summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubin Xu <rubinxu@google.com>2016-11-22 15:18:32 +0000
committergitbuildkicker <android-build@google.com>2016-11-28 15:34:06 -0800
commitad760e111ca844c84d3be5eb5a2e51124320f151 (patch)
tree5cf871dc6f2c74f12bf975a539aaf31260e87790
parent3570784fa5e7975a1bd8e01883b58676546b8d90 (diff)
downloadbase-ad760e111ca844c84d3be5eb5a2e51124320f151.tar.gz
Fix boot loop when upgrading direclty from L to N
A second attempt to fix the upgrade problem due to SID == 0 in the above upgrade path. The previous fix contains a bug where it would cause future attempts to unify work challenge to silently fail, and crash SystemUi when unlocking. This fix adds a check for non-zero SID before doing the initial work profile unification (which caused the upgrade crash when SID == 0). This means the initial work profile unification would only happen when the user has unlocked the lockscreen and SID is generated. Bug: 32490092 Bug: 33050562 Change-Id: Ib28951b2ec26b4f091df7763d9902f55616fcb5c (cherry picked from commit bfc7faaf353ea75ab04e986edbc79478679d40f6)
-rw-r--r--services/core/java/com/android/server/LockSettingsService.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java
index a91e2053c01d..03744f838036 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/LockSettingsService.java
@@ -240,6 +240,17 @@ public class LockSettingsService extends ILockSettings.Stub {
if (DEBUG) Slog.v(TAG, "Parent does not have a screen lock");
return;
}
+ // Do not tie when the parent has no SID (but does have a screen lock).
+ // This can only happen during an upgrade path where SID is yet to be
+ // generated when the user unlocks for the first time.
+ try {
+ if (getGateKeeperService().getSecureUserId(parentId) == 0) {
+ return;
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to talk to GateKeeper service", e);
+ return;
+ }
if (DEBUG) Slog.v(TAG, "Tie managed profile to parent now!");
byte[] randomLockSeed = new byte[] {};
try {