summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCostin Manolache <costin@google.com>2011-01-25 16:13:12 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-01-25 16:13:12 -0800
commitb324911b473d20d10c0107273721791bc8b04568 (patch)
treeeee41572d24a98370d4c6a0e073654d912a20e59
parentcf2b9ca11ab493728fe75c1ffcd6bc2e273e1d55 (diff)
parentd606045070dcf6a011e49a7711d2f17d8f2de8c1 (diff)
downloadframeworks_base-b324911b473d20d10c0107273721791bc8b04568.zip
frameworks_base-b324911b473d20d10c0107273721791bc8b04568.tar.gz
frameworks_base-b324911b473d20d10c0107273721791bc8b04568.tar.bz2
Merge "If 'customTokens', let authenticator handle notification." into honeycomb
-rw-r--r--core/java/android/accounts/AccountManager.java7
-rw-r--r--core/java/android/accounts/AccountManagerService.java5
2 files changed, 11 insertions, 1 deletions
diff --git a/core/java/android/accounts/AccountManager.java b/core/java/android/accounts/AccountManager.java
index 6388dc5..5bdc79d 100644
--- a/core/java/android/accounts/AccountManager.java
+++ b/core/java/android/accounts/AccountManager.java
@@ -195,6 +195,13 @@ public class AccountManager {
public static final String KEY_CALLER_UID = "callerUid";
public static final String KEY_CALLER_PID = "callerPid";
+ /**
+ * Boolean, if set and 'customTokens' the authenticator is responsible for
+ * notifications.
+ * @hide
+ */
+ public static final String KEY_NOTIFY_ON_FAILURE = "notifyOnAuthFailure";
+
public static final String ACTION_AUTHENTICATOR_INTENT =
"android.accounts.AccountAuthenticator";
public static final String AUTHENTICATOR_META_DATA_NAME =
diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java
index 2c99f14..fb16609 100644
--- a/core/java/android/accounts/AccountManagerService.java
+++ b/core/java/android/accounts/AccountManagerService.java
@@ -897,6 +897,9 @@ public class AccountManagerService
// let authenticator know the identity of the caller
loginOptions.putInt(AccountManager.KEY_CALLER_UID, callerUid);
loginOptions.putInt(AccountManager.KEY_CALLER_PID, callerPid);
+ if (notifyOnAuthFailure) {
+ loginOptions.putBoolean(AccountManager.KEY_NOTIFY_ON_FAILURE, true);
+ }
}
long identityToken = clearCallingIdentity();
@@ -964,7 +967,7 @@ public class AccountManagerService
}
Intent intent = result.getParcelable(AccountManager.KEY_INTENT);
- if (intent != null && notifyOnAuthFailure) {
+ if (intent != null && notifyOnAuthFailure && !customTokens) {
doNotification(
account, result.getString(AccountManager.KEY_AUTH_FAILED_MESSAGE),
intent);