summaryrefslogtreecommitdiffstats
path: root/hci
diff options
context:
space:
mode:
authortturney <tturney@google.com>2015-08-31 15:16:59 -0700
committertturney <tturney@google.com>2015-08-31 15:16:59 -0700
commit65d1c84f5b4c2d452b4927ab7f8670a4951db3ce (patch)
tree20f08d715c678fc9d84ce582bcf4fccf7f7cf0e5 /hci
parent0908eac54232fd876e355baf50c74edd91f2b89a (diff)
downloadandroid_system_bt-65d1c84f5b4c2d452b4927ab7f8670a4951db3ce.tar.gz
android_system_bt-65d1c84f5b4c2d452b4927ab7f8670a4951db3ce.tar.bz2
android_system_bt-65d1c84f5b4c2d452b4927ab7f8670a4951db3ce.zip
Fix btwrite timer timeout for Angler (2/2)
When calculating the appropriate LPM's idle timeout, the local chip name was NULL. This is fixed by calculating LMP's idle timeout when the chip is enabling. Bug: 23248798 Change-Id: I8ee2b28fb4363359e035e242fdcff8a736ee448c
Diffstat (limited to 'hci')
-rw-r--r--hci/src/low_power_manager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hci/src/low_power_manager.c b/hci/src/low_power_manager.c
index 9435e4fe1..f5345ef4e 100644
--- a/hci/src/low_power_manager.c
+++ b/hci/src/low_power_manager.c
@@ -79,7 +79,6 @@ static void init(thread_t *post_thread) {
thread = post_thread;
vendor->set_callback(VENDOR_SET_LPM_MODE, vendor_enable_disable_callback);
- vendor->send_command(VENDOR_GET_LPM_IDLE_TIMEOUT, &idle_timeout_ms);
idle_alarm = alarm_new();
if (!idle_alarm) {
@@ -147,6 +146,8 @@ static void enable(bool enable) {
} else {
uint8_t command = enable ? BT_VND_LPM_ENABLE : BT_VND_LPM_DISABLE;
state = enable ? LPM_ENABLING : LPM_DISABLING;
+ if (state == LPM_ENABLING)
+ vendor->send_command(VENDOR_GET_LPM_IDLE_TIMEOUT, &idle_timeout_ms);
vendor->send_async_command(VENDOR_SET_LPM_MODE, &command);
}
}