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

Commit 6d1b7c53 authored by Arthur Hung's avatar Arthur Hung
Browse files

Fix InTouchMode is not consistent between WMS and InputFlinger

Use getInTouchMode/setInTouchMode to access InTouchMode in WMS.

Test: atest TouchModeFocusChangeTest
Bug: 148002313
Change-Id: Iebea007f638624706ed91b6c17dcc73506d779ac
parent 1605af29
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -238,16 +238,12 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {

    @Override
    public void setInTouchMode(boolean mode) {
        synchronized (mService.mGlobalLock) {
            mService.mInTouchMode = mode;
        }
        mService.setInTouchMode(mode);
    }

    @Override
    public boolean getInTouchMode() {
        synchronized (mService.mGlobalLock) {
            return mService.mInTouchMode;
        }
        return mService.getInTouchMode();
    }

    @Override
+7 −1
Original line number Diff line number Diff line
@@ -938,7 +938,7 @@ public class WindowManagerService extends IWindowManager.Stub
     * Whether the UI is currently running in touch mode (not showing
     * navigational focus because the user is directly pressing the screen).
     */
    boolean mInTouchMode;
    private boolean mInTouchMode;

    private ViewServer mViewServer;
    final ArrayList<WindowChangeListener> mWindowChangeListeners = new ArrayList<>();
@@ -3461,6 +3461,12 @@ public class WindowManagerService extends IWindowManager.Stub
        mInputManager.setInTouchMode(mode);
    }

    boolean getInTouchMode() {
        synchronized (mGlobalLock) {
            return mInTouchMode;
        }
    }

    public void showEmulatorDisplayOverlayIfNeeded() {
        if (mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_windowEnableCircularEmulatorDisplayOverlay)