1<?xml version="1.0" encoding="utf-8"?>
2
3<manifest xmlns:android="http://schemas.android.com/apk/res/android"
4     package="com.android.mtp"
5     android:sharedUserId="android.media">
6    <uses-feature android:name="android.hardware.usb.host"/>
7    <uses-permission android:name="android.permission.ACCESS_MTP"/>
8    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
9    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>
10    <uses-permission android:name="android.permission.MANAGE_USB"/>
11    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
12    <uses-permission android:name="android.permission.MANAGE_USERS"/>
13    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/>
14    <uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE"/>
15    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
16    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
17
18    <application android:process="android.process.media"
19         android:label="@string/app_label"
20         android:allowBackup="false"
21         android:usesCleartextTraffic="true">
22        <provider android:name=".MtpDocumentsProvider"
23             android:authorities="com.android.mtp.documents"
24             android:grantUriPermissions="true"
25             android:exported="true"
26             android:permission="android.permission.MANAGE_DOCUMENTS">
27            <intent-filter>
28                <action android:name="android.content.action.DOCUMENTS_PROVIDER"/>
29            </intent-filter>
30        </provider>
31
32        <service android:name=".MtpDocumentsService"
33                 android:foregroundServiceType="dataSync">
34        </service>
35
36        <activity android:name=".ReceiverActivity"
37             android:label="@string/downloads_app_label"
38             android:icon="@mipmap/ic_launcher_download"
39             android:theme="@android:style/Theme.NoDisplay"
40             android:excludeFromRecents="true"
41             android:exported="true">
42            <intent-filter>
43                <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
44            </intent-filter>
45            <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
46                 android:resource="@xml/device_filter"/>
47        </activity>
48
49        <receiver android:name=".UsbIntentReceiver"
50             android:exported="true">
51            <intent-filter>
52                <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
53                <action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED"/>
54            </intent-filter>
55            <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
56                 android:resource="@xml/device_filter"/>
57        </receiver>
58
59        <receiver android:name=".MtpReceiver"
60             android:exported="true">
61            <intent-filter>
62                <action android:name="android.intent.action.BOOT_COMPLETED"/>
63            </intent-filter>
64            <intent-filter>
65                <action android:name="android.hardware.usb.action.USB_STATE"/>
66            </intent-filter>
67        </receiver>
68
69        <service android:name="MtpService"
70                 android:permission="android.permission.MANAGE_USB"
71                 android:exported="true"/>
72    </application>
73</manifest>
74