Bugfix: GPS via Bluetooth is not yet support and should therefore not be configurable.

Fixes #2294.
This commit is contained in:
Dennis Guse
2026-03-14 12:16:20 +01:00
parent ca6f973360
commit 4e400c60f6
4 changed files with 16 additions and 46 deletions
@@ -110,7 +110,7 @@ public class GpsHandler extends SensorHandler<Location, Position> {
@Override
protected int getSensorPreferenceKey() {
return R.string.settings_sensor_bluetooth_gps_key;
return R.string.settings_sensor_gps_key;
}
@Override
@@ -1,41 +0,0 @@
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);
}
}
+9 -1
View File
@@ -26,9 +26,17 @@
<string name="settings_sensor_bluetooth_cycling_power_key" translatable="false">bluetoothCyclingPowerSensor</string>
<string name="settings_sensor_bluetooth_running_speed_and_cadence_key" translatable="false">bluetoothRunningSpeedAndCadenceSensor</string>
<string name="settings_sensor_bluetooth_pressure_key" translatable="false">bluetoothPressureSensor</string>
<string name="settings_sensor_bluetooth_gps_key" translatable="false">bluetoothGPSSensor</string>
<string name="settings_sensor_gps_key" translatable="false">bluetoothGPSSensor</string>
<string name="sensor_type_value_none" translatable="false">NONE</string>
<string name="sensor_type_value_internal" translatable="false">INTERNAL</string>
<string-array name="sensor_type_no_bluetooth_entryValues">
<item>@string/sensor_type_value_none</item>
<item>@string/sensor_type_value_internal</item>
</string-array>
<string-array name="sensor_type_no_bluetooth_entries">
<item>@string/value_none</item>
<item>@string/value_internal_sensor</item>
</string-array>
<string name="settings_sensor_bluetooth_cycling_speed_wheel_circumference_key" translatable="false">bluetoothCyclingSpeedWheelCircumference</string>
<string name="settings_sensor_bluetooth_cycling_speed_wheel_circumference_default" translatable="false">2135</string>
+6 -3
View File
@@ -5,10 +5,13 @@
android:title="@string/settings_sensors_title">
<PreferenceCategory android:title="@string/settings_gps_sensor">
<de.dennisguse.opentracks.settings.bluetooth.BluetoothLeGpsPreference
<ListPreference
android:defaultValue="@string/sensor_type_value_internal"
android:key="@string/settings_sensor_bluetooth_gps_key"
android:title="@string/settings_gps_sensor" />
android:entryValues="@array/sensor_type_no_bluetooth_entryValues"
android:entries="@array/sensor_type_no_bluetooth_entries"
android:key="@string/settings_sensor_gps_key"
android:title="@string/settings_gps_sensor"
app:useSimpleSummaryProvider="true" />
<ListPreference
android:defaultValue="@string/min_sampling_interval_default"
android:entryValues="@array/min_sampling_interval_values"