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

Commit 73b627e5 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Automerger Merge Worker
Browse files

Merge "bta: Fix using stored db to save reconnection time" am: 6dbe8634

parents 81a2062c 6dbe8634
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -547,6 +547,9 @@ void bta_gattc_conn(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) {
      LOG_INFO("Connected to %s, robust caching support is %d",
               p_clcb->bda.ToRedactedStringForLogging().c_str(),
               robust_caching_support);

      if (!db.IsEmpty()) p_clcb->p_srcb->gatt_database = db;

      if (db.IsEmpty() ||
          robust_caching_support == RobustCachingSupport::SUPPORTED) {
        // If the peer device is expected to support robust caching, or if we
@@ -563,7 +566,6 @@ void bta_gattc_conn(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) {
        /* cache load failure, start discovery */
        bta_gattc_start_discover(p_clcb, NULL);
      } else {
        p_clcb->p_srcb->gatt_database = db;
        p_clcb->p_srcb->state = BTA_GATTC_SERV_IDLE;
        bta_gattc_reset_discover_st(p_clcb->p_srcb, GATT_SUCCESS);
      }