From a5703d66d94d3f0f1796658276f012ad42caf726 Mon Sep 17 00:00:00 2001 From: Grzegorz Kolodziejczyk Date: Mon, 12 May 2014 16:38:13 +0200 Subject: [PATCH] android/gatt: Refresh device cache on disconnect if not bonded This adds refreshing of device cache in case if device is not bonded. It affects on TC_GAD_CL_BV_01_C, TC_GAD_CL_BV_02_C and search services PTS test cases. With this patch those PTS tests cases pass. --- android/gatt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/gatt.c b/android/gatt.c index ad89233d6..ebda37775 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -571,6 +571,10 @@ static void connection_cleanup(struct gatt_device *device) bt_le_discovery_stop(NULL); } + /* If device is not bonded service cache should be refreshed */ + if (!bt_device_is_bonded(&device->bdaddr)) + queue_remove_all(device->services, NULL, NULL, destroy_service); + device_set_state(device, DEVICE_DISCONNECTED); } -- 2.47.3