blob: 7fb7a7c262e504749efb2dfe690d403966ae6f53 [file] [log] [blame]
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: "MediaProviderTestAppWithUserSelectedPerms",
manifest: "test_app/TestAppWithUserSelectedPerms.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: "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",
"keepanno-annotations",
],
static_libs: [
"androidx.appcompat_appcompat",
"modules-utils-backgroundthread",
"androidx.core_core",
"androidx.test.rules",
"guava",
"mockito-target",
"modules-utils-build",
"truth",
"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",
"glide-integration-recyclerview-prebuilt",
"androidx.fragment_fragment",
"androidx.vectordrawable_vectordrawable-animated",
"androidx.exifinterface_exifinterface",
"androidx.work_work-runtime",
"androidx.work_work-testing",
"exoplayer-mediaprovider-ui",
"SettingsLibProfileSelector",
"SettingsLibSelectorWithWidgetPreference",
],
certificate: "media",
aaptflags: ["--custom-package com.android.providers.media"],
errorprone: {
javacflags: [
"-Xep:CatchFail:ERROR",
"-Xep:MissingFail:ERROR",
],
},
data: [
":LegacyMediaProviderTestApp",
":MediaProviderTestAppForPermissionActivity",
":MediaProviderTestAppForPermissionActivity33",
":MediaProviderTestAppWithMediaPerms",
":MediaProviderTestAppWithStoragePerms",
":MediaProviderTestAppWithoutPerms",
":MediaProviderTestAppWithUserSelectedPerms",
],
per_testcase_directory: true,
min_sdk_version: "30",
}
filegroup {
name: "mediaprovider-testutils",
srcs: ["utils/**/*.java"],
}
filegroup {
name: "mediaprovider-library",
srcs: [
"src/com/android/providers/media/library/RunOnlyOnPostsubmit.java",
],
}