Loading core/java/android/view/InputWindowHandle.java +1 −11 Original line number Diff line number Diff line Loading @@ -35,8 +35,6 @@ import java.lang.ref.WeakReference; * @hide */ public final class InputWindowHandle { // TODO (b/300094445): Convert to use correct flagging infrastructure public static final boolean USE_SURFACE_TRUSTED_OVERLAY = true; /** * An internal annotation for all the {@link android.os.InputConfig} flags that can be Loading @@ -61,6 +59,7 @@ public final class InputWindowHandle { InputConfig.DUPLICATE_TOUCH_TO_WALLPAPER, InputConfig.IS_WALLPAPER, InputConfig.PAUSE_DISPATCHING, InputConfig.TRUSTED_OVERLAY, InputConfig.WATCH_OUTSIDE_TOUCH, InputConfig.SLIPPERY, InputConfig.DISABLE_USER_ACTIVITY, Loading Loading @@ -273,13 +272,4 @@ public final class InputWindowHandle { } this.inputConfig &= ~inputConfig; } public void setTrustedOverlay(SurfaceControl.Transaction t, SurfaceControl sc, boolean isTrusted) { if (USE_SURFACE_TRUSTED_OVERLAY) { t.setTrustedOverlay(sc, isTrusted); } else if (isTrusted) { inputConfig |= InputConfig.TRUSTED_OVERLAY; } } } services/core/java/com/android/server/input/GestureMonitorSpyWindow.java +2 −2 Original line number Diff line number Diff line Loading @@ -62,10 +62,10 @@ class GestureMonitorSpyWindow { mWindowHandle.ownerUid = uid; mWindowHandle.scaleFactor = 1.0f; mWindowHandle.replaceTouchableRegionWithCrop(null /* use this surface's bounds */); mWindowHandle.inputConfig = InputConfig.NOT_FOCUSABLE | InputConfig.SPY; mWindowHandle.inputConfig = InputConfig.NOT_FOCUSABLE | InputConfig.SPY | InputConfig.TRUSTED_OVERLAY; final SurfaceControl.Transaction t = new SurfaceControl.Transaction(); mWindowHandle.setTrustedOverlay(t, mInputSurface, true); t.setInputWindowInfo(mInputSurface, mWindowHandle); t.setLayer(mInputSurface, InputManagerService.INPUT_OVERLAY_LAYER_GESTURE_MONITOR); t.setPosition(mInputSurface, 0, 0); Loading services/core/java/com/android/server/inputmethod/HandwritingEventReceiverSurface.java +2 −2 Original line number Diff line number Diff line Loading @@ -57,13 +57,13 @@ final class HandwritingEventReceiverSurface { InputConfig.NOT_FOCUSABLE | InputConfig.NOT_TOUCHABLE | InputConfig.SPY | InputConfig.INTERCEPTS_STYLUS; | InputConfig.INTERCEPTS_STYLUS | InputConfig.TRUSTED_OVERLAY; // Configure the surface to receive stylus events across the entire display. mWindowHandle.replaceTouchableRegionWithCrop(null /* use this surface's bounds */); final SurfaceControl.Transaction t = new SurfaceControl.Transaction(); mWindowHandle.setTrustedOverlay(t, mInputSurface, true); t.setInputWindowInfo(mInputSurface, mWindowHandle); t.setLayer(mInputSurface, InputManagerService.INPUT_OVERLAY_LAYER_HANDWRITING_SURFACE); t.setPosition(mInputSurface, 0, 0); Loading services/core/java/com/android/server/wm/DragState.java +8 −5 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.content.ClipDescription.MIMETYPE_APPLICATION_SHORTCUT; import static android.content.ClipDescription.MIMETYPE_APPLICATION_TASK; import static android.os.InputConstants.DEFAULT_DISPATCHING_TIMEOUT_MILLIS; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_INTERCEPT_GLOBAL_DRAG_AND_DROP; import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ORIENTATION; import static com.android.internal.protolog.ProtoLogGroup.WM_SHOW_TRANSACTIONS; import static com.android.server.wm.DragDropController.MSG_ANIMATION_END; Loading @@ -32,6 +33,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACT import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerService.MY_PID; import static com.android.server.wm.WindowManagerService.MY_UID; import static java.util.concurrent.CompletableFuture.completedFuture; import android.animation.Animator; Loading @@ -46,6 +48,7 @@ import android.hardware.input.InputManagerGlobal; import android.os.Binder; import android.os.Build; import android.os.IBinder; import android.os.InputConfig; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; Loading Loading @@ -183,13 +186,8 @@ class DragState { // Crop the input surface to the display size. mTmpClipRect.set(0, 0, mDisplaySize.x, mDisplaySize.y); // Make trusted overlay to not block any touches while D&D ongoing and allowing // touches to pass through to windows underneath. This allows user to interact with the // UI to navigate while dragging. h.setTrustedOverlay(mTransaction, mInputSurface, true); mTransaction.show(mInputSurface) .setInputWindowInfo(mInputSurface, h) .setTrustedOverlay(mInputSurface, true) .setLayer(mInputSurface, Integer.MAX_VALUE) .setCrop(mInputSurface, mTmpClipRect); Loading Loading @@ -379,6 +377,11 @@ class DragState { mDragWindowHandle.ownerUid = MY_UID; mDragWindowHandle.scaleFactor = 1.0f; // InputConfig.TRUSTED_OVERLAY: To not block any touches while D&D ongoing and allowing // touches to pass through to windows underneath. This allows user to interact with the // UI to navigate while dragging. mDragWindowHandle.inputConfig = InputConfig.TRUSTED_OVERLAY; // The drag window cannot receive new touches. mDragWindowHandle.touchableRegion.setEmpty(); Loading services/core/java/com/android/server/wm/InputConsumerImpl.java +1 −3 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ class InputConsumerImpl implements IBinder.DeathRecipient { mWindowHandle.ownerPid = WindowManagerService.MY_PID; mWindowHandle.ownerUid = WindowManagerService.MY_UID; mWindowHandle.scaleFactor = 1.0f; mWindowHandle.inputConfig = InputConfig.NOT_FOCUSABLE; mWindowHandle.inputConfig = InputConfig.NOT_FOCUSABLE | InputConfig.TRUSTED_OVERLAY; mInputSurface = mService.makeSurfaceBuilder( mService.mRoot.getDisplayContent(displayId).getSession()) Loading Loading @@ -129,14 +129,12 @@ class InputConsumerImpl implements IBinder.DeathRecipient { void show(SurfaceControl.Transaction t, WindowContainer w) { t.show(mInputSurface); mWindowHandle.setTrustedOverlay(t, mInputSurface, true); t.setInputWindowInfo(mInputSurface, mWindowHandle); t.setRelativeLayer(mInputSurface, w.getSurfaceControl(), 1); } void show(SurfaceControl.Transaction t, int layer) { t.show(mInputSurface); mWindowHandle.setTrustedOverlay(t, mInputSurface, true); t.setInputWindowInfo(mInputSurface, mWindowHandle); t.setLayer(mInputSurface, layer); } Loading Loading
core/java/android/view/InputWindowHandle.java +1 −11 Original line number Diff line number Diff line Loading @@ -35,8 +35,6 @@ import java.lang.ref.WeakReference; * @hide */ public final class InputWindowHandle { // TODO (b/300094445): Convert to use correct flagging infrastructure public static final boolean USE_SURFACE_TRUSTED_OVERLAY = true; /** * An internal annotation for all the {@link android.os.InputConfig} flags that can be Loading @@ -61,6 +59,7 @@ public final class InputWindowHandle { InputConfig.DUPLICATE_TOUCH_TO_WALLPAPER, InputConfig.IS_WALLPAPER, InputConfig.PAUSE_DISPATCHING, InputConfig.TRUSTED_OVERLAY, InputConfig.WATCH_OUTSIDE_TOUCH, InputConfig.SLIPPERY, InputConfig.DISABLE_USER_ACTIVITY, Loading Loading @@ -273,13 +272,4 @@ public final class InputWindowHandle { } this.inputConfig &= ~inputConfig; } public void setTrustedOverlay(SurfaceControl.Transaction t, SurfaceControl sc, boolean isTrusted) { if (USE_SURFACE_TRUSTED_OVERLAY) { t.setTrustedOverlay(sc, isTrusted); } else if (isTrusted) { inputConfig |= InputConfig.TRUSTED_OVERLAY; } } }
services/core/java/com/android/server/input/GestureMonitorSpyWindow.java +2 −2 Original line number Diff line number Diff line Loading @@ -62,10 +62,10 @@ class GestureMonitorSpyWindow { mWindowHandle.ownerUid = uid; mWindowHandle.scaleFactor = 1.0f; mWindowHandle.replaceTouchableRegionWithCrop(null /* use this surface's bounds */); mWindowHandle.inputConfig = InputConfig.NOT_FOCUSABLE | InputConfig.SPY; mWindowHandle.inputConfig = InputConfig.NOT_FOCUSABLE | InputConfig.SPY | InputConfig.TRUSTED_OVERLAY; final SurfaceControl.Transaction t = new SurfaceControl.Transaction(); mWindowHandle.setTrustedOverlay(t, mInputSurface, true); t.setInputWindowInfo(mInputSurface, mWindowHandle); t.setLayer(mInputSurface, InputManagerService.INPUT_OVERLAY_LAYER_GESTURE_MONITOR); t.setPosition(mInputSurface, 0, 0); Loading
services/core/java/com/android/server/inputmethod/HandwritingEventReceiverSurface.java +2 −2 Original line number Diff line number Diff line Loading @@ -57,13 +57,13 @@ final class HandwritingEventReceiverSurface { InputConfig.NOT_FOCUSABLE | InputConfig.NOT_TOUCHABLE | InputConfig.SPY | InputConfig.INTERCEPTS_STYLUS; | InputConfig.INTERCEPTS_STYLUS | InputConfig.TRUSTED_OVERLAY; // Configure the surface to receive stylus events across the entire display. mWindowHandle.replaceTouchableRegionWithCrop(null /* use this surface's bounds */); final SurfaceControl.Transaction t = new SurfaceControl.Transaction(); mWindowHandle.setTrustedOverlay(t, mInputSurface, true); t.setInputWindowInfo(mInputSurface, mWindowHandle); t.setLayer(mInputSurface, InputManagerService.INPUT_OVERLAY_LAYER_HANDWRITING_SURFACE); t.setPosition(mInputSurface, 0, 0); Loading
services/core/java/com/android/server/wm/DragState.java +8 −5 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.content.ClipDescription.MIMETYPE_APPLICATION_SHORTCUT; import static android.content.ClipDescription.MIMETYPE_APPLICATION_TASK; import static android.os.InputConstants.DEFAULT_DISPATCHING_TIMEOUT_MILLIS; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_INTERCEPT_GLOBAL_DRAG_AND_DROP; import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ORIENTATION; import static com.android.internal.protolog.ProtoLogGroup.WM_SHOW_TRANSACTIONS; import static com.android.server.wm.DragDropController.MSG_ANIMATION_END; Loading @@ -32,6 +33,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACT import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerService.MY_PID; import static com.android.server.wm.WindowManagerService.MY_UID; import static java.util.concurrent.CompletableFuture.completedFuture; import android.animation.Animator; Loading @@ -46,6 +48,7 @@ import android.hardware.input.InputManagerGlobal; import android.os.Binder; import android.os.Build; import android.os.IBinder; import android.os.InputConfig; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; Loading Loading @@ -183,13 +186,8 @@ class DragState { // Crop the input surface to the display size. mTmpClipRect.set(0, 0, mDisplaySize.x, mDisplaySize.y); // Make trusted overlay to not block any touches while D&D ongoing and allowing // touches to pass through to windows underneath. This allows user to interact with the // UI to navigate while dragging. h.setTrustedOverlay(mTransaction, mInputSurface, true); mTransaction.show(mInputSurface) .setInputWindowInfo(mInputSurface, h) .setTrustedOverlay(mInputSurface, true) .setLayer(mInputSurface, Integer.MAX_VALUE) .setCrop(mInputSurface, mTmpClipRect); Loading Loading @@ -379,6 +377,11 @@ class DragState { mDragWindowHandle.ownerUid = MY_UID; mDragWindowHandle.scaleFactor = 1.0f; // InputConfig.TRUSTED_OVERLAY: To not block any touches while D&D ongoing and allowing // touches to pass through to windows underneath. This allows user to interact with the // UI to navigate while dragging. mDragWindowHandle.inputConfig = InputConfig.TRUSTED_OVERLAY; // The drag window cannot receive new touches. mDragWindowHandle.touchableRegion.setEmpty(); Loading
services/core/java/com/android/server/wm/InputConsumerImpl.java +1 −3 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ class InputConsumerImpl implements IBinder.DeathRecipient { mWindowHandle.ownerPid = WindowManagerService.MY_PID; mWindowHandle.ownerUid = WindowManagerService.MY_UID; mWindowHandle.scaleFactor = 1.0f; mWindowHandle.inputConfig = InputConfig.NOT_FOCUSABLE; mWindowHandle.inputConfig = InputConfig.NOT_FOCUSABLE | InputConfig.TRUSTED_OVERLAY; mInputSurface = mService.makeSurfaceBuilder( mService.mRoot.getDisplayContent(displayId).getSession()) Loading Loading @@ -129,14 +129,12 @@ class InputConsumerImpl implements IBinder.DeathRecipient { void show(SurfaceControl.Transaction t, WindowContainer w) { t.show(mInputSurface); mWindowHandle.setTrustedOverlay(t, mInputSurface, true); t.setInputWindowInfo(mInputSurface, mWindowHandle); t.setRelativeLayer(mInputSurface, w.getSurfaceControl(), 1); } void show(SurfaceControl.Transaction t, int layer) { t.show(mInputSurface); mWindowHandle.setTrustedOverlay(t, mInputSurface, true); t.setInputWindowInfo(mInputSurface, mWindowHandle); t.setLayer(mInputSurface, layer); } Loading