Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc7be107 authored by Christopher Tate's avatar Christopher Tate
Browse files

Once we decide to show Home settings, keep it shown forever

Principle of Least Surprise FTW.

Bug 11131794

Change-Id: I1df720fa86fb870aa74a5d0074ca966843317f12
parent 1955bf1b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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";

+8 −0
Original line number Diff line number Diff line
@@ -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;
    }