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

Commit fd4c206f authored by Christopher Tate's avatar Christopher Tate
Browse files

Correct garbled rebase re FGS notification ratelimit

Bug: 183428469
Test: atest CtsAppTestCases:ServiceTest
Change-Id: I93a7c33490c2aaee876e2254589bb643508a5809
parent 2fcbd129
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -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?