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

Commit 1a0b343b authored by Christian Göllner's avatar Christian Göllner
Browse files

MediaHierarchyManager: prevent crash when previousLocation is -1

This can happen when expanding split shade on lock screen with no media.
Because we are expanding on lock screen in split shade, the transformation
type is TRANSITION.

Bug: 221193561
Test: Manually
Change-Id: Ide21f54d80113e646729cd40c42ed1039d6a0413
parent e4590dbf
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -785,7 +785,11 @@ class MediaHierarchyManager @Inject constructor(
     * @return true if this transformation is guided by an external progress like a finger
     */
    private fun isCurrentlyInGuidedTransformation(): Boolean {
        return getTransformationProgress() >= 0
        return hasValidStartAndEndLocations() && getTransformationProgress() >= 0
    }

    private fun hasValidStartAndEndLocations(): Boolean {
        return previousLocation != -1 && desiredLocation != -1
    }

    /**