Loading api/current.txt +8 −7 Original line number Diff line number Diff line Loading @@ -6611,6 +6611,7 @@ package android.bluetooth.le { method public java.util.Map<android.os.ParcelUuid, byte[]> getServiceData(); method public java.util.List<android.os.ParcelUuid> getServiceUuids(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } public static final class AdvertiseData.Builder { Loading @@ -6625,10 +6626,10 @@ package android.bluetooth.le { public final class AdvertiseSettings implements android.os.Parcelable { method public int describeContents(); method public boolean getIsConnectable(); method public int getMode(); method public int getTimeout(); method public int getTxPowerLevel(); method public boolean isConnectable(); method public void writeToParcel(android.os.Parcel, int); field public static final int ADVERTISE_MODE_BALANCED = 1; // 0x1 field public static final int ADVERTISE_MODE_LOW_LATENCY = 2; // 0x2 Loading @@ -6637,13 +6638,14 @@ package android.bluetooth.le { field public static final int ADVERTISE_TX_POWER_LOW = 1; // 0x1 field public static final int ADVERTISE_TX_POWER_MEDIUM = 2; // 0x2 field public static final int ADVERTISE_TX_POWER_ULTRA_LOW = 0; // 0x0 field public static final android.os.Parcelable.Creator CREATOR; } public static final class AdvertiseSettings.Builder { ctor public AdvertiseSettings.Builder(); method public android.bluetooth.le.AdvertiseSettings build(); method public android.bluetooth.le.AdvertiseSettings.Builder setAdvertiseMode(int); method public android.bluetooth.le.AdvertiseSettings.Builder setIsConnectable(boolean); method public android.bluetooth.le.AdvertiseSettings.Builder setConnectable(boolean); method public android.bluetooth.le.AdvertiseSettings.Builder setTimeout(int); method public android.bluetooth.le.AdvertiseSettings.Builder setTxPowerLevel(int); } Loading Loading @@ -6686,6 +6688,7 @@ package android.bluetooth.le { method public android.os.ParcelUuid getServiceUuidMask(); method public boolean matches(android.bluetooth.le.ScanResult); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } public static final class ScanFilter.Builder { Loading Loading @@ -6721,6 +6724,7 @@ package android.bluetooth.le { method public android.bluetooth.le.ScanRecord getScanRecord(); method public long getTimestampNanos(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } public final class ScanSettings implements android.os.Parcelable { Loading @@ -6731,19 +6735,16 @@ package android.bluetooth.le { method public int getScanResultType(); method public void writeToParcel(android.os.Parcel, int); field public static final int CALLBACK_TYPE_ALL_MATCHES = 1; // 0x1 field public static final int CALLBACK_TYPE_FIRST_MATCH = 2; // 0x2 field public static final int CALLBACK_TYPE_MATCH_LOST = 4; // 0x4 field public static final android.os.Parcelable.Creator CREATOR; field public static final int SCAN_MODE_BALANCED = 1; // 0x1 field public static final int SCAN_MODE_LOW_LATENCY = 2; // 0x2 field public static final int SCAN_MODE_LOW_POWER = 0; // 0x0 field public static final int SCAN_RESULT_TYPE_FULL = 0; // 0x0 } public static final class ScanSettings.Builder { ctor public ScanSettings.Builder(); method public android.bluetooth.le.ScanSettings build(); method public android.bluetooth.le.ScanSettings.Builder setCallbackType(int); method public android.bluetooth.le.ScanSettings.Builder setReportDelayMillis(long); method public android.bluetooth.le.ScanSettings.Builder setReportDelay(long); method public android.bluetooth.le.ScanSettings.Builder setScanMode(int); } core/java/android/bluetooth/le/AdvertiseData.java +0 −3 Original line number Diff line number Diff line Loading @@ -172,9 +172,6 @@ public final class AdvertiseData implements Parcelable { dest.writeByte((byte) (getIncludeDeviceName() ? 1 : 0)); } /** * @hide */ public static final Parcelable.Creator<AdvertiseData> CREATOR = new Creator<AdvertiseData>() { @Override Loading core/java/android/bluetooth/le/AdvertiseSettings.java +22 −25 Original line number Diff line number Diff line Loading @@ -66,13 +66,13 @@ public final class AdvertiseSettings implements Parcelable { public static final int ADVERTISE_TX_POWER_HIGH = 3; /** * The maximimum limited advertisement duration as specified by the Bluetooth SIG * The maximum limited advertisement duration as specified by the Bluetooth SIG */ private static final int LIMITED_ADVERTISING_MAX_DURATION = 180; private static final int LIMITED_ADVERTISING_MAX_MILLIS = 180 * 1000; private final int mAdvertiseMode; private final int mAdvertiseTxPowerLevel; private final int mAdvertiseTimeoutSeconds; private final int mAdvertiseTimeoutMillis; private final boolean mAdvertiseConnectable; private AdvertiseSettings(int advertiseMode, int advertiseTxPowerLevel, Loading @@ -80,14 +80,14 @@ public final class AdvertiseSettings implements Parcelable { mAdvertiseMode = advertiseMode; mAdvertiseTxPowerLevel = advertiseTxPowerLevel; mAdvertiseConnectable = advertiseConnectable; mAdvertiseTimeoutSeconds = advertiseTimeout; mAdvertiseTimeoutMillis = advertiseTimeout; } private AdvertiseSettings(Parcel in) { mAdvertiseMode = in.readInt(); mAdvertiseTxPowerLevel = in.readInt(); mAdvertiseConnectable = in.readInt() != 0 ? true : false; mAdvertiseTimeoutSeconds = in.readInt(); mAdvertiseTimeoutMillis = in.readInt(); } /** Loading @@ -107,15 +107,15 @@ public final class AdvertiseSettings implements Parcelable { /** * Returns whether the advertisement will indicate connectable. */ public boolean getIsConnectable() { public boolean isConnectable() { return mAdvertiseConnectable; } /** * Returns the advertising time limit in seconds. * Returns the advertising time limit in milliseconds. */ public int getTimeout() { return mAdvertiseTimeoutSeconds; return mAdvertiseTimeoutMillis; } @Override Loading @@ -123,7 +123,7 @@ public final class AdvertiseSettings implements Parcelable { return "Settings [mAdvertiseMode=" + mAdvertiseMode + ", mAdvertiseTxPowerLevel=" + mAdvertiseTxPowerLevel + ", mAdvertiseConnectable=" + mAdvertiseConnectable + ", mAdvertiseTimeoutSeconds=" + mAdvertiseTimeoutSeconds + "]"; + ", mAdvertiseTimeoutMillis=" + mAdvertiseTimeoutMillis + "]"; } @Override Loading @@ -136,12 +136,9 @@ public final class AdvertiseSettings implements Parcelable { dest.writeInt(mAdvertiseMode); dest.writeInt(mAdvertiseTxPowerLevel); dest.writeInt(mAdvertiseConnectable ? 1 : 0); dest.writeInt(mAdvertiseTimeoutSeconds); dest.writeInt(mAdvertiseTimeoutMillis); } /** * @hide */ public static final Parcelable.Creator<AdvertiseSettings> CREATOR = new Creator<AdvertiseSettings>() { @Override Loading @@ -161,7 +158,7 @@ public final class AdvertiseSettings implements Parcelable { public static final class Builder { private int mMode = ADVERTISE_MODE_LOW_POWER; private int mTxPowerLevel = ADVERTISE_TX_POWER_MEDIUM; private int mTimeoutSeconds = 0; private int mTimeoutMillis = 0; private boolean mConnectable = true; /** Loading Loading @@ -204,26 +201,26 @@ public final class AdvertiseSettings implements Parcelable { /** * Set whether the advertisement type should be connectable or non-connectable. * * @param isConnectable Controls whether the advertisment type will be connectable (true) * @param connectable Controls whether the advertisment type will be connectable (true) * or non-connectable (false). */ public Builder setIsConnectable(boolean isConnectable) { mConnectable = isConnectable; public Builder setConnectable(boolean connectable) { mConnectable = connectable; return this; } /** * Limit advertising to a given amount of time. * @param timeoutSeconds Advertising time limit. May not exceed 180 seconds. * @param timeoutMillis Advertising time limit. May not exceed 180000 milliseconds. * A value of 0 will disable the time limit. * @throws IllegalArgumentException If the provided timeout is over 180s. * @throws IllegalArgumentException If the provided timeout is over 180000 ms. */ public Builder setTimeout(int timeoutSeconds) { if (timeoutSeconds < 0 || timeoutSeconds > LIMITED_ADVERTISING_MAX_DURATION) { throw new IllegalArgumentException("timeoutSeconds invalid (must be 0-" + LIMITED_ADVERTISING_MAX_DURATION + " seconds)"); public Builder setTimeout(int timeoutMillis) { if (timeoutMillis < 0 || timeoutMillis > LIMITED_ADVERTISING_MAX_MILLIS) { throw new IllegalArgumentException("timeoutMillis invalid (must be 0-" + LIMITED_ADVERTISING_MAX_MILLIS + " milliseconds)"); } mTimeoutSeconds = timeoutSeconds; mTimeoutMillis = timeoutMillis; return this; } Loading @@ -231,7 +228,7 @@ public final class AdvertiseSettings implements Parcelable { * Build the {@link AdvertiseSettings} object. */ public AdvertiseSettings build() { return new AdvertiseSettings(mMode, mTxPowerLevel, mConnectable, mTimeoutSeconds); return new AdvertiseSettings(mMode, mTxPowerLevel, mConnectable, mTimeoutMillis); } } } core/java/android/bluetooth/le/ScanCallback.java +3 −2 Original line number Diff line number Diff line Loading @@ -47,8 +47,8 @@ public abstract class ScanCallback { /** * 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 callbackType Determines how this callback was triggered. Currently could only be * {@link ScanSettings#CALLBACK_TYPE_ALL_MATCHES}. * @param result A Bluetooth LE scan result. */ public void onScanResult(int callbackType, ScanResult result) { Loading @@ -64,6 +64,7 @@ public abstract class ScanCallback { /** * Callback when scan could not be started. * * @param errorCode Error code (one of SCAN_FAILED_*) for scan failure. */ public void onScanFailed(int errorCode) { Loading core/java/android/bluetooth/le/ScanFilter.java +0 −2 Original line number Diff line number Diff line Loading @@ -138,8 +138,6 @@ public final class ScanFilter implements Parcelable { /** * A {@link android.os.Parcelable.Creator} to create {@link ScanFilter} from parcel. * * @hide */ public static final Creator<ScanFilter> CREATOR = new Creator<ScanFilter>() { Loading Loading
api/current.txt +8 −7 Original line number Diff line number Diff line Loading @@ -6611,6 +6611,7 @@ package android.bluetooth.le { method public java.util.Map<android.os.ParcelUuid, byte[]> getServiceData(); method public java.util.List<android.os.ParcelUuid> getServiceUuids(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } public static final class AdvertiseData.Builder { Loading @@ -6625,10 +6626,10 @@ package android.bluetooth.le { public final class AdvertiseSettings implements android.os.Parcelable { method public int describeContents(); method public boolean getIsConnectable(); method public int getMode(); method public int getTimeout(); method public int getTxPowerLevel(); method public boolean isConnectable(); method public void writeToParcel(android.os.Parcel, int); field public static final int ADVERTISE_MODE_BALANCED = 1; // 0x1 field public static final int ADVERTISE_MODE_LOW_LATENCY = 2; // 0x2 Loading @@ -6637,13 +6638,14 @@ package android.bluetooth.le { field public static final int ADVERTISE_TX_POWER_LOW = 1; // 0x1 field public static final int ADVERTISE_TX_POWER_MEDIUM = 2; // 0x2 field public static final int ADVERTISE_TX_POWER_ULTRA_LOW = 0; // 0x0 field public static final android.os.Parcelable.Creator CREATOR; } public static final class AdvertiseSettings.Builder { ctor public AdvertiseSettings.Builder(); method public android.bluetooth.le.AdvertiseSettings build(); method public android.bluetooth.le.AdvertiseSettings.Builder setAdvertiseMode(int); method public android.bluetooth.le.AdvertiseSettings.Builder setIsConnectable(boolean); method public android.bluetooth.le.AdvertiseSettings.Builder setConnectable(boolean); method public android.bluetooth.le.AdvertiseSettings.Builder setTimeout(int); method public android.bluetooth.le.AdvertiseSettings.Builder setTxPowerLevel(int); } Loading Loading @@ -6686,6 +6688,7 @@ package android.bluetooth.le { method public android.os.ParcelUuid getServiceUuidMask(); method public boolean matches(android.bluetooth.le.ScanResult); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } public static final class ScanFilter.Builder { Loading Loading @@ -6721,6 +6724,7 @@ package android.bluetooth.le { method public android.bluetooth.le.ScanRecord getScanRecord(); method public long getTimestampNanos(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } public final class ScanSettings implements android.os.Parcelable { Loading @@ -6731,19 +6735,16 @@ package android.bluetooth.le { method public int getScanResultType(); method public void writeToParcel(android.os.Parcel, int); field public static final int CALLBACK_TYPE_ALL_MATCHES = 1; // 0x1 field public static final int CALLBACK_TYPE_FIRST_MATCH = 2; // 0x2 field public static final int CALLBACK_TYPE_MATCH_LOST = 4; // 0x4 field public static final android.os.Parcelable.Creator CREATOR; field public static final int SCAN_MODE_BALANCED = 1; // 0x1 field public static final int SCAN_MODE_LOW_LATENCY = 2; // 0x2 field public static final int SCAN_MODE_LOW_POWER = 0; // 0x0 field public static final int SCAN_RESULT_TYPE_FULL = 0; // 0x0 } public static final class ScanSettings.Builder { ctor public ScanSettings.Builder(); method public android.bluetooth.le.ScanSettings build(); method public android.bluetooth.le.ScanSettings.Builder setCallbackType(int); method public android.bluetooth.le.ScanSettings.Builder setReportDelayMillis(long); method public android.bluetooth.le.ScanSettings.Builder setReportDelay(long); method public android.bluetooth.le.ScanSettings.Builder setScanMode(int); }
core/java/android/bluetooth/le/AdvertiseData.java +0 −3 Original line number Diff line number Diff line Loading @@ -172,9 +172,6 @@ public final class AdvertiseData implements Parcelable { dest.writeByte((byte) (getIncludeDeviceName() ? 1 : 0)); } /** * @hide */ public static final Parcelable.Creator<AdvertiseData> CREATOR = new Creator<AdvertiseData>() { @Override Loading
core/java/android/bluetooth/le/AdvertiseSettings.java +22 −25 Original line number Diff line number Diff line Loading @@ -66,13 +66,13 @@ public final class AdvertiseSettings implements Parcelable { public static final int ADVERTISE_TX_POWER_HIGH = 3; /** * The maximimum limited advertisement duration as specified by the Bluetooth SIG * The maximum limited advertisement duration as specified by the Bluetooth SIG */ private static final int LIMITED_ADVERTISING_MAX_DURATION = 180; private static final int LIMITED_ADVERTISING_MAX_MILLIS = 180 * 1000; private final int mAdvertiseMode; private final int mAdvertiseTxPowerLevel; private final int mAdvertiseTimeoutSeconds; private final int mAdvertiseTimeoutMillis; private final boolean mAdvertiseConnectable; private AdvertiseSettings(int advertiseMode, int advertiseTxPowerLevel, Loading @@ -80,14 +80,14 @@ public final class AdvertiseSettings implements Parcelable { mAdvertiseMode = advertiseMode; mAdvertiseTxPowerLevel = advertiseTxPowerLevel; mAdvertiseConnectable = advertiseConnectable; mAdvertiseTimeoutSeconds = advertiseTimeout; mAdvertiseTimeoutMillis = advertiseTimeout; } private AdvertiseSettings(Parcel in) { mAdvertiseMode = in.readInt(); mAdvertiseTxPowerLevel = in.readInt(); mAdvertiseConnectable = in.readInt() != 0 ? true : false; mAdvertiseTimeoutSeconds = in.readInt(); mAdvertiseTimeoutMillis = in.readInt(); } /** Loading @@ -107,15 +107,15 @@ public final class AdvertiseSettings implements Parcelable { /** * Returns whether the advertisement will indicate connectable. */ public boolean getIsConnectable() { public boolean isConnectable() { return mAdvertiseConnectable; } /** * Returns the advertising time limit in seconds. * Returns the advertising time limit in milliseconds. */ public int getTimeout() { return mAdvertiseTimeoutSeconds; return mAdvertiseTimeoutMillis; } @Override Loading @@ -123,7 +123,7 @@ public final class AdvertiseSettings implements Parcelable { return "Settings [mAdvertiseMode=" + mAdvertiseMode + ", mAdvertiseTxPowerLevel=" + mAdvertiseTxPowerLevel + ", mAdvertiseConnectable=" + mAdvertiseConnectable + ", mAdvertiseTimeoutSeconds=" + mAdvertiseTimeoutSeconds + "]"; + ", mAdvertiseTimeoutMillis=" + mAdvertiseTimeoutMillis + "]"; } @Override Loading @@ -136,12 +136,9 @@ public final class AdvertiseSettings implements Parcelable { dest.writeInt(mAdvertiseMode); dest.writeInt(mAdvertiseTxPowerLevel); dest.writeInt(mAdvertiseConnectable ? 1 : 0); dest.writeInt(mAdvertiseTimeoutSeconds); dest.writeInt(mAdvertiseTimeoutMillis); } /** * @hide */ public static final Parcelable.Creator<AdvertiseSettings> CREATOR = new Creator<AdvertiseSettings>() { @Override Loading @@ -161,7 +158,7 @@ public final class AdvertiseSettings implements Parcelable { public static final class Builder { private int mMode = ADVERTISE_MODE_LOW_POWER; private int mTxPowerLevel = ADVERTISE_TX_POWER_MEDIUM; private int mTimeoutSeconds = 0; private int mTimeoutMillis = 0; private boolean mConnectable = true; /** Loading Loading @@ -204,26 +201,26 @@ public final class AdvertiseSettings implements Parcelable { /** * Set whether the advertisement type should be connectable or non-connectable. * * @param isConnectable Controls whether the advertisment type will be connectable (true) * @param connectable Controls whether the advertisment type will be connectable (true) * or non-connectable (false). */ public Builder setIsConnectable(boolean isConnectable) { mConnectable = isConnectable; public Builder setConnectable(boolean connectable) { mConnectable = connectable; return this; } /** * Limit advertising to a given amount of time. * @param timeoutSeconds Advertising time limit. May not exceed 180 seconds. * @param timeoutMillis Advertising time limit. May not exceed 180000 milliseconds. * A value of 0 will disable the time limit. * @throws IllegalArgumentException If the provided timeout is over 180s. * @throws IllegalArgumentException If the provided timeout is over 180000 ms. */ public Builder setTimeout(int timeoutSeconds) { if (timeoutSeconds < 0 || timeoutSeconds > LIMITED_ADVERTISING_MAX_DURATION) { throw new IllegalArgumentException("timeoutSeconds invalid (must be 0-" + LIMITED_ADVERTISING_MAX_DURATION + " seconds)"); public Builder setTimeout(int timeoutMillis) { if (timeoutMillis < 0 || timeoutMillis > LIMITED_ADVERTISING_MAX_MILLIS) { throw new IllegalArgumentException("timeoutMillis invalid (must be 0-" + LIMITED_ADVERTISING_MAX_MILLIS + " milliseconds)"); } mTimeoutSeconds = timeoutSeconds; mTimeoutMillis = timeoutMillis; return this; } Loading @@ -231,7 +228,7 @@ public final class AdvertiseSettings implements Parcelable { * Build the {@link AdvertiseSettings} object. */ public AdvertiseSettings build() { return new AdvertiseSettings(mMode, mTxPowerLevel, mConnectable, mTimeoutSeconds); return new AdvertiseSettings(mMode, mTxPowerLevel, mConnectable, mTimeoutMillis); } } }
core/java/android/bluetooth/le/ScanCallback.java +3 −2 Original line number Diff line number Diff line Loading @@ -47,8 +47,8 @@ public abstract class ScanCallback { /** * 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 callbackType Determines how this callback was triggered. Currently could only be * {@link ScanSettings#CALLBACK_TYPE_ALL_MATCHES}. * @param result A Bluetooth LE scan result. */ public void onScanResult(int callbackType, ScanResult result) { Loading @@ -64,6 +64,7 @@ public abstract class ScanCallback { /** * Callback when scan could not be started. * * @param errorCode Error code (one of SCAN_FAILED_*) for scan failure. */ public void onScanFailed(int errorCode) { Loading
core/java/android/bluetooth/le/ScanFilter.java +0 −2 Original line number Diff line number Diff line Loading @@ -138,8 +138,6 @@ public final class ScanFilter implements Parcelable { /** * A {@link android.os.Parcelable.Creator} to create {@link ScanFilter} from parcel. * * @hide */ public static final Creator<ScanFilter> CREATOR = new Creator<ScanFilter>() { Loading