Add ReceiverActivity to MtpDocumentsProvider.
To show the application chooser for the UsbManager.ACTION_USB_DEVICE_ATTACHED
intent, the intent should be received by activity. The activity has NoDisplay
theme and immediately terminate after routing intent to MtpDocumentsService.
BUG=20274999
Change-Id: I2080ea433b1657dd68640681664adbf92d1d30e9
diff --git a/packages/MtpDocumentsProvider/AndroidManifest.xml b/packages/MtpDocumentsProvider/AndroidManifest.xml
index c1848c7..0172a4f 100644
--- a/packages/MtpDocumentsProvider/AndroidManifest.xml
+++ b/packages/MtpDocumentsProvider/AndroidManifest.xml
@@ -15,6 +15,17 @@
<action android:name="android.content.action.DOCUMENTS_PROVIDER" />
</intent-filter>
</provider>
+ <activity android:name=".ReceiverActivity"
+ android:theme="@android:style/Theme.NoDisplay"
+ android:screenOrientation="locked"
+ android:excludeFromRecents="true"
+ android:enabled="false">
+ <intent-filter>
+ <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
+ </intent-filter>
+ <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
+ android:resource="@xml/device_filter" />
+ </activity>
<service android:name=".MtpDocumentsService"></service>
</application>
</manifest>