diff options
author | Kenny Guy <kennyguy@google.com> | 2015-02-05 15:27:27 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-05 15:27:27 +0000 |
commit | 1b8945942d912f68c30954144ade6558897181c4 (patch) | |
tree | a38798c08377affcb984d4d56d6f6b05dfa7f011 /services | |
parent | 79cc73a095d7d983d39bc1142cf2a9b1a0df8771 (diff) | |
parent | 8d12d3da15a92fde05256c51f8a3085ab9399c0f (diff) | |
download | frameworks_base-1b8945942d912f68c30954144ade6558897181c4.zip frameworks_base-1b8945942d912f68c30954144ade6558897181c4.tar.gz frameworks_base-1b8945942d912f68c30954144ade6558897181c4.tar.bz2 |
am 8d12d3da: Merge "Only switch user if current user is being wiped" into lmp-mr1-dev
* commit '8d12d3da15a92fde05256c51f8a3085ab9399c0f':
Only switch user if current user is being wiped
Diffstat (limited to 'services')
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index fd4c016..40e2056 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -3049,7 +3049,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { mHandler.post(new Runnable() { public void run() { try { - ActivityManagerNative.getDefault().switchUser(UserHandle.USER_OWNER); + IActivityManager am = ActivityManagerNative.getDefault(); + if (am.getCurrentUser().id == userHandle) { + am.switchUser(UserHandle.USER_OWNER); + } if (!mUserManager.removeUser(userHandle)) { Slog.w(LOG_TAG, "Couldn't remove user " + userHandle); } |