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);
|
Log.i(TAG, "Requesting location updates. Every " + requestInterval + "ms with priority of " + priority);
|
||||||
mLocationRequest.setPriority(priority);
|
mLocationRequest.setPriority(priority);
|
||||||
mLocationRequest.setInterval(requestInterval);
|
mLocationRequest.setInterval(requestInterval);
|
||||||
if (priority == 102 && requestInterval > 60000) {
|
/*if (priority == 102 && requestInterval > 60000) {
|
||||||
mLocationRequest.setFastestInterval(30000);
|
mLocationRequest.setFastestInterval(30000);
|
||||||
}
|
}*/
|
||||||
startForeground(LocationUtils.SERVICE_NOTIFICATION_ID, LocationUtils.getNotification(this, null, LocationUtils.SERVICE_NOTIFICATION_CHANNEL_ID));
|
startForeground(LocationUtils.SERVICE_NOTIFICATION_ID, LocationUtils.getNotification(this, null, LocationUtils.SERVICE_NOTIFICATION_CHANNEL_ID));
|
||||||
try {
|
try {
|
||||||
mFusedLocationClient.requestLocationUpdates(mLocationRequest,
|
mFusedLocationClient.requestLocationUpdates(mLocationRequest,
|
||||||
|
@ -102,9 +102,9 @@ public class LocationUpdatesWorker extends ListenableWorker {
|
|||||||
int accuracy = LocationUtils.getLocationUpdatesPriority(getApplicationContext());
|
int accuracy = LocationUtils.getLocationUpdatesPriority(getApplicationContext());
|
||||||
locationRequest.setPriority(accuracy);
|
locationRequest.setPriority(accuracy);
|
||||||
locationRequest.setInterval(5000);
|
locationRequest.setInterval(5000);
|
||||||
if (accuracy == 102) {
|
/*if (accuracy == 102) {
|
||||||
locationRequest.setFastestInterval(1000);
|
locationRequest.setFastestInterval(1000);
|
||||||
}
|
}*/
|
||||||
try {
|
try {
|
||||||
fusedLocationClient.requestLocationUpdates(locationRequest,
|
fusedLocationClient.requestLocationUpdates(locationRequest,
|
||||||
callback, Looper.myLooper());
|
callback, Looper.myLooper());
|
||||||
|
Reference in New Issue
Block a user