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
This commit is contained in:
Christian Göllner
2022-02-24 18:12:05 +01:00
parent e4590dbf5d
commit 1a0b343bce

View File

@@ -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
}
/**