-
Notifications
You must be signed in to change notification settings - Fork 70
Conversation
7a85ec3
to
c99fd5d
Compare
@@ -1,6 +1,7 @@ | |||
package com.mapzen.android.lost.api; | |||
|
|||
import android.location.Location; | |||
import android.os.Looper; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:lost:checkstyle[ant:checkstyle] /home/ubuntu/lost/lost/src/main/java/com/mapzen/android/lost/api/LocationListener.java:4:8: Unused import - android.os.Looper.
|
||
private void checkLocationAvailability() { | ||
LocationAvailability availability = | ||
LocationServices.FusedLocationApi.getLocationAvailability(client); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While exercising a call to FusedLocationApi.getLocationAvailability(client)
is good we should also verify that LocationCallback
is properly invoked when location updates have been requested and provider status changes occur.
This is the use case that would more suitably replace LocationListener.onProviderEnabled(String provider)
and LocationListener.onProviderDisabled(String provider)
since the client app is relying on a push style notification rather than actively polling the provider status.
@@ -17,14 +18,28 @@ | |||
void onLocationChanged(Location location); | |||
|
|||
/** | |||
* Called when a location provider is disabled. | |||
* Called when a location provider is disabled. You will only receive updates for the priority |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Overview
This PR changes the underlying mechanism that Lost uses to notify of providers enabled/disabled from a
LocationListener
to aContentObserver
on the system location provider setting.Proposed Changes
FusionEngine
no longer does anything with its provider changedLocationListener
methods and instead usesLocationProviderChangedHandler
to receive notifications of providers enabled & disabled. TheLocationProviderChangedHandler
handles setting up aContentObserver
to listen to changes toSettings.System.LOCATION_PROVIDERS_ALLOWED
.Closes #123