Commit 30deeace authored by Boris Sazonov's avatar Boris Sazonov Committed by Commit Bot

[Signin][Android] Fix add account flow

Fixes "add account" flow in AccountManagementFragment that was broken by
https://crrev.com/c/1817607.
Before: Activity is finished right after the preference is clicked.
    Thus, isResumed check in createAddAccountIntent returns false and
    the intent is not started.
After: Activity is finished from createAddAccountIntent callback, so
    isResumed check passes.

Bug: 1036777
Change-Id: Ieaf443adf586eb1dd5949eca021ee9b499201bb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1982556
Auto-Submit: Boris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarJérôme Lebel <jlebel@chromium.org>
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727751}
parent 5e843b0f
......@@ -318,19 +318,17 @@ public class AccountManagementFragment extends PreferenceFragmentCompat
if (intent != null) {
startActivity(intent);
return;
} else {
// AccountManagerFacade couldn't create intent, use SigninUtils to open settings
// instead.
SigninUtils.openSettingsForAllAccounts(getActivity());
}
// AccountManagerFacade couldn't create intent, use SigninUtils to open settings
// instead.
SigninUtils.openSettingsForAllAccounts(getActivity());
// Return to the last opened tab if triggered from the content area.
if (mGaiaServiceType != GAIAServiceType.GAIA_SERVICE_TYPE_NONE) {
if (isAdded()) getActivity().finish();
}
});
// Return to the last opened tab if triggered from the content area.
if (mGaiaServiceType != GAIAServiceType.GAIA_SERVICE_TYPE_NONE) {
if (isAdded()) getActivity().finish();
}
return true;
});
addAccountPreference.setManagedPreferenceDelegate(preference -> !canAddAccounts());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment