run bluetooth adapter enabling/disabling in background thread

also run setting the default preferences in a background thread

Closes #184
This commit is contained in:
Torsten Grote
2016-01-19 11:10:34 -02:00
parent 05a83dc32c
commit f9f3696fb9
4 changed files with 29 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ import android.widget.Toast;
import org.briarproject.R;
import org.briarproject.android.BriarActivity;
import org.briarproject.android.util.AndroidUtils;
import org.briarproject.api.TransportConfig;
import org.briarproject.api.TransportId;
import org.briarproject.api.android.ReferenceManager;
@@ -333,7 +334,7 @@ implements InvitationListener {
if (LOG.isLoggable(INFO)) LOG.info("Turning off Bluetooth again");
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if (adapter != null) adapter.disable();
if (adapter != null) AndroidUtils.setBluetooth(adapter, false);
}
}