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

Commit 6c2dd2f4 authored by Bruno Martins's avatar Bruno Martins
Browse files

FinishActivity: Do not write the currently set FORCE_SHOW_NAVBAR value

 * Check if the value for the setting is already applied and do not
   attempt to write it again. During the testing of SuW it was found out
   that there can be an edgecase where softkeys don't show up neither
   hardware keys work, even though the setting is applied (judging
   by the status of the KeyDisabler switch).

Change-Id: I902f26fe131e508974116f7607fd0b88921395d9
parent 38728306
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -210,8 +210,14 @@ public class FinishActivity extends BaseSetupWizardActivity {
    private static void writeDisableNavkeysOption(Context context, boolean enabled) {
        final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

        final boolean virtualKeysEnabled = LineageSettings.System.getIntForUser(
                    context.getContentResolver(), LineageSettings.System.FORCE_SHOW_NAVBAR, 0,
                    UserHandle.USER_CURRENT) != 0;
        if (enabled != virtualKeysEnabled) {
            LineageSettings.System.putIntForUser(context.getContentResolver(),
                LineageSettings.System.FORCE_SHOW_NAVBAR, enabled ? 1 : 0, UserHandle.USER_CURRENT);
                    LineageSettings.System.FORCE_SHOW_NAVBAR, enabled ? 1 : 0,
                    UserHandle.USER_CURRENT);
        }

        /* Save/restore button timeouts to disable them in softkey mode */
        if (enabled) {