Loading core/java/android/view/WindowManagerGlobal.java +1 −3 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import android.window.TrustedPresentationThresholds; import com.android.internal.R; import com.android.internal.annotations.GuardedBy; import com.android.internal.policy.PhoneWindow; import com.android.internal.util.FastPrintWriter; import java.io.FileDescriptor; Loading Loading @@ -376,8 +375,7 @@ public final class WindowManagerGlobal { if (context != null && wparams.type > LAST_APPLICATION_WINDOW) { final TypedArray styles = context.obtainStyledAttributes(R.styleable.Window); if (PhoneWindow.isOptingOutEdgeToEdgeEnforcement( context.getApplicationInfo(), true /* local */, styles)) { if (styles.getBoolean(R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false)) { wparams.privateFlags |= PRIVATE_FLAG_OPT_OUT_EDGE_TO_EDGE; } styles.recycle(); Loading core/java/com/android/internal/policy/PhoneWindow.java +5 −32 Original line number Diff line number Diff line Loading @@ -183,14 +183,6 @@ 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; /** * Disable opting out the edge-to-edge enforcement. * {@link Build.VERSION_CODES#BAKLAVA} or above. */ @ChangeId @EnabledSince(targetSdkVersion = Build.VERSION_CODES.BAKLAVA) private static final long DISABLE_OPT_OUT_EDGE_TO_EDGE = 377864165; /** * Override the layout in display cutout mode behavior. This will only apply if the edge to edge * is not enforced. Loading Loading @@ -458,7 +450,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { */ public static boolean isEdgeToEdgeEnforced(ApplicationInfo info, boolean local, TypedArray windowStyle) { return !isOptingOutEdgeToEdgeEnforcement(info, local, windowStyle) return !windowStyle.getBoolean(R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false) && (info.targetSdkVersion >= ENFORCE_EDGE_TO_EDGE_SDK_VERSION || (Flags.enforceEdgeToEdge() && (local // Calling this doesn't require a permission. Loading @@ -467,26 +459,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { : info.isChangeEnabled(ENFORCE_EDGE_TO_EDGE)))); } /** * Returns whether the given application is opting out edge-to-edge enforcement. * * @param info The application to query. * @param local Whether this is called from the process of the given application. * @param windowStyle The style of the window. * @return {@code true} if the edge-to-edge enforcement is opting out. Otherwise, {@code false}. */ public static boolean isOptingOutEdgeToEdgeEnforcement(ApplicationInfo info, boolean local, TypedArray windowStyle) { final boolean disabled = (Flags.disableOptOutEdgeToEdge() && (local // Calling this doesn't require a permission. ? CompatChanges.isChangeEnabled(DISABLE_OPT_OUT_EDGE_TO_EDGE) // Calling this requires permissions. : info.isChangeEnabled(DISABLE_OPT_OUT_EDGE_TO_EDGE))); return !disabled && windowStyle.getBoolean( R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false /* default */); } @Override public final void setContainer(Window container) { super.setContainer(container); Loading Loading @@ -2514,7 +2486,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { TypedArray a = getWindowStyle(); WindowManager.LayoutParams params = getAttributes(); ApplicationInfo appInfo = getContext().getApplicationInfo(); if (false) { System.out.println("From style:"); Loading @@ -2526,7 +2497,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { System.out.println(s); } mEdgeToEdgeEnforced = isEdgeToEdgeEnforced(appInfo, true /* local */, a); mEdgeToEdgeEnforced = isEdgeToEdgeEnforced( getContext().getApplicationInfo(), true /* local */, a); if (mEdgeToEdgeEnforced) { getAttributes().privateFlags |= PRIVATE_FLAG_EDGE_TO_EDGE_ENFORCED; mDecorFitsSystemWindows = false; Loading @@ -2535,7 +2507,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { // mNavigationBarColor is not reset here because it might be used to draw the scrim. } if (CompatChanges.isChangeEnabled(OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE) && !isOptingOutEdgeToEdgeEnforcement(appInfo, true /* local */, a)) { && !a.getBoolean(R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false /* defValue */)) { getAttributes().privateFlags |= PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE; } Loading services/core/java/com/android/server/wm/ActivityRecord.java +2 −3 Original line number Diff line number Diff line Loading @@ -367,7 +367,6 @@ import com.android.internal.content.ReferrerIntent; import com.android.internal.os.TimeoutRecord; import com.android.internal.os.TransferPipe; import com.android.internal.policy.AttributeCache; import com.android.internal.policy.PhoneWindow; import com.android.internal.protolog.ProtoLog; import com.android.internal.util.XmlUtils; import com.android.modules.utils.TypedXmlPullParser; Loading Loading @@ -2027,8 +2026,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A || ent.array.getBoolean(R.styleable.Window_windowShowWallpaper, false); mStyleFillsParent = mOccludesParent; mNoDisplay = ent.array.getBoolean(R.styleable.Window_windowNoDisplay, false); mOptOutEdgeToEdge = PhoneWindow.isOptingOutEdgeToEdgeEnforcement( aInfo.applicationInfo, false /* local */, ent.array); mOptOutEdgeToEdge = ent.array.getBoolean( R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false); } else { mStyleFillsParent = mOccludesParent = true; mNoDisplay = false; Loading Loading
core/java/android/view/WindowManagerGlobal.java +1 −3 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import android.window.TrustedPresentationThresholds; import com.android.internal.R; import com.android.internal.annotations.GuardedBy; import com.android.internal.policy.PhoneWindow; import com.android.internal.util.FastPrintWriter; import java.io.FileDescriptor; Loading Loading @@ -376,8 +375,7 @@ public final class WindowManagerGlobal { if (context != null && wparams.type > LAST_APPLICATION_WINDOW) { final TypedArray styles = context.obtainStyledAttributes(R.styleable.Window); if (PhoneWindow.isOptingOutEdgeToEdgeEnforcement( context.getApplicationInfo(), true /* local */, styles)) { if (styles.getBoolean(R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false)) { wparams.privateFlags |= PRIVATE_FLAG_OPT_OUT_EDGE_TO_EDGE; } styles.recycle(); Loading
core/java/com/android/internal/policy/PhoneWindow.java +5 −32 Original line number Diff line number Diff line Loading @@ -183,14 +183,6 @@ 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; /** * Disable opting out the edge-to-edge enforcement. * {@link Build.VERSION_CODES#BAKLAVA} or above. */ @ChangeId @EnabledSince(targetSdkVersion = Build.VERSION_CODES.BAKLAVA) private static final long DISABLE_OPT_OUT_EDGE_TO_EDGE = 377864165; /** * Override the layout in display cutout mode behavior. This will only apply if the edge to edge * is not enforced. Loading Loading @@ -458,7 +450,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { */ public static boolean isEdgeToEdgeEnforced(ApplicationInfo info, boolean local, TypedArray windowStyle) { return !isOptingOutEdgeToEdgeEnforcement(info, local, windowStyle) return !windowStyle.getBoolean(R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false) && (info.targetSdkVersion >= ENFORCE_EDGE_TO_EDGE_SDK_VERSION || (Flags.enforceEdgeToEdge() && (local // Calling this doesn't require a permission. Loading @@ -467,26 +459,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { : info.isChangeEnabled(ENFORCE_EDGE_TO_EDGE)))); } /** * Returns whether the given application is opting out edge-to-edge enforcement. * * @param info The application to query. * @param local Whether this is called from the process of the given application. * @param windowStyle The style of the window. * @return {@code true} if the edge-to-edge enforcement is opting out. Otherwise, {@code false}. */ public static boolean isOptingOutEdgeToEdgeEnforcement(ApplicationInfo info, boolean local, TypedArray windowStyle) { final boolean disabled = (Flags.disableOptOutEdgeToEdge() && (local // Calling this doesn't require a permission. ? CompatChanges.isChangeEnabled(DISABLE_OPT_OUT_EDGE_TO_EDGE) // Calling this requires permissions. : info.isChangeEnabled(DISABLE_OPT_OUT_EDGE_TO_EDGE))); return !disabled && windowStyle.getBoolean( R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false /* default */); } @Override public final void setContainer(Window container) { super.setContainer(container); Loading Loading @@ -2514,7 +2486,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { TypedArray a = getWindowStyle(); WindowManager.LayoutParams params = getAttributes(); ApplicationInfo appInfo = getContext().getApplicationInfo(); if (false) { System.out.println("From style:"); Loading @@ -2526,7 +2497,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { System.out.println(s); } mEdgeToEdgeEnforced = isEdgeToEdgeEnforced(appInfo, true /* local */, a); mEdgeToEdgeEnforced = isEdgeToEdgeEnforced( getContext().getApplicationInfo(), true /* local */, a); if (mEdgeToEdgeEnforced) { getAttributes().privateFlags |= PRIVATE_FLAG_EDGE_TO_EDGE_ENFORCED; mDecorFitsSystemWindows = false; Loading @@ -2535,7 +2507,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { // mNavigationBarColor is not reset here because it might be used to draw the scrim. } if (CompatChanges.isChangeEnabled(OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE) && !isOptingOutEdgeToEdgeEnforcement(appInfo, true /* local */, a)) { && !a.getBoolean(R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false /* defValue */)) { getAttributes().privateFlags |= PRIVATE_FLAG_OVERRIDE_LAYOUT_IN_DISPLAY_CUTOUT_MODE; } Loading
services/core/java/com/android/server/wm/ActivityRecord.java +2 −3 Original line number Diff line number Diff line Loading @@ -367,7 +367,6 @@ import com.android.internal.content.ReferrerIntent; import com.android.internal.os.TimeoutRecord; import com.android.internal.os.TransferPipe; import com.android.internal.policy.AttributeCache; import com.android.internal.policy.PhoneWindow; import com.android.internal.protolog.ProtoLog; import com.android.internal.util.XmlUtils; import com.android.modules.utils.TypedXmlPullParser; Loading Loading @@ -2027,8 +2026,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A || ent.array.getBoolean(R.styleable.Window_windowShowWallpaper, false); mStyleFillsParent = mOccludesParent; mNoDisplay = ent.array.getBoolean(R.styleable.Window_windowNoDisplay, false); mOptOutEdgeToEdge = PhoneWindow.isOptingOutEdgeToEdgeEnforcement( aInfo.applicationInfo, false /* local */, ent.array); mOptOutEdgeToEdge = ent.array.getBoolean( R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false); } else { mStyleFillsParent = mOccludesParent = true; mNoDisplay = false; Loading