mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
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:
@@ -1,6 +1,7 @@
|
||||
package org.briarproject.android.util;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.os.Build;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
|
||||
@@ -32,4 +33,16 @@ public class AndroidUtils {
|
||||
} else
|
||||
til.setError(null);
|
||||
}
|
||||
|
||||
public static void setBluetooth(final BluetoothAdapter adapter,
|
||||
final boolean activate) {
|
||||
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (activate) adapter.enable();
|
||||
else adapter.disable();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user