mirror of
https://github.com/androidx/media.git
synced 2025-04-29 22:36:54 +08:00
Prevent metricsReporter.reportMetrics()
from throwing
In general, metrics collection should not lead to Transformer thorwing and crashing the app. PiperOrigin-RevId: 739099456 (cherry picked from commit 3f5019b9088555e8bbbd492901c272ae47b5fb67)
This commit is contained in:
parent
aea0637c95
commit
184416adfc
@ -16,7 +16,6 @@
|
||||
|
||||
package androidx.media3.transformer;
|
||||
|
||||
import static androidx.media3.common.util.Assertions.checkState;
|
||||
import static androidx.media3.common.util.Util.usToMs;
|
||||
|
||||
import android.content.Context;
|
||||
@ -102,8 +101,7 @@ import java.util.List;
|
||||
|
||||
@Override
|
||||
public void reportMetrics(EditingEndedEvent editingEndedEvent) {
|
||||
checkState(!metricsReported, "Metrics have already been reported.");
|
||||
if (editingSession != null) {
|
||||
if (!metricsReported && editingSession != null) {
|
||||
editingSession.reportEditingEndedEvent(editingEndedEvent);
|
||||
metricsReported = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user