From e397be65d6b7fc1a639997c2a5a377772d3f3e58 Mon Sep 17 00:00:00 2001 From: Milton Wu Date: Thu, 24 Mar 2022 01:52:06 +0000 Subject: [PATCH] Revert "Support tuning sysui_rounded_size" This reverts commit b432ba94bb41719d90bde01ab8cf1331dc60e80c. Reason for revert: Missed frame on lockscreen swipe Bug: 226240098 Change-Id: I4db140127c770083a44ddf92effd256e78cfc793 --- .../systemui/decor/RoundedCornerResDelegate.kt | 11 +++++------ .../systemui/decor/RoundedCornerResDelegateTest.kt | 8 ++++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerResDelegate.kt b/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerResDelegate.kt index 1d38e58dd48c6..256c6751c443b 100644 --- a/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerResDelegate.kt +++ b/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerResDelegate.kt @@ -125,18 +125,17 @@ class RoundedCornerResDelegate( bottomRoundedSize = Size(bottomRadius, bottomRadius) } + if (roundedSizeFactor != null && roundedSizeFactor > 0) { + val length: Int = (roundedSizeFactor * density).toInt() + roundedSize = Size(length, length) + } + if (topRoundedSize.width == 0) { topRoundedSize = roundedSize } if (bottomRoundedSize.width == 0) { bottomRoundedSize = roundedSize } - - if (roundedSizeFactor != null && roundedSizeFactor > 0) { - val length: Int = (roundedSizeFactor * density).toInt() - topRoundedSize = Size(length, length) - bottomRoundedSize = Size(length, length) - } } fun updateTuningSizeFactor(factor: Int?, newReloadToken: Int) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/decor/RoundedCornerResDelegateTest.kt b/packages/SystemUI/tests/src/com/android/systemui/decor/RoundedCornerResDelegateTest.kt index e89ed309a1b6f..fb6ff76a4e381 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/decor/RoundedCornerResDelegateTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/decor/RoundedCornerResDelegateTest.kt @@ -102,9 +102,8 @@ class RoundedCornerResDelegateTest : SysuiTestCase() { fun testUpdateTuningSizeFactor() { mContext.orCreateTestableResources.addOverrides( mockTypeArray = mockTypedArray, - radius = 1, radiusTop = 0, - radiusBottom = 2, + radiusBottom = 0, multipleRadius = false) roundedCornerResDelegate = RoundedCornerResDelegate(mContext.resources, null) @@ -116,6 +115,11 @@ class RoundedCornerResDelegateTest : SysuiTestCase() { assertEquals(Size(length, length), roundedCornerResDelegate.topRoundedSize) assertEquals(Size(length, length), roundedCornerResDelegate.bottomRoundedSize) + mContext.orCreateTestableResources.addOverrides( + mockTypeArray = mockTypedArray, + radiusTop = 1, + radiusBottom = 2, + multipleRadius = false) roundedCornerResDelegate.updateTuningSizeFactor(null, 2) assertEquals(Size(1, 1), roundedCornerResDelegate.topRoundedSize)