Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -6140,6 +6140,7 @@ package android.bluetooth { ctor public BluetoothLeAdvertiseScanData(); field public static final int ADVERTISING_DATA = 0; // 0x0 field public static final int PARSED_SCAN_RECORD = 2; // 0x2 field public static final int SCAN_RESPONSE_DATA = 1; // 0x1 } public static abstract class BluetoothLeAdvertiseScanData.AdvertiseBaseData { Loading Loading @@ -6183,6 +6184,7 @@ package android.bluetooth { public class BluetoothLeAdvertiser { method public void startAdvertising(android.bluetooth.BluetoothLeAdvertiser.Settings, android.bluetooth.BluetoothLeAdvertiseScanData.AdvertisementData, android.bluetooth.BluetoothLeAdvertiser.AdvertiseCallback); method public void startAdvertising(android.bluetooth.BluetoothLeAdvertiser.Settings, android.bluetooth.BluetoothLeAdvertiseScanData.AdvertisementData, android.bluetooth.BluetoothLeAdvertiseScanData.AdvertisementData, android.bluetooth.BluetoothLeAdvertiser.AdvertiseCallback); method public void stopAdvertising(android.bluetooth.BluetoothLeAdvertiser.Settings, android.bluetooth.BluetoothLeAdvertiser.AdvertiseCallback); } core/java/android/bluetooth/BluetoothLeAdvertiseScanData.java +0 −3 Original line number Diff line number Diff line Loading @@ -53,9 +53,6 @@ public final class BluetoothLeAdvertiseScanData { * Bluetooth LE scan response data, the data will be placed in ScanRspData field of advertising * packet. * <p> * TODO: unhide when stack supports setting scan response data. * * @hide */ public static final int SCAN_RESPONSE_DATA = 1; /** Loading core/java/android/bluetooth/BluetoothLeAdvertiser.java +19 −4 Original line number Diff line number Diff line Loading @@ -328,6 +328,7 @@ public class BluetoothLeAdvertiser { private static final int LE_CALLBACK_TIMEOUT_MILLIS = 2000; private final AdvertiseCallback mAdvertiseCallback; private final AdvertisementData mAdvertisement; private final AdvertisementData mScanResponse; private final Settings mSettings; private final IBluetoothGatt mBluetoothGatt; Loading @@ -338,10 +339,11 @@ public class BluetoothLeAdvertiser { private boolean isAdvertising = false; public AdvertiseCallbackWrapper(AdvertiseCallback advertiseCallback, AdvertisementData advertiseData, Settings settings, AdvertisementData advertiseData, AdvertisementData scanResponse, Settings settings, IBluetoothGatt bluetoothGatt) { mAdvertiseCallback = advertiseCallback; mAdvertisement = advertiseData; mScanResponse = scanResponse; mSettings = settings; mBluetoothGatt = bluetoothGatt; mLeHandle = 0; Loading Loading @@ -384,7 +386,8 @@ public class BluetoothLeAdvertiser { if (status == BluetoothGatt.GATT_SUCCESS) { mLeHandle = clientIf; try { mBluetoothGatt.startMultiAdvertising(mLeHandle, mAdvertisement, mSettings); mBluetoothGatt.startMultiAdvertising(mLeHandle, mAdvertisement, mScanResponse, mSettings); } catch (RemoteException e) { Log.e(TAG, "fail to start le advertise: " + e); mLeHandle = -1; Loading Loading @@ -540,6 +543,19 @@ public class BluetoothLeAdvertiser { */ public void startAdvertising(Settings settings, AdvertisementData advertiseData, final AdvertiseCallback callback) { startAdvertising(settings, advertiseData, null, callback); } /** * Start Bluetooth LE Advertising. * @param settings {@link Settings} for Bluetooth LE advertising. * @param advertiseData {@link AdvertisementData} to be advertised in advertisement packet. * @param scanResponse {@link AdvertisementData} for scan response. * @param callback {@link AdvertiseCallback} for advertising status. */ public void startAdvertising(Settings settings, AdvertisementData advertiseData, AdvertisementData scanResponse, final AdvertiseCallback callback) { if (callback == null) { throw new IllegalArgumentException("callback cannot be null"); } Loading @@ -548,8 +564,7 @@ public class BluetoothLeAdvertiser { return; } AdvertiseCallbackWrapper wrapper = new AdvertiseCallbackWrapper(callback, advertiseData, settings, mBluetoothGatt); scanResponse, settings, mBluetoothGatt); UUID uuid = UUID.randomUUID(); try { mBluetoothGatt.registerClient(new ParcelUuid(uuid), wrapper); Loading core/java/android/bluetooth/IBluetoothGatt.aidl +3 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,9 @@ interface IBluetoothGatt { in BluetoothLeScanner.Settings settings, in List<BluetoothLeScanFilter> filters); void stopScan(in int appIf, in boolean isServer); void startMultiAdvertising(in int appIf, in BluetoothLeAdvertiseScanData.AdvertisementData data, void startMultiAdvertising(in int appIf, in BluetoothLeAdvertiseScanData.AdvertisementData advertiseData, in BluetoothLeAdvertiseScanData.AdvertisementData scanResponse, in BluetoothLeAdvertiser.Settings settings); void stopMultiAdvertising(in int appIf); void registerClient(in ParcelUuid appId, in IBluetoothGattCallback callback); Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -6140,6 +6140,7 @@ package android.bluetooth { ctor public BluetoothLeAdvertiseScanData(); field public static final int ADVERTISING_DATA = 0; // 0x0 field public static final int PARSED_SCAN_RECORD = 2; // 0x2 field public static final int SCAN_RESPONSE_DATA = 1; // 0x1 } public static abstract class BluetoothLeAdvertiseScanData.AdvertiseBaseData { Loading Loading @@ -6183,6 +6184,7 @@ package android.bluetooth { public class BluetoothLeAdvertiser { method public void startAdvertising(android.bluetooth.BluetoothLeAdvertiser.Settings, android.bluetooth.BluetoothLeAdvertiseScanData.AdvertisementData, android.bluetooth.BluetoothLeAdvertiser.AdvertiseCallback); method public void startAdvertising(android.bluetooth.BluetoothLeAdvertiser.Settings, android.bluetooth.BluetoothLeAdvertiseScanData.AdvertisementData, android.bluetooth.BluetoothLeAdvertiseScanData.AdvertisementData, android.bluetooth.BluetoothLeAdvertiser.AdvertiseCallback); method public void stopAdvertising(android.bluetooth.BluetoothLeAdvertiser.Settings, android.bluetooth.BluetoothLeAdvertiser.AdvertiseCallback); }
core/java/android/bluetooth/BluetoothLeAdvertiseScanData.java +0 −3 Original line number Diff line number Diff line Loading @@ -53,9 +53,6 @@ public final class BluetoothLeAdvertiseScanData { * Bluetooth LE scan response data, the data will be placed in ScanRspData field of advertising * packet. * <p> * TODO: unhide when stack supports setting scan response data. * * @hide */ public static final int SCAN_RESPONSE_DATA = 1; /** Loading
core/java/android/bluetooth/BluetoothLeAdvertiser.java +19 −4 Original line number Diff line number Diff line Loading @@ -328,6 +328,7 @@ public class BluetoothLeAdvertiser { private static final int LE_CALLBACK_TIMEOUT_MILLIS = 2000; private final AdvertiseCallback mAdvertiseCallback; private final AdvertisementData mAdvertisement; private final AdvertisementData mScanResponse; private final Settings mSettings; private final IBluetoothGatt mBluetoothGatt; Loading @@ -338,10 +339,11 @@ public class BluetoothLeAdvertiser { private boolean isAdvertising = false; public AdvertiseCallbackWrapper(AdvertiseCallback advertiseCallback, AdvertisementData advertiseData, Settings settings, AdvertisementData advertiseData, AdvertisementData scanResponse, Settings settings, IBluetoothGatt bluetoothGatt) { mAdvertiseCallback = advertiseCallback; mAdvertisement = advertiseData; mScanResponse = scanResponse; mSettings = settings; mBluetoothGatt = bluetoothGatt; mLeHandle = 0; Loading Loading @@ -384,7 +386,8 @@ public class BluetoothLeAdvertiser { if (status == BluetoothGatt.GATT_SUCCESS) { mLeHandle = clientIf; try { mBluetoothGatt.startMultiAdvertising(mLeHandle, mAdvertisement, mSettings); mBluetoothGatt.startMultiAdvertising(mLeHandle, mAdvertisement, mScanResponse, mSettings); } catch (RemoteException e) { Log.e(TAG, "fail to start le advertise: " + e); mLeHandle = -1; Loading Loading @@ -540,6 +543,19 @@ public class BluetoothLeAdvertiser { */ public void startAdvertising(Settings settings, AdvertisementData advertiseData, final AdvertiseCallback callback) { startAdvertising(settings, advertiseData, null, callback); } /** * Start Bluetooth LE Advertising. * @param settings {@link Settings} for Bluetooth LE advertising. * @param advertiseData {@link AdvertisementData} to be advertised in advertisement packet. * @param scanResponse {@link AdvertisementData} for scan response. * @param callback {@link AdvertiseCallback} for advertising status. */ public void startAdvertising(Settings settings, AdvertisementData advertiseData, AdvertisementData scanResponse, final AdvertiseCallback callback) { if (callback == null) { throw new IllegalArgumentException("callback cannot be null"); } Loading @@ -548,8 +564,7 @@ public class BluetoothLeAdvertiser { return; } AdvertiseCallbackWrapper wrapper = new AdvertiseCallbackWrapper(callback, advertiseData, settings, mBluetoothGatt); scanResponse, settings, mBluetoothGatt); UUID uuid = UUID.randomUUID(); try { mBluetoothGatt.registerClient(new ParcelUuid(uuid), wrapper); Loading
core/java/android/bluetooth/IBluetoothGatt.aidl +3 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,9 @@ interface IBluetoothGatt { in BluetoothLeScanner.Settings settings, in List<BluetoothLeScanFilter> filters); void stopScan(in int appIf, in boolean isServer); void startMultiAdvertising(in int appIf, in BluetoothLeAdvertiseScanData.AdvertisementData data, void startMultiAdvertising(in int appIf, in BluetoothLeAdvertiseScanData.AdvertisementData advertiseData, in BluetoothLeAdvertiseScanData.AdvertisementData scanResponse, in BluetoothLeAdvertiser.Settings settings); void stopMultiAdvertising(in int appIf); void registerClient(in ParcelUuid appId, in IBluetoothGattCallback callback); Loading