blob: a542d34ab726e31fc7e03678aa6e5ab283495ace [file] [log] [blame]
Bob Badour45b6e7d2021-02-12 18:09:33 -08001package {
Bob Badour19bda642022-01-27 18:29:56 -08002 // See: http://go/android-license-faq
3 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badour45b6e7d2021-02-12 18:09:33 -08004}
5
Jeff Sharkeyc55994b2019-12-20 19:43:59 -07006android_app {
7 name: "MediaProvider",
felkachang775842b2018-10-16 17:05:44 +08008 manifest: "AndroidManifest.xml",
9
Jeff Sharkeyb6781bc2019-07-18 18:45:52 -060010 static_libs: [
William Escande5ca7e762021-09-01 14:20:09 +020011 "modules-utils-backgroundthread",
Jeff Sharkeyb6781bc2019-07-18 18:45:52 -060012 "androidx.appcompat_appcompat",
Jeff Sharkey7ea24f22019-08-22 10:14:18 -060013 "androidx.core_core",
Ivan Chiangfe204ba2021-04-27 13:57:25 +080014 "androidx.legacy_legacy-support-core-ui",
Sahana Rao1e8923d2021-04-26 00:03:55 +010015 "androidx.lifecycle_lifecycle-extensions",
Ivan Chiangfe204ba2021-04-27 13:57:25 +080016 "androidx.recyclerview_recyclerview",
17 "com.google.android.material_material",
Jeff Sharkeycc5c31d2019-10-08 16:10:53 -060018 "guava",
Ivan Chiang7fce4a52021-01-25 16:53:54 +080019 "modules-utils-build",
Corinaf0319fb2022-02-03 11:10:37 +000020 "modules-utils-uieventlogger-interface",
Sahana Raoc70976a2021-06-20 13:24:20 +010021 "glide-prebuilt",
Biswarup Pald06af0b2021-08-25 20:05:41 +000022 "glide-gifdecoder-prebuilt",
23 "glide-disklrucache-prebuilt",
24 "glide-annotation-and-compiler-prebuilt",
Ivan Chiang0e3e5572021-09-02 16:12:15 +080025 "androidx.fragment_fragment",
26 "androidx.vectordrawable_vectordrawable-animated",
27 "androidx.exifinterface_exifinterface",
Santiago Seifert679c81c2022-03-28 17:36:17 +000028 "exoplayer-mediaprovider-ui",
Jeff Sharkeyb6781bc2019-07-18 18:45:52 -060029 ],
30
Artur Satayev2bb438d2020-01-23 15:26:14 +000031 libs: [
32 "unsupportedappusage",
atrostcee01812020-01-29 13:37:19 +000033 "app-compat-annotations",
Anton Hansson9258dba2021-03-30 13:38:15 +010034 "framework-annotations-lib",
Paul Duffina3b37862020-05-14 00:40:43 +010035 "framework-mediaprovider.impl",
Chong Zhangd3358642020-12-08 15:37:50 -080036 "framework-media.stubs.module_lib",
Paul Duffindc5abff2020-05-31 11:54:42 +010037 "framework-statsd",
Artur Satayev2bb438d2020-01-23 15:26:14 +000038 ],
39
Narayan Kamath88203dc2019-08-30 17:19:38 +010040 jni_libs: [
41 "libfuse_jni",
Santiago Seifert679c81c2022-03-28 17:36:17 +000042 "libfuse",
Narayan Kamath88203dc2019-08-30 17:19:38 +010043 ],
Zim3e45d9b2019-08-19 21:14:14 +010044
felkachang775842b2018-10-16 17:05:44 +080045 resource_dirs: [
46 "res",
47 ],
felkachang775842b2018-10-16 17:05:44 +080048 srcs: [
Jeff Sharkeyc55994b2019-12-20 19:43:59 -070049 ":mediaprovider-sources",
felkachang775842b2018-10-16 17:05:44 +080050 ],
51
Jeff Sharkey10b4d8d2019-02-04 21:53:22 -070052 optimize: {
Sahana Raod8455602022-01-13 08:31:09 +000053 shrink: true,
54 optimize: false,
55 obfuscate: false,
Jeff Sharkey10b4d8d2019-02-04 21:53:22 -070056 proguard_flags_files: ["proguard.flags"],
57 },
58
atrost2cf251d2019-10-10 19:32:30 +010059 plugins: [
Jeff Sharkey75b789d2019-10-30 10:24:44 -060060 "java_api_finder",
Jeff Sharkeyc4a5f812020-05-03 21:07:14 -060061 "error_prone_mediaprovider",
Biswarup Pald06af0b2021-08-25 20:05:41 +000062 "glide-annotation-processor",
atrost2cf251d2019-10-10 19:32:30 +010063 ],
Andrei Oneace30a2c2022-01-14 23:33:46 +000064 jarjar_rules: "jarjar-rules.txt",
Anton Hansson65958d02020-03-31 21:05:53 +010065 sdk_version: "module_current",
Nikita Ioffe0bf6f892020-11-03 22:58:11 +000066 min_sdk_version: "30",
felkachang775842b2018-10-16 17:05:44 +080067
68 certificate: "media",
felkachang775842b2018-10-16 17:05:44 +080069 privileged: true,
atrost2cf251d2019-10-10 19:32:30 +010070
Jeff Sharkey56c34e82019-11-21 15:56:37 -070071 aaptflags: ["--custom-package com.android.providers.media"],
Jeff Sharkeyb3e66032020-05-03 11:34:41 -060072
73 errorprone: {
74 javacflags: [
75 "-Xep:FallThrough:ERROR",
76 "-Xep:GuardedBy:ERROR",
77 "-Xep:StreamResourceLeak:ERROR",
Jeff Sharkeyc4a5f812020-05-03 21:07:14 -060078
79 // Local checkers specific to this module
80 "-Xep:MediaProviderLocaleRoot:ERROR",
81 "-Xep:MediaProviderMimeType:ERROR",
Jeff Sharkeyb3e66032020-05-03 11:34:41 -060082 ],
83 },
Saumya Pathak3054ea52021-03-09 22:14:22 +000084
Andrei Onea03d4d762022-02-24 13:46:36 +000085 required: [
86 "preinstalled-packages-com.android.providers.media.module.xml",
87 "privapp_allowlist_com.android.providers.media.module.xml",
88 ],
Corina Grigorasca99ec42021-07-20 10:22:44 +000089
90 lint: {
91 strict_updatability_linting: true,
92 },
Jeff Sharkey56c34e82019-11-21 15:56:37 -070093}
94
Anton Hansson65958d02020-03-31 21:05:53 +010095// Used by MediaProvider and MediaProviderTests
Jeff Sharkeyc55994b2019-12-20 19:43:59 -070096filegroup {
97 name: "mediaprovider-sources",
98 srcs: [
99 "src/**/*.aidl",
100 "src/**/*.java",
Jeff Sharkeyc55994b2019-12-20 19:43:59 -0700101 ":statslog-mediaprovider-java-gen",
102 ],
103}
104
105// This is defined to give LegacyMediaProvider the bare minimum it needs
106// to keep the legacy database schema working while also building
107// against "system_current"
William Escande5ca7e762021-09-01 14:20:09 +0200108java_library {
109 name: "mediaprovider-database",
Jeff Sharkeyc55994b2019-12-20 19:43:59 -0700110 srcs: [
111 "src/com/android/providers/media/DatabaseHelper.java",
Jeff Sharkeyc55994b2019-12-20 19:43:59 -0700112 "src/com/android/providers/media/util/DatabaseUtils.java",
113 "src/com/android/providers/media/util/FileUtils.java",
Jeff Sharkeye04e2c62020-03-05 10:53:33 -0700114 "src/com/android/providers/media/util/ForegroundThread.java",
Jeff Sharkeyc55994b2019-12-20 19:43:59 -0700115 "src/com/android/providers/media/util/Logging.java",
Ivan Chiangbe571c92019-12-03 18:09:00 +0800116 "src/com/android/providers/media/util/MimeUtils.java",
Martijn Coenendb782022021-12-09 11:25:45 +0100117 "src/com/android/providers/media/util/StringUtils.java",
Sahana Rao9f4c1fa2020-09-09 15:06:04 +0100118 "src/com/android/providers/media/playlist/*.java",
Dipankar Bhardwaj49320102022-04-12 16:57:38 +0000119 "src/com/android/providers/media/dao/*.java",
Jeff Sharkeyc55994b2019-12-20 19:43:59 -0700120 ],
William Escande5ca7e762021-09-01 14:20:09 +0200121 sdk_version: "module_current",
122 min_sdk_version: "30",
123 static_libs: [
124 "modules-utils-backgroundthread",
125 "modules-utils-build",
126 "guava",
127 ],
128 libs: [
129 "androidx.annotation_annotation",
130 "framework-annotations-lib",
131 "framework-mediaprovider",
132 ],
Jeff Sharkeyc55994b2019-12-20 19:43:59 -0700133}
134
atrost2cf251d2019-10-10 19:32:30 +0100135platform_compat_config {
136 name: "media-provider-platform-compat-config",
137 src: ":MediaProvider",
138}
Jeff Sharkey3c0a6c62019-11-15 20:45:41 -0700139
140genrule {
141 name: "statslog-mediaprovider-java-gen",
142 tools: ["stats-log-api-gen"],
Muhammad Qureshi71b395e2020-12-11 14:59:11 -0800143 cmd: "$(location stats-log-api-gen) --java $(out) --module mediaprovider" +
Santiago Seifert679c81c2022-03-28 17:36:17 +0000144 " --javaPackage com.android.providers.media --javaClass MediaProviderStatsLog" +
145 " --minApiLevel 30",
Jeff Sharkey3c0a6c62019-11-15 20:45:41 -0700146 out: ["com/android/providers/media/MediaProviderStatsLog.java"],
147}
Saumya Pathak3054ea52021-03-09 22:14:22 +0000148
149prebuilt_etc {
Santiago Seifert679c81c2022-03-28 17:36:17 +0000150 name: "preinstalled-packages-com.android.providers.media.module.xml",
151 src: "preinstalled-packages-com.android.providers.media.module.xml",
152 sub_dir: "sysconfig",
Saumya Pathak3054ea52021-03-09 22:14:22 +0000153}