Lines Matching refs: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 c, i, 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,
925 connection->setFirstFlushPending(handle, true);
926 status_t err_flush = sensor->flush(connection.get(), handle);
931 connection->setFirstFlushPending(handle, false);
936 ALOGD_IF(DEBUG_CONNECTIONS, "Calling activate on %d", handle);
944 reg_info.mSensorHandle = handle;
959 cleanupWithoutDisableLocked(connection, handle);
965 int handle)
971 status_t err = cleanupWithoutDisableLocked(connection, handle);
973 SensorInterface* sensor = mSensorMap.valueFor(handle);
982 reg_info.mSensorHandle = handle;
994 const sp<SensorEventConnection>& connection, int handle) {
996 return cleanupWithoutDisableLocked(connection, handle);
1000 const sp<SensorEventConnection>& connection, int handle) {
1001 SensorRecord* rec = mActiveSensors.valueFor(handle);
1004 if (connection->removeSensor(handle)) {
1005 BatteryService::disableSensor(connection->getUid(), handle);
1013 mActiveSensors.removeItem(handle);
1014 mActiveVirtualSensors.removeItem(handle);
1023 int handle, nsecs_t ns, const String16& opPackageName)
1028 SensorInterface* sensor = mSensorMap.valueFor(handle);
1044 return sensor->setDelay(connection.get(), handle, ns);
1056 const int handle = connection->mSensorInfo.keyAt(i);
1057 SensorInterface* sensor = mSensorMap.valueFor(handle);
1063 if (halVersion <= SENSORS_DEVICE_API_VERSION_1_0 || isVirtualSensor(handle)) {
1066 connection->incrementPendingFlushCount(handle);
1072 status_t err_flush = sensor->flush(connection.get(), handle);
1074 SensorRecord* rec = mActiveSensors.valueFor(handle);
1418 bool SensorService::SensorEventConnection::addSensor(int32_t handle) {
1420 if (!canAccessSensor(mService->getSensorFromHandle(handle),
1424 if (mSensorInfo.indexOfKey(handle) < 0) {
1425 mSensorInfo.add(handle, FlushInfo());
1431 bool SensorService::SensorEventConnection::removeSensor(int32_t handle) {
1433 if (mSensorInfo.removeItem(handle) >= 0) {
1439 bool SensorService::SensorEventConnection::hasSensor(int32_t handle) const {
1441 return mSensorInfo.indexOfKey(handle) >= 0;
1452 const int handle = mSensorInfo.keyAt(i);
1453 if (mService->getSensorFromHandle(handle).getReportingMode() == AREPORTING_MODE_ONE_SHOT) {
1464 void SensorService::SensorEventConnection::setFirstFlushPending(int32_t handle,
1467 ssize_t index = mSensorInfo.indexOfKey(handle);
1498 const int handle = mSensorInfo.keyAt(i);
1499 if (mService->getSensorFromHandle(handle).isWakeUpSensor()) {
1526 void SensorService::SensorEventConnection::incrementPendingFlushCount(int32_t handle) {
1528 ssize_t index = mSensorInfo.indexOfKey(handle);
1826 int handle, bool enabled, nsecs_t samplingPeriodNs, nsecs_t maxBatchReportLatencyNs,
1831 err = mService->enable(this, handle, samplingPeriodNs, maxBatchReportLatencyNs,
1835 err = mService->disable(this, handle);
1841 int handle, nsecs_t samplingPeriodNs)
1843 return mService->setEventRate(this, handle, samplingPeriodNs, mOpPackageName);