Fix crash on intent is null
This commit is contained in:
@@ -85,13 +85,15 @@ class TetheringService : IpNeighbourMonitoringService(), UpstreamMonitor.Callbac
|
|||||||
|
|
||||||
override fun onBind(intent: Intent?) = binder
|
override fun onBind(intent: Intent?) = binder
|
||||||
|
|
||||||
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||||
val iface = intent.getStringExtra(EXTRA_ADD_INTERFACE)
|
if (intent != null) {
|
||||||
synchronized(routings) {
|
val iface = intent.getStringExtra(EXTRA_ADD_INTERFACE)
|
||||||
if (iface != null) routings[iface] = null
|
synchronized(routings) {
|
||||||
routings.remove(intent.getStringExtra(EXTRA_REMOVE_INTERFACE))?.stop()
|
if (iface != null) routings[iface] = null
|
||||||
updateRoutingsLocked()
|
routings.remove(intent.getStringExtra(EXTRA_REMOVE_INTERFACE))?.stop()
|
||||||
}
|
updateRoutingsLocked()
|
||||||
|
}
|
||||||
|
} else if (routings.isEmpty()) stopSelf(startId)
|
||||||
return START_NOT_STICKY
|
return START_NOT_STICKY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user