From b61dff48d6ce9ec708ca36ddeb4433984167e510 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Fri, 26 Feb 2021 17:50:33 +0300 Subject: [PATCH] Revert "Added location looper thread" This reverts commit cb556beb2baa6b72e45157bcb69b84f5f8659ec3. --- .../src-gms/net/osmand/plus/LocationServiceHelperImpl.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/OsmAnd/src-gms/net/osmand/plus/LocationServiceHelperImpl.java b/OsmAnd/src-gms/net/osmand/plus/LocationServiceHelperImpl.java index 2abfc7aee5..eaab9e3d06 100644 --- a/OsmAnd/src-gms/net/osmand/plus/LocationServiceHelperImpl.java +++ b/OsmAnd/src-gms/net/osmand/plus/LocationServiceHelperImpl.java @@ -1,7 +1,6 @@ package net.osmand.plus; import android.location.Location; -import android.os.HandlerThread; import android.os.Looper; import androidx.annotation.NonNull; @@ -33,8 +32,6 @@ public class LocationServiceHelperImpl extends LocationServiceHelper { private final OsmandApplication app; - private final HandlerThread mHandlerThread = new HandlerThread("LocationServiceHelperThread"); - // FusedLocationProviderClient - Main class for receiving location updates. private final FusedLocationProviderClient fusedLocationProviderClient; @@ -49,7 +46,6 @@ public class LocationServiceHelperImpl extends LocationServiceHelper { public LocationServiceHelperImpl(@NonNull OsmandApplication app) { this.app = app; - mHandlerThread.start(); fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(app); @@ -104,7 +100,7 @@ public class LocationServiceHelperImpl extends LocationServiceHelper { // request location updates try { fusedLocationProviderClient.requestLocationUpdates( - fusedLocationRequest, fusedLocationCallback, mHandlerThread.getLooper()); + fusedLocationRequest, fusedLocationCallback, Looper.myLooper()); } catch (SecurityException e) { LOG.debug("Location service permission not granted"); throw e;