Fix bluetooth crashes in issue 681.

This commit is contained in:
Jimmy Shih
2011-12-21 17:37:34 -08:00
parent 34c273be7a
commit 28ce9a1656
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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"
@@ -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);