p_tle->event = type;
// NOTE: This value is in seconds but stored in a ticks field.
p_tle->ticks = timeout_sec;
+ if (p_tle->in_use == TRUE)
+ ALOGW("%s Starting alarm already in use\n", __func__);
+ p_tle->in_use = TRUE;
alarm_set(alarm, (period_ms_t)(timeout_sec * 1000), btu_general_alarm_cb, (void *)p_tle);
}
void btu_stop_timer(TIMER_LIST_ENT *p_tle) {
assert(p_tle != NULL);
+ if (p_tle->in_use == FALSE)
+ return;
+ p_tle->in_use = FALSE;
+
// Get the alarm for the timer list entry.
alarm_t *alarm = hash_map_get(btu_general_alarm_hash_map, p_tle);
if (alarm == NULL) {
p_tle->event = type;
p_tle->ticks = timeout_ticks;
+ if (p_tle->in_use == TRUE)
+ ALOGW("%s Starting alarm already in use\n", __func__);
+ p_tle->in_use = TRUE;
// The quick timer ticks are 100ms long.
alarm_set(alarm, (period_ms_t)(timeout_ticks * 100), btu_l2cap_alarm_cb, (void *)p_tle);
}
void btu_stop_quick_timer(TIMER_LIST_ENT *p_tle) {
assert(p_tle != NULL);
+ if (p_tle->in_use == FALSE)
+ return;
+ p_tle->in_use = FALSE;
+
// Get the alarm for the timer list entry.
alarm_t *alarm = hash_map_get(btu_l2cap_alarm_hash_map, p_tle);
if (alarm == NULL) {
alarm_cancel(alarm);
p_tle->event = type;
+ if (p_tle->in_use == TRUE)
+ ALOGW("%s Starting alarm already in use\n", __func__);
+ p_tle->in_use = TRUE;
// NOTE: This value is in seconds but stored in a ticks field.
p_tle->ticks = timeout_sec;
alarm_set(alarm, (period_ms_t)(timeout_sec * 1000), btu_oneshot_alarm_cb, (void *)p_tle);
void btu_stop_timer_oneshot(TIMER_LIST_ENT *p_tle) {
assert(p_tle != NULL);
+ if (p_tle->in_use == FALSE)
+ return;
+ p_tle->in_use = FALSE;
+
// Get the alarm for the timer list entry.
alarm_t *alarm = hash_map_get(btu_oneshot_alarm_hash_map, p_tle);
if (alarm == NULL) {