Skip to content

Commit af608b3

Browse files
rlees85Domi04151309
authored andcommitted
Close AOD when no notifications are there
1 parent 624a9b4 commit af608b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/src/main/java/io/github/domi04151309/alwayson/services/NotificationService.kt

+8
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ class NotificationService : NotificationListenerService() {
5353

5454
override fun onNotificationRemoved(notification: StatusBarNotification) {
5555
updateValues()
56+
57+
if (
58+
CombinedServiceReceiver.isAlwaysOnRunning &&
59+
Rules.isAmbientMode(this) &&
60+
count < 1
61+
) {
62+
AlwaysOn.finish()
63+
}
5664
}
5765

5866
private fun updateValues() {

0 commit comments

Comments
 (0)