diff options
Diffstat (limited to 'services/java/com/android/server/accessibility')
-rw-r--r-- | services/java/com/android/server/accessibility/AccessibilityManagerService.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java index 0ab56df..fd6b467 100644 --- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -195,6 +195,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { private int mCurrentUserId = UserHandle.USER_OWNER; + //TODO: Remove this hack + private boolean mInitialized; + private UserState getCurrentUserStateLocked() { return getUserStateLocked(mCurrentUserId); } @@ -771,6 +774,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { private void switchUser(int userId) { synchronized (mLock) { + if (mCurrentUserId == userId && mInitialized) { + return; + } + // Disconnect from services for the old user. UserState oldUserState = getUserStateLocked(mCurrentUserId); oldUserState.onSwitchToAnotherUser(); @@ -1283,6 +1290,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } private void onUserStateChangedLocked(UserState userState) { + // TODO: Remove this hack + mInitialized = true; updateLegacyCapabilities(userState); updateServicesLocked(userState); updateFilterKeyEventsLocked(userState); |