summaryrefslogtreecommitdiffstats
path: root/btif/src
diff options
context:
space:
mode:
authorEthan Chen <intervigil@gmail.com>2016-06-22 15:30:13 -0700
committerEthan Chen <intervigil@gmail.com>2016-06-22 15:31:23 -0700
commit2e63e65c7a558415f64a1957bd9cc060ab10f64e (patch)
treea9a728c280a466060d332f043d25f403ce3828b5 /btif/src
parent0af4949c92fa6a3d260a6e5e81004f36e443095c (diff)
downloadandroid_system_bt-2e63e65c7a558415f64a1957bd9cc060ab10f64e.tar.gz
android_system_bt-2e63e65c7a558415f64a1957bd9cc060ab10f64e.tar.bz2
android_system_bt-2e63e65c7a558415f64a1957bd9cc060ab10f64e.zip
bt: Don't use CLOCK_BOOTTIME where CLOCK_MONOTONIC was expected
* Commit c71852721a6c97c020c554639ddea0d0c5b7410c changed several calls to clock_gettime(CLOCK_MONOTONIC, ...) to use time_now_timespec, which uses CLOCK_BOOTTIME. Change-Id: Icad8aecc559db24b34cc188484030865d3458cf2
Diffstat (limited to 'btif/src')
-rw-r--r--btif/src/btif_hf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/btif/src/btif_hf.c b/btif/src/btif_hf.c
index bdaf69ec9..43707adfc 100644
--- a/btif/src/btif_hf.c
+++ b/btif/src/btif_hf.c
@@ -391,7 +391,7 @@ static int btif_hf_latest_connected_idx()
struct timespec now, conn_time_delta;
int latest_conn_idx = BTIF_HF_INVALID_IDX, i;
- time_now_timespec(&now);
+ clock_gettime(CLOCK_MONOTONIC, &now);
conn_time_delta.tv_sec = now.tv_sec;
for (i = 0; i < btif_max_hf_clients; i++)
@@ -555,7 +555,8 @@ static void btif_hf_upstreams_evt(UINT16 event, char* p_param)
break;
case BTA_AG_CONN_EVT:
- time_now_timespec(&btif_hf_cb[idx].connected_timestamp);
+ clock_gettime(CLOCK_MONOTONIC,
+ &btif_hf_cb[idx].connected_timestamp);
BTIF_TRACE_DEBUG("%s: BTA_AG_CONN_EVT, idx = %d ",
__FUNCTION__, idx);
btif_hf_cb[idx].peer_feat = p_data->conn.peer_feat;
@@ -1401,7 +1402,7 @@ static bt_status_t phone_state_change(int num_active, int num_held, bthf_call_st
(btif_hf_cb[idx].num_active) ||(btif_hf_cb[idx].num_held))
{
BTIF_TRACE_DEBUG("%s: Record call termination timestamp", __FUNCTION__);
- time_now_timespec(&btif_hf_cb[0].call_end_timestamp);
+ clock_gettime(CLOCK_MONOTONIC, &btif_hf_cb[0].call_end_timestamp);
}
BTA_AgResult (BTA_AG_HANDLE_ALL, BTA_AG_END_CALL_RES, NULL);
hf_idx = BTIF_HF_INVALID_IDX;
@@ -1646,7 +1647,7 @@ BOOLEAN btif_hf_call_terminated_recently()
{
struct timespec now;
- time_now_timespec(&now);
+ clock_gettime(CLOCK_MONOTONIC, &now);
if (now.tv_sec < btif_hf_cb[0].call_end_timestamp.tv_sec +
BTIF_HF_CALL_END_TIMEOUT)
{