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

@@ -17,6 +17,7 @@ import android.widget.TextView;
import org.briarproject.R;
import org.briarproject.android.panic.PanicPreferencesActivity;
import org.briarproject.android.util.AndroidUtils;
import org.briarproject.android.util.FixedVerticalSpace;
import org.briarproject.android.util.HorizontalBorder;
import org.briarproject.android.util.LayoutUtils;
@@ -330,8 +331,7 @@ OnClickListener {
bluetoothSetting = !bluetoothSetting;
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if (adapter != null) {
if (bluetoothSetting) adapter.enable();
else adapter.disable();
AndroidUtils.setBluetooth(adapter, bluetoothSetting);
}
storeBluetoothSetting();
displaySettings();