Skip to content

Commit 2aae6af

Browse files
committed
Location: Don't trigger moving wifi shortcut if connection info is broken
1 parent 52deaee commit 2aae6af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

play-services-location/core/provider/src/main/kotlin/org/microg/gms/location/network/NetworkLocationService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class NetworkLocationService : LifecycleService(), WifiDetailsCallback, CellDeta
148148
} else if (settings.wifiMoving) {
149149
// No need to scan if only moving wifi enabled, instead simulate scan based on current connection info
150150
val connectionInfo = getSystemService<WifiManager>()?.connectionInfo
151-
if (SDK_INT >= 31 && connectionInfo != null) {
151+
if (SDK_INT >= 31 && connectionInfo != null && connectionInfo.toWifiDetails() != null) {
152152
onWifiDetailsAvailable(listOfNotNull(connectionInfo.toWifiDetails()))
153153
} else if (currentLocalMovingWifi != null && connectionInfo?.bssid == currentLocalMovingWifi.macAddress) {
154154
onWifiDetailsAvailable(listOf(currentLocalMovingWifi.copy(timestamp = System.currentTimeMillis())))

0 commit comments

Comments
 (0)