From 8adda5a070744c1601c2771527ed542faf303c72 Mon Sep 17 00:00:00 2001 From: Sudheer Shanka Date: Wed, 13 Apr 2022 12:05:59 -0700 Subject: [PATCH] Stop using temp-allowlist reason to identify push msgs. We made a temporary change a while back to identify push messages using temp-allowlist reason so that we can get the broadcast response stats data without needing for changes on the client side but this logic is not needed anymore. Bug: 217251579 Test: atest tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java Change-Id: I72a09fc6bc9a7d1cd0aeced3da09a506ea4aef76 --- .../com/android/server/am/BroadcastQueue.java | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/services/core/java/com/android/server/am/BroadcastQueue.java b/services/core/java/com/android/server/am/BroadcastQueue.java index 0518899fd9469..8a7fece5905c3 100644 --- a/services/core/java/com/android/server/am/BroadcastQueue.java +++ b/services/core/java/com/android/server/am/BroadcastQueue.java @@ -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 =