Use unary operator instead of == bool

Automatically generated with coccinelle:

@@
expression e1;
@@

-e1 == false
+!e1

@@
expression e1;
@@

-false == e1
+!e1

@@
expression e1;
@@

-e1 == true
+e1

@@
expression e1;
@@

-true == e1
+e1

Test: build
Change-Id: Ic7df0dc43b550594855e457466b6bccd8f3443a3
diff --git a/system/bta/ag/bta_ag_act.cc b/system/bta/ag/bta_ag_act.cc
index ad40c5d..e818825 100644
--- a/system/bta/ag/bta_ag_act.cc
+++ b/system/bta/ag/bta_ag_act.cc
@@ -406,7 +406,7 @@
   (*bta_ag_cb.p_cback)(BTA_AG_CLOSE_EVT, (tBTA_AG*)&close);
 
   /* if not deregistering (deallocating) reopen registered servers */
-  if (p_scb->dealloc == false) {
+  if (!p_scb->dealloc) {
     /* Clear peer bd_addr so instance can be reused */
     p_scb->peer_addr = RawAddress::kEmpty;
 
diff --git a/system/bta/ag/bta_ag_cmd.cc b/system/bta/ag/bta_ag_cmd.cc
index 79028db..d356468 100644
--- a/system/bta/ag/bta_ag_cmd.cc
+++ b/system/bta/ag/bta_ag_cmd.cc
@@ -321,39 +321,39 @@
   /* Ensure we do not send duplicate indicators if not requested by app */
   /* If it was requested by app, transmit CIEV even if it is duplicate. */
   if (id == BTA_AG_IND_CALL) {
-    if ((value == p_scb->call_ind) && (on_demand == false)) return;
+    if ((value == p_scb->call_ind) && (!on_demand)) return;
 
     p_scb->call_ind = (uint8_t)value;
   }
 
-  if ((id == BTA_AG_IND_CALLSETUP) && (on_demand == false)) {
+  if ((id == BTA_AG_IND_CALLSETUP) && (!on_demand)) {
     if (value == p_scb->callsetup_ind) return;
 
     p_scb->callsetup_ind = (uint8_t)value;
   }
 
-  if ((id == BTA_AG_IND_SERVICE) && (on_demand == false)) {
+  if ((id == BTA_AG_IND_SERVICE) && (!on_demand)) {
     if (value == p_scb->service_ind) return;
 
     p_scb->service_ind = (uint8_t)value;
   }
-  if ((id == BTA_AG_IND_SIGNAL) && (on_demand == false)) {
+  if ((id == BTA_AG_IND_SIGNAL) && (!on_demand)) {
     if (value == p_scb->signal_ind) return;
 
     p_scb->signal_ind = (uint8_t)value;
   }
-  if ((id == BTA_AG_IND_ROAM) && (on_demand == false)) {
+  if ((id == BTA_AG_IND_ROAM) && (!on_demand)) {
     if (value == p_scb->roam_ind) return;
 
     p_scb->roam_ind = (uint8_t)value;
   }
-  if ((id == BTA_AG_IND_BATTCHG) && (on_demand == false)) {
+  if ((id == BTA_AG_IND_BATTCHG) && (!on_demand)) {
     if (value == p_scb->battchg_ind) return;
 
     p_scb->battchg_ind = (uint8_t)value;
   }
 
-  if ((id == BTA_AG_IND_CALLHELD) && (on_demand == false)) {
+  if ((id == BTA_AG_IND_CALLHELD) && (!on_demand)) {
     /* call swap could result in sending callheld=1 multiple times */
     if ((value != 1) && (value == p_scb->callheld_ind)) return;
 
@@ -750,8 +750,7 @@
           p_scb->local_hf_indicators[i].ind_id);
 
       /* Check whether local and peer sides support this indicator */
-      if (p_scb->local_hf_indicators[i].is_supported == true &&
-          peer_index != -1) {
+      if (p_scb->local_hf_indicators[i].is_supported && peer_index != -1) {
         /* In the format of ind, state */
         p += utl_itoa((uint16_t)p_scb->local_hf_indicators[i].ind_id, p);
         *p++ = ',';
@@ -1670,7 +1669,7 @@
         } else {
           APPL_TRACE_DEBUG(
               "%s HF Indicator %d already %s", p_result->data.ind.id,
-              (p_result->data.ind.on_demand == true) ? "Enabled" : "Disabled");
+              (p_result->data.ind.on_demand) ? "Enabled" : "Disabled");
         }
       }
       break;
diff --git a/system/bta/ag/bta_ag_sco.cc b/system/bta/ag/bta_ag_sco.cc
index f118988..2d644c8 100644
--- a/system/bta/ag/bta_ag_sco.cc
+++ b/system/bta/ag/bta_ag_sco.cc
@@ -1209,7 +1209,7 @@
  *
  ******************************************************************************/
 void bta_ag_sco_codec_nego(tBTA_AG_SCB* p_scb, bool result) {
-  if (result == true) {
+  if (result) {
     /* Subsequent SCO connection will skip codec negotiation */
     APPL_TRACE_DEBUG("%s: Succeeded for index 0x%04x", __func__,
                      p_scb->sco_idx);
diff --git a/system/bta/ag/bta_ag_sdp.cc b/system/bta/ag/bta_ag_sdp.cc
index 2bfe145..1b81ffc 100644
--- a/system/bta/ag/bta_ag_sdp.cc
+++ b/system/bta/ag/bta_ag_sdp.cc
@@ -251,7 +251,7 @@
       continue;
     }
 
-    if (p->in_use && p->dealloc == false) {
+    if (p->in_use && !p->dealloc) {
       others |= p->reg_services;
     }
   }
diff --git a/system/bta/av/bta_av_aact.cc b/system/bta/av/bta_av_aact.cc
index 12f8b24..c9a895a 100644
--- a/system/bta/av/bta_av_aact.cc
+++ b/system/bta/av/bta_av_aact.cc
@@ -348,7 +348,7 @@
   /* for outgoing RC connection as INT/CT */
   if ((p_scb->rc_handle == BTA_AV_RC_HANDLE_NONE) &&
       /* (bta_av_cb.features & BTA_AV_FEAT_RCCT) && */
-      (p_scb->use_rc == true || (p_scb->role & BTA_AV_ROLE_AD_ACP))) {
+      (p_scb->use_rc || (p_scb->role & BTA_AV_ROLE_AD_ACP))) {
     if ((p_scb->wait & BTA_AV_WAIT_ROLE_SW_BITS) == 0) {
       bta_sys_start_timer(p_scb->avrc_ct_timer, BTA_AV_RC_DISC_TIME_VAL,
                           BTA_AV_AVRC_TIMER_EVT, p_scb->hndl);
@@ -382,7 +382,7 @@
 
   for (i = p_scb->sep_info_idx; i < p_scb->num_seps; i++) {
     /* steam not in use, is a sink, and is the right media type (audio/video) */
-    if ((p_scb->sep_info[i].in_use == false) &&
+    if ((!p_scb->sep_info[i].in_use) &&
         (p_scb->sep_info[i].tsep == sep_requested) &&
         (p_scb->sep_info[i].media_type == p_scb->media_type)) {
       p_scb->sep_info_idx = i;
@@ -975,7 +975,7 @@
 
   bta_sys_app_open(BTA_ID_AV, p_scb->app_id, p_scb->peer_addr);
 
-  if (p_scb->skip_sdp == true) {
+  if (p_scb->skip_sdp) {
     tA2DP_Service a2dp_ser;
     a2dp_ser.avdt_version = AVDT_VERSION;
     p_scb->skip_sdp = false;
@@ -1569,7 +1569,7 @@
 
   for (i = 0; i < p_scb->num_seps; i++) {
     /* steam not in use, is a sink, and is audio */
-    if ((p_scb->sep_info[i].in_use == false) &&
+    if ((!p_scb->sep_info[i].in_use) &&
         (p_scb->sep_info[i].media_type == p_scb->media_type)) {
       if ((p_scb->sep_info[i].tsep == AVDT_TSEP_SNK) &&
           (uuid_int == UUID_SERVCLASS_AUDIO_SOURCE))
@@ -1748,7 +1748,7 @@
 
   /* check whether there is already an opened audio or video connection with the
    * same device */
-  for (idx = 0; (idx < BTA_AV_NUM_STRS) && (is_av_opened == false); idx++) {
+  for (idx = 0; (idx < BTA_AV_NUM_STRS) && (!is_av_opened); idx++) {
     p_opened_scb = bta_av_cb.p_scb[idx];
     if (p_opened_scb && (p_opened_scb->state == BTA_AV_OPEN_SST) &&
         (p_opened_scb->peer_addr == p_scb->peer_addr))
@@ -1758,7 +1758,7 @@
   /* if there is already an active AV connnection with the same bd_addr,
      don't send disconnect req, just report the open event with
      BTA_AV_FAIL_GET_CAP status */
-  if (is_av_opened == true) {
+  if (is_av_opened) {
     tBTA_AV_OPEN open;
     open.bd_addr = p_scb->peer_addr;
     open.chnl = p_scb->chnl;
@@ -1960,8 +1960,7 @@
 
   bta_sys_clear_policy(BTA_ID_AV, policy, p_scb->peer_addr);
 
-  if ((p_scb->started == false) &&
-      ((p_scb->role & BTA_AV_ROLE_START_INT) == 0)) {
+  if ((!p_scb->started) && ((p_scb->role & BTA_AV_ROLE_START_INT) == 0)) {
     p_scb->role |= BTA_AV_ROLE_START_INT;
     bta_sys_busy(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
 
@@ -2474,7 +2473,7 @@
  *
  ******************************************************************************/
 void bta_av_start_failed(tBTA_AV_SCB* p_scb, UNUSED_ATTR tBTA_AV_DATA* p_data) {
-  if (p_scb->started == false && p_scb->co_started == false) {
+  if (!p_scb->started && !p_scb->co_started) {
     bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
     notify_start_failed(p_scb);
   }
@@ -2580,7 +2579,7 @@
   APPL_TRACE_DEBUG("%s: audio_open_cnt = %d, err_code = %d", __func__,
                    bta_av_cb.audio_open_cnt, err_code);
 
-  if (p_scb->started == false) {
+  if (!p_scb->started) {
     /* handle the condition where there is a collision of SUSPEND req from
      *either side
      ** Second SUSPEND req could be rejected. Do not treat this as a failure
@@ -3021,7 +3020,7 @@
     return;
   }
 
-  if (p_scb->use_rc == true || (p_scb->role & BTA_AV_ROLE_AD_ACP)) {
+  if (p_scb->use_rc || (p_scb->role & BTA_AV_ROLE_AD_ACP)) {
     if (bta_av_cb.disc) {
       /* AVRC discover db is in use */
       if (p_scb->rc_handle == BTA_AV_RC_HANDLE_NONE) {
diff --git a/system/bta/av/bta_av_act.cc b/system/bta/av/bta_av_act.cc
index 4125b6c..365a301 100644
--- a/system/bta/av/bta_av_act.cc
+++ b/system/bta/av/bta_av_act.cc
@@ -155,7 +155,7 @@
   int i;
 
   for (i = 0; i < BTA_AV_NUM_RCB; i++) {
-    if ((p_cb->disabling == true) || (bta_av_cb.rcb[i].shdl != 0))
+    if ((p_cb->disabling) || (bta_av_cb.rcb[i].shdl != 0))
       bta_av_del_rc(&bta_av_cb.rcb[i]);
   }
 }
diff --git a/system/bta/av/bta_av_main.cc b/system/bta/av/bta_av_main.cc
index 0d7c360..5128018 100644
--- a/system/bta/av/bta_av_main.cc
+++ b/system/bta/av/bta_av_main.cc
@@ -938,7 +938,7 @@
     for (i = 0; i < BTA_AV_NUM_STRS; i++) {
       p_scb = bta_av_cb.p_scb[i];
 
-      if (p_scb && p_scb->co_started && (p_scb->sco_suspend == false)) {
+      if (p_scb && p_scb->co_started && (!p_scb->sco_suspend)) {
         APPL_TRACE_DEBUG("suspending scb:%d", i);
         /* scb is used and started, not suspended automatically */
         p_scb->sco_suspend = true;
diff --git a/system/bta/dm/bta_dm_act.cc b/system/bta/dm/bta_dm_act.cc
index 5499c0c..b66b1b5 100644
--- a/system/bta/dm/bta_dm_act.cc
+++ b/system/bta/dm/bta_dm_act.cc
@@ -259,7 +259,7 @@
   tBTA_DM_ENABLE enable_event;
 
   /* if already in use, return an error */
-  if (bta_dm_cb.is_bta_dm_active == true) {
+  if (bta_dm_cb.is_bta_dm_active) {
     APPL_TRACE_WARNING("%s Device already started by another application",
                        __func__);
     memset(&enable_event, 0, sizeof(tBTA_DM_ENABLE));
@@ -1042,7 +1042,7 @@
 void bta_dm_confirm(tBTA_DM_MSG* p_data) {
   tBTM_STATUS res = BTM_NOT_AUTHORIZED;
 
-  if (p_data->confirm.accept == true) res = BTM_SUCCESS;
+  if (p_data->confirm.accept) res = BTM_SUCCESS;
   BTM_ConfirmReqReply(res, p_data->confirm.bd_addr);
 }
 
@@ -1087,7 +1087,7 @@
 void bta_dm_ci_rmt_oob_act(tBTA_DM_MSG* p_data) {
   tBTM_STATUS res = BTM_NOT_AUTHORIZED;
 
-  if (p_data->ci_rmt_oob.accept == true) res = BTM_SUCCESS;
+  if (p_data->ci_rmt_oob.accept) res = BTM_SUCCESS;
   BTM_RemoteOobDataReply(res, p_data->ci_rmt_oob.bd_addr, p_data->ci_rmt_oob.c,
                          p_data->ci_rmt_oob.r);
 }
@@ -2251,7 +2251,7 @@
 
   APPL_TRACE_DEBUG("%s", __func__);
 
-  if (bta_dm_search_cb.cancel_pending == false) {
+  if (!bta_dm_search_cb.cancel_pending) {
     p_msg->inq_cmpl.hdr.event = BTA_DM_INQUIRY_CMPL_EVT;
     p_msg->inq_cmpl.num = ((tBTM_INQUIRY_CMPL*)p_result)->num_resp;
   } else {
@@ -2868,7 +2868,7 @@
       APPL_TRACE_WARNING("[%d]: state:%d, info:x%x, avoid_rs %d", i,
                          p_dev->conn_state, p_dev->info, avoid_roleswitch);
       if ((p_dev->conn_state == BTA_DM_CONNECTED) &&
-          (p_dev->info & BTA_DM_DI_AV_ACTIVE) && (avoid_roleswitch == false)) {
+          (p_dev->info & BTA_DM_DI_AV_ACTIVE) && (!avoid_roleswitch)) {
         /* make master and take away the role switch policy */
         if (BTM_CMD_STARTED == BTM_SwitchRole(p_dev->peer_bdaddr,
                                               HCI_ROLE_MASTER,
@@ -3306,7 +3306,7 @@
 
           if (bta_dm_cb.device_list.peer_device[i].pref_role !=
                   BTA_SLAVE_ROLE_ONLY &&
-              delay_role_switch == false) {
+              !delay_role_switch) {
             BTM_SwitchRole(bta_dm_cb.device_list.peer_device[i].peer_bdaddr,
                            HCI_ROLE_MASTER, NULL);
           } else {
diff --git a/system/bta/gatt/bta_gattc_api.cc b/system/bta/gatt/bta_gattc_api.cc
index 8470a85..2fe9eb4 100644
--- a/system/bta/gatt/bta_gattc_api.cc
+++ b/system/bta/gatt/bta_gattc_api.cc
@@ -57,7 +57,7 @@
  *
  ******************************************************************************/
 void BTA_GATTC_Disable(void) {
-  if (bta_sys_is_register(BTA_ID_GATTC) == false) {
+  if (!bta_sys_is_register(BTA_ID_GATTC)) {
     APPL_TRACE_WARNING("GATTC Module not enabled/already disabled");
     return;
   }
@@ -73,7 +73,7 @@
  */
 void BTA_GATTC_AppRegister(tBTA_GATTC_CBACK* p_client_cb,
                            BtaAppRegisterCallback cb) {
-  if (bta_sys_is_register(BTA_ID_GATTC) == false)
+  if (!bta_sys_is_register(BTA_ID_GATTC))
     bta_sys_register(BTA_ID_GATTC, &bta_gattc_reg);
 
   do_in_bta_thread(FROM_HERE, base::Bind(&bta_gattc_register, Uuid::GetRandom(),
diff --git a/system/bta/gatt/bta_gatts_act.cc b/system/bta/gatt/bta_gatts_act.cc
index c699e8e..75ca6e4 100644
--- a/system/bta/gatt/bta_gatts_act.cc
+++ b/system/bta/gatt/bta_gatts_act.cc
@@ -178,7 +178,7 @@
   tGATT_STATUS status = GATT_SUCCESS;
   uint8_t i, first_unuse = 0xff;
 
-  if (p_cb->enabled == false) {
+  if (!p_cb->enabled) {
     bta_gatts_enable(p_cb);
   }
 
diff --git a/system/bta/gatt/bta_gatts_api.cc b/system/bta/gatt/bta_gatts_api.cc
index 544cc3b..97eb421 100644
--- a/system/bta/gatt/bta_gatts_api.cc
+++ b/system/bta/gatt/bta_gatts_api.cc
@@ -50,7 +50,7 @@
  *
  ******************************************************************************/
 void BTA_GATTS_Disable(void) {
-  if (bta_sys_is_register(BTA_ID_GATTS) == false) {
+  if (!bta_sys_is_register(BTA_ID_GATTS)) {
     APPL_TRACE_WARNING("GATTS Module not enabled/already disabled");
     return;
   }
diff --git a/system/bta/hf_client/bta_hf_client_act.cc b/system/bta/hf_client/bta_hf_client_act.cc
index b633bd0..7f56949 100644
--- a/system/bta/hf_client/bta_hf_client_act.cc
+++ b/system/bta/hf_client/bta_hf_client_act.cc
@@ -303,7 +303,7 @@
   evt.conn.bd_addr = client_cb->peer_addr;
 
   /* if not deregistering reopen server */
-  if (bta_hf_client_cb_arr.deregister == false) {
+  if (!bta_hf_client_cb_arr.deregister) {
     /* Make sure SCO is shutdown */
     bta_hf_client_sco_shutdown(client_cb);
 
diff --git a/system/bta/hf_client/bta_hf_client_at.cc b/system/bta/hf_client/bta_hf_client_at.cc
index 5d8493b..6700c63 100644
--- a/system/bta/hf_client/bta_hf_client_at.cc
+++ b/system/bta/hf_client/bta_hf_client_at.cc
@@ -170,7 +170,7 @@
                                   uint16_t buf_len) {
   APPL_TRACE_DEBUG("%s", __func__);
   if ((client_cb->at_cb.current_cmd == BTA_HF_CLIENT_AT_NONE ||
-       client_cb->svc_conn == false) &&
+       !client_cb->svc_conn) &&
       !alarm_is_scheduled(client_cb->at_cb.hold_timer)) {
     uint16_t len;
 
@@ -257,7 +257,7 @@
       client_cb->at_cb.current_cmd = BTA_HF_CLIENT_AT_NONE;
       return;
     case BTA_HF_CLIENT_AT_CLIP:  // last cmd is post slc seq
-      if (client_cb->send_at_reply == false) {
+      if (!client_cb->send_at_reply) {
         client_cb->send_at_reply = true;
       }
       break;
@@ -296,7 +296,7 @@
       bta_hf_client_cback_sco(client_cb, BTA_HF_CLIENT_AUDIO_CLOSE_EVT);
       break;
     case BTA_HF_CLIENT_AT_CLIP:  // last cmd is post slc seq
-      if (client_cb->send_at_reply == false) {
+      if (!client_cb->send_at_reply) {
         client_cb->send_at_reply = true;
       }
       break;
@@ -1587,7 +1587,7 @@
     client_cb->at_cb.offset += space_left;
 
     /* find end of last complete command before proceeding */
-    while (bta_hf_client_check_at_complete(client_cb) == false) {
+    while (!bta_hf_client_check_at_complete(client_cb)) {
       if (client_cb->at_cb.offset == 0) {
         APPL_TRACE_ERROR("HFPClient: AT parser buffer overrun, disconnecting");
 
@@ -1620,7 +1620,7 @@
   client_cb->at_cb.offset += len;
 
   /* If last event is complete, parsing can be started */
-  if (bta_hf_client_check_at_complete(client_cb) == true) {
+  if (bta_hf_client_check_at_complete(client_cb)) {
     bta_hf_client_at_parse_start(client_cb);
     bta_hf_client_at_clear_buf(client_cb);
   }
@@ -1886,7 +1886,7 @@
 
   APPL_TRACE_DEBUG("%s", __func__);
 
-  if (query == true) {
+  if (query) {
     at_len = snprintf(buf, sizeof(buf), "AT+BTRH?\r");
   } else {
     at_len = snprintf(buf, sizeof(buf), "AT+BTRH=%u\r", val);
diff --git a/system/bta/hf_client/bta_hf_client_sco.cc b/system/bta/hf_client/bta_hf_client_sco.cc
index 6181ba1d..2fd4476 100644
--- a/system/bta/hf_client/bta_hf_client_sco.cc
+++ b/system/bta/hf_client/bta_hf_client_sco.cc
@@ -602,7 +602,7 @@
   /* call app callback */
   bta_hf_client_cback_sco(client_cb, BTA_HF_CLIENT_AUDIO_CLOSE_EVT);
 
-  if (client_cb->sco_close_rfc == true) {
+  if (client_cb->sco_close_rfc) {
     client_cb->sco_close_rfc = false;
     bta_hf_client_rfc_do_close(p_data);
   }
diff --git a/system/bta/hh/bta_hh_le.cc b/system/bta/hh/bta_hh_le.cc
index 7cca56d..2dcfc3e 100644
--- a/system/bta/hh/bta_hh_le.cc
+++ b/system/bta/hh/bta_hh_le.cc
@@ -1139,7 +1139,7 @@
     if (p_cb->app_id != 0 && p_cb->hid_srvc.in_use) {
       APPL_TRACE_DEBUG("%s: discovery has been done for HID service", __func__);
       /* configure protocol mode */
-      if (bta_hh_le_set_protocol_mode(p_cb, p_cb->mode) == false) {
+      if (!bta_hh_le_set_protocol_mode(p_cb, p_cb->mode)) {
         bta_hh_le_open_cmpl(p_cb);
       }
     }
@@ -1166,7 +1166,7 @@
  *
  ******************************************************************************/
 void bta_hh_le_notify_enc_cmpl(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_buf) {
-  if (p_cb == NULL || p_cb->security_pending == false || p_buf == NULL ||
+  if (p_cb == NULL || !p_cb->security_pending || p_buf == NULL ||
       p_buf->le_enc_cmpl.client_if != bta_hh_cb.gatt_if) {
     return;
   }
@@ -1477,7 +1477,7 @@
   tBTA_HH_DEV_CB* p_dev_cb = (tBTA_HH_DEV_CB*)data;
 
   if (interop_match_addr(INTEROP_HID_PREF_CONN_SUP_TIMEOUT_3S,
-                         (RawAddress*)&p_dev_cb->addr) == true) {
+                         (RawAddress*)&p_dev_cb->addr)) {
     if (tout < 300) tout = 300;
   }
 
diff --git a/system/bta/hh/bta_hh_main.cc b/system/bta/hh/bta_hh_main.cc
index e747773..4e7032f 100644
--- a/system/bta/hh/bta_hh_main.cc
+++ b/system/bta/hh/bta_hh_main.cc
@@ -400,7 +400,7 @@
             * force the index to be IDX_INVALID
             */
           if ((index != BTA_HH_IDX_INVALID) &&
-              (bta_hh_cb.kdev[index].in_use == false)) {
+              (!bta_hh_cb.kdev[index].in_use)) {
             index = BTA_HH_IDX_INVALID;
           }
         }
diff --git a/system/bta/jv/bta_jv_act.cc b/system/bta/jv/bta_jv_act.cc
index 61e0bf8..8f5bdc8 100644
--- a/system/bta/jv/bta_jv_act.cc
+++ b/system/bta/jv/bta_jv_act.cc
@@ -576,27 +576,27 @@
 
         case TCS_PSM_INTERCOM: /* 5 */
         case TCS_PSM_CORDLESS: /* 7 */
-          if (false == bta_sys_is_register(BTA_ID_CT) &&
-              false == bta_sys_is_register(BTA_ID_CG))
+          if (!bta_sys_is_register(BTA_ID_CT) &&
+              !bta_sys_is_register(BTA_ID_CG))
             ret = true;
           break;
 
         case BT_PSM_BNEP: /* F */
-          if (false == bta_sys_is_register(BTA_ID_PAN)) ret = true;
+          if (!bta_sys_is_register(BTA_ID_PAN)) ret = true;
           break;
 
         case HID_PSM_CONTROL:   /* 0x11 */
         case HID_PSM_INTERRUPT: /* 0x13 */
           // FIX: allow HID Device and HID Host to coexist
-          if (false == bta_sys_is_register(BTA_ID_HD) ||
-              false == bta_sys_is_register(BTA_ID_HH))
+          if (!bta_sys_is_register(BTA_ID_HD) ||
+              !bta_sys_is_register(BTA_ID_HH))
             ret = true;
           break;
 
         case AVCT_PSM: /* 0x17 */
         case AVDT_PSM: /* 0x19 */
-          if ((false == bta_sys_is_register(BTA_ID_AV)) &&
-              (false == bta_sys_is_register(BTA_ID_AVK)))
+          if ((!bta_sys_is_register(BTA_ID_AV)) &&
+              (!bta_sys_is_register(BTA_ID_AVK)))
             ret = true;
           break;
 
@@ -701,7 +701,7 @@
       int32_t channel = p_data->alloc_channel.channel;
       uint8_t scn = 0;
       if (channel > 0) {
-        if (BTM_TryAllocateSCN(channel) == false) {
+        if (!BTM_TryAllocateSCN(channel)) {
           APPL_TRACE_ERROR("rfc channel:%d already in use or invalid", channel);
           channel = 0;
         }
@@ -1001,14 +1001,14 @@
 
   memset(&cfg, 0, sizeof(tL2CAP_CFG_INFO));
 
-  if (cc->has_cfg == true) {
+  if (cc->has_cfg) {
     cfg = cc->cfg;
     if (cfg.fcr_present && cfg.fcr.mode == L2CAP_FCR_ERTM_MODE) {
       chan_mode_mask = GAP_FCR_CHAN_OPT_ERTM;
     }
   }
 
-  if (cc->has_ertm_info == true) {
+  if (cc->has_ertm_info) {
     ertm_info = &(cc->ertm_info);
   }
 
@@ -1169,14 +1169,14 @@
 
   memset(&cfg, 0, sizeof(tL2CAP_CFG_INFO));
 
-  if (ls->has_cfg == true) {
+  if (ls->has_cfg) {
     cfg = ls->cfg;
     if (cfg.fcr_present && cfg.fcr.mode == L2CAP_FCR_ERTM_MODE) {
       chan_mode_mask = GAP_FCR_CHAN_OPT_ERTM;
     }
   }
 
-  if (ls->has_ertm_info == true) {
+  if (ls->has_ertm_info) {
     ertm_info = &(ls->ertm_info);
   }
 
@@ -1197,7 +1197,7 @@
   /* PSM checking is not required for LE COC */
   if (0 == sec_id ||
       ((ls->type == BTA_JV_CONN_TYPE_L2CAP) &&
-       (false == bta_jv_check_psm(ls->local_psm))) ||
+       (!bta_jv_check_psm(ls->local_psm))) ||
       (handle = GAP_ConnOpen("JV L2CAP", sec_id, 1, nullptr, ls->local_psm,
                              &cfg, ertm_info, ls->sec_mask, chan_mode_mask,
                              bta_jv_l2cap_server_cback, ls->type)) ==
@@ -1526,8 +1526,8 @@
   evt_data.sec_id = sec_id;
   evt_data.status = BTA_JV_SUCCESS;
   if (0 == sec_id ||
-      BTM_SetSecurityLevel(true, "", sec_id, cc->sec_mask, BT_PSM_RFCOMM,
-                           BTM_SEC_PROTO_RFCOMM, cc->remote_scn) == false) {
+      !BTM_SetSecurityLevel(true, "", sec_id, cc->sec_mask, BT_PSM_RFCOMM,
+                            BTM_SEC_PROTO_RFCOMM, cc->remote_scn)) {
     evt_data.status = BTA_JV_FAILURE;
     APPL_TRACE_ERROR(
         "sec_id:%d is zero or BTM_SetSecurityLevel failed, remote_scn:%d",
@@ -1848,9 +1848,9 @@
     sec_id = bta_jv_alloc_sec_id();
 
     if (0 == sec_id ||
-        BTM_SetSecurityLevel(false, "JV PORT", sec_id, rs->sec_mask,
-                             BT_PSM_RFCOMM, BTM_SEC_PROTO_RFCOMM,
-                             rs->local_scn) == false) {
+        !BTM_SetSecurityLevel(false, "JV PORT", sec_id, rs->sec_mask,
+                              BT_PSM_RFCOMM, BTM_SEC_PROTO_RFCOMM,
+                              rs->local_scn)) {
       APPL_TRACE_ERROR("bta_jv_rfcomm_start_server, run out of sec_id");
       break;
     }
diff --git a/system/bta/jv/bta_jv_api.cc b/system/bta/jv/bta_jv_api.cc
index f4db9d8..6e1a7fe 100644
--- a/system/bta/jv/bta_jv_api.cc
+++ b/system/bta/jv/bta_jv_api.cc
@@ -61,7 +61,7 @@
   int i;
 
   APPL_TRACE_API("BTA_JvEnable");
-  if (p_cback && false == bta_sys_is_register(BTA_ID_JV)) {
+  if (p_cback && !bta_sys_is_register(BTA_ID_JV)) {
     memset(&bta_jv_cb, 0, sizeof(tBTA_JV_CB));
     /* set handle to invalid value by default */
     for (i = 0; i < BTA_JV_PM_MAX_NUM; i++) {
diff --git a/system/bta/mce/bta_mce_api.cc b/system/bta/mce/bta_mce_api.cc
index b44c210..920e493 100644
--- a/system/bta/mce/bta_mce_api.cc
+++ b/system/bta/mce/bta_mce_api.cc
@@ -59,7 +59,7 @@
 
   APPL_TRACE_API("%", __func__);
 
-  if (p_cback && false == bta_sys_is_register(BTA_ID_MCE)) {
+  if (p_cback && !bta_sys_is_register(BTA_ID_MCE)) {
     memset(&bta_mce_cb, 0, sizeof(tBTA_MCE_CB));
 
     /* register with BTA system manager */
diff --git a/system/bta/pan/bta_pan_act.cc b/system/bta/pan/bta_pan_act.cc
index 68e8f06..64f3be2 100644
--- a/system/bta/pan/bta_pan_act.cc
+++ b/system/bta/pan/bta_pan_act.cc
@@ -261,7 +261,7 @@
 
   for (uint8_t index = 0; index < BTA_PAN_NUM_CONN; index++) {
     p_scb = &bta_pan_cb.scb[index];
-    if (p_scb->in_use == true && app_id == p_scb->app_id) {
+    if (p_scb->in_use && app_id == p_scb->app_id) {
       /* save temp bd_addr */
       bd_addr = p_scb->bd_addr;
       found = true;
@@ -270,14 +270,14 @@
   }
 
   /* If cannot find a match then there is no connection at all */
-  if (found == false) return false;
+  if (!found) return false;
 
   /* Find whether there is another connection with different device other than
      PANU.
       Could be same service or different service */
   for (uint8_t index = 0; index < BTA_PAN_NUM_CONN; index++) {
     p_scb = &bta_pan_cb.scb[index];
-    if (p_scb->in_use == true && p_scb->app_id != bta_pan_cb.app_id[0] &&
+    if (p_scb->in_use && p_scb->app_id != bta_pan_cb.app_id[0] &&
         bd_addr != p_scb->bd_addr) {
       return true;
     }
@@ -576,7 +576,7 @@
   /* if data path configured for rx pull */
   if ((bta_pan_cb.flow_mask & BTA_PAN_RX_MASK) == BTA_PAN_RX_PULL) {
     /* if we can accept data */
-    if (p_scb->pan_flow_enable == true) {
+    if (p_scb->pan_flow_enable) {
       /* call application callout function for rx path */
       bta_pan_co_rx_path(p_scb->handle, p_scb->app_id);
     }
@@ -611,7 +611,7 @@
   /* if configured for zero copy push */
   else if ((bta_pan_cb.flow_mask & BTA_PAN_TX_MASK) == BTA_PAN_TX_PUSH_BUF) {
     /* if app can accept data */
-    if (p_scb->app_flow_enable == true) {
+    if (p_scb->app_flow_enable) {
       BT_HDR* p_buf;
 
       /* read data from the queue */
diff --git a/system/bta/sdp/bta_sdp_api.cc b/system/bta/sdp/bta_sdp_api.cc
index 0e01616..24c039e 100644
--- a/system/bta/sdp/bta_sdp_api.cc
+++ b/system/bta/sdp/bta_sdp_api.cc
@@ -56,7 +56,7 @@
   tBTA_SDP_STATUS status = BTA_SDP_FAILURE;
 
   APPL_TRACE_API(__func__);
-  if (p_cback && false == bta_sys_is_register(BTA_ID_SDP)) {
+  if (p_cback && !bta_sys_is_register(BTA_ID_SDP)) {
     memset(&bta_sdp_cb, 0, sizeof(tBTA_SDP_CB));
 
     /* register with BTA system manager */
diff --git a/system/bta/sys/bta_sys_main.cc b/system/bta/sys/bta_sys_main.cc
index 0ea2439..79162b7 100644
--- a/system/bta/sys/bta_sys_main.cc
+++ b/system/bta/sys/bta_sys_main.cc
@@ -609,7 +609,7 @@
 
   for (; bta_id <= bta_id_max; bta_id++) {
     if (bta_sys_cb.reg[bta_id] != NULL) {
-      if (bta_sys_cb.is_reg[bta_id] == true &&
+      if (bta_sys_cb.is_reg[bta_id] &&
           bta_sys_cb.reg[bta_id]->disable != NULL) {
         (*bta_sys_cb.reg[bta_id]->disable)();
       }
diff --git a/system/btif/src/bluetooth.cc b/system/btif/src/bluetooth.cc
index 9565a7f..fa0d25f 100644
--- a/system/btif/src/bluetooth.cc
+++ b/system/btif/src/bluetooth.cc
@@ -170,28 +170,28 @@
 
 static int get_adapter_properties(void) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_get_adapter_properties();
 }
 
 static int get_adapter_property(bt_property_type_t type) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_get_adapter_property(type);
 }
 
 static int set_adapter_property(const bt_property_t* property) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_set_adapter_property(property);
 }
 
 int get_remote_device_properties(RawAddress* remote_addr) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_get_remote_device_properties(remote_addr);
 }
@@ -199,7 +199,7 @@
 int get_remote_device_property(RawAddress* remote_addr,
                                bt_property_type_t type) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_get_remote_device_property(remote_addr, type);
 }
@@ -207,7 +207,7 @@
 int set_remote_device_property(RawAddress* remote_addr,
                                const bt_property_t* property) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_set_remote_device_property(remote_addr, property);
 }
@@ -222,28 +222,28 @@
 
 int get_remote_services(RawAddress* remote_addr) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_dm_get_remote_services(*remote_addr);
 }
 
 static int start_discovery(void) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_dm_start_discovery();
 }
 
 static int cancel_discovery(void) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_dm_cancel_discovery();
 }
 
 static int create_bond(const RawAddress* bd_addr, int transport) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_dm_create_bond(bd_addr, transport);
 }
@@ -251,14 +251,14 @@
 static int create_bond_out_of_band(const RawAddress* bd_addr, int transport,
                                    const bt_out_of_band_data_t* oob_data) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_dm_create_bond_out_of_band(bd_addr, transport, oob_data);
 }
 
 static int cancel_bond(const RawAddress* bd_addr) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_dm_cancel_bond(bd_addr);
 }
@@ -268,14 +268,14 @@
     return BT_STATUS_SUCCESS;
 
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_dm_remove_bond(bd_addr);
 }
 
 static int get_connection_state(const RawAddress* bd_addr) {
   /* sanity check */
-  if (interface_ready() == false) return 0;
+  if (!interface_ready()) return 0;
 
   return btif_dm_get_connection_state(bd_addr);
 }
@@ -283,7 +283,7 @@
 static int pin_reply(const RawAddress* bd_addr, uint8_t accept, uint8_t pin_len,
                      bt_pin_code_t* pin_code) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_dm_pin_reply(bd_addr, accept, pin_len, pin_code);
 }
@@ -291,13 +291,13 @@
 static int ssp_reply(const RawAddress* bd_addr, bt_ssp_variant_t variant,
                      uint8_t accept, uint32_t passkey) {
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_dm_ssp_reply(bd_addr, variant, accept, passkey);
 }
 
 static int read_energy_info() {
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
   btif_dm_read_energy_info();
   return BT_STATUS_SUCCESS;
 }
@@ -329,7 +329,7 @@
   LOG_INFO(LOG_TAG, "%s: id = %s", __func__, profile_id);
 
   /* sanity check */
-  if (interface_ready() == false) return NULL;
+  if (!interface_ready()) return NULL;
 
   /* check for supported profile interfaces */
   if (is_profile(profile_id, BT_PROFILE_HANDSFREE_ID))
@@ -381,7 +381,7 @@
   LOG_INFO(LOG_TAG, "%s", __func__);
 
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_dut_mode_configure(enable);
 }
@@ -390,7 +390,7 @@
   LOG_INFO(LOG_TAG, "%s", __func__);
 
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_dut_mode_send(opcode, buf, len);
 }
@@ -399,7 +399,7 @@
   LOG_INFO(LOG_TAG, "%s", __func__);
 
   /* sanity check */
-  if (interface_ready() == false) return BT_STATUS_NOT_READY;
+  if (!interface_ready()) return BT_STATUS_NOT_READY;
 
   return btif_le_test_mode(opcode, buf, len);
 }
diff --git a/system/btif/src/btif_debug_btsnoop.cc b/system/btif/src/btif_debug_btsnoop.cc
index e52a177..668240c 100644
--- a/system/btif/src/btif_debug_btsnoop.cc
+++ b/system/btif/src/btif_debug_btsnoop.cc
@@ -207,7 +207,7 @@
     rc = btsnoop_compress(ringbuffer, buffer);
   }
 
-  if (rc == false) {
+  if (!rc) {
     dprintf(fd, "%s Log compression failed", __func__);
     goto error;
   }
diff --git a/system/btif/src/btif_dm.cc b/system/btif/src/btif_dm.cc
index f44934a..245675b 100644
--- a/system/btif/src/btif_dm.cc
+++ b/system/btif/src/btif_dm.cc
@@ -1027,7 +1027,7 @@
   BTIF_TRACE_DEBUG("%s: bond state=%d", __func__, pairing_cb.state);
 
   RawAddress bd_addr = p_auth_cmpl->bd_addr;
-  if ((p_auth_cmpl->success == true) && (p_auth_cmpl->key_present)) {
+  if ((p_auth_cmpl->success) && (p_auth_cmpl->key_present)) {
     if ((p_auth_cmpl->key_type < HCI_LKEY_TYPE_DEBUG_COMB) ||
         (p_auth_cmpl->key_type == HCI_LKEY_TYPE_AUTH_COMB) ||
         (p_auth_cmpl->key_type == HCI_LKEY_TYPE_CHANGED_COMB) ||
@@ -2789,7 +2789,7 @@
   /* Clear OOB data */
   memset(&oob_cb, 0, sizeof(oob_cb));
 
-  if ((p_auth_cmpl->success == true) && (p_auth_cmpl->key_present)) {
+  if ((p_auth_cmpl->success) && (p_auth_cmpl->key_present)) {
     /* store keys */
   }
   if (p_auth_cmpl->success) {
diff --git a/system/btif/src/btif_gatt_client.cc b/system/btif/src/btif_gatt_client.cc
index 3f7f788..beb356fd 100644
--- a/system/btif/src/btif_gatt_client.cc
+++ b/system/btif/src/btif_gatt_client.cc
@@ -128,7 +128,7 @@
       HAL_CBACK(bt_gatt_callbacks, client->notify_cb, p_data->notify.conn_id,
                 data);
 
-      if (p_data->notify.is_notify == false)
+      if (!p_data->notify.is_notify)
         BTA_GATTC_SendIndConfirm(p_data->notify.conn_id, p_data->notify.handle);
 
       break;
diff --git a/system/btif/src/btif_hf.cc b/system/btif/src/btif_hf.cc
index 6fe571e..1076006 100644
--- a/system/btif/src/btif_hf.cc
+++ b/system/btif/src/btif_hf.cc
@@ -547,8 +547,7 @@
       we should set the BTA AG Codec to mSBC. This would trigger a +BCS to mSBC
       at the time
       of SCO connection establishment */
-      if ((btif_conf_hf_force_wbs == true) &&
-          (p_data->val.num & BTA_AG_CODEC_MSBC)) {
+      if ((btif_conf_hf_force_wbs) && (p_data->val.num & BTA_AG_CODEC_MSBC)) {
         BTIF_TRACE_EVENT("%s: btif_hf override-Preferred Codec to MSBC",
                          __func__);
         BTA_AgSetCodec(btif_hf_cb[idx].handle, BTA_AG_CODEC_MSBC);
diff --git a/system/btif/src/btif_rc.cc b/system/btif/src/btif_rc.cc
index fc10b8b..3a94bb7 100644
--- a/system/btif/src/btif_rc.cc
+++ b/system/btif/src/btif_rc.cc
@@ -1242,7 +1242,7 @@
       __func__, p_dev->rc_handle, index, label, code,
       dump_rc_pdu(pmetamsg_resp->rsp.pdu));
 
-  if (index >= 0 && p_dev->rc_pdu_info[index].is_rsp_pending == false) {
+  if (index >= 0 && !p_dev->rc_pdu_info[index].is_rsp_pending) {
     BTIF_TRACE_ERROR("%s: is_rsp_pending false, returning", __func__);
     return;
   }
@@ -1467,7 +1467,7 @@
     case AVRC_PDU_INFORM_DISPLAY_CHARSET: {
       tAVRC_RESPONSE avrc_rsp;
       BTIF_TRACE_EVENT("%s: AVRC_PDU_INFORM_DISPLAY_CHARSET", __func__);
-      if (p_dev->rc_connected == true) {
+      if (p_dev->rc_connected) {
         memset(&(avrc_rsp.inform_charset), 0, sizeof(tAVRC_RSP));
         avrc_rsp.inform_charset.opcode =
             opcode_from_pdu(AVRC_PDU_INFORM_DISPLAY_CHARSET);
@@ -1754,7 +1754,7 @@
     return;
   }
 
-  if (p_dev->rc_procedure_complete == true) {
+  if (p_dev->rc_procedure_complete) {
     return;
   }
   p_dev->rc_procedure_complete = true;
@@ -1981,7 +1981,7 @@
   CHECK_RC_CONNECTED(p_dev);
 
   /* check if rsp to previous cmd was completed */
-  if (p_dev->rc_pdu_info[IDX_GET_FOLDER_ITEMS_RSP].is_rsp_pending == false) {
+  if (!p_dev->rc_pdu_info[IDX_GET_FOLDER_ITEMS_RSP].is_rsp_pending) {
     BTIF_TRACE_WARNING("%s: Not sending response as no PDU was registered",
                        __func__);
     return BT_STATUS_UNHANDLED;
@@ -2192,7 +2192,7 @@
                    __func__, rsp_status, avrc_rsp.br_player.status);
 
   /* check if rsp to previous cmd was completed */
-  if (p_dev->rc_pdu_info[IDX_SET_BROWSED_PLAYER_RSP].is_rsp_pending == false) {
+  if (!p_dev->rc_pdu_info[IDX_SET_BROWSED_PLAYER_RSP].is_rsp_pending) {
     BTIF_TRACE_WARNING("%s: Not sending response as no PDU was registered",
                        __func__);
     return BT_STATUS_UNHANDLED;
@@ -3251,7 +3251,7 @@
       p_event = NULL;
     }
     /* Registered for all events, we can request application settings */
-    if (p_event == NULL && p_dev->rc_app_settings.query_started == false) {
+    if (p_event == NULL && !p_dev->rc_app_settings.query_started) {
       /* we need to do this only if remote TG supports
        * player application settings
        */
diff --git a/system/btif/src/btif_sdp_server.cc b/system/btif/src/btif_sdp_server.cc
index 43d489b..a9d2dd9 100644
--- a/system/btif/src/btif_sdp_server.cc
+++ b/system/btif/src/btif_sdp_server.cc
@@ -355,7 +355,7 @@
   if (handle != -1 && handle != 0) {
     bool result;
     result = SDP_DeleteRecord(handle);
-    if (result == false) {
+    if (!result) {
       BTIF_TRACE_ERROR("  Unable to remove handle 0x%08x", handle);
     }
   }
diff --git a/system/btif/src/btif_sm.cc b/system/btif/src/btif_sm.cc
index 8f7bbb2..791d5bd 100644
--- a/system/btif/src/btif_sm.cc
+++ b/system/btif/src/btif_sm.cc
@@ -136,8 +136,7 @@
     return BT_STATUS_FAIL;
   }
 
-  if (p_cb->p_handlers[p_cb->state](event, data) == false)
-    return BT_STATUS_UNHANDLED;
+  if (!p_cb->p_handlers[p_cb->state](event, data)) return BT_STATUS_UNHANDLED;
 
   return status;
 }
@@ -167,14 +166,14 @@
   }
 
   /* Send exit event to the current state */
-  if (p_cb->p_handlers[p_cb->state](BTIF_SM_EXIT_EVT, NULL) == false)
+  if (!p_cb->p_handlers[p_cb->state](BTIF_SM_EXIT_EVT, NULL))
     status = BT_STATUS_UNHANDLED;
 
   /* Change to the new state */
   p_cb->state = state;
 
   /* Send enter event to the new state */
-  if (p_cb->p_handlers[p_cb->state](BTIF_SM_ENTER_EVT, NULL) == false)
+  if (!p_cb->p_handlers[p_cb->state](BTIF_SM_ENTER_EVT, NULL))
     status = BT_STATUS_UNHANDLED;
 
   return status;
diff --git a/system/btif/src/btif_sock_l2cap.cc b/system/btif/src/btif_sock_l2cap.cc
index 90e3755..c341f66 100644
--- a/system/btif/src/btif_sock_l2cap.cc
+++ b/system/btif/src/btif_sock_l2cap.cc
@@ -240,21 +240,21 @@
   // lower-level close() should be idempotent... so let's call it and see...
   if (sock->is_le_coc) {
     // Only call if we are non server connections
-    if (sock->handle >= 0 && (sock->server == false)) {
+    if (sock->handle >= 0 && (!sock->server)) {
       BTA_JvL2capClose(sock->handle);
     }
-    if ((sock->channel >= 0) && (sock->server == true)) {
+    if ((sock->channel >= 0) && (sock->server)) {
       BTA_JvFreeChannel(sock->channel, BTA_JV_CONN_TYPE_L2CAP);
     }
   } else {
     // Only call if we are non server connections
-    if ((sock->handle >= 0) && (sock->server == false)) {
+    if ((sock->handle >= 0) && (!sock->server)) {
       if (sock->fixed_chan)
         BTA_JvL2capCloseLE(sock->handle);
       else
         BTA_JvL2capClose(sock->handle);
     }
-    if ((sock->channel >= 0) && (sock->server == true)) {
+    if ((sock->channel >= 0) && (sock->server)) {
       if (sock->fixed_chan)
         BTA_JvFreeChannel(sock->channel, BTA_JV_CONN_TYPE_L2CAP_LE);
       else
@@ -396,7 +396,7 @@
   APPL_TRACE_DEBUG("on_srv_l2cap_listen_started() sock->handle =%d id:%d",
                    sock->handle, sock->id);
 
-  if (sock->server_psm_sent == false) {
+  if (!sock->server_psm_sent) {
     if (!send_app_psm_or_chan_l(sock)) {
       // closed
       APPL_TRACE_DEBUG("send_app_psm() failed, close rs->id:%d", sock->id);
@@ -599,7 +599,7 @@
                    sock->server);
   // TODO: This does not seem to be called...
   // I'm not sure if this will be called for non-server sockets?
-  if (!sock->fixed_chan && (sock->server == true)) {
+  if (!sock->fixed_chan && (sock->server)) {
     BTA_JvFreeChannel(sock->channel, BTA_JV_CONN_TYPE_L2CAP);
   }
   btsock_l2cap_free_l(sock);
diff --git a/system/btif/src/btif_sock_rfc.cc b/system/btif/src/btif_sock_rfc.cc
index b3378b5..3433662 100644
--- a/system/btif/src/btif_sock_rfc.cc
+++ b/system/btif/src/btif_sock_rfc.cc
@@ -439,7 +439,7 @@
 }
 
 static bool send_app_scn(rfc_slot_t* slot) {
-  if (slot->scn_notified == true) {
+  if (slot->scn_notified) {
     // already send, just return success.
     return true;
   }
@@ -653,7 +653,7 @@
           APPL_TRACE_DEBUG("send_app_scn() failed, close rs->id:%d", rs->id);
           cleanup_rfc_slot(rs);
         } else {
-          if (rs->is_service_uuid_valid == true) {
+          if (rs->is_service_uuid_valid) {
             // We already have data for SDP record, create it (RFC-only
             // profiles)
             BTA_JvCreateRecordByUser(rs->id);
diff --git a/system/btif/src/btif_sock_sdp.cc b/system/btif/src/btif_sock_sdp.cc
index cb50f74..c2674b6 100644
--- a/system/btif/src/btif_sock_sdp.cc
+++ b/system/btif/src/btif_sock_sdp.cc
@@ -112,7 +112,7 @@
   proto_list[1].num_params = 1;
   proto_list[1].params[0] = channel;
 
-  if (with_obex == true) {
+  if (with_obex) {
     proto_list[2].protocol_uuid = UUID_PROTOCOL_OBEX;
     proto_list[2].num_params = 0;
   }
diff --git a/system/btif/src/btif_storage.cc b/system/btif/src/btif_storage.cc
index 1692901..6abbebd 100644
--- a/system/btif/src/btif_storage.cc
+++ b/system/btif/src/btif_storage.cc
@@ -358,11 +358,11 @@
         ret = btif_config_get_int(bdstr, BTIF_STORAGE_PATH_REMOTE_VER_MFCT,
                                   &info->manufacturer);
 
-        if (ret == true)
+        if (ret)
           ret = btif_config_get_int(bdstr, BTIF_STORAGE_PATH_REMOTE_VER_VER,
                                     &info->version);
 
-        if (ret == true)
+        if (ret)
           ret = btif_config_get_int(bdstr, BTIF_STORAGE_PATH_REMOTE_VER_SUBVER,
                                     &info->sub_ver);
       }
@@ -556,7 +556,7 @@
     RawAddress* bd_addr = (RawAddress*)property->val;
     /* Fetch the local BD ADDR */
     const controller_t* controller = controller_get_interface();
-    if (controller->get_is_ready() == false) {
+    if (!controller->get_is_ready()) {
       LOG_ERROR(LOG_TAG,
                 "%s: Controller not ready! Unable to return Bluetooth Address",
                 __func__);
diff --git a/system/stack/avct/avct_bcb_act.cc b/system/stack/avct/avct_bcb_act.cc
index c404be4..4c227b2 100644
--- a/system/stack/avct/avct_bcb_act.cc
+++ b/system/stack/avct/avct_bcb_act.cc
@@ -180,7 +180,7 @@
   }
 
   /* if no ccbs bound to this lcb, disconnect */
-  if (bind == false) {
+  if (!bind) {
     avct_bcb_event(p_bcb, AVCT_LCB_INT_CLOSE_EVT, p_data);
     return;
   }
diff --git a/system/stack/avct/avct_lcb_act.cc b/system/stack/avct/avct_lcb_act.cc
index e2ce9db..2fd6fa5 100644
--- a/system/stack/avct/avct_lcb_act.cc
+++ b/system/stack/avct/avct_lcb_act.cc
@@ -235,7 +235,7 @@
   }
 
   /* if no ccbs bound to this lcb, disconnect */
-  if (bind == false) {
+  if (!bind) {
     avct_lcb_event(p_lcb, AVCT_LCB_INT_CLOSE_EVT, p_data);
   }
 }
@@ -419,7 +419,7 @@
   /* set event */
   event = (p_data->cong) ? AVCT_CONG_IND_EVT : AVCT_UNCONG_IND_EVT;
   p_lcb->cong = p_data->cong;
-  if (p_lcb->cong == false && !fixed_queue_is_empty(p_lcb->tx_q)) {
+  if (!p_lcb->cong && !fixed_queue_is_empty(p_lcb->tx_q)) {
     while (!p_lcb->cong &&
            (p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_lcb->tx_q)) != NULL) {
       if (L2CA_DataWrite(p_lcb->ch_lcid, p_buf) == L2CAP_DW_CONGESTED) {
@@ -528,7 +528,7 @@
       UINT16_TO_BE_STREAM(p, p_data->ul_msg.p_ccb->cc.pid);
     }
 
-    if (p_lcb->cong == true) {
+    if (p_lcb->cong) {
       fixed_queue_enqueue(p_lcb->tx_q, p_buf);
     }
 
diff --git a/system/stack/avdt/avdt_ccb_act.cc b/system/stack/avdt/avdt_ccb_act.cc
index f679dab..354525e 100644
--- a/system/stack/avdt/avdt_ccb_act.cc
+++ b/system/stack/avdt/avdt_ccb_act.cc
@@ -834,7 +834,7 @@
     /* do we have responses to send?  send them */
     else if (!fixed_queue_is_empty(p_ccb->rsp_q)) {
       while ((p_msg = (BT_HDR*)fixed_queue_try_dequeue(p_ccb->rsp_q)) != NULL) {
-        if (avdt_msg_send(p_ccb, p_msg) == true) {
+        if (avdt_msg_send(p_ccb, p_msg)) {
           /* break out if congested */
           break;
         }
diff --git a/system/stack/avrc/avrc_api.cc b/system/stack/avrc/avrc_api.cc
index 482d462..bc57e22 100644
--- a/system/stack/avrc/avrc_api.cc
+++ b/system/stack/avrc/avrc_api.cc
@@ -580,10 +580,10 @@
       drop_code = 4;
 
   } else if (cr == AVCT_RSP) {
-    if (req_continue == true) {
+    if (req_continue) {
       avrc_cmd.pdu = AVRC_PDU_REQUEST_CONTINUATION_RSP;
       drop_code = 2;
-    } else if (buf_overflow == true) {
+    } else if (buf_overflow) {
       /* Incoming message too big to fit in BT_DEFAULT_BUFFER_SIZE. Send abort
        * to peer  */
       avrc_cmd.pdu = AVRC_PDU_ABORT_CONTINUATION_RSP;
@@ -861,7 +861,7 @@
     drop = true;
   }
 
-  if (drop == false) {
+  if (!drop) {
     msg.hdr.opcode = opcode;
     (*avrc_cb.ccb[handle].p_msg_cback)(handle, label, opcode, &msg);
   } else {
@@ -1216,7 +1216,7 @@
   /* AVRCP spec has not defined any control channel commands that needs
    * fragmentation at this level
    * check for fragmentation only on the response */
-  if ((cr == AVCT_RSP) && (chk_frag == true)) {
+  if ((cr == AVCT_RSP) && (chk_frag)) {
     if (p_pkt->len > AVRC_MAX_CTRL_DATA_LEN) {
       int offset_len = MAX(AVCT_MSG_OFFSET, p_pkt->offset);
       BT_HDR* p_pkt_new =
diff --git a/system/stack/avrc/avrc_bld_tg.cc b/system/stack/avrc/avrc_bld_tg.cc
index f96a5d3..3939a8a 100644
--- a/system/stack/avrc/avrc_bld_tg.cc
+++ b/system/stack/avrc/avrc_bld_tg.cc
@@ -955,7 +955,7 @@
   /* min len required = item_type(1) + item len(2) + min item (14) = 17 */
   for (xx = 0;
        xx < p_rsp->item_count && len_left > AVRC_MIN_LEN_GET_FOLDER_ITEMS_RSP &&
-       multi_items_add_fail == false;
+       !multi_items_add_fail;
        xx++) {
     p_item_start = p_data;
     UINT8_TO_BE_STREAM(p_data, p_item_list[xx].item_type);
@@ -970,8 +970,7 @@
         p_player = &p_item_list[xx].u.player;
         item_len = AVRC_FEATURE_MASK_SIZE + p_player->name.str_len + 12;
 
-        if ((len_left <= item_len) ||
-            AVRC_ITEM_PLAYER_IS_VALID(p_player) == false) {
+        if ((len_left <= item_len) || !AVRC_ITEM_PLAYER_IS_VALID(p_player)) {
           p_data = p_item_start;
         } else {
           UINT16_TO_BE_STREAM(p_data, p_player->player_id);
@@ -1058,7 +1057,7 @@
       /* fill in variable item lenth */
       UINT16_TO_BE_STREAM(p_item_len, item_len);
     } else {
-      if (multi_items_add_fail == false) {
+      if (!multi_items_add_fail) {
         /* some item is not added properly - set an error status */
         if (len_left < item_len)
           status = AVRC_STS_INTERNAL_ERR;
@@ -1066,7 +1065,7 @@
           status = AVRC_STS_BAD_PARAM;
       }
     }
-    if (multi_items_add_fail == false) {
+    if (!multi_items_add_fail) {
       len += item_len;
       len += 3; /* the item_type(1) and item_len(2) */
     }
diff --git a/system/stack/btm/btm_ble_gap.cc b/system/stack/btm/btm_ble_gap.cc
index 7e567a0..d8a3bc3 100644
--- a/system/stack/btm/btm_ble_gap.cc
+++ b/system/stack/btm/btm_ble_gap.cc
@@ -576,7 +576,7 @@
 #if (BLE_VND_INCLUDED == TRUE)
 extern void BTM_BleReadControllerFeatures(
     tBTM_BLE_CTRL_FEATURES_CBACK* p_vsc_cback) {
-  if (true == btm_cb.cmn_ble_vsc_cb.values_read) return;
+  if (btm_cb.cmn_ble_vsc_cb.values_read) return;
 
   BTM_TRACE_DEBUG("BTM_BleReadControllerFeatures");
 
diff --git a/system/stack/btm/btm_ble_privacy.cc b/system/stack/btm/btm_ble_privacy.cc
index aaa8134..8d83857 100644
--- a/system/stack/btm/btm_ble_privacy.cc
+++ b/system/stack/btm/btm_ble_privacy.cc
@@ -794,8 +794,8 @@
   }
 
   if ((p_dev_rec->ble.in_controller_list & BTM_RESOLVING_LIST_BIT) &&
-      btm_ble_brcm_find_resolving_pending_entry(
-          p_dev_rec->bd_addr, BTM_BLE_META_REMOVE_IRK_ENTRY) == false) {
+      !btm_ble_brcm_find_resolving_pending_entry(
+          p_dev_rec->bd_addr, BTM_BLE_META_REMOVE_IRK_ENTRY)) {
     btm_ble_update_resolving_list(p_dev_rec->bd_addr, false);
     btm_ble_remove_resolving_list_entry(p_dev_rec);
   } else {
diff --git a/system/stack/btm/btm_devctl.cc b/system/stack/btm/btm_devctl.cc
index 4910315..ba42a25 100644
--- a/system/stack/btm/btm_devctl.cc
+++ b/system/stack/btm/btm_devctl.cc
@@ -647,7 +647,7 @@
       free_idx = i;
     } else if (btm_cb.devcb.p_vend_spec_cb[i] == p_cb) {
       /* Found callback in lookup table. If deregistering, clear the entry. */
-      if (is_register == false) {
+      if (!is_register) {
         btm_cb.devcb.p_vend_spec_cb[i] = NULL;
         BTM_TRACE_EVENT("BTM Deregister For VSEvents is successfully");
       }
diff --git a/system/stack/btm/btm_inq.cc b/system/stack/btm/btm_inq.cc
index df5eac2..3537eb8 100644
--- a/system/stack/btm/btm_inq.cc
+++ b/system/stack/btm/btm_inq.cc
@@ -1532,7 +1532,7 @@
 
   /* Only process the inquiry filter; Ignore the connection filter until it
      is used by the upper layers */
-  if (p_inq->inqfilt_active == true) {
+  if (p_inq->inqfilt_active) {
     /* Extract the returned status from the buffer */
     STREAM_TO_UINT8(hci_status, p);
     if (hci_status != HCI_SUCCESS) {
@@ -1804,7 +1804,7 @@
     else
       p_i->inq_info.results.rssi = BTM_INQ_RES_IGNORE_RSSI;
 
-    if (is_new == true) {
+    if (is_new) {
       /* Save the info */
       p_cur = &p_i->inq_info.results;
       p_cur->page_scan_rep_mode = page_scan_rep_mode;
@@ -2127,8 +2127,7 @@
 
   /* If the inquire BDA and remote DBA are the same, then stop the timer and set
    * the active to false */
-  if ((p_inq->remname_active == true) &&
-      (!bda || (*bda == p_inq->remname_bda))) {
+  if ((p_inq->remname_active) && (!bda || (*bda == p_inq->remname_bda))) {
     if (BTM_UseLeLink(p_inq->remname_bda)) {
       if (hci_status == HCI_ERR_UNSPECIFIED)
         btm_ble_cancel_remote_name(p_inq->remname_bda);
diff --git a/system/stack/btm/btm_pm.cc b/system/stack/btm/btm_pm.cc
index c011ff2..83686bb 100644
--- a/system/stack/btm/btm_pm.cc
+++ b/system/stack/btm/btm_pm.cc
@@ -574,7 +574,7 @@
   if (mode != BTM_PM_MD_ACTIVE && p_cb->state != BTM_PM_MD_ACTIVE)
     p_cb->chg_ind = true; /* needs to wake, then sleep */
 
-  if (p_cb->chg_ind == true) /* needs to wake first */
+  if (p_cb->chg_ind) /* needs to wake first */
     md_res.mode = BTM_PM_MD_ACTIVE;
 #if (BTM_SSR_INCLUDED == TRUE)
   else if (BTM_PM_MD_SNIFF == md_res.mode && p_cb->max_lat) {
@@ -785,7 +785,7 @@
     btm_pm_snd_md_req(BTM_PM_SET_ONLY_ID, xx, NULL);
   } else {
     for (zz = 0; zz < MAX_L2CAP_LINKS; zz++) {
-      if (btm_cb.pm_mode_db[zz].chg_ind == true) {
+      if (btm_cb.pm_mode_db[zz].chg_ind) {
 #if (BTM_PM_DEBUG == TRUE)
         BTM_TRACE_DEBUG("btm_pm_proc_mode_change: Sending PM req :%d", zz);
 #endif  // BTM_PM_DEBUG
@@ -928,9 +928,9 @@
  *
  ******************************************************************************/
 tBTM_CONTRL_STATE BTM_PM_ReadControllerState(void) {
-  if (true == btm_pm_device_in_active_or_sniff_mode())
+  if (btm_pm_device_in_active_or_sniff_mode())
     return BTM_CONTRL_ACTIVE;
-  else if (true == btm_pm_device_in_scan_state())
+  else if (btm_pm_device_in_scan_state())
     return BTM_CONTRL_SCAN;
   else
     return BTM_CONTRL_IDLE;
diff --git a/system/stack/btm/btm_sec.cc b/system/stack/btm/btm_sec.cc
index 3167a75..f90e13a 100644
--- a/system/stack/btm/btm_sec.cc
+++ b/system/stack/btm/btm_sec.cc
@@ -1875,7 +1875,7 @@
   /* Only check if link key already exists */
   if (!(p_dev_rec->sec_flags & BTM_SEC_LINK_KEY_KNOWN)) return;
 
-  if (btm_sec_is_upgrade_possible(p_dev_rec, is_originator) == true) {
+  if (btm_sec_is_upgrade_possible(p_dev_rec, is_originator)) {
     BTM_TRACE_DEBUG("need upgrade!! sec_flags:0x%x", p_dev_rec->sec_flags);
     /* upgrade is possible: check if the application wants the upgrade.
      * If the application is configured to use a global MITM flag,
@@ -2780,7 +2780,7 @@
   /* set up the control block to indicated dedicated bonding */
   btm_cb.pairing_flags |= BTM_PAIR_FLAGS_DISC_WHEN_DONE;
 
-  if (l2cu_create_conn(p_lcb, BT_TRANSPORT_BR_EDR) == false) {
+  if (!l2cu_create_conn(p_lcb, BT_TRANSPORT_BR_EDR)) {
     LOG(WARNING) << "Security Manager: failed create allocate LCB "
                  << p_dev_rec->bd_addr;
 
@@ -5080,11 +5080,10 @@
         "service id:%d, is trusted:%d", p_dev_rec->p_cur_service->service_id,
         (BTM_SEC_IS_SERVICE_TRUSTED(p_dev_rec->trusted_mask,
                                     p_dev_rec->p_cur_service->service_id)));
-    if ((btm_sec_are_all_trusted(p_dev_rec->trusted_mask) == false) &&
+    if ((!btm_sec_are_all_trusted(p_dev_rec->trusted_mask)) &&
         (p_dev_rec->p_cur_service->service_id < BTM_SEC_MAX_SERVICES) &&
-        (BTM_SEC_IS_SERVICE_TRUSTED(p_dev_rec->trusted_mask,
-                                    p_dev_rec->p_cur_service->service_id) ==
-         false)) {
+        (!BTM_SEC_IS_SERVICE_TRUSTED(p_dev_rec->trusted_mask,
+                                     p_dev_rec->p_cur_service->service_id))) {
       BTM_TRACE_EVENT("Security Manager: Start authorization");
       return (btm_sec_start_authorization(p_dev_rec));
     }
@@ -5592,7 +5591,7 @@
         "0x%02x",
         __func__, major, minor);
 
-    if (btm_cb.security_mode_changed == false) {
+    if (!btm_cb.security_mode_changed) {
       btm_cb.security_mode_changed = true;
 #ifdef APPL_AUTH_WRITE_EXCEPTION
       if (!(APPL_AUTH_WRITE_EXCEPTION)(p_dev_rec->bd_addr))
diff --git a/system/stack/gatt/gatt_main.cc b/system/stack/gatt/gatt_main.cc
index ee6ce31..1f760ad 100644
--- a/system/stack/gatt/gatt_main.cc
+++ b/system/stack/gatt/gatt_main.cc
@@ -476,7 +476,7 @@
   uint16_t conn_id;
 
   /* if uncongested, check to see if there is any more pending data */
-  if (p_tcb != NULL && congested == false) {
+  if (p_tcb != NULL && !congested) {
     gatt_cl_send_next_cmd_inq(*p_tcb);
   }
   /* notifying all applications for the connection up event */
@@ -1085,7 +1085,7 @@
         req.client_read_index = i;
         status = (*gatt_cb.cb_info.p_srv_chg_callback)(
             GATTS_SRV_CHG_CMD_READ_CLENT, &req, &rsp);
-        if (status == true) {
+        if (status) {
           memcpy(&srv_chg_clt, &rsp.srv_chg, sizeof(tGATTS_SRV_CHG));
           if (gatt_add_srv_chg_clt(&srv_chg_clt) == NULL) {
             LOG(ERROR) << "Unable to add a service change client";
diff --git a/system/stack/l2cap/l2c_api.cc b/system/stack/l2cap/l2c_api.cc
index 809199f..67a57e8 100644
--- a/system/stack/l2cap/l2c_api.cc
+++ b/system/stack/l2cap/l2c_api.cc
@@ -2124,7 +2124,7 @@
        * controller */
       if ((HCI_NON_FLUSHABLE_PB_SUPPORTED(BTM_ReadLocalFeatures())) &&
           (BTM_GetNumScoLinks() == 0)) {
-        if (l2cb.is_flush_active == false) {
+        if (!l2cb.is_flush_active) {
           l2cb.is_flush_active = true;
 
           /* The only packet type defined - 0 - Automatically-Flushable Only */
diff --git a/system/stack/l2cap/l2c_csm.cc b/system/stack/l2cap/l2c_csm.cc
index 4edc298..5356b1f 100644
--- a/system/stack/l2cap/l2c_csm.cc
+++ b/system/stack/l2cap/l2c_csm.cc
@@ -830,7 +830,7 @@
       alarm_cancel(p_ccb->l2c_ccb_timer);
 
       /* If failure was channel mode try to renegotiate */
-      if (l2c_fcr_renegotiate_chan(p_ccb, p_cfg) == false) {
+      if (!l2c_fcr_renegotiate_chan(p_ccb, p_cfg)) {
         L2CAP_TRACE_API(
             "L2CAP - Calling Config_Rsp_Cb(), CID: 0x%04x, Failure: %d",
             p_ccb->local_cid, p_cfg->result);
diff --git a/system/stack/l2cap/l2c_fcr.cc b/system/stack/l2cap/l2c_fcr.cc
index 0e5a84a..06d101f 100644
--- a/system/stack/l2cap/l2c_fcr.cc
+++ b/system/stack/l2cap/l2c_fcr.cc
@@ -375,7 +375,7 @@
   CHECK(p_ccb != NULL);
   if (p_ccb->peer_cfg.fcr.mode == L2CAP_FCR_ERTM_MODE) {
     /* Check if remote side flowed us off or the transmit window is full */
-    if ((p_ccb->fcrb.remote_busy == true) ||
+    if ((p_ccb->fcrb.remote_busy) ||
         (fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q) >=
          p_ccb->peer_cfg.fcr.tx_win_sz)) {
 #if (L2CAP_ERTM_STATS == TRUE)
@@ -802,8 +802,7 @@
   /* If a window has opened, check if we can send any more packets */
   if ((!fixed_queue_is_empty(p_ccb->fcrb.retrans_q) ||
        !fixed_queue_is_empty(p_ccb->xmit_hold_q)) &&
-      (p_ccb->fcrb.wait_ack == false) &&
-      (l2c_fcr_is_flow_controlled(p_ccb) == false)) {
+      (!p_ccb->fcrb.wait_ack) && (!l2c_fcr_is_flow_controlled(p_ccb))) {
     l2c_link_check_send_pkts(p_ccb->p_lcb, NULL, NULL);
   }
 }
@@ -1489,7 +1488,7 @@
     }
   }
 
-  if (packet_ok == false) {
+  if (!packet_ok) {
     osi_free(p_buf);
   } else if (p_buf != NULL) {
 #if (L2CAP_NUM_FIXED_CHNLS > 0)
@@ -1831,7 +1830,7 @@
   }
 
   /* Get a new buffer and copy the data that can be sent in a PDU */
-  if (first_seg == true)
+  if (first_seg)
     p_xmit = l2c_fcr_clone_buf(p_buf, L2CAP_LCC_OFFSET, no_of_bytes_to_send);
   else
     p_xmit = l2c_fcr_clone_buf(p_buf, L2CAP_MIN_OFFSET, no_of_bytes_to_send);
@@ -1840,7 +1839,7 @@
     p_buf->event = p_ccb->local_cid;
     p_xmit->event = p_ccb->local_cid;
 
-    if (first_seg == true) {
+    if (first_seg) {
       p_xmit->offset -= L2CAP_LCC_SDU_LENGTH; /* for writing the SDU length. */
       p = (uint8_t*)(p_xmit + 1) + p_xmit->offset;
       UINT16_TO_STREAM(p, sdu_len);
@@ -1860,7 +1859,7 @@
     return (NULL);
   }
 
-  if (last_seg == true) {
+  if (last_seg) {
     p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_ccb->xmit_hold_q);
     osi_free(p_buf);
   }
diff --git a/system/stack/l2cap/l2c_link.cc b/system/stack/l2cap/l2c_link.cc
index bd4a610..356793d 100644
--- a/system/stack/l2cap/l2c_link.cc
+++ b/system/stack/l2cap/l2c_link.cc
@@ -523,7 +523,7 @@
 
       p_ccb = pn;
     }
-    if (p_lcb->link_state == LST_CONNECTING && l2cb.is_ble_connecting == true) {
+    if (p_lcb->link_state == LST_CONNECTING && l2cb.is_ble_connecting) {
       L2CA_CancelBleConnectReq(l2cb.ble_connecting_bda);
     }
     /* Release the LCB */
diff --git a/system/stack/l2cap/l2c_utils.cc b/system/stack/l2cap/l2c_utils.cc
index e77dade..b8ce36a 100644
--- a/system/stack/l2cap/l2c_utils.cc
+++ b/system/stack/l2cap/l2c_utils.cc
@@ -1835,7 +1835,7 @@
     /* Make sure MTU is at least the minimum */
     if (p_cfg->mtu >= L2CAP_MIN_MTU) {
       /* In basic mode, limit the MTU to our buffer size */
-      if ((p_cfg->fcr_present == false) && (p_cfg->mtu > L2CAP_MTU_SIZE))
+      if ((!p_cfg->fcr_present) && (p_cfg->mtu > L2CAP_MTU_SIZE))
         p_cfg->mtu = L2CAP_MTU_SIZE;
 
       /* Save the accepted value in case of renegotiation */
@@ -2139,9 +2139,9 @@
 
       L2CAP_TRACE_API(
           "l2cu_create_conn - btm_is_sco_active_by_bdaddr() is_sco_active = %s",
-          (is_sco_active == true) ? "true" : "false");
+          (is_sco_active) ? "true" : "false");
 
-      if (is_sco_active == true)
+      if (is_sco_active)
         continue; /* No Master Slave switch not allowed when SCO Active */
 #endif
       /*4_1_TODO check  if btm_cb.devcb.local_features to be used instead */
diff --git a/system/stack/mcap/mca_dact.cc b/system/stack/mcap/mca_dact.cc
index d05f3cd..f1c2112 100644
--- a/system/stack/mcap/mca_dact.cc
+++ b/system/stack/mcap/mca_dact.cc
@@ -111,7 +111,7 @@
  *
  ******************************************************************************/
 void mca_dcb_do_disconn(tMCA_DCB* p_dcb, UNUSED_ATTR tMCA_DCB_EVT* p_data) {
-  if ((p_dcb->lcid == 0) || (L2CA_DisconnectReq(p_dcb->lcid) == false)) {
+  if ((p_dcb->lcid == 0) || (!L2CA_DisconnectReq(p_dcb->lcid))) {
     tMCA_CLOSE close;
     close.param = MCA_INT;
     close.reason = L2CAP_DISC_OK;
diff --git a/system/stack/rfcomm/port_api.cc b/system/stack/rfcomm/port_api.cc
index b32e038..c949c3c 100644
--- a/system/stack/rfcomm/port_api.cc
+++ b/system/stack/rfcomm/port_api.cc
@@ -1418,9 +1418,9 @@
   }
   int available = 0;
   // if(ioctl(fd, FIONREAD, &available) < 0)
-  if (p_port->p_data_co_callback(
-          handle, (uint8_t*)&available, sizeof(available),
-          DATA_CO_CALLBACK_TYPE_OUTGOING_SIZE) == false) {
+  if (!p_port->p_data_co_callback(handle, (uint8_t*)&available,
+                                  sizeof(available),
+                                  DATA_CO_CALLBACK_TYPE_OUTGOING_SIZE)) {
     RFCOMM_TRACE_ERROR(
         "p_data_co_callback DATA_CO_CALLBACK_TYPE_INCOMING_SIZE failed, "
         "available:%d",
@@ -1443,9 +1443,9 @@
       (((int)p_buf->len + available) <= (int)length)) {
     // if(recv(fd, (uint8_t *)(p_buf + 1) + p_buf->offset + p_buf->len,
     // available, 0) != available)
-    if (p_port->p_data_co_callback(
+    if (!p_port->p_data_co_callback(
             handle, (uint8_t*)(p_buf + 1) + p_buf->offset + p_buf->len,
-            available, DATA_CO_CALLBACK_TYPE_OUTGOING) == false)
+            available, DATA_CO_CALLBACK_TYPE_OUTGOING))
 
     {
       error(
@@ -1499,9 +1499,9 @@
     // memcpy ((uint8_t *)(p_buf + 1) + p_buf->offset, p_data, length);
     // if(recv(fd, (uint8_t *)(p_buf + 1) + p_buf->offset, (int)length, 0) !=
     // (int)length)
-    if (p_port->p_data_co_callback(
-            handle, (uint8_t*)(p_buf + 1) + p_buf->offset, length,
-            DATA_CO_CALLBACK_TYPE_OUTGOING) == false) {
+    if (!p_port->p_data_co_callback(handle,
+                                    (uint8_t*)(p_buf + 1) + p_buf->offset,
+                                    length, DATA_CO_CALLBACK_TYPE_OUTGOING)) {
       error(
           "p_data_co_callback DATA_CO_CALLBACK_TYPE_OUTGOING failed, length:%d",
           length);
diff --git a/system/stack/rfcomm/rfc_utils.cc b/system/stack/rfcomm/rfc_utils.cc
index baf9aa0..fcdf363 100644
--- a/system/stack/rfcomm/rfc_utils.cc
+++ b/system/stack/rfcomm/rfc_utils.cc
@@ -380,8 +380,7 @@
 
     RFCOMM_TRACE_EVENT("rfc_inc_credit:%d", p_port->credit_tx);
 
-    if (p_port->tx.peer_fc == true)
-      PORT_FlowInd(p_port->rfc.p_mcb, p_port->dlci, true);
+    if (p_port->tx.peer_fc) PORT_FlowInd(p_port->rfc.p_mcb, p_port->dlci, true);
   }
 }
 
@@ -426,7 +425,7 @@
   }
 
   /* handle queue if L2CAP not congested */
-  while (p_mcb->l2cap_congested == false) {
+  while (!p_mcb->l2cap_congested) {
     BT_HDR* p = (BT_HDR*)fixed_queue_try_dequeue(p_mcb->cmd_q);
     if (p == NULL) break;
     L2CA_DataWrite(p_mcb->lcid, p);
diff --git a/system/stack/sdp/sdp_api.cc b/system/stack/sdp/sdp_api.cc
index 8800d07..d82cc2f 100644
--- a/system/stack/sdp/sdp_api.cc
+++ b/system/stack/sdp/sdp_api.cc
@@ -720,7 +720,7 @@
         if (SDP_DISC_ATTR_TYPE(p_sattr->attr_len_type) ==
             DATA_ELE_SEQ_DESC_TYPE) {
           ret = sdp_fill_proto_elem(p_sattr, layer_uuid, p_elem);
-          if (ret == true) break;
+          if (ret) break;
         }
       }
       return ret;
@@ -999,8 +999,7 @@
   if (p_device_info == NULL) return SDP_ILLEGAL_PARAMETER;
 
   /* if record is to be primary record, get handle to replace old primary */
-  if (p_device_info->primary_record == true &&
-      sdp_cb.server_db.di_primary_handle)
+  if (p_device_info->primary_record && sdp_cb.server_db.di_primary_handle)
     handle = sdp_cb.server_db.di_primary_handle;
   else {
     handle = SDP_CreateRecord();
@@ -1011,7 +1010,7 @@
 
   /* build the SDP entry */
   /* Add the UUID to the Service Class ID List */
-  if ((SDP_AddServiceClassIdList(handle, 1, &di_uuid)) == false)
+  if (!(SDP_AddServiceClassIdList(handle, 1, &di_uuid)))
     result = SDP_DI_REG_FAILED;
 
   /* mandatory */
@@ -1108,7 +1107,7 @@
 
   if (result != SDP_SUCCESS)
     SDP_DeleteRecord(handle);
-  else if (p_device_info->primary_record == true)
+  else if (p_device_info->primary_record)
     sdp_cb.server_db.di_primary_handle = handle;
 
   return result;
diff --git a/system/stack/sdp/sdp_server.cc b/system/stack/sdp/sdp_server.cc
index e0639d8..fe2df6b 100644
--- a/system/stack/sdp/sdp_server.cc
+++ b/system/stack/sdp/sdp_server.cc
@@ -591,7 +591,7 @@
        p_rec; p_rec = sdp_db_service_search(p_rec, &uid_seq)) {
     /* Allow space for attribute sequence type and length */
     p_seq_start = p_rsp;
-    if (p_ccb->cont_info.last_attr_seq_desc_sent == false) {
+    if (!p_ccb->cont_info.last_attr_seq_desc_sent) {
       /* See if there is enough room to include a new service in the current
        * response */
       rem_len = max_list_len - (int16_t)(p_rsp - &p_ccb->rsp_list[0]);
@@ -666,7 +666,7 @@
     }
 
     /* Go back and put the type and length into the buffer */
-    if (p_ccb->cont_info.last_attr_seq_desc_sent == false) {
+    if (!p_ccb->cont_info.last_attr_seq_desc_sent) {
       seq_len = sdpu_get_attrib_seq_len(p_rec, &attr_seq_sav);
       if (seq_len != 0) {
         UINT8_TO_BE_STREAM(p_seq_start,
diff --git a/system/stack/sdp/sdp_utils.cc b/system/stack/sdp/sdp_utils.cc
index 76dc33a..86ea6f7 100644
--- a/system/stack/sdp/sdp_utils.cc
+++ b/system/stack/sdp/sdp_utils.cc
@@ -756,7 +756,7 @@
   uint16_t start_id = 0, end_id = 0;
 
   for (xx = 0; xx < attr_seq->num_attr; xx++) {
-    if (is_range == false) {
+    if (!is_range) {
       start_id = attr_seq->attr_entry[xx].start;
       end_id = attr_seq->attr_entry[xx].end;
     }
diff --git a/system/stack/srvc/srvc_dis.cc b/system/stack/srvc/srvc_dis.cc
index 3997984..8ddfdf9 100644
--- a/system/stack/srvc/srvc_dis.cc
+++ b/system/stack/srvc/srvc_dis.cc
@@ -136,7 +136,7 @@
     if (handle == p_db_attr->handle) {
       if ((p_db_attr->uuid == GATT_UUID_PNP_ID ||
            p_db_attr->uuid == GATT_UUID_SYSTEM_ID) &&
-          is_long == true) {
+          is_long) {
         st = GATT_NOT_LONG;
         break;
       }