summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/le/ScanCallback.java
diff options
context:
space:
mode:
authorWei Wang <weiwa@google.com>2014-07-09 14:03:42 -0700
committerAndre Eisenbach <eisenbach@google.com>2014-07-11 11:06:10 -0700
commit7faed2f183c09307b398c22e1b92ac52f1d93a7e (patch)
treea1b965074345becdbbd7474cc50662a7cd9d8e97 /framework/java/android/bluetooth/le/ScanCallback.java
parent0649e964a14ffea79689a81fdcb5546ee6ad4553 (diff)
Unhide Bluetooth batch APIs. Deprecate BluetoothAdpater scan APIs. (1/2)
Change-Id: Ib0c4ea6c8372a15473269660355fb5ccf4284457
Diffstat (limited to 'framework/java/android/bluetooth/le/ScanCallback.java')
-rw-r--r--framework/java/android/bluetooth/le/ScanCallback.java49
1 files changed, 19 insertions, 30 deletions
diff --git a/framework/java/android/bluetooth/le/ScanCallback.java b/framework/java/android/bluetooth/le/ScanCallback.java
index 593f7f8ab3..b4c1e1769c 100644
--- a/framework/java/android/bluetooth/le/ScanCallback.java
+++ b/framework/java/android/bluetooth/le/ScanCallback.java
@@ -19,64 +19,53 @@ package android.bluetooth.le;
import java.util.List;
/**
- * Callback of Bluetooth LE scans. The results of the scans will be delivered through the callbacks.
+ * Bluetooth LE scan callbacks.
+ * Scan results are reported using these callbacks.
+ *
+ * {@see BluetoothLeScanner#startScan}
*/
public abstract class ScanCallback {
-
/**
* Fails to start scan as BLE scan with the same settings is already started by the app.
*/
public static final int SCAN_FAILED_ALREADY_STARTED = 1;
+
/**
* Fails to start scan as app cannot be registered.
*/
public static final int SCAN_FAILED_APPLICATION_REGISTRATION_FAILED = 2;
+
/**
- * Fails to start scan due to gatt service failure.
- */
- public static final int SCAN_FAILED_GATT_SERVICE_FAILURE = 3;
- /**
- * Fails to start scan due to controller failure.
+ * Fails to start scan due an internal error
*/
- public static final int SCAN_FAILED_CONTROLLER_FAILURE = 4;
+ public static final int SCAN_FAILED_INTERNAL_ERROR = 3;
/**
* Fails to start power optimized scan as this feature is not supported.
*/
- public static final int SCAN_FAILED_FEATURE_UNSUPPORTED = 5;
+ public static final int SCAN_FAILED_FEATURE_UNSUPPORTED = 4;
/**
- * Callback when a BLE advertisement is found.
+ * Callback when a BLE advertisement has been found.
*
+ * @param callbackType Determines if this callback was triggered because of first match,
+ * a lost match indication or a regular scan result.
* @param result A Bluetooth LE scan result.
*/
- public abstract void onAdvertisementUpdate(ScanResult result);
-
- /**
- * Callback when the BLE advertisement is found for the first time.
- *
- * @param result The Bluetooth LE scan result when the onFound event is triggered.
- */
- public abstract void onAdvertisementFound(ScanResult result);
-
- /**
- * Callback when the BLE advertisement was lost. Note a device has to be "found" before it's
- * lost.
- *
- * @param result The Bluetooth scan result that was last found.
- */
- public abstract void onAdvertisementLost(ScanResult result);
+ public void onScanResult(int callbackType, ScanResult result) {
+ }
/**
* Callback when batch results are delivered.
*
* @param results List of scan results that are previously scanned.
- * @hide
*/
- public abstract void onBatchScanResults(List<ScanResult> results);
+ public void onBatchScanResults(List<ScanResult> results) {
+ }
/**
- * Callback when scan failed.
+ * Callback when scan could not be started.
*/
- public abstract void onScanFailed(int errorCode);
+ public void onScanFailed(int errorCode) {
+ }
}