diff options
| author | 2022-03-22 13:54:51 +0000 | |
|---|---|---|
| committer | 2022-03-22 13:54:51 +0000 | |
| commit | 005eea08b4bbea845ee832faafca9d76d060c817 (patch) | |
| tree | f9a3aef651c975fe158882265c9dd4c002586952 | |
| parent | de15991aec83e150492239604c3f156db36febfc (diff) | |
| parent | 894210fea9194d46b229516240323dcd4bf6d25a (diff) | |
Merge "Update transparent region when cutouts update" into tm-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt | 8 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/ScreenDecorHwcLayer.kt | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt b/packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt index 56046d9c057d..ccb5b1146a1c 100644 --- a/packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt +++ b/packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt @@ -79,6 +79,8 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView { override fun onAttachedToWindow() { super.onAttachedToWindow() updateCutout() + updateProtectionBoundingPath() + onUpdate() } fun onDisplayChanged(displayId: Int) { @@ -93,6 +95,7 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView { if (displayId == display.displayId) { updateCutout() updateProtectionBoundingPath() + onUpdate() } } @@ -100,8 +103,13 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView { displayRotation = rotation updateCutout() updateProtectionBoundingPath() + onUpdate() } + // Called after the cutout and protection bounding path change. Subclasses + // should make any changes that need to happen based on the change. + open fun onUpdate() = Unit + @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) public override fun onDraw(canvas: Canvas) { super.onDraw(canvas) diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorHwcLayer.kt b/packages/SystemUI/src/com/android/systemui/ScreenDecorHwcLayer.kt index ae4c365ff270..011881354e35 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorHwcLayer.kt +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorHwcLayer.kt @@ -114,6 +114,10 @@ class ScreenDecorHwcLayer(context: Context, displayDecorationSupport: DisplayDec } } + override fun onUpdate() { + parent.requestTransparentRegion(this) + } + override fun onDraw(canvas: Canvas) { // If updating onDraw, also update gatherTransparentRegion if (useInvertedAlphaColor) { |