Merge "MediaHierarchyManager: prevent crash when previousLocation is -1" into tm-dev

This commit is contained in:
Christian Göllner
2022-02-25 14:50:30 +00:00
committed by Android (Google) Code Review

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