Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b10804a9 authored by Svetoslav's avatar Svetoslav Committed by Android Git Automerger
Browse files

am 0cb0a37f: am a0b9e1ee: am 99e4a0f5: Merge "Improper initialization of the...

am 0cb0a37f: am a0b9e1ee: am 99e4a0f5: Merge "Improper initialization of the accessibility manager service." into jb-mr2-dev

* commit '0cb0a37f':
  Improper initialization of the accessibility manager service.
parents a5df9aa4 0cb0a37f
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -195,6 +195,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {


    private int mCurrentUserId = UserHandle.USER_OWNER;
    private int mCurrentUserId = UserHandle.USER_OWNER;


    //TODO: Remove this hack
    private boolean mInitialized;

    private UserState getCurrentUserStateLocked() {
    private UserState getCurrentUserStateLocked() {
        return getUserStateLocked(mCurrentUserId);
        return getUserStateLocked(mCurrentUserId);
    }
    }
@@ -771,6 +774,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {


    private void switchUser(int userId) {
    private void switchUser(int userId) {
        synchronized (mLock) {
        synchronized (mLock) {
            if (mCurrentUserId == userId && mInitialized) {
                return;
            }

            // Disconnect from services for the old user.
            // Disconnect from services for the old user.
            UserState oldUserState = getUserStateLocked(mCurrentUserId);
            UserState oldUserState = getUserStateLocked(mCurrentUserId);
            oldUserState.onSwitchToAnotherUser();
            oldUserState.onSwitchToAnotherUser();
@@ -1283,6 +1290,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
    }
    }


    private void onUserStateChangedLocked(UserState userState) {
    private void onUserStateChangedLocked(UserState userState) {
        // TODO: Remove this hack
        mInitialized = true;
        updateLegacyCapabilities(userState);
        updateLegacyCapabilities(userState);
        updateServicesLocked(userState);
        updateServicesLocked(userState);
        updateFilterKeyEventsLocked(userState);
        updateFilterKeyEventsLocked(userState);