Loading core/java/android/bluetooth/BluetoothGatt.java +25 −1 Original line number Original line Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.bluetooth; package android.bluetooth; import android.content.Context; import android.os.Handler; import android.os.Handler; import android.os.ParcelUuid; import android.os.ParcelUuid; import android.os.RemoteException; import android.os.RemoteException; Loading Loading @@ -926,6 +925,31 @@ public final class BluetoothGatt implements BluetoothProfile { return true; return true; } } /** * Discovers a service by UUID. This is exposed only for passing PTS tests. * It should never be used by real applications. The service is not searched * for characteristics and descriptors, or returned in any callback. * * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @return true, if the remote service discovery has been started * @hide */ public boolean discoverServiceByUuid(UUID uuid) { if (DBG) Log.d(TAG, "discoverServiceByUuid() - device: " + mDevice.getAddress()); if (mService == null || mClientIf == 0) return false; mServices.clear(); try { mService.discoverServiceByUuid(mClientIf, mDevice.getAddress(), new ParcelUuid(uuid)); } catch (RemoteException e) { Log.e(TAG, "", e); return false; } return true; } /** /** * Returns a list of GATT services offered by the remote device. * Returns a list of GATT services offered by the remote device. * * Loading core/java/android/bluetooth/IBluetoothGatt.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -80,6 +80,7 @@ interface IBluetoothGatt { void clientReadPhy(in int clientIf, in String address); void clientReadPhy(in int clientIf, in String address); void refreshDevice(in int clientIf, in String address); void refreshDevice(in int clientIf, in String address); void discoverServices(in int clientIf, in String address); void discoverServices(in int clientIf, in String address); void discoverServiceByUuid(in int clientIf, in String address, in ParcelUuid uuid); void readCharacteristic(in int clientIf, in String address, in int handle, in int authReq); void readCharacteristic(in int clientIf, in String address, in int handle, in int authReq); void readUsingCharacteristicUuid(in int clientIf, in String address, in ParcelUuid uuid, void readUsingCharacteristicUuid(in int clientIf, in String address, in ParcelUuid uuid, in int startHandle, in int endHandle, in int authReq); in int startHandle, in int endHandle, in int authReq); Loading Loading
core/java/android/bluetooth/BluetoothGatt.java +25 −1 Original line number Original line Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.bluetooth; package android.bluetooth; import android.content.Context; import android.os.Handler; import android.os.Handler; import android.os.ParcelUuid; import android.os.ParcelUuid; import android.os.RemoteException; import android.os.RemoteException; Loading Loading @@ -926,6 +925,31 @@ public final class BluetoothGatt implements BluetoothProfile { return true; return true; } } /** * Discovers a service by UUID. This is exposed only for passing PTS tests. * It should never be used by real applications. The service is not searched * for characteristics and descriptors, or returned in any callback. * * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @return true, if the remote service discovery has been started * @hide */ public boolean discoverServiceByUuid(UUID uuid) { if (DBG) Log.d(TAG, "discoverServiceByUuid() - device: " + mDevice.getAddress()); if (mService == null || mClientIf == 0) return false; mServices.clear(); try { mService.discoverServiceByUuid(mClientIf, mDevice.getAddress(), new ParcelUuid(uuid)); } catch (RemoteException e) { Log.e(TAG, "", e); return false; } return true; } /** /** * Returns a list of GATT services offered by the remote device. * Returns a list of GATT services offered by the remote device. * * Loading
core/java/android/bluetooth/IBluetoothGatt.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -80,6 +80,7 @@ interface IBluetoothGatt { void clientReadPhy(in int clientIf, in String address); void clientReadPhy(in int clientIf, in String address); void refreshDevice(in int clientIf, in String address); void refreshDevice(in int clientIf, in String address); void discoverServices(in int clientIf, in String address); void discoverServices(in int clientIf, in String address); void discoverServiceByUuid(in int clientIf, in String address, in ParcelUuid uuid); void readCharacteristic(in int clientIf, in String address, in int handle, in int authReq); void readCharacteristic(in int clientIf, in String address, in int handle, in int authReq); void readUsingCharacteristicUuid(in int clientIf, in String address, in ParcelUuid uuid, void readUsingCharacteristicUuid(in int clientIf, in String address, in ParcelUuid uuid, in int startHandle, in int endHandle, in int authReq); in int startHandle, in int endHandle, in int authReq); Loading