DO NOT MERGE:CDD Annotations for Sensors

7.3/C-1-8: MUST ensure that the sensor event stream MUST NOT prevent the device
CPU from entering a suspend state or waking up from a suspend state.
-->DeviceSuspendActivity#testAPWakeup..
-->DeviceSuspendActivity#testAccelBatching..

Composite Sensors: CDD:7.3.2/C-2-1,7.3.1/,C-3-1,C-4-1,7.3/C-2-1
-->SingleSensorTests#testGravity1/5_hz
-->SingleSensorTest#testGameRotationVector
-->SingleSensorTest#testLinearAcceleration

CDD 7.3/C-1-7:Continuous Sensor: jitter test
-->SingleSensorTest#testAcclerometer
-->SingleSensorTest#testMagneticField
-->SingleSensorTest#testGyroscope

CDD:7.3/C-0-1/C-0-2/C-0-3
 C-0-1:MUST accurately report the presence or absence of sensors per the
android.content.pm.PackageManager class.
 C-0-2:MUST return an accurate list of supported sensors via the
SensorManager.getSensorList() and similar methods.
-->SystemFeaturesTest#testSensorFeatures

C-0-3:MUST behave reasonably for all other sensor APIs..(Must return true or false as
appropriate when applications attempt to register listeners,
-->SensorTest#testRequestTriggerWithNonTrigger
-->testCancelTriggerWithNonTrigger
-->testRegisterTrigger

CDD:7.3.9/C-3-1,C-3-2:
 C-3-1: MUST correctly declare support of direct channel types
and direct report rates level through the isDirectChannelTypeSupported and
getHighestDirectReportRateLevel API.
 C-3-2 MUST support at least one of the two sensor direct channel types for all
sensors that declare support for sensor direct channel
TYPE_HARDWARE_BUFFER
TYPE_MEMORY_FILE

-->SenosrDirectReportTest#testAccle/Gyro/MagAshMemNormal/Fast/VeryFast

CDD:7.3/C-1-1: MUST report all sensor measurements using the relevant International System
of Units (metric)
-->"SensorParameterRangeTest#checkSensor
RangeAndFrequency#getUnitsForSensor"

CDD: 7.3/C-1-2,C-1-3
 C-1-2: MUST report sensor data with a maximum latency of 100 milliseconds
2 * sample_time for the case of a sensor streamed with a minimum required latency
of 5 ms + 2 * sample_time when the application processor is active.
This delay does not include any filtering delays.
-->SingleSensorTests#testAccel/gyro/mag

 C-1-3 MUST report the first sensor sample within 400 milliseconds + 2 * sample_time of
the sensor being activated. It is acceptable for this sample to have an accuracy of 0.
-->SensorBatchingTests#testAcce/Gyro/Mag/_fastestBatching/_50hz

CDD: 7.3.9/C-2-1: TYPE_ACCELEROMETER: buffering capability of at least 3000 events
CDD: 7.3.9/C-2-6: TYPE_PRESSURE: buffering capability of 300 sensor events.
CDD: 7.3.9/C-2-17: TYPE_PROXIMITY: buffering capability of 100 sensor events.
CDD: 7.3.9/C-2-10: TYPE_STEP_DETECTOR:  buffering capability of 100 sensor events
--> SensorParameterRangeTest#testPressure/GameRotation/Proximity/StepDetectorFifoLength()

Bug: 117652133

Test: make cts
Change-Id: I8b6bab31c71ff4734374d26569427357f252520f
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/location/GpsTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/location/GpsTestActivity.java
index 4909497..c779a2a 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/location/GpsTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/location/GpsTestActivity.java
@@ -19,6 +19,8 @@
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
+import com.android.compatibility.common.util.CddTest;
+
 import android.content.Context;
 import android.graphics.Color;
 import android.graphics.Typeface;
@@ -41,6 +43,7 @@
 /**
  * CTS Verifier case for verifying GPS.
  */
+@CddTest(requirement="7.3.3/C-1-1")
 public class GpsTestActivity extends PassFailButtons.Activity implements PassFailLog {
     private LocationManager mLocationManager;
     private TextView mTextView;
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/DeviceSuspendTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/DeviceSuspendTestActivity.java
index e5a262a..f688951 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/DeviceSuspendTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/DeviceSuspendTestActivity.java
@@ -11,6 +11,8 @@
 import com.android.cts.verifier.sensors.base.SensorCtsVerifierTestActivity;
 import com.android.cts.verifier.sensors.helpers.SensorTestScreenManipulator;
 
+import com.android.compatibility.common.util.CddTest;
+
 import android.app.AlarmManager;
 import android.app.PendingIntent;
 import android.content.BroadcastReceiver;
@@ -122,6 +124,7 @@
             }
         };
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenReportLatencyExpiresAccel() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER, true);
             if (wakeUpSensor == null) {
@@ -130,6 +133,7 @@
             return runAPWakeUpWhenReportLatencyExpires(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenReportLatencyExpiresGyro() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE, true);
             if (wakeUpSensor == null) {
@@ -138,6 +142,7 @@
             return runAPWakeUpWhenReportLatencyExpires(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenReportLatencyExpiresMag() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD,true);
             if (wakeUpSensor == null) {
@@ -146,6 +151,7 @@
             return runAPWakeUpWhenReportLatencyExpires(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenFIFOFullAccel() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER, true);
             if (wakeUpSensor == null) {
@@ -154,6 +160,7 @@
             return runAPWakeUpWhenFIFOFull(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenFIFOFullGyro() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE, true);
             if (wakeUpSensor == null) {
@@ -162,6 +169,7 @@
             return runAPWakeUpWhenFIFOFull(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenFIFOFullMag() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD,true);
             if (wakeUpSensor == null) {
@@ -170,6 +178,7 @@
             return runAPWakeUpWhenFIFOFull(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAccelBatchingInAPSuspendLargeReportLatency() throws Throwable {
             Sensor accel = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
             if (accel == null) {
@@ -178,6 +187,7 @@
             return runAPWakeUpByAlarmNonWakeSensor(accel, (int)TimeUnit.SECONDS.toMicros(1000));
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAccelBatchingInAPSuspendZeroReportLatency() throws Throwable {
             Sensor accel = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
            if (accel == null) {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/sixdof/Activities/TestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/sixdof/Activities/TestActivity.java
index 9ca5f2c..157ca3d 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/sixdof/Activities/TestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/sixdof/Activities/TestActivity.java
@@ -39,6 +39,8 @@
 import com.android.cts.verifier.sensors.sixdof.Utils.PoseProvider.PoseProvider;
 import com.android.cts.verifier.sensors.sixdof.Utils.ResultObjects.ResultObject;
 
+import com.android.compatibility.common.util.CddTest;
+
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
 import android.content.res.Configuration;
@@ -62,6 +64,7 @@
  * Main Activity for 6DOF tests Handles calls between UI fragments and the Data fragment. The
  * controller in the MVC structure.
  */
+@CddTest(requirement="7.3.12/C-1-1")
 public class TestActivity extends Activity implements BaseUiListener, AccuracyListener,
         RobustnessListener, ComplexMovementListener {
 
diff --git a/tests/app/src/android/app/cts/SystemFeaturesTest.java b/tests/app/src/android/app/cts/SystemFeaturesTest.java
index 69564be..de52f50 100644
--- a/tests/app/src/android/app/cts/SystemFeaturesTest.java
+++ b/tests/app/src/android/app/cts/SystemFeaturesTest.java
@@ -297,6 +297,7 @@
      * Check that the sensor features reported by the PackageManager correspond to the sensors
      * returned by {@link SensorManager#getSensorList(int)}.
      */
+    @CddTest(requirement="7.3/C-0-1,C-0-2,C-0-3")
     public void testSensorFeatures() throws Exception {
         Set<String> featuresLeft = getFeatureConstantsNames("FEATURE_SENSOR_");
 
diff --git a/tests/sensor/src/android/hardware/cts/SensorBatchingTests.java b/tests/sensor/src/android/hardware/cts/SensorBatchingTests.java
index 1b2b25c..25512ec 100644
--- a/tests/sensor/src/android/hardware/cts/SensorBatchingTests.java
+++ b/tests/sensor/src/android/hardware/cts/SensorBatchingTests.java
@@ -25,6 +25,8 @@
 import android.hardware.cts.helpers.sensorverification.EventBasicVerification;
 import android.hardware.cts.helpers.sensorverification.ISensorVerification;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.concurrent.TimeUnit;
 
 /**
@@ -55,10 +57,12 @@
      */
     private static final int BATCHING_PADDING_TIME_S = (int) Math.ceil(BATCHING_PERIOD * 0.1f + 2);
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testAccelerometer_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testAccelerometer_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -95,10 +99,12 @@
         runFlushSensorTest(Sensor.TYPE_ACCELEROMETER_UNCALIBRATED, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testMagneticField_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testMagneticField_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -131,10 +137,12 @@
         runFlushSensorTest(Sensor.TYPE_ORIENTATION, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGyroscope_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GYROSCOPE, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGyroscope_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GYROSCOPE, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -147,10 +155,12 @@
         runFlushSensorTest(Sensor.TYPE_GYROSCOPE, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testPressure_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_PRESSURE, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testPressure_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_PRESSURE, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -163,10 +173,12 @@
         runFlushSensorTest(Sensor.TYPE_PRESSURE, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGravity_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GRAVITY, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGravity_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GRAVITY, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -179,10 +191,12 @@
         runFlushSensorTest(Sensor.TYPE_GRAVITY, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testRotationVector_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testRotationVector_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -211,10 +225,12 @@
         runFlushSensorTest(Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGameRotationVector_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GAME_ROTATION_VECTOR, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGameRotationVector_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GAME_ROTATION_VECTOR, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -243,10 +259,12 @@
         runFlushSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testLinearAcceleration_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testLinearAcceleration_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_50HZ, BATCHING_PERIOD);
     }
diff --git a/tests/sensor/src/android/hardware/cts/SensorDirectReportTest.java b/tests/sensor/src/android/hardware/cts/SensorDirectReportTest.java
index 77852f1..8f65c54 100644
--- a/tests/sensor/src/android/hardware/cts/SensorDirectReportTest.java
+++ b/tests/sensor/src/android/hardware/cts/SensorDirectReportTest.java
@@ -31,6 +31,8 @@
 import android.os.SystemClock;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.IOException;
 import java.io.UncheckedIOException;
 import java.nio.ByteBuffer;
@@ -204,6 +206,7 @@
                        (mHardwareBuffer != null && mHardwareBufferSecondary != null));
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerAshmemNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -211,6 +214,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeAshmemNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -218,6 +222,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldAshmemNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
@@ -225,6 +230,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerAshmemFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -233,6 +239,7 @@
 
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeAshmemFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -240,6 +247,7 @@
                 SensorDirectChannel.RATE_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldAshmemFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
@@ -247,6 +255,7 @@
                 SensorDirectChannel.RATE_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerAshmemVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -255,6 +264,7 @@
 
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeAshmemVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -262,6 +272,7 @@
                 SensorDirectChannel.RATE_VERY_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldAshmemVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
@@ -269,6 +280,7 @@
                 SensorDirectChannel.RATE_VERY_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerHardwareBufferNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -276,6 +288,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeHardwareBufferNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -283,6 +296,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldHardwareBufferNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
@@ -290,6 +304,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerHardwareBufferFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -297,6 +312,7 @@
                 SensorDirectChannel.RATE_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeHardwareBufferFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -304,6 +320,7 @@
                 SensorDirectChannel.RATE_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldHardwareBufferFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
@@ -311,6 +328,7 @@
                 SensorDirectChannel.RATE_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerHardwareBufferVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -318,6 +336,7 @@
                 SensorDirectChannel.RATE_VERY_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeHardwareBufferVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -325,6 +344,7 @@
                 SensorDirectChannel.RATE_VERY_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldHardwareBufferVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
diff --git a/tests/sensor/src/android/hardware/cts/SensorParameterRangeTest.java b/tests/sensor/src/android/hardware/cts/SensorParameterRangeTest.java
index 44135bc..fe8408f 100644
--- a/tests/sensor/src/android/hardware/cts/SensorParameterRangeTest.java
+++ b/tests/sensor/src/android/hardware/cts/SensorParameterRangeTest.java
@@ -23,6 +23,8 @@
 import android.hardware.cts.helpers.SensorCtsHelper;
 import android.text.TextUtils;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
@@ -75,6 +77,7 @@
         mVrModeHighPerformance = pm.hasSystemFeature(PackageManager.FEATURE_VR_MODE_HIGH_PERFORMANCE);
     }
 
+    @CddTest(requirement="7.3.9/C-2-1,7.3/C-1-1")
     public void testAccelerometerRange() {
         checkSensorRangeAndFrequency(
                 mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
@@ -83,6 +86,7 @@
                 ACCELEROMETER_MAX_FREQUENCY);
   }
 
+   @CddTest(requirement="7.3.9/C-2-3,7.3/C-1-1")
   public void testGyroscopeRange() {
         checkSensorRangeAndFrequency(
                 mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE),
@@ -91,7 +95,8 @@
                 GYRO_MAX_FREQUENCY);
   }
 
-    public void testMagnetometerRange() {
+   @CddTest(requirement="7.3.9/C-2-5,7.3/C-1-1")
+   public void testMagnetometerRange() {
         checkSensorRangeAndFrequency(
                 mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD),
                 MAGNETOMETER_MAX_RANGE,
@@ -99,6 +104,7 @@
                 MAGNETOMETER_MAX_FREQUENCY);
     }
 
+    @CddTest(requirement="7.3.9/C-2-7,7.3/C-1-1")
     public void testPressureRange() {
         if (mHasHifiSensors) {
             checkSensorRangeAndFrequency(
@@ -129,11 +135,13 @@
                 maxFrequency - 0.1);
     }
 
+    @CddTest(requirement="7.3.9/C-2-1")
     public void testAccelerometerFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(Sensor.TYPE_ACCELEROMETER, ACCELEROMETER_MIN_FIFO_LENGTH);
     }
 
+    @CddTest(requirement="7.3.9/C-2-6")
     public void testUncalMagnetometerFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(
@@ -141,21 +149,25 @@
                 UNCAL_MAGNETOMETER_MIN_FIFO_LENGTH);
     }
 
+    @CddTest(requirement="7.3.9/C-2-7")
     public void testPressureFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(Sensor.TYPE_PRESSURE, PRESSURE_MIN_FIFO_LENGTH);
     }
 
+    @CddTest(requirement="7.3.9/C-2-8")
     public void testGameRotationVectorFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(Sensor.TYPE_GAME_ROTATION_VECTOR, GAME_ROTATION_VECTOR_MIN_FIFO_LENGTH);
     }
 
+    @CddTest(requirement="7.3.9/C-2-17")
     public void testProximityFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(Sensor.TYPE_PROXIMITY, PROXIMITY_SENSOR_MIN_FIFO_LENGTH);
     }
 
+    @CddTest(requirement="7.3.9/C-2-10")
     public void testStepDetectorFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(Sensor.TYPE_STEP_DETECTOR, STEP_DETECTOR_MIN_FIFO_LENGTH);
diff --git a/tests/sensor/src/android/hardware/cts/SensorTest.java b/tests/sensor/src/android/hardware/cts/SensorTest.java
index 11ead36..f62bb7a 100644
--- a/tests/sensor/src/android/hardware/cts/SensorTest.java
+++ b/tests/sensor/src/android/hardware/cts/SensorTest.java
@@ -45,6 +45,8 @@
 import android.platform.test.annotations.Presubmit;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
@@ -115,6 +117,7 @@
         }
     }
 
+    @CddTest(requirement="7.3/C-0-1,7.3.1/C-1-2,7.3.2/C-1-1")
     @SuppressWarnings("deprecation")
     public void testSensorOperations() {
         // Because we can't know every sensors unit details, so we can't assert
@@ -260,6 +263,7 @@
         }
     }
 
+    @CddTest(requirement="7.3/C-0-3")
     public void testRequestTriggerWithNonTriggerSensor() {
         mTriggerSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
         if (mTriggerSensor == null) {
@@ -270,6 +274,7 @@
         assertFalse(result);
     }
 
+    @CddTest(requirement="7.3/C-0-3")
     public void testCancelTriggerWithNonTriggerSensor() {
         mTriggerSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
         if (mTriggerSensor == null) {
@@ -280,6 +285,7 @@
         assertFalse(result);
     }
 
+    @CddTest(requirement="7.3/C-0-3")
     public void testRegisterWithTriggerSensor() {
         Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_SIGNIFICANT_MOTION);
         if (sensor == null) {
diff --git a/tests/sensor/src/android/hardware/cts/SingleSensorTests.java b/tests/sensor/src/android/hardware/cts/SingleSensorTests.java
index a626957..17f73c6 100644
--- a/tests/sensor/src/android/hardware/cts/SingleSensorTests.java
+++ b/tests/sensor/src/android/hardware/cts/SingleSensorTests.java
@@ -25,6 +25,8 @@
 import android.hardware.cts.helpers.sensoroperations.TestSensorOperation;
 import android.content.pm.PackageManager;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -150,6 +152,7 @@
         runSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_100HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-1-1,C-1-2,C-1-3,C-1-6,7.3/C-1-7")
     public void testAccelerometer_50hz() throws Throwable {
         runSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_50HZ);
     }
@@ -234,14 +237,17 @@
         runSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_15HZ);
     }
 
+    @CddTest(requirement="7.3.2/C-1-1,C-1-2,C-1-3,C-1-9,7.3/C-1-7")
     public void testMagneticField_10hz() throws Throwable {
         runSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3.2/C-1-1,C-1-3,7.3/C-1-2")
     public void testMagneticField_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3.2/C-1-1,C-1-3,7.3/C-1-2,7.3/C-1-7")
     public void testMagneticField_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_1HZ);
     }
@@ -302,6 +308,7 @@
         runSensorTest(Sensor.TYPE_GYROSCOPE, RATE_100HZ);
     }
 
+    @CddTest(requirement="7.3.4/C-1-1,C-1-7,7.3/C-1-7")
     public void testGyroscope_50hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE, RATE_50HZ);
     }
@@ -322,6 +329,7 @@
         runSensorTest(Sensor.TYPE_GYROSCOPE, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3.4/C-1-2,C-1-7,7.3/C-1-7")
     public void testGyroscope_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE, RATE_1HZ);
     }
@@ -354,6 +362,7 @@
         runSensorTest(Sensor.TYPE_PRESSURE, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3.5/C-1-1,C-1-2,7.3/C-1-7,C-1-2")
     public void testPressure_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_PRESSURE, RATE_5HZ);
     }
@@ -362,6 +371,7 @@
         runSensorTest(Sensor.TYPE_PRESSURE, RATE_1HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_fastest() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, SensorManager.SENSOR_DELAY_FASTEST);
     }
@@ -378,26 +388,32 @@
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_50HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_25hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_25HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_15hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_15HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_10hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_1HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-4-1,7.3.2/C-2-1")
     public void testRotationVector_fastest() throws Throwable {
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, SensorManager.SENSOR_DELAY_FASTEST);
     }
@@ -410,6 +426,7 @@
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_100HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-4-1")
     public void testRotationVector_50hz() throws Throwable {
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_50HZ);
     }
@@ -422,14 +439,17 @@
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_15HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-4-1,7.3.2/C-2-1")
     public void testRotationVector_10hz() throws Throwable {
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-4-1,7.3.2/C-2-1")
     public void testRotationVector_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-4-1,7.3.2/C-2-1")
     public void testRotationVector_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_1HZ);
     }
@@ -498,14 +518,17 @@
         runSensorTest(Sensor.TYPE_GAME_ROTATION_VECTOR, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGameRotationVector_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GAME_ROTATION_VECTOR, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGameRotationVector_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GAME_ROTATION_VECTOR, RATE_1HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGyroscopeUncalibrated_fastest() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, SensorManager.SENSOR_DELAY_FASTEST);
     }
@@ -518,6 +541,7 @@
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_100HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGyroscopeUncalibrated_50hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_50HZ);
     }
@@ -530,14 +554,17 @@
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_15HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGyroscopeUncalibrated_10hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGyroscopeUncalibrated_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGyroscopeUncalibrated_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_1HZ);
     }
@@ -554,26 +581,32 @@
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_100HZ);
     }
 
+     @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_50hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_50HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_25hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_25HZ);
     }
 
+     @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_15hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_15HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_10hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_1HZ);
     }