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

Commit 9ca1dd7b authored by Lucas Silva's avatar Lucas Silva Committed by Android (Google) Code Review
Browse files

Merge "Disable communal touch handler when not on keyguard" into main

parents 1c63a266 b6c77038
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -31,10 +31,12 @@ import com.android.systemui.ambient.touch.TouchHandler;
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor;
import com.android.systemui.communal.domain.interactor.CommunalInteractor;
import com.android.systemui.dreams.touch.dagger.CommunalTouchModule;
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
import com.android.systemui.scene.domain.interactor.SceneInteractor;
import com.android.systemui.scene.shared.flag.SceneContainerFlag;
import com.android.systemui.scene.ui.view.WindowRootView;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.util.kotlin.BooleanFlowOperators;

import kotlinx.coroutines.Job;

@@ -76,6 +78,7 @@ public class CommunalTouchHandler implements TouchHandler {
            CommunalInteractor communalInteractor,
            ConfigurationInteractor configurationInteractor,
            SceneInteractor sceneInteractor,
            KeyguardInteractor keyguardInteractor,
            Optional<Provider<WindowRootView>> windowRootViewProvider,
            Lifecycle lifecycle) {
        mInitiationWidth = initiationWidth;
@@ -88,7 +91,10 @@ public class CommunalTouchHandler implements TouchHandler {

        mFlows.add(collectFlow(
                mLifecycle,
                BooleanFlowOperators.INSTANCE.allOf(
                        mCommunalInteractor.isCommunalAvailable(),
                        keyguardInteractor.isKeyguardShowing()
                ),
                mIsCommunalAvailableCallback
        ));

+1 −1
Original line number Diff line number Diff line
@@ -445,7 +445,7 @@ constructor(
        return dozeTransitionModel.filter { states.contains(it.to) }
    }

    fun isKeyguardShowing(): Boolean {
    fun isKeyguardCurrentlyShowing(): Boolean {
        return repository.isKeyguardShowing()
    }

+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ constructor(
        // we
        // are we will dismiss it which will also collapse the shade.
        val shouldAnimateFromExpandable =
            expandable != null && !keyguardInteractor.isKeyguardShowing()
            expandable != null && !keyguardInteractor.isKeyguardCurrentlyShowing()
        val dismissAction =
            ActivityStarter.OnDismissAction {
                if (shouldAnimateFromExpandable) {
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ constructor(
                    if (
                        sensorPrivacyController.requiresAuthentication() &&
                            keyguardInteractor.isKeyguardDismissible.value &&
                            keyguardInteractor.isKeyguardShowing()
                            keyguardInteractor.isKeyguardCurrentlyShowing()
                    ) {
                        activityStarter.postQSRunnableDismissingKeyguard {
                            sensorPrivacyController.setSensorBlocked(QS_TILE, sensorId, !blocked)
+2 −5
Original line number Diff line number Diff line
@@ -128,10 +128,7 @@ constructor(
    }

    /** Notifies the item for a user has been clicked. */
    fun onUserListItemClicked(
        record: UserRecord,
        dialogShower: DialogShower?,
    ) {
    fun onUserListItemClicked(record: UserRecord, dialogShower: DialogShower?) {
        mUserSwitcherInteractor.onRecordSelected(record, dialogShower)
    }

@@ -184,7 +181,7 @@ constructor(

    /** Whether keyguard is showing. */
    val isKeyguardShowing: Boolean
        get() = keyguardInteractor.isKeyguardShowing()
        get() = keyguardInteractor.isKeyguardCurrentlyShowing()

    /** Starts an activity with the given [Intent]. */
    fun startActivity(intent: Intent) {
Loading