Remove location priority settings
This commit is contained in:
parent
595406bb7e
commit
bc72956365
@ -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,
|
||||
|
@ -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());
|
||||
|
Reference in New Issue
Block a user