Home
last modified time | relevance | path

Searched refs:sensor (Results 1 – 25 of 96) sorted by relevance

1234

/frameworks/base/core/java/android/hardware/
DSystemSensorManager.java56 Sensor sensor, int index); in nativeGetSensorAtIndex() argument
105 Sensor sensor = new Sensor(); in SystemSensorManager() local
106 if (!nativeGetSensorAtIndex(mNativeInstance, sensor, index)) break; in SystemSensorManager()
107 mFullSensorsList.add(sensor); in SystemSensorManager()
108 mHandleToSensor.put(sensor.getHandle(), sensor); in SystemSensorManager() local
131 protected boolean registerListenerImpl(SensorEventListener listener, Sensor sensor, in registerListenerImpl() argument
133 if (listener == null || sensor == null) { in registerListenerImpl()
138 if (sensor.getReportingMode() == Sensor.REPORTING_MODE_ONE_SHOT) { in registerListenerImpl()
159 if (!queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs)) { in registerListenerImpl()
166 return queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs); in registerListenerImpl()
[all …]
DSensorManager.java499 for (Sensor sensor : l) { in getDefaultSensor()
500 if (sensor.isWakeUpSensor() == wakeUpSensor) return sensor; in getDefaultSensor()
533 for (Sensor sensor : l) { in getDefaultSensor()
534 if (sensor.isWakeUpSensor() == wakeUp) in getDefaultSensor()
535 return sensor; in getDefaultSensor()
640 public void unregisterListener(SensorEventListener listener, Sensor sensor) { in unregisterListener() argument
641 if (listener == null || sensor == null) { in unregisterListener()
645 unregisterListenerImpl(listener, sensor); in unregisterListener()
667 protected abstract void unregisterListenerImpl(SensorEventListener listener, Sensor sensor); in unregisterListenerImpl() argument
721 public boolean registerListener(SensorEventListener listener, Sensor sensor, in registerListener() argument
[all …]
DLegacySensorManager.java113 Sensor sensor = mSensorManager.getDefaultSensor(type); in registerLegacyListener() local
114 if (sensor != null) { in registerLegacyListener()
134 result = mSensorManager.registerListener(legacyListener, sensor, rate); in registerLegacyListener()
165 Sensor sensor = mSensorManager.getDefaultSensor(type); in unregisterLegacyListener() local
166 if (sensor != null) { in unregisterLegacyListener()
179 mSensorManager.unregisterListener(legacyListener, sensor); in unregisterLegacyListener()
248 public void onAccuracyChanged(Sensor sensor, int accuracy) { in onAccuracyChanged() argument
250 mTarget.onAccuracyChanged(getLegacySensorType(sensor.getType()), accuracy); in onAccuracyChanged()
262 int type = event.sensor.getType(); in onSensorChanged()
286 private void mapSensorDataToWindow(int sensor, in mapSensorDataToWindow() argument
[all …]
DSensorListener.java90 public void onSensorChanged(int sensor, float[] values); in onSensorChanged() argument
100 public void onAccuracyChanged(int sensor, int accuracy); in onAccuracyChanged() argument
DSensorEventCallback.java38 public void onAccuracyChanged(Sensor sensor, int accuracy) {} in onAccuracyChanged() argument
46 public void onFlushCompleted(Sensor sensor) {} in onFlushCompleted() argument
/frameworks/base/native/android/
Dsensor.cpp108 int ASensorEventQueue_registerSensor(ASensorEventQueue* queue, ASensor const* sensor, in ASensorEventQueue_registerSensor() argument
112 static_cast<Sensor const*>(sensor)->getHandle(), samplingPeriodUs, in ASensorEventQueue_registerSensor()
116 int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor) in ASensorEventQueue_enableSensor() argument
119 static_cast<Sensor const*>(sensor)); in ASensorEventQueue_enableSensor()
122 int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sensor) in ASensorEventQueue_disableSensor() argument
125 static_cast<Sensor const*>(sensor)); in ASensorEventQueue_disableSensor()
128 int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, ASensor const* sensor, in ASensorEventQueue_setEventRate() argument
132 static_cast<Sensor const*>(sensor), us2ns(usec)); in ASensorEventQueue_setEventRate()
165 const char* ASensor_getName(ASensor const* sensor) in ASensor_getName() argument
167 return static_cast<Sensor const*>(sensor)->getName().string(); in ASensor_getName()
[all …]
/frameworks/native/include/android/
Dsensor.h183 int32_t sensor; member
227 int32_t sensor; member
399 int ASensorEventQueue_registerSensor(ASensorEventQueue* queue, ASensor const* sensor,
405 int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor);
410 int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sensor);
419 int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, ASensor const* sensor, int32_t usec);
450 const char* ASensor_getName(ASensor const* sensor);
455 const char* ASensor_getVendor(ASensor const* sensor);
460 int ASensor_getType(ASensor const* sensor);
465 float ASensor_getResolution(ASensor const* sensor);
[all …]
/frameworks/base/docs/html/guide/topics/sensors/
Dsensors_overview.jd10 <li>Learn about the sensors that Android supports and the Android sensor framework.</li>
11 <li>Find out how to list sensors, determine sensor capabilities, and monitor sensor data.</li>
57 game might track readings from a device's gravity sensor to infer complex user gestures
59 device's temperature sensor and humidity sensor to calculate and report the dewpoint, or a travel
60 application might use the geomagnetic field sensor and accelerometer to report a compass
83 <p>You can access sensors available on the device and acquire raw sensor data by using the Android
84 sensor framework. The sensor framework provides several classes and interfaces that help you perfor…
85 variety of sensor-related tasks. For example, you can use the sensor framework to do the following:…
89 <li>Determine an individual sensor's capabilities, such as its maximum range, manufacturer, power
91 <li>Acquire raw sensor data and define the minimum rate at which you acquire sensor data.</li>
[all …]
Dsensors_position.jd47 of a device: the geomagnetic field sensor and the accelerometer. The Android
48 platform also provides a sensor that lets you determine how close the face of
49 a device is to an object (known as the <em>proximity sensor</em>). The
50 geomagnetic field sensor and the proximity sensor are hardware-based. Most
51 handset and tablet manufacturers include a geomagnetic field sensor. Likewise,
52 handset manufacturers usually include a proximity sensor to determine when a
55 the device's accelerometer and the geomagnetic field sensor.
59 <strong>Note:</strong> The orientation sensor was deprecated in Android 2.2
60 (API level 8), and the orientation sensor type was deprecated in Android 4.4W
67 sensor in combination with the accelerometer to determine a device's position
[all …]
Dsensors_environment.jd40 the light sensor, which most device manufacturers use to control screen brightness, environment
42 verify at runtime whether an environment sensor exists before you attempt to acquire data from
45 <p>Unlike most motion sensors and position sensors, which return a multi-dimensional array of sensor
46 values for each {@link android.hardware.SensorEvent}, environment sensors return a single sensor
94 device. This sensor was deprecated in Android 4.0 (API Level 14).</p>
101 android.hardware.SensorManager} class, which you can use to get an instance of a physical sensor.
102 Then you register a sensor listener in the {@link android.app.Activity#onResume
103 onResume()} method, and start handling incoming sensor data in the {@link
117 // Get an instance of the sensor service, and use that to get an instance of
118 // a particular sensor.
[all …]
Dsensors_motion.jd64 device position, but they can be used with other sensors, such as the geomagnetic field sensor, to
69 <p>All of the motion sensors return multi-dimensional arrays of sensor values for each {@link
70 android.hardware.SensorEvent}. For example, during a single sensor event the accelerometer returns
194 <td>Number of steps taken by the user since the last reboot while the sensor
208 <p>The rotation vector sensor and the gravity sensor are the most frequently used sensors for motion
209 detection and monitoring. The rotational vector sensor is particularly versatile and can be used for
211 monitoring relative orientation changes. For example, the rotational vector sensor is ideal if you
214 the accelerometer and geomagnetic field sensor or the orientation sensor.</p>
219 sensor, a linear acceleration sensor, and a rotation vector sensor. These sensors were updated in
225 sensors. For example, if a device manufacturer provides their own gravity sensor, then the AOSP
[all …]
/frameworks/native/services/sensorservice/
DSensorService.cpp480 int handle = buffer[i].sensor; in cleanupAutoDisabledSensorLocked()
482 handle = buffer[i].meta_data.sensor; in cleanupAutoDisabledSensorLocked()
611 const int sensor_handle = mSensorEventBuffer[i].meta_data.sensor; in threadLoop()
625 *(mSensorEventBuffer[i].dynamic_sensor_meta.sensor); in threadLoop()
756 auto logger = mRecentEvent.find(buffer[i].sensor); in recordLastValueLocked()
779 sp<SensorInterface> sensor = getSensorInterfaceFromHandle(handle); in isVirtualSensor() local
780 return sensor != nullptr && sensor->isVirtual(); in isVirtualSensor()
784 int handle = event.sensor; in isWakeUpSensorEvent()
786 handle = event.meta_data.sensor; in isWakeUpSensorEvent()
788 sp<SensorInterface> sensor = getSensorInterfaceFromHandle(handle); in isWakeUpSensorEvent() local
[all …]
DSensorInterface.cpp32 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()
DSensorEventConnection.cpp216 int32_t sensor_handle = buffer[i].sensor; in sendEvents()
219 buffer[i].meta_data.sensor); in sendEvents()
223 sensor_handle = buffer[i].meta_data.sensor; in sendEvents()
240 buffer[i].meta_data.sensor); in sendEvents()
266 } while ((i<numEvents) && ((buffer[i].sensor == sensor_handle && in sendEvents()
269 buffer[i].meta_data.sensor == sensor_handle))); in sendEvents()
397 flushCompleteEvent.meta_data.sensor = handle; in sendPendingFlushEventsLocked()
409 flushCompleteEvent.meta_data.sensor); in sendPendingFlushEventsLocked()
478 FlushInfo& flushInfo = mSensorInfo.editValueFor(scratch[j].meta_data.sensor); in countFlushCompleteEventsLocked()
564 mService->getSensorInterfaceFromHandle(sensor_event.sensor); in handleEvent()
[all …]
DRotationVectorSensor.cpp32 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()
DSensorInterface.h50 BaseSensor(const sensor_t& sensor);
51 BaseSensor(const sensor_t& sensor, const uint8_t (&uuid)[16]);
77 HardwareSensor(const sensor_t& sensor);
78 HardwareSensor(const sensor_t& sensor, const uint8_t (&uuid)[16]);
DGravitySensor.cpp40 const sensor_t sensor = { in GravitySensor() local
51 mSensor = Sensor(&sensor); in GravitySensor()
71 outEvent->sensor = '_grv'; in process()
DCorrectedGyroSensor.cpp41 const sensor_t sensor = { in CorrectedGyroSensor() local
52 mSensor = Sensor(&sensor); in CorrectedGyroSensor()
64 outEvent->sensor = '_cgy'; in process()
DLinearAccelerationSensor.cpp35 const sensor_t sensor = { in LinearAccelerationSensor() local
46 mSensor = Sensor(&sensor); in LinearAccelerationSensor()
57 outEvent->sensor = '_lin'; in process()
DOrientationSensor.cpp33 const sensor_t sensor = { in OrientationSensor() local
44 mSensor = Sensor(&sensor); in OrientationSensor()
66 outEvent->sensor = '_ypr'; in process()
DSensorService.h165 const Sensor& registerSensor(SensorInterface* sensor,
167 const Sensor& registerVirtualSensor(SensorInterface* sensor, bool isDebug = false);
168 const Sensor& registerDynamicSensorLocked(SensorInterface* sensor, bool isDebug = false);
174 static bool canAccessSensor(const Sensor& sensor, const char* operation,
/frameworks/base/core/jni/
Dandroid_hardware_SensorManager.cpp165 translateNativeSensorToJavaSensor(JNIEnv *env, jobject sensor, const Sensor& nativeSensor) { in translateNativeSensorToJavaSensor() argument
168 if (sensor == NULL) { in translateNativeSensorToJavaSensor()
170 sensor = env->NewObject(sensorOffsets.clazz, sensorOffsets.init, ""); in translateNativeSensorToJavaSensor()
173 if (sensor != NULL) { in translateNativeSensorToJavaSensor()
179 env->SetObjectField(sensor, sensorOffsets.name, name); in translateNativeSensorToJavaSensor()
180 env->SetObjectField(sensor, sensorOffsets.vendor, vendor); in translateNativeSensorToJavaSensor()
181 env->SetIntField(sensor, sensorOffsets.version, nativeSensor.getVersion()); in translateNativeSensorToJavaSensor()
182 env->SetIntField(sensor, sensorOffsets.handle, nativeSensor.getHandle()); in translateNativeSensorToJavaSensor()
183 env->SetFloatField(sensor, sensorOffsets.range, nativeSensor.getMaxValue()); in translateNativeSensorToJavaSensor()
184 env->SetFloatField(sensor, sensorOffsets.resolution, nativeSensor.getResolution()); in translateNativeSensorToJavaSensor()
[all …]
/frameworks/native/libs/gui/
DSensorEventQueue.cpp127 status_t SensorEventQueue::enableSensor(Sensor const* sensor) const { in enableSensor()
128 return enableSensor(sensor, SENSOR_DELAY_NORMAL); in enableSensor()
131 status_t SensorEventQueue::enableSensor(Sensor const* sensor, int32_t samplingPeriodUs) const { in enableSensor() argument
132 return mSensorEventConnection->enableDisable(sensor->getHandle(), true, in enableSensor()
136 status_t SensorEventQueue::disableSensor(Sensor const* sensor) const { in disableSensor()
137 return mSensorEventConnection->enableDisable(sensor->getHandle(), false, 0, 0, 0); in disableSensor()
154 status_t SensorEventQueue::setEventRate(Sensor const* sensor, nsecs_t ns) const { in setEventRate() argument
155 return mSensorEventConnection->setEventRate(sensor->getHandle(), ns); in setEventRate()
/frameworks/native/libs/binder/
DIBatteryStats.cpp37 virtual void noteStartSensor(int uid, int sensor) { in noteStartSensor() argument
41 data.writeInt32(sensor); in noteStartSensor()
45 virtual void noteStopSensor(int uid, int sensor) { in noteStopSensor() argument
49 data.writeInt32(sensor); in noteStopSensor()
146 int sensor = data.readInt32(); in onTransact() local
147 noteStartSensor(uid, sensor); in onTransact()
154 int sensor = data.readInt32(); in onTransact() local
155 noteStopSensor(uid, sensor); in onTransact()
/frameworks/native/include/gui/
DSensorEventQueue.h82 status_t enableSensor(Sensor const* sensor) const;
83 status_t enableSensor(Sensor const* sensor, int32_t samplingPeriodUs) const;
84 status_t disableSensor(Sensor const* sensor) const;
85 status_t setEventRate(Sensor const* sensor, nsecs_t ns) const;

1234