1<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2          xmlns:tools="http://schemas.android.com/tools"
3        package="com.android.providers.media.module">
4
5    <meta-data
6        android:name="com.android.providers.media.photopicker.data.glide.PickerGlideModule"
7        android:value="GlideModule" />
8
9    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
10    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
11    <uses-permission android:name="android.permission.WAKE_LOCK" />
12    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
13
14    <uses-permission android:name="android.permission.MANAGE_USERS" />
15    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
16    <!-- Permission required  to prompt for the work profile to be turned on -->
17    <uses-permission android:name="android.permission.MODIFY_QUIET_MODE" />
18
19    <uses-permission android:name="android.permission.WATCH_APPOPS" />
20    <uses-permission android:name="android.permission.UPDATE_APP_OPS_STATS" />
21    <uses-permission android:name="android.permission.UPDATE_DEVICE_STATS" />
22
23    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
24    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
25    <uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
26    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
27    <uses-permission android:name="android.permission.USE_RESERVED_DISK" android:maxSdkVersion="34" />
28    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
29    <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" />
30    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
31
32    <!-- Permissions required for reading and logging compat changes -->
33    <uses-permission android:name="android.permission.LOG_COMPAT_CHANGE"/>
34    <uses-permission android:name="android.permission.READ_COMPAT_CHANGE_CONFIG"/>
35
36    <!-- Permissions required for reading device configs -->
37    <uses-permission android:name="android.permission.READ_DEVICE_CONFIG"/>
38
39    <uses-permission android:name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND"/>
40
41    <!-- Permissions required for statsd pull metrics -->
42    <uses-permission android:name="android.permission.REGISTER_STATS_PULL_ATOM"/>
43
44    <!-- Permissions required to check if an app is in the foreground or not during IO -->
45    <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
46
47    <!-- Permission required to access CloudMediaProviders. Declared by us -->
48    <uses-permission android:name="com.android.providers.media.permission.MANAGE_CLOUD_MEDIA_PROVIDERS" />
49
50    <!-- Permission required to bind to MediaCognitionService. Declared by us -->
51    <uses-permission android:name="com.android.providers.media.permission.BIND_MEDIA_COGNITION_SERVICE" />
52
53    <!-- Allows an application to have access to OWNER_PACKAGE_NAME field of accessible media files.
54         Applications are still required to have read access to media files.
55         <p>Protection level: normal -->
56    <permission android:name="com.android.providers.media.permission.ACCESS_MEDIA_OWNER_PACKAGE_NAME"
57                android:label="@string/permlab_accessMediaOwnerPackageName"
58                android:description="@string/permdesc_accessMediaOwnerPackageName"
59                android:protectionLevel="normal" />
60
61    <permission android:name="com.android.providers.media.permission.MANAGE_CLOUD_MEDIA_PROVIDERS"
62                android:protectionLevel="signature" />
63
64    <permission android:name="com.android.providers.media.permission.BIND_MEDIA_COGNITION_SERVICE"
65                android:protectionLevel="signature"/>
66
67    <!-- We use Photo Picker app icon and label for this package. It is necessary for Photo Picker
68         GET_CONTENT take over. Some apps query packages that can handle GET_CONTENT and want to
69         display the icon and label of the package to the user. -->
70    <application
71            android:name="com.android.providers.media.MediaApplication"
72            android:label="@string/picker_app_label"
73            android:icon="@mipmap/picker_app_icon"
74            android:allowBackup="false"
75            android:supportsRtl="true"
76            android:forceQueryable="true"
77            android:usesCleartextTraffic="true"
78            android:crossProfile="true">
79        <provider
80                android:name="com.android.providers.media.MediaProvider"
81                android:authorities="media"
82                android:grantUriPermissions="true"
83                android:forceUriPermissions="true"
84                android:exported="true" />
85
86        <provider
87                android:name="com.android.providers.media.MediaDocumentsProvider"
88                android:label="@string/storage_description"
89                android:authorities="com.android.providers.media.documents"
90                android:grantUriPermissions="true"
91                android:exported="true"
92                android:permission="android.permission.MANAGE_DOCUMENTS">
93            <intent-filter>
94                <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
95            </intent-filter>
96        </provider>
97
98        <provider
99            android:name="com.android.providers.media.photopicker.PhotoPickerProvider"
100            android:authorities="com.android.providers.media.photopicker"
101            android:exported="true"
102            android:permission="com.android.providers.media.permission.MANAGE_CLOUD_MEDIA_PROVIDERS" />
103
104        <provider
105            android:name="com.android.providers.media.photopicker.RemoteVideoPreviewProvider"
106            android:process=":PhotoPicker"
107            android:authorities="com.android.providers.media.remote_video_preview"
108            android:permission="com.android.providers.media.permission.MANAGE_CLOUD_MEDIA_PROVIDERS"
109            android:exported="true" />
110
111        <!-- Don't initialise WorkManager by default at startup -->
112        <provider
113            android:name="androidx.startup.InitializationProvider"
114            android:authorities="${applicationId}.androidx-startup"
115            android:exported="false"
116            tools:node="merge">
117            <meta-data
118                android:name="androidx.work.WorkManagerInitializer"
119                android:value="androidx.startup"
120                tools:node="remove" />
121        </provider>
122
123        <!-- Handles database upgrades after OTAs, then disables itself -->
124        <receiver android:name="com.android.providers.media.MediaUpgradeReceiver"
125            android:exported="true">
126            <!-- This broadcast is sent after the core system has finished
127                 booting, before the home app is launched or BOOT_COMPLETED
128                 is sent. -->
129            <intent-filter>
130                <action android:name="android.intent.action.PRE_BOOT_COMPLETED"/>
131            </intent-filter>
132        </receiver>
133
134        <receiver android:name="com.android.providers.media.MediaReceiver"
135            android:exported="true">
136            <intent-filter>
137                <action android:name="android.intent.action.BOOT_COMPLETED" />
138            </intent-filter>
139            <intent-filter>
140                <action android:name="android.intent.action.LOCALE_CHANGED" />
141            </intent-filter>
142            <intent-filter>
143                <action android:name="android.intent.action.PACKAGE_FULLY_REMOVED" />
144                <action android:name="android.intent.action.PACKAGE_DATA_CLEARED" />
145                <data android:scheme="package" />
146            </intent-filter>
147            <intent-filter>
148                <action android:name="android.intent.action.MEDIA_MOUNTED" />
149                <data android:scheme="file" />
150            </intent-filter>
151            <intent-filter>
152                <action android:name="android.intent.action.MEDIA_SCANNER_SCAN_FILE" />
153                <data android:scheme="file" />
154            </intent-filter>
155        </receiver>
156
157        <service
158            android:name="com.android.providers.media.IdleService"
159            android:exported="true"
160            android:permission="android.permission.BIND_JOB_SERVICE" />
161
162        <service
163            android:name="com.android.providers.media.MediaService"
164            android:exported="true"
165            android:permission="android.permission.BIND_JOB_SERVICE" />
166
167        <service
168            android:name=
169                "com.android.providers.media.stableuris.job.StableUriIdleMaintenanceService"
170            android:exported="true"
171            android:permission="android.permission.BIND_JOB_SERVICE"/>
172
173        <service android:name="com.android.providers.media.fuse.ExternalStorageServiceImpl"
174                 android:exported="true"
175                 android:permission="android.permission.BIND_EXTERNAL_STORAGE_SERVICE">
176            <intent-filter>
177                <action android:name="android.service.storage.ExternalStorageService" />
178            </intent-filter>
179        </service>
180
181        <activity
182                android:name="com.android.providers.media.PermissionActivity"
183                android:configChanges="orientation|keyboardHidden|screenSize"
184                android:theme="@style/PickerDialogTheme"
185                android:exported="false"
186                android:excludeFromRecents="true" />
187
188        <activity
189                android:name="com.android.providers.media.CacheClearingActivity"
190                android:configChanges="orientation|keyboardHidden|screenSize"
191                android:exported="true"
192                android:theme="@style/CacheClearingAlertDialogTheme"
193                android:finishOnCloseSystemDialogs="true"
194                android:launchMode="singleTop"
195                android:excludeFromRecents="true"
196                android:visibleToInstantApps="true" >
197            <intent-filter android:priority="100">
198                <action android:name="android.os.storage.action.CLEAR_APP_CACHE" />
199                <category android:name="android.intent.category.DEFAULT" />
200            </intent-filter>
201        </activity>
202
203        <activity
204                android:name="com.android.providers.media.photopicker.PhotoPickerActivity"
205                android:process=":PhotoPicker"
206                android:label="@string/picker_app_label"
207                android:theme="@style/PickerDefaultTheme"
208                android:exported="true"
209                android:excludeFromRecents="true"
210                android:colorMode="wideColorGamut">
211            <intent-filter android:priority="100" >
212                <action android:name="android.provider.action.PICK_IMAGES" />
213                <category android:name="android.intent.category.DEFAULT" />
214                <data android:mimeType="image/*" />
215                <data android:mimeType="video/*" />
216            </intent-filter>
217            <intent-filter android:priority="100" >
218                <action android:name="android.provider.action.PICK_IMAGES" />
219                <category android:name="android.intent.category.DEFAULT" />
220            </intent-filter>
221        </activity>
222
223        <activity
224            android:name="com.android.providers.media.photopicker.PhotoPickerSettingsActivity"
225            android:theme="@style/PickerSettingsDefaultTheme"
226            android:launchMode="singleInstance"
227            android:process=":PhotoPicker"
228            android:excludeFromRecents="false"
229            android:exported="true"
230            android:enabled="false" >
231
232            <intent-filter android:priority="100" >
233                <action android:name="android.provider.action.PICK_IMAGES_SETTINGS" />
234                <category android:name="android.intent.category.DEFAULT" />
235            </intent-filter>
236
237            <!-- ============== BEGIN SYSTEM SETTINGS MENU ITEM SECTION ============== -->
238            <intent-filter>
239                <action android:name="com.android.settings.action.IA_SETTINGS"/>
240                <category android:name="android.intent.category.DEFAULT"/>
241            </intent-filter>
242
243            <meta-data
244                android:name="com.android.settings.category"
245                android:value="com.android.settings.category.ia.apps"/>
246            <meta-data
247                android:name="com.android.settings.title"
248                android:resource="@string/picker_settings_system_settings_menu_title"/>
249            <meta-data
250                android:name="com.android.settings.summary_uri"
251                android:value="content://media/get_cloud_provider_label"/>
252            <meta-data
253                android:name="com.android.settings.profile"
254                android:value="primary_profile_only"/>
255            <!-- ============== END BEGIN SYSTEM SETTINGS MENU ITEM SECTION ============== -->
256        </activity>
257
258        <activity-alias
259            android:name="com.android.providers.media.photopicker.PhotoPickerUserSelectActivity"
260            android:targetActivity="com.android.providers.media.photopicker.PhotoPickerActivity"
261            android:permission="android.permission.GRANT_RUNTIME_PERMISSIONS"
262            android:exported="true"
263            android:excludeFromRecents="true"
264            android:enabled="true">
265            <intent-filter android:priority="100">
266               <action android:name="android.provider.action.USER_SELECT_IMAGES_FOR_APP" />
267                <category android:name="android.intent.category.DEFAULT" />
268                <data android:mimeType="image/*" />
269                <data android:mimeType="video/*" />
270            </intent-filter>
271            <intent-filter android:priority="100">
272                <action android:name="android.provider.action.USER_SELECT_IMAGES_FOR_APP" />
273                <category android:name="android.intent.category.DEFAULT" />
274            </intent-filter>
275        </activity-alias>
276
277        <activity-alias
278            android:name="com.android.providers.media.photopicker.PhotoPickerGetContentActivity"
279            android:targetActivity="com.android.providers.media.photopicker.PhotoPickerActivity"
280            android:exported="true"
281            android:excludeFromRecents="true"
282            android:enabled="true">
283            <intent-filter android:priority="105" >
284                <action android:name="android.intent.action.GET_CONTENT" />
285                <category android:name="android.intent.category.OPENABLE" />
286                <category android:name="android.intent.category.DEFAULT" />
287                <data android:mimeType="image/*" />
288                <data android:mimeType="video/*" />
289            </intent-filter>
290        </activity-alias>
291
292    </application>
293</manifest>
294