Skip to content

Commit 70f031e

Browse files
NAVALSn0wfreezeDev
NAVAL
authored andcommitted
fix: networkProviderEnabled check
fixes #131
1 parent 68feff6 commit 70f031e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

app/src/main/java/de/seemoo/at_tracking_detection/detection/LocationProvider.kt

+9-7
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,15 @@ open class LocationProvider @Inject constructor(
211211
handler.looper
212212
)
213213

214-
locationManager.requestLocationUpdates(
215-
LocationManager.NETWORK_PROVIDER,
216-
MIN_UPDATE_TIME_MS,
217-
MIN_DISTANCE_METER,
218-
this,
219-
handler.looper
220-
)
214+
if (networkProviderEnabled){
215+
locationManager.requestLocationUpdates(
216+
LocationManager.NETWORK_PROVIDER,
217+
MIN_UPDATE_TIME_MS,
218+
MIN_DISTANCE_METER,
219+
this,
220+
handler.looper
221+
)
222+
}
221223

222224
} else if (networkProviderEnabled) {
223225
locationManager.requestLocationUpdates(

0 commit comments

Comments
 (0)