Skip to content

Commit 6b491b6

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "Invalid accessibility state if UI test process crashes in a bad time." into lmp-dev
2 parents 86ef70e + 419036b commit 6b491b6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2004,7 +2004,15 @@ mIntent, this, Context.BIND_AUTO_CREATE, new UserHandle(mUserId))) {
20042004
} else {
20052005
userState.mBindingServices.add(mComponentName);
20062006
mService = userState.mUiAutomationServiceClient.asBinder();
2007-
onServiceConnected(mComponentName, mService);
2007+
mMainHandler.post(new Runnable() {
2008+
@Override
2009+
public void run() {
2010+
// Simulate asynchronous connection since in onServiceConnected
2011+
// we may modify the state data in case of an error but bind is
2012+
// called while iterating over the data and bad things can happen.
2013+
onServiceConnected(mComponentName, mService);
2014+
}
2015+
});
20082016
userState.mUiAutomationService = this;
20092017
}
20102018
return false;

0 commit comments

Comments
 (0)