Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a8f2b10 authored by Fred Quintana's avatar Fred Quintana Committed by Android (Google) Code Review
Browse files

Merge "When in the Choose Account flow if the accounts list display was...

Merge "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."
parents 5a471818 2becf93d
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -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);