Loading media/java/android/media/MediaPlayer2Impl.java +13 −8 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ import android.widget.VideoView; import com.android.framework.protobuf.InvalidProtocolBufferException; import com.android.internal.annotations.GuardedBy; import com.android.internal.util.Preconditions; import libcore.io.IoBridge; Loading Loading @@ -350,7 +349,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { addTask(new Task(CALL_COMPLETED_SET_DATA_SOURCE, false) { @Override void process() throws IOException { Preconditions.checkArgument(dsd != null, "the DataSourceDesc cannot be null"); checkArgument(dsd != null, "the DataSourceDesc cannot be null"); int state = getState(); if (state != PLAYER_STATE_ERROR && state != PLAYER_STATE_IDLE) { throw new IllegalStateException("called in wrong state " + state); Loading @@ -376,7 +375,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { addTask(new Task(CALL_COMPLETED_SET_NEXT_DATA_SOURCE, false) { @Override void process() { Preconditions.checkArgument(dsd != null, "the DataSourceDesc cannot be null"); checkArgument(dsd != null, "the DataSourceDesc cannot be null"); synchronized (mSrcLock) { mNextDSDs = new ArrayList<DataSourceDesc>(1); mNextDSDs.add(dsd); Loading Loading @@ -690,7 +689,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { private void handleDataSource(boolean isCurrent, @NonNull DataSourceDesc dsd, long srcId) throws IOException { Preconditions.checkNotNull(dsd, "the DataSourceDesc cannot be null"); checkArgument(dsd != null, "the DataSourceDesc cannot be null"); switch (dsd.getType()) { case DataSourceDesc.TYPE_CALLBACK: Loading Loading @@ -1290,7 +1289,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { addTask(new Task(CALL_COMPLETED_SET_BUFFERING_PARAMS, false) { @Override void process() { Preconditions.checkArgument(params != null, "the BufferingParams cannot be null"); checkArgument(params != null, "the BufferingParams cannot be null"); _setBufferingParams(params); } }); Loading Loading @@ -1354,7 +1353,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { addTask(new Task(CALL_COMPLETED_SET_PLAYBACK_PARAMS, false) { @Override void process() { Preconditions.checkArgument(params != null, "the PlaybackParams cannot be null"); checkArgument(params != null, "the PlaybackParams cannot be null"); _setPlaybackParams(params); } }); Loading Loading @@ -1387,7 +1386,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { addTask(new Task(CALL_COMPLETED_SET_SYNC_PARAMS, false) { @Override void process() { Preconditions.checkArgument(params != null, "the SyncParams cannot be null"); checkArgument(params != null, "the SyncParams cannot be null"); _setSyncParams(params); } }); Loading Loading @@ -3027,6 +3026,12 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { } } public static void checkArgument(boolean expression, String errorMessage) { if (!expression) { throw new IllegalArgumentException(errorMessage); } } private void sendEvent(final EventNotifier notifier) { synchronized (mEventCbLock) { try { Loading Loading
media/java/android/media/MediaPlayer2Impl.java +13 −8 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ import android.widget.VideoView; import com.android.framework.protobuf.InvalidProtocolBufferException; import com.android.internal.annotations.GuardedBy; import com.android.internal.util.Preconditions; import libcore.io.IoBridge; Loading Loading @@ -350,7 +349,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { addTask(new Task(CALL_COMPLETED_SET_DATA_SOURCE, false) { @Override void process() throws IOException { Preconditions.checkArgument(dsd != null, "the DataSourceDesc cannot be null"); checkArgument(dsd != null, "the DataSourceDesc cannot be null"); int state = getState(); if (state != PLAYER_STATE_ERROR && state != PLAYER_STATE_IDLE) { throw new IllegalStateException("called in wrong state " + state); Loading @@ -376,7 +375,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { addTask(new Task(CALL_COMPLETED_SET_NEXT_DATA_SOURCE, false) { @Override void process() { Preconditions.checkArgument(dsd != null, "the DataSourceDesc cannot be null"); checkArgument(dsd != null, "the DataSourceDesc cannot be null"); synchronized (mSrcLock) { mNextDSDs = new ArrayList<DataSourceDesc>(1); mNextDSDs.add(dsd); Loading Loading @@ -690,7 +689,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { private void handleDataSource(boolean isCurrent, @NonNull DataSourceDesc dsd, long srcId) throws IOException { Preconditions.checkNotNull(dsd, "the DataSourceDesc cannot be null"); checkArgument(dsd != null, "the DataSourceDesc cannot be null"); switch (dsd.getType()) { case DataSourceDesc.TYPE_CALLBACK: Loading Loading @@ -1290,7 +1289,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { addTask(new Task(CALL_COMPLETED_SET_BUFFERING_PARAMS, false) { @Override void process() { Preconditions.checkArgument(params != null, "the BufferingParams cannot be null"); checkArgument(params != null, "the BufferingParams cannot be null"); _setBufferingParams(params); } }); Loading Loading @@ -1354,7 +1353,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { addTask(new Task(CALL_COMPLETED_SET_PLAYBACK_PARAMS, false) { @Override void process() { Preconditions.checkArgument(params != null, "the PlaybackParams cannot be null"); checkArgument(params != null, "the PlaybackParams cannot be null"); _setPlaybackParams(params); } }); Loading Loading @@ -1387,7 +1386,7 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { addTask(new Task(CALL_COMPLETED_SET_SYNC_PARAMS, false) { @Override void process() { Preconditions.checkArgument(params != null, "the SyncParams cannot be null"); checkArgument(params != null, "the SyncParams cannot be null"); _setSyncParams(params); } }); Loading Loading @@ -3027,6 +3026,12 @@ public final class MediaPlayer2Impl extends MediaPlayer2 { } } public static void checkArgument(boolean expression, String errorMessage) { if (!expression) { throw new IllegalArgumentException(errorMessage); } } private void sendEvent(final EventNotifier notifier) { synchronized (mEventCbLock) { try { Loading