mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-01-28 22:01:50 +00:00
fix service killed by Android battery saver
having an always-on/ongoing notification is required in order for Android not to kill it
This commit is contained in:
@@ -151,6 +151,7 @@ class AirPodsService: Service() {
|
||||
.setContentTitle("AirPods are not connected")
|
||||
.setCategory(Notification.CATEGORY_SERVICE)
|
||||
.setPriority(NotificationCompat.PRIORITY_LOW)
|
||||
.setOngoing(true)
|
||||
.build()
|
||||
|
||||
try {
|
||||
@@ -281,6 +282,7 @@ class AirPodsService: Service() {
|
||||
} ?: ""}""")
|
||||
.setCategory(Notification.CATEGORY_SERVICE)
|
||||
.setPriority(NotificationCompat.PRIORITY_LOW)
|
||||
.setOngoing(true)
|
||||
.build()
|
||||
|
||||
} else {
|
||||
@@ -289,6 +291,7 @@ class AirPodsService: Service() {
|
||||
.setContentTitle("AirPods are not connected")
|
||||
.setCategory(Notification.CATEGORY_SERVICE)
|
||||
.setPriority(NotificationCompat.PRIORITY_LOW)
|
||||
.setOngoing(true)
|
||||
.build()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user