commit | e32c6e284d353a7db2a184a0e135dd4ece9794fc | [log] [tgz] |
---|---|---|
author | Matt Sziklay <mattsziklay@google.com> | Fri Jun 02 00:18:02 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Jun 02 00:18:02 2023 +0000 |
tree | 5fe203bc56d12396b48ec9141f3218569c4e64a5 | |
parent | 4539a2f1ef76889de69040a332335a398954fbb3 [diff] | |
parent | f502b113992cb43176ad4f76d57b801bf640c8a3 [diff] |
Merge "Use status bar appearance to determine header element brightness." into udc-qpr-dev am: f502b11399 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23517670 Change-Id: I520532f79dd62f03d208ed62c56ca34d74f19d5d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeWindowDecorationViewHolder.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeWindowDecorationViewHolder.kt index 514ea52..76c80f7 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeWindowDecorationViewHolder.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/DesktopModeWindowDecorationViewHolder.kt
@@ -4,7 +4,7 @@ import android.content.Context import android.graphics.Color import android.view.View - +import android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS /** * Encapsulates the root [View] of a window decoration and its children to facilitate looking up * children (via findViewById) and updating to the latest data from [RunningTaskInfo]. @@ -23,6 +23,10 @@ * with the caption background color. */ protected fun shouldUseLightCaptionColors(taskInfo: RunningTaskInfo): Boolean { - return Color.valueOf(taskInfo.taskDescription.statusBarColor).luminance() < 0.5 + return if (Color.alpha(taskInfo.taskDescription.statusBarColor) != 0) { + Color.valueOf(taskInfo.taskDescription.statusBarColor).luminance() < 0.5 + } else { + taskInfo.taskDescription.statusBarAppearance and APPEARANCE_LIGHT_STATUS_BARS == 0 + } } }