Skip to content

Commit

Permalink
DexShareCollectionService invalid address catch
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed Nov 2, 2016
1 parent 60b7351 commit 82d3a23
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,19 @@ public void attemptConnection() {
mDeviceName = btDevice.name;
mDeviceAddress = btDevice.address;
mBluetoothAdapter = mBluetoothManager.getAdapter();
if (mBluetoothAdapter.isEnabled() && mBluetoothAdapter.getRemoteDevice(mDeviceAddress) != null) {
connect(mDeviceAddress);
return;
} else {
Log.w(TAG, "Bluetooth is disabled or BT device cant be found");
setRetryTimer();
return;
try {
if (mBluetoothAdapter.isEnabled() && mBluetoothAdapter.getRemoteDevice(mDeviceAddress) != null) {
connect(mDeviceAddress);
return;
} else {
Log.w(TAG, "Bluetooth is disabled or BT device cant be found");
setRetryTimer();
return;
}
} catch (IllegalArgumentException e) {
if (JoH.ratelimit("dex-share-error-log", 180)) {
Log.wtf(TAG, "Error connecting: " + e);
}
}
} else {
Log.w(TAG, "No bluetooth device to try and connect to");
Expand Down

0 comments on commit 82d3a23

Please sign in to comment.