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

Commit 419036b5 authored by Svetoslav's avatar Svetoslav
Browse files

Invalid accessibility state if UI test process crashes in a bad time.

We allow a fake accessibility service to connect to the system for UI
automation. If the process hosting the fake service dies right after
registering it, the accessibility layer ends up in a bad state and
subsequent attempts to connect UI automation service fail.

bug:17725904

Change-Id: Idad288eab41bbdd486d95e1e5803220640653fb7
parent d1462247
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1982,7 +1982,15 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
            } else {
                userState.mBindingServices.add(mComponentName);
                mService = userState.mUiAutomationServiceClient.asBinder();
                mMainHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        // Simulate asynchronous connection since in onServiceConnected
                        // we may modify the state data in case of an error but bind is
                        // called while iterating over the data and bad things can happen.
                        onServiceConnected(mComponentName, mService);
                    }
                });
                userState.mUiAutomationService = this;
            }
            return false;