diff options
| author | 2024-02-15 12:24:49 +0000 | |
|---|---|---|
| committer | 2024-02-15 12:41:39 +0000 | |
| commit | 35a57a24182bd977cbfa0d86cd5ec60c15a67b6b (patch) | |
| tree | 7c12a077ba42588f5b7baae2b56ca7a8c0904eb9 | |
| parent | 4c1bdc28c6d91af5e4bfb0ebd48118150748602a (diff) | |
Fix incorrectly sized overlay for unfold animation
Currently we are fetching display info every time before adding an
overlay. Due to some unknown reason some displays are occasionally(1 out of 3 times) missing from the
list of display received from display manager. This resulted in incorrect display layout parameters and hence
incorrectly sized unfold overlay animation.
After this change we will be fetching the list of displays from display manager
only once when the object is initialized.
Fixes: 324386469
Test: Flash build locally to device
* Fold -> Unfold the device multiple times
* Check if unfold animation is occurring with correct size of overlay
Flag: ACONFIG fold_lock_setting_enabled TRUNKFOOD
Change-Id: Icdc028aac49a2da8361c25ee5906bfcd40582ec7
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/unfold/FullscreenLightRevealAnimation.kt | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/unfold/FullscreenLightRevealAnimation.kt b/packages/SystemUI/src/com/android/systemui/unfold/FullscreenLightRevealAnimation.kt index 668b1439abab..ca5ea3bc1caa 100644 --- a/packages/SystemUI/src/com/android/systemui/unfold/FullscreenLightRevealAnimation.kt +++ b/packages/SystemUI/src/com/android/systemui/unfold/FullscreenLightRevealAnimation.kt @@ -45,7 +45,6 @@ import com.android.wm.shell.displayareahelper.DisplayAreaHelper import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject -import java.lang.IllegalArgumentException import java.util.Optional import java.util.concurrent.Executor import java.util.function.Consumer @@ -71,7 +70,7 @@ constructor( private val displayTracker: DisplayTracker, @Background private val applicationScope: CoroutineScope, @Main private val executor: Executor, - @Assisted private val displaySelector: Sequence<DisplayInfo>.() -> DisplayInfo?, + @Assisted private val displaySelector: List<DisplayInfo>.() -> DisplayInfo?, @Assisted private val lightRevealEffectFactory: (rotation: Int) -> LightRevealEffect, @Assisted private val overlayContainerName: String ) { @@ -84,13 +83,11 @@ constructor( private var scrimView: LightRevealScrim? = null private val rotationWatcher = RotationWatcher() - private val internalDisplayInfos: Sequence<DisplayInfo> - get() = - displayManager - .getDisplays(DisplayManager.DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED) - .asSequence() - .map { DisplayInfo().apply { it.getDisplayInfo(this) } } - .filter { it.type == Display.TYPE_INTERNAL } + private val internalDisplayInfos: List<DisplayInfo> = + displayManager + .getDisplays(DisplayManager.DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED) + .map { DisplayInfo().apply { it.getDisplayInfo(this) } } + .filter { it.type == Display.TYPE_INTERNAL } var isTouchBlocked: Boolean = false set(value) { @@ -252,7 +249,7 @@ constructor( @AssistedFactory interface Factory { fun create( - displaySelector: Sequence<DisplayInfo>.() -> DisplayInfo?, + displaySelector: List<DisplayInfo>.() -> DisplayInfo?, effectFactory: (rotation: Int) -> LightRevealEffect, overlayContainerName: String ): FullscreenLightRevealAnimationController |