Lines Matching defs:handle

210     // add to our handle->SensorInterface mapping
334 int handle = mActiveSensors.keyAt(i);
335 result.appendFormat("%s (handle=0x%08x, connections=%zu)\n",
336 getSensorName(handle).string(),
337 handle,
361 int handle = buffer[i].sensor;
363 handle = buffer[i].meta_data.sensor;
365 if (connection->hasSensor(handle)) {
366 SensorInterface* sensor = mSensorMap.valueFor(handle);
371 sensor->autoDisable(connection.get(), handle);
372 cleanupWithoutDisableLocked(connection, handle);
431 // handle virtual sensors
469 // handle backward compatibility for RotationVector sensor
607 String8 SensorService::getSensorName(int handle) const {
611 if (sensor.getHandle() == handle) {
619 bool SensorService::isVirtualSensor(int handle) const {
620 SensorInterface* sensor = mSensorMap.valueFor(handle);
625 int handle = event.sensor;
627 handle = event.meta_data.sensor;
629 SensorInterface* sensor = mSensorMap.valueFor(handle);
634 SensorService::SensorRecord * SensorService::getSensorRecord(int handle) {
635 return mActiveSensors.valueFor(handle);
675 int handle = mActiveSensors.keyAt(i);
676 if (c->hasSensor(handle)) {
677 ALOGD_IF(DEBUG_CONNECTIONS, "%zu: disabling handle=0x%08x", i, handle);
678 SensorInterface* sensor = mSensorMap.valueFor( handle );
679 ALOGE_IF(!sensor, "mSensorMap[handle=0x%08x] is null!", handle);
683 c->removeSensor(handle);
686 ALOGE_IF(!rec, "mActiveSensors[%zu] is null (handle=0x%08x)!", i, handle);
688 "removing connection %p for sensor[%zu].handle=0x%08x",
689 c, i, handle);
694 mActiveVirtualSensors.removeItem(handle);
709 Sensor SensorService::getSensorFromHandle(int handle) const {
710 return mSensorMap.valueFor(handle)->getSensor();
714 int handle, nsecs_t samplingPeriodNs, nsecs_t maxBatchReportLatencyNs, int reservedFlags)
719 SensorInterface* sensor = mSensorMap.valueFor(handle);
729 SensorRecord* rec = mActiveSensors.valueFor(handle);
732 mActiveSensors.add(handle, rec);
734 mActiveVirtualSensors.add(handle, sensor);
744 sensors_event_t& event(mLastEventSeen.editValueFor(handle));
758 if (connection->addSensor(handle)) {
759 BatteryService::enableSensor(connection->getUid(), handle);
767 handle, connection.get());
775 ALOGD_IF(DEBUG_CONNECTIONS, "Calling batch handle==%d flags=%d"
777 handle, reservedFlags, samplingPeriodNs, maxBatchReportLatencyNs);
779 status_t err = sensor->batch(connection.get(), handle, reservedFlags, samplingPeriodNs,
787 connection->setFirstFlushPending(handle, true);
788 status_t err_flush = sensor->flush(connection.get(), handle);
793 connection->setFirstFlushPending(handle, false);
798 ALOGD_IF(DEBUG_CONNECTIONS, "Calling activate on %d", handle);
808 cleanupWithoutDisableLocked(connection, handle);
814 int handle)
820 status_t err = cleanupWithoutDisableLocked(connection, handle);
822 SensorInterface* sensor = mSensorMap.valueFor(handle);
829 const sp<SensorEventConnection>& connection, int handle) {
831 return cleanupWithoutDisableLocked(connection, handle);
835 const sp<SensorEventConnection>& connection, int handle) {
836 SensorRecord* rec = mActiveSensors.valueFor(handle);
839 if (connection->removeSensor(handle)) {
840 BatteryService::disableSensor(connection->getUid(), handle);
848 mActiveSensors.removeItem(handle);
849 mActiveVirtualSensors.removeItem(handle);
858 int handle, nsecs_t ns)
863 SensorInterface* sensor = mSensorMap.valueFor(handle);
879 return sensor->setDelay(connection.get(), handle, ns);
890 const int handle = connection->mSensorInfo.keyAt(i);
891 SensorInterface* sensor = mSensorMap.valueFor(handle);
897 if (halVersion <= SENSORS_DEVICE_API_VERSION_1_0 || isVirtualSensor(handle)) {
900 connection->incrementPendingFlushCount(handle);
902 status_t err_flush = sensor->flush(connection.get(), handle);
904 SensorRecord* rec = mActiveSensors.valueFor(handle);
1091 bool SensorService::SensorEventConnection::addSensor(int32_t handle) {
1093 if (!verifyCanAccessSensor(mService->getSensorFromHandle(handle), "Tried adding")) {
1096 if (mSensorInfo.indexOfKey(handle) < 0) {
1097 mSensorInfo.add(handle, FlushInfo());
1103 bool SensorService::SensorEventConnection::removeSensor(int32_t handle) {
1105 if (mSensorInfo.removeItem(handle) >= 0) {
1111 bool SensorService::SensorEventConnection::hasSensor(int32_t handle) const {
1113 return mSensorInfo.indexOfKey(handle) >= 0;
1124 const int handle = mSensorInfo.keyAt(i);
1125 if (mService->getSensorFromHandle(handle).getReportingMode() == AREPORTING_MODE_ONE_SHOT) {
1132 void SensorService::SensorEventConnection::setFirstFlushPending(int32_t handle,
1135 ssize_t index = mSensorInfo.indexOfKey(handle);
1164 const int handle = mSensorInfo.keyAt(i);
1165 if (mService->getSensorFromHandle(handle).isWakeUpSensor()) {
1192 void SensorService::SensorEventConnection::incrementPendingFlushCount(int32_t handle) {
1194 ssize_t index = mSensorInfo.indexOfKey(handle);
1492 int handle, bool enabled, nsecs_t samplingPeriodNs, nsecs_t maxBatchReportLatencyNs,
1497 err = mService->enable(this, handle, samplingPeriodNs, maxBatchReportLatencyNs,
1501 err = mService->disable(this, handle);
1507 int handle, nsecs_t samplingPeriodNs)
1509 return mService->setEventRate(this, handle, samplingPeriodNs);