Cleanup after bluetooth-swap merge

This commit is contained in:
Daniel Martí 2015-09-10 19:00:09 -07:00
parent 42d31eb0e6
commit cba2e67a70
4 changed files with 10 additions and 16 deletions

View File

@ -282,7 +282,7 @@ public class RepoUpdater {
* actually in the index.jar itself. If no fingerprint, just store the
* signing certificate */
boolean trustNewSigningCertificate = false;
if (repo.fingerprint == null || TextUtils.isEmpty(repo.fingerprint)) {
if (TextUtils.isEmpty(repo.fingerprint)) {
// no info to check things are valid, so just Trust On First Use
trustNewSigningCertificate = true;
} else {

View File

@ -108,17 +108,13 @@ public class SwapService extends Service {
public void scanForPeers() {
Log.d(TAG, "Scanning for nearby devices to swap with...");
bonjourFinder.scan();
bluetoothFinder.scan();
}
public void stopScanningForPeers() {
bonjourFinder.cancel();
bluetoothFinder.cancel();
}

View File

@ -99,13 +99,9 @@ public class BluetoothFinder extends PeerFinder<BluetoothPeer> {
if (device != null && device.getName() != null &&
(device.getBluetoothClass().getDeviceClass() == BluetoothClass.Device.COMPUTER_HANDHELD_PC_PDA||
device.getBluetoothClass().getDeviceClass() == BluetoothClass.Device.COMPUTER_PALM_SIZE_PC_PDA||
device.getBluetoothClass().getDeviceClass() == BluetoothClass.Device.PHONE_SMART))
{
device.getBluetoothClass().getDeviceClass() == BluetoothClass.Device.PHONE_SMART)) {
foundPeer(new BluetoothPeer(device));
}
// if (device != null && device.getName() != null && device.getName().startsWith(BluetoothSwap.BLUETOOTH_NAME_TAG)) {
// foundPeer(new BluetoothPeer(device));
// }
}
}

View File

@ -135,10 +135,12 @@ public class BluetoothSwap extends SwapType {
server.close();
setConnected(false);
// if (receiver != null) {
// context.unregisterReceiver(receiver);
// receiver = null;
// }
/*
if (receiver != null) {
context.unregisterReceiver(receiver);
receiver = null;
}
*/
} else {
Log.i(TAG, "Attempting to stop Bluetooth swap, but it is not currently running.");
}