Merge "Set the default value for Secure Settings: SKIP_GESTURE & SILENCE_GESTURE" into qt-dev
This commit is contained in:
@@ -229,4 +229,10 @@
|
|||||||
|
|
||||||
<!-- Default for Settings.Secure.AWARE_ENABLED -->
|
<!-- Default for Settings.Secure.AWARE_ENABLED -->
|
||||||
<bool name="def_aware_enabled">false</bool>
|
<bool name="def_aware_enabled">false</bool>
|
||||||
|
|
||||||
|
<!-- Default for Settings.Secure.SKIP_GESTURE -->
|
||||||
|
<bool name="def_skip_gesture">false</bool>
|
||||||
|
|
||||||
|
<!-- Default for Settings.Secure.SILENCE_GESTURE -->
|
||||||
|
<bool name="def_silence_gesture">false</bool>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -3237,7 +3237,7 @@ public class SettingsProvider extends ContentProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final class UpgradeController {
|
private final class UpgradeController {
|
||||||
private static final int SETTINGS_VERSION = 178;
|
private static final int SETTINGS_VERSION = 179;
|
||||||
|
|
||||||
private final int mUserId;
|
private final int mUserId;
|
||||||
|
|
||||||
@@ -4356,6 +4356,37 @@ public class SettingsProvider extends ContentProvider {
|
|||||||
currentVersion = 178;
|
currentVersion = 178;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentVersion == 178) {
|
||||||
|
// Version 178: Set the default value for Secure Settings:
|
||||||
|
// SKIP_GESTURE & SILENCE_GESTURE
|
||||||
|
|
||||||
|
final SettingsState secureSettings = getSecureSettingsLocked(userId);
|
||||||
|
|
||||||
|
final Setting skipGesture = secureSettings.getSettingLocked(
|
||||||
|
Secure.SKIP_GESTURE);
|
||||||
|
|
||||||
|
if (skipGesture.isNull()) {
|
||||||
|
final boolean defSkipGesture = getContext().getResources().getBoolean(
|
||||||
|
R.bool.def_skip_gesture);
|
||||||
|
secureSettings.insertSettingLocked(
|
||||||
|
Secure.SKIP_GESTURE, defSkipGesture ? "1" : "0",
|
||||||
|
null, true, SettingsState.SYSTEM_PACKAGE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
final Setting silenceGesture = secureSettings.getSettingLocked(
|
||||||
|
Secure.SILENCE_GESTURE);
|
||||||
|
|
||||||
|
if (silenceGesture.isNull()) {
|
||||||
|
final boolean defSilenceGesture = getContext().getResources().getBoolean(
|
||||||
|
R.bool.def_silence_gesture);
|
||||||
|
secureSettings.insertSettingLocked(
|
||||||
|
Secure.SILENCE_GESTURE, defSilenceGesture ? "1" : "0",
|
||||||
|
null, true, SettingsState.SYSTEM_PACKAGE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
currentVersion = 179;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// vXXX: Add new settings above this point.
|
// vXXX: Add new settings above this point.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user