Home
last modified time | relevance | path

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

12

/cts/tests/sensor/src/android/hardware/cts/
DSensorTest.java125 Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); in testSensorOperations() local
130 assertEquals(Sensor.TYPE_ACCELEROMETER, sensor.getType()); in testSensorOperations()
131 assertSensorValues(sensor); in testSensorOperations()
133 assertNull(sensor); in testSensorOperations()
136 sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER); in testSensorOperations()
141 assertEquals(Sensor.TYPE_STEP_COUNTER, sensor.getType()); in testSensorOperations()
142 assertSensorValues(sensor); in testSensorOperations()
144 assertNull(sensor); in testSensorOperations()
147 sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_STEP_DETECTOR); in testSensorOperations()
152 assertEquals(Sensor.TYPE_STEP_DETECTOR, sensor.getType()); in testSensorOperations()
[all …]
DSensorParameterRangeTest.java113 Sensor sensor, double maxRange, double minFrequency, double maxFrequency) { in checkSensorRangeAndFrequency() argument
116 sensor.getName(), sensor.getMaximumRange(), maxRange, in checkSensorRangeAndFrequency()
117 SensorCtsHelper.getUnitsForSensor(sensor)), in checkSensorRangeAndFrequency()
118 sensor.getMaximumRange() >= maxRange); in checkSensorRangeAndFrequency()
119 double actualMinFrequency = SensorCtsHelper.getFrequency(sensor.getMaxDelay(), in checkSensorRangeAndFrequency()
122 sensor.getName(), actualMinFrequency, minFrequency), actualMinFrequency <= in checkSensorRangeAndFrequency()
125 double actualMaxFrequency = SensorCtsHelper.getFrequency(sensor.getMinDelay(), in checkSensorRangeAndFrequency()
128 sensor.getName(), actualMaxFrequency, maxFrequency), actualMaxFrequency >= in checkSensorRangeAndFrequency()
165 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); in checkMinFifoLength() local
166 assertTrue(String.format("sensor of type=%d (null)", sensorType), sensor != null); in checkMinFifoLength()
[all …]
DSensorBatchingFifoTest.java80 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); in getReservedFifoLength() local
81 assertTrue(String.format("sensor of type=%d (null)", sensorType), sensor != null); in getReservedFifoLength()
82 return sensor.getFifoReservedEventCount(); in getReservedFifoLength()
89 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); in runBatchingSensorFifoTest() local
91 sensor, in runBatchingSensorFifoTest()
93 sensor.getMinDelay(), in runBatchingSensorFifoTest()
DSensorSupportTest.java121 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); in checkSupportsSensor() local
122 assertTrue(sensor != null); in checkSupportsSensor()
124 … assertTrue(sensor.isDirectChannelTypeSupported(SensorDirectChannel.TYPE_HARDWARE_BUFFER)); in checkSupportsSensor()
DSensorAdditionalInfoTest.java123 public void onFlushCompleted(Sensor sensor) { in onFlushCompleted() argument
124 if (sensor == mSensor) { in onFlushCompleted()
131 if (info.sensor == mSensor && !mFlushPending) { in onSensorAdditionalInfo()
DSensorIntegrationTests.java88 Sensor sensor = TestSensorEnvironment.getSensor(context, sensorType); in testSensorsWithSeveralClients() local
94 sensor.getMinDelay(), in testSensorsWithSeveralClients()
270 Sensor sensor = TestSensorEnvironment.getSensor(getContext(), sensorType); in generateSamplingRateInUs() local
271 int maxSamplingRate = sensor.getMinDelay(); in generateSamplingRateInUs()
/cts/apps/CameraITS/tests/scene0/
Dtest_unified_timestamps.py46 for sensor, existing in sensors.iteritems():
48 assert(len(events[sensor]) > 0)
49 ts_sensor_first[sensor] = events[sensor][0]["time"]
50 ts_sensor_last[sensor] = events[sensor][-1]["time"]
59 for sensor, existing in sensors.iteritems():
61 print "%s timestamps: %d %d" % (sensor, ts_sensor_first[sensor],
62 ts_sensor_last[sensor])
63 assert ts_image0 < ts_sensor_first[sensor] < ts_image1
64 assert ts_image0 < ts_sensor_last[sensor] < ts_image1
/cts/tools/cts-device-info/src/com/android/cts/deviceinfo/
DSensorDeviceInfo.java71 for (Sensor sensor : sensors) { in collectDeviceInfo()
73 store.addResult(REPORTING_MODE, sensor.getReportingMode()); in collectDeviceInfo()
74 store.addResult(NAME, sensor.getName()); in collectDeviceInfo()
75 store.addResult(VENDOR, sensor.getVendor()); in collectDeviceInfo()
76 store.addResult(TYPE, sensor.getType()); in collectDeviceInfo()
77 store.addResult(VERSION, sensor.getVersion()); in collectDeviceInfo()
78 store.addResult(MAXIMUM_RANGE, sensor.getMaximumRange()); in collectDeviceInfo()
79 store.addResult(RESOLUTION, sensor.getResolution()); in collectDeviceInfo()
80 store.addResult(POWER, sensor.getPower()); in collectDeviceInfo()
81 store.addResult(MIN_DELAY, sensor.getMinDelay()); in collectDeviceInfo()
[all …]
/cts/tests/sensor/src/android/hardware/cts/helpers/
DTestSensorEvent.java30 public final Sensor sensor; field in TestSensorEvent
55 sensor = event.sensor; in TestSensorEvent()
65 public TestSensorEvent(Sensor sensor, long timestamp, int accuracy, float[] values) { in TestSensorEvent() argument
66 this(sensor, timestamp, timestamp, accuracy, values); in TestSensorEvent()
72 public TestSensorEvent(Sensor sensor, long timestamp, long receivedTimestamp, int accuracy, in TestSensorEvent() argument
74 this.sensor = sensor; in TestSensorEvent()
DTestSensorEnvironment.java171 Sensor sensor, in TestSensorEnvironment() argument
175 sensor, in TestSensorEnvironment()
194 Sensor sensor, in TestSensorEnvironment() argument
199 sensor, in TestSensorEnvironment()
208 Sensor sensor, in TestSensorEnvironment() argument
214 sensor, in TestSensorEnvironment()
224 Sensor sensor, in TestSensorEnvironment() argument
229 this(context, sensor, sensorMightHaveMoreListeners, in TestSensorEnvironment()
237 Sensor sensor, in TestSensorEnvironment() argument
244 mSensor = sensor; in TestSensorEnvironment()
[all …]
DSensorCalibratedUncalibratedVerifier.java120 calibratedEvent.sensor.getName(), in verifyCalibratedUncalibratedPair()
121 uncalibratedEvent.sensor.getName(), in verifyCalibratedUncalibratedPair()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/sensors/
DDeviceSuspendTestActivity.java242 for (Sensor sensor : sensorList) { in testTimestampClockSource()
243 if (sensor.getReportingMode() != Sensor.REPORTING_MODE_CONTINUOUS) { in testTimestampClockSource()
244 … Log.i(TAG, "testTimestampClockSource skipping non-continuous sensor: '" + sensor.getName()); in testTimestampClockSource()
247 if (sensor.getType() >= Sensor.TYPE_DEVICE_PRIVATE_BASE) { in testTimestampClockSource()
248 … Log.i(TAG, "testTimestampClockSource skipping vendor specific sensor: '" + sensor.getName()); in testTimestampClockSource()
252 string = runVerifySensorTimestampClockbase(sensor, false); in testTimestampClockSource()
267 public String runAPWakeUpWhenReportLatencyExpires(Sensor sensor) throws Throwable { in runAPWakeUpWhenReportLatencyExpires() argument
269 verifyBatchingSupport(sensor); in runAPWakeUpWhenReportLatencyExpires()
271 int fifoMaxEventCount = sensor.getFifoMaxEventCount(); in runAPWakeUpWhenReportLatencyExpires()
272 int samplingPeriodUs = sensor.getMaxDelay(); in runAPWakeUpWhenReportLatencyExpires()
[all …]
DEventSanitizationTestActivity.java63 final Sensor sensor = sensorManager.getDefaultSensor( in testNoTriggerEventsWhileUidIdle() local
65 if (sensor == null) { in testNoTriggerEventsWhileUidIdle()
82 sensorManager.requestTriggerSensor(listener, sensor); in testNoTriggerEventsWhileUidIdle()
93 sensorManager.cancelTriggerSensor(listener, sensor); in testNoTriggerEventsWhileUidIdle()
107 final Sensor sensor = sensorManager.getDefaultSensor( in testNoOnChangeEventsWhileUidIdle() local
109 if (sensor == null) { in testNoOnChangeEventsWhileUidIdle()
127 public void onAccuracyChanged(Sensor sensor, int accuracy) { in testNoOnChangeEventsWhileUidIdle()
131 sensorManager.registerListener(listener, sensor, in testNoOnChangeEventsWhileUidIdle()
132 sensor.getMinDelay(), sensor.getMaxDelay()); in testNoOnChangeEventsWhileUidIdle()
143 sensorManager.unregisterListener(listener, sensor); in testNoOnChangeEventsWhileUidIdle()
DRotationVectorTestActivity.java126 Sensor sensor = mSensor[sensorIndex]; in verifyVector() local
127 if (sensor == null) { in verifyVector()
198 Sensor sensor = mSensor[i]; in onResume() local
199 if (sensor != null) { in onResume()
201 .registerListener(mListener, sensor, SensorManager.SENSOR_DELAY_GAME); in onResume()
202 Log.v(LOG_TAG, "Renderer using sensor: " + sensor.getName()); in onResume()
214 if (event.sensor.getType() == Sensor.TYPE_ROTATION_VECTOR) { in onSensorChanged()
217 if (event.sensor.getType() == Sensor.TYPE_GEOMAGNETIC_ROTATION_VECTOR) { in onSensorChanged()
220 if (event.sensor.getType() == Sensor.TYPE_GAME_ROTATION_VECTOR) { in onSensorChanged()
226 public void onAccuracyChanged(Sensor sensor, int accuracy) { in onAccuracyChanged() argument
DDynamicSensorDiscoveryTestActivity.java164 public void onDynamicSensorConnected(Sensor sensor) { in onDynamicSensorConnected() argument
165 Log.d(TAG, "Sensor Connected: " + sensor); in onDynamicSensorConnected()
167 if (mExpectSensorId == null || mExpectSensorId == sensor.getId()) { in onDynamicSensorConnected()
168 mSensor = sensor; in onDynamicSensorConnected()
176 public void onDynamicSensorDisconnected(Sensor sensor) { in onDynamicSensorDisconnected() argument
177 if (mSensor == sensor) { in onDynamicSensorDisconnected()
DStepCounterTestActivity.java215 String sensorName = counterEvent.sensor.getName(); in verifyStepCounterMeasurements()
243 + TestSensorEnvironment.getSensorMaxDetectionLatencyNs(counterEvent.sensor); in verifyStepCounterMeasurements()
248 counterEvent.sensor.getName()); in verifyStepCounterMeasurements()
272 counterEvent.sensor.getName()); in verifyStepCounterMeasurements()
294 String sensorName = detectorEvent.sensor.getName(); in verifyStepDetectorMeasurements()
317 public final void onAccuracyChanged(Sensor sensor, int accuracy) { in onAccuracyChanged() argument
322 int type = event.sensor.getType(); in onSensorChanged()
DSensorSynchronizationTestActivity.java75 if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { in analyzeData()
83 } else if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) { in analyzeData()
92 if (event.sensor.getType() == Sensor.TYPE_GYROSCOPE) { in analyzeData()
166 public void onAccuracyChanged(Sensor sensor, int accuracy) { in onAccuracyChanged() argument
DOffBodySensorTestActivity.java109 public void onAccuracyChanged(Sensor sensor, int accuracy) {} in onAccuracyChanged() argument
114 int type = event.sensor.getType(); in onSensorChanged()
179 int eventType = registry.event.sensor.getType(); in verifyEvent()
189 String sensorName = registry.event.sensor.getName(); in verifyEvent()
387 public String runOffbodyDetectResponseTimeTest(Sensor sensor) throws Throwable { in runOffbodyDetectResponseTimeTest() argument
390 mOffBodySensor = sensor; in runOffbodyDetectResponseTimeTest()
449 public String runOnbodyDetectResponseTimeTest(Sensor sensor) throws Throwable { in runOnbodyDetectResponseTimeTest() argument
450 mOffBodySensor = sensor; in runOnbodyDetectResponseTimeTest()
495 public String runWakeAPOffbodyDetectTest(Sensor sensor) throws Throwable { in runWakeAPOffbodyDetectTest() argument
502 mOffBodySensor = sensor; in runWakeAPOffbodyDetectTest()
/cts/tests/sensor/src/android/hardware/cts/helpers/sensorverification/
DFrequencyVerification.java68 Sensor sensor = environment.getSensor(); in getDefault() local
69 if (sensor.getReportingMode() != Sensor.REPORTING_MODE_CONTINUOUS) { in getDefault()
75 sensor.getName(), in getDefault()
76 sensor.getMinDelay(), in getDefault()
77 sensor.getMaxDelay())); in getDefault()
79 double minDelayUs = sensor.getMinDelay(); in getDefault()
80 double maxDelayUs = sensor.getMaxDelay(); in getDefault()
86 Log.w(LOG_TAG, "This sensor (" + sensor.getName() + ") didn't report its maxDelay." in getDefault()
106 if (sensor.getMaxDelay() > 0) { in getDefault()
DEventBasicVerification.java64 Sensor sensor) { in EventBasicVerification() argument
66 mSensor = sensor; in EventBasicVerification()
204 if (event.sensor == mSensor) { in addSensorEventInternal()
DEventBasicVerificationTest.java96 int expectedMinNumEvent, Sensor sensor, Sensor eventSensor, float[] ... values) { in getVerification() argument
103 new EventBasicVerification(expectedMinNumEvent, sensor); in getVerification()
/cts/tests/tests/car/src/android/car/cts/
DCarSensorManagerTest.java42 for (int sensor: supportedSensors) { in testRequiredSensorsForDrivingState()
43 if (sensor == CarSensorManager.SENSOR_TYPE_CAR_SPEED) { in testRequiredSensorsForDrivingState()
45 } else if ( sensor == CarSensorManager.SENSOR_TYPE_GEAR) { in testRequiredSensorsForDrivingState()
/cts/apps/CtsVerifier/assets/scripts/
Dexecute_power_tests.py593 def setPowerOn(self, sensor, powered_on): argument
595 (("ON" if powered_on else "OFF"), sensor))
597 response == "ERR", "Unable to set sensor %s state" % sensor)
598 logging.info("Set %s %s", sensor, ("ON" if powered_on else "OFF"))
602 self, sensor, max_amperes_allowed, baseline_amps, user_request = None): argument
616 sensor, ("Under_Motion" if user_request is not None else "Still")))
620 print ("Running power test on %s under motion." % sensor)
622 print ("Running power test on %s while device is still." % sensor)
625 PowerTest.REQUEST_SENSOR_AVAILABILITY % sensor)
629 test_message = "Sensor %s not available on this platform" % sensor)
[all …]
/cts/tests/sensor/jni/
DSensorTestCases.cpp150 TestSensor sensor = mManager->getDefaultSensor(sensorType); in testDirectReport() local
151 if (!sensor.isValid() in testDirectReport()
152 || sensor.getHighestDirectReportRateLevel() < rateLevel in testDirectReport()
153 || !sensor.isDirectChannelTypeSupported(channelType)) { in testDirectReport()
186 eventToken = mManager->configureDirectReport(sensor, channel, rateLevel); in testDirectReport()
213 ASSERT_EQ(e.sensor, eventToken); in testDirectReport()
241 mManager->configureDirectReport(sensor, channel, ASENSOR_DIRECT_RATE_STOP); in testDirectReport()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/
DPowerTestHostLink.java212 final String sensor = request.substring(REQUEST_SENSOR_AVAILABILITY.length()); in processClientRequest() local
213 final int sensorId = getSensorId(sensor); in processClientRequest()
415 for (Sensor sensor : allSensors) { in switchAllSensors()
416 if (sensor.getType() >= Sensor.TYPE_DEVICE_PRIVATE_BASE) { in switchAllSensors()
419 response = switchSensor(sensor.getType(), on); in switchAllSensors()
438 public void onAccuracyChanged(Sensor sensor, int accuracy) {}

12