Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed immediate crash on startup if autoreconnect selected without a …

…bluetooth target
  • Loading branch information...
commit efc888f5f1b3321d8d2e08362a8622bf84938050 1 parent addeca9
authored July 18, 2012

Showing 1 changed file with 2 additions and 5 deletions. Show diff stats Hide diff stats

  1. 7  src/org/harleydroid/HarleyDroid.java
7  src/org/harleydroid/HarleyDroid.java
@@ -78,11 +78,8 @@ public void onCreate(Bundle savedInstanceState)
78 78
 		super.onCreate(savedInstanceState);
79 79
 
80 80
 		if (DTRACE) Debug.startMethodTracing("harleydroid");
81  
-
82 81
 		mPrefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
83  
-
84  
-		mAutoConnect = true;
85  
-
  82
+		mAutoConnect = ( mBluetoothID != null );
86 83
 		if (Eula.show(this, false))
87 84
 			onEulaAgreedTo();
88 85
 	}
@@ -120,7 +117,7 @@ public void onStart() {
120 117
 		// get preferences which may have been changed
121 118
 		mInterfaceType = mPrefs.getString("interfacetype", null);
122 119
 		mBluetoothID = mPrefs.getString("bluetoothid", null);
123  
-		mAutoConnect = mAutoConnect && mPrefs.getBoolean("autoconnect", false);
  120
+		mAutoConnect = ( mBluetoothID != null ) && mAutoConnect && mPrefs.getBoolean("autoconnect", false);
124 121
 		mAutoReconnect = mPrefs.getBoolean("autoreconnect", false);
125 122
 		mReconnectDelay = mPrefs.getString("reconnectdelay", "30");
126 123
 		if (mPrefs.getString("orientation", "auto").equals("auto"))

0 notes on commit efc888f

Please sign in to comment.
Something went wrong with that request. Please try again.