diff options
| author | Hui Yu <huiyu@google.com> | 2021-02-19 11:38:10 -0800 |
|---|---|---|
| committer | Hui Yu <huiyu@google.com> | 2021-02-24 22:02:09 +0000 |
| commit | bd7619635d0d04340cc60548e5650cc77270a371 (patch) | |
| tree | 30c7b03134df7ffa2a447ff68105d585c24b5c89 /docs/html/sdk/api_diff/10/changes | |
| parent | d549483e311e3d9765efc21be1524c1ebe96d9a2 (diff) | |
Log the temp allowlist reason/duration at FGS start.
There are four ways a package can be temp allowlisted:
1. Calling BroadcastOptions#setTemporaryAppWhitelistDuration() to
allowlist a BroadcastReceiver, this is a SystemApi.
2. Calling ActivityManagerService#setPendingIntentWhitelistDuration()
to allowlist a PendingIntent, this is not an API, it is an internal method.
3. Calling PowerWhitelistManager#whitelistAppTemporarily() to allowlist
a package, this is a SystemApi.
4. DeviceIdleController.addPowerSaveTempWhitelistApp(), this is an
internal method.
Also the package can be permanently allowlsited in
ActivityManagerService#mDeviceIdleExceptIdleAllowlist.
Move the BG-FGS-launch reasonCode from ActiveService.java to
PowerWhitelistManager.java. Define a list of temp allowlist reasonCode
in addition to the BG-FGS-launch reasonCode. The reasonCode is passed
around in DeviceIdleController and ActivityManagerService, it will be
used in statsd FGS metric.
At FGS start, check all above allowlists and record the reasonCode/reason/duration in
ServiceRecord#mInfoTempAllowListReason field.
If mInfoTempAllowListReason is not null, log the reasonCode/reason/duration in "Background started FGS" log
message, with key "tempAllowListReason".
Bug: 171305836
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java
Reboot device, observe all "tempAllowListReason" listed above in logcat.
BYPASS_INCLUSIVE_LANGUAGE_REASON=existing APIs
Change-Id: Ieb52d95aae3258817a67734c093cb12fc78a81fd
CTS-Coverage-Bug: 181160445
Diffstat (limited to 'docs/html/sdk/api_diff/10/changes')
0 files changed, 0 insertions, 0 deletions
