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
diff --git a/btif/co/bta_gattc_co.c b/btif/co/bta_gattc_co.c
index 8541aa3..5ed7f8f 100644
--- a/btif/co/bta_gattc_co.c
+++ b/btif/co/bta_gattc_co.c
@@ -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 @@
 {
     /* 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);