OSDN Git Service

Hide redundant foreground service notifications.
authorDan Sandler <dsandler@android.com>
Sun, 28 May 2017 16:18:53 +0000 (12:18 -0400)
committerDan Sandler <dsandler@android.com>
Mon, 5 Jun 2017 15:18:59 +0000 (11:18 -0400)
commit008cea772ac4d6122e81c19ff6128e33b7415917
tree9d445e142348c3d9e4b997b5abcf0009596a8e8f
parent2f36ab88d706965dae8c1eaafcd02abb3f0097c8
Hide redundant foreground service notifications.

If an app with a foreground service has (at least one)
FLAG_FOREGROUND notification shown to the user, we allow
that to satisfy the requirement that the user be informed
about such things. But if the fg notification or its channel
is blocked by the user, we show the NOTE_FOREGROUND_SERVICES
notification (a/k/a Dianne's Dungeon) provided to us by the
activity manager.

Note that if even one of the foreground processes for the
current user is missing its disclosure notification, the
user will see the whole dungeon.

Bug: 36891897
Test: runtest -x frameworks/base/packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceControllerTest.java
Change-Id: I4f5d96f80b7c1901faadb56661a42d26f746aa88
packages/SystemUI/src/com/android/systemui/Dependency.java
packages/SystemUI/src/com/android/systemui/ForegroundServiceController.java [new file with mode: 0644]
packages/SystemUI/src/com/android/systemui/ForegroundServiceControllerImpl.java [new file with mode: 0644]
packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceControllerTest.java [new file with mode: 0644]