Unit tests w/dynamic content to "dynamic-presubmit"

put unit tests that need dynamic content into a "dynamic-presubmit"
grouping so that we can run them with proper flags.

Bug: 167284748
Test: atest --include-subdir frameworks/av/media:dynamic-presubmit \
       -- --enable-module-dynamic-download=true
Change-Id: I39f9373ab1f543dacfae6b420a6969e1603b25dd
diff --git a/media/extractors/TEST_MAPPING b/media/extractors/TEST_MAPPING
index 038b99a..4984b8f 100644
--- a/media/extractors/TEST_MAPPING
+++ b/media/extractors/TEST_MAPPING
@@ -1,7 +1,5 @@
 {
   "presubmit": [
-    // TODO(b/148094059): unit tests not allowed to download content
-    // { "name": "ExtractorUnitTest" },
 
     // TODO(b/153661591) enable test once the bug is fixed
     // This tests the extractor path
@@ -16,5 +14,14 @@
     //      }
     //    ]
     //  }
+  ],
+
+  // tests which require dynamic content
+  // invoke with: atest -- --enable-module-dynamic-download=true
+  // TODO(b/148094059): unit tests not allowed to download content
+  "dynamic-presubmit": [
+    { "name": "ExtractorUnitTest" }
   ]
+
+
 }
diff --git a/media/libstagefright/TEST_MAPPING b/media/libstagefright/TEST_MAPPING
index 3dceef7..a95829c 100644
--- a/media/libstagefright/TEST_MAPPING
+++ b/media/libstagefright/TEST_MAPPING
@@ -1,12 +1,17 @@
 {
-  "presubmit": [
-    // TODO(b/148094059): unit tests not allowed to download content
-    // { "name": "HEVCUtilsUnitTest" },
-    //{ "name": "ExtractorFactoryTest" },
+  // tests which require dynamic content
+  // invoke with: atest -- --enable-module-dynamic-download=true
+  // TODO(b/148094059): unit tests not allowed to download content
+  "dynamic-presubmit": [
     // writerTest fails about 5 out of 66
-    // in addition to needing the download ability
-    //{ "name": "writerTest" },
+    // { "name": "writerTest" },
 
+    { "name": "HEVCUtilsUnitTest" },
+    { "name": "ExtractorFactoryTest" }
+
+  ],
+
+  "presubmit": [
     {
       "name": "CtsMediaTestCases",
       "options": [
diff --git a/media/libstagefright/codecs/amrnb/TEST_MAPPING b/media/libstagefright/codecs/amrnb/TEST_MAPPING
index 2909099..343d08a 100644
--- a/media/libstagefright/codecs/amrnb/TEST_MAPPING
+++ b/media/libstagefright/codecs/amrnb/TEST_MAPPING
@@ -1,11 +1,10 @@
 // mappings for frameworks/av/media/libstagefright/codecs/amrnb
 {
-  "presubmit": [
-    // TODO(b/148094059): unit tests not allowed to download content
-    // { "name": "AmrnbDecoderTest"},
-
-    // TODO(b/148094059): unit tests not allowed to download content
-    // { "name": "AmrnbEncoderTest"}
-
+  // tests which require dynamic content
+  // invoke with: atest -- --enable-module-dynamic-download=true
+  // TODO(b/148094059): unit tests not allowed to download content
+  "dynamic-presubmit": [
+    { "name": "AmrnbDecoderTest"},
+    { "name": "AmrnbEncoderTest"}
   ]
 }
diff --git a/media/libstagefright/codecs/amrwb/TEST_MAPPING b/media/libstagefright/codecs/amrwb/TEST_MAPPING
index 3d58ba2..0278d26 100644
--- a/media/libstagefright/codecs/amrwb/TEST_MAPPING
+++ b/media/libstagefright/codecs/amrwb/TEST_MAPPING
@@ -1,8 +1,10 @@
 // mappings for frameworks/av/media/libstagefright/codecs/amrwb
 {
-  "presubmit": [
-    // TODO(b/148094059): unit tests not allowed to download content
-    // { "name": "AmrwbDecoderTest"}
+  // tests which require dynamic content
+  // invoke with: atest -- --enable-module-dynamic-download=true
+  // TODO(b/148094059): unit tests not allowed to download content
+  "dynamic-presubmit": [
+    { "name": "AmrwbDecoderTest"}
 
   ]
 }
diff --git a/media/libstagefright/codecs/amrwb/test/Android.bp b/media/libstagefright/codecs/amrwb/test/Android.bp
index 968215a..e8a2aa9 100644
--- a/media/libstagefright/codecs/amrwb/test/Android.bp
+++ b/media/libstagefright/codecs/amrwb/test/Android.bp
@@ -16,6 +16,7 @@
 
 cc_test {
     name: "AmrwbDecoderTest",
+    test_suites: ["device-tests"],
     gtest: true,
 
     srcs: [
diff --git a/media/libstagefright/codecs/amrwbenc/TEST_MAPPING b/media/libstagefright/codecs/amrwbenc/TEST_MAPPING
index d53d665..045e8b3 100644
--- a/media/libstagefright/codecs/amrwbenc/TEST_MAPPING
+++ b/media/libstagefright/codecs/amrwbenc/TEST_MAPPING
@@ -1,8 +1,10 @@
 // mappings for frameworks/av/media/libstagefright/codecs/amrwbenc
 {
-  "presubmit": [
-    // TODO(b/148094059): unit tests not allowed to download content
-    // { "name": "AmrwbEncoderTest"}
+  // tests which require dynamic content
+  // invoke with: atest -- --enable-module-dynamic-download=true
+  // TODO(b/148094059): unit tests not allowed to download content
+  "dynamic-presubmit": [
+    { "name": "AmrwbEncoderTest"}
 
   ]
 }
diff --git a/media/libstagefright/codecs/amrwbenc/test/Android.bp b/media/libstagefright/codecs/amrwbenc/test/Android.bp
index 7042bc5..0872570 100644
--- a/media/libstagefright/codecs/amrwbenc/test/Android.bp
+++ b/media/libstagefright/codecs/amrwbenc/test/Android.bp
@@ -16,6 +16,7 @@
 
 cc_test {
     name: "AmrwbEncoderTest",
+    test_suites: ["device-tests"],
     gtest: true,
 
     srcs: [
diff --git a/media/libstagefright/codecs/m4v_h263/TEST_MAPPING b/media/libstagefright/codecs/m4v_h263/TEST_MAPPING
index 6b42847..ba3ff1c 100644
--- a/media/libstagefright/codecs/m4v_h263/TEST_MAPPING
+++ b/media/libstagefright/codecs/m4v_h263/TEST_MAPPING
@@ -1,7 +1,9 @@
 // mappings for frameworks/av/media/libstagefright/codecs/m4v_h263
 {
-  "presubmit": [
-    // TODO(b/148094059): unit tests not allowed to download content
+  // tests which require dynamic content
+  // invoke with: atest -- --enable-module-dynamic-download=true
+  // TODO(b/148094059): unit tests not allowed to download content
+  "dynamic-presubmit": [
 
     // the decoder reports something bad about an unexpected newline in the *config file
     // and the config file looks like the AndroidTest.xml file that we put in there.
@@ -9,8 +11,8 @@
     // between decode and encode AndroidTest.xml files -- except that encode does NOT
     // finish with a newline.
     // strange.
-    // { "name": "Mpeg4H263DecoderTest"},
-    // { "name": "Mpeg4H263EncoderTest"}
+    { "name": "Mpeg4H263DecoderTest"},
+    { "name": "Mpeg4H263EncoderTest"}
 
   ]
 }
diff --git a/media/libstagefright/codecs/mp3dec/TEST_MAPPING b/media/libstagefright/codecs/mp3dec/TEST_MAPPING
index b237d65..4ef4317 100644
--- a/media/libstagefright/codecs/mp3dec/TEST_MAPPING
+++ b/media/libstagefright/codecs/mp3dec/TEST_MAPPING
@@ -1,7 +1,9 @@
 // mappings for frameworks/av/media/libstagefright/codecs/mp3dec
 {
-  "presubmit": [
-    // TODO(b/148094059): unit tests not allowed to download content
-    // { "name": "Mp3DecoderTest"}
+  // tests which require dynamic content
+  // invoke with: atest -- --enable-module-dynamic-download=true
+  // TODO(b/148094059): unit tests not allowed to download content
+  "dynamic-presubmit": [
+    { "name": "Mp3DecoderTest"}
   ]
 }
diff --git a/media/libstagefright/foundation/TEST_MAPPING b/media/libstagefright/foundation/TEST_MAPPING
index 0d6a6da..a70c352 100644
--- a/media/libstagefright/foundation/TEST_MAPPING
+++ b/media/libstagefright/foundation/TEST_MAPPING
@@ -1,9 +1,13 @@
 // mappings for frameworks/av/media/libstagefright/foundation
 {
-  "presubmit": [
-    // TODO(b/148094059): unit tests not allowed to download content
-    //{ "name": "OpusHeaderTest" },
+  // tests which require dynamic content
+  // invoke with: atest -- --enable-module-dynamic-download=true
+  // TODO(b/148094059): unit tests not allowed to download content
+  "dynamic-presubmit": [
+    { "name": "OpusHeaderTest" }
+  ],
 
+  "presubmit": [
     { "name": "sf_foundation_test" },
     { "name": "MetaDataBaseUnitTest"}
   ]
diff --git a/media/libstagefright/foundation/tests/OpusHeader/Android.bp b/media/libstagefright/foundation/tests/OpusHeader/Android.bp
index c1251a8..ed3298c 100644
--- a/media/libstagefright/foundation/tests/OpusHeader/Android.bp
+++ b/media/libstagefright/foundation/tests/OpusHeader/Android.bp
@@ -16,6 +16,7 @@
 
 cc_test {
     name: "OpusHeaderTest",
+    test_suites: ["device-tests"],
     gtest: true,
 
     srcs: [
diff --git a/media/libstagefright/id3/TEST_MAPPING b/media/libstagefright/id3/TEST_MAPPING
index e4454c1..d070d25 100644
--- a/media/libstagefright/id3/TEST_MAPPING
+++ b/media/libstagefright/id3/TEST_MAPPING
@@ -1,9 +1,13 @@
 // frameworks/av/media/libstagefright/id3
 {
-  "presubmit": [
-    // TODO(b/148094059): unit tests not allowed to download content
-    //{ "name": "ID3Test" },
+  // tests which require dynamic content
+  // invoke with: atest -- --enable-module-dynamic-download=true
+  // TODO(b/148094059): unit tests not allowed to download content
+  "dynamic-presubmit": [
+    { "name": "ID3Test" }
+  ],
 
+  "presubmit": [
     // this doesn't seem to run any tests.
     // but: cts-tradefed run -m CtsMediaTestCases -t android.media.cts.MediaMetadataRetrieverTest
     // does run he 32 and 64 bit tests, but not the instant tests
diff --git a/media/libstagefright/id3/test/Android.bp b/media/libstagefright/id3/test/Android.bp
index 9d26eec..acf38e2 100644
--- a/media/libstagefright/id3/test/Android.bp
+++ b/media/libstagefright/id3/test/Android.bp
@@ -16,6 +16,7 @@
 
 cc_test {
     name: "ID3Test",
+    test_suites: ["device-tests"],
     gtest: true,
 
     srcs: ["ID3Test.cpp"],
diff --git a/media/libstagefright/mpeg2ts/TEST_MAPPING b/media/libstagefright/mpeg2ts/TEST_MAPPING
index b25d732..9f4bbdf 100644
--- a/media/libstagefright/mpeg2ts/TEST_MAPPING
+++ b/media/libstagefright/mpeg2ts/TEST_MAPPING
@@ -1,7 +1,9 @@
 // frameworks/av/media/libstagefright/mpeg2ts
 {
-  "presubmit": [
-    // TODO(b/148094059): unit tests not allowed to download content
-    //{ "name": "Mpeg2tsUnitTest" }
+  // tests which require dynamic content
+  // invoke with: atest -- --enable-module-dynamic-download=true
+  // TODO(b/148094059): unit tests not allowed to download content
+  "dynamic-presubmit": [
+    { "name": "Mpeg2tsUnitTest" }
   ]
 }
diff --git a/media/libstagefright/tests/HEVC/Android.bp b/media/libstagefright/tests/HEVC/Android.bp
index 7a6b959..3762553 100644
--- a/media/libstagefright/tests/HEVC/Android.bp
+++ b/media/libstagefright/tests/HEVC/Android.bp
@@ -16,6 +16,7 @@
 
 cc_test {
     name: "HEVCUtilsUnitTest",
+    test_suites: ["device-tests"],
     gtest: true,
 
     srcs: [
diff --git a/media/libstagefright/timedtext/TEST_MAPPING b/media/libstagefright/timedtext/TEST_MAPPING
index 185f824..35a5b11 100644
--- a/media/libstagefright/timedtext/TEST_MAPPING
+++ b/media/libstagefright/timedtext/TEST_MAPPING
@@ -1,7 +1,9 @@
 // mappings for frameworks/av/media/libstagefright/timedtext
 {
-  "presubmit": [
-    // TODO(b/148094059): unit tests not allowed to download content
-    //{ "name": "TimedTextUnitTest" }
+  // tests which require dynamic content
+  // invoke with: atest -- --enable-module-dynamic-download=true
+  // TODO(b/148094059): unit tests not allowed to download content
+  "dynamic-presubmit": [
+    { "name": "TimedTextUnitTest" }
   ]
 }
diff --git a/media/libstagefright/timedtext/test/Android.bp b/media/libstagefright/timedtext/test/Android.bp
index 36f8891..11e5077 100644
--- a/media/libstagefright/timedtext/test/Android.bp
+++ b/media/libstagefright/timedtext/test/Android.bp
@@ -16,6 +16,7 @@
 
 cc_test {
     name: "TimedTextUnitTest",
+    test_suites: ["device-tests"],
     gtest: true,
 
     srcs: [