Merge "Once we decide to show Home settings, keep it shown forever" into klp-dev

This commit is contained in:
Christopher Tate
2013-10-08 21:20:13 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 1 deletions

View File

@@ -49,7 +49,8 @@ public class HomeSettings extends SettingsPreferenceFragment {
static final int REQUESTING_UNINSTALL = 10;
public static final String CURRENT_HOME = "current_home";
public static final String HOME_PREFS = "home_prefs";
public static final String HOME_PREFS_DO_SHOW = "do_show";
public static final String HOME_SHOW_NOTICE = "show";

View File

@@ -686,6 +686,12 @@ public class Settings extends PreferenceActivity
}
private boolean updateHomeSettingHeaders(Header header) {
// Once we decide to show Home settings, keep showing it forever
SharedPreferences sp = getSharedPreferences(HomeSettings.HOME_PREFS, Context.MODE_PRIVATE);
if (sp.getBoolean(HomeSettings.HOME_PREFS_DO_SHOW, false)) {
return true;
}
try {
final ArrayList<ResolveInfo> homeApps = new ArrayList<ResolveInfo>();
getPackageManager().getHomeActivities(homeApps);
@@ -712,6 +718,8 @@ public class Settings extends PreferenceActivity
// Can't look up the home activity; bail on configuring the icon
Log.w(LOG_TAG, "Problem looking up home activity!", e);
}
sp.edit().putBoolean(HomeSettings.HOME_PREFS_DO_SHOW, true).apply();
return true;
}