Code cleanup for MyTracksLocationManager

This commit is contained in:
Jimmy Shih
2013-05-22 11:09:07 -07:00
parent b37fe0ff35
commit 2e199d633c
@@ -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