• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.MANAGE_USB"/>
10    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
11    <uses-permission android:name="android.permission.MANAGE_USERS"/>
12    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/>
13    <uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE"/>
14    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
15
16    <application android:process="android.process.media"
17         android:label="@string/app_label"
18         android:allowBackup="false"
19         android:usesCleartextTraffic="true">
20        <provider android:name=".MtpDocumentsProvider"
21             android:authorities="com.android.mtp.documents"
22             android:grantUriPermissions="true"
23             android:exported="true"
24             android:permission="android.permission.MANAGE_DOCUMENTS">
25            <intent-filter>
26                <action android:name="android.content.action.DOCUMENTS_PROVIDER"/>
27            </intent-filter>
28        </provider>
29
30        <service android:name=".MtpDocumentsService"/>
31
32        <activity android:name=".ReceiverActivity"
33             android:label="@string/downloads_app_label"
34             android:icon="@mipmap/ic_launcher_download"
35             android:theme="@android:style/Theme.NoDisplay"
36             android:excludeFromRecents="true"
37             android:exported="true">
38            <intent-filter>
39                <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
40            </intent-filter>
41            <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
42                 android:resource="@xml/device_filter"/>
43        </activity>
44
45        <receiver android:name=".UsbIntentReceiver"
46             android:exported="true">
47            <intent-filter>
48                <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
49                <action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED"/>
50            </intent-filter>
51            <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
52                 android:resource="@xml/device_filter"/>
53        </receiver>
54
55        <receiver android:name=".MtpReceiver"
56             android:exported="true">
57            <intent-filter>
58                <action android:name="android.intent.action.BOOT_COMPLETED"/>
59            </intent-filter>
60            <intent-filter>
61                <action android:name="android.hardware.usb.action.USB_STATE"/>
62            </intent-filter>
63        </receiver>
64
65        <service android:name="MtpService"/>
66    </application>
67</manifest>
68