Merge "Correct garbled rebase re FGS notification ratelimit" into sc-dev am: 4b0b2283ca

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14036209

Change-Id: Id195b4248268ff484e2053baf0f89338d71f45cf
This commit is contained in:
TreeHugger Robot
2021-03-31 16:24:30 +00:00
committed by Automerger Merge Worker

View File

@@ -1996,17 +1996,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?