Home
last modified time | relevance | path

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

12345

/frameworks/base/core/java/android/hardware/
DSystemSensorManager.java46 Sensor sensor, int index); in nativeGetSensorAtIndex() argument
85 Sensor sensor = new Sensor(); in SystemSensorManager() local
86 if (!nativeGetSensorAtIndex(mNativeInstance, sensor, index)) break; in SystemSensorManager()
87 mFullSensorsList.add(sensor); in SystemSensorManager()
88 mHandleToSensor.append(sensor.getHandle(), sensor); in SystemSensorManager() local
102 protected boolean registerListenerImpl(SensorEventListener listener, Sensor sensor, in registerListenerImpl() argument
104 if (listener == null || sensor == null) { in registerListenerImpl()
109 if (sensor.getReportingMode() == Sensor.REPORTING_MODE_ONE_SHOT) { in registerListenerImpl()
130 if (!queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs)) { in registerListenerImpl()
137 return queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs); in registerListenerImpl()
[all …]
DSensorManager.java461 for (Sensor sensor : l) { in getDefaultSensor()
462 if (sensor.isWakeUpSensor() == wakeUpSensor) return sensor; in getDefaultSensor()
495 for (Sensor sensor : l) { in getDefaultSensor()
496 if (sensor.isWakeUpSensor() == wakeUp) in getDefaultSensor()
497 return sensor; in getDefaultSensor()
602 public void unregisterListener(SensorEventListener listener, Sensor sensor) { in unregisterListener() argument
603 if (listener == null || sensor == null) { in unregisterListener()
607 unregisterListenerImpl(listener, sensor); in unregisterListener()
629 protected abstract void unregisterListenerImpl(SensorEventListener listener, Sensor sensor); in unregisterListenerImpl() argument
683 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
/frameworks/base/native/android/
Dsensor.cpp112 int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor) in ASensorEventQueue_enableSensor() argument
115 static_cast<Sensor const*>(sensor)); in ASensorEventQueue_enableSensor()
118 int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sensor) in ASensorEventQueue_disableSensor() argument
121 static_cast<Sensor const*>(sensor)); in ASensorEventQueue_disableSensor()
124 int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, ASensor const* sensor, in ASensorEventQueue_setEventRate() argument
128 static_cast<Sensor const*>(sensor), us2ns(usec)); in ASensorEventQueue_setEventRate()
161 const char* ASensor_getName(ASensor const* sensor) in ASensor_getName() argument
163 return static_cast<Sensor const*>(sensor)->getName().string(); in ASensor_getName()
166 const char* ASensor_getVendor(ASensor const* sensor) in ASensor_getVendor() argument
168 return static_cast<Sensor const*>(sensor)->getVendor().string(); in ASensor_getVendor()
[all …]
/frameworks/native/include/android/
Dsensor.h122 int32_t sensor; member
152 int32_t sensor; member
254 int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor);
259 int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sensor);
268 int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, ASensor const* sensor, int32_t usec);
299 const char* ASensor_getName(ASensor const* sensor);
304 const char* ASensor_getVendor(ASensor const* sensor);
309 int ASensor_getType(ASensor const* sensor);
314 float ASensor_getResolution(ASensor const* sensor);
321 int ASensor_getMinDelay(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.jd46 geomagnetic field sensor and the orientation sensor. The Android platform also
47 provides a sensor that lets you determine how close the face of a device is to an object (known as
48 the proximity sensor). The geomagnetic field sensor and the proximity sensor are hardware-based.
50 handset and tablet manufacturers include a geomagnetic field sensor. Likewise, handset manufacturers
51 usually include a proximity sensor to determine when a handset is being held close to a user's face
52 (for example, during a phone call). The orientation sensor is software-based and derives its data
53 from the accelerometer and the geomagnetic field sensor.</p>
55 <p class="note"><strong>Note:</strong> The orientation sensor was deprecated in Android 2.2 (API
59 world's frame of reference. For example, you can use the geomagnetic field sensor in
61 the magnetic North Pole. You can also use the orientation sensor (or similar sensor-based
[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.cpp221 const Sensor sensor(s->getSensor()); in registerSensor() local
223 mSensorList.add(sensor); in registerSensor()
225 mSensorMap.add(sensor.getHandle(), s); in registerSensor()
227 mLastEventSeen.add(sensor.getHandle(), NULL); in registerSensor()
229 return sensor; in registerSensor()
234 Sensor sensor = registerSensor(s); in registerVirtualSensor() local
236 return sensor; in registerVirtualSensor()
445 int handle = buffer[i].sensor; in cleanupAutoDisabledSensorLocked()
447 handle = buffer[i].meta_data.sensor; in cleanupAutoDisabledSensorLocked()
450 SensorInterface* sensor = mSensorMap.valueFor(handle); in cleanupAutoDisabledSensorLocked() local
[all …]
DRotationVectorSensor.cpp47 outEvent->sensor = '_rov'; in process()
74 Sensor sensor(&hwSensor); in getSensor() local
75 return sensor; in getSensor()
96 outEvent->sensor = '_gbs'; in process()
123 Sensor sensor(&hwSensor); in getSensor() local
124 return sensor; in getSensor()
DGravitySensor.cpp62 outEvent->sensor = '_grv'; in process()
88 Sensor sensor(&hwSensor); in getSensor() local
89 return sensor; in getSensor()
DOrientationSensor.cpp60 outEvent->sensor = '_ypr'; in process()
87 Sensor sensor(&hwSensor); in getSensor() local
88 return sensor; in getSensor()
DLinearAccelerationSensor.cpp46 outEvent->sensor = '_lin'; in process()
73 Sensor sensor(&hwSensor); in getSensor() local
74 return sensor; in getSensor()
DCorrectedGyroSensor.cpp53 outEvent->sensor = '_cgy'; in process()
80 Sensor sensor(&hwSensor); in getSensor() local
81 return sensor; in getSensor()
/frameworks/base/core/jni/
Dandroid_hardware_SensorManager.cpp145 nativeGetSensorAtIndex(JNIEnv *env, jclass clazz, jlong sensorManager, jobject sensor, jint index) in nativeGetSensorAtIndex() argument
160 env->SetObjectField(sensor, sensorOffsets.name, name); in nativeGetSensorAtIndex()
161 env->SetObjectField(sensor, sensorOffsets.vendor, vendor); in nativeGetSensorAtIndex()
162 env->SetIntField(sensor, sensorOffsets.version, list->getVersion()); in nativeGetSensorAtIndex()
163 env->SetIntField(sensor, sensorOffsets.handle, list->getHandle()); in nativeGetSensorAtIndex()
164 env->SetFloatField(sensor, sensorOffsets.range, list->getMaxValue()); in nativeGetSensorAtIndex()
165 env->SetFloatField(sensor, sensorOffsets.resolution, list->getResolution()); in nativeGetSensorAtIndex()
166 env->SetFloatField(sensor, sensorOffsets.power, list->getPowerUsage()); in nativeGetSensorAtIndex()
167 env->SetIntField(sensor, sensorOffsets.minDelay, list->getMinDelay()); in nativeGetSensorAtIndex()
168 env->SetIntField(sensor, sensorOffsets.fifoReservedEventCount, in nativeGetSensorAtIndex()
[all …]
/frameworks/base/docs/html/ndk/reference/
Dglobals_type.jd21 : <a class="el" href="group___sensor.html#gae85b6eac76abe74e6e53d78bb3a4858c">sensor.h</a>
36 : <a class="el" href="group___sensor.html#ga0378daec23b2d8a70438ef7c3912475f">sensor.h</a>
60 : <a class="el" href="group___sensor.html#ga93b28b7ce5e9b6d2ebc5b574cd5f4710">sensor.h</a>
63 : <a class="el" href="group___sensor.html#ga6bb167c45f0ef0a94d8f178d227e781f">sensor.h</a>
66 : <a class="el" href="group___sensor.html#gaa9448106d6d463f4cc5dded7c914e7ae">sensor.h</a>
69 : <a class="el" href="group___sensor.html#ga26ff51817e8b320a631b3bf4ed378d58">sensor.h</a>
72 : <a class="el" href="group___sensor.html#gaef620baab9b276ab8f914ae77babc349">sensor.h</a>
75 : <a class="el" href="group___sensor.html#gafec8dd682458c750a5f0f913a0f162ce">sensor.h</a>
78 : <a class="el" href="group___sensor.html#ga207e807f9e18271f6a763e57232b409f">sensor.h</a>
87 : <a class="el" href="group___sensor.html#ga24acc545b908dd24cadc44c5e0760b3b">sensor.h</a>
Dglobals_defs.jd15 : <a class="el" href="group___sensor.html#gaf8b57b13c6432bc6136aac0ad3813d63">sensor.h</a>
18 : <a class="el" href="group___sensor.html#ga4423a712e27b6d5a57d138796892886d">sensor.h</a>
21 : <a class="el" href="group___sensor.html#ga5129cb9e4091fc3474e246d5f950e52b">sensor.h</a>
Dstruct_a_meta_data_event.jd14 <p><code>#include &lt;sensor.h&gt;</code></p>
20 …ss="el" href="struct_a_meta_data_event.html#a470f19badf179fe205462c060e5175b4">sensor</a></td></tr>
29 <td class="memname">int32_t sensor</td>
49 <li><a class="el" href="sensor_8h.html">sensor.h</a></li>
Dgroup___sensor.jd21 …<td class="memItemRight" valign="bottom"><a class="el" href="sensor_8h.html">sensor.h</a></td></tr>
112 … href="group___sensor.html#ga93b28b7ce5e9b6d2ebc5b574cd5f4710">ASensor</a> const *sensor)</td></tr>
114 … href="group___sensor.html#ga93b28b7ce5e9b6d2ebc5b574cd5f4710">ASensor</a> const *sensor)</td></tr>
116 …oup___sensor.html#ga93b28b7ce5e9b6d2ebc5b574cd5f4710">ASensor</a> const *sensor, int32_t usec)</td…
122 … href="group___sensor.html#ga93b28b7ce5e9b6d2ebc5b574cd5f4710">ASensor</a> const *sensor)</td></tr>
124 … href="group___sensor.html#ga93b28b7ce5e9b6d2ebc5b574cd5f4710">ASensor</a> const *sensor)</td></tr>
126 … href="group___sensor.html#ga93b28b7ce5e9b6d2ebc5b574cd5f4710">ASensor</a> const *sensor)</td></tr>
128 … href="group___sensor.html#ga93b28b7ce5e9b6d2ebc5b574cd5f4710">ASensor</a> const *sensor)</td></tr>
130 … href="group___sensor.html#ga93b28b7ce5e9b6d2ebc5b574cd5f4710">ASensor</a> const *sensor)</td></tr>
132 … href="group___sensor.html#ga93b28b7ce5e9b6d2ebc5b574cd5f4710">ASensor</a> const *sensor)</td></tr>
[all …]
Dglobals_func.jd470 : <a class="el" href="group___sensor.html#gae9969580eda319926a677a6937c7afb1">sensor.h</a>
473 : <a class="el" href="group___sensor.html#gaec7084c6a9d4d85f87c95a70511c5f53">sensor.h</a>
476 : <a class="el" href="group___sensor.html#gacb6e021757c07344b58742611eaf68e7">sensor.h</a>
479 : <a class="el" href="group___sensor.html#ga52f4b22990c70df0784b9ccf23314fae">sensor.h</a>
482 : <a class="el" href="group___sensor.html#ga99e56b84cf421788c27998da8eab7e39">sensor.h</a>
485 : <a class="el" href="group___sensor.html#ga3da2930dd866cf1f76da6bc39e578a46">sensor.h</a>
488 : <a class="el" href="group___sensor.html#gabee3eb65390fc75a639c59d653af3591">sensor.h</a>
491 : <a class="el" href="group___sensor.html#ga93962747ab3c7d2b609f97af26fc0230">sensor.h</a>
494 : <a class="el" href="group___sensor.html#gafaf467fc71f7adba537a90f166e3320d">sensor.h</a>
497 : <a class="el" href="group___sensor.html#ga0ff4118e400bedac62be6b79e9e0f924">sensor.h</a>
[all …]
/frameworks/native/libs/gui/
DSensorEventQueue.cpp127 status_t SensorEventQueue::enableSensor(Sensor const* sensor) const { in enableSensor()
128 return mSensorEventConnection->enableDisable(sensor->getHandle(), true, 0, 0, false); in enableSensor()
131 status_t SensorEventQueue::disableSensor(Sensor const* sensor) const { in disableSensor()
132 return mSensorEventConnection->enableDisable(sensor->getHandle(), false, 0, 0, false); in disableSensor()
149 status_t SensorEventQueue::setEventRate(Sensor const* sensor, nsecs_t ns) const { in setEventRate() argument
150 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.h70 status_t enableSensor(Sensor const* sensor) const;
71 status_t disableSensor(Sensor const* sensor) const;
72 status_t setEventRate(Sensor const* sensor, nsecs_t ns) const;

12345