| package { |
| // See: http://go/android-license-faq |
| default_applicable_licenses: ["Android-Apache-2.0"], |
| } |
| |
| android_test_helper_app { |
| name: "MediaProviderTestAppForPermissionActivity", |
| manifest: "test_app/TestAppForPermissionActivity.xml", |
| srcs: [ |
| "test_app/src/**/*.java", |
| "src/com/android/providers/media/util/TestUtils.java", |
| ], |
| static_libs: [ |
| "cts-install-lib", |
| ], |
| sdk_version: "test_current", |
| target_sdk_version: "30", |
| min_sdk_version: "30", |
| test_suites: [ |
| "general-tests", |
| "mts-mediaprovider", |
| ], |
| } |
| |
| android_test_helper_app { |
| name: "MediaProviderTestAppForPermissionActivity33", |
| manifest: "test_app/TestAppForPermissionActivity33.xml", |
| srcs: [ |
| "test_app/src/**/*.java", |
| "src/com/android/providers/media/util/TestUtils.java", |
| ], |
| static_libs: [ |
| "cts-install-lib", |
| ], |
| sdk_version: "test_current", |
| target_sdk_version: "33", |
| min_sdk_version: "30", |
| test_suites: [ |
| "general-tests", |
| "mts-mediaprovider", |
| ], |
| } |
| |
| android_test_helper_app { |
| name: "MediaProviderTestAppWithStoragePerms", |
| manifest: "test_app/TestAppWithStoragePerms.xml", |
| srcs: [ |
| "test_app/src/**/*.java", |
| "src/com/android/providers/media/util/TestUtils.java", |
| ], |
| static_libs: [ |
| "cts-install-lib", |
| ], |
| sdk_version: "test_current", |
| target_sdk_version: "30", |
| min_sdk_version: "30", |
| test_suites: [ |
| "general-tests", |
| "mts-mediaprovider", |
| ], |
| } |
| |
| android_test_helper_app { |
| name: "MediaProviderTestAppWithMediaPerms", |
| manifest: "test_app/TestAppWithMediaPerms.xml", |
| srcs: [ |
| "test_app/src/**/*.java", |
| "src/com/android/providers/media/util/TestUtils.java", |
| ], |
| static_libs: [ |
| "cts-install-lib", |
| ], |
| sdk_version: "test_current", |
| target_sdk_version: "30", |
| min_sdk_version: "30", |
| test_suites: [ |
| "general-tests", |
| "mts-mediaprovider", |
| ], |
| } |
| |
| android_test_helper_app { |
| name: "MediaProviderTestAppWithoutPerms", |
| manifest: "test_app/TestAppWithoutPerms.xml", |
| srcs: [ |
| "test_app/src/**/*.java", |
| "src/com/android/providers/media/util/TestUtils.java", |
| ], |
| static_libs: [ |
| "cts-install-lib", |
| ], |
| sdk_version: "test_current", |
| target_sdk_version: "30", |
| min_sdk_version: "30", |
| test_suites: [ |
| "general-tests", |
| "mts-mediaprovider", |
| ], |
| } |
| |
| android_test_helper_app { |
| name: "LegacyMediaProviderTestApp", |
| manifest: "test_app/LegacyTestApp.xml", |
| srcs: [ |
| "test_app/src/**/*.java", |
| "src/com/android/providers/media/util/TestUtils.java", |
| ], |
| static_libs: [ |
| "cts-install-lib", |
| ], |
| sdk_version: "test_current", |
| target_sdk_version: "28", |
| min_sdk_version: "30", |
| test_suites: [ |
| "general-tests", |
| "mts-mediaprovider", |
| ], |
| } |
| |
| // This looks a bit awkward, but we need our tests to run against either |
| // MediaProvider or MediaProviderGoogle, and we don't know which one is |
| // on the device being tested, so we can't sign our tests with a key that |
| // will allow instrumentation. Thus we pull all the sources we need to |
| // run tests against into the test itself. |
| android_test { |
| name: "MediaProviderTests", |
| test_suites: [ |
| "general-tests", |
| "mts-mediaprovider", |
| ], |
| compile_multilib: "both", |
| |
| manifest: "AndroidManifest.xml", |
| |
| resource_dirs: [ |
| "main_res", |
| "res", |
| ], |
| |
| srcs: [ |
| ":framework-mediaprovider-sources", |
| ":mediaprovider-sources", |
| ":mediaprovider-testutils", |
| "src/**/*.java", |
| ], |
| |
| libs: [ |
| "android.test.base", |
| "android.test.mock", |
| "android.test.runner", |
| "unsupportedappusage", |
| "framework-mediaprovider.impl", |
| ], |
| |
| static_libs: [ |
| "androidx.appcompat_appcompat", |
| "modules-utils-backgroundthread", |
| "androidx.core_core", |
| "androidx.test.rules", |
| "guava", |
| "mockito-target-extended-minus-junit4", |
| "modules-utils-build", |
| "truth-prebuilt", |
| "com.google.android.material_material", |
| "cts-install-lib", |
| "androidx.test.espresso.core", |
| "androidx.test.espresso.contrib", |
| "androidx.test.core", |
| "androidx.arch.core_core-runtime", |
| "glide-prebuilt", |
| "glide-gifdecoder-prebuilt", |
| "glide-disklrucache-prebuilt", |
| "glide-annotation-and-compiler-prebuilt", |
| "androidx.fragment_fragment", |
| "androidx.vectordrawable_vectordrawable-animated", |
| "androidx.exifinterface_exifinterface", |
| "exoplayer-mediaprovider-ui", |
| ], |
| |
| // these are needed for Extended Mockito |
| jni_libs: [ |
| "libdexmakerjvmtiagent", |
| "libstaticjvmtiagent", |
| ], |
| |
| certificate: "media", |
| |
| aaptflags: ["--custom-package com.android.providers.media"], |
| |
| errorprone: { |
| javacflags: [ |
| "-Xep:CatchFail:ERROR", |
| "-Xep:MissingFail:ERROR", |
| ], |
| }, |
| |
| java_resources: [ |
| ":MediaProviderTestAppWithStoragePerms", |
| ":MediaProviderTestAppWithMediaPerms", |
| ":MediaProviderTestAppWithoutPerms", |
| ":MediaProviderTestAppForPermissionActivity", |
| ":MediaProviderTestAppForPermissionActivity33", |
| ":LegacyMediaProviderTestApp", |
| ], |
| |
| min_sdk_version: "30", |
| } |
| |
| filegroup { |
| name: "mediaprovider-testutils", |
| srcs: ["utils/**/*.java"], |
| } |