Refine updateNotif in TetheringService

This commit is contained in:
Mygod
2023-03-10 00:24:13 -05:00
parent 3824cac335
commit 0ccdfa5caa

View File

@@ -101,7 +101,7 @@ class TetheringService : IpNeighbourMonitoringService(), TetheringManager.Tether
TetheringManager.registerTetheringEventCallbackCompat(this, this) TetheringManager.registerTetheringEventCallbackCompat(this, this)
IpNeighbourMonitor.registerCallback(this) IpNeighbourMonitor.registerCallback(this)
} }
updateNotification() super.updateNotification()
} }
launch(Dispatchers.Main) { binder.routingsChanged() } launch(Dispatchers.Main) { binder.routingsChanged() }
} }
@@ -111,7 +111,7 @@ class TetheringService : IpNeighbourMonitoringService(), TetheringManager.Tether
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
BootReceiver.startIfEnabled() BootReceiver.startIfEnabled()
// call this first just in case we are shutting down immediately // call this first just in case we are shutting down immediately
updateNotification() super.updateNotification()
launch { launch {
if (intent != null) { if (intent != null) {
for (iface in intent.getStringArrayExtra(EXTRA_ADD_INTERFACES) ?: emptyArray()) { for (iface in intent.getStringArrayExtra(EXTRA_ADD_INTERFACES) ?: emptyArray()) {