Home | History | Annotate | Download | only in sensorservice

Lines Matching full:handle

224     // add to our handle->SensorInterface mapping
377 int handle = mActiveSensors.keyAt(i);
378 result.appendFormat("%s (handle=0x%08x, connections=%zu)\n",
379 getSensorName(handle).string(),
380 handle,
423 result.appendFormat("%02d:%02d:%02d activated package=%s handle=0x%08x "
429 result.appendFormat("%02d:%02d:%02d de-activated package=%s handle=0x%08x\n",
445 int handle = buffer[i].sensor;
447 handle = buffer[i].meta_data.sensor;
449 if (connection->hasSensor(handle)) {
450 SensorInterface* sensor = mSensorMap.valueFor(handle);
455 sensor->autoDisable(connection.get(), handle);
456 cleanupWithoutDisableLocked(connection, handle);
516 // handle virtual sensors
554 // handle backward compatibility for RotationVector sensor
687 String8 SensorService::getSensorName(int handle) const {
691 if (sensor.getHandle() == handle) {
699 bool SensorService::isVirtualSensor(int handle) const {
700 SensorInterface* sensor = mSensorMap.valueFor(handle);
705 int handle = event.sensor;
707 handle = event.meta_data.sensor;
709 SensorInterface* sensor = mSensorMap.valueFor(handle);
713 SensorService::SensorRecord * SensorService::getSensorRecord(int handle) {
714 return mActiveSensors.valueFor(handle);
792 int handle = mActiveSensors.keyAt(i);
793 if (c->hasSensor(handle)) {
794 ALOGD_IF(DEBUG_CONNECTIONS, "%zu: disabling handle=0x%08x", i, handle);
795 SensorInterface* sensor = mSensorMap.valueFor( handle );
796 ALOGE_IF(!sensor, "mSensorMap[handle=0x%08x] is null!", handle);
800 c->removeSensor(handle);
803 ALOGE_IF(!rec, "mActiveSensors[%zu] is null (handle=0x%08x)!", i, handle);
805 "removing connection %p for sensor[%zu].handle=0x%08x",
806 handle);
811 mActiveVirtualSensors.removeItem(handle);
826 Sensor SensorService::getSensorFromHandle(int handle) const {
827 return mSensorMap.valueFor(handle)->getSensor();
831 int handle, nsecs_t samplingPeriodNs, nsecs_t maxBatchReportLatencyNs, int reservedFlags,
837 SensorInterface* sensor = mSensorMap.valueFor(handle);
852 SensorRecord* rec = mActiveSensors.valueFor(handle);
855 mActiveSensors.add(handle, rec);
857 mActiveVirtualSensors.add(handle, sensor);
867 CircularBuffer *circular_buf = mLastEventSeen.valueFor(handle);
875 event.sensor = handle;
891 if (connection->addSensor(handle)) {
892 BatteryService::enableSensor(connection->getUid(), handle);
900 handle, connection.get());
908 ALOGD_IF(DEBUG_CONNECTIONS, "Calling batch handle==%d flags=%d"
910 handle, reservedFlags, samplingPeriodNs, maxBatchReportLatencyNs);
912 status_t err = sensor->batch(connection.get(), handle, 0, samplingPeriodNs,
920 connection->setFirstFlushPending(handle, true);
921 status_t err_flush = sensor->flush(connection.get(), handle);
926 connection->setFirstFlushPending(handle, false);
931 ALOGD_IF(DEBUG_CONNECTIONS, "Calling activate on %d", handle);
939 reg_info.mSensorHandle = handle;
954 cleanupWithoutDisableLocked(connection, handle);
960 int handle)
966 status_t err = cleanupWithoutDisableLocked(connection, handle);
968 SensorInterface* sensor = mSensorMap.valueFor(handle);
977 reg_info.mSensorHandle = handle;
989 const sp<SensorEventConnection>& connection, int handle) {
991 return cleanupWithoutDisableLocked(connection, handle);
995 const sp<SensorEventConnection>& connection, int handle) {
996 SensorRecord* rec = mActiveSensors.valueFor(handle);
999 if (connection->removeSensor(handle)) {
1000 BatteryService::disableSensor(connection->getUid(), handle);
1008 mActiveSensors.removeItem(handle);
1009 mActiveVirtualSensors.removeItem(handle);
1018 int handle, nsecs_t ns, const String16& opPackageName)
1023 SensorInterface* sensor = mSensorMap.valueFor(handle);
1039 return sensor->setDelay(connection.get(), handle, ns);
1051 const int handle = connection->mSensorInfo.keyAt(i);
1052 SensorInterface* sensor = mSensorMap.valueFor(handle);
1058 if (halVersion <= SENSORS_DEVICE_API_VERSION_1_0 || isVirtualSensor(handle)) {
1061 connection->incrementPendingFlushCount(handle);
1067 status_t err_flush = sensor->flush(connection.get(), handle);
1069 SensorRecord* rec = mActiveSensors.valueFor(handle);
1413 bool SensorService::SensorEventConnection::addSensor(int32_t handle) {
1415 if (!canAccessSensor(mService->getSensorFromHandle(handle),
1419 if (mSensorInfo.indexOfKey(handle) < 0) {
1420 mSensorInfo.add(handle, FlushInfo());
1426 bool SensorService::SensorEventConnection::removeSensor(int32_t handle) {
1428 if (mSensorInfo.removeItem(handle) >= 0) {
1434 bool SensorService::SensorEventConnection::hasSensor(int32_t handle) const {
1436 return mSensorInfo.indexOfKey(handle) >= 0;
1447 const int handle = mSensorInfo.keyAt(i);
1448 if (mService->getSensorFromHandle(handle).getReportingMode() == AREPORTING_MODE_ONE_SHOT) {
1459 void SensorService::SensorEventConnection::setFirstFlushPending(int32_t handle,
1462 ssize_t index = mSensorInfo.indexOfKey(handle);
1493 const int handle = mSensorInfo.keyAt(i);
1494 if (mService->getSensorFromHandle(handle).isWakeUpSensor()) {
1521 void SensorService::SensorEventConnection::incrementPendingFlushCount(int32_t handle) {
1523 ssize_t index = mSensorInfo.indexOfKey(handle);
1821 int handle, bool enabled, nsecs_t samplingPeriodNs, nsecs_t maxBatchReportLatencyNs,
1826 err = mService->enable(this, handle, samplingPeriodNs, maxBatchReportLatencyNs,
1830 err = mService->disable(this, handle);
1836 int handle, nsecs_t samplingPeriodNs)
1838 return mService->setEventRate(this, handle, samplingPeriodNs, mOpPackageName);