From 5895958535c410d11b49a6de03bcfc53b244339f Mon Sep 17 00:00:00 2001 From: Hawkwood Glazier Date: Fri, 14 Jul 2023 20:12:47 +0000 Subject: [PATCH] Disable Clock View Layer and ignore assigned alpha The Software Layer is causing clipping. Instead of that approach, we'll ignore the set alpha and compute our own alpha from the view's properties This prevents regressing in edge cases where onSetAlpha(255) is called from View. Bug: 291300765 Test: Manually checked many clocks and re-verified double clock bug Change-Id: I7f4813673cc6b61d7bc93d4984500c19bce41936 --- .../src/com/android/keyguard/KeyguardClockFrame.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockFrame.kt b/packages/SystemUI/src/com/android/keyguard/KeyguardClockFrame.kt index 50e5466d03259..1cb8e43cf2c81 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockFrame.kt +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockFrame.kt @@ -12,12 +12,9 @@ class KeyguardClockFrame( ) : FrameLayout(context, attrs) { private var drawAlpha: Int = 255 - init { - setLayerType(View.LAYER_TYPE_SOFTWARE, null) - } - protected override fun onSetAlpha(alpha: Int): Boolean { - drawAlpha = alpha + // Ignore alpha passed from View, prefer to compute it from set values + drawAlpha = (255 * this.alpha * transitionAlpha).toInt() return true }