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

Commit f6504be3 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Revert^2 "Remove dozeui binder call"

This reverts commit 8e1cb133.

Reason for revert: will still be removing binder call

Change-Id: Icb486b1980105d583b9160c2a6d395e63b8a09e4
parent 8e1cb133
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@ import androidx.core.content.res.ResourcesCompat
import com.android.compose.animation.scene.ElementKey
import com.android.compose.animation.scene.ElementKey
import com.android.compose.animation.scene.SceneScope
import com.android.compose.animation.scene.SceneScope
import com.android.systemui.animation.view.LaunchableImageView
import com.android.systemui.animation.view.LaunchableImageView
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.keyguard.ui.binder.KeyguardIndicationAreaBinder
import com.android.systemui.keyguard.ui.binder.KeyguardIndicationAreaBinder
import com.android.systemui.keyguard.ui.binder.KeyguardQuickAffordanceViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardQuickAffordanceViewBinder
import com.android.systemui.keyguard.ui.view.KeyguardIndicationArea
import com.android.systemui.keyguard.ui.view.KeyguardIndicationArea
@@ -43,6 +44,7 @@ import com.android.systemui.res.R
import com.android.systemui.statusbar.KeyguardIndicationController
import com.android.systemui.statusbar.KeyguardIndicationController
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.statusbar.VibratorHelper
import javax.inject.Inject
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.DisposableHandle
import kotlinx.coroutines.DisposableHandle
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.Flow


@@ -54,6 +56,7 @@ constructor(
    private val vibratorHelper: VibratorHelper,
    private val vibratorHelper: VibratorHelper,
    private val indicationController: KeyguardIndicationController,
    private val indicationController: KeyguardIndicationController,
    private val indicationAreaViewModel: KeyguardIndicationAreaViewModel,
    private val indicationAreaViewModel: KeyguardIndicationAreaViewModel,
    @Main private val mainImmediateDispatcher: CoroutineDispatcher,
) {
) {
    /**
    /**
     * Renders a single lockscreen shortcut.
     * Renders a single lockscreen shortcut.
@@ -161,6 +164,7 @@ constructor(
                        transitionAlpha,
                        transitionAlpha,
                        falsingManager,
                        falsingManager,
                        vibratorHelper,
                        vibratorHelper,
                        mainImmediateDispatcher,
                    ) {
                    ) {
                        indicationController.showTransientIndication(it)
                        indicationController.showTransientIndication(it)
                    }
                    }
+4 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,7 @@ import com.android.keyguard.LockIconView
import com.android.keyguard.LockIconViewController
import com.android.keyguard.LockIconViewController
import com.android.systemui.biometrics.AuthController
import com.android.systemui.biometrics.AuthController
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor
import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor
import com.android.systemui.flags.FeatureFlagsClassic
import com.android.systemui.flags.FeatureFlagsClassic
import com.android.systemui.flags.Flags
import com.android.systemui.flags.Flags
@@ -50,12 +51,14 @@ import com.android.systemui.shade.NotificationPanelView
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.statusbar.VibratorHelper
import dagger.Lazy
import dagger.Lazy
import javax.inject.Inject
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.CoroutineScope


class LockSection
class LockSection
@Inject
@Inject
constructor(
constructor(
    @Application private val applicationScope: CoroutineScope,
    @Application private val applicationScope: CoroutineScope,
    @Main private val mainImmediateDispatcher: CoroutineDispatcher,
    private val windowManager: WindowManager,
    private val windowManager: WindowManager,
    private val authController: AuthController,
    private val authController: AuthController,
    private val featureFlags: FeatureFlagsClassic,
    private val featureFlags: FeatureFlagsClassic,
@@ -93,6 +96,7 @@ constructor(
                                deviceEntryBackgroundViewModel.get(),
                                deviceEntryBackgroundViewModel.get(),
                                falsingManager.get(),
                                falsingManager.get(),
                                vibratorHelper.get(),
                                vibratorHelper.get(),
                                mainImmediateDispatcher,
                            )
                            )
                        }
                        }
                    } else {
                    } else {
+4 −2
Original line number Original line Diff line number Diff line
@@ -214,14 +214,16 @@ class KeyguardInteractorTest : SysuiTestCase() {
            )
            )


            repository.setStatusBarState(StatusBarState.KEYGUARD)
            repository.setStatusBarState(StatusBarState.KEYGUARD)
            shadeRepository.setLegacyShadeExpansion(1f)
            // User begins to swipe up
            shadeRepository.setLegacyShadeExpansion(0.99f)


            // When not dismissable, no alpha value (null) should emit
            // When not dismissable, no alpha value (null) should emit
            repository.setKeyguardDismissible(false)
            repository.setKeyguardDismissible(false)
            assertThat(dismissAlpha).isNull()
            assertThat(dismissAlpha).isNull()


            repository.setKeyguardDismissible(true)
            repository.setKeyguardDismissible(true)
            assertThat(dismissAlpha).isGreaterThan(0.95f)
            shadeRepository.setLegacyShadeExpansion(0.98f)
            assertThat(dismissAlpha).isGreaterThan(0.5f)
        }
        }


    @Test
    @Test
+12 −8
Original line number Original line Diff line number Diff line
@@ -31,6 +31,7 @@ import android.view.ViewTreeObserver.OnGlobalLayoutListener
import androidx.annotation.VisibleForTesting
import androidx.annotation.VisibleForTesting
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.repeatOnLifecycle
import androidx.lifecycle.repeatOnLifecycle
import com.android.app.tracing.coroutines.launch
import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.customization.R
import com.android.systemui.customization.R
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Background
@@ -65,6 +66,7 @@ import java.util.Locale
import java.util.TimeZone
import java.util.TimeZone
import java.util.concurrent.Executor
import java.util.concurrent.Executor
import javax.inject.Inject
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DisposableHandle
import kotlinx.coroutines.DisposableHandle
import kotlinx.coroutines.Job
import kotlinx.coroutines.Job
@@ -72,7 +74,6 @@ import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.merge
import kotlinx.coroutines.flow.merge
import kotlinx.coroutines.launch


/**
/**
 * Controller for a Clock provided by the registry and used on the keyguard. Instantiated by
 * Controller for a Clock provided by the registry and used on the keyguard. Instantiated by
@@ -90,6 +91,7 @@ constructor(
    @DisplaySpecific private val resources: Resources,
    @DisplaySpecific private val resources: Resources,
    private val context: Context,
    private val context: Context,
    @Main private val mainExecutor: DelayableExecutor,
    @Main private val mainExecutor: DelayableExecutor,
    @Main private val mainImmediateDispatcher: CoroutineDispatcher,
    @Background private val bgExecutor: Executor,
    @Background private val bgExecutor: Executor,
    private val clockBuffers: ClockMessageBuffers,
    private val clockBuffers: ClockMessageBuffers,
    private val featureFlags: FeatureFlagsClassic,
    private val featureFlags: FeatureFlagsClassic,
@@ -424,7 +426,7 @@ constructor(
        keyguardUpdateMonitor.registerCallback(keyguardUpdateMonitorCallback)
        keyguardUpdateMonitor.registerCallback(keyguardUpdateMonitorCallback)
        zenModeController.addCallback(zenModeCallback)
        zenModeController.addCallback(zenModeCallback)
        disposableHandle =
        disposableHandle =
            parent.repeatWhenAttached {
            parent.repeatWhenAttached(mainImmediateDispatcher) {
                repeatOnLifecycle(Lifecycle.State.CREATED) {
                repeatOnLifecycle(Lifecycle.State.CREATED) {
                    listenForDozing(this)
                    listenForDozing(this)
                    if (MigrateClocksToBlueprint.isEnabled) {
                    if (MigrateClocksToBlueprint.isEnabled) {
@@ -529,12 +531,14 @@ constructor(


    @VisibleForTesting
    @VisibleForTesting
    internal fun listenForDozeAmount(scope: CoroutineScope): Job {
    internal fun listenForDozeAmount(scope: CoroutineScope): Job {
        return scope.launch { keyguardInteractor.dozeAmount.collect { handleDoze(it) } }
        return scope.launch("$TAG#listenForDozeAmount") {
            keyguardInteractor.dozeAmount.collect { handleDoze(it) }
        }
    }
    }


    @VisibleForTesting
    @VisibleForTesting
    internal fun listenForDozeAmountTransition(scope: CoroutineScope): Job {
    internal fun listenForDozeAmountTransition(scope: CoroutineScope): Job {
        return scope.launch {
        return scope.launch("$TAG#listenForDozeAmountTransition") {
            merge(
            merge(
                    keyguardTransitionInteractor.aodToLockscreenTransition.map { step ->
                    keyguardTransitionInteractor.aodToLockscreenTransition.map { step ->
                        step.copy(value = 1f - step.value)
                        step.copy(value = 1f - step.value)
@@ -552,7 +556,7 @@ constructor(
     */
     */
    @VisibleForTesting
    @VisibleForTesting
    internal fun listenForAnyStateToAodTransition(scope: CoroutineScope): Job {
    internal fun listenForAnyStateToAodTransition(scope: CoroutineScope): Job {
        return scope.launch {
        return scope.launch("$TAG#listenForAnyStateToAodTransition") {
            keyguardTransitionInteractor
            keyguardTransitionInteractor
                .transitionStepsToState(AOD)
                .transitionStepsToState(AOD)
                .filter { it.transitionState == TransitionState.STARTED }
                .filter { it.transitionState == TransitionState.STARTED }
@@ -563,7 +567,7 @@ constructor(


    @VisibleForTesting
    @VisibleForTesting
    internal fun listenForDozing(scope: CoroutineScope): Job {
    internal fun listenForDozing(scope: CoroutineScope): Job {
        return scope.launch {
        return scope.launch("$TAG#listenForDozing") {
            combine(
            combine(
                    keyguardInteractor.dozeAmount,
                    keyguardInteractor.dozeAmount,
                    keyguardInteractor.isDozing,
                    keyguardInteractor.isDozing,
@@ -628,7 +632,7 @@ constructor(
    }
    }


    companion object {
    companion object {
        private val TAG = ClockEventController::class.simpleName!!
        private const val TAG = "ClockEventController"
        private val DOZE_TICKRATE_THRESHOLD = 0.99f
        private const val DOZE_TICKRATE_THRESHOLD = 0.99f
    }
    }
}
}
+9 −0
Original line number Original line Diff line number Diff line
@@ -208,6 +208,15 @@ public class DozeLog implements Dumpable {
        mLogger.logTimeTickScheduled(when, triggerAt);
        mLogger.logTimeTickScheduled(when, triggerAt);
    }
    }


    /**
     * Logs cancelation requests for time ticks
     * @param isPending is an unschedule request pending?
     * @param isTimeTickScheduled is a time tick request scheduled
     */
    public void tracePendingUnscheduleTimeTick(boolean isPending, boolean isTimeTickScheduled) {
        mLogger.logPendingUnscheduleTimeTick(isPending, isTimeTickScheduled);
    }

    /**
    /**
     * Appends keyguard visibility change event to the logs
     * Appends keyguard visibility change event to the logs
     * @param showing whether the keyguard is now showing
     * @param showing whether the keyguard is now showing
Loading