Merge "Document process capability in AppOps.md." into rvc-dev am: d0139b01dd am: 096aafc8d2 am: 8f815ed535
Change-Id: Ibd0ac43b49d8e6a8a0691ac50351ab28fc9341b1
This commit is contained in:
@@ -116,14 +116,27 @@ for app-ops. It also delays the changes by a _settle time_. This delay is needed
|
|||||||
can fluctuate when switching apps. By delaying the change the appops service is not affected by
|
can fluctuate when switching apps. By delaying the change the appops service is not affected by
|
||||||
those.
|
those.
|
||||||
|
|
||||||
The proc state is used for two use cases: Firstly, Tracking remembers the proc state for each
|
In addition to proc state, the `AppOpsService` also receives process capability update from the
|
||||||
tracked event. Secondly, `noteOp`/`checkOp` calls for app-op that are set to `MODE_FOREGROUND` are
|
`ActivityManagerService`. Proc capability specifies what while-in-use(`MODE_FOREGROUND`) operations
|
||||||
translated using the `AppOpsService.UidState.evalMode` method into `MODE_ALLOWED` when the app is
|
the proc is allowed to perform in its current proc state. There are three proc capabilities
|
||||||
counted as foreground and `MODE_IGNORED` when the app is counted as background. `checkOpRaw`
|
defined so far:
|
||||||
calls are not affected.
|
`PROCESS_CAPABILITY_FOREGROUND_LOCATION`, `PROCESS_CAPABILITY_FOREGROUND_CAMERA` and
|
||||||
|
`PROCESS_CAPABILITY_FOREGROUND_MICROPHONE`, they correspond to the while-in-use operation of
|
||||||
|
location, camera and microphone (microphone is `RECORD_AUDIO`).
|
||||||
|
|
||||||
The current proc state for an app can be read from `dumpsys appops`. The tracking information can
|
In `ActivityManagerService`, `PROCESS_STATE_TOP` and `PROCESS_STATE_PERSISTENT` have all
|
||||||
be read from `dumpsys appops`
|
three capabilities, `PROCESS_STATE_FOREGROUND_SERVICE` has capabilities defined by
|
||||||
|
`foregroundServiceType` that is specified in foreground service's manifest file. A client process
|
||||||
|
can pass its capabilities to service using `BIND_INCLUDE_CAPABILITIES` flag.
|
||||||
|
|
||||||
|
The proc state and capability are used for two use cases: Firstly, Tracking remembers the proc state
|
||||||
|
for each tracked event. Secondly, `noteOp`/`checkOp` calls for app-op that are set to
|
||||||
|
`MODE_FOREGROUND` are translated using the `AppOpsService.UidState.evalMode` method into
|
||||||
|
`MODE_ALLOWED` when the app has the capability and `MODE_IGNORED` when the app does not have the
|
||||||
|
capability. `checkOpRaw` calls are not affected.
|
||||||
|
|
||||||
|
The current proc state and capability for an app can be read from `dumpsys appops`.
|
||||||
|
The tracking information can be read from `dumpsys appops`
|
||||||
|
|
||||||
```
|
```
|
||||||
Uid u0a118:
|
Uid u0a118:
|
||||||
|
|||||||
Reference in New Issue
Block a user