summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/le/AdvertiseCallback.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/AdvertiseCallback.java
parent0649e964a14ffea79689a81fdcb5546ee6ad4553 (diff)
Unhide Bluetooth batch APIs. Deprecate BluetoothAdpater scan APIs. (1/2)
Change-Id: Ib0c4ea6c8372a15473269660355fb5ccf4284457
Diffstat (limited to 'framework/java/android/bluetooth/le/AdvertiseCallback.java')
-rw-r--r--framework/java/android/bluetooth/le/AdvertiseCallback.java50
1 files changed, 22 insertions, 28 deletions
diff --git a/framework/java/android/bluetooth/le/AdvertiseCallback.java b/framework/java/android/bluetooth/le/AdvertiseCallback.java
index 1d26ef9393..2afbadf47e 100644
--- a/framework/java/android/bluetooth/le/AdvertiseCallback.java
+++ b/framework/java/android/bluetooth/le/AdvertiseCallback.java
@@ -17,64 +17,58 @@
package android.bluetooth.le;
/**
- * Callback of Bluetooth LE advertising, which is used to deliver advertising operation status.
+ * Bluetooth LE advertising callbacks, used to deliver advertising operation status.
*/
public abstract class AdvertiseCallback {
/**
- * The operation is success.
- *
+ * The requested operation was successful.
* @hide
*/
- public static final int SUCCESS = 0;
+ public static final int ADVERTISE_SUCCESS = 0;
+
/**
- * Fails to start advertising as the advertisement data contains services that are not added to
- * the local bluetooth GATT server.
+ * Failed to start advertising as the advertisement data contains services that are not
+ * added to the local Bluetooth GATT server.
*/
public static final int ADVERTISE_FAILED_SERVICE_UNKNOWN = 1;
+
/**
- * Fails to start advertising as system runs out of quota for advertisers.
+ * Failed to start advertising because no advertising instance is available.
*/
public static final int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS = 2;
/**
- * Fails to start advertising as the advertising is already started.
+ * Failed to start advertising as the advertising is already started.
*/
public static final int ADVERTISE_FAILED_ALREADY_STARTED = 3;
- /**
- * Fails to stop advertising as the advertising is not started.
- */
- public static final int ADVERTISE_FAILED_NOT_STARTED = 4;
/**
- * Operation fails due to bluetooth controller failure.
- */
- public static final int ADVERTISE_FAILED_CONTROLLER_FAILURE = 5;
-
- /**
- * Operation fails due to GATT service failure.
- * @hide
+ * Operation failed due to an internal error.
*/
- public static final int ADVERTISE_FAILED_GATT_SERVICE_FAILURE = 6;
+ public static final int ADVERTISE_FAILED_INTERNAL_ERROR = 4;
/**
- * Operation fails as this feature is not supported
+ * This feature is not supported on this platform.
*/
- public static final int ADVERTISE_FAILED_FEATURE_UNSUPPORTED = 7;
+ public static final int ADVERTISE_FAILED_FEATURE_UNSUPPORTED = 5;
/**
- * Callback when advertising operation succeeds.
+ * Callback triggered in response to {@link BluetoothLeAdvertiser#startAdvertising} indicating
+ * that the advertising has been started successfully.
*
* @param settingsInEffect The actual settings used for advertising, which may be different from
- * what the app asks.
+ * what has been requested.
*/
- public abstract void onSuccess(AdvertiseSettings settingsInEffect);
+ public void onStartSuccess(AdvertiseSettings settingsInEffect) {
+ }
/**
- * Callback when advertising operation fails.
+ * Callback when advertising could not be started.
*
- * @param errorCode Error code for failures.
+ * @param errorCode Error code (see ADVERTISE_FAILED_* constants) for
*/
- public abstract void onFailure(int errorCode);
+ public void onStartFailure(int errorCode) {
+ }
}