Update bluetooth preference to take user to new screen

This CL removes the toggle from the bluetooth preference and instead
takes users to a new dedicated screen for toggling bluetooth status.
On this screen we show a different summary text depending on whether
bluetooth and bluetooth scanning are on/off. Also, we were able to
delegate most of the UI/bluetooth handling to already existing
classes.

Test: robotests
Bug: 77543471
Change-Id: I036a3992bbd78896da8364b55ecc51afc4464b6e
This commit is contained in:
Salvador Martinez
2018-04-04 14:23:57 -07:00
parent 837f279db9
commit 21c5ed2894
12 changed files with 312 additions and 170 deletions

View File

@@ -21,6 +21,7 @@ import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.content.DialogInterface;
import android.provider.Settings;
import android.support.annotation.VisibleForTesting;
import android.widget.Toast;
@@ -142,4 +143,8 @@ public final class Utils {
}
};
public static boolean isBluetoothScanningEnabled(Context context) {
return Settings.Global.getInt(context.getContentResolver(),
Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, 0) == 1;
}
}