Merge cherrypicks of [4658485, 4658486, 4658487, 4657188, 4657275, 4659124, 4659125, 4659141, 4659142, 4659143, 4657276, 4657814, 4658660, 4657277, 4657815, 4657278, 4659144, 4658126, 4658127, 4658128, 4658129, 4658130, 4658131, 4658132, 4658133, 4658134, 4658135, 4658136, 4658137, 4658138, 4659161, 4659162, 4659163, 4659164, 4659145, 4659146, 4659147, 4659148, 4657655, 4657656, 4658139, 4658140, 4659181, 4659182, 4659183, 4657130, 4657131, 4657132, 4657133, 4659165, 4659166, 4659167, 4657657, 4657279, 4659149] into pi-dr1-release

Change-Id: If984637d09b0ba348d16e068c4a37be0d693059a
diff --git a/btif/src/btif_dm.cc b/btif/src/btif_dm.cc
index d1bb61c..dd9b813 100644
--- a/btif/src/btif_dm.cc
+++ b/btif/src/btif_dm.cc
@@ -1395,10 +1395,15 @@
       if ((p_data->disc_res.result != BTA_SUCCESS) &&
           (pairing_cb.state == BT_BOND_STATE_BONDING) &&
           (pairing_cb.sdp_attempts < BTIF_DM_MAX_SDP_ATTEMPTS_AFTER_PAIRING)) {
-        BTIF_TRACE_WARNING("%s:SDP failed after bonding re-attempting",
-                           __func__);
-        pairing_cb.sdp_attempts++;
-        btif_dm_get_remote_services(bd_addr);
+        if (pairing_cb.sdp_attempts) {
+          BTIF_TRACE_WARNING("%s: SDP failed after bonding re-attempting",
+                             __func__);
+          pairing_cb.sdp_attempts++;
+          btif_dm_get_remote_services(bd_addr);
+        } else {
+          BTIF_TRACE_WARNING("%s: SDP triggered by someone failed when bonding",
+                             __func__);
+        }
         return;
       }
       prop.type = BT_PROPERTY_UUIDS;