summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Zhang <lukez@codeaurora.org>2016-09-14 15:49:03 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-10-23 23:50:13 -0700
commitae8dc96fa9f39e8adab9f392818610b19da9f622 (patch)
treec561baa05763d1a493ec58f1dfffaa8055ef2310
parent9d723738e8d51b2a42f1a2fddee3cdae170484d2 (diff)
downloadbt-ae8dc96fa9f39e8adab9f392818610b19da9f622.tar.gz
Enable LPM mode by changing BT_VND_OP_LPM_SET_MODE handler
In BT_VND_OP_LPM_SET_MODE handler, if LPM mode is configured, we will return success enable LPM mode, so that BT stack can hold wake lock through LPM mode. We added a new persistent property to configure it Change-Id: I4350a8d88d845cf9c7a1d80ea659763cc5309399
-rw-r--r--libbt-vendor/src/bt_vendor_qcom.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libbt-vendor/src/bt_vendor_qcom.c b/libbt-vendor/src/bt_vendor_qcom.c
index 6586f36..47b735f 100644
--- a/libbt-vendor/src/bt_vendor_qcom.c
+++ b/libbt-vendor/src/bt_vendor_qcom.c
@@ -725,6 +725,7 @@ static int __op(bt_vendor_opcode_t opcode, void *param)
char wipower_status[PROPERTY_VALUE_MAX];
char emb_wp_mode[PROPERTY_VALUE_MAX];
char bt_version[PROPERTY_VALUE_MAX];
+ char lpm_config[PROPERTY_VALUE_MAX];
bool ignore_boot_prop = TRUE;
#ifdef READ_BT_ADDR_FROM_PROP
int i = 0;
@@ -1151,8 +1152,21 @@ userial_open:
}
q->cb->lpm_cb(BT_VND_OP_RESULT_SUCCESS);
} else {
- /* respond with failure as it's handled by other mechanism */
- q->cb->lpm_cb(BT_VND_OP_RESULT_FAIL);
+ int lpm_result = BT_VND_OP_RESULT_SUCCESS;
+
+ property_get("persist.service.bdroid.lpmcfg", lpm_config, "all");
+ ALOGI("%s: property_get: persist.service.bdroid.lpmcfg: %s",
+ __func__, lpm_config);
+
+ if (!strcmp(lpm_config, "all")) {
+ // respond with success since we want to hold wake lock through LPM
+ lpm_result = BT_VND_OP_RESULT_SUCCESS;
+ }
+ else {
+ lpm_result = BT_VND_OP_RESULT_FAIL;
+ }
+
+ q->cb->lpm_cb(lpm_result);
}
break;