LineageSettingsActivity: Account for user stored KeyDisabler setting

* This ensures the proper switch status is set
   when migrating from older versions

Change-Id: Ie6b79a5269418ec7eae205e30558449098202e54
This commit is contained in:
Bruno Martins
2019-01-18 10:42:41 +00:00
parent e159adc164
commit 0277e73429

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017-2018 The LineageOS Project
* Copyright (C) 2017-2019 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -127,8 +127,8 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
mNavKeys = (CheckBox) findViewById(R.id.nav_keys_checkbox);
mSupportsKeyDisabler = isKeyDisablerSupported(this);
if (mSupportsKeyDisabler) {
boolean navKeysDisabled = isKeyDisablerActive(this);
mNavKeys.setChecked(navKeysDisabled);
mNavKeys.setChecked(LineageSettings.System.getIntForUser(getContentResolver(),
LineageSettings.System.FORCE_SHOW_NAVBAR, 0, UserHandle.USER_CURRENT) != 0);
} else {
navKeysRow.setVisibility(View.GONE);
}
@@ -216,9 +216,4 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
final LineageHardwareManager hardware = LineageHardwareManager.getInstance(context);
return hardware.isSupported(LineageHardwareManager.FEATURE_KEY_DISABLE);
}
private static boolean isKeyDisablerActive(Context context) {
final LineageHardwareManager hardware = LineageHardwareManager.getInstance(context);
return hardware.get(LineageHardwareManager.FEATURE_KEY_DISABLE);
}
}