Home
last modified time | relevance | path

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

123

/cts/tests/sensor/src/android/hardware/cts/
DSensorTest.java135 Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); in testSensorOperations_accelerometer() local
140 assertNotNull(sensor); in testSensorOperations_accelerometer()
141 assertEquals(Sensor.TYPE_ACCELEROMETER, sensor.getType()); in testSensorOperations_accelerometer()
142 assertSensorValues(sensor); in testSensorOperations_accelerometer()
144 assertNull(sensor); in testSensorOperations_accelerometer()
149 Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER); in testSensorOperations_stepCounter() local
154 assertNotNull(sensor); in testSensorOperations_stepCounter()
155 assertEquals(Sensor.TYPE_STEP_COUNTER, sensor.getType()); in testSensorOperations_stepCounter()
156 assertSensorValues(sensor); in testSensorOperations_stepCounter()
158 assertNull(sensor); in testSensorOperations_stepCounter()
[all …]
DSensorParameterRangeTest.java173 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); in checkSensorRangeAndFrequency() local
174 if (sensor == null) { in checkSensorRangeAndFrequency()
187 sensor.getName(), sensor.getMaximumRange(), range, in checkSensorRangeAndFrequency()
188 SensorCtsHelper.getUnitsForSensor(sensor)), in checkSensorRangeAndFrequency()
189 sensor.getMaximumRange() >= (range - 0.1)); in checkSensorRangeAndFrequency()
190 double actualMaxFrequency = SensorCtsHelper.getFrequency(sensor.getMinDelay(), in checkSensorRangeAndFrequency()
193 sensor.getName(), actualMaxFrequency, frequency), actualMaxFrequency >= in checkSensorRangeAndFrequency()
197 double actualMinFrequency = SensorCtsHelper.getFrequency(sensor.getMaxDelay(), in checkSensorRangeAndFrequency()
200 sensor.getName(), actualMinFrequency, hifiMinFrequency), in checkSensorRangeAndFrequency()
233 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); in checkMinFifoLength() local
[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()
DSensorIntegrationTests.java90 Sensor sensor = TestSensorEnvironment.getSensor(context, sensorType); in testSensorsWithSeveralClients() local
96 sensor.getMinDelay(), in testSensorsWithSeveralClients()
258 Sensor sensor = sensorManager.getDefaultSensor(sensorType); in verifySensorReconfigureWhileActive() local
259 if(sensor == null) { in verifySensorReconfigureWhileActive()
267 sensor, in verifySensorReconfigureWhileActive()
270 sensor.getMaxDelay(), in verifySensorReconfigureWhileActive()
284 sensor, in verifySensorReconfigureWhileActive()
287 sensor.getMinDelay(), in verifySensorReconfigureWhileActive()
457 Sensor sensor = TestSensorEnvironment.getSensor(getContext(), sensorType); in generateSamplingRateInUs() local
458 int maxSamplingRate = sensor.getMinDelay(); in generateSamplingRateInUs()
/cts/apps/CameraITS/tests/scene0/
Dtest_unified_timestamps.py67 for sensor, existing in sensors.items():
69 if existing and sensor != 'vibrator':
70 if not events[sensor]:
72 ts_sensor_first[sensor] = events[sensor][0]['time']
73 ts_sensor_last[sensor] = events[sensor][-1]['time']
82 for sensor, existing in sensors.items():
83 if existing and sensor != 'vibrator':
84 logging.debug('%s timestamps: %d %d', sensor, ts_sensor_first[sensor],
85 ts_sensor_last[sensor])
86 if (not ts_image0 < ts_sensor_first[sensor] < ts_image1 or
[all …]
/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.java200 Sensor sensor, in TestSensorEnvironment() argument
204 sensor, in TestSensorEnvironment()
223 Sensor sensor, in TestSensorEnvironment() argument
228 sensor, in TestSensorEnvironment()
237 Sensor sensor, in TestSensorEnvironment() argument
243 sensor, in TestSensorEnvironment()
254 Sensor sensor, in TestSensorEnvironment() argument
259 this(context, sensor, sensorMightHaveMoreListeners, in TestSensorEnvironment()
268 Sensor sensor, in TestSensorEnvironment() argument
276 mSensor = sensor; in TestSensorEnvironment()
[all …]
DSensorCtsHelper.java321 public static String getUnitsForSensor(Sensor sensor) { in getUnitsForSensor() argument
322 switch(sensor.getType()) { in getUnitsForSensor()
341 public static boolean hasMaxResolutionRequirement(Sensor sensor, boolean hasHifiSensors) { in hasMaxResolutionRequirement() argument
342 switch (sensor.getType()) { in hasMaxResolutionRequirement()
371 public static float getRequiredMaxResolutionForSensor(Sensor sensor) { in getRequiredMaxResolutionForSensor() argument
372 switch (sensor.getType()) { in getRequiredMaxResolutionForSensor()
387 return (float)(2.001f * sensor.getMaximumRange() / Math.pow(2, 12)); in getRequiredMaxResolutionForSensor()
413 public static boolean hasMinResolutionRequirement(Sensor sensor) { in hasMinResolutionRequirement() argument
414 switch (sensor.getType()) { in hasMinResolutionRequirement()
437 public static float getRequiredMinResolutionForSensor(Sensor sensor) { in getRequiredMinResolutionForSensor() argument
[all …]
DSensorRatePermissionEventConnectionTestHelper.java82 Sensor sensor = mTestSensorEnvironment.getSensor(); in errorWhenExceedCappedRate() local
85 sensor.getName(), in errorWhenExceedCappedRate()
94 Sensor sensor = mTestSensorEnvironment.getSensor(); in errorWhenBelowExpectedRate() local
97 sensor.getName(), in errorWhenBelowExpectedRate()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/sensors/
DDeviceSuspendTestActivity.java275 for (Sensor sensor : sensorList) { in testTimestampClockSource()
276 if (sensor.getReportingMode() != Sensor.REPORTING_MODE_CONTINUOUS) { in testTimestampClockSource()
277 … Log.i(TAG, "testTimestampClockSource skipping non-continuous sensor: '" + sensor.getName()); in testTimestampClockSource()
280 if (sensor.getType() >= Sensor.TYPE_DEVICE_PRIVATE_BASE) { in testTimestampClockSource()
281 … Log.i(TAG, "testTimestampClockSource skipping vendor specific sensor: '" + sensor.getName()); in testTimestampClockSource()
291 string = runVerifySensorTimestampClockbase(sensor, false); in testTimestampClockSource()
306 public String runAPWakeUpWhenReportLatencyExpires(Sensor sensor) throws Throwable { in runAPWakeUpWhenReportLatencyExpires() argument
308 verifyBatchingSupport(sensor); in runAPWakeUpWhenReportLatencyExpires()
310 int fifoMaxEventCount = sensor.getFifoMaxEventCount(); in runAPWakeUpWhenReportLatencyExpires()
311 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
DStepSensorPermissionTestActivity.java171 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); in checkSensor() local
172 mSensorUnderTest = sensor; in checkSensor()
175 expected ? "" : "not ", sensor.getName()); in checkSensor()
176 assertTrue(msg, mSensorManager.registerListener(this, sensor, 0, 0) == expected); in checkSensor()
183 assertTrue("Failed to receive event for " + sensor.getName(), eventReceived); in checkSensor()
185 assertFalse("Should not have received event for " + sensor.getName(), eventReceived); in checkSensor()
197 if (sensorEvent.sensor == mSensorUnderTest) { in onSensorChanged()
203 public void onAccuracyChanged(Sensor sensor, int i) { in onAccuracyChanged() argument
247 if (sensorEvent.sensor == mAccel) { in onSensorChanged()
256 public void onAccuracyChanged(Sensor sensor, int i) { in onAccuracyChanged() argument
DDynamicSensorDiscoveryTestActivity.java175 public void onDynamicSensorConnected(Sensor sensor) { in onDynamicSensorConnected() argument
176 Log.d(TAG, "Sensor Connected: " + sensor); in onDynamicSensorConnected()
178 if (mExpectSensorId == null || mExpectSensorId == sensor.getId()) { in onDynamicSensorConnected()
179 mSensor = sensor; in onDynamicSensorConnected()
187 public void onDynamicSensorDisconnected(Sensor sensor) { in onDynamicSensorDisconnected() argument
188 if (mSensor == sensor) { in onDynamicSensorDisconnected()
/cts/tests/tests/virtualdevice/sensor/src/android/virtualdevice/cts/sensor/
DVirtualSensorTest.java17 package android.virtualdevice.cts.sensor;
44 import android.companion.virtual.sensor.VirtualSensor;
45 import android.companion.virtual.sensor.VirtualSensorCallback;
46 import android.companion.virtual.sensor.VirtualSensorConfig;
47 import android.companion.virtual.sensor.VirtualSensorDirectChannelCallback;
48 import android.companion.virtual.sensor.VirtualSensorDirectChannelWriter;
49 import android.companion.virtual.sensor.VirtualSensorEvent;
215 Sensor sensor = mVirtualDeviceSensorManager.getDefaultSensor(TYPE_ACCELEROMETER); in getSensorList_returnsVirtualSensor() local
219 assertThat(sensors).containsExactly(sensor); in getSensorList_returnsVirtualSensor()
220 assertThat(sensor).isNotEqualTo(defaultDeviceSensor); in getSensorList_returnsVirtualSensor()
[all …]
DVirtualSensorDirectChannelWriterTest.java17 package android.virtualdevice.cts.sensor;
28 import android.companion.virtual.sensor.VirtualSensor;
29 import android.companion.virtual.sensor.VirtualSensorDirectChannelWriter;
30 import android.companion.virtual.sensor.VirtualSensorEvent;
191 for (VirtualSensor sensor : sensors) { in testWriteSensorEvents()
194 channel.mChannelHandle, sensor, RATE_NORMAL, in testWriteSensorEvents()
195 /*reportToken=*/sensor.getHandle())) in testWriteSensorEvents()
205 for (VirtualSensor sensor : sensors) { in testWriteSensorEvents()
206 int sensorIndex = sensors.indexOf(sensor) + 1; in testWriteSensorEvents()
208 assertThat(mWriter.writeSensorEvent(sensor, event)).isTrue(); in testWriteSensorEvents()
[all …]
DVirtualSensorNativeTest.java17 package android.virtualdevice.cts.sensor;
30 import android.companion.virtual.sensor.VirtualSensorCallback;
31 import android.companion.virtual.sensor.VirtualSensorConfig;
40 import android.virtualdevice.cts.sensor.util.NativeSensorTestActivity;
/cts/tests/tests/sensorprivacy/src/android/sensorprivacy/cts/
DSensorPrivacyBaseTest.kt69 val sensor: Int, in <lambda>() constant in android.sensorprivacy.cts.SensorPrivacyBaseTest
106 protected val op = getOpForSensor(sensor) in <lambda>()
158 setSensor(sensor, true) in <lambda>()
161 setSensor(sensor, false) in <lambda>()
218 spm.addSensorPrivacyListener(sensor, executor, listener) in <lambda>()
223 spm.removeSensorPrivacyListener(sensor, listener) in <lambda>()
233 spm.addSensorPrivacyListener(sensor, executor, listener) in <lambda>()
238 spm.removeSensorPrivacyListener(sensor, listener) in <lambda>()
251 params.sensor == sensor && in <lambda>()
257 override fun onSensorPrivacyChanged(sensor: Int, enabled: Boolean) { in <lambda>()
[all …]
DSensorPrivacyCameraTest.kt84 private fun setSensorState(sensor: Int, state: Int) { in setSensorState()
86 spm.setSensorPrivacyState(sensor, state) in setSensorState()
90 private fun getSensorState(toggleType: Int, sensor: Int): Int { in getSensorState()
92 spm.getSensorPrivacyState(toggleType, sensor) in getSensorState()
120 if ((params.getState() == ENABLED) && (params.sensor == sensor)) { in testSensorStateChangedListener()
126 override fun onSensorPrivacyChanged(sensor: Int, enabled: Boolean) { in testSensorStateChangedListener()
141 if ((params.getState() == DISABLED) && (params.sensor == sensor)) { in testSensorStateChangedListener()
147 override fun onSensorPrivacyChanged(sensor: Int, enabled: Boolean) { in testSensorStateChangedListener()
163 (params.sensor == sensor)) { in testSensorStateChangedListener()
169 override fun onSensorPrivacyChanged(sensor: Int, enabled: Boolean) { in testSensorStateChangedListener()
/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()
/cts/tests/tests/view/src/android/view/cts/input/
DInputDeviceSensorManagerTest.java121 Callback(@NonNull Sensor sensor) { in Callback() argument
122 mSensor = sensor; in Callback()
126 public void onDynamicSensorConnected(Sensor sensor) { in onDynamicSensorConnected() argument
128 if (mSensor.getId() == sensor.getId()) { in onDynamicSensorConnected()
135 public void onDynamicSensorDisconnected(Sensor sensor) { in onDynamicSensorDisconnected() argument
137 if (mSensor.getId() == sensor.getId()) { in onDynamicSensorDisconnected()
201 public void onAccuracyChanged(Sensor sensor, int accuracy) { in onAccuracyChanged() argument
239 private float[] getExpectedSensorValue(Sensor sensor, int[] dataVector) { in getExpectedSensorValue() argument
242 switch (sensor.getType()) { in getExpectedSensorValue()
272 private void injectSensorSample(Sensor sensor, int[] dataVec, int timestamp) { in injectSensorSample() argument
[all …]
/cts/tests/sensor/sensorratepermission/DebuggableAPI31/src/android/sensorratepermission/cts/debuggableapi31/
DDebuggableAPI31Test.java71 Sensor sensor = mSensorManager.getDefaultSensor(sensorType); in testRegisterListener() local
72 if (sensor == null) { in testRegisterListener()
77 sensor, in testRegisterListener()
83 sensor, in testRegisterListener()
/cts/tests/tests/virtualdevice/sensor/src/android/virtualdevice/cts/sensor/util/jni/
Dandroid_virtualdevice_cts_sensor_util_NativeSensorTestActivity.cpp31 const ASensor* sensor = in getDefaultAccelerometerName() local
33 return env->NewStringUTF(ASensor_getName(sensor)); in getDefaultAccelerometerName()
/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 …]

123