From c7956f0d9100fa7def28cc7a279bc84813077a89 Mon Sep 17 00:00:00 2001 From: Hui Yu Date: Thu, 13 Feb 2020 17:29:57 -0800 Subject: [PATCH] Change isProcStateBackground() cutoff to PROCESS_STATE_BOUND_FOREGROUND_SERVICE isProcStateBackground() mostly is used to determinte when to call registered IUidObserver's onUidActive() and onUidIdle() callbacks. CameraServer and AudioServer are the two most notable IUidObserver. Since AppOps uses PROCESS_STATE_BOUND_FOREGROUND_SERVICE as foreground state cutoff. It is better we consolidate other part of code use the same proc state as foreground cutoff. Bug: 149500958 Test: NA. Change-Id: I8206ef4c8cad210547204117c2fe8eb0550d459f --- core/java/android/app/ActivityManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index 7ee44053d4d59..471c6bad71408 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -694,7 +694,7 @@ public class ActivityManager { /** @hide Should this process state be considered a background state? */ public static final boolean isProcStateBackground(int procState) { - return procState >= PROCESS_STATE_TRANSIENT_BACKGROUND; + return procState > PROCESS_STATE_BOUND_FOREGROUND_SERVICE; } /** @hide Is this a foreground service type? */