Loading android/app/src/com/android/bluetooth/gatt/GattService.java +9 −6 Original line number Diff line number Diff line Loading @@ -940,13 +940,14 @@ public class GattService extends ProfileService { } @Override public void sendNotification(int serverIf, String address, int handle, boolean confirm, public int sendNotification(int serverIf, String address, int handle, boolean confirm, byte[] value, AttributionSource attributionSource) { GattService service = getService(); if (service == null) { return; return BluetoothStatusCodes.ERROR_PROFILE_SERVICE_NOT_BOUND; } service.sendNotification(serverIf, address, handle, confirm, value, attributionSource); return service.sendNotification(serverIf, address, handle, confirm, value, attributionSource); } @Override Loading Loading @@ -3669,11 +3670,11 @@ public class GattService extends ProfileService { } @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) void sendNotification(int serverIf, String address, int handle, boolean confirm, byte[] value, int sendNotification(int serverIf, String address, int handle, boolean confirm, byte[] value, AttributionSource attributionSource) { if (!Utils.checkConnectPermissionForDataDelivery( this, attributionSource, "GattService sendNotification")) { return; return BluetoothStatusCodes.ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION; } if (VDBG) { Loading @@ -3682,7 +3683,7 @@ public class GattService extends ProfileService { Integer connId = mServerMap.connIdByAddress(serverIf, address); if (connId == null || connId == 0) { return; return BluetoothStatusCodes.ERROR_DEVICE_NOT_CONNECTED; } if (confirm) { Loading @@ -3690,6 +3691,8 @@ public class GattService extends ProfileService { } else { gattServerSendNotificationNative(serverIf, handle, connId, value); } return BluetoothStatusCodes.SUCCESS; } Loading system/binder/android/bluetooth/IBluetoothGatt.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ interface IBluetoothGatt { void sendResponse(in int serverIf, in String address, in int requestId, in int status, in int offset, in byte[] value, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") void sendNotification(in int serverIf, in String address, in int handle, int sendNotification(in int serverIf, in String address, in int handle, in boolean confirm, in byte[] value, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") void disconnectAll(in AttributionSource attributionSource); Loading Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +9 −6 Original line number Diff line number Diff line Loading @@ -940,13 +940,14 @@ public class GattService extends ProfileService { } @Override public void sendNotification(int serverIf, String address, int handle, boolean confirm, public int sendNotification(int serverIf, String address, int handle, boolean confirm, byte[] value, AttributionSource attributionSource) { GattService service = getService(); if (service == null) { return; return BluetoothStatusCodes.ERROR_PROFILE_SERVICE_NOT_BOUND; } service.sendNotification(serverIf, address, handle, confirm, value, attributionSource); return service.sendNotification(serverIf, address, handle, confirm, value, attributionSource); } @Override Loading Loading @@ -3669,11 +3670,11 @@ public class GattService extends ProfileService { } @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) void sendNotification(int serverIf, String address, int handle, boolean confirm, byte[] value, int sendNotification(int serverIf, String address, int handle, boolean confirm, byte[] value, AttributionSource attributionSource) { if (!Utils.checkConnectPermissionForDataDelivery( this, attributionSource, "GattService sendNotification")) { return; return BluetoothStatusCodes.ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION; } if (VDBG) { Loading @@ -3682,7 +3683,7 @@ public class GattService extends ProfileService { Integer connId = mServerMap.connIdByAddress(serverIf, address); if (connId == null || connId == 0) { return; return BluetoothStatusCodes.ERROR_DEVICE_NOT_CONNECTED; } if (confirm) { Loading @@ -3690,6 +3691,8 @@ public class GattService extends ProfileService { } else { gattServerSendNotificationNative(serverIf, handle, connId, value); } return BluetoothStatusCodes.SUCCESS; } Loading
system/binder/android/bluetooth/IBluetoothGatt.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ interface IBluetoothGatt { void sendResponse(in int serverIf, in String address, in int requestId, in int status, in int offset, in byte[] value, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") void sendNotification(in int serverIf, in String address, in int handle, int sendNotification(in int serverIf, in String address, in int handle, in boolean confirm, in byte[] value, in AttributionSource attributionSource); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") void disconnectAll(in AttributionSource attributionSource); Loading