MediaSession2: Add onDataSourceMissingHelper am: ee19f10ecc
am: ef201fb504

Change-Id: I403f6d2c88ade4d786f13548cdce43681effb4d6
diff --git a/packages/MediaComponents/src/com/android/media/MediaItem2Impl.java b/packages/MediaComponents/src/com/android/media/MediaItem2Impl.java
index 252512c..039ff8f 100644
--- a/packages/MediaComponents/src/com/android/media/MediaItem2Impl.java
+++ b/packages/MediaComponents/src/com/android/media/MediaItem2Impl.java
@@ -44,14 +44,11 @@
     private DataSourceDesc mDataSourceDesc;
 
     // From the public API
-    public MediaItem2Impl(Context context, String mediaId,
-            DataSourceDesc dsd, MediaMetadata2 metadata, @Flags int flags) {
+    public MediaItem2Impl(@NonNull Context context, @NonNull String mediaId,
+            @Nullable DataSourceDesc dsd, @Nullable MediaMetadata2 metadata, @Flags int flags) {
         if (mediaId == null) {
             throw new IllegalArgumentException("mediaId shouldn't be null");
         }
-        if (dsd == null) {
-            throw new IllegalArgumentException("dsd shouldn't be null");
-        }
         if (metadata != null && !TextUtils.equals(mediaId, metadata.getMediaId())) {
             throw new IllegalArgumentException("metadata's id should be matched with the mediaid");
         }
@@ -186,10 +183,7 @@
         }
 
         @Override
-        public Builder setDataSourceDesc_impl(@NonNull DataSourceDesc dataSourceDesc) {
-            if (dataSourceDesc == null) {
-                throw new IllegalArgumentException("dataSourceDesc shouldn't be null");
-            }
+        public Builder setDataSourceDesc_impl(@Nullable DataSourceDesc dataSourceDesc) {
             mDataSourceDesc = dataSourceDesc;
             return mInstance;
         }