summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorKenny Guy <kennyguy@google.com>2015-02-05 15:27:27 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-05 15:27:27 +0000
commit1b8945942d912f68c30954144ade6558897181c4 (patch)
treea38798c08377affcb984d4d56d6f6b05dfa7f011 /services
parent79cc73a095d7d983d39bc1142cf2a9b1a0df8771 (diff)
parent8d12d3da15a92fde05256c51f8a3085ab9399c0f (diff)
downloadframeworks_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.java5
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);
}