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

Commit 983769ff authored by Dmitry Dementyev's avatar Dmitry Dementyev Committed by Automerger Merge Worker
Browse files

Merge "Toast: Fix the concurrency problem of mAuthenticator" am: a8438682...

Merge "Toast: Fix the concurrency problem of mAuthenticator" am: a8438682 am: adfda791 am: 087b9165

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2276161



Change-Id: I6088d6688e1afda926bd2f8446f76eff2ff3ef74
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents fc13cb1d 087b9165
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -4795,6 +4795,7 @@ public class AccountManagerService

    private abstract class Session extends IAccountAuthenticatorResponse.Stub
            implements IBinder.DeathRecipient, ServiceConnection {
        private final Object mSessionLock = new Object();
        IAccountManagerResponse mResponse;
        final String mAccountType;
        final boolean mExpectActivityLaunch;
@@ -4985,11 +4986,13 @@ public class AccountManagerService
        }

        private void unbind() {
            synchronized (mSessionLock) {
                if (mAuthenticator != null) {
                    mAuthenticator = null;
                    mContext.unbindService(this);
                }
            }
        }

        public void cancelTimeout() {
            mHandler.removeMessages(MESSAGE_TIMED_OUT, this);
@@ -4997,6 +5000,7 @@ public class AccountManagerService

        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
            synchronized (mSessionLock) {
                mAuthenticator = IAccountAuthenticator.Stub.asInterface(service);
                try {
                    run();
@@ -5005,6 +5009,7 @@ public class AccountManagerService
                            "remote exception");
                }
            }
        }

        @Override
        public void onServiceDisconnected(ComponentName name) {