Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb8aeffb authored by Tiger Huang's avatar Tiger Huang Committed by Android (Google) Code Review
Browse files

Merge "Let certain apps go edge-to-edge by default" into main

parents adbb273e 86f09613
Loading
Loading
Loading
Loading
+23 −1
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.provider.Settings;
import android.text.TextUtils;
import android.transition.Scene;
@@ -182,6 +183,12 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {

    private static final Transition USE_DEFAULT_TRANSITION = new TransitionSet();

    /**
     * Since which target SDK version this window should be edge-to-edge by default.
     */
    private static final int DEFAULT_EDGE_TO_EDGE_SDK_VERSION =
            SystemProperties.getInt("persist.wm.debug.default_e2e_since_sdk", Integer.MAX_VALUE);

    /**
     * Simple callback used by the context menu and its submenus. The options
     * menu submenus do not use this (their behavior is more complex).
@@ -359,6 +366,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {

    boolean mDecorFitsSystemWindows = true;

    private final boolean mDefaultEdgeToEdge;

    private final ProxyOnBackInvokedDispatcher mProxyOnBackInvokedDispatcher;

    static class WindowManagerHolder {
@@ -377,6 +386,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        mProxyOnBackInvokedDispatcher = new ProxyOnBackInvokedDispatcher(context);
        mAllowFloatingWindowsFillScreen = context.getResources().getBoolean(
                com.android.internal.R.bool.config_allowFloatingWindowsFillScreen);
        mDefaultEdgeToEdge =
                context.getApplicationInfo().targetSdkVersion >= DEFAULT_EDGE_TO_EDGE_SDK_VERSION;
        if (mDefaultEdgeToEdge) {
            mDecorFitsSystemWindows = false;
        }
    }

    /**
@@ -2527,7 +2541,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        final boolean targetPreQ = targetSdk < Build.VERSION_CODES.Q;

        if (!mForcedStatusBarColor) {
            mStatusBarColor = a.getColor(R.styleable.Window_statusBarColor, Color.BLACK);
            final int statusBarCompatibleColor = context.getColor(R.color.status_bar_compatible);
            final int statusBarDefaultColor = context.getColor(R.color.status_bar_default);
            final int statusBarColor = a.getColor(R.styleable.Window_statusBarColor,
                    statusBarDefaultColor);

            mStatusBarColor = statusBarColor == statusBarDefaultColor && !mDefaultEdgeToEdge
                    ? statusBarCompatibleColor
                    : statusBarColor;
        }
        if (!mForcedNavigationBarColor) {
            final int navBarCompatibleColor = context.getColor(R.color.navigation_bar_compatible);
@@ -2541,6 +2562,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                                    && Flags.navBarTransparentByDefault())
                            && !context.getResources().getBoolean(
                                    R.bool.config_navBarDefaultTransparent)
                            && !mDefaultEdgeToEdge
                    ? navBarCompatibleColor
                    : navBarColor;

+4 −0
Original line number Diff line number Diff line
@@ -568,6 +568,10 @@
    <color name="side_fps_button_color">#00677E</color>

    <!-- Color for system bars -->
    <color name="status_bar_compatible">@android:color/black</color>
    <!-- This uses non-regular transparent intentionally. It is used to tell if the transparent
         color is set by the framework or not. -->
    <color name="status_bar_default">#00808080</color>
    <color name="navigation_bar_compatible">@android:color/black</color>
    <!-- This uses non-regular transparent intentionally. It is used to tell if the transparent
         color is set by the framework or not. -->
+2 −0
Original line number Diff line number Diff line
@@ -3074,6 +3074,8 @@
  <java-symbol type="bool" name="config_navBarDefaultTransparent" />
  <java-symbol type="color" name="navigation_bar_default"/>
  <java-symbol type="color" name="navigation_bar_compatible"/>
  <java-symbol type="color" name="status_bar_default"/>
  <java-symbol type="color" name="status_bar_compatible"/>

  <!-- EditText suggestion popup. -->
  <java-symbol type="id" name="suggestionWindowContainer" />
+1 −1
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ please see themes_device_defaults.xml.
        <item name="windowTranslucentStatus">false</item>
        <item name="windowTranslucentNavigation">false</item>
        <item name="windowDrawsSystemBarBackgrounds">false</item>
        <item name="statusBarColor">@color/black</item>
        <item name="statusBarColor">@color/status_bar_default</item>
        <item name="navigationBarColor">@color/navigation_bar_default</item>
        <item name="windowActionBarFullscreenDecorLayout">@layout/screen_action_bar</item>
        <item name="windowContentTransitions">false</item>