unsigned int min_interval = POLL_MAX_HZ_MS;
unsigned int min_latency = std::numeric_limits<unsigned int>::max();
- bool active_sensor_found = false;
unsigned int _interval;
unsigned int _latency;
while (it_handle != m_sensor_handle_infos.end()) {
if ((it_handle->second.m_sensor_id == sensor) &&
- (it_handle->second.m_sensor_state == SENSOR_STATE_STARTED)) {
- active_sensor_found = true;
- it_handle->second.get_batch(_interval, _latency);
- min_interval = (_interval < min_interval) ? _interval : min_interval;
- min_latency = (_latency < min_latency) ? _latency : min_latency;
+ it_handle->second.is_started()) {
+ it_handle->second.get_batch(_interval, _latency);
+ min_interval = (_interval < min_interval) ? _interval : min_interval;
+ min_latency = (_latency < min_latency) ? _latency : min_latency;
}
++it_handle;
}
- if (!active_sensor_found) {
+ if (!is_sensor_active(sensor)) {
_D("Active sensor[%#llx] is not found for client %s", sensor, get_client_name());
return false;
}
unsigned int sensor_client_info::get_active_pause_policy(sensor_id_t sensor)
{
int active_pause = SENSORD_PAUSE_ALL;
- bool active_sensor_found = false;
int pause;
AUTOLOCK(m_handle_info_lock);
while (it_handle != m_sensor_handle_infos.end()) {
if ((it_handle->second.m_sensor_id == sensor) &&
- (it_handle->second.m_sensor_state == SENSOR_STATE_STARTED)) {
- active_sensor_found = true;
- pause = it_handle->second.m_pause_policy;
- active_pause = (pause < active_pause) ? pause: active_pause;
+ it_handle->second.is_started()) {
+ pause = it_handle->second.m_pause_policy;
+ active_pause = (pause < active_pause) ? pause: active_pause;
}
++it_handle;
}
- if (!active_sensor_found)
+ if (!is_sensor_active(sensor))
_D("Active sensor[%#llx] is not found for client %s", sensor, get_client_name());
return active_pause;
while (it_handle != m_sensor_handle_infos.end()) {
if ((it_handle->second.m_sensor_id == sensor) &&
- (it_handle->second.m_sensor_state == SENSOR_STATE_STARTED))
- it_handle->second.get_reg_event_types(event_types);
+ it_handle->second.is_started())
+ it_handle->second.get_reg_event_types(event_types);
++it_handle;
}
while (it_handle != m_sensor_handle_infos.end()) {
if ((it_handle->second.m_sensor_id == sensor) &&
- (it_handle->second.m_sensor_state == SENSOR_STATE_STARTED))
+ it_handle->second.is_started())
return true;
++it_handle;