From 189e8abc3c1129bc4232ddeeae16346fd7056f8f Mon Sep 17 00:00:00 2001 From: Pablo Date: Tue, 18 Jun 2024 07:35:30 +0200 Subject: [PATCH] fix: check location is enabled Signed-off-by: Pablo --- .../org/dhis2/commons/locationprovider/LocationProviderImpl.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commons/src/main/java/org/dhis2/commons/locationprovider/LocationProviderImpl.kt b/commons/src/main/java/org/dhis2/commons/locationprovider/LocationProviderImpl.kt index 562237618aa..1583e3b54a1 100644 --- a/commons/src/main/java/org/dhis2/commons/locationprovider/LocationProviderImpl.kt +++ b/commons/src/main/java/org/dhis2/commons/locationprovider/LocationProviderImpl.kt @@ -75,7 +75,8 @@ class LocationProviderImpl(val context: Context) : LocationProvider { } override fun hasLocationEnabled(): Boolean { - return locationManager.isProviderEnabled(locationProvider) + return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) || + locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER) } override fun stopLocationUpdates() {