forked from upstream-mirrors/OpenTracks
Code cleanup for MyTracksLocationManager
This commit is contained in:
+17
-17
@@ -44,6 +44,23 @@ import android.util.Log;
|
|||||||
*/
|
*/
|
||||||
public class MyTracksLocationManager {
|
public class MyTracksLocationManager {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Observer for Google location settings.
|
||||||
|
*
|
||||||
|
* @author Jimmy Shih
|
||||||
|
*/
|
||||||
|
private class GoogleSettingsObserver extends ContentObserver {
|
||||||
|
|
||||||
|
public GoogleSettingsObserver() {
|
||||||
|
super(new Handler());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onChange(boolean selfChange) {
|
||||||
|
isAllowed = isUseLocationForServicesOn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static final String TAG = MyTracksLocationManager.class.getSimpleName();
|
private static final String TAG = MyTracksLocationManager.class.getSimpleName();
|
||||||
|
|
||||||
private static final String GOOGLE_SETTINGS_CONTENT_URI = "content://com.google.settings/partner";
|
private static final String GOOGLE_SETTINGS_CONTENT_URI = "content://com.google.settings/partner";
|
||||||
@@ -125,23 +142,6 @@ public class MyTracksLocationManager {
|
|||||||
contentResolver.unregisterContentObserver(observer);
|
contentResolver.unregisterContentObserver(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Observer for Google location settings.
|
|
||||||
*
|
|
||||||
* @author Jimmy Shih
|
|
||||||
*/
|
|
||||||
private class GoogleSettingsObserver extends ContentObserver {
|
|
||||||
|
|
||||||
public GoogleSettingsObserver() {
|
|
||||||
super(new Handler());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onChange(boolean selfChange) {
|
|
||||||
isAllowed = isUseLocationForServicesOn();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if allowed to access the location manager. Returns true if
|
* Returns true if allowed to access the location manager. Returns true if
|
||||||
* there is no Google location settings or the Google location settings allows
|
* there is no Google location settings or the Google location settings allows
|
||||||
|
|||||||
Reference in New Issue
Block a user