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

Commit 48d5cfa8 authored by Ray Essick's avatar Ray Essick Committed by Android (Google) Code Review
Browse files

Merge "Integrate feedback from MediaMetrics API reviews" into tm-dev

parents 5c687a51 2ee37d3d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -24461,6 +24461,7 @@ package android.media.metrics {
    method public void close();
    method @NonNull public android.media.metrics.LogSessionId getSessionId();
    method public void reportBundleMetrics(@NonNull android.os.PersistableBundle);
    field public static final String KEY_STATSD_ATOM = "bundlesession-statsd-atom";
  }
  public final class EditingSession implements java.lang.AutoCloseable {
@@ -24484,6 +24485,7 @@ package android.media.metrics {
    method @NonNull public android.media.metrics.PlaybackSession createPlaybackSession();
    method @NonNull public android.media.metrics.RecordingSession createRecordingSession();
    method @NonNull public android.media.metrics.TranscodingSession createTranscodingSession();
    method @NonNull public void releaseSessionId(@NonNull String);
    field public static final long INVALID_TIMESTAMP = -1L; // 0xffffffffffffffffL
  }
+14 −0
Original line number Diff line number Diff line
@@ -32,6 +32,15 @@ public final class BundleSession implements AutoCloseable {
    private final @NonNull MediaMetricsManager mManager;
    private final @NonNull LogSessionId mLogSessionId;

    /**
     * A key describing the statsd atom into which to place this bundle's other contents.
     * The associated value is an integer.
     *
     * @see #reportBundleMetrics
     */

    public static final String KEY_STATSD_ATOM = "bundlesession-statsd-atom";

    /** @hide */
    public BundleSession(@NonNull String id, @NonNull MediaMetricsManager manager) {
        mId = id;
@@ -44,6 +53,10 @@ public final class BundleSession implements AutoCloseable {
    /**
     * Reports metrics via bundle.
     *
     * The key {@link #KEY_STATSD_ATOM} references an integer value that
     * indicates the statsd atom for the data in this bundle. Other keys
     * and their types are defined on a per-atom basis.
     *
     */
    public void reportBundleMetrics(@NonNull PersistableBundle metrics) {
        mManager.reportBundleMetrics(mId, metrics);
@@ -68,5 +81,6 @@ public final class BundleSession implements AutoCloseable {

    @Override
    public void close() {
        mManager.releaseSessionId(mLogSessionId.getStringId());
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -59,5 +59,6 @@ public final class EditingSession implements AutoCloseable {

    @Override
    public void close() {
        mManager.releaseSessionId(mLogSessionId.getStringId());
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -41,4 +41,6 @@ interface IMediaMetricsManager {
    String getEditingSessionId(int userId);
    String getBundleSessionId(int userId);
    void reportBundleMetrics(in String sessionId, in PersistableBundle metrics, int userId);

    void releaseSessionId(in String sessionId, int userId);
}
+12 −0
Original line number Diff line number Diff line
@@ -170,6 +170,18 @@ public final class MediaMetricsManager {
        }
    }

    /**
     * Creates a generic bundle session.
     */
    @NonNull
    public void releaseSessionId(@NonNull String sessionId) {
        try {
            mService.releaseSessionId(sessionId, mUserId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Reports error event.
     * @hide
Loading