Loading api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2312,6 +2312,7 @@ package android.provider { } public static interface DeviceConfig.WindowManager { field public static final String KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE = "system_gestures_excluded_by_pre_q_sticky_immersive"; field public static final String KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP = "system_gesture_exclusion_limit_dp"; } Loading core/java/android/provider/DeviceConfig.java +11 −0 Original line number Diff line number Diff line Loading @@ -325,6 +325,17 @@ public final class DeviceConfig { */ @TestApi String KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP = "system_gesture_exclusion_limit_dp"; /** * Key for controlling whether system gestures are implicitly excluded by windows requesting * sticky immersive mode from apps that are targeting an SDK prior to Q. * * @see android.provider.DeviceConfig#NAMESPACE_WINDOW_MANAGER * @hide */ @TestApi String KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE = "system_gestures_excluded_by_pre_q_sticky_immersive"; } private static final Object sLock = new Object(); Loading services/core/java/com/android/server/wm/DisplayContent.java +11 −7 Original line number Diff line number Diff line Loading @@ -5158,6 +5158,9 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo w.getTouchableRegion(touchableRegion); touchableRegion.op(unhandled, Op.INTERSECT); if (w.isImplicitlyExcludingAllSystemGestures()) { local.set(touchableRegion); } else { rectListToRegion(w.getSystemGestureExclusion(), local); // Transform to display coordinates Loading @@ -5167,6 +5170,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // A window can only exclude system gestures where it is actually touchable local.op(touchableRegion, Op.INTERSECT); } // Apply restriction if necessary. if (needsGestureExclusionRestrictions(w, mLastDispatchedSystemUiVisibility)) { Loading services/core/java/com/android/server/wm/WindowManagerService.java +11 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.os.Process.SYSTEM_UID; import static android.os.Process.myPid; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.provider.DeviceConfig.WindowManager.KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE; import static android.provider.DeviceConfig.WindowManager.KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP; import static android.provider.Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS; import static android.view.Display.DEFAULT_DISPLAY; Loading Loading @@ -844,6 +845,7 @@ public class WindowManagerService extends IWindowManager.Stub boolean mWindowsChanged = false; int mSystemGestureExclusionLimitDp; boolean mSystemGestureExcludedByPreQStickyImmersive; public interface WindowChangeListener { public void windowsChanged(); Loading Loading @@ -1142,13 +1144,21 @@ public class WindowManagerService extends IWindowManager.Stub mSystemGestureExclusionLimitDp = Math.max(MIN_GESTURE_EXCLUSION_LIMIT_DP, DeviceConfig.getInt(DeviceConfig.NAMESPACE_WINDOW_MANAGER, KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP, 0)); mSystemGestureExcludedByPreQStickyImmersive = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_WINDOW_MANAGER, KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE, false); DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_WINDOW_MANAGER, new HandlerExecutor(mH), properties -> { synchronized (mGlobalLock) { final int exclusionLimitDp = Math.max(MIN_GESTURE_EXCLUSION_LIMIT_DP, properties.getInt(KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP, 0)); if (mSystemGestureExclusionLimitDp != exclusionLimitDp) { final boolean excludedByPreQSticky = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_WINDOW_MANAGER, KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE, false); if (mSystemGestureExcludedByPreQStickyImmersive != excludedByPreQSticky || mSystemGestureExclusionLimitDp != exclusionLimitDp) { mSystemGestureExclusionLimitDp = exclusionLimitDp; mSystemGestureExcludedByPreQStickyImmersive = excludedByPreQSticky; mRoot.forAllDisplays(DisplayContent::updateSystemGestureExclusionLimit); } } Loading services/core/java/com/android/server/wm/WindowState.java +12 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import static android.os.PowerManager.DRAW_WAKE_LOCK; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.SurfaceControl.Transaction; import static android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; import static android.view.View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_CONTENT; import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME; import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION; Loading Loading @@ -155,6 +157,7 @@ import android.graphics.Point; import android.graphics.Rect; import android.graphics.Region; import android.os.Binder; import android.os.Build; import android.os.Debug; import android.os.IBinder; import android.os.PowerManager; Loading Loading @@ -657,6 +660,15 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP return true; } boolean isImplicitlyExcludingAllSystemGestures() { final int immersiveStickyFlags = SYSTEM_UI_FLAG_HIDE_NAVIGATION | SYSTEM_UI_FLAG_IMMERSIVE_STICKY; final boolean immersiveSticky = (mSystemUiVisibility & immersiveStickyFlags) == immersiveStickyFlags; return immersiveSticky && mWmService.mSystemGestureExcludedByPreQStickyImmersive && mAppToken != null && mAppToken.mTargetSdk < Build.VERSION_CODES.Q; } interface PowerManagerWrapper { void wakeUp(long time, @WakeReason int reason, String details); Loading Loading
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2312,6 +2312,7 @@ package android.provider { } public static interface DeviceConfig.WindowManager { field public static final String KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE = "system_gestures_excluded_by_pre_q_sticky_immersive"; field public static final String KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP = "system_gesture_exclusion_limit_dp"; } Loading
core/java/android/provider/DeviceConfig.java +11 −0 Original line number Diff line number Diff line Loading @@ -325,6 +325,17 @@ public final class DeviceConfig { */ @TestApi String KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP = "system_gesture_exclusion_limit_dp"; /** * Key for controlling whether system gestures are implicitly excluded by windows requesting * sticky immersive mode from apps that are targeting an SDK prior to Q. * * @see android.provider.DeviceConfig#NAMESPACE_WINDOW_MANAGER * @hide */ @TestApi String KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE = "system_gestures_excluded_by_pre_q_sticky_immersive"; } private static final Object sLock = new Object(); Loading
services/core/java/com/android/server/wm/DisplayContent.java +11 −7 Original line number Diff line number Diff line Loading @@ -5158,6 +5158,9 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo w.getTouchableRegion(touchableRegion); touchableRegion.op(unhandled, Op.INTERSECT); if (w.isImplicitlyExcludingAllSystemGestures()) { local.set(touchableRegion); } else { rectListToRegion(w.getSystemGestureExclusion(), local); // Transform to display coordinates Loading @@ -5167,6 +5170,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // A window can only exclude system gestures where it is actually touchable local.op(touchableRegion, Op.INTERSECT); } // Apply restriction if necessary. if (needsGestureExclusionRestrictions(w, mLastDispatchedSystemUiVisibility)) { Loading
services/core/java/com/android/server/wm/WindowManagerService.java +11 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.os.Process.SYSTEM_UID; import static android.os.Process.myPid; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.provider.DeviceConfig.WindowManager.KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE; import static android.provider.DeviceConfig.WindowManager.KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP; import static android.provider.Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS; import static android.view.Display.DEFAULT_DISPLAY; Loading Loading @@ -844,6 +845,7 @@ public class WindowManagerService extends IWindowManager.Stub boolean mWindowsChanged = false; int mSystemGestureExclusionLimitDp; boolean mSystemGestureExcludedByPreQStickyImmersive; public interface WindowChangeListener { public void windowsChanged(); Loading Loading @@ -1142,13 +1144,21 @@ public class WindowManagerService extends IWindowManager.Stub mSystemGestureExclusionLimitDp = Math.max(MIN_GESTURE_EXCLUSION_LIMIT_DP, DeviceConfig.getInt(DeviceConfig.NAMESPACE_WINDOW_MANAGER, KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP, 0)); mSystemGestureExcludedByPreQStickyImmersive = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_WINDOW_MANAGER, KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE, false); DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_WINDOW_MANAGER, new HandlerExecutor(mH), properties -> { synchronized (mGlobalLock) { final int exclusionLimitDp = Math.max(MIN_GESTURE_EXCLUSION_LIMIT_DP, properties.getInt(KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP, 0)); if (mSystemGestureExclusionLimitDp != exclusionLimitDp) { final boolean excludedByPreQSticky = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_WINDOW_MANAGER, KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE, false); if (mSystemGestureExcludedByPreQStickyImmersive != excludedByPreQSticky || mSystemGestureExclusionLimitDp != exclusionLimitDp) { mSystemGestureExclusionLimitDp = exclusionLimitDp; mSystemGestureExcludedByPreQStickyImmersive = excludedByPreQSticky; mRoot.forAllDisplays(DisplayContent::updateSystemGestureExclusionLimit); } } Loading
services/core/java/com/android/server/wm/WindowState.java +12 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import static android.os.PowerManager.DRAW_WAKE_LOCK; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.SurfaceControl.Transaction; import static android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; import static android.view.View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_CONTENT; import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME; import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION; Loading Loading @@ -155,6 +157,7 @@ import android.graphics.Point; import android.graphics.Rect; import android.graphics.Region; import android.os.Binder; import android.os.Build; import android.os.Debug; import android.os.IBinder; import android.os.PowerManager; Loading Loading @@ -657,6 +660,15 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP return true; } boolean isImplicitlyExcludingAllSystemGestures() { final int immersiveStickyFlags = SYSTEM_UI_FLAG_HIDE_NAVIGATION | SYSTEM_UI_FLAG_IMMERSIVE_STICKY; final boolean immersiveSticky = (mSystemUiVisibility & immersiveStickyFlags) == immersiveStickyFlags; return immersiveSticky && mWmService.mSystemGestureExcludedByPreQStickyImmersive && mAppToken != null && mAppToken.mTargetSdk < Build.VERSION_CODES.Q; } interface PowerManagerWrapper { void wakeUp(long time, @WakeReason int reason, String details); Loading