Commit e60e9300 authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Commit Bot

Fix crash when AccountManagementFragment is destroyed before adding an account

When AccountManagementFragment is destroyed after pressing add account in
account picker it is not attached to any intent and causes crash on asynchronous
call to AccountManagerFacade.createAddAccountIntent(). This cl should fix that
crash.

Bug: 1006682
Change-Id: I3c1f5be77cf279d7ad740d220297b11027844031
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1817607
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699756}
parent 3cd9ead2
......@@ -310,6 +310,8 @@ public class AccountManagementFragment extends PreferenceFragmentCompat
SigninUtils.logEvent(ProfileAccountManagementMetrics.ADD_ACCOUNT, mGaiaServiceType);
AccountManagerFacade.get().createAddAccountIntent((@Nullable Intent intent) -> {
if (!isVisible() || !isResumed()) return;
if (intent != null) {
startActivity(intent);
return;
......
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