Give up trying to diagnose double routing

This commit is contained in:
Mygod
2022-05-16 11:34:47 -04:00
parent 8b49830b2e
commit 819a584c4b
2 changed files with 7 additions and 2 deletions

View File

@@ -83,7 +83,7 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService(), CoroutineScope {
reservation.close()
}
}
// based on: https://android.googlesource.com/platform/packages/services/Car/+/df5cd06/service/src/com/android/car/CarProjectionService.java#160
// based on: https://android.googlesource.com/platform/packages/services/Car/+/72c71d2/service/src/com/android/car/CarProjectionService.java#160
val sticky = registerReceiver(null, IntentFilter(WifiApManager.WIFI_AP_STATE_CHANGED_ACTION))!!
val apState = sticky.wifiApState
val iface = sticky.getStringExtra(WifiApManager.EXTRA_WIFI_AP_INTERFACE_NAME)

View File

@@ -81,7 +81,12 @@ abstract class RoutingManager(private val caller: Any, val downstream: String, p
initRoutingLocked(fromMonitor)
}
this -> true // already started
else -> error("Double routing detected for $downstream from $caller != ${other.caller}")
else -> {
val msg = "Double routing detected for $downstream from $caller != ${other.caller}"
Timber.w(RuntimeException(msg))
SmartSnackbar.make(msg).show()
false
}
}
}