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

Commit d8a19718 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add null check to destroyUiAutomationService"

parents 7f05818a c0c7efc4
Loading
Loading
Loading
Loading
+14 −13
Original line number Diff line number Diff line
@@ -64,10 +64,8 @@ class UiAutomationManager {
                public void binderDied() {
                    mUiAutomationServiceOwner.unlinkToDeath(this, 0);
                    mUiAutomationServiceOwner = null;
                    if (mUiAutomationService != null) {
                    destroyUiAutomationService();
                }
                }
            };

    /**
@@ -201,19 +199,22 @@ class UiAutomationManager {

    private void destroyUiAutomationService() {
        synchronized (mLock) {
            mUiAutomationService.mServiceInterface.asBinder().unlinkToDeath(mUiAutomationService,
                    0);
            if (mUiAutomationService != null) {
                mUiAutomationService.mServiceInterface.asBinder().unlinkToDeath(
                        mUiAutomationService, 0);
                mUiAutomationService.onRemoved();
                mUiAutomationService.resetLocked();
                mUiAutomationService = null;
                mUiAutomationFlags = 0;
                if (mUiAutomationServiceOwner != null) {
                mUiAutomationServiceOwner.unlinkToDeath(mUiAutomationServiceOwnerDeathRecipient, 0);
                    mUiAutomationServiceOwner.unlinkToDeath(
                            mUiAutomationServiceOwnerDeathRecipient, 0);
                    mUiAutomationServiceOwner = null;
                }
                mSystemSupport.onClientChangeLocked(false);
            }
        }
    }

    private class UiAutomationService extends AbstractAccessibilityServiceConnection {
        private final Handler mMainHandler;