Skip to content

Commit 7fd9882

Browse files
committed
Accessibility layer in inconsistent state after running UI test automation tests.
1. The accessibility layer has a back door for a UI test automation code running from the shell to attach. The unregister code does an incorrect identity check and as a result the register UI test automation service is not disconnected until its process is killed. The fix is super safe and simple. bug:7409261 Change-Id: I4b1da18be6c5619dadd4a58fca6724529bc59dea
1 parent ead7d90 commit 7fd9882

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/java/com/android/server/accessibility/AccessibilityManagerService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,9 @@ public void temporaryEnableAccessibilityStateUntilKeyguardRemoved(
558558
public void unregisterUiTestAutomationService(IAccessibilityServiceClient serviceClient) {
559559
synchronized (mLock) {
560560
// Automation service is not bound, so pretend it died to perform clean up.
561-
if (mUiAutomationService != null
562-
&& mUiAutomationService.mServiceInterface == serviceClient) {
561+
if (mUiAutomationService != null && mUiAutomationService.mServiceInterface != null
562+
&& serviceClient != null && mUiAutomationService.mServiceInterface
563+
.asBinder() == serviceClient.asBinder()) {
563564
mUiAutomationService.binderDied();
564565
}
565566
}

0 commit comments

Comments
 (0)