diff options
author | Kai Shi <kaishi@google.com> | 2022-01-25 04:06:53 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-01-25 04:06:53 +0000 |
commit | df1fb92ed2d88a451d4ec0a9fff3ad0612321854 (patch) | |
tree | 8c6be1ee2da56022881e19e483c1f35b357e8c39 /framework/java/android/bluetooth/le/ScanSettings.java | |
parent | afd282c1f74b1b5f9d67a8221a3a4ecffe16963b (diff) | |
parent | 73c9ebec84913d8f1fbf115d7f5f23b4204d7a45 (diff) |
Merge "BLE scan time optimization" am: b6ba66bc25 am: 73c9ebec84
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1956456
Change-Id: Ie7fb31db7bc7d1e0507d1f0d70f02b17fb1f98c6
Diffstat (limited to 'framework/java/android/bluetooth/le/ScanSettings.java')
-rw-r--r-- | framework/java/android/bluetooth/le/ScanSettings.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/le/ScanSettings.java b/framework/java/android/bluetooth/le/ScanSettings.java index 1aa7cb5111..1f9d4caec5 100644 --- a/framework/java/android/bluetooth/le/ScanSettings.java +++ b/framework/java/android/bluetooth/le/ScanSettings.java @@ -62,6 +62,23 @@ public final class ScanSettings implements Parcelable { public static final int SCAN_MODE_AMBIENT_DISCOVERY = 3; /** + * Default Bluetooth LE scan mode when the screen is off. + * This mode has the low duty cycle and long scan interval which results in the lowest + * power consumption among all modes. It is for the framework internal use only. + * + * @hide + */ + public static final int SCAN_MODE_SCREEN_OFF = 4; + + /** + * Balanced Bluetooth LE scan mode for foreground service when the screen is off. + * It is for the framework internal use only. + * + * @hide + */ + public static final int SCAN_MODE_SCREEN_OFF_BALANCED = 5; + + /** * Trigger a callback for every Bluetooth advertisement found that matches the filter criteria. * If no filter is active, all advertisement packets are reported. */ @@ -292,6 +309,8 @@ public final class ScanSettings implements Parcelable { case SCAN_MODE_BALANCED: case SCAN_MODE_LOW_LATENCY: case SCAN_MODE_AMBIENT_DISCOVERY: + case SCAN_MODE_SCREEN_OFF: + case SCAN_MODE_SCREEN_OFF_BALANCED: mScanMode = scanMode; break; default: |