Merge "[RESTRICT AUTOMERGE] Make Lock task default consistent w/ Settings (oc)." into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4c9fa739ff
@@ -4566,19 +4566,12 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
|
|||||||
mLockTaskNotify = new LockTaskNotify(mService.mContext);
|
mLockTaskNotify = new LockTaskNotify(mService.mContext);
|
||||||
}
|
}
|
||||||
mLockTaskNotify.show(false);
|
mLockTaskNotify.show(false);
|
||||||
try {
|
if (mLockTaskModeState == LOCK_TASK_MODE_PINNED && shouldLockKeyguard()) {
|
||||||
boolean shouldLockKeyguard = Settings.Secure.getInt(
|
|
||||||
mService.mContext.getContentResolver(),
|
|
||||||
Settings.Secure.LOCK_TO_APP_EXIT_LOCKED) != 0;
|
|
||||||
if (mLockTaskModeState == LOCK_TASK_MODE_PINNED && shouldLockKeyguard) {
|
|
||||||
mWindowManager.lockNow(null);
|
mWindowManager.lockNow(null);
|
||||||
mWindowManager.dismissKeyguard(null /* callback */);
|
mWindowManager.dismissKeyguard(null /* callback */);
|
||||||
new LockPatternUtils(mService.mContext)
|
new LockPatternUtils(mService.mContext)
|
||||||
.requireCredentialEntry(UserHandle.USER_ALL);
|
.requireCredentialEntry(UserHandle.USER_ALL);
|
||||||
}
|
}
|
||||||
} catch (SettingNotFoundException e) {
|
|
||||||
// No setting, don't lock.
|
|
||||||
}
|
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
throw new RuntimeException(ex);
|
throw new RuntimeException(ex);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -4609,11 +4602,25 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean shouldLockKeyguard() {
|
||||||
|
// This functionality should be kept consistent with
|
||||||
|
// com.android.settings.security.ScreenPinningSettings (see b/127605586)
|
||||||
|
try {
|
||||||
|
return Settings.Secure.getInt(
|
||||||
|
mService.mContext.getContentResolver(),
|
||||||
|
Settings.Secure.LOCK_TO_APP_EXIT_LOCKED) != 0;
|
||||||
|
} catch (Settings.SettingNotFoundException e) {
|
||||||
|
// Log to SafetyNet for b/127605586
|
||||||
|
android.util.EventLog.writeEvent(0x534e4554, "127605586", -1, "");
|
||||||
|
LockPatternUtils lockPatternUtils = new LockPatternUtils(mService.mContext);
|
||||||
|
return lockPatternUtils.isSecure(mCurrentUser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class ActivityContainer extends android.app.IActivityContainer.Stub {
|
class ActivityContainer extends android.app.IActivityContainer.Stub {
|
||||||
final static int FORCE_NEW_TASK_FLAGS = FLAG_ACTIVITY_NEW_TASK |
|
final static int FORCE_NEW_TASK_FLAGS = FLAG_ACTIVITY_NEW_TASK |
|
||||||
FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION;
|
FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION;
|
||||||
|
|||||||
Reference in New Issue
Block a user