Loading packages/SystemUI/src/com/android/systemui/deviceentry/data/repository/DeviceEntryRepository.kt +21 −4 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ package com.android.systemui.deviceentry.data.repository import com.android.internal.widget.LockPatternUtils import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging import com.android.systemui.common.coroutine.ConflatedCallbackFlow import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background Loading Loading @@ -51,7 +51,7 @@ interface DeviceEntryRepository { * When this is `false`, an automatically-triggered face unlock shouldn't automatically dismiss * the lockscreen. */ fun isBypassEnabled(): Boolean val isBypassEnabled: StateFlow<Boolean> } /** Encapsulates application state for device entry. */ Loading @@ -68,7 +68,7 @@ constructor( ) : DeviceEntryRepository { override val isUnlocked = ConflatedCallbackFlow.conflatedCallbackFlow { conflatedCallbackFlow { val callback = object : KeyguardStateController.Callback { override fun onUnlockedChanged() { Loading Loading @@ -112,7 +112,24 @@ constructor( } } override fun isBypassEnabled() = keyguardBypassController.bypassEnabled override val isBypassEnabled: StateFlow<Boolean> = conflatedCallbackFlow { val listener = object : KeyguardBypassController.OnBypassStateChangedListener { override fun onBypassStateChanged(isEnabled: Boolean) { trySend(isEnabled) } } keyguardBypassController.registerOnBypassStateChangedListener(listener) awaitClose { keyguardBypassController.unregisterOnBypassStateChangedListener(listener) } } .stateIn( applicationScope, SharingStarted.Eagerly, initialValue = keyguardBypassController.bypassEnabled, ) companion object { private const val TAG = "DeviceEntryRepositoryImpl" Loading packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -106,5 +106,5 @@ constructor( * authentication challenge via face unlock or fingerprint sensor can automatically bypass the * lock screen. */ fun isBypassEnabled() = repository.isBypassEnabled() val isBypassEnabled: StateFlow<Boolean> = repository.isBypassEnabled } packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt +27 −29 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICA import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.distinctUntilChanged Loading @@ -51,7 +52,6 @@ import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.mapNotNull import kotlinx.coroutines.launch import javax.inject.Inject /** * Hooks up business logic that manipulates the state of the [SceneInteractor] for the system UI Loading Loading @@ -142,7 +142,7 @@ constructor( // When the device becomes unlocked in Lockscreen, go to Gone if // bypass is enabled. renderedScenes.contains(SceneKey.Lockscreen) -> if (deviceEntryInteractor.isBypassEnabled()) { if (deviceEntryInteractor.isBypassEnabled.value) { SceneKey.Gone to "device unlocked in Lockscreen scene with bypass" } else { Loading Loading @@ -179,8 +179,7 @@ constructor( } applicationScope.launch { powerInteractor.isAsleep .collect { isAsleep -> powerInteractor.isAsleep.collect { isAsleep -> if (isAsleep) { switchToScene( targetSceneKey = SceneKey.Lockscreen, Loading @@ -194,8 +193,7 @@ constructor( switchToScene( targetSceneKey = SceneKey.Gone, loggingReason = "device is starting to wake up while auth method is" + " none", "device is starting to wake up while auth method is" + " none", ) } authMethod.isSecure && isUnlocked -> { Loading packages/SystemUI/src/com/android/systemui/statusbar/CrossFadeHelper.java +12 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.systemui.statusbar; import android.view.View; import androidx.annotation.Nullable; import com.android.app.animation.Interpolators; import com.android.systemui.res.R; import com.android.systemui.statusbar.notification.stack.StackStateAnimator; Loading Loading @@ -113,7 +115,16 @@ public class CrossFadeHelper { fadeIn(view, ANIMATION_DURATION_LENGTH, 0); } public static void fadeIn(final View view, Runnable endRunnable) { fadeIn(view, ANIMATION_DURATION_LENGTH, /* delay= */ 0, endRunnable); } public static void fadeIn(final View view, long duration, int delay) { fadeIn(view, duration, delay, /* endRunnable= */ null); } public static void fadeIn(final View view, long duration, int delay, @Nullable Runnable endRunnable) { view.animate().cancel(); if (view.getVisibility() == View.INVISIBLE) { view.setAlpha(0.0f); Loading @@ -124,7 +135,7 @@ public class CrossFadeHelper { .setDuration(duration) .setStartDelay(delay) .setInterpolator(Interpolators.ALPHA_IN) .withEndAction(null); .withEndAction(endRunnable); if (view.hasOverlappingRendering() && view.getLayerType() != View.LAYER_TYPE_HARDWARE) { view.animate().withLayer(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +7 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; import android.view.animation.Interpolator; import androidx.annotation.Nullable; import androidx.core.graphics.ColorUtils; import com.android.app.animation.Interpolators; Loading Loading @@ -959,12 +960,17 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi } public void setDozing(boolean dozing, boolean fade, long delay) { setDozing(dozing, fade, delay, /* onChildCompleted= */ null); } public void setDozing(boolean dozing, boolean fade, long delay, @Nullable Runnable endRunnable) { mDozer.setDozing(f -> { mDozeAmount = f; updateDecorColor(); updateIconColor(); updateAllowAnimation(); }, dozing, fade, delay, this); }, dozing, fade, delay, this, endRunnable); } private void updateAllowAnimation() { Loading Loading
packages/SystemUI/src/com/android/systemui/deviceentry/data/repository/DeviceEntryRepository.kt +21 −4 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ package com.android.systemui.deviceentry.data.repository import com.android.internal.widget.LockPatternUtils import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging import com.android.systemui.common.coroutine.ConflatedCallbackFlow import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background Loading Loading @@ -51,7 +51,7 @@ interface DeviceEntryRepository { * When this is `false`, an automatically-triggered face unlock shouldn't automatically dismiss * the lockscreen. */ fun isBypassEnabled(): Boolean val isBypassEnabled: StateFlow<Boolean> } /** Encapsulates application state for device entry. */ Loading @@ -68,7 +68,7 @@ constructor( ) : DeviceEntryRepository { override val isUnlocked = ConflatedCallbackFlow.conflatedCallbackFlow { conflatedCallbackFlow { val callback = object : KeyguardStateController.Callback { override fun onUnlockedChanged() { Loading Loading @@ -112,7 +112,24 @@ constructor( } } override fun isBypassEnabled() = keyguardBypassController.bypassEnabled override val isBypassEnabled: StateFlow<Boolean> = conflatedCallbackFlow { val listener = object : KeyguardBypassController.OnBypassStateChangedListener { override fun onBypassStateChanged(isEnabled: Boolean) { trySend(isEnabled) } } keyguardBypassController.registerOnBypassStateChangedListener(listener) awaitClose { keyguardBypassController.unregisterOnBypassStateChangedListener(listener) } } .stateIn( applicationScope, SharingStarted.Eagerly, initialValue = keyguardBypassController.bypassEnabled, ) companion object { private const val TAG = "DeviceEntryRepositoryImpl" Loading
packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -106,5 +106,5 @@ constructor( * authentication challenge via face unlock or fingerprint sensor can automatically bypass the * lock screen. */ fun isBypassEnabled() = repository.isBypassEnabled() val isBypassEnabled: StateFlow<Boolean> = repository.isBypassEnabled }
packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt +27 −29 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICA import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.distinctUntilChanged Loading @@ -51,7 +52,6 @@ import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.mapNotNull import kotlinx.coroutines.launch import javax.inject.Inject /** * Hooks up business logic that manipulates the state of the [SceneInteractor] for the system UI Loading Loading @@ -142,7 +142,7 @@ constructor( // When the device becomes unlocked in Lockscreen, go to Gone if // bypass is enabled. renderedScenes.contains(SceneKey.Lockscreen) -> if (deviceEntryInteractor.isBypassEnabled()) { if (deviceEntryInteractor.isBypassEnabled.value) { SceneKey.Gone to "device unlocked in Lockscreen scene with bypass" } else { Loading Loading @@ -179,8 +179,7 @@ constructor( } applicationScope.launch { powerInteractor.isAsleep .collect { isAsleep -> powerInteractor.isAsleep.collect { isAsleep -> if (isAsleep) { switchToScene( targetSceneKey = SceneKey.Lockscreen, Loading @@ -194,8 +193,7 @@ constructor( switchToScene( targetSceneKey = SceneKey.Gone, loggingReason = "device is starting to wake up while auth method is" + " none", "device is starting to wake up while auth method is" + " none", ) } authMethod.isSecure && isUnlocked -> { Loading
packages/SystemUI/src/com/android/systemui/statusbar/CrossFadeHelper.java +12 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.systemui.statusbar; import android.view.View; import androidx.annotation.Nullable; import com.android.app.animation.Interpolators; import com.android.systemui.res.R; import com.android.systemui.statusbar.notification.stack.StackStateAnimator; Loading Loading @@ -113,7 +115,16 @@ public class CrossFadeHelper { fadeIn(view, ANIMATION_DURATION_LENGTH, 0); } public static void fadeIn(final View view, Runnable endRunnable) { fadeIn(view, ANIMATION_DURATION_LENGTH, /* delay= */ 0, endRunnable); } public static void fadeIn(final View view, long duration, int delay) { fadeIn(view, duration, delay, /* endRunnable= */ null); } public static void fadeIn(final View view, long duration, int delay, @Nullable Runnable endRunnable) { view.animate().cancel(); if (view.getVisibility() == View.INVISIBLE) { view.setAlpha(0.0f); Loading @@ -124,7 +135,7 @@ public class CrossFadeHelper { .setDuration(duration) .setStartDelay(delay) .setInterpolator(Interpolators.ALPHA_IN) .withEndAction(null); .withEndAction(endRunnable); if (view.hasOverlappingRendering() && view.getLayerType() != View.LAYER_TYPE_HARDWARE) { view.animate().withLayer(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +7 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; import android.view.animation.Interpolator; import androidx.annotation.Nullable; import androidx.core.graphics.ColorUtils; import com.android.app.animation.Interpolators; Loading Loading @@ -959,12 +960,17 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi } public void setDozing(boolean dozing, boolean fade, long delay) { setDozing(dozing, fade, delay, /* onChildCompleted= */ null); } public void setDozing(boolean dozing, boolean fade, long delay, @Nullable Runnable endRunnable) { mDozer.setDozing(f -> { mDozeAmount = f; updateDecorColor(); updateIconColor(); updateAllowAnimation(); }, dozing, fade, delay, this); }, dozing, fade, delay, this, endRunnable); } private void updateAllowAnimation() { Loading