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

Commit 35a57a24 authored by dshivangi's avatar dshivangi Committed by Shivangi Dubey
Browse files

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
parent 4c1bdc28
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -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,11 +83,9 @@ constructor(
    private var scrimView: LightRevealScrim? = null

    private val rotationWatcher = RotationWatcher()
    private val internalDisplayInfos: Sequence<DisplayInfo>
        get() =
    private val internalDisplayInfos: List<DisplayInfo> =
        displayManager
            .getDisplays(DisplayManager.DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED)
                .asSequence()
            .map { DisplayInfo().apply { it.getDisplayInfo(this) } }
            .filter { it.type == Display.TYPE_INTERNAL }

@@ -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