summaryrefslogtreecommitdiff
path: root/packages/MtpDocumentsProvider
diff options
context:
space:
mode:
author Dianne Hackborn <hackbod@google.com> 2018-01-19 17:44:46 -0800
committer Dianne Hackborn <hackbod@google.com> 2018-02-07 14:02:02 -0800
commita9da85fde4675ed0b03557e448b1cc67f1d391fe (patch)
treec901ec0f1a35514c8eab7d8f089cf813a4ef1d89 /packages/MtpDocumentsProvider
parent0589371900a47b70dd5851c9792ffdbdd781c96c (diff)
Fix issue #72116995: Add permission guarding Service#startForeground
Now requires permission if targeting P. Note that this is a separate permission from the existing one that is required for instant apps to use foreground services. The reason for this is that their semantics are different (the instant apps permission is associated with an app op for control over what the app is allowed, while the regular app permission is just a normal permission that is always granted and only there for auditing of apps), and there are probably going to be cases where a developer will want to use a foreground service in the full version of their app but not as an instant app. Bug: 72116995 Test: atest CtsAppTestCases Change-Id: I95afb7185742b82c525e775ca20bb36015510b43
Diffstat (limited to 'packages/MtpDocumentsProvider')
-rw-r--r--packages/MtpDocumentsProvider/AndroidManifest.xml1
1 files changed, 1 insertions, 0 deletions
diff --git a/packages/MtpDocumentsProvider/AndroidManifest.xml b/packages/MtpDocumentsProvider/AndroidManifest.xml
index 8d79f62f21d7..c0a59b3badbf 100644
--- a/packages/MtpDocumentsProvider/AndroidManifest.xml
+++ b/packages/MtpDocumentsProvider/AndroidManifest.xml
@@ -3,6 +3,7 @@
package="com.android.mtp"
android:sharedUserId="android.media">
<uses-feature android:name="android.hardware.usb.host" />
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.MANAGE_USB" />
<application android:label="@string/app_label">
<provider