mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
Fix bluetooth crashes in issue 681.
This commit is contained in:
@@ -167,7 +167,7 @@ limitations under the License.
|
||||
<ListPreference android:key="@string/bluetooth_sensor_key"
|
||||
android:title="@string/settings_sensor_bluetooth_sensor"
|
||||
android:summary="@string/settings_sensor_bluetooth_sensor_summary"
|
||||
android:defaultValue="any" />
|
||||
android:defaultValue="" />
|
||||
|
||||
<Preference android:key="@string/bluetooth_pairing_key"
|
||||
android:title="@string/settings_sensor_bluetooth_pairing"
|
||||
|
||||
+2
-2
@@ -130,8 +130,8 @@ public class BluetoothSensorManager extends SensorManager {
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
String address =
|
||||
prefs.getString(context.getString(R.string.bluetooth_sensor_key), null);
|
||||
if (address == null) {
|
||||
prefs.getString(context.getString(R.string.bluetooth_sensor_key), "");
|
||||
if (address.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Log.w(Constants.TAG, "Connecting to bluetooth sensor: " + address);
|
||||
|
||||
Reference in New Issue
Block a user