Bug 1401318 - Make sure account won't be null when it's processed by Android APIs r=nalexander

MozReview-Commit-ID: EVHzQngUykm

--HG--
extra : rebase_source : e06c0585f05977670fb4abc2dfb16474b1dfe433
This commit is contained in:
Grigory Kruglov 2017-09-20 18:48:42 -04:00
Родитель f2388d9cda
Коммит 849e872d8a
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -1075,7 +1075,8 @@ public class AndroidFxAccount {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void doOptionalProfileRename21Plus(final String newEmail, final Runnable migrateSyncSettingsCallback, final Runnable callback) {
accountManager.renameAccount(account, newEmail, new AccountManagerCallback<Account>() {
final Account currentAccount = new Account(account.name, account.type);
accountManager.renameAccount(currentAccount, newEmail, new AccountManagerCallback<Account>() {
@Override
public void run(AccountManagerFuture<Account> future) {
if (future.isCancelled()) {
@ -1127,7 +1128,8 @@ public class AndroidFxAccount {
accountManager.setUserData(account, ACCOUNT_KEY_RENAME_IN_PROGRESS, ACCOUNT_VALUE_RENAME_IN_PROGRESS);
// Then, remove current account.
accountManager.removeAccount(account, new AccountManagerCallback<Boolean>() {
final Account currentAccount = new Account(account.name, account.type);
accountManager.removeAccount(currentAccount, new AccountManagerCallback<Boolean>() {
@Override
public void run(AccountManagerFuture<Boolean> future) {
boolean accountRemovalSucceeded = false;