diff options
| author | 2015-04-24 14:06:00 -0700 | |
|---|---|---|
| committer | 2015-04-24 14:06:00 -0700 | |
| commit | b271d27dbc0c1cec0c2bb0dff9390dc91842e3ee (patch) | |
| tree | 9e13a449230b795a7c351b7abca6f7370efeb161 | |
| parent | f9465fb6d215358233edc7679918aadf3d6e5b48 (diff) | |
| parent | db1dbb889588505cd340e954acbde7ebf7c086d6 (diff) | |
Merge commit 'db1dbb8' into merge2
6 files changed, 22 insertions, 3 deletions
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index c124a18d23a1..515be038d3a9 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -1307,9 +1307,12 @@ public final class BluetoothAdapter { public boolean isHardwareTrackingFiltersAvailable() { if (getState() != STATE_ON) return false; try { - synchronized(mManagerCallback) { - if(mService != null) return (mService.numOfHwTrackFiltersAvailable() != 0); + IBluetoothGatt iGatt = mManagerService.getBluetoothGatt(); + if (iGatt == null) { + // BLE is not supported + return false; } + return (iGatt.numHwTrackFiltersAvailable() != 0); } catch (RemoteException e) { Log.e(TAG, "", e); } diff --git a/core/java/android/bluetooth/BluetoothGattCallbackWrapper.java b/core/java/android/bluetooth/BluetoothGattCallbackWrapper.java index cdb24f40e2de..01778b3dc40e 100644 --- a/core/java/android/bluetooth/BluetoothGattCallbackWrapper.java +++ b/core/java/android/bluetooth/BluetoothGattCallbackWrapper.java @@ -123,4 +123,7 @@ public class BluetoothGattCallbackWrapper extends IBluetoothGattCallback.Stub { public void onFoundOrLost(boolean onFound, ScanResult scanResult) throws RemoteException { } + @Override + public void onScanManagerErrorCallback(int errorCode) throws RemoteException { + } } diff --git a/core/java/android/bluetooth/IBluetooth.aidl b/core/java/android/bluetooth/IBluetooth.aidl index f6001bfffedd..a3eceb5efd9d 100644 --- a/core/java/android/bluetooth/IBluetooth.aidl +++ b/core/java/android/bluetooth/IBluetooth.aidl @@ -100,7 +100,6 @@ interface IBluetooth boolean isActivityAndEnergyReportingSupported(); void getActivityEnergyInfoFromController(); BluetoothActivityEnergyInfo reportActivityInfo(); - int numOfHwTrackFiltersAvailable(); // for dumpsys support String dump(); diff --git a/core/java/android/bluetooth/IBluetoothGatt.aidl b/core/java/android/bluetooth/IBluetoothGatt.aidl index 4ca57f8eccab..72abeaf699c1 100644 --- a/core/java/android/bluetooth/IBluetoothGatt.aidl +++ b/core/java/android/bluetooth/IBluetoothGatt.aidl @@ -103,4 +103,5 @@ interface IBluetoothGatt { in boolean confirm, in byte[] value); void disconnectAll(); void unregAll(); + int numHwTrackFiltersAvailable(); } diff --git a/core/java/android/bluetooth/IBluetoothGattCallback.aidl b/core/java/android/bluetooth/IBluetoothGattCallback.aidl index 91e62ea65c73..cbba9f021423 100644 --- a/core/java/android/bluetooth/IBluetoothGattCallback.aidl +++ b/core/java/android/bluetooth/IBluetoothGattCallback.aidl @@ -67,6 +67,7 @@ oneway interface IBluetoothGattCallback { void onReadRemoteRssi(in String address, in int rssi, in int status); void onMultiAdvertiseCallback(in int status, boolean isStart, in AdvertiseSettings advertiseSettings); + void onScanManagerErrorCallback(in int errorCode); void onConfigureMTU(in String address, in int mtu, in int status); void onFoundOrLost(in boolean onFound, in ScanResult scanResult); } diff --git a/core/java/android/bluetooth/le/BluetoothLeScanner.java b/core/java/android/bluetooth/le/BluetoothLeScanner.java index 307895129120..687bd5db099e 100644 --- a/core/java/android/bluetooth/le/BluetoothLeScanner.java +++ b/core/java/android/bluetooth/le/BluetoothLeScanner.java @@ -381,6 +381,18 @@ public final class BluetoothLeScanner { } }); } + + @Override + public void onScanManagerErrorCallback(final int errorCode) { + if (VDBG) { + Log.d(TAG, "onScanManagerErrorCallback() - errorCode = " + errorCode); + } + synchronized (this) { + if (mClientIf <= 0) + return; + } + postCallbackError(mScanCallback, errorCode); + } } private void postCallbackError(final ScanCallback callback, final int errorCode) { |