diff options
| author | Svetoslav Ganov <svetoslavganov@google.com> | 2013-05-06 08:44:49 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2013-05-06 08:44:49 -0700 |
| commit | 4337e038a20b890885fbcb17e6b8b48da999849c (patch) | |
| tree | 877bd038ad0424d41d9edf905aafe8fd3daf63f9 /services/java/com/android/server/accessibility/AccessibilityManagerService.java | |
| parent | 2a44f8d102a60b1ccca780341cff0b0efb8f19ed (diff) | |
| parent | 62159c0d854737f8dc519fba01fd28adea26e57f (diff) | |
| download | frameworks_base-4337e038a20b890885fbcb17e6b8b48da999849c.zip frameworks_base-4337e038a20b890885fbcb17e6b8b48da999849c.tar.gz frameworks_base-4337e038a20b890885fbcb17e6b8b48da999849c.tar.bz2 | |
am 62159c0d: Merge "Multiple bindings to the same accessiblity serice if it dies." into jb-mr2-dev
* commit '62159c0d854737f8dc519fba01fd28adea26e57f':
Multiple bindings to the same accessiblity serice if it dies.
Diffstat (limited to 'services/java/com/android/server/accessibility/AccessibilityManagerService.java')
| -rw-r--r-- | services/java/com/android/server/accessibility/AccessibilityManagerService.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java index 138c51b..4ae9eb5 100644 --- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -1711,6 +1711,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { final KeyEventDispatcher mKeyEventDispatcher = new KeyEventDispatcher(); + boolean mWasConnectedAndDied; + // Handler only for dispatching accessibility events since we use event // types as message types allowing us to remove messages per event type. public Handler mEventDispatchHandler = new Handler(mMainHandler.getLooper()) { @@ -1865,8 +1867,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { mServiceInterface = IAccessibilityServiceClient.Stub.asInterface(service); UserState userState = getUserStateLocked(mUserId); addServiceLocked(this, userState); - if (userState.mBindingServices.contains(mComponentName)) { + if (userState.mBindingServices.contains(mComponentName) || mWasConnectedAndDied) { userState.mBindingServices.remove(mComponentName); + mWasConnectedAndDied = false; try { mServiceInterface.setConnection(this, mId); onUserStateChangedLocked(userState); @@ -2220,7 +2223,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { mServiceInterface = null; } - public boolean isInitializedLocked() { + public boolean isConnectedLocked() { return (mService != null); } @@ -2230,9 +2233,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { // whose handling the death recipient is unlinked and still get a call // on binderDied since the call was made before we unlink but was // waiting on the lock we held during the force stop handling. - if (!isInitializedLocked()) { + if (!isConnectedLocked()) { return; } + mWasConnectedAndDied = true; mKeyEventDispatcher.flush(); UserState userState = getUserStateLocked(mUserId); // The death recipient is unregistered in removeServiceLocked @@ -2245,7 +2249,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { userState.mEnabledServices.remove(mComponentName); userState.destroyUiAutomationService(); } - onUserStateChangedLocked(userState); } } |
