Merge "Fix the concurrency issue when 'linkToDeath' in AccountManagerService that leads to JE" into main

This commit is contained in:
Dmitry Dementyev
2023-07-21 20:47:47 +00:00
committed by Gerrit Code Review

View File

@@ -4854,7 +4854,6 @@ public class AccountManagerService
if (accountType == null) throw new IllegalArgumentException("accountType is null"); if (accountType == null) throw new IllegalArgumentException("accountType is null");
mAccounts = accounts; mAccounts = accounts;
mStripAuthTokenFromResult = stripAuthTokenFromResult; mStripAuthTokenFromResult = stripAuthTokenFromResult;
mResponse = response;
mAccountType = accountType; mAccountType = accountType;
mExpectActivityLaunch = expectActivityLaunch; mExpectActivityLaunch = expectActivityLaunch;
mCreationTime = SystemClock.elapsedRealtime(); mCreationTime = SystemClock.elapsedRealtime();
@@ -4868,8 +4867,8 @@ public class AccountManagerService
if (response != null) { if (response != null) {
try { try {
response.asBinder().linkToDeath(this, 0 /* flags */); response.asBinder().linkToDeath(this, 0 /* flags */);
mResponse = response;
} catch (RemoteException e) { } catch (RemoteException e) {
mResponse = null;
binderDied(); binderDied();
} }
} }