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

Commit c460c897 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...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22335733



Change-Id: I8adc91f6f266f0a2a7656be9ebe924c2d2a5b5f3
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4c265078 4318824f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -217,7 +217,7 @@ public class DozeSensors {
                        true /* settingDef */,
                        true /* settingDef */,
                        true /* configured */,
                        true /* configured */,
                        DozeLog.REASON_SENSOR_TAP,
                        DozeLog.REASON_SENSOR_TAP,
                        false /* reports touch coordinates */,
                        true /* reports touch coordinates */,
                        true /* touchscreen */,
                        true /* touchscreen */,
                        false /* ignoresSetting */,
                        false /* ignoresSetting */,
                        dozeParameters.singleTapUsesProx(mDevicePosture) /* requiresProx */,
                        dozeParameters.singleTapUsesProx(mDevicePosture) /* requiresProx */,
+1 −3
Original line number Original line Diff line number Diff line
@@ -323,9 +323,7 @@ public class DozeTriggers implements DozeMachine.Part {
                    return;
                    return;
                }
                }
                if (isDoubleTap || isTap) {
                if (isDoubleTap || isTap) {
                    if (screenX != -1 && screenY != -1) {
                    mDozeHost.onSlpiTap(screenX, screenY);
                    mDozeHost.onSlpiTap(screenX, screenY);
                    }
                    gentleWakeUp(pulseReason);
                    gentleWakeUp(pulseReason);
                } else if (isPickup) {
                } else if (isPickup) {
                    if (shouldDropPickupEvent())  {
                    if (shouldDropPickupEvent())  {
+2 −7
Original line number Original line 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.HelpAuthenticationStatus
import com.android.systemui.keyguard.shared.model.SuccessAuthenticationStatus
import com.android.systemui.keyguard.shared.model.SuccessAuthenticationStatus
import com.android.systemui.keyguard.shared.model.TransitionState
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.FaceAuthenticationLogger
import com.android.systemui.log.SessionTracker
import com.android.systemui.log.SessionTracker
import com.android.systemui.log.table.TableLogBuffer
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
        // Clear auth status when keyguard is going away or when the user is switching or device
        // starts going to sleep.
        // starts going to sleep.
        merge(
        merge(
                keyguardRepository.wakefulness.map {
                keyguardRepository.wakefulness.map { it.isStartingToSleepOrAsleep() },
                    WakefulnessModel.isSleepingOrStartingToSleep(it)
                },
                keyguardRepository.isKeyguardGoingAway,
                keyguardRepository.isKeyguardGoingAway,
                userRepository.userSwitchingInProgress
                userRepository.userSwitchingInProgress
            )
            )
@@ -315,9 +312,7 @@ constructor(
                    tableLogBuffer
                    tableLogBuffer
                ),
                ),
                logAndObserve(
                logAndObserve(
                    keyguardRepository.wakefulness
                    keyguardRepository.wakefulness.map { it.isStartingToSleepOrAsleep() }.isFalse(),
                        .map { WakefulnessModel.isSleepingOrStartingToSleep(it) }
                        .isFalse(),
                    "deviceNotSleepingOrNotStartingToSleep",
                    "deviceNotSleepingOrNotStartingToSleep",
                    tableLogBuffer
                    tableLogBuffer
                ),
                ),
+0 −2
Original line number Original line Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.systemui.keyguard.data.repository


import android.os.Build
import android.os.Build
import android.util.Log
import android.util.Log
import com.android.keyguard.ViewMediatorCallback
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.EXPANSION_HIDDEN
import com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.EXPANSION_HIDDEN
@@ -104,7 +103,6 @@ interface KeyguardBouncerRepository {
class KeyguardBouncerRepositoryImpl
class KeyguardBouncerRepositoryImpl
@Inject
@Inject
constructor(
constructor(
    private val viewMediatorCallback: ViewMediatorCallback,
    private val clock: SystemClock,
    private val clock: SystemClock,
    @Application private val applicationScope: CoroutineScope,
    @Application private val applicationScope: CoroutineScope,
    @BouncerLog private val buffer: TableLogBuffer,
    @BouncerLog private val buffer: TableLogBuffer,
+19 −20
Original line number Original line 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.common.shared.model.Position
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.doze.DozeHost
import com.android.systemui.doze.DozeMachine
import com.android.systemui.doze.DozeMachine
import com.android.systemui.doze.DozeTransitionCallback
import com.android.systemui.doze.DozeTransitionCallback
import com.android.systemui.doze.DozeTransitionListener
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
     * returns `false`. In order to account for that, observers should also use the
     * [linearDozeAmount] flow to check if it's greater than `0`
     * [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.
     * Observable for whether the device is dreaming.
@@ -133,6 +132,8 @@ interface KeyguardRepository {
    /** Doze state information, as it transitions */
    /** Doze state information, as it transitions */
    val dozeTransitionModel: Flow<DozeTransitionModel>
    val dozeTransitionModel: Flow<DozeTransitionModel>


    val lastDozeTapToWakePosition: StateFlow<Point?>

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


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


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

    fun setLastDozeTapToWakePosition(position: Point)

    fun setIsDozing(isDozing: Boolean)
}
}


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


    override val isDozing: Flow<Boolean> =
    private val _isDozing = MutableStateFlow(statusBarStateController.isDozing)
        conflatedCallbackFlow {
    override val isDozing: StateFlow<Boolean> = _isDozing.asStateFlow()
                val callback =

                    object : DozeHost.Callback {
    override fun setIsDozing(isDozing: Boolean) {
                        override fun onDozingChanged(isDozing: Boolean) {
        _isDozing.value = isDozing
                            trySendWithFailureLogging(isDozing, TAG, "updated 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> =
    override val isDreamingWithOverlay: Flow<Boolean> =
        conflatedCallbackFlow {
        conflatedCallbackFlow {
Loading