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

Commit af960d00 authored by shubang's avatar shubang
Browse files

Fix NPE of extras in media metrics

Bug: 182186519
Bug: 182104911
Test: CTS
Change-Id: I114763499b62eb62aa9d770e6b1e1f98ce6a8eaf
parent 3f4814f5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -113,10 +113,11 @@ public final class NetworkEvent extends Event implements Parcelable {
     *
     * @hide
     */
    public NetworkEvent(@NetworkType int type, long timeSinceCreatedMillis, Bundle extras) {
    public NetworkEvent(@NetworkType int type, long timeSinceCreatedMillis,
            @Nullable Bundle extras) {
        this.mNetworkType = type;
        this.mTimeSinceCreatedMillis = timeSinceCreatedMillis;
        this.mExtras = extras.deepCopy();
        this.mExtras = extras == null ? null : extras.deepCopy();
    }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -65,12 +65,12 @@ public final class PlaybackErrorEvent extends Event implements Parcelable {
            int errorCode,
            int subErrorCode,
            long timeSinceCreatedMillis,
            Bundle extras) {
            @Nullable Bundle extras) {
        this.mExceptionStack = exceptionStack;
        this.mErrorCode = errorCode;
        this.mSubErrorCode = subErrorCode;
        this.mTimeSinceCreatedMillis = timeSinceCreatedMillis;
        this.mExtras = extras.deepCopy();
        this.mExtras = extras == null ? null : extras.deepCopy();
    }

    /** @hide */
+2 −2
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ public final class PlaybackMetrics implements Parcelable {
            long localBytesRead,
            long networkTransferDurationMillis,
            byte[] drmSessionId,
            Bundle extras) {
            @Nullable Bundle extras) {
        this.mMediaDurationMillis = mediaDurationMillis;
        this.mStreamSource = streamSource;
        this.mStreamType = streamType;
@@ -212,7 +212,7 @@ public final class PlaybackMetrics implements Parcelable {
        this.mLocalBytesRead = localBytesRead;
        this.mNetworkTransferDurationMillis = networkTransferDurationMillis;
        this.mDrmSessionId = drmSessionId;
        this.mExtras = extras.deepCopy();
        this.mExtras = extras == null ? null : extras.deepCopy();
    }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -138,10 +138,10 @@ public final class PlaybackStateEvent extends Event implements Parcelable {
    public PlaybackStateEvent(
            int state,
            long timeSinceCreatedMillis,
            Bundle extras) {
            @Nullable Bundle extras) {
        this.mTimeSinceCreatedMillis = timeSinceCreatedMillis;
        this.mState = state;
        this.mExtras = extras.deepCopy();
        this.mExtras = extras == null ? null : extras.deepCopy();
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ public final class TrackChangeEvent extends Event implements Parcelable {
        this.mWidth = width;
        this.mHeight = height;
        this.mVideoFrameRate = videoFrameRate;
        this.mExtras = extras.deepCopy();
        this.mExtras = extras == null ? null : extras.deepCopy();
    }

    /**