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

Commit 2becf93d authored by Fred Quintana's avatar Fred Quintana
Browse files

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
parent 527c44e8
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);