Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b1110b1 authored by Hui Yu's avatar Hui Yu
Browse files

Document process capability in AppOps.md.

Bug: 153581565
Test: NA
Change-Id: I3c42cf5022c0e7e5b008570fdc656260bb13475f
parent e68c8ac0
Loading
Loading
Loading
Loading
+21 −8
Original line number Original line Diff line number Diff line
@@ -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
The current proc state for an app can be read from `dumpsys appops`. The tracking information can
location, camera and microphone (microphone is `RECORD_AUDIO`).
be read from `dumpsys appops`

In `ActivityManagerService`, `PROCESS_STATE_TOP` and `PROCESS_STATE_PERSISTENT` have all
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: