/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...] |
SensorCtsHelper.java | 18 import android.hardware.Sensor; 223 "%s | sensor='%s', samplingPeriod=%dus, maxReportLatency=%dus | %s", 256 * @return A {@link File} representing a root directory to store sensor tests data. 264 * Creates the directory structure for the given sensor test data sub-directory. 315 public static String getUnitsForSensor(Sensor sensor) { 316 switch(sensor.getType()) { 317 case Sensor.TYPE_ACCELEROMETER: 319 case Sensor.TYPE_MAGNETIC_FIELD: 320 case Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED [all...] |
TestSensorEvent.java | 19 import android.hardware.Sensor; 30 public final Sensor sensor; field in class:TestSensorEvent 40 * @param event the received sensor event 55 sensor = event.sensor; 65 public TestSensorEvent(Sensor sensor, long timestamp, int accuracy, float[] values) { 66 this(sensor, timestamp, timestamp, accuracy, values); 72 public TestSensorEvent(Sensor sensor, long timestamp, long receivedTimestamp, int accuracy [all...] |
MovementDetectorHelper.java | 22 import android.hardware.Sensor; 44 private final Sensor mAccelerometer; 52 mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); 54 throw new SensorNotSupportedException(Sensor.TYPE_ACCELEROMETER); 80 public void onAccuracyChanged(Sensor sensor, int accuracy) {}
|
/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 | 22 import android.hardware.Sensor; 63 checkSupportsSensor(Sensor.TYPE_ACCELEROMETER); 69 checkSupportsSensor(Sensor.TYPE_ACCELEROMETER_UNCALIBRATED); 74 checkSupportsSensor(Sensor.TYPE_GYROSCOPE); 78 checkSupportsSensor(Sensor.TYPE_GYROSCOPE_UNCALIBRATED); 82 checkSupportsSensor(Sensor.TYPE_MAGNETIC_FIELD); 86 checkSupportsSensor(Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED); 90 checkSupportsSensor(Sensor.TYPE_PRESSURE); 94 checkSupportsSensor(Sensor.TYPE_ROTATION_VECTOR); 98 checkSupportsSensor(Sensor.TYPE_SIGNIFICANT_MOTION) 131 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; 46 * This test focuses in the interaction of continuous and batching clients for the same Sensor 47 * under test. The verification ensures that sensor clients can interact with the System and 55 * that the sensors must be independent. Activating one sensor should not cause another sensor 63 * - the sensor type and sensor handle that caused the failure 65 * It is important to look at the internals of the Sensor HAL to identify how the interaction 75 Sensor.TYPE_ACCELEROMETER, 76 Sensor.TYPE_MAGNETIC_FIELD 91 Sensor sensor = TestSensorEnvironment.getSensor(context, sensorType); local 243 Sensor sensor = sensorManager.getDefaultSensor(sensorType); local 402 Sensor sensor = TestSensorEnvironment.getSensor(getContext(), 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...] |
SensorParameterRangeTest.java | 21 import android.hardware.Sensor; 96 Sensor.TYPE_ACCELEROMETER, 110 Sensor.TYPE_GYROSCOPE, 120 Sensor.TYPE_MAGNETIC_FIELD, 130 Sensor.TYPE_PRESSURE, 144 if (mVrModeHighPerformance && (sensorType == Sensor.TYPE_ACCELEROMETER || 145 sensorType == Sensor.TYPE_GYROSCOPE || sensorType == Sensor.TYPE_MAGNETIC_FIELD)) { 149 Sensor sensor = mSensorManager.getDefaultSensor(sensorType) local 210 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); local [all...] |
SensorTest.java | 21 import android.hardware.Sensor; 72 private Sensor mTriggerSensor; 73 private List<Sensor> mSensorList; 74 private List<Sensor> mAndroidSensorList; 86 mSensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL); 95 for (Sensor s : mSensorList) { 96 if (s.getType() < Sensor.TYPE_DEVICE_PRIVATE_BASE) { 129 Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER) local 212 Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE); local 316 Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_SIGNIFICANT_MOTION); local 328 Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); local 432 Sensor sensor = null; local 468 Sensor sensor = null; local [all...] |
/external/robolectric-shadows/robolectric/src/test/java/org/robolectric/shadows/ |
ShadowSensorTest.java | 5 import android.hardware.Sensor; 18 Sensor sensor = ShadowSensor.newInstance(Sensor.TYPE_ACCELEROMETER); local 19 assertThat(sensor.getType()).isEqualTo(Sensor.TYPE_ACCELEROMETER); 25 Sensor sensor = ShadowSensor.newInstance(Sensor.TYPE_ACCELEROMETER); local 26 assertThat(sensor.getStringType()).isEqualTo(Sensor.STRING_TYPE_ACCELEROMETER) [all...] |
/external/robolectric-shadows/shadows/framework/src/main/java/org/robolectric/shadows/ |
ShadowSensor.java | 4 import android.hardware.Sensor; 12 @Implements(Sensor.class) 16 * Constructs a {@link Sensor} with a given type. 18 public static Sensor newInstance(int type) { 19 Sensor sensor = Shadow.newInstanceOf(Sensor.class); local 21 Shadow.directlyOn(sensor, Sensor.class, "setType", ClassParameter.from(int.class, type)); 23 ReflectionHelpers.setField(Sensor.class, sensor, "mType", type) [all...] |
ShadowSensorManager.java | 6 import android.hardware.Sensor; 27 private final Map<Integer, Sensor> sensorMap = new HashMap<>(); 33 * Provide a Sensor for the indicated sensor type. 35 * @param sensorType from Sensor constants 36 * @param sensor Sensor instance 37 * @deprecated Use {@link ShadowSensor#newInstance(int)} to construct your {@link Sensor} and add 38 * to the {@link SensorManager} using {@link #addSensor(Sensor)} instead. This method will be 42 public void addSensor(int sensorType, Sensor sensor) 48 sensorMap.put(sensor.getType(), sensor); local [all...] |
/cts/tests/sensor/src/android/hardware/cts/helpers/sensorverification/ |
JitterVerification.java | 23 import android.hardware.Sensor; 36 * A {@link ISensorVerification} which verifies that the sensor jitter is in an acceptable range. 73 * Get the default {@link JitterVerification} for a sensor. 76 * @return the verification or null if the verification does not apply to the sensor. 170 DEFAULTS.put(Sensor.TYPE_ACCELEROMETER, Integer.MAX_VALUE); 171 DEFAULTS.put(Sensor.TYPE_MAGNETIC_FIELD, Integer.MAX_VALUE); 172 DEFAULTS.put(Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED, Integer.MAX_VALUE); 173 DEFAULTS.put(Sensor.TYPE_GYROSCOPE, Integer.MAX_VALUE); 174 DEFAULTS.put(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, Integer.MAX_VALUE); 175 DEFAULTS.put(Sensor.TYPE_ORIENTATION, Integer.MAX_VALUE) [all...] |
StandardDeviationVerification.java | 23 import android.hardware.Sensor; 64 * Get the default {@link StandardDeviationVerification} for a sensor. 67 * @return the verification or null if the verification does not apply to the sensor. 107 DEFAULTS.put(Sensor.TYPE_ACCELEROMETER, new float[]{mAccelNoise, mAccelNoise, mAccelNoise}); 109 DEFAULTS.put(Sensor.TYPE_GYROSCOPE, 112 DEFAULTS.put(Sensor.TYPE_MAGNETIC_FIELD, new float[]{mMagNoise, mMagNoise, mMagNoise}); 114 DEFAULTS.put(Sensor.TYPE_PRESSURE, new float[]{mPressureNoise}); 212 DEFAULTS.put(Sensor.TYPE_ACCELEROMETER, new float[]{1.0f, 1.0f, 1.0f}); 213 DEFAULTS.put(Sensor.TYPE_GYROSCOPE, new float[]{0.5f, 0.5f, 0.5f}); 215 DEFAULTS.put(Sensor.TYPE_MAGNETIC_FIELD [all...] |
EventBasicVerificationTest.java | 21 import android.hardware.Sensor; 41 /* Sensor contents is not used in this verification, use Object as mock */ 44 Sensor sensor1 = null; 46 // accelerometer is the most likely sensor to exist 47 Sensor sensor2 = mgr.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); 78 // if we cannot even get a second sensor then do not bother this test. 84 throw new Error("Expect an AssertionError due to wrong sensor event"); 89 // zero here because wrong sensor is used. 96 int expectedMinNumEvent, Sensor sensor, Sensor eventSensor, float[] ... values) [all...] |
InitialValueVerification.java | 18 import android.hardware.Sensor; 70 * Get the default {@link InitialValueVerification} for a sensor. 73 * @return the verification or null if the verification does not apply to the sensor. 160 DEFAULTS.put(Sensor.TYPE_ACCELEROMETER, 162 DEFAULTS.put(Sensor.TYPE_MAGNETIC_FIELD, 164 DEFAULTS.put(Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED, 166 DEFAULTS.put(Sensor.TYPE_GYROSCOPE, 168 DEFAULTS.put(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, 170 DEFAULTS.put(Sensor.TYPE_ORIENTATION, 173 DEFAULTS.put(Sensor.TYPE_PRESSURE [all...] |
/cts/apps/CtsVerifier/src/com/android/cts/verifier/sensors/ |
DeviceSuspendTestActivity.java | 25 import android.hardware.Sensor; 86 // able to be woken-up when sensor data is delivered. 172 Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER, true); 174 throw new SensorNotSupportedException(Sensor.TYPE_ACCELEROMETER, true); 180 Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE, true); 182 throw new SensorNotSupportedException(Sensor.TYPE_GYROSCOPE, true); 188 Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD,true) [all...] |
EventSanitizationTestActivity.java | 19 import android.hardware.Sensor; 60 // Not significant motion sensor, nothing to do. 63 final Sensor sensor = sensorManager.getDefaultSensor( local 64 Sensor.TYPE_SIGNIFICANT_MOTION); 65 if (sensor == null) { 66 throw new SensorNotSupportedException(Sensor.TYPE_SIGNIFICANT_MOTION); 82 sensorManager.requestTriggerSensor(listener, sensor); 93 sensorManager.cancelTriggerSensor(listener, sensor); 104 // Not significant motion sensor, nothing to do 107 final Sensor sensor = sensorManager.getDefaultSensor( local [all...] |
RotationVectorTestActivity.java | 26 import android.hardware.Sensor; 72 private final Sensor[] mSensor = new Sensor[3]; 120 * Verifies that a given 'Rotation Vector' sensor does not drift over time. 126 Sensor sensor = mSensor[sensorIndex]; local 127 if (sensor == null) { 150 return verifyVector(ROTATION_VECTOR_INDEX, Sensor.TYPE_ROTATION_VECTOR); 156 Sensor.TYPE_GEOMAGNETIC_ROTATION_VECTOR); 160 return verifyVector(GAME_ROTATION_VECTOR_INDEX, Sensor.TYPE_GAME_ROTATION_VECTOR) 198 Sensor sensor = mSensor[i]; local [all...] |
BatchingTestActivity.java | 23 import android.hardware.Sensor; 34 * If a sensor supports the batching mode, FifoReservedEventCount for that sensor should be greater 56 Sensor.TYPE_STEP_COUNTER, 64 Sensor.TYPE_STEP_COUNTER, 72 Sensor.TYPE_STEP_DETECTOR, 80 Sensor.TYPE_STEP_DETECTOR, 91 Sensor.TYPE_PROXIMITY, 102 Sensor.TYPE_PROXIMITY, 110 Sensor.TYPE_LIGHT [all...] |
/device/generic/goldfish/camera/fake-pipeline2/ |
Sensor.cpp | 30 #include "Sensor.h" 37 //const nsecs_t Sensor::kExposureTimeRange[2] = 39 //const nsecs_t Sensor::kFrameDurationRange[2] = 41 const nsecs_t Sensor::kExposureTimeRange[2] = 43 const nsecs_t Sensor::kFrameDurationRange[2] = 46 const nsecs_t Sensor::kMinVerticalBlank = 10000L; 48 const uint8_t Sensor::kColorFilterArrangement = 52 const uint32_t Sensor::kMaxRawValue = 4000; 53 const uint32_t Sensor::kBlackLevel = 1000; 55 // Sensor sensitivit [all...] |
/device/google/cuttlefish_common/guest/hals/camera/fake-pipeline2/ |
Sensor.cpp | 32 #include "Sensor.h" 38 // const nsecs_t Sensor::kExposureTimeRange[2] = 40 // const nsecs_t Sensor::kFrameDurationRange[2] = 42 const nsecs_t Sensor::kExposureTimeRange[2] = {1000L, 44 const nsecs_t Sensor::kFrameDurationRange[2] = { 47 const nsecs_t Sensor::kMinVerticalBlank = 10000L; 49 const uint8_t Sensor::kColorFilterArrangement = 53 const uint32_t Sensor::kMaxRawValue = 4000; 54 const uint32_t Sensor::kBlackLevel = 1000; 56 // Sensor sensitivit [all...] |