/frameworks/base/core/java/android/hardware/ |
D | SystemSensorManager.java | 60 Sensor sensor, int index); in nativeGetSensorAtIndex() argument 119 Sensor sensor = new Sensor(); in SystemSensorManager() local 120 if (!nativeGetSensorAtIndex(mNativeInstance, sensor, index)) break; in SystemSensorManager() 121 mFullSensorsList.add(sensor); in SystemSensorManager() 122 mHandleToSensor.put(sensor.getHandle(), sensor); in SystemSensorManager() local 145 protected boolean registerListenerImpl(SensorEventListener listener, Sensor sensor, in registerListenerImpl() argument 147 if (listener == null || sensor == null) { in registerListenerImpl() 152 if (sensor.getReportingMode() == Sensor.REPORTING_MODE_ONE_SHOT) { in registerListenerImpl() 179 if (!queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs)) { in registerListenerImpl() 186 return queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs); in registerListenerImpl() [all …]
|
D | SensorManager.java | 505 for (Sensor sensor : l) { in getDefaultSensor() 506 if (sensor.isWakeUpSensor() == wakeUpSensor) return sensor; in getDefaultSensor() 539 for (Sensor sensor : l) { in getDefaultSensor() 540 if (sensor.isWakeUpSensor() == wakeUp) { in getDefaultSensor() 541 return sensor; in getDefaultSensor() 647 public void unregisterListener(SensorEventListener listener, Sensor sensor) { in unregisterListener() argument 648 if (listener == null || sensor == null) { in unregisterListener() 652 unregisterListenerImpl(listener, sensor); in unregisterListener() 674 protected abstract void unregisterListenerImpl(SensorEventListener listener, Sensor sensor); in unregisterListenerImpl() argument 728 public boolean registerListener(SensorEventListener listener, Sensor sensor, in registerListener() argument [all …]
|
D | LegacySensorManager.java | 114 Sensor sensor = mSensorManager.getDefaultSensor(type); in registerLegacyListener() local 115 if (sensor != null) { in registerLegacyListener() 135 result = mSensorManager.registerListener(legacyListener, sensor, rate); in registerLegacyListener() 166 Sensor sensor = mSensorManager.getDefaultSensor(type); in unregisterLegacyListener() local 167 if (sensor != null) { in unregisterLegacyListener() 180 mSensorManager.unregisterListener(legacyListener, sensor); in unregisterLegacyListener() 249 public void onAccuracyChanged(Sensor sensor, int accuracy) { in onAccuracyChanged() argument 251 mTarget.onAccuracyChanged(getLegacySensorType(sensor.getType()), accuracy); in onAccuracyChanged() 263 int type = event.sensor.getType(); in onSensorChanged() 287 private void mapSensorDataToWindow(int sensor, in mapSensorDataToWindow() argument [all …]
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/utils/hardware/ |
D | FakeSensorManager.java | 114 protected void unregisterListenerImpl(SensorEventListener listener, Sensor sensor) { in unregisterListenerImpl() argument 117 if (sensor == null || s.mSensor == sensor) { in unregisterListenerImpl() 124 protected boolean registerListenerImpl(SensorEventListener listener, Sensor sensor, in registerListenerImpl() argument 127 Preconditions.checkNotNull(sensor); in registerListenerImpl() 130 if (s.mSensor == sensor) { in registerListenerImpl() 172 protected boolean requestTriggerSensorImpl(TriggerEventListener listener, Sensor sensor) { in requestTriggerSensorImpl() argument 177 protected boolean cancelTriggerSensorImpl(TriggerEventListener listener, Sensor sensor, in cancelTriggerSensorImpl() argument 188 protected boolean injectSensorDataImpl(Sensor sensor, float[] values, int accuracy, in injectSensorDataImpl() argument 201 Sensor sensor = constr.newInstance(); in createSensor() local 203 setSensorType(sensor, type); in createSensor() [all …]
|
/frameworks/base/native/android/ |
D | sensor.cpp | 52 if (sensor == nullptr) { \ 189 ASensorManager *manager, ASensor const *sensor, int channelId, int rate) { in ASensorManager_configureDirectReport() argument 193 if (sensor == nullptr) { in ASensorManager_configureDirectReport() 201 sensorHandle = static_cast<Sensor const *>(sensor)->getHandle(); in ASensorManager_configureDirectReport() 209 int ASensorEventQueue_registerSensor(ASensorEventQueue* queue, ASensor const* sensor, in ASensorEventQueue_registerSensor() argument 219 static_cast<Sensor const*>(sensor)->getHandle(), samplingPeriodUs, in ASensorEventQueue_registerSensor() 223 int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor) { in ASensorEventQueue_enableSensor() argument 228 static_cast<Sensor const*>(sensor)); in ASensorEventQueue_enableSensor() 231 int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sensor) { in ASensorEventQueue_disableSensor() argument 236 static_cast<Sensor const*>(sensor)); in ASensorEventQueue_disableSensor() [all …]
|
/frameworks/hardware/interfaces/sensorservice/libsensorndkbridge/ |
D | ASensorManager.cpp | 128 [&](const auto &sensor, auto result) { in getDefaultSensor() argument 134 if (sensor == mSensors[i]) { in getDefaultSensor() 224 if (sensor == NULL) { \ 297 ASensor const* sensor, 306 ASensor const* sensor, in ASensorEventQueue_registerSensor() argument 312 sensor, samplingPeriodUs, maxBatchReportLatencyUs); in ASensorEventQueue_registerSensor() 316 ASensorEventQueue* queue, ASensor const* sensor) { in ASensorEventQueue_enableSensor() argument 319 return queue->enableSensor(sensor); in ASensorEventQueue_enableSensor() 323 ASensorEventQueue* queue, ASensor const* sensor) { in ASensorEventQueue_disableSensor() argument 326 return queue->disableSensor(sensor); in ASensorEventQueue_disableSensor() [all …]
|
D | ASensorEventQueue.cpp | 44 ASensorRef sensor, in registerSensor() argument 48 reinterpret_cast<const SensorInfo *>(sensor)->sensorHandle, in registerSensor() 59 int ASensorEventQueue::enableSensor(ASensorRef sensor) { in enableSensor() argument 63 sensor, SENSOR_DELAY_NORMAL, 0 /* maxBatchReportLatencyUs */); in enableSensor() 67 ASensorRef sensor, int32_t samplingPeriodUs) { in setEventRate() argument 71 sensor, samplingPeriodUs, 0 /* maxBatchReportLatencyUs */); in setEventRate() 79 int ASensorEventQueue::disableSensor(ASensorRef sensor) { in disableSensor() argument 81 reinterpret_cast<const SensorInfo *>(sensor)->sensorHandle); in disableSensor()
|
D | ASensorEventQueue.h | 48 ASensorRef sensor, 52 int enableSensor(ASensorRef sensor); 53 int disableSensor(ASensorRef sensor); 55 int setEventRate(ASensorRef sensor, int32_t samplingPeriodUs);
|
/frameworks/native/include/android/ |
D | sensor.h | 387 int32_t sensor; member 431 int32_t sensor; member 704 ASensor const* sensor, int channelId, int rate) __INTRODUCED_IN(26); 722 int ASensorEventQueue_registerSensor(ASensorEventQueue* queue, ASensor const* sensor, 735 int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor); 746 int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sensor); 761 int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, ASensor const* sensor, int32_t usec); 825 const char* ASensor_getName(ASensor const* sensor); 830 const char* ASensor_getVendor(ASensor const* sensor); 835 int ASensor_getType(ASensor const* sensor); [all …]
|
/frameworks/native/include_sensor/android/ |
D | sensor.h | 387 int32_t sensor; member 431 int32_t sensor; member 704 ASensor const* sensor, int channelId, int rate) __INTRODUCED_IN(26); 722 int ASensorEventQueue_registerSensor(ASensorEventQueue* queue, ASensor const* sensor, 735 int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor); 746 int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sensor); 761 int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, ASensor const* sensor, int32_t usec); 825 const char* ASensor_getName(ASensor const* sensor); 830 const char* ASensor_getVendor(ASensor const* sensor); 835 int ASensor_getType(ASensor const* sensor); [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/display/ |
D | TestUtils.java | 29 public static SensorEvent createSensorEvent(Sensor sensor, int lux) throws Exception { in createSensorEvent() argument 34 event.sensor = sensor; in createSensorEvent() 41 public static void setSensorType(Sensor sensor, int type, String strType) throws Exception { in setSensorType() argument 44 setter.invoke(sensor, type); in setSensorType() 46 Field f = sensor.getClass().getDeclaredField("mStringType"); in setSensorType() 48 f.set(sensor, strType); in setSensorType() 55 Sensor sensor = constr.newInstance(); in createSensor() local 56 setSensorType(sensor, type, strType); in createSensor() 57 return sensor; in createSensor()
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/util/ |
D | AsyncSensorManager.java | 90 Sensor sensor, int delayUs, Handler handler, int maxReportLatencyUs, in registerListenerImpl() argument 93 if (!mInner.registerListener(listener, sensor, delayUs, maxReportLatencyUs, handler)) { in registerListenerImpl() 94 Log.e(TAG, "Registering " + listener + " for " + sensor + " failed."); in registerListenerImpl() 133 protected boolean requestTriggerSensorImpl(TriggerEventListener listener, Sensor sensor) { in requestTriggerSensorImpl() argument 135 if (!mInner.requestTriggerSensor(listener, sensor)) { in requestTriggerSensorImpl() 136 Log.e(TAG, "Requesting " + listener + " for " + sensor + " failed."); in requestTriggerSensorImpl() 143 protected boolean cancelTriggerSensorImpl(TriggerEventListener listener, Sensor sensor, in cancelTriggerSensorImpl() argument 148 if (!mInner.cancelTriggerSensor(listener, sensor)) { in cancelTriggerSensorImpl() 149 Log.e(TAG, "Canceling " + listener + " for " + sensor + " failed."); in cancelTriggerSensorImpl() 161 public boolean registerPluginListener(SensorManagerPlugin.Sensor sensor, in registerPluginListener() argument [all …]
|
D | ProximitySensor.java | 53 public void onAccuracyChanged(Sensor sensor, int accuracy) { 63 Sensor sensor = findCustomProxSensor(context, sensorManager); in ProximitySensor() local 65 if (sensor == null) { in ProximitySensor() 67 sensor = sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); in ProximitySensor() 71 mSensor = sensor; in ProximitySensor() 100 Sensor sensor = null; in findCustomProxSensor() local 103 sensor = s; in findCustomProxSensor() 108 return sensor; in findCustomProxSensor()
|
/frameworks/native/services/sensorservice/ |
D | SensorInterface.cpp | 32 BaseSensor::BaseSensor(const sensor_t& sensor) : in BaseSensor() argument 34 mSensor(&sensor, mSensorDevice.getHalDeviceVersion()) { in BaseSensor() 37 BaseSensor::BaseSensor(const sensor_t& sensor, const uint8_t (&uuid)[16]) : in BaseSensor() argument 39 mSensor(sensor, Sensor::uuid_t(uuid), mSensorDevice.getHalDeviceVersion()) { in BaseSensor() 44 HardwareSensor::HardwareSensor(const sensor_t& sensor): in HardwareSensor() argument 45 BaseSensor(sensor) { in HardwareSensor() 48 HardwareSensor::HardwareSensor(const sensor_t& sensor, const uint8_t (&uuid)[16]): in HardwareSensor() argument 49 BaseSensor(sensor, uuid) { in HardwareSensor()
|
D | SensorService.cpp | 676 int handle = buffer[i].sensor; in cleanupAutoDisabledSensorLocked() 678 handle = buffer[i].meta_data.sensor; in cleanupAutoDisabledSensorLocked() 809 const int sensor_handle = mSensorEventBuffer[i].meta_data.sensor; in threadLoop() 823 *(mSensorEventBuffer[i].dynamic_sensor_meta.sensor); in threadLoop() 940 auto logger = mRecentEvent.find(buffer[i].sensor); in recordLastValueLocked() 963 sp<SensorInterface> sensor = getSensorInterfaceFromHandle(handle); in isVirtualSensor() local 964 return sensor != nullptr && sensor->isVirtual(); in isVirtualSensor() 968 int handle = event.sensor; in isWakeUpSensorEvent() 970 handle = event.meta_data.sensor; in isWakeUpSensorEvent() 972 sp<SensorInterface> sensor = getSensorInterfaceFromHandle(handle); in isWakeUpSensorEvent() local [all …]
|
D | SensorEventConnection.cpp | 242 int32_t sensor_handle = buffer[i].sensor; in sendEvents() 245 buffer[i].meta_data.sensor); in sendEvents() 249 sensor_handle = buffer[i].meta_data.sensor; in sendEvents() 266 buffer[i].meta_data.sensor); in sendEvents() 295 } while ((i<numEvents) && ((buffer[i].sensor == sensor_handle && in sendEvents() 298 buffer[i].meta_data.sensor == sensor_handle))); in sendEvents() 392 const auto iter = mHandleToAppOp.find(event.sensor); in noteOpIfRequired() 487 flushCompleteEvent.meta_data.sensor = handle; in sendPendingFlushEventsLocked() 499 flushCompleteEvent.meta_data.sensor); in sendPendingFlushEventsLocked() 571 ssize_t index = mSensorInfo.indexOfKey(scratch[j].meta_data.sensor); in countFlushCompleteEventsLocked() [all …]
|
D | RotationVectorSensor.cpp | 32 const sensor_t sensor = { in RotationVectorSensor() local 43 mSensor = Sensor(&sensor); in RotationVectorSensor() 57 outEvent->sensor = getSensorToken(); in process() 118 const sensor_t sensor = { in GyroDriftSensor() local 129 mSensor = Sensor(&sensor); in GyroDriftSensor() 142 outEvent->sensor = '_gbs'; in process()
|
/frameworks/base/core/jni/ |
D | android_hardware_SensorManager.cpp | 154 translateNativeSensorToJavaSensor(JNIEnv *env, jobject sensor, const Sensor& nativeSensor) { in translateNativeSensorToJavaSensor() argument 157 if (sensor == NULL) { in translateNativeSensorToJavaSensor() 159 sensor = env->NewObject(sensorOffsets.clazz, sensorOffsets.init, ""); in translateNativeSensorToJavaSensor() 162 if (sensor != NULL) { in translateNativeSensorToJavaSensor() 168 env->SetObjectField(sensor, sensorOffsets.name, name); in translateNativeSensorToJavaSensor() 169 env->SetObjectField(sensor, sensorOffsets.vendor, vendor); in translateNativeSensorToJavaSensor() 170 env->SetIntField(sensor, sensorOffsets.version, nativeSensor.getVersion()); in translateNativeSensorToJavaSensor() 171 env->SetIntField(sensor, sensorOffsets.handle, nativeSensor.getHandle()); in translateNativeSensorToJavaSensor() 172 env->SetFloatField(sensor, sensorOffsets.range, nativeSensor.getMaxValue()); in translateNativeSensorToJavaSensor() 173 env->SetFloatField(sensor, sensorOffsets.resolution, nativeSensor.getResolution()); in translateNativeSensorToJavaSensor() [all …]
|
/frameworks/base/packages/SystemUI/plugin/src/com/android/systemui/plugins/ |
D | SensorManagerPlugin.java | 38 void registerListener(Sensor sensor, SensorEventListener listener); in registerListener() argument 45 void unregisterListener(Sensor sensor, SensorEventListener listener); in unregisterListener() argument 90 public SensorEvent(Sensor sensor, int vendorType) { in SensorEvent() argument 91 this(sensor, vendorType, null); in SensorEvent() 101 public SensorEvent(Sensor sensor, int vendorType, float[] values) { in SensorEvent() argument 102 mSensor = sensor; in SensorEvent()
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/doze/ |
D | DozeSensors.java | 225 for (TriggerSensor sensor : mSensors) { in setTouchscreenSensorsListening() 226 if (sensor.mRequiresTouchscreen) { in setTouchscreenSensorsListening() 227 sensor.setListening(listening); in setTouchscreenSensorsListening() 260 for (TriggerSensor sensor : mSensors) { in ignoreTouchScreenSensorsSettingInterferingWithDocking() 261 if (sensor.mRequiresTouchscreen) { in ignoreTouchScreenSensorsSettingInterferingWithDocking() 262 sensor.ignoreSetting(ignore); in ignoreTouchScreenSensorsSettingInterferingWithDocking() 301 Sensor sensor = ProximitySensor.findCustomProxSensor(mContext, mSensorManager); in ProxSensor() local 302 mUsingBrightnessSensor = sensor != null; in ProxSensor() 307 sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); in ProxSensor() 308 mSensorThreshold = sensor == null ? 0 : sensor.getMaximumRange(); in ProxSensor() [all …]
|
/frameworks/hardware/interfaces/sensorservice/1.0/ |
D | IDirectReportChannel.hal | 31 * Configure sensor direct report on a direct channel: set rate to value 32 * other than STOP so that sensor event can be directly written into the 34 * stop the sensor direct report. 36 * To stop all active sensor direct report configured to a channel, set 39 * @param sensorHandle handle of the sensor to operate on. If it is -1 41 * sensor direct report. 42 * @param rate rate level value to set on the specified sensor. 46 * rate level is not supported by sensor, etc); 48 * @return token the token used to distinguish sensor events from
|
D | IEventQueue.hal | 25 * Enable the selected sensor with a specified sampling period and 27 * same sensor, the previous calls must be overridden by the last call. 29 * @param sensorHandle the sensor to enable. Must be a sensor acquired from 45 * Disable the selected sensor. 47 * @param sensorHandle the sensor to disable. Must be a sensor acquired from
|
D | ISensorManager.hal | 43 * Get the default sensor of the specified type. 45 * @return sensor the default sensor for the given type, or undetermined 48 NOT_EXIST if no sensor of that type exists. 51 generates (SensorInfo sensor, Result result); 57 * for configuring sensor direct report. 64 * 0x0004 int32_t sensor report token 91 * for configuring sensor direct report. 107 * Create a sensor event queue. 109 * Create a sensor event queue with an IEventQueueCallback object. 110 * Subsequently, one can enable sensors on the event queue so that sensor
|
/frameworks/native/libs/sensor/ |
D | SensorEventQueue.cpp | 125 status_t SensorEventQueue::enableSensor(Sensor const* sensor) const { in enableSensor() 126 return enableSensor(sensor, SENSOR_DELAY_NORMAL); in enableSensor() 129 status_t SensorEventQueue::enableSensor(Sensor const* sensor, int32_t samplingPeriodUs) const { in enableSensor() argument 130 return mSensorEventConnection->enableDisable(sensor->getHandle(), true, in enableSensor() 134 status_t SensorEventQueue::disableSensor(Sensor const* sensor) const { in disableSensor() 135 return mSensorEventConnection->enableDisable(sensor->getHandle(), false, 0, 0, 0); in disableSensor() 152 status_t SensorEventQueue::setEventRate(Sensor const* sensor, nsecs_t ns) const { in setEventRate() argument 153 return mSensorEventConnection->setEventRate(sensor->getHandle(), ns); in setEventRate()
|
/frameworks/native/libs/binder/ |
D | IBatteryStats.cpp | 35 virtual void noteStartSensor(int uid, int sensor) { in noteStartSensor() argument 39 data.writeInt32(sensor); in noteStartSensor() 43 virtual void noteStopSensor(int uid, int sensor) { in noteStopSensor() argument 47 data.writeInt32(sensor); in noteStopSensor() 145 int sensor = data.readInt32(); in onTransact() local 146 noteStartSensor(uid, sensor); in onTransact() 153 int sensor = data.readInt32(); in onTransact() local 154 noteStopSensor(uid, sensor); in onTransact()
|