Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aea72ea6 authored by András Kurucz's avatar András Kurucz
Browse files

[Flexiglass] Fix lint warnings in NSSL's ViewModels

Bug: 296118689
Test: build sysui
Flag: EXEMPT PURE_REFACTOR
Change-Id: Icf482421d2acac91c65fab8b5e08f265d7172e73
parent 71331759
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.statusbar.notification.stack.ui.viewmodel

import android.annotation.SuppressLint
import android.graphics.RectF
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dump.DumpManager
@@ -41,6 +42,7 @@ import com.android.systemui.util.ui.AnimatedValue
import com.android.systemui.util.ui.toAnimatedValueFlow
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
@@ -54,6 +56,7 @@ import kotlinx.coroutines.flow.onStart
 * ViewModel for the list of notifications, including child elements like the Clear all/Manage
 * button at the bottom (the footer) and the "No notifications" text (the empty shade).
 */
@SuppressLint("FlowExposedFromViewModel") // because all flows from this class are bound to a View
class NotificationListViewModel
@Inject
constructor(
@@ -98,7 +101,10 @@ constructor(
                shadeInteractor.qsExpansion
                    .map { it >= QS_EXPANSION_THRESHOLD }
                    .distinctUntilChanged(),
                shadeModeInteractor.shadeMode.map { it == ShadeMode.Split },
                shadeModeInteractor.shadeMode.map {
                    @Suppress("DEPRECATION") // to handle split shade
                    it == ShadeMode.Split
                },
                notificationStackInteractor.isShowingOnLockscreen,
            ) { hasNotifications, qsExpandedEnough, splitShade, isShowingOnLockscreen ->
                when {
@@ -367,6 +373,7 @@ constructor(
     * Note that this list can contain both notification keys, as well as keys for other types of
     * chips like screen recording.
     */
    @OptIn(ExperimentalCoroutinesApi::class)
    val visibleStatusBarChips: Flow<Map<String, RectF>> =
        shadeStatusBarComponentsInteractor.ongoingActivityChipsViewModel.flatMapLatest {
            it.visibleChipsWithBounds
+4 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

package com.android.systemui.statusbar.notification.stack.ui.viewmodel

import android.annotation.SuppressLint
import com.android.compose.animation.scene.ContentKey
import com.android.compose.animation.scene.ObservableTransitionState
import com.android.compose.animation.scene.ObservableTransitionState.Idle
@@ -66,6 +67,7 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.mapNotNull

/** ViewModel which represents the state of the NSSL/Controller in the world of flexiglass */
@SuppressLint("FlowExposedFromViewModel") // because all flows from this class are bound to a View
class NotificationScrollViewModel
@AssistedInject
constructor(
@@ -76,7 +78,7 @@ constructor(
    shadeModeInteractor: ShadeModeInteractor,
    bouncerInteractor: BouncerInteractor,
    private val remoteInputInteractor: RemoteInputInteractor,
    private val sceneInteractor: SceneInteractor,
    sceneInteractor: SceneInteractor,
    // TODO(b/336364825) Remove Lazy when SceneContainerFlag is released -
    // while the flag is off, creating this object too early results in a crash
    keyguardInteractor: Lazy<KeyguardInteractor>,
@@ -282,6 +284,7 @@ constructor(
                shadeInteractor.qsExpansion,
                sceneInteractor.transitionState,
            ) { shadeMode, qsExpansion, transition ->
                @Suppress("DEPRECATION") // to handle split shade
                when (shadeMode) {
                    is ShadeMode.Dual ->
                        // Don't clip notifications while we are opening the DualShade panel to