diff options
author | Hui Yu <huiyu@google.com> | 2021-04-22 19:13:08 -0700 |
---|---|---|
committer | Hui Yu <huiyu@google.com> | 2021-04-29 16:27:41 -0700 |
commit | a6b92260d391544de5453772f81ae16a465de1d0 (patch) | |
tree | 8327502eb0722115c3401204c2de049cfe7f9b2a /tools/aapt2/java/JavaClassGenerator.cpp | |
parent | 329a11f7c6158c4c5fc0e6ea03491c099febc7b0 (diff) |
Do not allow FGS start when temp allowlist reasonCode is REASON_PUSH_MESSAGING_OVER_QUOTA
If temp allowlist reasonCode is REASON_PUSH_MESSAGING_OVER_QUOTA, check
DeviceConfig key "push_messaging_over_quota_behavior" to decide if
temp allowlist and FGS start are allowed. Three options:
1. -1, temp allowlist not allowed, FGS start not allowed.
2. 0, temp allowlist allowed, FGS start allowed.
3. 1, temp allowlist allowed, FGS start not allowed. This is default.
The device config command to change the behavior:
adb shell device_config set activity_manager push_messaging_over_quota_behavior <-1|0|1>
If temp allowlist reasonCode is REASON_DENIED, do not allow temp allowlist
at all.
Also, in DeviceIdleController.addPowerSaveTempAllowlistAppInternal(),
there used to be a check if the callingUid is on the mPowerSaveWhitelistSystemAppIds list,
this is unnecessary because upstream callers already checked if callingUid has
permission CHANGE_DEVICE_IDLE_TEMP_WHITELIST, and this permission is a privileged permission,
so removing the check of mPowerSaveWhitelistSystemAppIds should be safe.
Bug: 182796372
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testPushMessagingOverQuota
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testTempAllowListReasonCode
Change-Id: Id34b1c26c819dc4fe07838eb2e3a8f0138cbcf8f
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions