Once we decide to show Home settings, keep it shown forever
Principle of Least Surprise FTW. Bug 11131794 Change-Id: I1df720fa86fb870aa74a5d0074ca966843317f12
This commit is contained in:
@@ -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";
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user