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

Commit ed144a57 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Stop using temp-allowlist reason to identify push msgs." into tm-dev

parents 5f90df83 8adda5a0
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.PowerExemptionManager;
import android.os.PowerExemptionManager.ReasonCode;
import android.os.PowerExemptionManager.TempAllowListType;
import android.os.Process;
@@ -1934,9 +1933,6 @@ public final class BroadcastQueue {
    }

    private void maybeReportBroadcastDispatchedEventLocked(BroadcastRecord r, int targetUid) {
        // STOPSHIP (217251579): Temporarily use temp-allowlist reason to identify
        // push messages and record response events.
        useTemporaryAllowlistReasonAsSignal(r);
        if (r.options == null || r.options.getIdForResponseEvent() <= 0) {
            return;
        }
@@ -1951,17 +1947,6 @@ public final class BroadcastQueue {
                mService.getUidStateLocked(targetUid));
    }

    private void useTemporaryAllowlistReasonAsSignal(BroadcastRecord r) {
        if (r.options == null || r.options.getIdForResponseEvent() > 0) {
            return;
        }
        final int reasonCode = r.options.getTemporaryAppAllowlistReasonCode();
        if (reasonCode == PowerExemptionManager.REASON_PUSH_MESSAGING
                || reasonCode == PowerExemptionManager.REASON_PUSH_MESSAGING_OVER_QUOTA) {
            r.options.recordResponseEventWhileInBackground(reasonCode);
        }
    }

    @NonNull
    private UsageStatsManagerInternal getUsageStatsManagerInternal() {
        final UsageStatsManagerInternal usageStatsManagerInternal =