OSDN Git Service

Fix issue #72116995: Add permission guarding Service#startForeground
authorDianne Hackborn <hackbod@google.com>
Sat, 20 Jan 2018 01:44:46 +0000 (17:44 -0800)
committerDianne Hackborn <hackbod@google.com>
Wed, 24 Jan 2018 17:58:24 +0000 (17:58 +0000)
commit994b5ad737831854ac3ba119abba533adca774fc
tree6878e43694bfad9ae0e03f2f479d2a41b17b7301
parent00be19795d68bb5a670b749972b6690e1fa3ce5f
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: If5a79e7ed5ab9e0edc77410315eb4d2df8ac850b
13 files changed:
api/current.txt
core/java/android/app/Service.java
core/java/android/os/Build.java
core/res/AndroidManifest.xml
core/res/res/values/strings.xml
core/tests/coretests/AndroidManifest.xml
packages/MtpDocumentsProvider/AndroidManifest.xml
packages/Shell/AndroidManifest.xml
services/core/java/com/android/server/am/ActiveServices.java
services/core/java/com/android/server/am/ActivityManagerService.java
services/tests/servicestests/AndroidManifest.xml
tests/FrameworkPerf/AndroidManifest.xml
tests/OneMedia/AndroidManifest.xml