Loading services/core/java/com/android/server/wm/AccessibilityController.java +10 −5 Original line number Diff line number Diff line Loading @@ -898,11 +898,16 @@ final class AccessibilityController { /* ignore */ } mSurfaceControl = surfaceControl; mService.mTransactionFactory.get().setLayer(mSurfaceControl, mService.mPolicy.getWindowLayerFromTypeLw(TYPE_MAGNIFICATION_OVERLAY) * WindowManagerService.TYPE_LAYER_MULTIPLIER) .setPosition(mSurfaceControl, 0, 0) .apply(); final SurfaceControl.Transaction t = mService.mTransactionFactory.get(); final int layer = mService.mPolicy.getWindowLayerFromTypeLw(TYPE_MAGNIFICATION_OVERLAY) * WindowManagerService.TYPE_LAYER_MULTIPLIER; t.setLayer(mSurfaceControl, layer).setPosition(mSurfaceControl, 0, 0); InputMonitor.setTrustedOverlayInputInfo(mSurfaceControl, t, mDisplayContent.getDisplayId(), "Magnification Overlay"); t.apply(); mSurface.copyFrom(mSurfaceControl); mAnimationController = new AnimationController(context, Loading services/core/java/com/android/server/wm/EmulatorDisplayOverlay.java +3 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,9 @@ class EmulatorDisplayOverlay { t.setLayer(ctrl, zOrder); t.setPosition(ctrl, 0, 0); t.show(ctrl); // Ensure we aren't considered as obscuring for Input purposes. InputMonitor.setTrustedOverlayInputInfo(ctrl, t, dc.getDisplayId(), "EmulatorDisplayOverlay"); mSurface.copyFrom(ctrl); } catch (OutOfResourcesException e) { } Loading services/core/java/com/android/server/wm/InputMonitor.java +26 −0 Original line number Diff line number Diff line Loading @@ -16,13 +16,17 @@ package com.android.server.wm; import static android.os.Process.myPid; import static android.os.Process.myUid; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.view.WindowManager.INPUT_CONSUMER_NAVIGATION; import static android.view.WindowManager.INPUT_CONSUMER_PIP; import static android.view.WindowManager.INPUT_CONSUMER_RECENTS_ANIMATION; import static android.view.WindowManager.INPUT_CONSUMER_WALLPAPER; import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; import static android.view.WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS; import static android.view.WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS_LIGHT; Loading Loading @@ -550,4 +554,26 @@ final class InputMonitor { } } } /** * Helper function to generate an InputInfo with type SECURE_SYSTEM_OVERLAY. This input * info will not have an input channel or be touchable, but is used to omit Surfaces * from occlusion detection, so that System global overlays like the Watermark aren't * counted by the InputDispatcher as occluding applications below. */ static void setTrustedOverlayInputInfo(SurfaceControl sc, SurfaceControl.Transaction t, int displayId, String name) { InputWindowHandle inputWindowHandle = new InputWindowHandle(null, displayId); inputWindowHandle.name = name; inputWindowHandle.layoutParamsType = TYPE_SECURE_SYSTEM_OVERLAY; inputWindowHandle.dispatchingTimeoutNanos = -1; inputWindowHandle.visible = true; inputWindowHandle.canReceiveKeys = false; inputWindowHandle.hasFocus = false; inputWindowHandle.ownerPid = myPid(); inputWindowHandle.ownerUid = myUid(); inputWindowHandle.inputFeatures = INPUT_FEATURE_NO_INPUT_CHANNEL; inputWindowHandle.scaleFactor = 1; t.setInputWindowInfo(sc, inputWindowHandle); } } services/core/java/com/android/server/wm/StrictModeFlash.java +4 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,10 @@ class StrictModeFlash { t.setLayer(ctrl, WindowManagerService.TYPE_LAYER_MULTIPLIER * 101); t.setPosition(ctrl, 0, 0); t.show(ctrl); // Ensure we aren't considered as obscuring for Input purposes. InputMonitor.setTrustedOverlayInputInfo(ctrl, t, dc.getDisplayId(), "StrictModeFlash"); mSurface.copyFrom(ctrl); } catch (OutOfResourcesException e) { } Loading services/core/java/com/android/server/wm/Watermark.java +3 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.util.DisplayMetrics; import android.util.Log; import android.util.TypedValue; import android.view.Display; import android.view.InputWindowHandle; import android.view.Surface; import android.view.Surface.OutOfResourcesException; import android.view.SurfaceControl; Loading Loading @@ -124,6 +125,8 @@ class Watermark { t.setLayer(ctrl, WindowManagerService.TYPE_LAYER_MULTIPLIER * 100) .setPosition(ctrl, 0, 0) .show(ctrl); // Ensure we aren't considered as obscuring for Input purposes. InputMonitor.setTrustedOverlayInputInfo(ctrl, t, dc.getDisplayId(), "Watermark"); mSurface.copyFrom(ctrl); } catch (OutOfResourcesException e) { } Loading Loading
services/core/java/com/android/server/wm/AccessibilityController.java +10 −5 Original line number Diff line number Diff line Loading @@ -898,11 +898,16 @@ final class AccessibilityController { /* ignore */ } mSurfaceControl = surfaceControl; mService.mTransactionFactory.get().setLayer(mSurfaceControl, mService.mPolicy.getWindowLayerFromTypeLw(TYPE_MAGNIFICATION_OVERLAY) * WindowManagerService.TYPE_LAYER_MULTIPLIER) .setPosition(mSurfaceControl, 0, 0) .apply(); final SurfaceControl.Transaction t = mService.mTransactionFactory.get(); final int layer = mService.mPolicy.getWindowLayerFromTypeLw(TYPE_MAGNIFICATION_OVERLAY) * WindowManagerService.TYPE_LAYER_MULTIPLIER; t.setLayer(mSurfaceControl, layer).setPosition(mSurfaceControl, 0, 0); InputMonitor.setTrustedOverlayInputInfo(mSurfaceControl, t, mDisplayContent.getDisplayId(), "Magnification Overlay"); t.apply(); mSurface.copyFrom(mSurfaceControl); mAnimationController = new AnimationController(context, Loading
services/core/java/com/android/server/wm/EmulatorDisplayOverlay.java +3 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,9 @@ class EmulatorDisplayOverlay { t.setLayer(ctrl, zOrder); t.setPosition(ctrl, 0, 0); t.show(ctrl); // Ensure we aren't considered as obscuring for Input purposes. InputMonitor.setTrustedOverlayInputInfo(ctrl, t, dc.getDisplayId(), "EmulatorDisplayOverlay"); mSurface.copyFrom(ctrl); } catch (OutOfResourcesException e) { } Loading
services/core/java/com/android/server/wm/InputMonitor.java +26 −0 Original line number Diff line number Diff line Loading @@ -16,13 +16,17 @@ package com.android.server.wm; import static android.os.Process.myPid; import static android.os.Process.myUid; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.view.WindowManager.INPUT_CONSUMER_NAVIGATION; import static android.view.WindowManager.INPUT_CONSUMER_PIP; import static android.view.WindowManager.INPUT_CONSUMER_RECENTS_ANIMATION; import static android.view.WindowManager.INPUT_CONSUMER_WALLPAPER; import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; import static android.view.WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS; import static android.view.WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS_LIGHT; Loading Loading @@ -550,4 +554,26 @@ final class InputMonitor { } } } /** * Helper function to generate an InputInfo with type SECURE_SYSTEM_OVERLAY. This input * info will not have an input channel or be touchable, but is used to omit Surfaces * from occlusion detection, so that System global overlays like the Watermark aren't * counted by the InputDispatcher as occluding applications below. */ static void setTrustedOverlayInputInfo(SurfaceControl sc, SurfaceControl.Transaction t, int displayId, String name) { InputWindowHandle inputWindowHandle = new InputWindowHandle(null, displayId); inputWindowHandle.name = name; inputWindowHandle.layoutParamsType = TYPE_SECURE_SYSTEM_OVERLAY; inputWindowHandle.dispatchingTimeoutNanos = -1; inputWindowHandle.visible = true; inputWindowHandle.canReceiveKeys = false; inputWindowHandle.hasFocus = false; inputWindowHandle.ownerPid = myPid(); inputWindowHandle.ownerUid = myUid(); inputWindowHandle.inputFeatures = INPUT_FEATURE_NO_INPUT_CHANNEL; inputWindowHandle.scaleFactor = 1; t.setInputWindowInfo(sc, inputWindowHandle); } }
services/core/java/com/android/server/wm/StrictModeFlash.java +4 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,10 @@ class StrictModeFlash { t.setLayer(ctrl, WindowManagerService.TYPE_LAYER_MULTIPLIER * 101); t.setPosition(ctrl, 0, 0); t.show(ctrl); // Ensure we aren't considered as obscuring for Input purposes. InputMonitor.setTrustedOverlayInputInfo(ctrl, t, dc.getDisplayId(), "StrictModeFlash"); mSurface.copyFrom(ctrl); } catch (OutOfResourcesException e) { } Loading
services/core/java/com/android/server/wm/Watermark.java +3 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.util.DisplayMetrics; import android.util.Log; import android.util.TypedValue; import android.view.Display; import android.view.InputWindowHandle; import android.view.Surface; import android.view.Surface.OutOfResourcesException; import android.view.SurfaceControl; Loading Loading @@ -124,6 +125,8 @@ class Watermark { t.setLayer(ctrl, WindowManagerService.TYPE_LAYER_MULTIPLIER * 100) .setPosition(ctrl, 0, 0) .show(ctrl); // Ensure we aren't considered as obscuring for Input purposes. InputMonitor.setTrustedOverlayInputInfo(ctrl, t, dc.getDisplayId(), "Watermark"); mSurface.copyFrom(ctrl); } catch (OutOfResourcesException e) { } Loading