Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 318a22f8 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Robust caching: read database hash on devices with unknown state.

Currently, we would not set the srvc_hdl_db_hash, and would always
trigger full service discovery on such device.
This doesn't match the spec, or the comment just below the if statement.

Bug: 293249869
Test: Bond with a set of devices, where both of them have same GATT
database hash. Verify service discovery is triggered only once in snoop
log.

Test: 1. Connect to device that supports robust caching.
      2. Disconnect.
      3. Connect again to same device, it might roatate it's address in
	 meantime
      4. Verify full GATT database discovery was done only onece, on 2nd
	 connection we read DB hash first.
Change-Id: Icd30ab6157bb411325d64176777ff949203a1985
parent 3625a1ce
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -552,7 +552,7 @@ void bta_gattc_conn(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) {
      if (!db.IsEmpty()) p_clcb->p_srcb->gatt_database = db;

      if (db.IsEmpty() ||
          robust_caching_support == RobustCachingSupport::SUPPORTED) {
          robust_caching_support != RobustCachingSupport::UNSUPPORTED) {
        // If the peer device is expected to support robust caching, or if we
        // don't know its services yet, then we should do discovery (which may
        // short-circuit through a hash match, but might also do the full