Update to Android Q beta 2 APIs

This commit is contained in:
Mygod
2019-04-04 11:31:27 +08:00
parent 400d4e67a3
commit bb41536eb1
6 changed files with 12 additions and 9 deletions

View File

@@ -48,7 +48,7 @@ class TetheringService : IpNeighbourMonitoringService() {
private val receiver = broadcastReceiver { _, intent ->
synchronized(downstreams) {
val toRemove = downstreams.toMutableMap() // make a copy
for (iface in intent.tetheredIfaces) {
for (iface in intent.tetheredIfaces ?: return@synchronized) {
val downstream = toRemove.remove(iface) ?: continue
if (downstream.monitor) downstream.start()
}