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

Commit f80a94a9 authored by Sherry Zhou's avatar Sherry Zhou
Browse files

Layout shape effects correctly in foldable and tablet

Bug: 382776222
Test: manual test on comet and tangor, observe the shape effects is
positioned in correct place, and positioning in editor is not influenced by this
change.
Flag: com.android.systemui.magic_portrait_wallpapers

Change-Id: Icef520e06b8371546318fd75399828dc7899ce9e
parent d9d05f15
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -26,4 +26,5 @@ class FakeWallpaperRepository : WallpaperRepository {
    override val wallpaperInfo = MutableStateFlow<WallpaperInfo?>(null)
    override val wallpaperSupportsAmbientMode = flowOf(false)
    override var rootView: View? = null
    override val shouldSendFocalArea = MutableStateFlow(false)
}
+2 −3
Original line number Diff line number Diff line
@@ -67,7 +67,6 @@ class WallpaperRepositoryImplTest : SysuiTestCase() {
            fakeBroadcastDispatcher,
            userRepository,
            keyguardRepository,
            keyguardClockRepository,
            wallpaperManager,
            context,
        )
@@ -252,7 +251,7 @@ class WallpaperRepositoryImplTest : SysuiTestCase() {
    @EnableFlags(Flags.FLAG_MAGIC_PORTRAIT_WALLPAPERS)
    fun shouldSendNotificationLayout_setMagicPortraitWallpaper_launchSendLayoutJob() =
        testScope.runTest {
            val latest by collectLastValue(underTest.shouldSendNotificationLayout)
            val latest by collectLastValue(underTest.shouldSendFocalArea)
            val magicPortraitWallpaper =
                mock<WallpaperInfo>().apply {
                    whenever(this.component)
@@ -273,7 +272,7 @@ class WallpaperRepositoryImplTest : SysuiTestCase() {
    @EnableFlags(Flags.FLAG_MAGIC_PORTRAIT_WALLPAPERS)
    fun shouldSendNotificationLayout_setNotMagicPortraitWallpaper_cancelSendLayoutJob() =
        testScope.runTest {
            val latest by collectLastValue(underTest.shouldSendNotificationLayout)
            val latest by collectLastValue(underTest.shouldSendFocalArea)
            val magicPortraitWallpaper = MAGIC_PORTRAIT_WP
            whenever(wallpaperManager.getWallpaperInfoForUser(any()))
                .thenReturn(magicPortraitWallpaper)
+1 −0
Original line number Diff line number Diff line
@@ -16,4 +16,5 @@

<resources>
    <item name="shortcut_helper_screen_width_fraction"  format="float" type="dimen">0.8</item>
    <bool name="center_align_magic_portrait_shape">true</bool>
</resources>
+4 −1
Original line number Diff line number Diff line
@@ -1104,7 +1104,10 @@
    -->
    <bool name="config_userSwitchingMustGoThroughLoginScreen">false</bool>


    <!-- The dream component used when the device is low light environment. -->
    <string translatable="false" name="config_lowLightDreamComponent"/>

    <!--Whether we should position magic portrait shape effects in the center of lockscreen
    it's false by default, and only be true in tablet landscape -->
    <bool name="center_align_magic_portrait_shape">false</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryHapticsInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor
import com.android.systemui.keyguard.domain.interactor.WallpaperFocalAreaInteractor
import com.android.systemui.keyguard.ui.binder.KeyguardBlueprintViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardRootViewBinder
import com.android.systemui.keyguard.ui.binder.LightRevealScrimViewBinder
@@ -79,6 +80,7 @@ constructor(
    private val keyguardClockViewModel: KeyguardClockViewModel,
    private val smartspaceViewModel: KeyguardSmartspaceViewModel,
    private val clockInteractor: KeyguardClockInteractor,
    private val wallpaperFocalAreaInteractor: WallpaperFocalAreaInteractor,
    private val keyguardViewMediator: KeyguardViewMediator,
    private val deviceEntryUnlockTrackerViewBinder: Optional<DeviceEntryUnlockTrackerViewBinder>,
    private val statusBarKeyguardViewManager: StatusBarKeyguardViewManager,
@@ -139,6 +141,7 @@ constructor(
                screenOffAnimationController,
                shadeInteractor,
                clockInteractor,
                wallpaperFocalAreaInteractor,
                keyguardClockViewModel,
                interactionJankMonitor,
                deviceEntryHapticsInteractor,
Loading