summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/accessibility
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2013-04-15 12:10:36 -0700
committerSvetoslav <svetoslavganov@google.com>2013-04-15 12:16:20 -0700
commit072906eef827cd8d92b48f79975d4f2e21d1c958 (patch)
treef8b06d652006e7704cc5d154560e79a68490c27e /services/java/com/android/server/accessibility
parent8d4c23b9c32f8c0328ebca538bb801716fe4478a (diff)
downloadframeworks_base-072906eef827cd8d92b48f79975d4f2e21d1c958.zip
frameworks_base-072906eef827cd8d92b48f79975d4f2e21d1c958.tar.gz
frameworks_base-072906eef827cd8d92b48f79975d4f2e21d1c958.tar.bz2
Fully setup newly bound service before state management.
If the connected service is not entirely setup when calling the method for handling a change in the current user state we get a potential NPE since the management method may have discarded the service, thus nullifying the connection to it. Now the service is fully configured before calling the state change management method. bug:8600489 Change-Id: Ib0bf7c6d575e15c620da419d43ece22f4187fd34
Diffstat (limited to 'services/java/com/android/server/accessibility')
-rw-r--r--services/java/com/android/server/accessibility/AccessibilityManagerService.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
index 110c4da..ac4f970 100644
--- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -1817,11 +1817,13 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
addServiceLocked(this, userState);
if (userState.mBindingServices.contains(mComponentName)) {
userState.mBindingServices.remove(mComponentName);
- onUserStateChangedLocked(userState);
try {
- mServiceInterface.setConnection(this, mId);
+ mServiceInterface.setConnection(this, mId);
+ onUserStateChangedLocked(userState);
} catch (RemoteException re) {
- Slog.w(LOG_TAG, "Error while setting connection for service: " + service, re);
+ Slog.w(LOG_TAG, "Error while setting connection for service: "
+ + service, re);
+ binderDied();
}
} else {
binderDied();