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
This commit is contained in:
@@ -210,8 +210,14 @@ public class FinishActivity extends BaseSetupWizardActivity {
|
|||||||
private static void writeDisableNavkeysOption(Context context, boolean enabled) {
|
private static void writeDisableNavkeysOption(Context context, boolean enabled) {
|
||||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
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.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 */
|
/* Save/restore button timeouts to disable them in softkey mode */
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
|
Reference in New Issue
Block a user