Merge commit 'db1dbb8' into merge2

This commit is contained in:
Etan Cohen
2015-04-24 14:06:00 -07:00
6 changed files with 22 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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 {
}
}

View File

@@ -100,7 +100,6 @@ interface IBluetooth
boolean isActivityAndEnergyReportingSupported();
void getActivityEnergyInfoFromController();
BluetoothActivityEnergyInfo reportActivityInfo();
int numOfHwTrackFiltersAvailable();
// for dumpsys support
String dump();

View File

@@ -103,4 +103,5 @@ interface IBluetoothGatt {
in boolean confirm, in byte[] value);
void disconnectAll();
void unregAll();
int numHwTrackFiltersAvailable();
}

View File

@@ -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);
}

View File

@@ -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) {