When a set of GATT services of a bonded device is cached locally,
an application needs to call BluetoothGatt.refresh() to clear it out
and to trigger a new service discovery. By disabling local caching,
a service discovery is performed on every connection and that prevents
an application from getting staled GATT services.
bug:
68954828
Change-Id: I2c07404c3d56a5c8a0ffc86bc65d36480f3c46f2
*******************************************************************************/
bool bta_gattc_cache_load(tBTA_GATTC_CLCB *p_clcb)
{
+
+#if (defined WEAR_DISABLE_GATT_CACHE && WEAR_DISABLE_GATT_CACHE == TRUE)
+ LOG_WARN(LOG_TAG, "%s GATT cache not used.", __func__);
+ return false;
+#endif
+
char fname[255] = {0};
bta_gattc_generate_cache_file_name(fname, p_clcb->p_srcb->server_bda);
#define WEAR_AUTO_CONN_IDLE_INTERVAL_1_25_MS 72
#endif
+/*
+ * Disable the use of local GATT cache. This forces service discovery on connection
+ * establishment.
+ */
+#ifndef WEAR_DISABLE_GATT_CACHE
+#define WEAR_DISABLE_GATT_CACHE TRUE
+#endif
+
#endif /* BT_TARGET_H */