mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: Clear notifications on device switch (#2281)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
9cde2f1b1a
commit
7e6bf21e2d
2 changed files with 9 additions and 0 deletions
|
|
@ -2040,9 +2040,14 @@ class MeshService : Service(), Logging {
|
|||
putString("device_address", deviceAddr)
|
||||
}
|
||||
clearDatabases()
|
||||
clearNotifications()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun clearNotifications() {
|
||||
serviceNotifications.clearNotifications()
|
||||
}
|
||||
private val binder = object : IMeshService.Stub() {
|
||||
|
||||
override fun setDeviceAddress(deviceAddr: String?) = toRemoteExceptions {
|
||||
|
|
|
|||
|
|
@ -61,6 +61,10 @@ class MeshServiceNotifications(
|
|||
// We have two notification channels: one for general service status and another one for messages
|
||||
val notifyId = 101
|
||||
|
||||
fun clearNotifications() {
|
||||
notificationManager.cancelAll()
|
||||
}
|
||||
|
||||
fun initChannels() {
|
||||
// create notification channels on service creation
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue