Merge "Bluetooth: bluetooth.le API fixes" am: cf95973276 am: 6af9bde898

am: 62fc08f684

Change-Id: I98bf6fc7d8d58f102b1268cb3e6d27fb6fd86b78
This commit is contained in:
Jakub Pawlowski
2017-04-28 22:02:52 +00:00
committed by android-build-merger
6 changed files with 12 additions and 11 deletions

View File

@@ -8025,7 +8025,7 @@ package android.bluetooth.le {
method public void setAdvertisingData(android.bluetooth.le.AdvertiseData); method public void setAdvertisingData(android.bluetooth.le.AdvertiseData);
method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters); method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters);
method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData); method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData);
method public void setPeriodicAdvertisingEnable(boolean); method public void setPeriodicAdvertisingEnabled(boolean);
method public void setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters); method public void setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters);
method public void setScanResponseData(android.bluetooth.le.AdvertiseData); method public void setScanResponseData(android.bluetooth.le.AdvertiseData);
} }

View File

@@ -8503,7 +8503,7 @@ package android.bluetooth.le {
method public void setAdvertisingData(android.bluetooth.le.AdvertiseData); method public void setAdvertisingData(android.bluetooth.le.AdvertiseData);
method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters); method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters);
method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData); method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData);
method public void setPeriodicAdvertisingEnable(boolean); method public void setPeriodicAdvertisingEnabled(boolean);
method public void setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters); method public void setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters);
method public void setScanResponseData(android.bluetooth.le.AdvertiseData); method public void setScanResponseData(android.bluetooth.le.AdvertiseData);
} }

View File

@@ -8056,7 +8056,7 @@ package android.bluetooth.le {
method public void setAdvertisingData(android.bluetooth.le.AdvertiseData); method public void setAdvertisingData(android.bluetooth.le.AdvertiseData);
method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters); method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters);
method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData); method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData);
method public void setPeriodicAdvertisingEnable(boolean); method public void setPeriodicAdvertisingEnabled(boolean);
method public void setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters); method public void setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters);
method public void setScanResponseData(android.bluetooth.le.AdvertiseData); method public void setScanResponseData(android.bluetooth.le.AdvertiseData);
} }

View File

@@ -172,7 +172,7 @@ public final class AdvertisingSet {
* *
* @param enable whether the periodic advertising should be enabled (true), or disabled (false). * @param enable whether the periodic advertising should be enabled (true), or disabled (false).
*/ */
public void setPeriodicAdvertisingEnable(boolean enable) { public void setPeriodicAdvertisingEnabled(boolean enable) {
try { try {
gatt.setPeriodicAdvertisingEnable(this.advertiserId, enable); gatt.setPeriodicAdvertisingEnable(this.advertiserId, enable);
} catch (RemoteException e) { } catch (RemoteException e) {

View File

@@ -135,7 +135,7 @@ public abstract class AdvertisingSetCallback {
int status) {} int status) {}
/** /**
* Callback triggered in response to {@link AdvertisingSet#setPeriodicAdvertisingEnable} * Callback triggered in response to {@link AdvertisingSet#setPeriodicAdvertisingEnabled}
* indicating result of the operation. * indicating result of the operation.
* *
* @param advertisingSet The advertising set. * @param advertisingSet The advertising set.

View File

@@ -242,7 +242,7 @@ public final class AdvertisingSetParameters implements Parcelable {
* non-connectable. * non-connectable.
* Legacy advertisements can be both connectable and scannable. Non-legacy * Legacy advertisements can be both connectable and scannable. Non-legacy
* advertisements can be only scannable or only connectable. * advertisements can be only scannable or only connectable.
* @param connectable Controls whether the advertisment type will be * @param connectable Controls whether the advertisement type will be
* connectable (true) or non-connectable (false). * connectable (true) or non-connectable (false).
*/ */
public Builder setConnectable(boolean connectable) { public Builder setConnectable(boolean connectable) {
@@ -254,7 +254,7 @@ public final class AdvertisingSetParameters implements Parcelable {
* Set whether the advertisement type should be scannable. * Set whether the advertisement type should be scannable.
* Legacy advertisements can be both connectable and scannable. Non-legacy * Legacy advertisements can be both connectable and scannable. Non-legacy
* advertisements can be only scannable or only connectable. * advertisements can be only scannable or only connectable.
* @param scannable Controls whether the advertisment type will be * @param scannable Controls whether the advertisement type will be
* scannable (true) or non-scannable (false). * scannable (true) or non-scannable (false).
*/ */
public Builder setScannable(boolean scannable) { public Builder setScannable(boolean scannable) {
@@ -386,6 +386,7 @@ public final class AdvertisingSetParameters implements Parcelable {
/** /**
* Build the {@link AdvertisingSetParameters} object. * Build the {@link AdvertisingSetParameters} object.
* @throws IllegalStateException if invalid combination of parameters is used.
*/ */
public AdvertisingSetParameters build() { public AdvertisingSetParameters build() {
if (isLegacy) { if (isLegacy) {
@@ -394,22 +395,22 @@ public final class AdvertisingSetParameters implements Parcelable {
} }
if (connectable == true && scannable == false) { if (connectable == true && scannable == false) {
throw new IllegalArgumentException( throw new IllegalStateException(
"Legacy advertisement can't be connectable and non-scannable"); "Legacy advertisement can't be connectable and non-scannable");
} }
if (includeTxPower) { if (includeTxPower) {
throw new IllegalArgumentException( throw new IllegalStateException(
"Legacy advertising can't include TX power level in header"); "Legacy advertising can't include TX power level in header");
} }
} else { } else {
if (connectable && scannable) { if (connectable && scannable) {
throw new IllegalArgumentException( throw new IllegalStateException(
"Advertising can't be both connectable and scannable"); "Advertising can't be both connectable and scannable");
} }
if (isAnonymous && connectable) { if (isAnonymous && connectable) {
throw new IllegalArgumentException( throw new IllegalStateException(
"Advertising can't be both connectable and anonymous"); "Advertising can't be both connectable and anonymous");
} }
} }