Merge "Fix NPE of extras in media metrics" into sc-dev

This commit is contained in:
Shubang Lu
2021-03-11 02:03:09 +00:00
committed by Android (Google) Code Review
5 changed files with 10 additions and 9 deletions

View File

@@ -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();
}
/**

View File

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

View File

@@ -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();
}
/**

View File

@@ -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();
}
/**

View File

@@ -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();
}
/**