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

Commit 51a2c6c2 authored by Ioana Alexandru's avatar Ioana Alexandru Committed by Android (Google) Code Review
Browse files

Merge changes Ia6a3506f,Ifc470bd1 into main

* changes:
  Preserve qsFullScreen update in NSSL
  Perform NLVM combines on the bg thread
parents aac608a2 83dd6b45
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -979,9 +979,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
    void updateQsState() {
    void updateQsState() {
        boolean qsFullScreen = getExpanded() && !mSplitShadeEnabled;
        boolean qsFullScreen = getExpanded() && !mSplitShadeEnabled;
        mShadeRepository.setLegacyQsFullscreen(qsFullScreen);
        mShadeRepository.setLegacyQsFullscreen(qsFullScreen);
        if (!FooterViewRefactor.isEnabled()) {
        mNotificationStackScrollLayoutController.setQsFullScreen(qsFullScreen);
        mNotificationStackScrollLayoutController.setQsFullScreen(qsFullScreen);
        }
        if (!SceneContainerFlag.isEnabled()) {
        if (!SceneContainerFlag.isEnabled()) {
            mNotificationStackScrollLayoutController.setScrollingEnabled(
            mNotificationStackScrollLayoutController.setScrollingEnabled(
                    mBarState != KEYGUARD && (!qsFullScreen || mExpansionFromOverscroll));
                    mBarState != KEYGUARD && (!qsFullScreen || mExpansionFromOverscroll));
+3 −2
Original line number Original line Diff line number Diff line
@@ -1260,10 +1260,11 @@ public class NotificationStackScrollLayoutController implements Dumpable {
    }
    }


    public void setQsFullScreen(boolean fullScreen) {
    public void setQsFullScreen(boolean fullScreen) {
        FooterViewRefactor.assertInLegacyMode();
        mView.setQsFullScreen(fullScreen);
        mView.setQsFullScreen(fullScreen);
        if (!FooterViewRefactor.isEnabled()) {
            updateShowEmptyShadeView();
            updateShowEmptyShadeView();
        }
        }
    }


    public void setScrollingEnabled(boolean enabled) {
    public void setScrollingEnabled(boolean enabled) {
        mView.setScrollingEnabled(enabled);
        mView.setScrollingEnabled(enabled);
+9 −4
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


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


import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.domain.interactor.RemoteInputInteractor
import com.android.systemui.statusbar.domain.interactor.RemoteInputInteractor
import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor
import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor
@@ -33,10 +34,12 @@ import com.android.systemui.util.ui.AnimatedValue
import com.android.systemui.util.ui.toAnimatedValueFlow
import com.android.systemui.util.ui.toAnimatedValueFlow
import java.util.Optional
import java.util.Optional
import javax.inject.Inject
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.flow.onStart


@@ -55,6 +58,7 @@ constructor(
    shadeInteractor: ShadeInteractor,
    shadeInteractor: ShadeInteractor,
    userSetupInteractor: UserSetupInteractor,
    userSetupInteractor: UserSetupInteractor,
    zenModeInteractor: ZenModeInteractor,
    zenModeInteractor: ZenModeInteractor,
    @Background bgDispatcher: CoroutineDispatcher,
) {
) {
    /**
    /**
     * We want the NSSL to be unimportant for accessibility when there are no notifications in it
     * We want the NSSL to be unimportant for accessibility when there are no notifications in it
@@ -72,6 +76,7 @@ constructor(
                ) { hasNotifications, isShowingOnLockscreen ->
                ) { hasNotifications, isShowingOnLockscreen ->
                    hasNotifications || !isShowingOnLockscreen
                    hasNotifications || !isShowingOnLockscreen
                }
                }
                .flowOn(bgDispatcher)
                .distinctUntilChanged()
                .distinctUntilChanged()
        }
        }
    }
    }
@@ -95,6 +100,7 @@ constructor(
                        else -> true
                        else -> true
                    }
                    }
                }
                }
                .flowOn(bgDispatcher)
                .distinctUntilChanged()
                .distinctUntilChanged()
        }
        }
    }
    }
@@ -107,15 +113,13 @@ constructor(
                    activeNotificationsInteractor.areAnyNotificationsPresent,
                    activeNotificationsInteractor.areAnyNotificationsPresent,
                    userSetupInteractor.isUserSetUp,
                    userSetupInteractor.isUserSetUp,
                    notificationStackInteractor.isShowingOnLockscreen,
                    notificationStackInteractor.isShowingOnLockscreen,
                    shadeInteractor.qsExpansion,
                    shadeInteractor.isQsFullscreen,
                    shadeInteractor.isQsFullscreen,
                    remoteInputInteractor.isRemoteInputActive,
                    remoteInputInteractor.isRemoteInputActive,
                    shadeInteractor.shadeExpansion.map { it == 0f }
                    shadeInteractor.shadeExpansion.map { it == 0f }.distinctUntilChanged(),
                ) {
                ) {
                    hasNotifications,
                    hasNotifications,
                    isUserSetUp,
                    isUserSetUp,
                    isShowingOnLockscreen,
                    isShowingOnLockscreen,
                    qsExpansion,
                    qsFullScreen,
                    qsFullScreen,
                    isRemoteInputActive,
                    isRemoteInputActive,
                    isShadeClosed ->
                    isShadeClosed ->
@@ -131,7 +135,7 @@ constructor(
                        isShowingOnLockscreen -> VisibilityChange.HIDE_WITHOUT_ANIMATION
                        isShowingOnLockscreen -> VisibilityChange.HIDE_WITHOUT_ANIMATION
                        // Do not show the footer if quick settings are fully expanded (except
                        // Do not show the footer if quick settings are fully expanded (except
                        // for the foldable split shade view). See b/201427195 && b/222699879.
                        // for the foldable split shade view). See b/201427195 && b/222699879.
                        qsExpansion == 1f && qsFullScreen -> VisibilityChange.HIDE_WITH_ANIMATION
                        qsFullScreen -> VisibilityChange.HIDE_WITH_ANIMATION
                        // Hide the footer if remote input is active (i.e. user is replying to a
                        // Hide the footer if remote input is active (i.e. user is replying to a
                        // notification). See b/75984847.
                        // notification). See b/75984847.
                        isRemoteInputActive -> VisibilityChange.HIDE_WITH_ANIMATION
                        isRemoteInputActive -> VisibilityChange.HIDE_WITH_ANIMATION
@@ -140,6 +144,7 @@ constructor(
                        else -> VisibilityChange.SHOW_WITH_ANIMATION
                        else -> VisibilityChange.SHOW_WITH_ANIMATION
                    }
                    }
                }
                }
                .flowOn(bgDispatcher)
                .distinctUntilChanged(
                .distinctUntilChanged(
                    // Equivalent unless visibility changes
                    // Equivalent unless visibility changes
                    areEquivalent = { a: VisibilityChange, b: VisibilityChange ->
                    areEquivalent = { a: VisibilityChange, b: VisibilityChange ->
+2 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar.notification.stack.ui.viewmodel


import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.kosmos.testDispatcher
import com.android.systemui.shade.domain.interactor.shadeInteractor
import com.android.systemui.shade.domain.interactor.shadeInteractor
import com.android.systemui.statusbar.domain.interactor.remoteInputInteractor
import com.android.systemui.statusbar.domain.interactor.remoteInputInteractor
import com.android.systemui.statusbar.notification.domain.interactor.activeNotificationsInteractor
import com.android.systemui.statusbar.notification.domain.interactor.activeNotificationsInteractor
@@ -42,5 +43,6 @@ val Kosmos.notificationListViewModel by Fixture {
        shadeInteractor,
        shadeInteractor,
        userSetupInteractor,
        userSetupInteractor,
        zenModeInteractor,
        zenModeInteractor,
        testDispatcher,
    )
    )
}
}