Merge "Move LOCK_TO_APP_EXIT_LOCKED from System to Secure" into lmp-mr1-dev
This commit is contained in:
@@ -2624,12 +2624,6 @@ public final class Settings {
|
||||
*/
|
||||
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>
|
||||
@@ -2704,6 +2698,7 @@ public final class Settings {
|
||||
POINTER_SPEED,
|
||||
VIBRATE_WHEN_RINGING,
|
||||
RINGTONE,
|
||||
LOCK_TO_APP_ENABLED,
|
||||
NOTIFICATION_SOUND
|
||||
};
|
||||
|
||||
@@ -3665,6 +3660,12 @@ public final class Settings {
|
||||
public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
|
||||
"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)
|
||||
*/
|
||||
|
||||
@@ -71,7 +71,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
// 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;
|
||||
@@ -1865,6 +1865,20 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
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) {
|
||||
|
||||
@@ -3546,9 +3546,9 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
||||
}
|
||||
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();
|
||||
|
||||
@@ -112,8 +112,8 @@ public class LockToAppRequestDialog implements OnClickListener {
|
||||
|
||||
// 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) {
|
||||
}
|
||||
@@ -127,8 +127,8 @@ public class LockToAppRequestDialog implements OnClickListener {
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user