Avoid LockSettingsService NPE during CTS due to races around user removal.
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.ManagedProfileTest Fixes: 125421639 Change-Id: Ie015748f4ef54a8de9ad143df2fe1b0f40976f40
This commit is contained in:
@@ -1966,7 +1966,8 @@ public class LockSettingsService extends ILockSettings.Stub {
|
||||
} catch (RemoteException ex) {
|
||||
Slog.w(TAG, "unable to clear GK secure user id");
|
||||
}
|
||||
if (unknownUser || mUserManager.getUserInfo(userId).isManagedProfile()) {
|
||||
UserInfo userInfo = mUserManager.getUserInfo(userId);
|
||||
if (unknownUser || userInfo == null || userInfo.isManagedProfile()) {
|
||||
removeKeystoreProfileKey(userId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user