diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fb1c6ff..0203712 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -38,6 +38,7 @@ { try { - mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this); - getLocalizationFromListeners(); - changeBackgroundMode(); + if (PrefUtils.getLocationLevel(getApplicationContext()).equals(SharingLevel.MANUAL.toString())) { + sendCoordinateToBackend(fakeLoc); + } else { + mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this); + getLocalizationFromListeners(); + changeBackgroundMode(); + } } finally { mFusedLocationClient = null; destroyLocationListeners(); @@ -200,7 +210,7 @@ public class BackgroundLocalizationService extends Service { destroyLocationListeners(); } - private void destroyLocationListeners(){ + private void destroyLocationListeners() { } @@ -231,9 +241,8 @@ public class BackgroundLocalizationService extends Service { String locationLevel = PrefUtils.getLocationLevel(getApplicationContext()); String status = (PrefUtils.isStatusEnabled(getApplicationContext())) ? PrefUtils.getUserStatus(getApplicationContext()) : ""; - if (locationLevel.equals(SharingLevel.PRESENCE.toString())) { - if(!MapUtils.checkIfCoordinateIsValid(latitude,longitude)){ + if (!MapUtils.checkIfCoordinateIsValid(latitude, longitude)) { return null; } @@ -277,7 +286,7 @@ public class BackgroundLocalizationService extends Service { @Override public void onError(Throwable e) { - Log.e(TAG,"onErr" + valueOf(e)); + Log.e(TAG, "onErr" + valueOf(e)); } }));