Loading core/java/android/provider/Settings.java +10 −0 Original line number Diff line number Diff line Loading @@ -9362,6 +9362,16 @@ public final class Settings { public static final String DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM = "enable_sizecompat_freeform"; /** * If true, shadows drawn around the window will be rendered by the system compositor. If * false, shadows will be drawn by the client by setting an elevation on the root view and * the contents will be inset by the surface insets. * (0 = false, 1 = true) * @hide */ public static final String DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR = "render_shadows_in_compositor"; /** * Whether user has enabled development settings. */ Loading core/java/com/android/internal/policy/DecorView.java +9 −5 Original line number Diff line number Diff line Loading @@ -95,8 +95,6 @@ import android.view.ViewTreeObserver; import android.view.Window; import android.view.WindowCallbacks; import android.view.WindowInsets; import android.view.WindowInsets.Side; import android.view.WindowInsets.Type; import android.view.WindowInsetsController; import android.view.WindowManager; import android.view.accessibility.AccessibilityEvent; Loading Loading @@ -131,9 +129,9 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind private static final boolean SWEEP_OPEN_MENU = false; // The height of a window which has focus in DIP. private final static int DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP = 20; public static final int DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP = 20; // The height of a window which has not in DIP. private final static int DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP = 5; public static final int DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP = 5; private static final int SCRIM_LIGHT = 0xe6ffffff; // 90% white Loading Loading @@ -1629,7 +1627,9 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind int opacity = PixelFormat.OPAQUE; final WindowConfiguration winConfig = getResources().getConfiguration().windowConfiguration; if (winConfig.hasWindowShadow()) { // If we draw shadows in the compositor we don't need to force the surface to be // translucent. if (winConfig.hasWindowShadow() && !mWindow.mRenderShadowsInCompositor) { // If the window has a shadow, it must be translucent. opacity = PixelFormat.TRANSLUCENT; } else{ Loading Loading @@ -2414,6 +2414,10 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind } private void updateElevation() { // If rendering shadows in the compositor, don't set an elevation on the view if (mWindow.mRenderShadowsInCompositor) { return; } float elevation = 0; final boolean wasAdjustedForStack = mElevationAdjustedForStack; // Do not use a shadow when we are in resizing mode (mBackdropFrameRenderer not null) Loading core/java/com/android/internal/policy/PhoneWindow.java +8 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.internal.policy; import static android.provider.Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES; import static android.provider.Settings.Global.DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR; import static android.view.View.SYSTEM_UI_LAYOUT_FLAGS; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; Loading Loading @@ -134,6 +135,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { private final static String TAG = "PhoneWindow"; /* If true, shadows drawn around the window will be rendered by the system compositor. If * false, shadows will be drawn by the client by setting an elevation on the root view and * the contents will be inset by the shadow radius. */ public final boolean mRenderShadowsInCompositor; private static final boolean DEBUG = false; private final static int DEFAULT_BACKGROUND_FADE_DURATION_MS = 300; Loading Loading @@ -327,6 +333,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { public PhoneWindow(Context context) { super(context); mLayoutInflater = LayoutInflater.from(context); mRenderShadowsInCompositor = Settings.Global.getInt(context.getContentResolver(), DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR, 0) != 0; } /** Loading packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,7 @@ public class SettingsBackupTest { Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES, Settings.Global.DEVELOPMENT_FORCE_RTL, Settings.Global.DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM, Settings.Global.DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR, Settings.Global.DEVICE_DEMO_MODE, Settings.Global.DEVICE_IDLE_CONSTANTS, Settings.Global.BATTERY_SAVER_ADAPTIVE_CONSTANTS, Loading packages/SystemUI/res/values/styles.xml +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ <item name="android:windowIsTranslucent">true</item> <item name="android:windowNoTitle">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowBackground">@null</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:colorBackgroundCacheHint">@null</item> <item name="android:statusBarColor">@*android:color/transparent</item> <item name="android:windowAnimationStyle">@style/Animation.PipPhoneOverlayControl</item> Loading Loading
core/java/android/provider/Settings.java +10 −0 Original line number Diff line number Diff line Loading @@ -9362,6 +9362,16 @@ public final class Settings { public static final String DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM = "enable_sizecompat_freeform"; /** * If true, shadows drawn around the window will be rendered by the system compositor. If * false, shadows will be drawn by the client by setting an elevation on the root view and * the contents will be inset by the surface insets. * (0 = false, 1 = true) * @hide */ public static final String DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR = "render_shadows_in_compositor"; /** * Whether user has enabled development settings. */ Loading
core/java/com/android/internal/policy/DecorView.java +9 −5 Original line number Diff line number Diff line Loading @@ -95,8 +95,6 @@ import android.view.ViewTreeObserver; import android.view.Window; import android.view.WindowCallbacks; import android.view.WindowInsets; import android.view.WindowInsets.Side; import android.view.WindowInsets.Type; import android.view.WindowInsetsController; import android.view.WindowManager; import android.view.accessibility.AccessibilityEvent; Loading Loading @@ -131,9 +129,9 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind private static final boolean SWEEP_OPEN_MENU = false; // The height of a window which has focus in DIP. private final static int DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP = 20; public static final int DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP = 20; // The height of a window which has not in DIP. private final static int DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP = 5; public static final int DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP = 5; private static final int SCRIM_LIGHT = 0xe6ffffff; // 90% white Loading Loading @@ -1629,7 +1627,9 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind int opacity = PixelFormat.OPAQUE; final WindowConfiguration winConfig = getResources().getConfiguration().windowConfiguration; if (winConfig.hasWindowShadow()) { // If we draw shadows in the compositor we don't need to force the surface to be // translucent. if (winConfig.hasWindowShadow() && !mWindow.mRenderShadowsInCompositor) { // If the window has a shadow, it must be translucent. opacity = PixelFormat.TRANSLUCENT; } else{ Loading Loading @@ -2414,6 +2414,10 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind } private void updateElevation() { // If rendering shadows in the compositor, don't set an elevation on the view if (mWindow.mRenderShadowsInCompositor) { return; } float elevation = 0; final boolean wasAdjustedForStack = mElevationAdjustedForStack; // Do not use a shadow when we are in resizing mode (mBackdropFrameRenderer not null) Loading
core/java/com/android/internal/policy/PhoneWindow.java +8 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.internal.policy; import static android.provider.Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES; import static android.provider.Settings.Global.DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR; import static android.view.View.SYSTEM_UI_LAYOUT_FLAGS; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; Loading Loading @@ -134,6 +135,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { private final static String TAG = "PhoneWindow"; /* If true, shadows drawn around the window will be rendered by the system compositor. If * false, shadows will be drawn by the client by setting an elevation on the root view and * the contents will be inset by the shadow radius. */ public final boolean mRenderShadowsInCompositor; private static final boolean DEBUG = false; private final static int DEFAULT_BACKGROUND_FADE_DURATION_MS = 300; Loading Loading @@ -327,6 +333,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { public PhoneWindow(Context context) { super(context); mLayoutInflater = LayoutInflater.from(context); mRenderShadowsInCompositor = Settings.Global.getInt(context.getContentResolver(), DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR, 0) != 0; } /** Loading
packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,7 @@ public class SettingsBackupTest { Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES, Settings.Global.DEVELOPMENT_FORCE_RTL, Settings.Global.DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM, Settings.Global.DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR, Settings.Global.DEVICE_DEMO_MODE, Settings.Global.DEVICE_IDLE_CONSTANTS, Settings.Global.BATTERY_SAVER_ADAPTIVE_CONSTANTS, Loading
packages/SystemUI/res/values/styles.xml +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ <item name="android:windowIsTranslucent">true</item> <item name="android:windowNoTitle">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowBackground">@null</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:colorBackgroundCacheHint">@null</item> <item name="android:statusBarColor">@*android:color/transparent</item> <item name="android:windowAnimationStyle">@style/Animation.PipPhoneOverlayControl</item> Loading