From e7a7053c14ccb9e2c2c082b257cd9187eb80cc7b Mon Sep 17 00:00:00 2001 From: Yining Liu Date: Tue, 5 Nov 2024 20:31:01 +0000 Subject: Fix minimalism feature not responding to settings change Fix the bug when we change the secure settings value through settings app or command line, the minimalism feature does not respond to the setting change. Fix: 377546277 Bug: 354047572 Flag: com.android.server.notification.notification_minimalism Test: adb shell settings secure put lock_screen_notification_minimalism \<1|0> Change-Id: I6d46c7a069c3f3ce5aa0e01723df177d8225aa7b --- .../stack/NotificationStackSizeCalculatorTest.kt | 10 +++++- .../coordinator/LockScreenMinimalismCoordinator.kt | 23 ++++++++------ .../stack/NotificationStackSizeCalculator.kt | 36 ++++++++++++++++++++-- 3 files changed, 55 insertions(+), 14 deletions(-) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt index dae5542123ed..7b73da2737e8 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt @@ -23,14 +23,17 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.res.R import com.android.systemui.SysuiTestCase +import com.android.systemui.kosmos.testScope import com.android.systemui.media.controls.domain.pipeline.MediaDataManager import com.android.systemui.statusbar.LockscreenShadeTransitionController import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.SysuiStatusBarStateController import com.android.systemui.statusbar.notification.collection.NotificationEntry +import com.android.systemui.statusbar.notification.domain.interactor.SeenNotificationsInteractor import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.ExpandableView import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.eq import com.android.systemui.util.mockito.nullable @@ -52,8 +55,11 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { private lateinit var lockscreenShadeTransitionController: LockscreenShadeTransitionController @Mock private lateinit var mediaDataManager: MediaDataManager @Mock private lateinit var stackLayout: NotificationStackScrollLayout + @Mock private lateinit var seenNotificationsInteractor: SeenNotificationsInteractor private val testableResources = mContext.orCreateTestableResources + private val kosmos = testKosmos() + private val testScope = kosmos.testScope private lateinit var sizeCalculator: NotificationStackSizeCalculator @@ -72,7 +78,9 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { lockscreenShadeTransitionController = lockscreenShadeTransitionController, mediaDataManager = mediaDataManager, testableResources.resources, - ResourcesSplitShadeStateController() + ResourcesSplitShadeStateController(), + seenNotificationsInteractor = seenNotificationsInteractor, + scope = kosmos.testScope, ) } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/LockScreenMinimalismCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/LockScreenMinimalismCoordinator.kt index 2fded34a56a0..e2328497d9ea 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/LockScreenMinimalismCoordinator.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/LockScreenMinimalismCoordinator.kt @@ -19,6 +19,7 @@ package com.android.systemui.statusbar.notification.collection.coordinator import android.annotation.SuppressLint import android.app.NotificationManager import androidx.annotation.VisibleForTesting +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.Dumpable import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dump.DumpManager @@ -50,7 +51,6 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map -import com.android.app.tracing.coroutines.launchTraced as launch /** * If the setting is enabled, this will track seen notifications and ensure that they only show in @@ -74,7 +74,7 @@ constructor( private val unseenNotifications = mutableSetOf() private var isShadeVisible = false - private var unseenFilterEnabled = false + private var minimalismEnabled = false override fun attach(pipeline: NotifPipeline) { if (NotificationMinimalism.isUnexpectedlyInLegacyMode()) { @@ -83,7 +83,7 @@ constructor( pipeline.addPromoter(unseenNotifPromoter) pipeline.addOnBeforeTransformGroupsListener(::pickOutTopUnseenNotifs) pipeline.addCollectionListener(collectionListener) - scope.launch { trackUnseenFilterSettingChanges() } + scope.launch { trackLockScreenNotificationMinimalismSettingChanges() } dumpManager.registerDumpable(this) } @@ -136,12 +136,12 @@ constructor( return seenNotificationsInteractor.isLockScreenNotificationMinimalismEnabled() } - private suspend fun trackUnseenFilterSettingChanges() { + private suspend fun trackLockScreenNotificationMinimalismSettingChanges() { // Only filter the seen notifs when the lock screen minimalism feature settings is on. minimalismFeatureSettingEnabled().collectLatest { isMinimalismSettingEnabled -> // update local field and invalidate if necessary - if (isMinimalismSettingEnabled != unseenFilterEnabled) { - unseenFilterEnabled = isMinimalismSettingEnabled + if (isMinimalismSettingEnabled != minimalismEnabled) { + minimalismEnabled = isMinimalismSettingEnabled unseenNotifications.clear() unseenNotifPromoter.invalidateList("unseen setting changed") } @@ -156,21 +156,21 @@ constructor( private val collectionListener = object : NotifCollectionListener { override fun onEntryAdded(entry: NotificationEntry) { - if (unseenFilterEnabled && !isShadeVisible) { + if (minimalismEnabled && !isShadeVisible) { logger.logUnseenAdded(entry.key) unseenNotifications.add(entry) } } override fun onEntryUpdated(entry: NotificationEntry) { - if (unseenFilterEnabled && !isShadeVisible) { + if (minimalismEnabled && !isShadeVisible) { logger.logUnseenUpdated(entry.key) unseenNotifications.add(entry) } } override fun onEntryRemoved(entry: NotificationEntry, reason: Int) { - if (unseenFilterEnabled && unseenNotifications.remove(entry)) { + if (minimalismEnabled && unseenNotifications.remove(entry)) { logger.logUnseenRemoved(entry.key) } } @@ -178,7 +178,7 @@ constructor( private fun pickOutTopUnseenNotifs(list: List) { if (NotificationMinimalism.isUnexpectedlyInLegacyMode()) return - if (!unseenFilterEnabled) return + if (!minimalismEnabled) return // Only ever elevate a top unseen notification on keyguard, not even locked shade if (statusBarStateController.state != StatusBarState.KEYGUARD) { seenNotificationsInteractor.setTopOngoingNotification(null) @@ -215,6 +215,7 @@ constructor( override fun shouldPromoteToTopLevel(child: NotificationEntry): Boolean = when { NotificationMinimalism.isUnexpectedlyInLegacyMode() -> false + !minimalismEnabled -> false seenNotificationsInteractor.isTopOngoingNotification(child) -> true !NotificationMinimalism.ungroupTopUnseen -> false else -> seenNotificationsInteractor.isTopUnseenNotification(child) @@ -225,6 +226,7 @@ constructor( object : NotifSectioner("TopOngoing", BUCKET_TOP_ONGOING) { override fun isInSection(entry: ListEntry): Boolean { if (NotificationMinimalism.isUnexpectedlyInLegacyMode()) return false + if (!minimalismEnabled) return false return entry.anyEntry { notificationEntry -> seenNotificationsInteractor.isTopOngoingNotification(notificationEntry) } @@ -235,6 +237,7 @@ constructor( object : NotifSectioner("TopUnseen", BUCKET_TOP_UNSEEN) { override fun isInSection(entry: ListEntry): Boolean { if (NotificationMinimalism.isUnexpectedlyInLegacyMode()) return false + if (!minimalismEnabled) return false return entry.anyEntry { notificationEntry -> seenNotificationsInteractor.isTopUnseenNotification(notificationEntry) } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt index 3bc549543ef2..5d37c10b916f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt @@ -21,18 +21,25 @@ import android.util.Log import android.view.View.GONE import androidx.annotation.VisibleForTesting import com.android.systemui.dagger.SysUISingleton +import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.media.controls.domain.pipeline.MediaDataManager import com.android.systemui.res.R import com.android.systemui.statusbar.LockscreenShadeTransitionController import com.android.systemui.statusbar.StatusBarState.KEYGUARD import com.android.systemui.statusbar.SysuiStatusBarStateController +import com.android.systemui.statusbar.notification.domain.interactor.SeenNotificationsInteractor import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.ExpandableView import com.android.systemui.statusbar.notification.shared.NotificationMinimalism import com.android.systemui.statusbar.policy.SplitShadeStateController import com.android.systemui.util.Compile import com.android.systemui.util.children +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.flow.flowOf +import kotlinx.coroutines.launch import java.io.PrintWriter import javax.inject.Inject import kotlin.math.max @@ -56,7 +63,9 @@ constructor( private val lockscreenShadeTransitionController: LockscreenShadeTransitionController, private val mediaDataManager: MediaDataManager, @Main private val resources: Resources, - private val splitShadeStateController: SplitShadeStateController + private val splitShadeStateController: SplitShadeStateController, + private val seenNotificationsInteractor: SeenNotificationsInteractor, + @Application private val scope: CoroutineScope, ) { /** @@ -74,7 +83,7 @@ constructor( /** Whether we allow keyguard to show less important notifications above the shelf. */ private val limitLockScreenToOneImportant - get() = NotificationMinimalism.isEnabled + get() = NotificationMinimalism.isEnabled && minimalismSettingEnabled /** Minimum space between two notifications, see [calculateGapAndDividerHeight]. */ private var dividerHeight by notNull() @@ -85,8 +94,16 @@ constructor( */ private var saveSpaceOnLockscreen = false + /** + * True when the lock screen notification minimalism feature setting is enabled + */ + private var minimalismSettingEnabled = false + init { updateResources() + if (NotificationMinimalism.isEnabled) { + scope.launch { trackLockScreenNotificationMinimalismSettingChanges() } + } } private fun allowedByPolicy(stackHeight: StackHeight): Boolean = @@ -338,6 +355,16 @@ constructor( val shouldForceIntoShelf: Boolean ) + private suspend fun trackLockScreenNotificationMinimalismSettingChanges() { + if (NotificationMinimalism.isUnexpectedlyInLegacyMode()) return + seenNotificationsInteractor.isLockScreenNotificationMinimalismEnabled().collectLatest { + if (it != minimalismSettingEnabled) { + minimalismSettingEnabled = it + } + Log.i(TAG, "minimalismSettingEnabled: $minimalismSettingEnabled") + } + } + private fun computeHeightPerNotificationLimit( stack: NotificationStackScrollLayout, shelfHeight: Float, @@ -390,7 +417,8 @@ constructor( log { "\tcomputeHeightPerNotificationLimit i=$i notifs=$notifications " + "notifsHeightSavingSpace=$notifsWithCollapsedHun" + - " shelfWithSpaceBefore=$shelfWithSpaceBefore" + " shelfWithSpaceBefore=$shelfWithSpaceBefore" + + " limitLockScreenToOneImportant: $limitLockScreenToOneImportant" } yield( StackHeight( @@ -462,6 +490,8 @@ constructor( fun dump(pw: PrintWriter, args: Array) { pw.println("NotificationStackSizeCalculator saveSpaceOnLockscreen=$saveSpaceOnLockscreen") + pw.println("NotificationStackSizeCalculator " + + "limitLockScreenToOneImportant=$limitLockScreenToOneImportant") } private fun ExpandableView.isShowable(onLockscreen: Boolean): Boolean { -- cgit v1.2.3-59-g8ed1b From f3ae4e09fa3c1c0b2229ae2128f5335e091b639a Mon Sep 17 00:00:00 2001 From: Yining Liu Date: Thu, 7 Nov 2024 22:20:02 +0000 Subject: Formatting kotlin file Fix the format issues reported by ktfmt. Bug: 377546277 Bug: 354047572 Flag: com.android.server.notification.notification_minimalism Test: EXEMPT refactor Change-Id: I0b30c4b99f75cd72455aa385876ff57a08cf36dc --- .../stack/NotificationStackSizeCalculatorTest.kt | 41 +++++++++------------ .../stack/NotificationStackSizeCalculator.kt | 42 ++++++++++------------ 2 files changed, 34 insertions(+), 49 deletions(-) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt index 7b73da2737e8..50db9f7268e4 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt @@ -21,10 +21,10 @@ import android.service.notification.StatusBarNotification import android.view.View.VISIBLE import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest -import com.android.systemui.res.R import com.android.systemui.SysuiTestCase import com.android.systemui.kosmos.testScope import com.android.systemui.media.controls.domain.pipeline.MediaDataManager +import com.android.systemui.res.R import com.android.systemui.statusbar.LockscreenShadeTransitionController import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.SysuiStatusBarStateController @@ -80,7 +80,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { testableResources.resources, ResourcesSplitShadeStateController(), seenNotificationsInteractor = seenNotificationsInteractor, - scope = kosmos.testScope, + scope = testScope, ) } @@ -93,7 +93,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { rows, spaceForNotifications = 0f, spaceForShelf = 0f, - shelfHeight = 0f + shelfHeight = 0f, ) assertThat(maxNotifications).isEqualTo(0) @@ -109,7 +109,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { rows, spaceForNotifications = Float.MAX_VALUE, spaceForShelf = Float.MAX_VALUE, - shelfHeight + shelfHeight, ) assertThat(maxNotifications).isEqualTo(numberOfRows) @@ -145,7 +145,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { listOf(row), /* spaceForNotifications= */ 5f, /* spaceForShelf= */ 0f, - /* shelfHeight= */ 0f + /* shelfHeight= */ 0f, ) assertThat(maxNotifications).isEqualTo(1) @@ -156,11 +156,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { setGapHeight(gapHeight) val shelfHeight = shelfHeight + dividerHeight val spaceForNotifications = - listOf( - rowHeight + dividerHeight, - gapHeight + rowHeight + dividerHeight, - ) - .sum() + listOf(rowHeight + dividerHeight, gapHeight + rowHeight + dividerHeight).sum() val spaceForShelf = gapHeight + dividerHeight + shelfHeight val rows = listOf(createMockRow(rowHeight), createMockRow(rowHeight), createMockRow(rowHeight)) @@ -170,7 +166,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { rows, spaceForNotifications + 1, spaceForShelf, - shelfHeight + shelfHeight, ) assertThat(maxNotifications).isEqualTo(2) @@ -181,12 +177,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { // Each row in separate section. setGapHeight(gapHeight) - val notifSpace = - listOf( - rowHeight, - dividerHeight + gapHeight + rowHeight, - ) - .sum() + val notifSpace = listOf(rowHeight, dividerHeight + gapHeight + rowHeight).sum() val shelfSpace = dividerHeight + gapHeight + shelfHeight val spaceUsed = notifSpace + shelfSpace @@ -217,7 +208,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { rows, spaceForNotifications + 1, spaceForShelf, - shelfHeight + shelfHeight, ) assertThat(maxNotifications).isEqualTo(1) @@ -260,7 +251,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { visibleIndex = 0, previousView = null, stack = stackLayout, - onLockscreen = true + onLockscreen = true, ) assertThat(space.whenEnoughSpace).isEqualTo(10f) } @@ -280,7 +271,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { visibleIndex = 0, previousView = null, stack = stackLayout, - onLockscreen = true + onLockscreen = true, ) assertThat(space.whenEnoughSpace).isEqualTo(5) } @@ -299,7 +290,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { visibleIndex = 0, previousView = null, stack = stackLayout, - onLockscreen = true + onLockscreen = true, ) assertThat(space.whenSavingSpace).isEqualTo(5) } @@ -319,7 +310,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { visibleIndex = 0, previousView = null, stack = stackLayout, - onLockscreen = true + onLockscreen = true, ) assertThat(space.whenSavingSpace).isEqualTo(5) } @@ -338,7 +329,7 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { visibleIndex = 0, previousView = null, stack = stackLayout, - onLockscreen = false + onLockscreen = false, ) assertThat(space.whenEnoughSpace).isEqualTo(rowHeight) assertThat(space.whenSavingSpace).isEqualTo(rowHeight) @@ -348,14 +339,14 @@ class NotificationStackSizeCalculatorTest : SysuiTestCase() { rows: List, spaceForNotifications: Float, spaceForShelf: Float, - shelfHeight: Float = this.shelfHeight + shelfHeight: Float = this.shelfHeight, ): Int { setupChildren(rows) return sizeCalculator.computeMaxKeyguardNotifications( stackLayout, spaceForNotifications, spaceForShelf, - shelfHeight + shelfHeight, ) } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt index 5d37c10b916f..5dff8120f33f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt @@ -35,16 +35,14 @@ import com.android.systemui.statusbar.notification.shared.NotificationMinimalism import com.android.systemui.statusbar.policy.SplitShadeStateController import com.android.systemui.util.Compile import com.android.systemui.util.children -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.flow.flowOf -import kotlinx.coroutines.launch import java.io.PrintWriter import javax.inject.Inject import kotlin.math.max import kotlin.math.min import kotlin.properties.Delegates.notNull +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch private const val TAG = "NotifStackSizeCalc" private val DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG) @@ -94,9 +92,7 @@ constructor( */ private var saveSpaceOnLockscreen = false - /** - * True when the lock screen notification minimalism feature setting is enabled - */ + /** True when the lock screen notification minimalism feature setting is enabled */ private var minimalismSettingEnabled = false init { @@ -216,7 +212,7 @@ constructor( canStackFitInSpace( heightResult, notifSpace = notifSpace, - shelfSpace = shelfSpace + shelfSpace = shelfSpace, ) == FitResult.FIT } @@ -246,7 +242,7 @@ constructor( canStackFitInSpace( heightResult, notifSpace = notifSpace, - shelfSpace = shelfSpace + shelfSpace = shelfSpace, ) != FitResult.NO_FIT } log { "\t--- maxNotifications=$maxNotifications" } @@ -294,7 +290,7 @@ constructor( fun computeHeight( stack: NotificationStackScrollLayout, maxNotifs: Int, - shelfHeight: Float + shelfHeight: Float, ): Float { log { "\n" } log { "computeHeight ---" } @@ -328,7 +324,7 @@ constructor( private enum class FitResult { FIT, FIT_IF_SAVE_SPACE, - NO_FIT + NO_FIT, } data class SpaceNeeded( @@ -336,7 +332,7 @@ constructor( val whenEnoughSpace: Float, // Float height of space needed when showing collapsed layout for FSI HUNs. - val whenSavingSpace: Float + val whenSavingSpace: Float, ) private data class StackHeight( @@ -352,7 +348,7 @@ constructor( val shelfHeightWithSpaceBefore: Float, /** Whether the stack should actually be forced into the shelf before this height. */ - val shouldForceIntoShelf: Boolean + val shouldForceIntoShelf: Boolean, ) private suspend fun trackLockScreenNotificationMinimalismSettingChanges() { @@ -404,7 +400,7 @@ constructor( stack, previous = currentNotification, current = children[firstViewInShelfIndex], - currentIndex = firstViewInShelfIndex + currentIndex = firstViewInShelfIndex, ) spaceBeforeShelf + shelfHeight } @@ -425,7 +421,7 @@ constructor( notifsHeight = notifications, notifsHeightSavingSpace = notifsWithCollapsedHun, shelfHeightWithSpaceBefore = shelfWithSpaceBefore, - shouldForceIntoShelf = counter?.shouldForceIntoShelf() ?: false + shouldForceIntoShelf = counter?.shouldForceIntoShelf() ?: false, ) ) } @@ -490,8 +486,10 @@ constructor( fun dump(pw: PrintWriter, args: Array) { pw.println("NotificationStackSizeCalculator saveSpaceOnLockscreen=$saveSpaceOnLockscreen") - pw.println("NotificationStackSizeCalculator " + - "limitLockScreenToOneImportant=$limitLockScreenToOneImportant") + pw.println( + "NotificationStackSizeCalculator " + + "limitLockScreenToOneImportant=$limitLockScreenToOneImportant" + ) } private fun ExpandableView.isShowable(onLockscreen: Boolean): Boolean { @@ -514,7 +512,7 @@ constructor( stack: NotificationStackScrollLayout, previous: ExpandableView?, current: ExpandableView?, - currentIndex: Int + currentIndex: Int, ): Float { if (currentIndex == 0) { return 0f @@ -566,11 +564,7 @@ constructor( takeWhile(predicate).count() - 1 /** Counts the number of notifications for each type of bucket */ - data class BucketTypeCounter( - var ongoing: Int = 0, - var important: Int = 0, - var other: Int = 0, - ) { + data class BucketTypeCounter(var ongoing: Int = 0, var important: Int = 0, var other: Int = 0) { fun incrementForBucket(@PriorityBucket bucket: Int?) { when (bucket) { BUCKET_MEDIA_CONTROLS, -- cgit v1.2.3-59-g8ed1b