/system/chre/core/include/chre/core/ |
sensor.h | 27 * Represents a sensor in the system that is exposed to nanoapps in CHRE. 30 * common code (Sensor) from common interface with platform-specific 34 * type, i.e. chre::Sensor. 36 class Sensor : public PlatformSensor { 39 * Constructs a sensor in an unspecified state. Should not be called directly 40 * by common code, as platform-specific initialization of the Sensor object is 45 Sensor() = default; 47 Sensor(Sensor&& other) = default; 48 Sensor& operator=(Sensor&& other) = default [all...] |
/cts/tests/sensor/src/android/hardware/cts/helpers/ |
SensorNotSupportedException.java | 19 import android.hardware.Sensor; 22 * Exception that indicates that a given sensor is not supported in the device. 26 super("Sensor '%s' of type %d is not supported.", getSensorName(sensorType), sensorType); 30 super("Sensor '%s' of type %d and %s is not supported.", getSensorName(sensorType), 41 case Sensor.TYPE_ACCELEROMETER: 43 case Sensor.TYPE_MAGNETIC_FIELD: 45 case Sensor.TYPE_ORIENTATION: 47 case Sensor.TYPE_GYROSCOPE: 49 case Sensor.TYPE_LIGHT: 51 case Sensor.TYPE_PRESSURE [all...] |
TestSensorEnvironment.java | 20 import android.hardware.Sensor; 30 * The environment is self contained and carries its state around all the sensor test framework. 35 * It represents the fraction of the expected sampling frequency, at which the sensor can 41 private final Sensor mSensor; 49 * Constructs an environment for sensor testing. 52 * @param sensorType The type of the sensor under test 53 * @param samplingPeriodUs The requested collection period for the sensor under test 55 * @deprecated Use variants with {@link Sensor} objects. 63 * Constructs an environment for sensor testing. 66 * @param sensorType The type of the sensor under tes 389 Sensor sensor = sensorManager.getDefaultSensor(sensorType); local [all...] |
/cts/tests/sensor/src/android/hardware/cts/ |
SingleSensorTests.java | 20 import android.hardware.Sensor; 41 * For each sensor that reports continuously, it takes a set of samples. The test suite verifies 42 * that the event ordering, frequency, and jitter pass for the collected sensor events. It 43 * additionally tests that the mean, standard deviation, and magnitude are correct for the sensor 46 * The event ordering test verifies the ordering of the sampled data reported by the Sensor under 47 * test. This test is used to guarantee that sensor data is reported in the order it occurs, and 51 * if the sensor sampled data is not timestamped at the hardware level. Or events sampled at high 54 * The frequency test verifies that the sensor under test can sample and report data at the maximum 57 * susceptible to errors if the sensor is not capable to sample data at the maximum rate it 58 * supports, or the sensor events are not timestamped at the hardware level 124 Sensor sensor = sensorManager.getDefaultSensor(entry.getKey()); local [all...] |
SensorSupportTest.java | 21 import android.hardware.Sensor; 56 checkSupportsSensor(Sensor.TYPE_ACCELEROMETER); 60 checkSupportsSensor(Sensor.TYPE_ACCELEROMETER_UNCALIBRATED); 64 checkSupportsSensor(Sensor.TYPE_GYROSCOPE); 68 checkSupportsSensor(Sensor.TYPE_GYROSCOPE_UNCALIBRATED); 72 checkSupportsSensor(Sensor.TYPE_MAGNETIC_FIELD); 76 checkSupportsSensor(Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED); 80 checkSupportsSensor(Sensor.TYPE_PRESSURE); 84 checkSupportsSensor(Sensor.TYPE_ROTATION_VECTOR); 88 checkSupportsSensor(Sensor.TYPE_SIGNIFICANT_MOTION) 121 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); local [all...] |
SensorBatchingTests.java | 19 import android.hardware.Sensor; 36 * Each test is expected to pass even if batching is not supported for a particular sensor. This is 59 runBatchingSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_FASTEST, BATCHING_PERIOD); 63 runBatchingSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_50HZ, BATCHING_PERIOD); 67 runFlushSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_FASTEST, BATCHING_PERIOD); 71 runFlushSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_50HZ, BATCHING_PERIOD); 75 runBatchingSensorTest(Sensor.TYPE_ACCELEROMETER_UNCALIBRATED, 81 runBatchingSensorTest(Sensor.TYPE_ACCELEROMETER_UNCALIBRATED, 87 runBatchingSensorTest(Sensor.TYPE_ACCELEROMETER_UNCALIBRATED, RATE_50HZ, BATCHING_PERIOD); 91 runFlushSensorTest(Sensor.TYPE_ACCELEROMETER_UNCALIBRATED, RATE_FASTEST, BATCHING_PERIOD) [all...] |
SensorIntegrationTests.java | 19 import android.hardware.Sensor; 43 * This test focuses in the interaction of continuous and batching clients for the same Sensor 44 * under test. The verification ensures that sensor clients can interact with the System and 52 * that the sensors must be independent. Activating one sensor should not cause another sensor 60 * - the sensor type and sensor handle that caused the failure 62 * It is important to look at the internals of the Sensor HAL to identify how the interaction 72 Sensor.TYPE_ACCELEROMETER, 73 Sensor.TYPE_MAGNETIC_FIELD 88 Sensor sensor = TestSensorEnvironment.getSensor(context, sensorType); local 270 Sensor sensor = TestSensorEnvironment.getSensor(getContext(), sensorType); local [all...] |
SensorTest.java | 26 import android.hardware.Sensor; 68 private Sensor mTriggerSensor; 69 private List<Sensor> mSensorList; 70 private List<Sensor> mAndroidSensorList; 82 mSensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL); 91 for (Sensor s : mSensorList) { 92 if (s.getType() < Sensor.TYPE_DEVICE_PRIVATE_BASE) { 125 Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER) local 287 Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_SIGNIFICANT_MOTION); local 299 Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); local 403 Sensor sensor = null; local 439 Sensor sensor = null; local [all...] |
SensorParameterRangeTest.java | 21 import android.hardware.Sensor; 80 mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), 88 mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE), 96 mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD), 105 mSensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE), 113 Sensor sensor, double maxRange, double minFrequency, double maxFrequency) { 116 sensor.getName(), sensor.getMaximumRange(), maxRange, 117 SensorCtsHelper.getUnitsForSensor(sensor)), 165 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); local [all...] |
SensorBatchingFifoTest.java | 21 import android.hardware.Sensor; 32 * Checks the minimum Hardware FIFO length for each of the Hardware sensor. 33 * Further verifies if the advertised FIFO (Sensor.getFifoMaxEventCount()) is actually allocated 34 * for the sensor. 54 Sensor.TYPE_ACCELEROMETER, 55 getReservedFifoLength(Sensor.TYPE_ACCELEROMETER)); 61 Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED, 62 getReservedFifoLength(Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED)); 68 Sensor.TYPE_PRESSURE, 69 getReservedFifoLength(Sensor.TYPE_PRESSURE)) 80 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); local 89 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); local [all...] |
/frameworks/base/core/java/android/hardware/ |
SensorEventListener2.java | 25 * was called have been delivered to the applications registered for those sensor events. In 27 * even if some other application has called flush() on the same sensor. Starting with 33 * @param sensor The {@link android.hardware.Sensor Sensor} on which flush was called. 36 public void onFlushCompleted(Sensor sensor);
|
SensorEventCallback.java | 20 * Used for receiving sensor additional information frames. 25 * Called when sensor values have changed. 33 * Called when the accuracy of the registered sensor has changed. 35 * @see android.hardware.SensorEventListener#onAccuracyChanged(Sensor, int) 38 public void onAccuracyChanged(Sensor sensor, int accuracy) {} 43 * @see android.hardware.SensorEventListener2#onFlushCompleted(Sensor) 46 public void onFlushCompleted(Sensor sensor) {} 49 * Called when a sensor additional information frame is available [all...] |
SensorEventListener.java | 21 * there is new sensor data. 26 * Called when there is a new sensor event. Note that "on changed" 28 * new reading from a sensor with the exact same sensor values (but a 32 * for details on possible sensor types. 46 * Called when the accuracy of the registered sensor has changed. Unlike 52 * @param accuracy The new accuracy of this sensor, one of 55 public void onAccuracyChanged(Sensor sensor, int accuracy);
|
SensorEvent.java | 20 * This class represents a {@link android.hardware.Sensor Sensor} event and 21 * holds information such as the sensor's type, the time-stamp, accuracy and of 22 * course the sensor's {@link SensorEvent#values data}. 52 * @see Sensor 60 * which {@link android.hardware.Sensor sensor} type is being monitored (see 64 * <h4>{@link android.hardware.Sensor#TYPE_ACCELEROMETER 65 * Sensor.TYPE_ACCELEROMETER}:</h4> All values are in SI units (m/s^2) 74 * A sensor of this type measures the acceleration applied to the devic 639 public Sensor sensor; field in class:SensorEvent [all...] |
TriggerEvent.java | 21 * associated with a Trigger Sensor. When the sensor detects a trigger 23 * {@link Sensor#TYPE_SIGNIFICANT_MOTION}, the {@link TriggerEventListener} 24 * is called with the TriggerEvent. The sensor is automatically canceled 27 * This class holds information such as the value of the sensor 29 * information regarding the Sensor itself. 33 * @see android.hardware.Sensor 39 * which {@link android.hardware.Sensor sensor} type is being monitored (see 42 * <h4> {@link Sensor#TYPE_SIGNIFICANT_MOTION} </h4 52 public Sensor sensor; field in class:TriggerEvent [all...] |
/platform_testing/tests/functional/devicehealthchecks/src/com/android/devicehealthchecks/ |
SensorsBootCheck.java | 20 import android.hardware.Sensor; 64 Assert.assertNotNull("Sensor Manager not found", mSensorManager); 68 Sensor.TYPE_ACCELEROMETER, errorDetails) ? 1 : 0; 70 Sensor.TYPE_AMBIENT_TEMPERATURE, errorDetails) ? 1 : 0; 72 Sensor.TYPE_PRESSURE, errorDetails) ? 1 : 0; 74 Sensor.TYPE_MAGNETIC_FIELD, errorDetails) ? 1 : 0; 76 Sensor.TYPE_GYROSCOPE, errorDetails) ? 1 : 0; 78 Sensor.TYPE_LIGHT, errorDetails) ? 1 : 0; 80 Sensor.TYPE_PROXIMITY, errorDetails) ? 1 : 0; 82 Sensor.TYPE_RELATIVE_HUMIDITY, errorDetails) ? 1 : 0 [all...] |
/platform_testing/tests/functional/devicehealthtests/src/com/android/devicehealth/tests/ |
SensorsBootCheck.java | 20 import android.hardware.Sensor; 64 Assert.assertNotNull("Sensor Manager not found", mSensorManager); 68 Sensor.TYPE_ACCELEROMETER, errorDetails) ? 1 : 0; 70 Sensor.TYPE_AMBIENT_TEMPERATURE, errorDetails) ? 1 : 0; 72 Sensor.TYPE_PRESSURE, errorDetails) ? 1 : 0; 74 Sensor.TYPE_MAGNETIC_FIELD, errorDetails) ? 1 : 0; 76 Sensor.TYPE_GYROSCOPE, errorDetails) ? 1 : 0; 78 Sensor.TYPE_LIGHT, errorDetails) ? 1 : 0; 80 Sensor.TYPE_PROXIMITY, errorDetails) ? 1 : 0; 82 Sensor.TYPE_RELATIVE_HUMIDITY, errorDetails) ? 1 : 0 [all...] |
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/utils/hardware/ |
FakeSensorManager.java | 21 import android.hardware.Sensor; 46 * Currently only supports the proximity sensor. 58 Sensor proxSensor = context.getSystemService(SensorManager.class) 59 .getDefaultSensor(Sensor.TYPE_PROXIMITY); 62 proxSensor = createSensor(Sensor.TYPE_PROXIMITY); 67 mFakeLightSensor = new FakeGenericSensor(createSensor(Sensor.TYPE_LIGHT)), 80 public Sensor getDefaultSensor(int type) { 81 Sensor s = super.getDefaultSensor(type); 86 // return non-wakeup sensors if we can't find a wakeup sensor. 91 protected List<Sensor> getFullSensorList() 191 Sensor sensor = constr.newInstance(); local [all...] |
/sdk/testapps/testSensors/src/com/android/tests/testsensors/ |
TestSensorsActivity.java | 23 import android.hardware.Sensor; 41 * Encapsulates a sensor. 44 /** Sensor to monitor. */ 45 private final Sensor mSensor; 46 /** Check box representing the sensor on the screen. */ 48 /** Text view displaying the value of the sensor. */ 56 * @param sensor Sensor to monitor. 58 MonitoredSensor(Sensor sensor) { [all...] |
/system/chre/core/ |
sensor.cc | 17 #include "chre/core/sensor.h" 21 bool Sensor::setRequest(const SensorRequest& request) {
|
/frameworks/native/services/sensorservice/ |
CorrectedGyroSensor.h | 23 #include <sensor/Sensor.h> 35 Sensor mGyro;
|
GravitySensor.h | 23 #include <sensor/Sensor.h> 35 Sensor mAccelerometer;
|
/packages/apps/Camera2/src/com/android/camera/hardware/ |
HeadingSensor.java | 21 import android.hardware.Sensor; 27 * A virtual sensor that reports device heading based on information 28 * provided by accelerometer sensor or magnetic sensor. 38 /** Device sensor manager. */ 41 private final Sensor mAccelerometerSensor; 43 private final Sensor mMagneticSensor; 47 /** Magnetic sensor data. */ 53 * Constructs a heading sensor. 60 mAccelerometerSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER) [all...] |
/system/chre/platform/include/chre/platform/ |
platform_sensor.h | 27 class Sensor; 30 * Defines the common interface to sensor functionality that is implemented in a 33 * @see Sensor 46 * sensor requests. This must be called as part of the deinitialization of the 52 * Constructs Sensor objects for every CHRE-supported sensor in the system, 60 static bool getSensors(DynamicVector<Sensor> *sensors); 63 * Obtains the SensorType of this platform sensor. The implementation of this 67 * @return The type of this sensor. 72 * @return This sensor's minimum supported sampling interval, in nanoseconds [all...] |
/frameworks/native/libs/sensor/include/sensor/ |
Sensor.h | 28 #include <android/sensor.h> 44 class Sensor : public ASensor, public LightFlattenable<Sensor> 64 Sensor(const Sensor&) = default; 65 Sensor& operator=(const Sensor&) = default; 67 Sensor(const char * name = ""); 68 Sensor(struct sensor_t const* hwSensor, int halVersion = 0); 69 Sensor(struct sensor_t const& hwSensor, const uuid_t& uuid, int halVersion = 0) [all...] |