summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--audio_a2dp_hw/audio_a2dp_hw.c6
-rw-r--r--btif/src/btif_hf.c9
2 files changed, 8 insertions, 7 deletions
diff --git a/audio_a2dp_hw/audio_a2dp_hw.c b/audio_a2dp_hw/audio_a2dp_hw.c
index 9cee5d0f2..1933d5a75 100644
--- a/audio_a2dp_hw/audio_a2dp_hw.c
+++ b/audio_a2dp_hw/audio_a2dp_hw.c
@@ -188,7 +188,7 @@ static void ts_error_log(char *tag, int val, int buff_size, struct a2dp_config c
unsigned long long now_us;
unsigned long long diff_us;
- time_now_timespec(&now);
+ clock_gettime(CLOCK_MONOTONIC, &now);
now_us = now.tv_sec*USEC_PER_SEC + now.tv_nsec/1000;
@@ -211,7 +211,7 @@ static void ts_log(char *tag, int val, struct timespec *pprev_opt)
UNUSED(tag);
UNUSED(val);
- time_now_timespec(&now);
+ clock_gettime(CLOCK_MONOTONIC, &now);
now_us = now.tv_sec*USEC_PER_SEC + now.tv_nsec/1000;
@@ -991,7 +991,7 @@ static int out_get_presentation_position(const struct audio_stream_out *stream,
uint64_t latency_frames = (uint64_t)out_get_latency(stream) * out->common.cfg.rate / 1000;
if (out->frames_presented >= latency_frames) {
*frames = out->frames_presented - latency_frames;
- time_now_timespec(timestamp); // could also be associated with out_write().
+ clock_gettime(CLOCK_MONOTONIC, timestamp); // could also be associated with out_write().
ret = 0;
}
pthread_mutex_unlock(&out->common.lock);
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)
{