Home | History | Annotate | Download | only in sensorservice

Lines Matching refs:connection

286             sp<SensorEventConnection> connection(mActiveConnections[i].promote());
287 if (connection != 0) {
288 result.appendFormat("Connection Number: %d \n", i);
289 connection->dump(result);
297 void SensorService::cleanupAutoDisabledSensor(const sp<SensorEventConnection>& connection,
305 if (connection->hasSensor(handle)) {
308 sensor->autoDisable(connection.get(), handle);
310 cleanupWithoutDisable(connection, handle);
410 sp<SensorEventConnection> connection(
412 if (connection != 0) {
413 connection->sendEvents(buffer, count, scratch);
415 cleanupAutoDisabledSensor(connection, buffer, count);
508 const wp<SensorEventConnection> connection(c);
524 "removing connection %p for sensor[%d].handle=0x%08x",
527 if (rec && rec->removeConnection(connection)) {
528 ALOGD_IF(DEBUG_CONNECTIONS, "... and it was the last connection");
537 mActiveConnections.remove(connection);
541 status_t SensorService::enable(const sp<SensorEventConnection>& connection,
554 rec = new SensorRecord(connection);
560 if (rec->addConnection(connection)) {
562 // connection that uses it. Immediately send down the last
569 connection->sendEvents(&event, 1);
575 if (connection->addSensor(handle)) {
576 BatteryService::enableSensor(connection->getUid(), handle);
578 // so, see if this connection becomes active
579 if (mActiveConnections.indexOf(connection) < 0) {
580 mActiveConnections.add(connection);
583 ALOGW("sensor %08x already enabled in connection %p (ignoring)",
584 handle, connection.get());
595 status_t err = sensor->batch(connection.get(), handle, reservedFlags, samplingPeriodNs,
598 connection->setFirstFlushPending(handle, true);
599 status_t err_flush = sensor->flush(connection.get(), handle);
603 connection->setFirstFlushPending(handle, false);
609 err = sensor->activate(connection.get(), true);
614 cleanupWithoutDisableLocked(connection, handle);
619 status_t SensorService::disable(const sp<SensorEventConnection>& connection,
626 status_t err = cleanupWithoutDisableLocked(connection, handle);
629 err = sensor ? sensor->activate(connection.get(), false) : status_t(BAD_VALUE);
635 const sp<SensorEventConnection>& connection, int handle) {
637 return cleanupWithoutDisableLocked(connection, handle);
641 const sp<SensorEventConnection>& connection, int handle) {
644 // see if this connection becomes inactive
645 if (connection->removeSensor(handle)) {
646 BatteryService::disableSensor(connection->getUid(), handle);
648 if (connection->hasAnySensor() == false) {
649 mActiveConnections.remove(connection);
652 if (rec->removeConnection(connection)) {
662 status_t SensorService::setEventRate(const sp<SensorEventConnection>& connection,
680 return sensor->setDelay(connection.get(), handle, ns);
683 status_t SensorService::flushSensor(const sp<SensorEventConnection>& connection,
694 return sensor->flush(connection.get(), handle);
699 const sp<SensorEventConnection>& connection)
701 mConnections.add(connection);
705 const sp<SensorEventConnection>& connection)
707 if (mConnections.indexOf(connection) < 0) {
708 mConnections.add(connection);
715 const wp<SensorEventConnection>& connection)
717 ssize_t index = mConnections.indexOf(connection);
802 // filter out events not for this connection
813 // Setting curr to the correct sensor to ensure the sensor events per connection are
821 // this sensor on this connection.
847 // Loop through all the sensors for this connection and check if there are any pending
866 // Early return if there are no events for this connection.
932 // Loop through all sensors for this connection and call flush on each of them.