summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/accounts/AccountManagerService.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2013-04-10 17:36:26 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-04-10 17:36:26 -0700
commit18a21459729ba6fd40545ee7ed2128dcb83eb23f (patch)
tree3d9369a8761ad48bc101acd8f287cebbe7d74315 /services/java/com/android/server/accounts/AccountManagerService.java
parent3f4e82b1909615f5c75d84104cb09e019c8bfdae (diff)
parent399a2977a5067e4ea562ad4d74aaa0f1bffe4c53 (diff)
am 399a2977: am b3a98725: Merge "Show an error dialog when account type is requested on a limited user" into jb-mr2-dev
* commit '399a2977a5067e4ea562ad4d74aaa0f1bffe4c53': Show an error dialog when account type is requested on a limited user
Diffstat (limited to 'services/java/com/android/server/accounts/AccountManagerService.java')
-rw-r--r--services/java/com/android/server/accounts/AccountManagerService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/java/com/android/server/accounts/AccountManagerService.java b/services/java/com/android/server/accounts/AccountManagerService.java
index e8251d629e24..55fe1c71e453 100644
--- a/services/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/java/com/android/server/accounts/AccountManagerService.java
@@ -22,6 +22,7 @@ import android.accounts.AccountAndUser;
import android.accounts.AccountAuthenticatorResponse;
import android.accounts.AccountManager;
import android.accounts.AuthenticatorDescription;
+import android.accounts.CantAddAccountActivity;
import android.accounts.GrantCredentialsPermissionActivity;
import android.accounts.IAccountAuthenticator;
import android.accounts.IAccountAuthenticatorResponse;
@@ -1456,6 +1457,14 @@ public class AccountManagerService
"User is not allowed to add an account!");
} catch (RemoteException re) {
}
+ Intent cantAddAccount = new Intent(mContext, CantAddAccountActivity.class);
+ cantAddAccount.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ long identityToken = clearCallingIdentity();
+ try {
+ mContext.startActivityAsUser(cantAddAccount, UserHandle.CURRENT);
+ } finally {
+ restoreCallingIdentity(identityToken);
+ }
return;
}