Fix NPE of extras in media metrics
Bug: 182186519 Bug: 182104911 Test: CTS Change-Id: I114763499b62eb62aa9d770e6b1e1f98ce6a8eaf
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user