Loading framework/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 framework/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); } } } framework/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 framework/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 framework/java/android/bluetooth/le/ScanResult.java +0 −3 Original line number Diff line number Diff line Loading @@ -149,9 +149,6 @@ public final class ScanResult implements Parcelable { + mTimestampNanos + '}'; } /** * @hide */ public static final Parcelable.Creator<ScanResult> CREATOR = new Creator<ScanResult>() { @Override public ScanResult createFromParcel(Parcel source) { Loading Loading
framework/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
framework/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); } } }
framework/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
framework/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
framework/java/android/bluetooth/le/ScanResult.java +0 −3 Original line number Diff line number Diff line Loading @@ -149,9 +149,6 @@ public final class ScanResult implements Parcelable { + mTimestampNanos + '}'; } /** * @hide */ public static final Parcelable.Creator<ScanResult> CREATOR = new Creator<ScanResult>() { @Override public ScanResult createFromParcel(Parcel source) { Loading