summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndre Eisenbach <eisenbach@google.com>2014-11-26 12:57:58 -0800
committerAndre Eisenbach <eisenbach@google.com>2014-11-26 12:57:58 -0800
commite632e4bb8c873f102cac7d6f39585ea06f34c082 (patch)
tree16e23949b2d284a116a2c04ad8ff1d9595ce6f5f /src
parent317f4e8911fee285fb313db47529a898e60f4da0 (diff)
downloadandroid_packages_apps_Bluetooth-e632e4bb8c873f102cac7d6f39585ea06f34c082.tar.gz
android_packages_apps_Bluetooth-e632e4bb8c873f102cac7d6f39585ea06f34c082.tar.bz2
android_packages_apps_Bluetooth-e632e4bb8c873f102cac7d6f39585ea06f34c082.zip
Add server-side callback for change in MTU (3/4)
When a client requests to update the LE transport MTU, the server currently does not get notified and can therefor not properly size notifications appropriate to the current MTU. Bug: 18388114 Change-Id: Ie075871cbc643bd3840e9ab472706f1565b74467
Diffstat (limited to 'src')
-rw-r--r--src/com/android/bluetooth/gatt/GattService.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/com/android/bluetooth/gatt/GattService.java b/src/com/android/bluetooth/gatt/GattService.java
index f67daf8a6..915d81ce7 100644
--- a/src/com/android/bluetooth/gatt/GattService.java
+++ b/src/com/android/bluetooth/gatt/GattService.java
@@ -1688,9 +1688,6 @@ public class GattService extends ProfileService {
HandleMap.Entry entry = mHandleMap.getByHandle(attrHandle);
if (entry == null) return;
- if (DBG) Log.d(TAG, "onAttributeRead() UUID=" + entry.uuid
- + ", serverIf=" + entry.serverIf + ", type=" + entry.type);
-
mHandleMap.addRequest(transId, attrHandle);
ServerMap.App app = mServerMap.getById(entry.serverIf);
@@ -1738,9 +1735,6 @@ public class GattService extends ProfileService {
HandleMap.Entry entry = mHandleMap.getByHandle(attrHandle);
if (entry == null) return;
- if (DBG) Log.d(TAG, "onAttributeWrite() UUID=" + entry.uuid
- + ", serverIf=" + entry.serverIf + ", type=" + entry.type);
-
mHandleMap.addRequest(transId, attrHandle);
ServerMap.App app = mServerMap.getById(entry.serverIf);
@@ -1793,7 +1787,7 @@ public class GattService extends ProfileService {
}
void onNotificationSent(int connId, int status) throws RemoteException {
- if (DBG) Log.d(TAG, "onNotificationSent() connId=" + connId + ", status=" + status);
+ if (VDBG) Log.d(TAG, "onNotificationSent() connId=" + connId + ", status=" + status);
String address = mServerMap.addressByConnId(connId);
if (address == null) return;
@@ -1825,6 +1819,18 @@ public class GattService extends ProfileService {
}
}
+ void onMtuChanged(int connId, int mtu) throws RemoteException {
+ if (DBG) Log.d(TAG, "onMtuChanged() - connId=" + connId + ", mtu=" + mtu);
+
+ String address = mServerMap.addressByConnId(connId);
+ if (address == null) return;
+
+ ServerMap.App app = mServerMap.getByConnId(connId);
+ if (app == null) return;
+
+ app.callback.onMtuChanged(address, mtu);
+ }
+
/**************************************************************************
* GATT Service functions - SERVER
*************************************************************************/