Flag roundness/4: Remove LegacySourceType

Test: mp droid
Bug: 271843089
Change-Id: I7f59d2a181354cf3d38b24aced98c7ad856d291c
This commit is contained in:
omarmt
2023-04-20 10:11:43 +00:00
parent 33cd4ddfbe
commit d7978e74df
3 changed files with 0 additions and 51 deletions

View File

@@ -44,7 +44,6 @@ import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
import com.android.systemui.shade.transition.LargeScreenShadeInterpolator;
import com.android.systemui.statusbar.notification.LegacySourceType;
import com.android.systemui.statusbar.notification.NotificationUtils;
import com.android.systemui.statusbar.notification.SourceType;
import com.android.systemui.statusbar.notification.row.ActivatableNotificationView;
@@ -1082,15 +1081,6 @@ public class NotificationShelf extends ActivatableNotificationView implements St
child.requestRoundnessReset(SHELF_SCROLL);
}
/**
* This method resets the OnScroll roundness of a view to 0f
* <p>
* Note: This should be the only class that handles roundness {@code SourceType.OnScroll}
*/
public static void resetLegacyOnScrollRoundness(ExpandableView expandableView) {
expandableView.requestRoundnessReset(LegacySourceType.OnScroll);
}
@Override
public void dump(PrintWriter pwOriginal, String[] args) {
IndentingPrintWriter pw = DumpUtilsKt.asIndenting(pwOriginal);

View File

@@ -448,10 +448,3 @@ interface SourceType {
}
}
}
@Deprecated("Use SourceType.from() instead", ReplaceWith("SourceType.from()"))
enum class LegacySourceType : SourceType {
DefaultValue,
OnDismissAnimation,
OnScroll,
}

View File

@@ -12,7 +12,6 @@ import com.android.systemui.flags.Flags
import com.android.systemui.shade.transition.LargeScreenShadeInterpolator
import com.android.systemui.statusbar.NotificationShelf
import com.android.systemui.statusbar.StatusBarIconView
import com.android.systemui.statusbar.notification.LegacySourceType
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.ExpandableView
import com.android.systemui.statusbar.notification.row.NotificationTestHelper
@@ -359,39 +358,6 @@ class NotificationShelfTest : SysuiTestCase() {
)
}
@Test
fun resetOnScrollRoundness_shouldSetOnScrollTo0() {
val row: ExpandableNotificationRow = notificationTestHelper.createRowWithRoundness(
/* topRoundness = */ 1f,
/* bottomRoundness = */ 1f,
/* sourceType = */ LegacySourceType.OnScroll)
NotificationShelf.resetLegacyOnScrollRoundness(row)
assertEquals(0f, row.topRoundness)
assertEquals(0f, row.bottomRoundness)
}
@Test
fun resetOnScrollRoundness_shouldNotResetOtherRoundness() {
val row1: ExpandableNotificationRow = notificationTestHelper.createRowWithRoundness(
/* topRoundness = */ 1f,
/* bottomRoundness = */ 1f,
/* sourceType = */ LegacySourceType.DefaultValue)
val row2: ExpandableNotificationRow = notificationTestHelper.createRowWithRoundness(
/* topRoundness = */ 1f,
/* bottomRoundness = */ 1f,
/* sourceType = */ LegacySourceType.OnDismissAnimation)
NotificationShelf.resetLegacyOnScrollRoundness(row1)
NotificationShelf.resetLegacyOnScrollRoundness(row2)
assertEquals(1f, row1.topRoundness)
assertEquals(1f, row1.bottomRoundness)
assertEquals(1f, row2.topRoundness)
assertEquals(1f, row2.bottomRoundness)
}
private fun setFractionToShade(fraction: Float) {
whenever(ambientState.fractionToShade).thenReturn(fraction)
}