Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/AvalancheControllerTest.kt +38 −18 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ import com.android.systemui.statusbar.policy.HeadsUpManagerTestUtil.createFullSc import com.android.systemui.util.concurrency.FakeExecutor import com.android.systemui.util.settings.FakeGlobalSettings import com.android.systemui.util.time.FakeSystemClock import com.google.common.truth.Truth import com.google.common.truth.Truth.assertThat import org.junit.Before import org.junit.Rule import org.junit.Test Loading Loading @@ -132,7 +132,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.update(headsUpEntry, runnableMock!!, "testLabel") // Entry is showing now Truth.assertThat(mAvalancheController.headsUpEntryShowing).isEqualTo(headsUpEntry) assertThat(mAvalancheController.headsUpEntryShowing).isEqualTo(headsUpEntry) } @Test Loading @@ -147,14 +147,14 @@ class AvalancheControllerTest : SysuiTestCase() { // Entry has one Runnable val runnableList: List<Runnable?>? = mAvalancheController.nextMap[headsUpEntry] Truth.assertThat(runnableList).isNotNull() Truth.assertThat(runnableList!!.size).isEqualTo(1) assertThat(runnableList).isNotNull() assertThat(runnableList!!.size).isEqualTo(1) // Update mAvalancheController.update(headsUpEntry, runnableMock, "testLabel") // Entry has two Runnables Truth.assertThat(runnableList.size).isEqualTo(2) assertThat(runnableList.size).isEqualTo(2) } @Test Loading @@ -172,7 +172,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.update(headsUpEntry, runnableMock!!, "testLabel") // Entry is next Truth.assertThat(mAvalancheController.nextMap.containsKey(headsUpEntry)).isTrue() assertThat(mAvalancheController.nextMap.containsKey(headsUpEntry)).isTrue() } @Test Loading @@ -185,7 +185,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.delete(headsUpEntry, runnableMock, "testLabel") // Entry was removed from next Truth.assertThat(mAvalancheController.nextMap.containsKey(headsUpEntry)).isFalse() assertThat(mAvalancheController.nextMap.containsKey(headsUpEntry)).isFalse() // Runnable was not run Mockito.verify(runnableMock, Mockito.times(0)).run() Loading @@ -201,7 +201,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.delete(headsUpEntry, runnableMock!!, "testLabel") // Entry was removed from dropSet Truth.assertThat(mAvalancheController.debugDropSet.contains(headsUpEntry)).isFalse() assertThat(mAvalancheController.debugDropSet.contains(headsUpEntry)).isFalse() } @Test Loading Loading @@ -244,7 +244,27 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.delete(showingEntry, runnableMock, "testLabel") // Next entry is shown Truth.assertThat(mAvalancheController.headsUpEntryShowing).isEqualTo(nextEntry) assertThat(mAvalancheController.headsUpEntryShowing).isEqualTo(nextEntry) } @Test fun testDelete_showingEntryKeyBecomesPreviousHunKey() { mAvalancheController.previousHunKey = "" // Entry is showing val showingEntry = createHeadsUpEntry(id = 0) mAvalancheController.headsUpEntryShowing = showingEntry // There's another entry waiting to show next val nextEntry = createHeadsUpEntry(id = 1) mAvalancheController.addToNext(nextEntry, runnableMock!!) // Delete mAvalancheController.delete(showingEntry, runnableMock, "testLabel") // Next entry is shown assertThat(mAvalancheController.previousHunKey).isEqualTo(showingEntry.mEntry!!.key) } @Test Loading @@ -258,7 +278,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.clearNext() val durationMs = mAvalancheController.getDurationMs(givenEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(5000) assertThat(durationMs).isEqualTo(5000) } @Test Loading @@ -273,7 +293,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.addToNext(nextEntry, runnableMock!!) val durationMs = mAvalancheController.getDurationMs(givenEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(5000) assertThat(durationMs).isEqualTo(5000) } @Test Loading @@ -286,7 +306,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.clearNext() val durationMs = mAvalancheController.getDurationMs(showingEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(5000) assertThat(durationMs).isEqualTo(5000) } @Test Loading @@ -300,10 +320,10 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.addToNext(nextEntry, runnableMock!!) // Next entry has lower priority Truth.assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(1) assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(1) val durationMs = mAvalancheController.getDurationMs(showingEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(5000) assertThat(durationMs).isEqualTo(5000) } @Test Loading @@ -317,10 +337,10 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.addToNext(nextEntry, runnableMock!!) // Same priority Truth.assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(0) assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(0) val durationMs = mAvalancheController.getDurationMs(showingEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(1000) assertThat(durationMs).isEqualTo(1000) } @Test Loading @@ -334,9 +354,9 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.addToNext(nextEntry, runnableMock!!) // Next entry has higher priority Truth.assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(-1) assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(-1) val durationMs = mAvalancheController.getDurationMs(showingEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(500) assertThat(durationMs).isEqualTo(500) } } packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +14 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm.BypassController; import com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm.SectionProvider; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.policy.AvalancheController; import java.io.PrintWriter; Loading @@ -56,6 +57,8 @@ public class AmbientState implements Dumpable { private final SectionProvider mSectionProvider; private final BypassController mBypassController; private final LargeScreenShadeInterpolator mLargeScreenShadeInterpolator; private final AvalancheController mAvalancheController; /** * Used to read bouncer states. */ Loading Loading @@ -269,12 +272,14 @@ public class AmbientState implements Dumpable { @NonNull SectionProvider sectionProvider, @NonNull BypassController bypassController, @Nullable StatusBarKeyguardViewManager statusBarKeyguardViewManager, @NonNull LargeScreenShadeInterpolator largeScreenShadeInterpolator @NonNull LargeScreenShadeInterpolator largeScreenShadeInterpolator, AvalancheController avalancheController ) { mSectionProvider = sectionProvider; mBypassController = bypassController; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mLargeScreenShadeInterpolator = largeScreenShadeInterpolator; mAvalancheController = avalancheController; reload(context); dumpManager.registerDumpable(this); } Loading @@ -287,6 +292,14 @@ public class AmbientState implements Dumpable { mBaseZHeight = getBaseHeight(mZDistanceBetweenElements); } String getAvalancheShowingHunKey() { return mAvalancheController.getShowingHunKey(); } String getAvalanchePreviousHunKey() { return mAvalancheController.getPreviousHunKey(); } void setOverExpansion(float overExpansion) { mOverExpansion = overExpansion; } Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/AvalancheController.kt +14 −4 Original line number Diff line number Diff line Loading @@ -40,6 +40,9 @@ class AvalancheController @Inject constructor( // HUN showing right now, in the floating state where full shade is hidden, on launcher or AOD @VisibleForTesting var headsUpEntryShowing: HeadsUpEntry? = null // Key of HUN previously showing, is being removed or was removed var previousHunKey: String = "" // List of runnables to run for the HUN showing right now private var headsUpEntryShowingRunnableList: MutableList<Runnable> = ArrayList() Loading @@ -63,6 +66,10 @@ class AvalancheController @Inject constructor( dumpManager.registerNormalDumpable(tag, /* module */ this) } fun getShowingHunKey(): String { return getKey(headsUpEntryShowing) } /** Run or delay Runnable for given HeadsUpEntry */ fun update(entry: HeadsUpEntry?, runnable: Runnable, label: String) { if (!NotificationThrottleHun.isEnabled) { Loading Loading @@ -134,8 +141,10 @@ class AvalancheController @Inject constructor( debugDropSet.remove(entry) } else if (isShowing(entry)) { log { "$fn => [remove showing ${getKey(entry)}]" } previousHunKey = getKey(headsUpEntryShowing) runnable.run() showNext() showNextAfterRemove() } else { log { "$fn => [removing untracked ${getKey(entry)}]" } } Loading Loading @@ -238,7 +247,7 @@ class AvalancheController @Inject constructor( } } private fun showNext() { private fun showNextAfterRemove() { log { "SHOW NEXT" } headsUpEntryShowing = null Loading Loading @@ -284,6 +293,7 @@ class AvalancheController @Inject constructor( private fun getStateStr(): String { return "SHOWING: [${getKey(headsUpEntryShowing)}]" + "\nPREVIOUS: [$previousHunKey]" + "\nNEXT LIST: $nextListStr" + "\nNEXT MAP: $nextMapStr" + "\nDROPPED: $dropSetStr" Loading Loading @@ -325,10 +335,10 @@ class AvalancheController @Inject constructor( fun getKey(entry: HeadsUpEntry?): String { if (entry == null) { return "null" return "HeadsUpEntry null" } if (entry.mEntry == null) { return entry.toString() return "HeadsUpEntry.mEntry null" } return entry.mEntry!!.key } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/AmbientStateTest.kt +4 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import com.android.systemui.dump.DumpManager import com.android.systemui.shade.transition.LargeScreenShadeInterpolator import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager import com.android.systemui.statusbar.policy.AvalancheController import com.android.systemui.util.mockito.mock import com.android.systemui.util.mockito.whenever import com.google.common.truth.Truth.assertThat Loading @@ -41,6 +42,7 @@ class AmbientStateTest : SysuiTestCase() { private val bypassController = StackScrollAlgorithm.BypassController { false } private val statusBarKeyguardViewManager = mock<StatusBarKeyguardViewManager>() private val largeScreenShadeInterpolator = mock<LargeScreenShadeInterpolator>() private val avalancheController = mock<AvalancheController>() private lateinit var sut: AmbientState Loading @@ -53,7 +55,8 @@ class AmbientStateTest : SysuiTestCase() { sectionProvider, bypassController, statusBarKeyguardViewManager, largeScreenShadeInterpolator largeScreenShadeInterpolator, avalancheController ) } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ import com.android.systemui.statusbar.notification.shared.NotificationsHeadsUpRe import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.policy.AvalancheController; import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController; import org.junit.Assert; Loading Loading @@ -140,6 +141,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Mock private NotificationStackSizeCalculator mNotificationStackSizeCalculator; @Mock private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; @Mock private LargeScreenShadeInterpolator mLargeScreenShadeInterpolator; @Mock private AvalancheController mAvalancheController; @Before public void setUp() throws Exception { Loading @@ -153,7 +155,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mNotificationSectionsManager, mBypassController, mStatusBarKeyguardViewManager, mLargeScreenShadeInterpolator mLargeScreenShadeInterpolator, mAvalancheController )); // Register the debug flags we use Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/AvalancheControllerTest.kt +38 −18 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ import com.android.systemui.statusbar.policy.HeadsUpManagerTestUtil.createFullSc import com.android.systemui.util.concurrency.FakeExecutor import com.android.systemui.util.settings.FakeGlobalSettings import com.android.systemui.util.time.FakeSystemClock import com.google.common.truth.Truth import com.google.common.truth.Truth.assertThat import org.junit.Before import org.junit.Rule import org.junit.Test Loading Loading @@ -132,7 +132,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.update(headsUpEntry, runnableMock!!, "testLabel") // Entry is showing now Truth.assertThat(mAvalancheController.headsUpEntryShowing).isEqualTo(headsUpEntry) assertThat(mAvalancheController.headsUpEntryShowing).isEqualTo(headsUpEntry) } @Test Loading @@ -147,14 +147,14 @@ class AvalancheControllerTest : SysuiTestCase() { // Entry has one Runnable val runnableList: List<Runnable?>? = mAvalancheController.nextMap[headsUpEntry] Truth.assertThat(runnableList).isNotNull() Truth.assertThat(runnableList!!.size).isEqualTo(1) assertThat(runnableList).isNotNull() assertThat(runnableList!!.size).isEqualTo(1) // Update mAvalancheController.update(headsUpEntry, runnableMock, "testLabel") // Entry has two Runnables Truth.assertThat(runnableList.size).isEqualTo(2) assertThat(runnableList.size).isEqualTo(2) } @Test Loading @@ -172,7 +172,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.update(headsUpEntry, runnableMock!!, "testLabel") // Entry is next Truth.assertThat(mAvalancheController.nextMap.containsKey(headsUpEntry)).isTrue() assertThat(mAvalancheController.nextMap.containsKey(headsUpEntry)).isTrue() } @Test Loading @@ -185,7 +185,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.delete(headsUpEntry, runnableMock, "testLabel") // Entry was removed from next Truth.assertThat(mAvalancheController.nextMap.containsKey(headsUpEntry)).isFalse() assertThat(mAvalancheController.nextMap.containsKey(headsUpEntry)).isFalse() // Runnable was not run Mockito.verify(runnableMock, Mockito.times(0)).run() Loading @@ -201,7 +201,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.delete(headsUpEntry, runnableMock!!, "testLabel") // Entry was removed from dropSet Truth.assertThat(mAvalancheController.debugDropSet.contains(headsUpEntry)).isFalse() assertThat(mAvalancheController.debugDropSet.contains(headsUpEntry)).isFalse() } @Test Loading Loading @@ -244,7 +244,27 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.delete(showingEntry, runnableMock, "testLabel") // Next entry is shown Truth.assertThat(mAvalancheController.headsUpEntryShowing).isEqualTo(nextEntry) assertThat(mAvalancheController.headsUpEntryShowing).isEqualTo(nextEntry) } @Test fun testDelete_showingEntryKeyBecomesPreviousHunKey() { mAvalancheController.previousHunKey = "" // Entry is showing val showingEntry = createHeadsUpEntry(id = 0) mAvalancheController.headsUpEntryShowing = showingEntry // There's another entry waiting to show next val nextEntry = createHeadsUpEntry(id = 1) mAvalancheController.addToNext(nextEntry, runnableMock!!) // Delete mAvalancheController.delete(showingEntry, runnableMock, "testLabel") // Next entry is shown assertThat(mAvalancheController.previousHunKey).isEqualTo(showingEntry.mEntry!!.key) } @Test Loading @@ -258,7 +278,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.clearNext() val durationMs = mAvalancheController.getDurationMs(givenEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(5000) assertThat(durationMs).isEqualTo(5000) } @Test Loading @@ -273,7 +293,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.addToNext(nextEntry, runnableMock!!) val durationMs = mAvalancheController.getDurationMs(givenEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(5000) assertThat(durationMs).isEqualTo(5000) } @Test Loading @@ -286,7 +306,7 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.clearNext() val durationMs = mAvalancheController.getDurationMs(showingEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(5000) assertThat(durationMs).isEqualTo(5000) } @Test Loading @@ -300,10 +320,10 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.addToNext(nextEntry, runnableMock!!) // Next entry has lower priority Truth.assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(1) assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(1) val durationMs = mAvalancheController.getDurationMs(showingEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(5000) assertThat(durationMs).isEqualTo(5000) } @Test Loading @@ -317,10 +337,10 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.addToNext(nextEntry, runnableMock!!) // Same priority Truth.assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(0) assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(0) val durationMs = mAvalancheController.getDurationMs(showingEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(1000) assertThat(durationMs).isEqualTo(1000) } @Test Loading @@ -334,9 +354,9 @@ class AvalancheControllerTest : SysuiTestCase() { mAvalancheController.addToNext(nextEntry, runnableMock!!) // Next entry has higher priority Truth.assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(-1) assertThat(nextEntry.compareNonTimeFields(showingEntry)).isEqualTo(-1) val durationMs = mAvalancheController.getDurationMs(showingEntry, autoDismissMs = 5000) Truth.assertThat(durationMs).isEqualTo(500) assertThat(durationMs).isEqualTo(500) } }
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +14 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm.BypassController; import com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm.SectionProvider; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.policy.AvalancheController; import java.io.PrintWriter; Loading @@ -56,6 +57,8 @@ public class AmbientState implements Dumpable { private final SectionProvider mSectionProvider; private final BypassController mBypassController; private final LargeScreenShadeInterpolator mLargeScreenShadeInterpolator; private final AvalancheController mAvalancheController; /** * Used to read bouncer states. */ Loading Loading @@ -269,12 +272,14 @@ public class AmbientState implements Dumpable { @NonNull SectionProvider sectionProvider, @NonNull BypassController bypassController, @Nullable StatusBarKeyguardViewManager statusBarKeyguardViewManager, @NonNull LargeScreenShadeInterpolator largeScreenShadeInterpolator @NonNull LargeScreenShadeInterpolator largeScreenShadeInterpolator, AvalancheController avalancheController ) { mSectionProvider = sectionProvider; mBypassController = bypassController; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mLargeScreenShadeInterpolator = largeScreenShadeInterpolator; mAvalancheController = avalancheController; reload(context); dumpManager.registerDumpable(this); } Loading @@ -287,6 +292,14 @@ public class AmbientState implements Dumpable { mBaseZHeight = getBaseHeight(mZDistanceBetweenElements); } String getAvalancheShowingHunKey() { return mAvalancheController.getShowingHunKey(); } String getAvalanchePreviousHunKey() { return mAvalancheController.getPreviousHunKey(); } void setOverExpansion(float overExpansion) { mOverExpansion = overExpansion; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/AvalancheController.kt +14 −4 Original line number Diff line number Diff line Loading @@ -40,6 +40,9 @@ class AvalancheController @Inject constructor( // HUN showing right now, in the floating state where full shade is hidden, on launcher or AOD @VisibleForTesting var headsUpEntryShowing: HeadsUpEntry? = null // Key of HUN previously showing, is being removed or was removed var previousHunKey: String = "" // List of runnables to run for the HUN showing right now private var headsUpEntryShowingRunnableList: MutableList<Runnable> = ArrayList() Loading @@ -63,6 +66,10 @@ class AvalancheController @Inject constructor( dumpManager.registerNormalDumpable(tag, /* module */ this) } fun getShowingHunKey(): String { return getKey(headsUpEntryShowing) } /** Run or delay Runnable for given HeadsUpEntry */ fun update(entry: HeadsUpEntry?, runnable: Runnable, label: String) { if (!NotificationThrottleHun.isEnabled) { Loading Loading @@ -134,8 +141,10 @@ class AvalancheController @Inject constructor( debugDropSet.remove(entry) } else if (isShowing(entry)) { log { "$fn => [remove showing ${getKey(entry)}]" } previousHunKey = getKey(headsUpEntryShowing) runnable.run() showNext() showNextAfterRemove() } else { log { "$fn => [removing untracked ${getKey(entry)}]" } } Loading Loading @@ -238,7 +247,7 @@ class AvalancheController @Inject constructor( } } private fun showNext() { private fun showNextAfterRemove() { log { "SHOW NEXT" } headsUpEntryShowing = null Loading Loading @@ -284,6 +293,7 @@ class AvalancheController @Inject constructor( private fun getStateStr(): String { return "SHOWING: [${getKey(headsUpEntryShowing)}]" + "\nPREVIOUS: [$previousHunKey]" + "\nNEXT LIST: $nextListStr" + "\nNEXT MAP: $nextMapStr" + "\nDROPPED: $dropSetStr" Loading Loading @@ -325,10 +335,10 @@ class AvalancheController @Inject constructor( fun getKey(entry: HeadsUpEntry?): String { if (entry == null) { return "null" return "HeadsUpEntry null" } if (entry.mEntry == null) { return entry.toString() return "HeadsUpEntry.mEntry null" } return entry.mEntry!!.key } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/AmbientStateTest.kt +4 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import com.android.systemui.dump.DumpManager import com.android.systemui.shade.transition.LargeScreenShadeInterpolator import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager import com.android.systemui.statusbar.policy.AvalancheController import com.android.systemui.util.mockito.mock import com.android.systemui.util.mockito.whenever import com.google.common.truth.Truth.assertThat Loading @@ -41,6 +42,7 @@ class AmbientStateTest : SysuiTestCase() { private val bypassController = StackScrollAlgorithm.BypassController { false } private val statusBarKeyguardViewManager = mock<StatusBarKeyguardViewManager>() private val largeScreenShadeInterpolator = mock<LargeScreenShadeInterpolator>() private val avalancheController = mock<AvalancheController>() private lateinit var sut: AmbientState Loading @@ -53,7 +55,8 @@ class AmbientStateTest : SysuiTestCase() { sectionProvider, bypassController, statusBarKeyguardViewManager, largeScreenShadeInterpolator largeScreenShadeInterpolator, avalancheController ) } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ import com.android.systemui.statusbar.notification.shared.NotificationsHeadsUpRe import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.policy.AvalancheController; import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController; import org.junit.Assert; Loading Loading @@ -140,6 +141,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Mock private NotificationStackSizeCalculator mNotificationStackSizeCalculator; @Mock private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; @Mock private LargeScreenShadeInterpolator mLargeScreenShadeInterpolator; @Mock private AvalancheController mAvalancheController; @Before public void setUp() throws Exception { Loading @@ -153,7 +155,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mNotificationSectionsManager, mBypassController, mStatusBarKeyguardViewManager, mLargeScreenShadeInterpolator mLargeScreenShadeInterpolator, mAvalancheController )); // Register the debug flags we use Loading