Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c70c5703 authored by Jack He's avatar Jack He Committed by android-build-merger
Browse files

HFP: Use disableinbandringing instead of enableinbandringing

am: 04240317

Change-Id: Ia9187da1a44978410bfcac41eb1b48eb86e2cfaf
parents 6b2fc3f0 04240317
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -626,12 +626,12 @@ static void bte_hf_evt(tBTA_AG_EVT event, tBTA_AG* p_data) {
  ASSERTC(status == BT_STATUS_SUCCESS, "context transfer failed", status);
}

static bool inband_ringing_property_enabled() {
  char inband_ringing_flag[PROPERTY_VALUE_MAX] = {0};
  osi_property_get("persist.bluetooth.enableinbandringing", inband_ringing_flag,
                   "true");
  if (strncmp(inband_ringing_flag, "true", 4) == 0) {
    BTIF_TRACE_DEBUG("%s: In-band ringing enabled by property", __func__);
static bool inband_ringing_property_disabled() {
  char disable_inband_ringing_flag[PROPERTY_VALUE_MAX] = {0};
  osi_property_get("persist.bluetooth.disableinbandringing",
                   disable_inband_ringing_flag, "false");
  if (strncmp(disable_inband_ringing_flag, "true", 4) == 0) {
    BTIF_TRACE_DEBUG("%s: In-band ringing disabled by property", __func__);
    return true;
  }
  return false;
@@ -737,8 +737,8 @@ class HeadsetInterface : Interface {

bt_status_t HeadsetInterface::Init(Callbacks* callbacks, int max_hf_clients,
                                   bool inband_ringing_supported) {
  bool inband_ringing_property_enable = inband_ringing_property_enabled();
  if (inband_ringing_supported && inband_ringing_property_enable) {
  bool inband_ringing_property_disable = inband_ringing_property_disabled();
  if (inband_ringing_supported && !inband_ringing_property_disable) {
    btif_hf_features |= BTA_AG_FEAT_INBAND;
  } else {
    btif_hf_features &= ~BTA_AG_FEAT_INBAND;
@@ -748,7 +748,7 @@ bt_status_t HeadsetInterface::Init(Callbacks* callbacks, int max_hf_clients,
      "%s: btif_hf_features=%zu, max_hf_clients=%d, "
      "inband_ringing=[supported=%d, enabled=%d]",
      __func__, btif_hf_features, btif_max_hf_clients, inband_ringing_supported,
      inband_ringing_property_enable);
      !inband_ringing_property_disable);
  bt_hf_callbacks = callbacks;
  for (btif_hf_cb_t& hf_cb : btif_hf_cb) {
    hf_cb = {};