From 1b6b76879840955c5177125c94849ec0ff760c8b Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Tue, 24 May 2022 20:26:37 +0530 Subject: privacycentralapp: use main looper for requestLocationUpdates --- .../domain/usecases/FakeLocationStateUseCase.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/FakeLocationStateUseCase.kt b/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/FakeLocationStateUseCase.kt index a475aa2..c026275 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/FakeLocationStateUseCase.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/FakeLocationStateUseCase.kt @@ -23,6 +23,7 @@ import android.location.Location import android.location.LocationListener import android.location.LocationManager import android.os.Bundle +import android.os.Looper import android.util.Log import foundation.e.privacycentralapp.data.repositories.LocalStateRepository import foundation.e.privacycentralapp.domain.entities.LocationMode @@ -172,14 +173,9 @@ class FakeLocationStateUseCase( LocationManager.NETWORK_PROVIDER, // TODO: tight this with fakelocation module. 0L, 0f, - listener - ) - // locationManager.requestLocationUpdates( - // LocationManager.NETWORK_PROVIDER, // TODO: tight this with fakelocation module. - // 0L, - // 0f, - // listener - // ) + listener, + Looper.getMainLooper() + ) val location: Location? = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER) location?.let { listener.onLocationChanged(it) } -- cgit v1.2.1