Remove location priority settings

This commit is contained in:
estevez-dev 2020-07-08 18:56:07 +03:00
parent 595406bb7e
commit bc72956365
2 changed files with 4 additions and 4 deletions

View File

@ -107,9 +107,9 @@ public class LocationUpdatesService extends Service {
Log.i(TAG, "Requesting location updates. Every " + requestInterval + "ms with priority of " + priority);
mLocationRequest.setPriority(priority);
mLocationRequest.setInterval(requestInterval);
if (priority == 102 && requestInterval > 60000) {
/*if (priority == 102 && requestInterval > 60000) {
mLocationRequest.setFastestInterval(30000);
}
}*/
startForeground(LocationUtils.SERVICE_NOTIFICATION_ID, LocationUtils.getNotification(this, null, LocationUtils.SERVICE_NOTIFICATION_CHANNEL_ID));
try {
mFusedLocationClient.requestLocationUpdates(mLocationRequest,

View File

@ -102,9 +102,9 @@ public class LocationUpdatesWorker extends ListenableWorker {
int accuracy = LocationUtils.getLocationUpdatesPriority(getApplicationContext());
locationRequest.setPriority(accuracy);
locationRequest.setInterval(5000);
if (accuracy == 102) {
/*if (accuracy == 102) {
locationRequest.setFastestInterval(1000);
}
}*/
try {
fusedLocationClient.requestLocationUpdates(locationRequest,
callback, Looper.myLooper());