diff options
| author | Jing Ji <jji@google.com> | 2022-02-07 00:56:27 -0800 |
|---|---|---|
| committer | Jing Ji <jji@google.com> | 2022-02-08 22:46:43 -0800 |
| commit | 8ddcda8bec75dae7edefddab07d3e636d96ca393 (patch) | |
| tree | fd7fc31fd0f667367da096a44ff49f38e9081897 /core/java/android | |
| parent | ed6be44189198deb401600704603a1ec6a37eac3 (diff) | |
Don't prompt on bg abuse if the app has a FGS with notification
Add a new config to control whether or not to prompt the user when
the system detects a background abusive app and it has a foreground
service with notification shown. By default it's OFF, meaning if
the background abusive app has a foreground service and its
notification is still showing, no prompt to the user in this case.
Bug: 200326767
Bug: 203105544
Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest
Change-Id: Ic611090e3152117a2379d902fc32416e11c3e197
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/ActivityManagerInternal.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java index a58ceaa99022..294621ee07f8 100644 --- a/core/java/android/app/ActivityManagerInternal.java +++ b/core/java/android/app/ActivityManagerInternal.java @@ -779,6 +779,16 @@ public abstract class ActivityManagerInternal { * @param started {@code true} if the process transits from non-FGS state to FGS state. */ void onForegroundServiceStateChanged(String packageName, int uid, int pid, boolean started); + + /** + * Call when the notification of the foreground service is updated. + * + * @param packageName The package name of the process. + * @param uid The UID of the process. + * @param foregroundId The current foreground service notification ID, a negative value + * means this notification is being removed. + */ + void onForegroundServiceNotificationUpdated(String packageName, int uid, int foregroundId); } /** |
