mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-11-23 16:18:53 +01:00
merge heads
This commit is contained in:
@@ -166,7 +166,6 @@ public class SearchListActivity extends AbstractSendToGoogleActivity
|
||||
private TrackRecordingServiceConnection trackRecordingServiceConnection;
|
||||
private SearchEngine searchEngine;
|
||||
private SearchRecentSuggestions searchRecentSuggestions;
|
||||
private MyTracksLocationManager myTracksLocationManager;
|
||||
private ArrayAdapter<Map<String, Object>> arrayAdapter;
|
||||
|
||||
private boolean metricUnits = PreferencesUtils.METRIC_UNITS_DEFAULT;
|
||||
@@ -388,7 +387,8 @@ public class SearchListActivity extends AbstractSendToGoogleActivity
|
||||
final String textQuery = intent.getStringExtra(SearchManager.QUERY);
|
||||
setTitle(textQuery);
|
||||
|
||||
myTracksLocationManager = new MyTracksLocationManager(this, Looper.myLooper());
|
||||
final MyTracksLocationManager myTracksLocationManager = new MyTracksLocationManager(
|
||||
this, Looper.myLooper());
|
||||
LocationListener locationListener = new LocationListener() {
|
||||
@Override
|
||||
public void onLocationChanged(final Location location) {
|
||||
|
||||
+17
-17
@@ -44,6 +44,23 @@ import android.util.Log;
|
||||
*/
|
||||
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 GOOGLE_SETTINGS_CONTENT_URI = "content://com.google.settings/partner";
|
||||
@@ -125,23 +142,6 @@ public class MyTracksLocationManager {
|
||||
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
|
||||
* there is no Google location settings or the Google location settings allows
|
||||
|
||||
Reference in New Issue
Block a user