summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Christopher Tate <ctate@google.com> 2021-03-30 15:51:29 -0700
committer Christopher Tate <ctate@google.com> 2021-03-30 15:51:29 -0700
commitfd4c206f2ceb263b654495f306f694415e76fdcc (patch)
tree4790bb8adde621a8d10e5dcd06bf3714dbc26317
parent2fcbd1290d3b4a4110a058e616dfeb1d2aea360a (diff)
Correct garbled rebase re FGS notification ratelimit
Bug: 183428469 Test: atest CtsAppTestCases:ServiceTest Change-Id: I93a7c33490c2aaee876e2254589bb643508a5809
-rw-r--r--services/core/java/com/android/server/am/ActiveServices.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index 6809ad4ea378..4c6a3f7c3f75 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -1989,17 +1989,16 @@ public final class ActiveServices {
final long now = SystemClock.uptimeMillis();
final boolean isLegacyApp = (r.appInfo.targetSdkVersion < Build.VERSION_CODES.S);
- boolean showNow = withinFgsDeferRateLimit(uid, now);
+ // Is the behavior enabled at all?
+ boolean showNow = !mAm.mConstants.mFlagFgsNotificationDeferralEnabled;
if (!showNow) {
- final boolean showLegacyNow = isLegacyApp
- && mAm.mConstants.mFlagFgsNotificationDeferralApiGated;
- showNow = !mAm.mConstants.mFlagFgsNotificationDeferralEnabled || showLegacyNow;
+ // Did the app have another FGS notification deferred recently?
+ showNow = withinFgsDeferRateLimit(uid, now);
}
if (!showNow) {
// Legacy apps' FGS notifications are not deferred unless the relevant
// DeviceConfig element has been set
- showNow = mAm.mConstants.mFlagFgsNotificationDeferralApiGated
- && isLegacyApp;
+ showNow = isLegacyApp && mAm.mConstants.mFlagFgsNotificationDeferralApiGated;
}
if (!showNow) {
// has the app forced deferral?