Permalink
Browse files

Fixed immediate crash on startup if autoreconnect selected without a …

…bluetooth target
  • Loading branch information...
1 parent addeca9 commit efc888f5f1b3321d8d2e08362a8622bf84938050 U-TZFAST\tz committed Jul 18, 2012
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/org/harleydroid/HarleyDroid.java
@@ -78,11 +78,8 @@ public void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
if (DTRACE) Debug.startMethodTracing("harleydroid");
-
mPrefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
-
- mAutoConnect = true;
-
+ mAutoConnect = ( mBluetoothID != null );
if (Eula.show(this, false))
onEulaAgreedTo();
}
@@ -120,7 +117,7 @@ public void onStart() {
// get preferences which may have been changed
mInterfaceType = mPrefs.getString("interfacetype", null);
mBluetoothID = mPrefs.getString("bluetoothid", null);
- mAutoConnect = mAutoConnect && mPrefs.getBoolean("autoconnect", false);
+ mAutoConnect = ( mBluetoothID != null ) && mAutoConnect && mPrefs.getBoolean("autoconnect", false);
mAutoReconnect = mPrefs.getBoolean("autoreconnect", false);
mReconnectDelay = mPrefs.getString("reconnectdelay", "30");
if (mPrefs.getString("orientation", "auto").equals("auto"))

0 comments on commit efc888f

Please sign in to comment.