summaryrefslogtreecommitdiffstats
path: root/core/java/android/accounts
diff options
context:
space:
mode:
authorFred Quintana <fredq@google.com>2011-11-15 17:33:08 -0800
committerFred Quintana <fredq@google.com>2011-11-15 17:33:08 -0800
commit2becf93d275a1e678abedd16b88225d6cecf49e2 (patch)
treeaa8374bdf998915f3a45a4b2a2f4ae08f6b48b7a /core/java/android/accounts
parent527c44e8a455dd0fdef1aeb6d7d8f99bb0839295 (diff)
downloadframeworks_base-2becf93d275a1e678abedd16b88225d6cecf49e2.zip
frameworks_base-2becf93d275a1e678abedd16b88225d6cecf49e2.tar.gz
frameworks_base-2becf93d275a1e678abedd16b88225d6cecf49e2.tar.bz2
When in the Choose Account flow if the accounts list display was initially
skipped if the user cancels out of adding an account the flow itself should be canceled rather than showing the accounts list display. Bug: 5599693 Change-Id: I5075e86656e237dddcb5e1d76e432e1cf525ab79
Diffstat (limited to 'core/java/android/accounts')
-rw-r--r--core/java/android/accounts/ChooseTypeAndAccountActivity.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/accounts/ChooseTypeAndAccountActivity.java b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
index c3c9d16..136c68c 100644
--- a/core/java/android/accounts/ChooseTypeAndAccountActivity.java
+++ b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
@@ -216,7 +216,7 @@ public class ChooseTypeAndAccountActivity extends Activity
if (mPendingRequest == REQUEST_NULL) {
// If there are no allowable accounts go directly to add account
- if (mAccountInfos.isEmpty()) {
+ if (shouldSkipToChooseAccountTypeFlow()) {
startChooseAccountTypeActivity();
return;
}
@@ -265,6 +265,12 @@ public class ChooseTypeAndAccountActivity extends Activity
mPendingRequest = REQUEST_NULL;
if (resultCode == RESULT_CANCELED) {
+ // if cancelling out of addAccount and the original state caused us to skip this,
+ // finish this activity
+ if (shouldSkipToChooseAccountTypeFlow()) {
+ setResult(Activity.RESULT_CANCELED);
+ finish();
+ }
return;
}
@@ -318,6 +324,14 @@ public class ChooseTypeAndAccountActivity extends Activity
finish();
}
+ /**
+ * convenience method to check if we should skip the accounts list display and immediately
+ * jump to the flow that asks the user to select from the account type list
+ */
+ private boolean shouldSkipToChooseAccountTypeFlow() {
+ return mAccountInfos.isEmpty();
+ }
+
protected void runAddAccountForAuthenticator(String type) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "runAddAccountForAuthenticator: " + type);