Fix require to check

This commit is contained in:
Mygod
2022-07-11 13:02:34 -04:00
parent 2e93b4b2c6
commit 2448687aa7

View File

@@ -106,7 +106,7 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService(), CoroutineScope {
// based on: https://android.googlesource.com/platform/packages/services/Car/+/72c71d2/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 state = lastState val state = lastState
unregisterStateReceiver() unregisterStateReceiver()
requireNotNull(state) { "Failed to obtain latest AP state" } checkNotNull(state) { "Failed to obtain latest AP state" }
val iface = state.second val iface = state.second
if (state.first != WifiApManager.WIFI_AP_STATE_ENABLED || iface.isNullOrEmpty()) { if (state.first != WifiApManager.WIFI_AP_STATE_ENABLED || iface.isNullOrEmpty()) {
if (state.first == WifiApManager.WIFI_AP_STATE_FAILED) { if (state.first == WifiApManager.WIFI_AP_STATE_FAILED) {