Loading core/java/android/app/Instrumentation.java +1 −1 Original line number Diff line number Diff line Loading @@ -390,7 +390,7 @@ public class Instrumentation { public void setInTouchMode(boolean inTouch) { try { IWindowManager.Stub.asInterface( ServiceManager.getService("window")).setInTouchMode(inTouch); ServiceManager.getService("window")).setInTouchModeOnAllDisplays(inTouch); } catch (RemoteException e) { // Shouldn't happen! } Loading core/java/android/view/IWindowManager.aidl +12 −3 Original line number Diff line number Diff line Loading @@ -227,9 +227,18 @@ interface IWindowManager float getCurrentAnimatorScale(); // For testing @UnsupportedAppUsage(maxTargetSdk = 28) void setInTouchMode(boolean showFocus); // Request to change the touch mode on the display represented by the displayId parameter. // // If com.android.internal.R.bool.config_perDisplayFocusEnabled is false, then it will request // to change the touch mode on all displays (disregarding displayId parameter). void setInTouchMode(boolean inTouch, int displayId); // Request to change the touch mode on all displays (disregarding the value // com.android.internal.R.bool.config_perDisplayFocusEnabled). void setInTouchModeOnAllDisplays(boolean inTouch); // Returns the touch mode state for the display represented by the displayId parameter. boolean isInTouchMode(int displayId); // For StrictMode flashing a red border on violations from the UI // thread. The uid/pid is implicit from the Binder call, and the Window Loading core/java/android/view/IWindowSession.aidl +0 −5 Original line number Diff line number Diff line Loading @@ -150,11 +150,6 @@ interface IWindowSession { oneway void finishDrawing(IWindow window, in SurfaceControl.Transaction postDrawTransaction, int seqId); @UnsupportedAppUsage oneway void setInTouchMode(boolean showFocus); @UnsupportedAppUsage boolean getInTouchMode(); @UnsupportedAppUsage boolean performHapticFeedback(int effectId, boolean always); Loading core/java/android/view/View.java +6 −3 Original line number Diff line number Diff line Loading @@ -15907,15 +15907,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * once the user begins interacting with the device by touch, and affects various * things like whether focus is always visible to the user. * * If this view has no {@link ViewRootImpl} or {@link Display} attached, then it will return * the default touch mode value defined in * {@code com.android.internal.R.bool.config_defaultInTouchMode}. * * @return Whether the device is in touch mode. */ @ViewDebug.ExportedProperty public boolean isInTouchMode() { if (mAttachInfo != null) { return mAttachInfo.mInTouchMode; } else { return ViewRootImpl.isInTouchMode(); } return mResources.getBoolean(com.android.internal.R.bool.config_defaultInTouchMode); } /** core/java/android/view/ViewRootImpl.java +6 −13 Original line number Diff line number Diff line Loading @@ -1055,19 +1055,11 @@ public final class ViewRootImpl implements ViewParent, mProfile = true; } /** * Indicates whether we are in touch mode. Calling this method triggers an IPC * call and should be avoided whenever possible. * * @return True, if the device is in touch mode, false otherwise. * * @hide */ static boolean isInTouchMode() { IWindowSession windowSession = WindowManagerGlobal.peekWindowSession(); if (windowSession != null) { private boolean isInTouchMode() { IWindowManager windowManager = WindowManagerGlobal.getWindowManagerService(); if (windowManager != null) { try { return windowSession.getInTouchMode(); return windowManager.isInTouchMode(getDisplayId()); } catch (RemoteException e) { } } Loading Loading @@ -5810,7 +5802,8 @@ public final class ViewRootImpl implements ViewParent, // tell the window manager try { mWindowSession.setInTouchMode(inTouchMode); IWindowManager windowManager = WindowManagerGlobal.getWindowManagerService(); windowManager.setInTouchMode(inTouchMode, getDisplayId()); } catch (RemoteException e) { throw new RuntimeException(e); } Loading Loading
core/java/android/app/Instrumentation.java +1 −1 Original line number Diff line number Diff line Loading @@ -390,7 +390,7 @@ public class Instrumentation { public void setInTouchMode(boolean inTouch) { try { IWindowManager.Stub.asInterface( ServiceManager.getService("window")).setInTouchMode(inTouch); ServiceManager.getService("window")).setInTouchModeOnAllDisplays(inTouch); } catch (RemoteException e) { // Shouldn't happen! } Loading
core/java/android/view/IWindowManager.aidl +12 −3 Original line number Diff line number Diff line Loading @@ -227,9 +227,18 @@ interface IWindowManager float getCurrentAnimatorScale(); // For testing @UnsupportedAppUsage(maxTargetSdk = 28) void setInTouchMode(boolean showFocus); // Request to change the touch mode on the display represented by the displayId parameter. // // If com.android.internal.R.bool.config_perDisplayFocusEnabled is false, then it will request // to change the touch mode on all displays (disregarding displayId parameter). void setInTouchMode(boolean inTouch, int displayId); // Request to change the touch mode on all displays (disregarding the value // com.android.internal.R.bool.config_perDisplayFocusEnabled). void setInTouchModeOnAllDisplays(boolean inTouch); // Returns the touch mode state for the display represented by the displayId parameter. boolean isInTouchMode(int displayId); // For StrictMode flashing a red border on violations from the UI // thread. The uid/pid is implicit from the Binder call, and the Window Loading
core/java/android/view/IWindowSession.aidl +0 −5 Original line number Diff line number Diff line Loading @@ -150,11 +150,6 @@ interface IWindowSession { oneway void finishDrawing(IWindow window, in SurfaceControl.Transaction postDrawTransaction, int seqId); @UnsupportedAppUsage oneway void setInTouchMode(boolean showFocus); @UnsupportedAppUsage boolean getInTouchMode(); @UnsupportedAppUsage boolean performHapticFeedback(int effectId, boolean always); Loading
core/java/android/view/View.java +6 −3 Original line number Diff line number Diff line Loading @@ -15907,15 +15907,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * once the user begins interacting with the device by touch, and affects various * things like whether focus is always visible to the user. * * If this view has no {@link ViewRootImpl} or {@link Display} attached, then it will return * the default touch mode value defined in * {@code com.android.internal.R.bool.config_defaultInTouchMode}. * * @return Whether the device is in touch mode. */ @ViewDebug.ExportedProperty public boolean isInTouchMode() { if (mAttachInfo != null) { return mAttachInfo.mInTouchMode; } else { return ViewRootImpl.isInTouchMode(); } return mResources.getBoolean(com.android.internal.R.bool.config_defaultInTouchMode); } /**
core/java/android/view/ViewRootImpl.java +6 −13 Original line number Diff line number Diff line Loading @@ -1055,19 +1055,11 @@ public final class ViewRootImpl implements ViewParent, mProfile = true; } /** * Indicates whether we are in touch mode. Calling this method triggers an IPC * call and should be avoided whenever possible. * * @return True, if the device is in touch mode, false otherwise. * * @hide */ static boolean isInTouchMode() { IWindowSession windowSession = WindowManagerGlobal.peekWindowSession(); if (windowSession != null) { private boolean isInTouchMode() { IWindowManager windowManager = WindowManagerGlobal.getWindowManagerService(); if (windowManager != null) { try { return windowSession.getInTouchMode(); return windowManager.isInTouchMode(getDisplayId()); } catch (RemoteException e) { } } Loading Loading @@ -5810,7 +5802,8 @@ public final class ViewRootImpl implements ViewParent, // tell the window manager try { mWindowSession.setInTouchMode(inTouchMode); IWindowManager windowManager = WindowManagerGlobal.getWindowManagerService(); windowManager.setInTouchMode(inTouchMode, getDisplayId()); } catch (RemoteException e) { throw new RuntimeException(e); } Loading