summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2014-09-23 01:09:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-23 01:09:11 +0000
commitfee7ad16191bb0fb7f09648cb2e00cda97c020b6 (patch)
tree01aa0aef87c95b9db1c5da5bc0eba3a1931c8a1f /services
parentc7437dd7c0fd90757698934d199fe864b40254e1 (diff)
parentae7034aaf092adb52e7d1b5b86b2986e91295b9f (diff)
downloadframeworks_base-fee7ad16191bb0fb7f09648cb2e00cda97c020b6.zip
frameworks_base-fee7ad16191bb0fb7f09648cb2e00cda97c020b6.tar.gz
frameworks_base-fee7ad16191bb0fb7f09648cb2e00cda97c020b6.tar.bz2
Merge "Fix regression in launching CantAddAccountActivity for correct user" into lmp-dev
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/accounts/AccountManagerService.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index 888fa1a..d480f68 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -1787,7 +1787,7 @@ public class AccountManagerService
"User is not allowed to add an account!");
} catch (RemoteException re) {
}
- showCantAddAccount(AccountManager.ERROR_CODE_USER_RESTRICTED);
+ showCantAddAccount(AccountManager.ERROR_CODE_USER_RESTRICTED, userId);
return;
}
if (!canUserModifyAccountsForType(userId, accountType)) {
@@ -1796,7 +1796,8 @@ public class AccountManagerService
"User cannot modify accounts of this type (policy).");
} catch (RemoteException re) {
}
- showCantAddAccount(AccountManager.ERROR_CODE_MANAGEMENT_DISABLED_FOR_ACCOUNT_TYPE);
+ showCantAddAccount(AccountManager.ERROR_CODE_MANAGEMENT_DISABLED_FOR_ACCOUNT_TYPE,
+ userId);
return;
}
@@ -1861,7 +1862,7 @@ public class AccountManagerService
"User is not allowed to add an account!");
} catch (RemoteException re) {
}
- showCantAddAccount(AccountManager.ERROR_CODE_USER_RESTRICTED);
+ showCantAddAccount(AccountManager.ERROR_CODE_USER_RESTRICTED, userId);
return;
}
if (!canUserModifyAccountsForType(userId, accountType)) {
@@ -1870,7 +1871,8 @@ public class AccountManagerService
"User cannot modify accounts of this type (policy).");
} catch (RemoteException re) {
}
- showCantAddAccount(AccountManager.ERROR_CODE_MANAGEMENT_DISABLED_FOR_ACCOUNT_TYPE);
+ showCantAddAccount(AccountManager.ERROR_CODE_MANAGEMENT_DISABLED_FOR_ACCOUNT_TYPE,
+ userId);
return;
}
@@ -1906,13 +1908,13 @@ public class AccountManagerService
}
}
- private void showCantAddAccount(int errorCode) {
+ private void showCantAddAccount(int errorCode, int userId) {
Intent cantAddAccount = new Intent(mContext, CantAddAccountActivity.class);
cantAddAccount.putExtra(CantAddAccountActivity.EXTRA_ERROR_CODE, errorCode);
cantAddAccount.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
long identityToken = clearCallingIdentity();
try {
- mContext.startActivity(cantAddAccount);
+ mContext.startActivityAsUser(cantAddAccount, new UserHandle(userId));
} finally {
restoreCallingIdentity(identityToken);
}