GPS is now optional: data source (internal, none) be selected in settings.

Migrated to GPSHandler.

Fixes #1279.
This commit is contained in:
Dennis Guse
2026-02-04 22:37:19 +01:00
parent d75472ef11
commit b651a8ca6a
15 changed files with 203 additions and 171 deletions
@@ -0,0 +1,41 @@
package de.dennisguse.opentracks.settings.bluetooth;
import android.content.Context;
import android.location.LocationManager;
import android.util.AttributeSet;
import androidx.core.location.LocationManagerCompat;
import androidx.preference.PreferenceDialogFragmentCompat;
import java.util.List;
import de.dennisguse.opentracks.sensors.driver.GpsInternal;
public class BluetoothLeGpsPreference extends BluetoothLeSensorPreference {
public BluetoothLeGpsPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public BluetoothLeGpsPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public BluetoothLeGpsPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
public BluetoothLeGpsPreference(Context context) {
super(context);
}
@Override
public PreferenceDialogFragmentCompat createInstance() {
boolean hasInternalSensor = LocationManagerCompat.hasProvider((LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE), GpsInternal.LOCATION_PROVIDER);
return BluetoothLeSensorPreferenceDialog
.newInstance(getKey(), List.of(), hasInternalSensor);
}
}