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

Commit 8fb65568 authored by JW Wang's avatar JW Wang Committed by Android (Google) Code Review
Browse files

Merge "mService.unlinkToDeath might be called without having linkToDeath"

parents adfeaa0b 6009ac66
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -239,16 +239,18 @@ class UiAutomationManager {
            mMainHandler.post(() -> {
                try {
                    final IAccessibilityServiceClient serviceInterface;
                    final IBinder service;
                    synchronized (mLock) {
                        serviceInterface = mServiceInterface;
                        mService = (serviceInterface == null) ? null : mServiceInterface.asBinder();
                        service = mService;
                        if (serviceInterface == null) {
                            mService = null;
                        } else {
                            mService = mServiceInterface.asBinder();
                            mService.linkToDeath(this, 0);
                        }
                    }
                    // If the serviceInterface is null, the UiAutomation has been shut down on
                    // another thread.
                    if (serviceInterface != null) {
                        service.linkToDeath(this, 0);
                        serviceInterface.init(this, mId,
                                mOverlayWindowTokens.get(Display.DEFAULT_DISPLAY));
                    }