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

Commit eff0927d authored by Christopher Tate's avatar Christopher Tate Committed by Android (Google) Code Review
Browse files

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

parents 1673fbc0 dc7be107
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;
    }