Loading services/core/java/com/android/server/wm/DisplayPolicy.java +15 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ import android.graphics.Insets; import android.graphics.PixelFormat; import android.graphics.Rect; import android.graphics.Region; import android.gui.DropInputMode; import android.hardware.power.Boost; import android.os.Handler; import android.os.IBinder; Loading Loading @@ -951,6 +952,20 @@ public class DisplayPolicy { } } /** * Add additional policy if needed to ensure the window or its children should not receive any * input. */ public void setDropInputModePolicy(WindowState win, LayoutParams attrs) { if (attrs.type == TYPE_TOAST && (attrs.privateFlags & PRIVATE_FLAG_TRUSTED_OVERLAY) == 0) { // Toasts should not receive input. These windows should not have any children, so // force this hierarchy of windows to drop all input. mService.mTransactionFactory.get() .setDropInputMode(win.getSurfaceControl(), DropInputMode.ALL).apply(); } } /** * Check if a window can be added to the system. * Loading services/core/java/com/android/server/wm/WindowManagerService.java +1 −0 Original line number Diff line number Diff line Loading @@ -1775,6 +1775,7 @@ public class WindowManagerService extends IWindowManager.Stub win.mToken.addWindow(win); displayPolicy.addWindowLw(win, attrs); displayPolicy.setDropInputModePolicy(win, win.mAttrs); if (type == TYPE_APPLICATION_STARTING && activity != null) { activity.attachStartingWindow(win); ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "addWindow: %s startingWindow=%s", Loading Loading
services/core/java/com/android/server/wm/DisplayPolicy.java +15 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ import android.graphics.Insets; import android.graphics.PixelFormat; import android.graphics.Rect; import android.graphics.Region; import android.gui.DropInputMode; import android.hardware.power.Boost; import android.os.Handler; import android.os.IBinder; Loading Loading @@ -951,6 +952,20 @@ public class DisplayPolicy { } } /** * Add additional policy if needed to ensure the window or its children should not receive any * input. */ public void setDropInputModePolicy(WindowState win, LayoutParams attrs) { if (attrs.type == TYPE_TOAST && (attrs.privateFlags & PRIVATE_FLAG_TRUSTED_OVERLAY) == 0) { // Toasts should not receive input. These windows should not have any children, so // force this hierarchy of windows to drop all input. mService.mTransactionFactory.get() .setDropInputMode(win.getSurfaceControl(), DropInputMode.ALL).apply(); } } /** * Check if a window can be added to the system. * Loading
services/core/java/com/android/server/wm/WindowManagerService.java +1 −0 Original line number Diff line number Diff line Loading @@ -1775,6 +1775,7 @@ public class WindowManagerService extends IWindowManager.Stub win.mToken.addWindow(win); displayPolicy.addWindowLw(win, attrs); displayPolicy.setDropInputModePolicy(win, win.mAttrs); if (type == TYPE_APPLICATION_STARTING && activity != null) { activity.attachStartingWindow(win); ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "addWindow: %s startingWindow=%s", Loading