To prepare for controlling from settings.
While here, add lock to app settings to backups.
Bug:
16957435
Change-Id: I059140cd07a7a0d5ceb4e0bfe5e0176cb96629d3
public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
/**
- * Whether lock-to-app will lock the keyguard when exiting.
- * @hide
- */
- public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
-
- /**
* I am the lolrus.
* <p>
* Nonzero values indicate that the user has a bukkit.
POINTER_SPEED,
VIBRATE_WHEN_RINGING,
RINGTONE,
+ LOCK_TO_APP_ENABLED,
NOTIFICATION_SOUND
};
"lock_biometric_weak_flags";
/**
+ * Whether lock-to-app will lock the keyguard when exiting.
+ * @hide
+ */
+ public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
+
+ /**
* Whether autolock is enabled (0 = false, 1 = true)
*/
public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
// is properly propagated through your change. Not doing so will result in a loss of user
// settings.
- private static final int DATABASE_VERSION = 116;
+ private static final int DATABASE_VERSION = 117;
private Context mContext;
private int mUserHandle;
upgradeVersion = 116;
}
+ if (upgradeVersion < 117) {
+ db.beginTransaction();
+ try {
+ String[] systemToSecure = {
+ Settings.Secure.LOCK_TO_APP_EXIT_LOCKED
+ };
+ moveSettingsToNewTable(db, TABLE_SYSTEM, TABLE_SECURE, systemToSecure, true);
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ }
+ upgradeVersion = 117;
+ }
+
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {
}
mLockTaskNotify.show(false);
try {
- boolean shouldLockKeyguard = Settings.System.getInt(
+ boolean shouldLockKeyguard = Settings.Secure.getInt(
mService.mContext.getContentResolver(),
- Settings.System.LOCK_TO_APP_EXIT_LOCKED) != 0;
+ Settings.Secure.LOCK_TO_APP_EXIT_LOCKED) != 0;
if (!mLockTaskIsLocked && shouldLockKeyguard) {
mWindowManager.lockNow(null);
mWindowManager.dismissKeyguard();
// Remember state.
try {
- boolean useLock = Settings.System.getInt(mContext.getContentResolver(),
- Settings.System.LOCK_TO_APP_EXIT_LOCKED) != 0;
+ boolean useLock = Settings.Secure.getInt(mContext.getContentResolver(),
+ Settings.Secure.LOCK_TO_APP_EXIT_LOCKED) != 0;
mCheckbox.setChecked(useLock);
} catch (SettingNotFoundException e) {
}
if (DialogInterface.BUTTON_POSITIVE == which) {
Slog.d(TAG, "accept lock-to-app request");
// Set whether to use the lock screen when exiting.
- Settings.System.putInt(mContext.getContentResolver(),
- Settings.System.LOCK_TO_APP_EXIT_LOCKED,
+ Settings.Secure.putInt(mContext.getContentResolver(),
+ Settings.Secure.LOCK_TO_APP_EXIT_LOCKED,
mCheckbox != null && mCheckbox.isChecked() ? 1 : 0);
// Start lock-to-app.