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

Commit 4114137a authored by Andreas Miko's avatar Andreas Miko Committed by Automerger Merge Worker
Browse files

Merge "Add tap to wake light reveal with tap position awareness" into udc-dev am: e28c7580

parents 06f8eae0 e28c7580
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ public class DozeSensors {
                        true /* settingDef */,
                        true /* configured */,
                        DozeLog.REASON_SENSOR_TAP,
                        false /* reports touch coordinates */,
                        true /* reports touch coordinates */,
                        true /* touchscreen */,
                        false /* ignoresSetting */,
                        dozeParameters.singleTapUsesProx(mDevicePosture) /* requiresProx */,
+1 −3
Original line number Diff line number Diff line
@@ -323,9 +323,7 @@ public class DozeTriggers implements DozeMachine.Part {
                    return;
                }
                if (isDoubleTap || isTap) {
                    if (screenX != -1 && screenY != -1) {
                    mDozeHost.onSlpiTap(screenX, screenY);
                    }
                    gentleWakeUp(pulseReason);
                } else if (isPickup) {
                    if (shouldDropPickupEvent())  {
+2 −7
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ import com.android.systemui.keyguard.shared.model.FailedAuthenticationStatus
import com.android.systemui.keyguard.shared.model.HelpAuthenticationStatus
import com.android.systemui.keyguard.shared.model.SuccessAuthenticationStatus
import com.android.systemui.keyguard.shared.model.TransitionState
import com.android.systemui.keyguard.shared.model.WakefulnessModel
import com.android.systemui.log.FaceAuthenticationLogger
import com.android.systemui.log.SessionTracker
import com.android.systemui.log.table.TableLogBuffer
@@ -239,9 +238,7 @@ constructor(
        // Clear auth status when keyguard is going away or when the user is switching or device
        // starts going to sleep.
        merge(
                keyguardRepository.wakefulness.map {
                    WakefulnessModel.isSleepingOrStartingToSleep(it)
                },
                keyguardRepository.wakefulness.map { it.isStartingToSleepOrAsleep() },
                keyguardRepository.isKeyguardGoingAway,
                userRepository.userSwitchingInProgress
            )
@@ -315,9 +312,7 @@ constructor(
                    tableLogBuffer
                ),
                logAndObserve(
                    keyguardRepository.wakefulness
                        .map { WakefulnessModel.isSleepingOrStartingToSleep(it) }
                        .isFalse(),
                    keyguardRepository.wakefulness.map { it.isStartingToSleepOrAsleep() }.isFalse(),
                    "deviceNotSleepingOrNotStartingToSleep",
                    tableLogBuffer
                ),
+0 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.systemui.keyguard.data.repository

import android.os.Build
import android.util.Log
import com.android.keyguard.ViewMediatorCallback
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.EXPANSION_HIDDEN
@@ -104,7 +103,6 @@ interface KeyguardBouncerRepository {
class KeyguardBouncerRepositoryImpl
@Inject
constructor(
    private val viewMediatorCallback: ViewMediatorCallback,
    private val clock: SystemClock,
    @Application private val applicationScope: CoroutineScope,
    @BouncerLog private val buffer: TableLogBuffer,
+19 −20
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCall
import com.android.systemui.common.shared.model.Position
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.doze.DozeHost
import com.android.systemui.doze.DozeMachine
import com.android.systemui.doze.DozeTransitionCallback
import com.android.systemui.doze.DozeTransitionListener
@@ -105,7 +104,7 @@ interface KeyguardRepository {
     * returns `false`. In order to account for that, observers should also use the
     * [linearDozeAmount] flow to check if it's greater than `0`
     */
    val isDozing: Flow<Boolean>
    val isDozing: StateFlow<Boolean>

    /**
     * Observable for whether the device is dreaming.
@@ -133,6 +132,8 @@ interface KeyguardRepository {
    /** Doze state information, as it transitions */
    val dozeTransitionModel: Flow<DozeTransitionModel>

    val lastDozeTapToWakePosition: StateFlow<Point?>

    /** Observable for the [StatusBarState] */
    val statusBarState: Flow<StatusBarState>

@@ -181,6 +182,10 @@ interface KeyguardRepository {

    /** Sets whether quick settings or quick-quick settings is visible. */
    fun setQuickSettingsVisible(isVisible: Boolean)

    fun setLastDozeTapToWakePosition(position: Point)

    fun setIsDozing(isDozing: Boolean)
}

/** Encapsulates application state for the keyguard. */
@@ -189,7 +194,6 @@ class KeyguardRepositoryImpl
@Inject
constructor(
    statusBarStateController: StatusBarStateController,
    dozeHost: DozeHost,
    wakefulnessLifecycle: WakefulnessLifecycle,
    biometricUnlockController: BiometricUnlockController,
    private val keyguardStateController: KeyguardStateController,
@@ -333,24 +337,19 @@ constructor(
        awaitClose { keyguardStateController.removeCallback(callback) }
    }

    override val isDozing: Flow<Boolean> =
        conflatedCallbackFlow {
                val callback =
                    object : DozeHost.Callback {
                        override fun onDozingChanged(isDozing: Boolean) {
                            trySendWithFailureLogging(isDozing, TAG, "updated isDozing")
                        }
    private val _isDozing = MutableStateFlow(statusBarStateController.isDozing)
    override val isDozing: StateFlow<Boolean> = _isDozing.asStateFlow()

    override fun setIsDozing(isDozing: Boolean) {
        _isDozing.value = isDozing
    }
                dozeHost.addCallback(callback)
                trySendWithFailureLogging(
                    statusBarStateController.isDozing,
                    TAG,
                    "initial isDozing",
                )

                awaitClose { dozeHost.removeCallback(callback) }
    private val _lastDozeTapToWakePosition = MutableStateFlow<Point?>(null)
    override val lastDozeTapToWakePosition = _lastDozeTapToWakePosition.asStateFlow()

    override fun setLastDozeTapToWakePosition(position: Point) {
        _lastDozeTapToWakePosition.value = position
    }
            .distinctUntilChanged()

    override val isDreamingWithOverlay: Flow<Boolean> =
        conflatedCallbackFlow {
Loading