Loading core/java/android/view/ViewRootImpl.java +3 −1 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import static android.view.ViewRootImplProto.WINDOW_ATTRIBUTES; import static android.view.ViewRootImplProto.WIN_FRAME; import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION; import static android.view.flags.Flags.sensitiveContentAppProtection; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; Loading Loading @@ -2056,7 +2057,8 @@ public final class ViewRootImpl implements ViewParent, private int adjustLayoutInDisplayCutoutMode(WindowManager.LayoutParams attrs) { final int originalMode = attrs.layoutInDisplayCutoutMode; if ((attrs.privateFlags & PRIVATE_FLAG_EDGE_TO_EDGE_ENFORCED) != 0 if ((attrs.privateFlags & (PRIVATE_FLAG_EDGE_TO_EDGE_ENFORCED | PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE)) != 0 && attrs.isFullscreen() && attrs.getFitInsetsTypes() == 0 && attrs.getFitInsetsSides() == 0) { Loading core/java/android/view/WindowManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -3313,6 +3313,12 @@ public interface WindowManager extends ViewManager { */ public static final int PRIVATE_FLAG_IMMERSIVE_CONFIRMATION_WINDOW = 1 << 17; /** * Flag to indicate that the window is forcibly to layout under the display cutout. * @hide */ public static final int PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE = 1 << 18; /** * Flag to indicate that any window added by an application process that is of type * {@link #TYPE_TOAST} or that requires Loading Loading @@ -3447,6 +3453,7 @@ public interface WindowManager extends ViewManager { PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS, PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE, PRIVATE_FLAG_IMMERSIVE_CONFIRMATION_WINDOW, PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE, SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS, PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY, PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION, Loading Loading @@ -3530,6 +3537,10 @@ public interface WindowManager extends ViewManager { mask = PRIVATE_FLAG_IMMERSIVE_CONFIRMATION_WINDOW, equals = PRIVATE_FLAG_IMMERSIVE_CONFIRMATION_WINDOW, name = "IMMERSIVE_CONFIRMATION_WINDOW"), @ViewDebug.FlagToString( mask = PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE, equals = PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE, name = "OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE"), @ViewDebug.FlagToString( mask = SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS, equals = SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS, Loading core/java/com/android/internal/policy/PhoneWindow.java +17 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_M import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_EDGE_TO_EDGE_ENFORCED; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE; import android.annotation.NonNull; import android.annotation.Nullable; Loading @@ -43,7 +44,9 @@ import android.app.KeyguardManager; import android.app.SearchManager; import android.app.compat.CompatChanges; import android.compat.annotation.ChangeId; import android.compat.annotation.Disabled; import android.compat.annotation.EnabledSince; import android.compat.annotation.Overridable; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.Intent; Loading Loading @@ -177,6 +180,15 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { @EnabledSince(targetSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM) private static final long ENFORCE_EDGE_TO_EDGE = 309578419; /** * Override the layout in display cutout mode behavior. This will only apply if the edge to edge * is not enforced. */ @ChangeId @Disabled @Overridable private static final long OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE = 332679525L; private static final int CUSTOM_TITLE_COMPATIBLE_FEATURES = DEFAULT_FEATURES | (1 << FEATURE_CUSTOM_TITLE) | (1 << FEATURE_CONTENT_TRANSITIONS) | Loading Loading @@ -2475,6 +2487,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { getAttributes().privateFlags |= PRIVATE_FLAG_EDGE_TO_EDGE_ENFORCED; mDecorFitsSystemWindows = false; } if (CompatChanges.isChangeEnabled(OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE) && !a.getBoolean(R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false /* defValue */)) { getAttributes().privateFlags |= PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE; } mIsFloating = a.getBoolean(R.styleable.Window_windowIsFloating, false); int flagsToUpdate = (FLAG_LAYOUT_IN_SCREEN|FLAG_LAYOUT_INSET_DECOR) Loading Loading
core/java/android/view/ViewRootImpl.java +3 −1 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import static android.view.ViewRootImplProto.WINDOW_ATTRIBUTES; import static android.view.ViewRootImplProto.WIN_FRAME; import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION; import static android.view.flags.Flags.sensitiveContentAppProtection; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; Loading Loading @@ -2056,7 +2057,8 @@ public final class ViewRootImpl implements ViewParent, private int adjustLayoutInDisplayCutoutMode(WindowManager.LayoutParams attrs) { final int originalMode = attrs.layoutInDisplayCutoutMode; if ((attrs.privateFlags & PRIVATE_FLAG_EDGE_TO_EDGE_ENFORCED) != 0 if ((attrs.privateFlags & (PRIVATE_FLAG_EDGE_TO_EDGE_ENFORCED | PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE)) != 0 && attrs.isFullscreen() && attrs.getFitInsetsTypes() == 0 && attrs.getFitInsetsSides() == 0) { Loading
core/java/android/view/WindowManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -3313,6 +3313,12 @@ public interface WindowManager extends ViewManager { */ public static final int PRIVATE_FLAG_IMMERSIVE_CONFIRMATION_WINDOW = 1 << 17; /** * Flag to indicate that the window is forcibly to layout under the display cutout. * @hide */ public static final int PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE = 1 << 18; /** * Flag to indicate that any window added by an application process that is of type * {@link #TYPE_TOAST} or that requires Loading Loading @@ -3447,6 +3453,7 @@ public interface WindowManager extends ViewManager { PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS, PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE, PRIVATE_FLAG_IMMERSIVE_CONFIRMATION_WINDOW, PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE, SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS, PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY, PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION, Loading Loading @@ -3530,6 +3537,10 @@ public interface WindowManager extends ViewManager { mask = PRIVATE_FLAG_IMMERSIVE_CONFIRMATION_WINDOW, equals = PRIVATE_FLAG_IMMERSIVE_CONFIRMATION_WINDOW, name = "IMMERSIVE_CONFIRMATION_WINDOW"), @ViewDebug.FlagToString( mask = PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE, equals = PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE, name = "OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE"), @ViewDebug.FlagToString( mask = SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS, equals = SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS, Loading
core/java/com/android/internal/policy/PhoneWindow.java +17 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_M import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_EDGE_TO_EDGE_ENFORCED; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE; import android.annotation.NonNull; import android.annotation.Nullable; Loading @@ -43,7 +44,9 @@ import android.app.KeyguardManager; import android.app.SearchManager; import android.app.compat.CompatChanges; import android.compat.annotation.ChangeId; import android.compat.annotation.Disabled; import android.compat.annotation.EnabledSince; import android.compat.annotation.Overridable; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.Intent; Loading Loading @@ -177,6 +180,15 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { @EnabledSince(targetSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM) private static final long ENFORCE_EDGE_TO_EDGE = 309578419; /** * Override the layout in display cutout mode behavior. This will only apply if the edge to edge * is not enforced. */ @ChangeId @Disabled @Overridable private static final long OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE = 332679525L; private static final int CUSTOM_TITLE_COMPATIBLE_FEATURES = DEFAULT_FEATURES | (1 << FEATURE_CUSTOM_TITLE) | (1 << FEATURE_CONTENT_TRANSITIONS) | Loading Loading @@ -2475,6 +2487,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { getAttributes().privateFlags |= PRIVATE_FLAG_EDGE_TO_EDGE_ENFORCED; mDecorFitsSystemWindows = false; } if (CompatChanges.isChangeEnabled(OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE) && !a.getBoolean(R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false /* defValue */)) { getAttributes().privateFlags |= PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE; } mIsFloating = a.getBoolean(R.styleable.Window_windowIsFloating, false); int flagsToUpdate = (FLAG_LAYOUT_IN_SCREEN|FLAG_LAYOUT_INSET_DECOR) Loading