From 8f06d2e254c8db838227ac25f296689dba43088d Mon Sep 17 00:00:00 2001 From: Mariia Sandrikova Date: Tue, 24 Aug 2021 22:14:14 +0100 Subject: [PATCH] Support dynamic material color for letterbox background. - Use SystemUI context to access overlays with material colors extracted from wallpaper. - Allow to set color with a resource name via an ADB command. - Set background color to system_neutral2_500 Bug: 197361088 Test: atest WmTest:SizeCompatTests and manual with adb shell cmd window set-letterbox-style --backgroundColorResource @android:color/resource_name Change-Id: I6aa593b6697fc9846542739427eb09168cdb038b --- core/res/res/values/config.xml | 3 +- .../server/wm/LetterboxConfiguration.java | 51 +++++++++++++------ .../server/wm/WindowManagerService.java | 4 +- .../server/wm/WindowManagerShellCommand.java | 43 +++++++++++++--- 4 files changed, 74 insertions(+), 27 deletions(-) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 5d87f84332ae1..fa86b0efe3f4f 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -4848,9 +4848,8 @@ - Option 3 is selected for R.integer.config_letterboxBackgroundType and blur requested but isn't supported on the device or both dark scrim alpha and blur radius aren't provided. - Defaults to black if not specified. --> - #000 + @android:color/system_neutral2_500