mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +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;
|
package androidx.media3.transformer;
|
||||||
|
|
||||||
import static androidx.media3.common.util.Assertions.checkState;
|
|
||||||
import static androidx.media3.common.util.Util.usToMs;
|
import static androidx.media3.common.util.Util.usToMs;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -102,8 +101,7 @@ import java.util.List;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reportMetrics(EditingEndedEvent editingEndedEvent) {
|
public void reportMetrics(EditingEndedEvent editingEndedEvent) {
|
||||||
checkState(!metricsReported, "Metrics have already been reported.");
|
if (!metricsReported && editingSession != null) {
|
||||||
if (editingSession != null) {
|
|
||||||
editingSession.reportEditingEndedEvent(editingEndedEvent);
|
editingSession.reportEditingEndedEvent(editingEndedEvent);
|
||||||
metricsReported = true;
|
metricsReported = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user