diff options
Diffstat (limited to 'framework/java/android/bluetooth/le/AdvertisingSetParameters.java')
-rw-r--r-- | framework/java/android/bluetooth/le/AdvertisingSetParameters.java | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/framework/java/android/bluetooth/le/AdvertisingSetParameters.java b/framework/java/android/bluetooth/le/AdvertisingSetParameters.java index 4e9fac3ee2..31d8f48209 100644 --- a/framework/java/android/bluetooth/le/AdvertisingSetParameters.java +++ b/framework/java/android/bluetooth/le/AdvertisingSetParameters.java @@ -17,6 +17,7 @@ package android.bluetooth.le; import android.bluetooth.BluetoothAdapter; +import android.bluetooth.BluetoothDevice; import android.os.Parcel; import android.os.Parcelable; @@ -30,21 +31,6 @@ import android.os.Parcelable; public final class AdvertisingSetParameters implements Parcelable { /** - * 1M advertiser PHY. - */ - public static final int PHY_LE_1M = 1; - - /** - * 2M advertiser PHY. - */ - public static final int PHY_LE_2M = 2; - - /** - * LE Coded advertiser PHY. - */ - public static final int PHY_LE_CODED = 3; - - /** * Advertise on low frequency, around every 1000ms. This is the default and * preferred advertising mode as it consumes the least power. */ @@ -246,8 +232,8 @@ public final class AdvertisingSetParameters implements Parcelable { private boolean isLegacy = false; private boolean isAnonymous = false; private boolean includeTxPower = false; - private int primaryPhy = PHY_LE_1M; - private int secondaryPhy = PHY_LE_1M; + private int primaryPhy = BluetoothDevice.PHY_LE_1M; + private int secondaryPhy = BluetoothDevice.PHY_LE_1M; private int interval = INTERVAL_LOW; private int txPowerLevel = TX_POWER_MEDIUM; @@ -321,12 +307,13 @@ public final class AdvertisingSetParameters implements Parcelable { * Use {@link BluetoothAdapter#isLeCodedPhySupported} to determine if LE Coded PHY is * supported on this device. * @param primaryPhy Primary advertising physical channel, can only be - * {@link AdvertisingSetParameters#PHY_LE_1M} or - * {@link AdvertisingSetParameters#PHY_LE_CODED}. + * {@link BluetoothDevice#PHY_LE_1M} or + * {@link BluetoothDevice#PHY_LE_CODED}. * @throws IllegalArgumentException If the primaryPhy is invalid. */ public Builder setPrimaryPhy(int primaryPhy) { - if (primaryPhy != PHY_LE_1M && primaryPhy != PHY_LE_CODED) { + if (primaryPhy != BluetoothDevice.PHY_LE_1M && + primaryPhy != BluetoothDevice.PHY_LE_CODED) { throw new IllegalArgumentException("bad primaryPhy " + primaryPhy); } this.primaryPhy = primaryPhy; @@ -343,14 +330,15 @@ public final class AdvertisingSetParameters implements Parcelable { * supported on this device. * * @param secondaryPhy Secondary advertising physical channel, can only be - * one of {@link AdvertisingSetParameters#PHY_LE_1M}, - * {@link AdvertisingSetParameters#PHY_LE_2M} or - * {@link AdvertisingSetParameters#PHY_LE_CODED}. + * one of {@link BluetoothDevice#PHY_LE_1M}, + * {@link BluetoothDevice#PHY_LE_2M} or + * {@link BluetoothDevice#PHY_LE_CODED}. * @throws IllegalArgumentException If the secondaryPhy is invalid. */ public Builder setSecondaryPhy(int secondaryPhy) { - if (secondaryPhy != PHY_LE_1M && secondaryPhy !=PHY_LE_2M && - secondaryPhy != PHY_LE_CODED) { + if (secondaryPhy != BluetoothDevice.PHY_LE_1M && + secondaryPhy != BluetoothDevice.PHY_LE_2M && + secondaryPhy != BluetoothDevice.PHY_LE_CODED) { throw new IllegalArgumentException("bad secondaryPhy " + secondaryPhy); } this.secondaryPhy = secondaryPhy; |