forked from upstream-mirrors/OpenTracks
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"
|
<ListPreference android:key="@string/bluetooth_sensor_key"
|
||||||
android:title="@string/settings_sensor_bluetooth_sensor"
|
android:title="@string/settings_sensor_bluetooth_sensor"
|
||||||
android:summary="@string/settings_sensor_bluetooth_sensor_summary"
|
android:summary="@string/settings_sensor_bluetooth_sensor_summary"
|
||||||
android:defaultValue="any" />
|
android:defaultValue="" />
|
||||||
|
|
||||||
<Preference android:key="@string/bluetooth_pairing_key"
|
<Preference android:key="@string/bluetooth_pairing_key"
|
||||||
android:title="@string/settings_sensor_bluetooth_pairing"
|
android:title="@string/settings_sensor_bluetooth_pairing"
|
||||||
|
|||||||
+2
-2
@@ -130,8 +130,8 @@ public class BluetoothSensorManager extends SensorManager {
|
|||||||
SharedPreferences prefs = context.getSharedPreferences(
|
SharedPreferences prefs = context.getSharedPreferences(
|
||||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
String address =
|
String address =
|
||||||
prefs.getString(context.getString(R.string.bluetooth_sensor_key), null);
|
prefs.getString(context.getString(R.string.bluetooth_sensor_key), "");
|
||||||
if (address == null) {
|
if (address.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Log.w(Constants.TAG, "Connecting to bluetooth sensor: " + address);
|
Log.w(Constants.TAG, "Connecting to bluetooth sensor: " + address);
|
||||||
|
|||||||
Reference in New Issue
Block a user