Fix file permissions for Bluetooth share
Used a file provider to serve up URIs to allow
applications to access files in the external
Bluetooth directory.
Bug: 23367919
Change-Id: Iadcdcafb235f3eeb50a0e147f3ef982fc9ee38b3
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 85910aa..3652fd3 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -27,6 +27,7 @@
<uses-permission android:name="android.permission.BLUETOOTH_MAP" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<!-- WRITE_CONTACTS is used for test cases only -->
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
@@ -80,6 +81,14 @@
android:pathPrefix="/btopp"
android:permission="android.permission.ACCESS_BLUETOOTH_SHARE" />
</provider>
+ <provider android:name="android.support.v4.content.FileProvider"
+ android:authorities="com.google.android.bluetooth.fileprovider"
+ android:grantUriPermissions="true"
+ android:exported="false">
+ <meta-data
+ android:name="android.support.FILE_PROVIDER_PATHS"
+ android:resource="@xml/file_paths" />
+ </provider>
<service
android:process="@string/process"
android:name = ".btservice.AdapterService">