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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user