Diff between 1ef6570a70d917585ed654f26b5ee06c54bc3b3e and 39054d59c0ecdb102f8aa352cb7aa6fcbd7f2b6b

Changed Files

File Additions Deletions Status
src/device.c +2 -9 modified
src/gatt-database.c +1 -1 modified

Full Patch

diff --git a/src/device.c b/src/device.c
index fe885aa..af13bad 100644
--- a/src/device.c
+++ b/src/device.c
@@ -5831,18 +5831,11 @@ void device_load_svc_chng_ccc(struct btd_device *device, uint16_t *ccc_le,
 	key_file = g_key_file_new();
 	g_key_file_load_from_file(key_file, filename, 0, NULL);
 
-	/*
-	 * If there is no "ServiceChanged" section we may be loading data from
-	 * old version which did not persist Service Changed CCC values. Let's
-	 * check if we are bonded and assume indications were enabled by peer
-	 * in such case - it should have done this anyway.
-	 */
 	if (!g_key_file_has_group(key_file, "ServiceChanged")) {
 		if (ccc_le)
-			*ccc_le = device->le_state.bonded ? 0x0002 : 0x0000;
+			*ccc_le = 0x0000;
 		if (ccc_bredr)
-			*ccc_bredr = device->bredr_state.bonded ?
-							0x0002 : 0x0000;
+			*ccc_bredr = 0x0000;
 		g_key_file_free(key_file);
 		return;
 	}
diff --git a/src/gatt-database.c b/src/gatt-database.c
index b7d2bea..d996048 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
@@ -333,7 +333,7 @@ static void att_disconnected(int err, void *user_data)
 		handle = gatt_db_attribute_get_handle(state->db->svc_chngd_ccc);
 
 		ccc = find_ccc_state(state, handle);
-		if (ccc)
+		if (ccc && ccc->value)
 			device_store_svc_chng_ccc(device, state->bdaddr_type,
 								ccc->value);