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

Commit 373dda41 authored by Beth Thibodeau's avatar Beth Thibodeau
Browse files

Update media target bounds after QS height changes

Also add log info, clean up unused listeners in MediaViewController

Bug: 404815434
Bug: 415755300
Test: verify media size after rotate, fold/unfold, close/open shade
Flag: EXEMPT bugfix
Change-Id: I4c945235397e57d85cbaeeaf0a7dff3e701ac5fe
parent e1c56a35
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -494,6 +494,10 @@ constructor(
        }
    }

    fun onQsHeightUpdated() {
        updateTargetState()
    }

    init {
        dumpManager.registerNormalDumpable(TAG, this)
        updateConfiguration()
+2 −15
Original line number Diff line number Diff line
@@ -95,8 +95,6 @@ constructor(

    /** A listener when the current dimensions of the player change */
    lateinit var sizeChangedListener: () -> Unit
    lateinit var configurationChangeListener: () -> Unit
    lateinit var recsConfigurationChangeListener: (MediaViewController, TransitionLayout) -> Unit
    var locationChangeListener: (Int) -> Unit = {}
    private var firstRefresh: Boolean = true
    @VisibleForTesting private var transitionLayout: TransitionLayout? = null
@@ -289,18 +287,7 @@ constructor(
                            )
                        )
                    }
                    if (SceneContainerFlag.isEnabled) {
                        if (
                            this@MediaViewController::recsConfigurationChangeListener.isInitialized
                        ) {
                            transitionLayout?.let {
                                recsConfigurationChangeListener.invoke(this@MediaViewController, it)
                            }
                        }
                    } else if (
                        this@MediaViewController::configurationChangeListener.isInitialized
                    ) {
                        configurationChangeListener.invoke()
                    if (!SceneContainerFlag.isEnabled) {
                        refreshState()
                    }
                }
@@ -996,7 +983,7 @@ constructor(
            // Let's squish the media player if our size was overridden
            result = squishViewState(result, state.squishFraction)
        }
        logger.logMediaSize("update to carousel", result.width, result.height)
        logger.logMediaSize("update to carousel (squish ${state?.squishFraction}", result.width, result.height)
        return result
    }

+1 −0
Original line number Diff line number Diff line
@@ -872,6 +872,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
            mMaxExpansionHeight = mQs.getDesiredHeight();
            mNotificationStackScrollLayoutController.setMaxTopPadding(
                    getMaxExpansionHeight());
            mMediaHierarchyManager.onQsHeightUpdated();
        }
        return oldMaxHeight;
    }