From 71de85091506eeeaab6e73cccf0ebd5bb06f2af1 Mon Sep 17 00:00:00 2001 From: Jack He Date: Thu, 7 Dec 2017 15:15:56 -0800 Subject: [PATCH] HFP: Use disableinbandringing instead of enableinbandringing * Use disableinbandringing system property as in-band ringing is enabled by default so an active user choice would disable it instead of enabling it Bug: 65383086 Test: make, try toggling the preference and verify in-band ringing behavior Change-Id: I9b10743960c933b223481d2efb68af538689c507 --- btif/src/btif_hf.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/btif/src/btif_hf.cc b/btif/src/btif_hf.cc index 8b1af73ae..3290949ec 100644 --- a/btif/src/btif_hf.cc +++ b/btif/src/btif_hf.cc @@ -625,12 +625,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; @@ -736,8 +736,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; @@ -747,7 +747,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 = {}; -- 2.11.0