Home
last modified time | relevance | path

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

123

/frameworks/base/core/java/android/hardware/
DSystemSensorManager.java41 private static native int nativeGetNextSensor(Sensor sensor, int next); in nativeGetNextSensor() argument
72 Sensor sensor = new Sensor(); in SystemSensorManager() local
73 i = nativeGetNextSensor(sensor, i); in SystemSensorManager()
77 fullList.add(sensor); in SystemSensorManager()
78 sHandleToSensor.append(sensor.getHandle(), sensor); in SystemSensorManager() local
95 protected boolean registerListenerImpl(SensorEventListener listener, Sensor sensor, in registerListenerImpl() argument
97 if (listener == null || sensor == null) { in registerListenerImpl()
102 if (sensor.getReportingMode() == Sensor.REPORTING_MODE_ONE_SHOT) { in registerListenerImpl()
120 if (!queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs, reservedFlags)) { in registerListenerImpl()
127 return queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs, reservedFlags); in registerListenerImpl()
[all …]
DSensorManager.java458 for (Sensor sensor : l) { in getDefaultSensor()
459 if (sensor.isWakeUpSensor() == wakeUpSensor) return sensor; in getDefaultSensor()
492 for (Sensor sensor : l) { in getDefaultSensor()
493 if (sensor.isWakeUpSensor() == wakeUp) in getDefaultSensor()
494 return sensor; in getDefaultSensor()
599 public void unregisterListener(SensorEventListener listener, Sensor sensor) { in unregisterListener() argument
600 if (listener == null || sensor == null) { in unregisterListener()
604 unregisterListenerImpl(listener, sensor); in unregisterListener()
626 protected abstract void unregisterListenerImpl(SensorEventListener listener, Sensor sensor); in unregisterListenerImpl() argument
665 public boolean registerListener(SensorEventListener listener, Sensor sensor, int rateUs) { 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
DSensor.java601 static int getMaxLengthValuesArray(Sensor sensor, int sdkLevel) { in getMaxLengthValuesArray() argument
604 if (sensor.mType == Sensor.TYPE_ROTATION_VECTOR && in getMaxLengthValuesArray()
608 int offset = sensor.mType; in getMaxLengthValuesArray()
/frameworks/base/native/android/
Dsensor.cpp99 int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor) in ASensorEventQueue_enableSensor() argument
102 static_cast<Sensor const*>(sensor)); in ASensorEventQueue_enableSensor()
105 int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sensor) in ASensorEventQueue_disableSensor() argument
108 static_cast<Sensor const*>(sensor)); in ASensorEventQueue_disableSensor()
111 int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, ASensor const* sensor, in ASensorEventQueue_setEventRate() argument
115 static_cast<Sensor const*>(sensor), us2ns(usec)); in ASensorEventQueue_setEventRate()
148 const char* ASensor_getName(ASensor const* sensor) in ASensor_getName() argument
150 return static_cast<Sensor const*>(sensor)->getName().string(); in ASensor_getName()
153 const char* ASensor_getVendor(ASensor const* sensor) in ASensor_getVendor() argument
155 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
241 int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor);
246 int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sensor);
255 int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, ASensor const* sensor, int32_t usec);
286 const char* ASensor_getName(ASensor const* sensor);
291 const char* ASensor_getVendor(ASensor const* sensor);
296 int ASensor_getType(ASensor const* sensor);
301 float ASensor_getResolution(ASensor const* sensor);
308 int ASensor_getMinDelay(ASensor const* sensor);
[all …]
/frameworks/native/services/sensorservice/
DSensorService.cpp205 const Sensor sensor(s->getSensor()); in registerSensor() local
207 mSensorList.add(sensor); in registerSensor()
209 mSensorMap.add(sensor.getHandle(), s); in registerSensor()
211 mLastEventSeen.add(sensor.getHandle(), event); in registerSensor()
213 return sensor; in registerSensor()
218 Sensor sensor = registerSensor(s); in registerVirtualSensor() local
220 return sensor; in registerVirtualSensor()
359 int handle = buffer[i].sensor; in cleanupAutoDisabledSensorLocked()
361 handle = buffer[i].meta_data.sensor; in cleanupAutoDisabledSensorLocked()
364 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()
DCorrectedGyroSensor.cpp53 outEvent->sensor = '_cgy'; in process()
80 Sensor sensor(&hwSensor); in getSensor() local
81 return sensor; in getSensor()
DLinearAccelerationSensor.cpp46 outEvent->sensor = '_lin'; in process()
73 Sensor sensor(&hwSensor); in getSensor() local
74 return sensor; in getSensor()
DOrientationSensor.cpp60 outEvent->sensor = '_ypr'; in process()
87 Sensor sensor(&hwSensor); in getSensor() local
88 return sensor; in getSensor()
DGravitySensor.cpp62 outEvent->sensor = '_grv'; in process()
88 Sensor sensor(&hwSensor); in getSensor() local
89 return sensor; in getSensor()
DSensorInterface.cpp31 HardwareSensor::HardwareSensor(const sensor_t& sensor) in HardwareSensor() argument
33 mSensor(&sensor, mSensorDevice.getHalDeviceVersion()) in HardwareSensor()
DSensorService.h218 Sensor registerSensor(SensorInterface* sensor);
219 Sensor registerVirtualSensor(SensorInterface* sensor);
226 static bool canAccessSensor(const Sensor& sensor);
227 static bool verifyCanAccessSensor(const Sensor& sensor, const char* operation);
/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/base/core/jni/
Dandroid_hardware_SensorManager.cpp88 nativeGetNextSensor(JNIEnv *env, jclass clazz, jobject sensor, jint next) in nativeGetNextSensor() argument
103 env->SetObjectField(sensor, sensorOffsets.name, name); in nativeGetNextSensor()
104 env->SetObjectField(sensor, sensorOffsets.vendor, vendor); in nativeGetNextSensor()
105 env->SetIntField(sensor, sensorOffsets.version, list->getVersion()); in nativeGetNextSensor()
106 env->SetIntField(sensor, sensorOffsets.handle, list->getHandle()); in nativeGetNextSensor()
107 env->SetIntField(sensor, sensorOffsets.type, list->getType()); in nativeGetNextSensor()
108 env->SetFloatField(sensor, sensorOffsets.range, list->getMaxValue()); in nativeGetNextSensor()
109 env->SetFloatField(sensor, sensorOffsets.resolution, list->getResolution()); in nativeGetNextSensor()
110 env->SetFloatField(sensor, sensorOffsets.power, list->getPowerUsage()); in nativeGetNextSensor()
111 env->SetIntField(sensor, sensorOffsets.minDelay, list->getMinDelay()); in nativeGetNextSensor()
[all …]
/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()
105 int sensor = data.readInt32(); in onTransact() local
106 noteStartSensor(uid, sensor); in onTransact()
113 int sensor = data.readInt32(); in onTransact() local
114 noteStopSensor(uid, sensor); in onTransact()
/frameworks/native/libs/gui/
DSensorEventQueue.cpp123 status_t SensorEventQueue::enableSensor(Sensor const* sensor) const { in enableSensor()
124 return mSensorEventConnection->enableDisable(sensor->getHandle(), true, 0, 0, false); in enableSensor()
127 status_t SensorEventQueue::disableSensor(Sensor const* sensor) const { in disableSensor()
128 return mSensorEventConnection->enableDisable(sensor->getHandle(), false, 0, 0, false); in disableSensor()
145 status_t SensorEventQueue::setEventRate(Sensor const* sensor, nsecs_t ns) const { in setEventRate() argument
146 return mSensorEventConnection->setEventRate(sensor->getHandle(), ns); in setEventRate()
/frameworks/native/include/gui/
DSensorEventQueue.h69 status_t enableSensor(Sensor const* sensor) const;
70 status_t disableSensor(Sensor const* sensor) const;
71 status_t setEventRate(Sensor const* sensor, nsecs_t ns) const;
/frameworks/native/include/binder/
DIBatteryStats.h31 virtual void noteStartSensor(int uid, int sensor) = 0;
32 virtual void noteStopSensor(int uid, int sensor) = 0;
/frameworks/base/core/java/android/view/
DOrientationListener.java93 public void onAccuracyChanged(int sensor, int accuracy) { in onAccuracyChanged() argument
96 public void onSensorChanged(int sensor, float[] values) { in onSensorChanged() argument

123