Merge "LE: Register for service change indication" into lmp-mr1-dev
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);
diff --git a/include/bt_target.h b/include/bt_target.h
index 44842cd..66b5f98 100644
--- a/include/bt_target.h
+++ b/include/bt_target.h
@@ -1457,7 +1457,7 @@
 #endif
 
 #ifndef SMP_DEBUG
-#define SMP_DEBUG            TRUE
+#define SMP_DEBUG            FALSE
 #endif
 
 #ifndef SMP_DEFAULT_AUTH_REQ
diff --git a/stack/smp/smp_keys.c b/stack/smp/smp_keys.c
index 891d7f8..31313c9 100644
--- a/stack/smp/smp_keys.c
+++ b/stack/smp/smp_keys.c
@@ -81,7 +81,7 @@
     {
         x += sprintf ((char *)&p_buf[x], "%02x ", p[i]);
     }
-    SMP_TRACE_WARNING("%s(LSB ~ MSB) = %s", key_name, p_buf);
+    SMP_TRACE_DEBUG("%s(LSB ~ MSB) = %s", key_name, p_buf);
 }
     #else
         #define smp_debug_print_nbyte_little_endian(p, key_name, len)
@@ -194,7 +194,6 @@
     /* truncate by maximum value */
     while (passkey > BTM_MAX_PASSKEY_VAL)
         passkey >>= 1;
-    SMP_TRACE_ERROR("Passkey generated = %d", passkey);
 
     /* save the TK */
     memset(p_cb->tk, 0, BT_OCTET16_LEN);