Loading core/java/android/app/WallpaperManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -284,6 +284,14 @@ public class WallpaperManager { */ public static final String COMMAND_UNFREEZE = "android.wallpaper.unfreeze"; /** * Command for {@link #sendWallpaperCommand}: in sendWallpaperCommand put extra to this command * to give the bounds of space between the bottom of notifications and the top of shortcuts * @hide */ public static final String COMMAND_LOCKSCREEN_LAYOUT_CHANGED = "android.wallpaper.lockscreen_layout_changed"; /** * Extra passed back from setWallpaper() giving the new wallpaper's assigned ID. * @hide Loading packages/SystemUI/aconfig/systemui.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -1473,3 +1473,11 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "magic_portrait_wallpapers" namespace: "systemui" description: "Magic Portrait related changes in systemui" bug: "370863642" } packages/SystemUI/multivalentTests/src/com/android/systemui/wallpapers/data/repository/FakeWallpaperRepository.kt +7 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,17 @@ package com.android.systemui.wallpapers.data.repository import android.app.WallpaperInfo import android.view.View import kotlinx.coroutines.flow.MutableStateFlow /** Fake implementation of the wallpaper repository. */ class FakeWallpaperRepository : WallpaperRepository { override val wallpaperInfo = MutableStateFlow<WallpaperInfo?>(null) override val wallpaperSupportsAmbientMode = MutableStateFlow(false) override var rootView: View? = null private val _notificationStackAbsoluteBottom = MutableStateFlow(0F) override fun setNotificationStackAbsoluteBottom(bottom: Float) { _notificationStackAbsoluteBottom.value = bottom } } packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardClockRepository.kt +16 −3 Original line number Diff line number Diff line Loading @@ -68,11 +68,16 @@ interface KeyguardClockRepository { val previewClock: Flow<ClockController> /** top of notifications without bcsmartspace in small clock settings */ val notificationDefaultTop: StateFlow<Float> val clockEventController: ClockEventController val shouldForceSmallClock: Boolean fun setClockSize(size: ClockSize) fun setNotificationDefaultTop(top: Float) } @SysUISingleton Loading Loading @@ -108,7 +113,7 @@ constructor( .stateIn( scope = applicationScope, started = SharingStarted.WhileSubscribed(), initialValue = getClockSize() initialValue = getClockSize(), ) override val currentClockId: Flow<ClockId> = Loading Loading @@ -138,7 +143,7 @@ constructor( .stateIn( scope = applicationScope, started = SharingStarted.WhileSubscribed(), initialValue = clockRegistry.createCurrentClock() initialValue = clockRegistry.createCurrentClock(), ) override val previewClock: Flow<ClockController> = Loading @@ -149,6 +154,14 @@ constructor( clockRegistry.createCurrentClock() } private val _notificationDefaultTop: MutableStateFlow<Float> = MutableStateFlow(0F) override val notificationDefaultTop: StateFlow<Float> = _notificationDefaultTop.asStateFlow() override fun setNotificationDefaultTop(top: Float) { _notificationDefaultTop.value = top } override val shouldForceSmallClock: Boolean get() = featureFlags.isEnabled(Flags.LOCKSCREEN_ENABLE_LANDSCAPE) && Loading @@ -160,7 +173,7 @@ constructor( secureSettings.getIntForUser( Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, /* defaultValue= */ 1, UserHandle.USER_CURRENT UserHandle.USER_CURRENT, ) ) } Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +19 −7 Original line number Diff line number Diff line Loading @@ -269,6 +269,9 @@ interface KeyguardRepository { */ val isEncryptedOrLockdown: Flow<Boolean> /** The top of shortcut in screen, used by wallpaper to find remaining space in lockscreen */ val shortcutAbsoluteTop: StateFlow<Float> /** * Returns `true` if the keyguard is showing; `false` otherwise. * Loading Loading @@ -339,6 +342,8 @@ interface KeyguardRepository { * otherwise. */ fun isShowKeyguardWhenReenabled(): Boolean fun setShortcutAbsoluteTop(top: Float) } /** Encapsulates application state for the keyguard. */ Loading Loading @@ -503,7 +508,7 @@ constructor( trySendWithFailureLogging( statusBarStateController.dozeAmount, TAG, "initial dozeAmount" "initial dozeAmount", ) awaitClose { statusBarStateController.removeCallback(callback) } Loading @@ -521,7 +526,7 @@ constructor( object : DozeTransitionCallback { override fun onDozeTransition( oldState: DozeMachine.State, newState: DozeMachine.State newState: DozeMachine.State, ) { trySendWithFailureLogging( DozeTransitionModel( Loading @@ -529,7 +534,7 @@ constructor( to = dozeMachineStateToModel(newState), ), TAG, "doze transition model" "doze transition model", ) } } Loading @@ -541,7 +546,7 @@ constructor( to = dozeMachineStateToModel(dozeTransitionListener.newState), ), TAG, "initial doze transition model" "initial doze transition model", ) awaitClose { dozeTransitionListener.removeCallback(callback) } Loading Loading @@ -579,7 +584,7 @@ constructor( trySendWithFailureLogging( statusBarStateIntToObject(state), TAG, "state" "state", ) } } Loading @@ -590,7 +595,7 @@ constructor( .stateIn( scope, SharingStarted.Eagerly, statusBarStateIntToObject(statusBarStateController.state) statusBarStateIntToObject(statusBarStateController.state), ) private val _biometricUnlockState: MutableStateFlow<BiometricUnlockModel> = Loading @@ -610,7 +615,7 @@ constructor( trySendWithFailureLogging( authController.fingerprintSensorLocation, TAG, "AuthController.Callback#onFingerprintLocationChanged" "AuthController.Callback#onFingerprintLocationChanged", ) } Loading @@ -635,6 +640,9 @@ constructor( private val _isActiveDreamLockscreenHosted = MutableStateFlow(false) override val isActiveDreamLockscreenHosted = _isActiveDreamLockscreenHosted.asStateFlow() private val _shortcutAbsoluteTop = MutableStateFlow(0F) override val shortcutAbsoluteTop = _shortcutAbsoluteTop.asStateFlow() init { val callback = object : KeyguardStateController.Callback { Loading Loading @@ -721,6 +729,10 @@ constructor( } } override fun setShortcutAbsoluteTop(top: Float) { _shortcutAbsoluteTop.value = top } private fun dozeMachineStateToModel(state: DozeMachine.State): DozeStateModel { return when (state) { DozeMachine.State.UNINITIALIZED -> DozeStateModel.UNINITIALIZED Loading Loading
core/java/android/app/WallpaperManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -284,6 +284,14 @@ public class WallpaperManager { */ public static final String COMMAND_UNFREEZE = "android.wallpaper.unfreeze"; /** * Command for {@link #sendWallpaperCommand}: in sendWallpaperCommand put extra to this command * to give the bounds of space between the bottom of notifications and the top of shortcuts * @hide */ public static final String COMMAND_LOCKSCREEN_LAYOUT_CHANGED = "android.wallpaper.lockscreen_layout_changed"; /** * Extra passed back from setWallpaper() giving the new wallpaper's assigned ID. * @hide Loading
packages/SystemUI/aconfig/systemui.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -1473,3 +1473,11 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "magic_portrait_wallpapers" namespace: "systemui" description: "Magic Portrait related changes in systemui" bug: "370863642" }
packages/SystemUI/multivalentTests/src/com/android/systemui/wallpapers/data/repository/FakeWallpaperRepository.kt +7 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,17 @@ package com.android.systemui.wallpapers.data.repository import android.app.WallpaperInfo import android.view.View import kotlinx.coroutines.flow.MutableStateFlow /** Fake implementation of the wallpaper repository. */ class FakeWallpaperRepository : WallpaperRepository { override val wallpaperInfo = MutableStateFlow<WallpaperInfo?>(null) override val wallpaperSupportsAmbientMode = MutableStateFlow(false) override var rootView: View? = null private val _notificationStackAbsoluteBottom = MutableStateFlow(0F) override fun setNotificationStackAbsoluteBottom(bottom: Float) { _notificationStackAbsoluteBottom.value = bottom } }
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardClockRepository.kt +16 −3 Original line number Diff line number Diff line Loading @@ -68,11 +68,16 @@ interface KeyguardClockRepository { val previewClock: Flow<ClockController> /** top of notifications without bcsmartspace in small clock settings */ val notificationDefaultTop: StateFlow<Float> val clockEventController: ClockEventController val shouldForceSmallClock: Boolean fun setClockSize(size: ClockSize) fun setNotificationDefaultTop(top: Float) } @SysUISingleton Loading Loading @@ -108,7 +113,7 @@ constructor( .stateIn( scope = applicationScope, started = SharingStarted.WhileSubscribed(), initialValue = getClockSize() initialValue = getClockSize(), ) override val currentClockId: Flow<ClockId> = Loading Loading @@ -138,7 +143,7 @@ constructor( .stateIn( scope = applicationScope, started = SharingStarted.WhileSubscribed(), initialValue = clockRegistry.createCurrentClock() initialValue = clockRegistry.createCurrentClock(), ) override val previewClock: Flow<ClockController> = Loading @@ -149,6 +154,14 @@ constructor( clockRegistry.createCurrentClock() } private val _notificationDefaultTop: MutableStateFlow<Float> = MutableStateFlow(0F) override val notificationDefaultTop: StateFlow<Float> = _notificationDefaultTop.asStateFlow() override fun setNotificationDefaultTop(top: Float) { _notificationDefaultTop.value = top } override val shouldForceSmallClock: Boolean get() = featureFlags.isEnabled(Flags.LOCKSCREEN_ENABLE_LANDSCAPE) && Loading @@ -160,7 +173,7 @@ constructor( secureSettings.getIntForUser( Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, /* defaultValue= */ 1, UserHandle.USER_CURRENT UserHandle.USER_CURRENT, ) ) } Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +19 −7 Original line number Diff line number Diff line Loading @@ -269,6 +269,9 @@ interface KeyguardRepository { */ val isEncryptedOrLockdown: Flow<Boolean> /** The top of shortcut in screen, used by wallpaper to find remaining space in lockscreen */ val shortcutAbsoluteTop: StateFlow<Float> /** * Returns `true` if the keyguard is showing; `false` otherwise. * Loading Loading @@ -339,6 +342,8 @@ interface KeyguardRepository { * otherwise. */ fun isShowKeyguardWhenReenabled(): Boolean fun setShortcutAbsoluteTop(top: Float) } /** Encapsulates application state for the keyguard. */ Loading Loading @@ -503,7 +508,7 @@ constructor( trySendWithFailureLogging( statusBarStateController.dozeAmount, TAG, "initial dozeAmount" "initial dozeAmount", ) awaitClose { statusBarStateController.removeCallback(callback) } Loading @@ -521,7 +526,7 @@ constructor( object : DozeTransitionCallback { override fun onDozeTransition( oldState: DozeMachine.State, newState: DozeMachine.State newState: DozeMachine.State, ) { trySendWithFailureLogging( DozeTransitionModel( Loading @@ -529,7 +534,7 @@ constructor( to = dozeMachineStateToModel(newState), ), TAG, "doze transition model" "doze transition model", ) } } Loading @@ -541,7 +546,7 @@ constructor( to = dozeMachineStateToModel(dozeTransitionListener.newState), ), TAG, "initial doze transition model" "initial doze transition model", ) awaitClose { dozeTransitionListener.removeCallback(callback) } Loading Loading @@ -579,7 +584,7 @@ constructor( trySendWithFailureLogging( statusBarStateIntToObject(state), TAG, "state" "state", ) } } Loading @@ -590,7 +595,7 @@ constructor( .stateIn( scope, SharingStarted.Eagerly, statusBarStateIntToObject(statusBarStateController.state) statusBarStateIntToObject(statusBarStateController.state), ) private val _biometricUnlockState: MutableStateFlow<BiometricUnlockModel> = Loading @@ -610,7 +615,7 @@ constructor( trySendWithFailureLogging( authController.fingerprintSensorLocation, TAG, "AuthController.Callback#onFingerprintLocationChanged" "AuthController.Callback#onFingerprintLocationChanged", ) } Loading @@ -635,6 +640,9 @@ constructor( private val _isActiveDreamLockscreenHosted = MutableStateFlow(false) override val isActiveDreamLockscreenHosted = _isActiveDreamLockscreenHosted.asStateFlow() private val _shortcutAbsoluteTop = MutableStateFlow(0F) override val shortcutAbsoluteTop = _shortcutAbsoluteTop.asStateFlow() init { val callback = object : KeyguardStateController.Callback { Loading Loading @@ -721,6 +729,10 @@ constructor( } } override fun setShortcutAbsoluteTop(top: Float) { _shortcutAbsoluteTop.value = top } private fun dozeMachineStateToModel(state: DozeMachine.State): DozeStateModel { return when (state) { DozeMachine.State.UNINITIALIZED -> DozeStateModel.UNINITIALIZED Loading