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

Commit c6333f1b authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

LE: Ignore non-volatile GATT service cache for non-bonded devices

If a device is not bonded, the non-volatile GATT service cache should
not be used. Only bonded devices have the capability to invalidate the
cache using the service changed indication.

Bug: 18571592
Change-Id: Ia75aa14f1c862a18237e78d24b63c22cf1dc82a8
parent e918c92e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include "bta_gattc_co.h"
#include "bta_gattc_ci.h"
#include "btif_util.h"
#include "btm_int.h"

#if( defined BLE_INCLUDED ) && (BLE_INCLUDED == TRUE)
#if( defined BTA_GATT_INCLUDED ) && (BTA_GATT_INCLUDED == TRUE)
@@ -86,7 +87,7 @@ void bta_gattc_co_cache_open(BD_ADDR server_bda, UINT16 evt, UINT16 conn_id, BOO
{
    /* open NV cache and send call in */
    tBTA_GATT_STATUS    status = BTA_GATT_OK;
    if (!cacheOpen(server_bda, to_save))
    if (!btm_sec_is_a_bonded_dev(server_bda) || !cacheOpen(server_bda, to_save))
        status = BTA_GATT_ERROR;

    BTIF_TRACE_DEBUG("%s() - status=%d", __FUNCTION__, status);