Tests migration feature meta tags to Conditionalized Tests.

Feature meta tags were removed from AndroidManifest.xml.
Conditionalized Test annotations were added to each test.

This is a follow up based on cl https://android-review.googlesource.com/#/c/278403,
which added Conditionalized Tests support.

Bug: 31928528
Change-Id: Iba8e34a5345a16321b8fd6ae4aa4da730d1bc924
diff --git a/apps/CtsVerifier/AndroidManifest.xml b/apps/CtsVerifier/AndroidManifest.xml
index 61937ff..60d294e 100644
--- a/apps/CtsVerifier/AndroidManifest.xml
+++ b/apps/CtsVerifier/AndroidManifest.xml
@@ -90,8 +90,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_device_admin" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.device_admin" />
         </activity>
 
         <!-- A generic activity for intent based tests -->
@@ -105,8 +103,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_device_admin" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.device_admin" />
         </activity>
 
         <activity android:name=".admin.RedactedNotificationKeyguardDisabledFeaturesActivity"
@@ -117,8 +113,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_device_admin" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.device_admin" />
         </activity>
 
         <activity android:name=".admin.ScreenLockTestActivity"
@@ -129,8 +123,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_device_admin" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.device_admin" />
         </activity>
 
         <activity android:name=".backup.BackupTestActivity" android:label="@string/backup_test">
@@ -138,8 +130,6 @@
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.backup" />
         </activity>
 
         <activity android:name=".bluetooth.BluetoothTestActivity"
@@ -150,7 +140,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_networking" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.bluetooth" />
         </activity>
 
         <activity android:name=".bluetooth.BluetoothToggleActivity"
@@ -162,7 +151,6 @@
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/bt_control" />
             <meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BluetoothTestActivity" />
-            <meta-data android:name="test_excluded_features" android:value="android.software.leanback" />
         </activity>
 
         <activity android:name=".bluetooth.SecureServerActivity"
@@ -255,8 +243,6 @@
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/bt_le" />
             <meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BluetoothTestActivity" />
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.bluetooth_le"/>
         </activity>
 
         <activity android:name=".bluetooth.BleServerStartActivity"
@@ -268,8 +254,6 @@
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/bt_le" />
             <meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BluetoothTestActivity" />
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.bluetooth_le"/>
         </activity> -->
 
         <activity android:name=".bluetooth.BleScannerTestActivity"
@@ -281,8 +265,6 @@
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/bt_le" />
             <meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BluetoothTestActivity" />
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.bluetooth_le"/>
         </activity>
 
         <activity android:name=".bluetooth.BleScannerPowerLevelActivity"
@@ -318,8 +300,6 @@
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/bt_le" />
             <meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BluetoothTestActivity" />
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.bluetooth_le"/>
          </activity>
 
         <activity android:name=".bluetooth.BleAdvertiserPowerLevelActivity"
@@ -364,9 +344,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_security" />
-            <meta-data android:name="test_excluded_features"
-                       android:value="android.hardware.type.television:android.software.leanback:android.hardware.type.watch" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.fingerprint" />
         </activity>
         <activity android:name=".security.ScreenLockBoundKeysTest"
                 android:label="@string/sec_lock_bound_key_test"
@@ -376,8 +353,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_security" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.device_admin" />
         </activity>
         <activity android:name=".security.LockConfirmBypassTest"
                 android:label="@string/lock_confirm_test_title"
@@ -387,8 +362,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_security" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.device_admin" />
         </activity>
         <activity android:name=".security.WiFiCACertificateBugTest"
                 android:configChanges="keyboardHidden|orientation|screenSize"
@@ -398,8 +371,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST"/>
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_security"/>
-            <meta-data android:name="test_excluded_features"
-                       android:value="android.hardware.type.television:android.software.leanback:android.hardware.type.watch"/>
         </activity>
 
         <activity android:name=".streamquality.StreamingVideoActivity"
@@ -410,8 +381,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_streaming" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.watch" />
         </activity>
 
         <activity android:name=".streamquality.PlayVideoActivity"
@@ -435,7 +404,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_hardware" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.location.gps" />
         </activity>
 
         <activity android:name=".net.ConnectivityScreenOffTestActivity"
@@ -445,7 +413,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_networking" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.wifi" />
         </activity>
 
         <activity android:name=".nfc.NfcTestActivity"
@@ -456,7 +423,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_hardware" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.nfc" />
         </activity>
 
         <activity android:name="com.android.cts.verifier.nfc.hce.HceReaderTestActivity"
@@ -732,8 +698,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST"/>
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors"/>
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.sensor.accelerometer"/>
         </activity>
 
         <activity android:name=".sensors.GyroscopeMeasurementTestActivity"
@@ -744,8 +708,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST"/>
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors"/>
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.sensor.gyroscope"/>
         </activity>
 
         <activity android:name=".sensors.HeartRateMonitorTestActivity"
@@ -756,8 +718,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors" />
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.sensor.heartrate" />
         </activity>
 
         <activity android:name=".sensors.MagneticFieldMeasurementTestActivity"
@@ -768,8 +728,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors" />
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.sensor.compass" />
         </activity>
 
         <activity
@@ -806,8 +764,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors" />
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.sensor.gyroscope" />
         </activity-->
 
         <activity android:name=".sensors.BatchingTestActivity"
@@ -818,8 +774,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors" />
-            <meta-data android:name="test_applicable_features"
-                       android:value="android.hardware.sensor.stepcounter:android.hardware.sensor.stepdetector:android.hardware.sensor.proximity:android.hardware.sensor.light" />
         </activity>
 
         <!-- TODO: enable when a more reliable way to identify time synchronization is available -->
@@ -831,8 +785,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors" />
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.sensor.gyroscope" />
         </activity-->
 
         <activity android:name=".sensors.SingleSensorTestsActivity"
@@ -843,8 +795,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST"/>
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors"/>
-            <meta-data android:name="test_applicable_features"
-                       android:value="android.hardware.sensor.accelerometer:android.hardware.sensor.compass:android.hardware.sensor.gyroscope:android.hardware.sensor.barometer" />
         </activity>
 
         <activity android:name=".sensors.SensorBatchingTestsActivity"
@@ -855,8 +805,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST"/>
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors"/>
-            <meta-data android:name="test_applicable_features"
-                       android:value="android.hardware.sensor.accelerometer:android.hardware.sensor.compass:android.hardware.sensor.gyroscope:android.hardware.sensor.barometer" />
         </activity>
 
         <activity android:name=".sensors.SensorIntegrationTestsActivity"
@@ -867,8 +815,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST"/>
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors"/>
-            <meta-data android:name="test_applicable_features"
-                       android:value="android.hardware.sensor.accelerometer:android.hardware.sensor.compass:android.hardware.sensor.gyroscope" />
         </activity>
 
         <activity android:name=".sensors.SensorTestActivity"
@@ -879,8 +825,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST"/>
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors"/>
-            <meta-data android:name="test_applicable_features"
-                       android:value="android.hardware.sensor.accelerometer:android.hardware.sensor.stepcounter:android.hardware.sensor.stepdetector:android.hardware.sensor.heartrate:android.hardware.sensor.compass:android.hardware.sensor.ambient_temperature" />
         </activity>
 
         <!-- End sensor tests definitions -->
@@ -892,10 +836,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_location" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
         <activity android:name=".location.LocationModeHighAccuracyTestActivity"
                 android:label="@string/location_mode_high_accuracy_test">
@@ -904,12 +844,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_location" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.hardware.location.network:android.hardware.location.gps" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
         <activity android:name=".location.LocationModeBatterySavingTestActivity"
                 android:label="@string/location_mode_battery_saving_test">
@@ -918,11 +852,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_location" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.location.network" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
         <activity android:name=".location.LocationModeDeviceOnlyTestActivity"
                 android:label="@string/location_mode_device_only_test">
@@ -931,11 +860,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_location" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.location.gps" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
 
         <activity android:name=".camera.formats.CameraFormatsActivity"
@@ -947,7 +871,6 @@
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_camera" />
 
-            <meta-data android:name="test_required_features" android:value="android.hardware.camera.any"/>
         </activity>
 
         <activity android:name=".camera.intents.CameraIntentsActivity"
@@ -958,7 +881,6 @@
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_camera" />
 
-            <meta-data android:name="test_required_features" android:value="android.hardware.camera.any"/>
         </activity>
 
 
@@ -971,7 +893,6 @@
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_camera" />
 
-            <meta-data android:name="test_required_features" android:value="android.hardware.camera.any"/>
         </activity>
 
         <activity
@@ -984,8 +905,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_camera" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.sensor.gyroscope" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.camera.any"/>
         </activity>
         <activity
             android:name=".camera.fov.DetermineFovActivity"
@@ -1007,8 +926,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_camera" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.hardware.camera.any"/>
         </activity>
 
         <activity android:name=".camera.its.ItsTestActivity"
@@ -1020,7 +937,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_camera" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.camera.any" />
         </activity>
 
         <activity android:name=".camera.flashlight.CameraFlashlightActivity"
@@ -1031,7 +947,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_camera" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.camera.flash" />
         </activity>
 
         <activity android:name=".usb.UsbAccessoryTestActivity"
@@ -1048,9 +963,6 @@
             <meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
                     android:resource="@xml/accessory_filter" />
             <meta-data android:name="test_category" android:value="@string/test_category_hardware" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.usb.accessory" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.watch" />
         </activity>
 <!-- Turned off Sensor Power Test in initial L release
         <activity android:name=".sensors.SensorPowerTestActivity"
@@ -1061,8 +973,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors" />
-            <meta-data android:name="test_excluded_features"
-                       android:value="android.hardware.type.television:android.software.leanback" />
         </activity>
 -->
         <activity android:name=".p2p.P2pTestListActivity"
@@ -1073,7 +983,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_networking" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.wifi.direct" />
         </activity>
 
         <activity android:name=".notifications.NotificationListenerVerifierActivity"
@@ -1092,8 +1001,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_notifications" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.watch:android.software.leanback" />
         </activity>
 
         <activity android:name=".notifications.PackagePriorityVerifierActivity"
@@ -1103,8 +1010,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_notifications" />
-            <meta-data android:name="test_excluded_features"
-                       android:value="android.hardware.type.watch:android.software.leanback" />
         </activity>
 
         <service android:name=".notifications.MockListener"
@@ -1125,12 +1030,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_notifications" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.watch" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
         <activity android:name=".security.CANotifyOnBootActivity"
                 android:label="@string/caboot_test">
@@ -1139,12 +1038,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_notifications" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.watch" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
 
         <activity android:name=".security.KeyChainTest"
@@ -1155,12 +1048,6 @@
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_security" />
             <!-- KeyChain is only installed on communication-oriented devices inheriting core.mk -->
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.watch" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
 
         <activity android:name=".security.AlarmIntentTest"
@@ -1234,8 +1121,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_other" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.app_widgets" />
         </activity>
 
         <activity android:name=".deskclock.DeskClockTestsActivity"
@@ -1245,10 +1130,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_deskclock" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
 
 <!-- TODO: enable when not requiring to tap the screen and timeouts are tuned -->
@@ -1263,8 +1144,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors" />
-            <meta-data android:name="test_excluded_features"
-                       android:value="android.hardware.type.television:android.software.leanback" />
         </activity>
 -->
           <activity
@@ -1276,10 +1155,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
 
         <receiver android:name="com.android.cts.verifier.sensors.DeviceSuspendTestActivity$AlarmReceiver">
@@ -1301,8 +1176,6 @@
             <meta-data
                 android:name="test_category"
                 android:value="@string/test_category_sensors" />
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.sensor.accelerometer" />
         </activity>
 
         <receiver android:name=".widget.WidgetCtsProvider">
@@ -1326,7 +1199,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_projection" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.faketouch" />
         </activity>
 
         <activity android:name=".projection.widgets.ProjectionWidgetActivity"
@@ -1336,7 +1208,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_projection" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.faketouch" />
         </activity>
 
         <activity android:name=".projection.list.ProjectionListActivity"
@@ -1346,8 +1217,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_projection" />
-            <meta-data android:name="test_excluded_features"
-                       android:value="android.hardware.type.television:android.software.leanback" />
         </activity>
 
         <activity android:name=".projection.video.ProjectionVideoActivity"
@@ -1357,8 +1226,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_projection" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.watch" />
         </activity>
 
         <activity android:name=".projection.touch.ProjectionTouchActivity"
@@ -1368,8 +1235,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_projection" />
-            <meta-data android:name="test_required_features"
-                       android:value="android.hardware.faketouch:android.hardware.touchscreen.multitouch" />
         </activity>
 
 
@@ -1380,8 +1245,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_projection" />
-            <meta-data android:name="test_excluded_features"
-                       android:value="android.hardware.type.television:android.software.leanback" />
         </activity>
 
         <service android:name=".projection.ProjectionService"
@@ -1395,7 +1258,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_managed_provisioning" />
-            <meta-data android:name="test_required_features" android:value="android.software.device_admin" />
         </activity>
 
         <activity android:name=".managedprovisioning.DeviceOwnerPositiveTestActivity"
@@ -1405,7 +1267,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_managed_provisioning" />
-            <meta-data android:name="test_required_features" android:value="android.software.device_admin" />
         </activity>
 
         <activity android:name=".managedprovisioning.DeviceOwnerPositiveTestActivity$CommandReceiver"
@@ -1479,7 +1340,6 @@
                 <category android:name="android.intent.category.DEFAULT"></category>
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_managed_provisioning" />
-            <meta-data android:name="test_required_features" android:value="android.software.managed_users:android.software.device_admin" />
         </activity>
 
         <activity android:name=".managedprovisioning.ByodHelperActivity">
@@ -1508,7 +1368,6 @@
         </activity>
 
         <activity android:name=".managedprovisioning.NfcTestActivity">
-            <meta-data android:name="test_required_features" android:value="android.hardware.nfc" />
         </activity>
 
         <provider
@@ -1646,10 +1505,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_jobscheduler" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
 
         <activity android:name=".jobscheduler.ChargingConstraintTestActivity" android:label="@string/js_charging_test">
@@ -1658,10 +1513,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_jobscheduler" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
 
         <activity android:name=".jobscheduler.ConnectivityConstraintTestActivity" android:label="@string/js_connectivity_test">
@@ -1670,10 +1521,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_jobscheduler" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television" />
-            <meta-data android:name="test_excluded_features"
-                    android:value="android.software.leanback" />
         </activity>
 
         <service android:name=".jobscheduler.MockJobService"
@@ -1689,8 +1536,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_tv" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.live_tv" />
         </activity>
 
         <activity android:name=".tv.ParentalControlTestActivity"
@@ -1700,8 +1545,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_tv" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.live_tv" />
         </activity>
 
         <activity android:name=".tv.MultipleTracksTestActivity"
@@ -1711,8 +1554,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_tv" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.live_tv" />
         </activity>
 
         <!-- Comment out in M due to b/29916035.
@@ -1723,8 +1564,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_tv" />
-            <meta-data android:name="test_required_features"
-                    android:value="android.software.live_tv" />
         </activity>
         -->
 
@@ -1736,8 +1575,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_tv" />
-            <meta-data android:name="test_required_features"
-                android:value="android.software.live_tv" />
         </activity>
 
         <activity android:name=".screenpinning.ScreenPinningTestActivity"
@@ -1747,8 +1584,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_other" />
-            <meta-data android:name="test_excluded_features"
-                       android:value="android.hardware.type.television:android.software.leanback:android.hardware.type.watch" />
         </activity>
 
         <activity android:name=".tv.MockTvInputSetupActivity">
@@ -1765,7 +1600,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_audio" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.microphone" />
         </activity>
 
         <activity android:name=".audio.HifiUltrasoundSpeakerTestActivity"
@@ -1776,7 +1610,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_audio" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.audio.output" />
         </activity>
 
         <activity android:name=".audio.AudioOutputDeviceNotificationsActivity"
@@ -1786,7 +1619,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_audio" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.audio.output" />
         </activity>
 
         <activity android:name=".audio.AudioInputDeviceNotificationsActivity"
@@ -1796,7 +1628,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_audio" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.microphone" />
         </activity>
 
         <activity android:name=".audio.AudioOutputRoutingNotificationsActivity"
@@ -1806,7 +1637,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_audio" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.audio.output" />
             </activity>
 
         <activity android:name=".audio.AudioInputRoutingNotificationsActivity"
@@ -1816,7 +1646,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_audio" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.microphone" />
             </activity>
 
         <activity android:name=".audio.AudioLoopbackActivity"
@@ -1826,10 +1655,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_audio" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.microphone" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.audio.output" />
-            <meta-data android:name="test_excluded_features" android:value="android.hardware.type.watch" />
-            <meta-data android:name="test_excluded_features" android:value="android.hardware.type.television" />
         </activity>
 
         <activity android:name=".audio.AudioFrequencyLineActivity"
@@ -1839,8 +1664,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_audio" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.microphone" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.audio.output" />
         </activity>
 
         <activity android:name=".audio.AudioFrequencySpeakerActivity"
@@ -1850,8 +1673,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_audio" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.audio.output" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.usb.host" />
         </activity>
 
         <activity android:name=".audio.AudioFrequencyMicActivity"
@@ -1861,9 +1682,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_audio" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.microphone" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.audio.output" />
-            <meta-data android:name="test_required_features" android:value="android.hardware.usb.host" />
         </activity>
 
         <service android:name=".tv.MockTvInputService"
@@ -1890,8 +1708,6 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST" />
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_car" />
-            <meta-data android:name="test_excluded_features"
-                       android:value="android.hardware.type.television:android.software.leanback:android.hardware.type.watch" />
 
         </activity>
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/admin/DeviceAdminKeyguardDisabledFeaturesActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/admin/DeviceAdminKeyguardDisabledFeaturesActivity.java
index 2ad77f6..64a49ff 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/admin/DeviceAdminKeyguardDisabledFeaturesActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/admin/DeviceAdminKeyguardDisabledFeaturesActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.admin;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.admin.DevicePolicyManager;
 import android.content.ComponentName;
 import android.content.Context;
@@ -34,6 +35,7 @@
 /**
  * Tests for Device Admin keyguard disabled features.
  */
+@ConditionalTest(required_features = "android.software.device_admin")
 public class DeviceAdminKeyguardDisabledFeaturesActivity extends KeyguardDisabledFeaturesActivity {
     @Override
     protected int getKeyguardDisabledFeatures() {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/admin/PolicySerializationTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/admin/PolicySerializationTestActivity.java
index ee24868..73d6be2 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/admin/PolicySerializationTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/admin/PolicySerializationTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.admin;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.managedprovisioning.DeviceAdminTestReceiver;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
@@ -46,6 +47,7 @@
  * returning to the test, the activity checks that the device manager is reporting the values
  * it set before the user rebooted the device.
  */
+@ConditionalTest(required_features = "android.software.device_admin")
 public class PolicySerializationTestActivity extends PassFailButtons.ListActivity {
 
     /**
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/admin/RedactedNotificationKeyguardDisabledFeaturesActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/admin/RedactedNotificationKeyguardDisabledFeaturesActivity.java
index 711fd8c..79f2835 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/admin/RedactedNotificationKeyguardDisabledFeaturesActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/admin/RedactedNotificationKeyguardDisabledFeaturesActivity.java
@@ -15,6 +15,7 @@
  */
 package com.android.cts.verifier.admin;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.admin.DevicePolicyManager;
 
 import android.content.Intent;
@@ -31,6 +32,7 @@
  * would mask KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS.
  *  */
 
+@ConditionalTest(required_features = "android.software.device_admin")
 public class RedactedNotificationKeyguardDisabledFeaturesActivity
     extends DeviceAdminKeyguardDisabledFeaturesActivity {
   @Override
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/admin/ScreenLockTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/admin/ScreenLockTestActivity.java
index 41217a6..95c5141 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/admin/ScreenLockTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/admin/ScreenLockTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.admin;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.managedprovisioning.DeviceAdminTestReceiver;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
@@ -32,6 +33,7 @@
 import android.view.View.OnClickListener;
 import android.widget.Button;
 
+@ConditionalTest(required_features = "android.software.device_admin")
 public class ScreenLockTestActivity extends PassFailButtons.Activity {
 
     private static final int ADD_DEVICE_ADMIN_REQUEST_CODE = 1;
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencyLineActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencyLineActivity.java
index edb3bf0..0db2f0f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencyLineActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencyLineActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.audio;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 import com.android.cts.verifier.audio.wavelib.*;
@@ -47,6 +48,7 @@
 /**
  * Tests Audio Device roundtrip latency by using a loopback plug.
  */
+@ConditionalTest(required_features = "android.hardware.microphone:android.hardware.audio.output")
 public class AudioFrequencyLineActivity extends PassFailButtons.Activity implements Runnable,
     AudioRecord.OnRecordPositionUpdateListener {
     private static final String TAG = "AudioFrequencyLineActivity";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencyMicActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencyMicActivity.java
index 03d84e1..87a8689 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencyMicActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencyMicActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.audio;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 import com.android.cts.verifier.audio.wavelib.*;
@@ -54,6 +55,7 @@
 /**
  * Tests Audio built in Microphone response using external speakers and USB reference microphone.
  */
+@ConditionalTest(required_features = "android.hardware.microphone:android.hardware.audio.output:android.hardware.usb.host")
 public class AudioFrequencyMicActivity extends PassFailButtons.Activity implements Runnable,
     AudioRecord.OnRecordPositionUpdateListener {
     private static final String TAG = "AudioFrequencyMicActivity";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencySpeakerActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencySpeakerActivity.java
index ba7b86d..85316cc 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencySpeakerActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioFrequencySpeakerActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.audio;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 import com.android.cts.verifier.audio.wavelib.*;
@@ -54,6 +55,7 @@
 /**
  * Tests Audio Device roundtrip latency by using a loopback plug.
  */
+@ConditionalTest(required_features = "android.hardware.audio.output:android.hardware.usb.host")
 public class AudioFrequencySpeakerActivity extends PassFailButtons.Activity implements Runnable,
     AudioRecord.OnRecordPositionUpdateListener {
     private static final String TAG = "AudioFrequencySpeakerActivity";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioInputDeviceNotificationsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioInputDeviceNotificationsActivity.java
index e253635..fe8cc17 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioInputDeviceNotificationsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioInputDeviceNotificationsActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.audio;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 
 import android.content.Context;
@@ -36,6 +37,7 @@
  * Tests Audio Device Connection events for output by prompting the user to insert/remove a
  * wired headset (or microphone) and noting the presence (or absence) of notifications.
  */
+@ConditionalTest(required_features = "android.hardware.microphone")
 public class AudioInputDeviceNotificationsActivity extends HeadsetHonorSystemActivity {
     Context mContext;
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioInputRoutingNotificationsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioInputRoutingNotificationsActivity.java
index eefa9e4..94440cf 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioInputRoutingNotificationsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioInputRoutingNotificationsActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.audio;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 
 import android.content.Context;
@@ -39,6 +40,7 @@
 /**
  * Tests AudioRecord (re)Routing messages.
  */
+@ConditionalTest(required_features = "android.hardware.microphone")
 public class AudioInputRoutingNotificationsActivity extends HeadsetHonorSystemActivity {
     private static final String TAG = "AudioInputRoutingNotificationsActivity";
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioLoopbackActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioLoopbackActivity.java
index fbec57a..7b0c460 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioLoopbackActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioLoopbackActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.audio;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 import com.android.compatibility.common.util.ReportLog;
@@ -46,6 +47,10 @@
 /**
  * Tests Audio Device roundtrip latency by using a loopback plug.
  */
+@ConditionalTest(
+    required_features = "android.hardware.microphone:android.hardware.audio.output",
+    excluded_features = "android.hardware.type.watch:android.hardware.type.television"
+)
 public class AudioLoopbackActivity extends PassFailButtons.Activity {
     private static final String TAG = "AudioLoopbackActivity";
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioOutputDeviceNotificationsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioOutputDeviceNotificationsActivity.java
index ad8ba68..2dec28f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioOutputDeviceNotificationsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioOutputDeviceNotificationsActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.audio;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 
 import android.content.Context;
@@ -36,6 +37,7 @@
  * Tests Audio Device Connection events for output devices by prompting the user to
  * insert/remove a wired headset and noting the presence (or absence) of notifications.
  */
+@ConditionalTest(required_features = "android.hardware.audio.output")
 public class AudioOutputDeviceNotificationsActivity extends HeadsetHonorSystemActivity {
     Context mContext;
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioOutputRoutingNotificationsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioOutputRoutingNotificationsActivity.java
index a6d8846..4c25e82 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioOutputRoutingNotificationsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/AudioOutputRoutingNotificationsActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.audio;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 
 import android.content.Context;
@@ -39,6 +40,7 @@
 /**
  * Tests AudioTrack and AudioRecord (re)Routing messages.
  */
+@ConditionalTest(required_features = "android.hardware.audio.output")
 public class AudioOutputRoutingNotificationsActivity extends HeadsetHonorSystemActivity {
     private static final String TAG = "AudioOutputRoutingNotificationsActivity";
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/HifiUltrasoundSpeakerTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/HifiUltrasoundSpeakerTestActivity.java
index dc81e19..39a36e9 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/HifiUltrasoundSpeakerTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/HifiUltrasoundSpeakerTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.audio;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -41,6 +42,7 @@
 import com.androidplot.xy.XYSeries;
 import com.androidplot.xy.*;
 
+@ConditionalTest(required_features = "android.hardware.audio.output")
 public class HifiUltrasoundSpeakerTestActivity extends PassFailButtons.Activity {
 
   public enum Status {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/HifiUltrasoundTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/HifiUltrasoundTestActivity.java
index 85b3e37..9be20f2 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/HifiUltrasoundTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/HifiUltrasoundTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.audio;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -41,6 +42,7 @@
 import com.androidplot.xy.XYSeries;
 import com.androidplot.xy.*;
 
+@ConditionalTest(required_features = "android.hardware.microphone")
 public class HifiUltrasoundTestActivity extends PassFailButtons.Activity {
 
   public enum Status {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/backup/BackupTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/backup/BackupTestActivity.java
index cccc1c2..e71761f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/backup/BackupTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/backup/BackupTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.backup;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -54,6 +55,7 @@
  * several preferences and contents of files that should get backed up and restored after
  * running the backup manager and reinstalling the CTS verifier.
  */
+@ConditionalTest(required_features = "android.software.backup")
 public class BackupTestActivity extends PassFailButtons.ListActivity {
 
     private static final String TAG = BackupTestActivity.class.getSimpleName();
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserTestActivity.java
index 64c50bc..4fa2283 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.bluetooth;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.ManifestTestListAdapter;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
@@ -26,6 +27,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+@ConditionalTest(required_features = "android.hardware.bluetooth_le")
 public class BleAdvertiserTestActivity extends PassFailButtons.TestListActivity {
 
     @Override
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleScannerTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleScannerTestActivity.java
index 52933e0..9de78db 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleScannerTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleScannerTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.bluetooth;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.ManifestTestListAdapter;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
@@ -26,6 +27,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+@ConditionalTest(required_features = "android.hardware.bluetooth_le")
 public class BleScannerTestActivity extends PassFailButtons.TestListActivity {
 
     @Override
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothTestActivity.java
index df70984..9e6a3bc 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.bluetooth;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.ManifestTestListAdapter;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
@@ -27,6 +28,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+@ConditionalTest(required_features = "android.hardware.bluetooth")
 public class BluetoothTestActivity extends PassFailButtons.TestListActivity {
 
     @Override
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothToggleActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothToggleActivity.java
index 7106e7b..15e630f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothToggleActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothToggleActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.bluetooth;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -37,6 +38,7 @@
  * a button that toggles Bluetooth by disabling it via {@link BluetoothAdapter#disable()} and
  * enabling it via the Intent action {@link BluetoothAdapter#ACTION_REQUEST_ENABLE}.
  */
+@ConditionalTest(excluded_features = "android.software.leanback")
 public class BluetoothToggleActivity extends PassFailButtons.Activity {
 
     private static final String TAG = BluetoothToggleActivity.class.getName();
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/flashlight/CameraFlashlightActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/flashlight/CameraFlashlightActivity.java
index 4d37b3e..2456789 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/flashlight/CameraFlashlightActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/flashlight/CameraFlashlightActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.camera.flashlight;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -37,6 +38,7 @@
  * turns on or off the flashlight, it asks for user input to verify the flashlight status. The
  * test will pass when the user input is correct for all camera devices with a flash unit.
  */
+@ConditionalTest(required_features = "android.hardware.camera.flash")
 public class CameraFlashlightActivity extends PassFailButtons.Activity {
 
     private static final String TAG = "CameraFlashlight";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/formats/CameraFormatsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/formats/CameraFormatsActivity.java
index 9c5b31d..1979ebd 100755
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/formats/CameraFormatsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/formats/CameraFormatsActivity.java
@@ -15,6 +15,7 @@
  */
 package com.android.cts.verifier.camera.formats;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -57,6 +58,7 @@
  * Tests for manual verification of the CDD-required camera output formats
  * for preview callbacks
  */
+@ConditionalTest(required_features = "android.hardware.camera.any")
 public class CameraFormatsActivity extends PassFailButtons.Activity
         implements TextureView.SurfaceTextureListener, Camera.PreviewCallback {
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java
index 44029a9..76f2be3 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.camera.fov;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Dialog;
@@ -55,6 +56,7 @@
 /**
  * An activity for showing the camera preview and taking a picture.
  */
+@ConditionalTest(required_features = "android.hardware.sensor.gyroscope:android.hardware.camera.any")
 public class PhotoCaptureActivity extends Activity
         implements PictureCallback, SurfaceHolder.Callback {
     private static final String TAG = PhotoCaptureActivity.class.getSimpleName();
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/intents/CameraIntentsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/intents/CameraIntentsActivity.java
index 9204de3..040ca05 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/intents/CameraIntentsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/intents/CameraIntentsActivity.java
@@ -15,6 +15,7 @@
  */
 package com.android.cts.verifier.camera.intents;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -54,6 +55,7 @@
  *  (e.g. social network apps that upload a photo after you take a picture)
  *  rely on this functionality present and correctly working.
  */
+@ConditionalTest(required_features = "android.hardware.camera.any")
 public class CameraIntentsActivity extends PassFailButtons.Activity
 implements OnClickListener, SurfaceHolder.Callback {
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsTestActivity.java
index 0c39a9e..8cb7a91 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.camera.its;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -50,6 +51,7 @@
  * This test activity requires a USB connection to a computer, and a corresponding host-side run of
  * the python scripts found in the CameraITS directory.
  */
+@ConditionalTest(required_features = "android.hardware.camera.any")
 public class ItsTestActivity extends PassFailButtons.Activity {
     private static final String TAG = "ItsTestActivity";
     private static final String EXTRA_CAMERA_ID = "camera.its.extra.CAMERA_ID";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/orientation/CameraOrientationActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/orientation/CameraOrientationActivity.java
index 49b34fd..295030e 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/orientation/CameraOrientationActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/orientation/CameraOrientationActivity.java
@@ -13,6 +13,7 @@
  */
 package com.android.cts.verifier.camera.orientation;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.content.Intent;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
@@ -46,6 +47,7 @@
  * Tests for manual verification of the CDD-required camera output formats
  * for preview callbacks
  */
+@ConditionalTest(required_features = "android.hardware.camera.any")
 public class CameraOrientationActivity extends PassFailButtons.Activity
 implements OnClickListener, SurfaceHolder.Callback {
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java
index 0a397e8..7667c73 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java
@@ -15,6 +15,7 @@
  */
 package com.android.cts.verifier.camera.video;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.AlertDialog;
 import android.content.DialogInterface;
 import android.graphics.Matrix;
@@ -56,6 +57,7 @@
 /**
  * Tests for manual verification of camera video capture
  */
+@ConditionalTest(required_features = "android.hardware.camera.any")
 public class CameraVideoActivity extends PassFailButtons.Activity
         implements TextureView.SurfaceTextureListener {
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/car/CarDockTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/car/CarDockTestActivity.java
index 4473a3c..bad6342 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/car/CarDockTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/car/CarDockTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.car;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.UiModeManager;
 import android.content.ComponentName;
 import android.content.Context;
@@ -36,6 +37,7 @@
  * Tests that CAR_DOCK mode opens the app associated with car dock when going into
  * car mode.
  */
+@ConditionalTest(excluded_features = "android.hardware.type.television:android.software.leanback:android.hardware.type.watch")
 public class CarDockTestActivity extends PassFailButtons.Activity {
 
     private static final String CAR_DOCK1 =
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/deskclock/DeskClockTestsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/deskclock/DeskClockTestsActivity.java
index aaea279..1ebd3c2 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/deskclock/DeskClockTestsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/deskclock/DeskClockTestsActivity.java
@@ -2,6 +2,7 @@
 
 package com.android.cts.verifier.deskclock;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.content.Intent;
 import android.database.DataSetObserver;
 import android.os.Bundle;
@@ -22,6 +23,7 @@
 /**
  * Activity that lists all the DeskClock tests.
  */
+@ConditionalTest(excluded_features = "android.hardware.type.television:android.software.leanback")
 public class DeskClockTestsActivity extends PassFailButtons.TestListActivity {
 
     private static final String SHOW_ALARMS_TEST = "SHOW_ALARMS";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/ChargingConstraintTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/ChargingConstraintTestActivity.java
index 4b70b894..ff86e13 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/ChargingConstraintTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/ChargingConstraintTestActivity.java
@@ -1,5 +1,6 @@
 package com.android.cts.verifier.jobscheduler;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.annotation.TargetApi;
 import android.app.job.JobInfo;
 import android.app.job.JobScheduler;
@@ -26,6 +27,7 @@
  *      not run.
  */
 @TargetApi(21)
+@ConditionalTest(excluded_features = "android.hardware.type.television:android.software.leanback")
 public class ChargingConstraintTestActivity extends ConstraintTestActivity {
 
     private static final int ON_CHARGING_JOB_ID =
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/ConnectivityConstraintTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/ConnectivityConstraintTestActivity.java
index aaf68e6..5f4f447 100755
--- a/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/ConnectivityConstraintTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/ConnectivityConstraintTestActivity.java
@@ -1,5 +1,6 @@
 package com.android.cts.verifier.jobscheduler;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.annotation.TargetApi;
 import android.app.job.JobInfo;
 import android.content.BroadcastReceiver;
@@ -23,6 +24,7 @@
  * run in the absence of an internet connection.
  */
 @TargetApi(21)
+@ConditionalTest(excluded_features = "android.hardware.type.television:android.software.leanback")
 public class ConnectivityConstraintTestActivity extends ConstraintTestActivity {
     private static final String TAG = "ConnectivityConstraintTestActivity";
     private static final int ANY_CONNECTIVITY_JOB_ID =
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/IdleConstraintTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/IdleConstraintTestActivity.java
index 05c1a2e..f6416ae 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/IdleConstraintTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/jobscheduler/IdleConstraintTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.jobscheduler;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 
 import android.annotation.TargetApi;
@@ -39,6 +40,7 @@
  *      turn off the screen to run to run tests that require idle mode to be on.
  */
 @TargetApi(21)
+@ConditionalTest(excluded_features = "android.hardware.type.television:android.software.leanback")
 public class IdleConstraintTestActivity extends ConstraintTestActivity {
     private static final String TAG = "IdleModeTestActivity";
     /**
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..fc1463d 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/location/GpsTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/location/GpsTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.location;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -41,6 +42,7 @@
 /**
  * CTS Verifier case for verifying GPS.
  */
+@ConditionalTest(required_features = "android.hardware.location.gps")
 public class GpsTestActivity extends PassFailButtons.Activity implements PassFailLog {
     private LocationManager mLocationManager;
     private TextView mTextView;
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeBatterySavingTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeBatterySavingTestActivity.java
index 08fb34d..03d1a32 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeBatterySavingTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeBatterySavingTestActivity.java
@@ -16,10 +16,15 @@
 
 package com.android.cts.verifier.location;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.location.LocationManager;
 import android.provider.Settings.Secure;
 import com.android.cts.verifier.R;
 
+@ConditionalTest(
+    required_features = "android.hardware.location.network",
+    excluded_features = "android.hardware.type.television:android.software.leanback"
+)
 public class LocationModeBatterySavingTestActivity extends LocationModeTestActivity {
 
     @Override
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeDeviceOnlyTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeDeviceOnlyTestActivity.java
index 0ba9f76..8efbf09 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeDeviceOnlyTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeDeviceOnlyTestActivity.java
@@ -16,10 +16,15 @@
 
 package com.android.cts.verifier.location;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.location.LocationManager;
 import android.provider.Settings.Secure;
 import com.android.cts.verifier.R;
 
+@ConditionalTest(
+    required_features = "android.hardware.location.gps",
+    excluded_features = "android.hardware.type.television:android.software.leanback"
+)
 public class LocationModeDeviceOnlyTestActivity extends LocationModeTestActivity {
 
     @Override
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeHighAccuracyTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeHighAccuracyTestActivity.java
index 9c10705..7546821 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeHighAccuracyTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeHighAccuracyTestActivity.java
@@ -16,10 +16,15 @@
 
 package com.android.cts.verifier.location;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.location.LocationManager;
 import android.provider.Settings.Secure;
 import com.android.cts.verifier.R;
 
+@ConditionalTest(
+    required_features = "android.hardware.location.network:android.hardware.location.gps",
+    excluded_features = "android.hardware.type.television:android.software.leanback"
+)
 public class LocationModeHighAccuracyTestActivity extends LocationModeTestActivity {
 
     @Override
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeOffTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeOffTestActivity.java
index 92b0742c..4fe9922 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeOffTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/location/LocationModeOffTestActivity.java
@@ -16,10 +16,12 @@
 
 package com.android.cts.verifier.location;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.location.LocationManager;
 import android.provider.Settings.Secure;
 import com.android.cts.verifier.R;
 
+@ConditionalTest(excluded_features = "android.hardware.type.television:android.software.leanback")
 public class LocationModeOffTestActivity extends LocationModeTestActivity {
 
     @Override
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodFlowTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodFlowTestActivity.java
index fe6de97..4018ae1 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodFlowTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodFlowTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.managedprovisioning;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.admin.DevicePolicyManager;
 import android.content.ActivityNotFoundException;
 import android.content.ComponentName;
@@ -47,6 +48,7 @@
  * The first two verifications are performed automatically, by interacting with profile owner using
  * cross-profile intents, while the last two are carried out manually by the user.
  */
+@ConditionalTest(required_features = "android.software.managed_users:android.software.device_admin")
 public class ByodFlowTestActivity extends DialogTestListActivity {
 
     private final String TAG = "ByodFlowTestActivity";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceOwnerNegativeTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceOwnerNegativeTestActivity.java
index 3c0955d..ecb0420 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceOwnerNegativeTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceOwnerNegativeTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.managedprovisioning;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.content.Intent;
 import android.database.DataSetObserver;
 import android.os.Bundle;
@@ -31,6 +32,7 @@
 /**
  * Activity that lists all device owner negative tests.
  */
+@ConditionalTest(required_features = "android.software.device_admin")
 public class DeviceOwnerNegativeTestActivity extends PassFailButtons.TestListActivity {
 
     private static final String ACTION_PROVISION_MANAGED_DEVICE
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceOwnerPositiveTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceOwnerPositiveTestActivity.java
index f4eb2b3..adb463d 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceOwnerPositiveTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceOwnerPositiveTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.managedprovisioning;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.admin.DevicePolicyManager;
@@ -47,6 +48,7 @@
  * adb shell dpm set-device-owner
  *  'com.android.cts.verifier/com.android.cts.verifier.managedprovisioning.DeviceAdminTestReceiver'
  */
+@ConditionalTest(required_features = "android.software.device_admin")
 public class DeviceOwnerPositiveTestActivity extends PassFailButtons.TestListActivity {
     private static final String TAG = "DeviceOwnerPositiveTestActivity";
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/NfcTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/NfcTestActivity.java
index 2f7619c..732106a 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/NfcTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/NfcTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.managedprovisioning;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.Activity;
 import android.app.admin.DevicePolicyManager;
 import android.content.ActivityNotFoundException;
@@ -43,6 +44,7 @@
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 
+@ConditionalTest(required_features = "android.hardware.nfc")
 public class NfcTestActivity extends Activity {
     private static final String TAG = "NfcTestActivity";
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityScreenOffTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityScreenOffTestActivity.java
index 6109893..a183d0e 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityScreenOffTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityScreenOffTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.net;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -75,6 +76,7 @@
  *     [4] The screen is put to sleep.
  *     [5] After two minutes, another IPv6 connectivity test is performed.
  */
+@ConditionalTest(required_features = "android.hardware.wifi")
 public class ConnectivityScreenOffTestActivity extends PassFailButtons.Activity {
 
     private static final String TAG = ConnectivityScreenOffTestActivity.class.getSimpleName();
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/NfcTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/NfcTestActivity.java
index 68fc027..e3140fc 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/NfcTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/NfcTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.nfc;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.ArrayTestListAdapter;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
@@ -32,6 +33,7 @@
 import android.os.Bundle;
 
 /** Activity that lists all the NFC tests. */
+@ConditionalTest(required_features = "android.hardware.nfc")
 public class NfcTestActivity extends PassFailButtons.TestListActivity {
 
     private static final String NDEF_ID =
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/AttentionManagementVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/AttentionManagementVerifierActivity.java
index 4898ab2..179629a 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/AttentionManagementVerifierActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/AttentionManagementVerifierActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.notifications;
 
+import com.android.cts.verifier.ConditionalTest;
 import static com.android.cts.verifier.notifications.MockListener.JSON_AMBIENT;
 import static com.android.cts.verifier.notifications.MockListener.JSON_MATCHES_ZEN_FILTER;
 import static com.android.cts.verifier.notifications.MockListener.JSON_TAG;
@@ -43,6 +44,7 @@
 import java.util.List;
 import java.util.Set;
 
+@ConditionalTest(excluded_features = "android.hardware.type.watch:android.software.leanback")
 public class AttentionManagementVerifierActivity
         extends InteractiveVerifierActivity {
     private static final String TAG = "NoListenerAttentionVerifier";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/PackagePriorityVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/PackagePriorityVerifierActivity.java
index 5870981..0761e70 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/PackagePriorityVerifierActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/PackagePriorityVerifierActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.notifications;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.Notification;
 import android.content.Intent;
 import android.content.pm.PackageManager;
@@ -33,6 +34,7 @@
  * result in the notificaitons from that package being ranked higher than those from
  * other packages.
  */
+@ConditionalTest(excluded_features = "android.hardware.type.watch:android.software.leanback")
 public class PackagePriorityVerifierActivity
         extends InteractiveVerifierActivity {
     private static final String ACTION_POST = "com.android.cts.robot.ACTION_POST";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/p2p/P2pTestListActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/p2p/P2pTestListActivity.java
index 5985be6..088e5b4 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/p2p/P2pTestListActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/p2p/P2pTestListActivity.java
@@ -15,6 +15,7 @@
  */
 package com.android.cts.verifier.p2p;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.AlertDialog;
 import android.content.BroadcastReceiver;
 import android.content.Context;
@@ -36,6 +37,7 @@
 /**
  * Activity that lists all the WiFi Direct tests.
  */
+@ConditionalTest(required_features = "android.hardware.wifi.direct")
 public class P2pTestListActivity extends PassFailButtons.TestListActivity {
 
     /*
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/projection/cube/ProjectionCubeActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/projection/cube/ProjectionCubeActivity.java
index 0ef9a30..977f390 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/projection/cube/ProjectionCubeActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/projection/cube/ProjectionCubeActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.projection.cube;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 
 import android.os.Bundle;
@@ -24,6 +25,7 @@
 import com.android.cts.verifier.projection.ProjectionActivity;
 import com.android.cts.verifier.projection.ProjectionPresentationType;
 
+@ConditionalTest(required_features = "android.hardware.faketouch")
 public class ProjectionCubeActivity extends ProjectionActivity {
     private static final String TAG = ProjectionCubeActivity.class.getSimpleName();
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/projection/list/ProjectionListActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/projection/list/ProjectionListActivity.java
index c166320..4f9c1bd 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/projection/list/ProjectionListActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/projection/list/ProjectionListActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.projection.list;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.os.Bundle;
 import android.util.Log;
 
@@ -24,6 +25,7 @@
 import com.android.cts.verifier.projection.ProjectionPresentationType;
 import com.android.cts.verifier.projection.cube.ProjectionCubeActivity;
 
+@ConditionalTest(excluded_features = "android.hardware.type.television:android.software.leanback")
 public class ProjectionListActivity extends ProjectionActivity {
     private static final String TAG = ProjectionCubeActivity.class.getSimpleName();
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/projection/offscreen/ProjectionOffscreenActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/projection/offscreen/ProjectionOffscreenActivity.java
index cfa097b..1d39d3c 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/projection/offscreen/ProjectionOffscreenActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/projection/offscreen/ProjectionOffscreenActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.projection.offscreen;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.Context;
@@ -50,6 +51,7 @@
 
 import java.nio.ByteBuffer;
 
+@ConditionalTest(excluded_features = "android.hardware.type.television:android.software.leanback")
 public class ProjectionOffscreenActivity extends PassFailButtons.Activity
         implements ImageReader.OnImageAvailableListener {
     private static String TAG = ProjectionOffscreenActivity.class.getSimpleName();
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/projection/touch/ProjectionTouchActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/projection/touch/ProjectionTouchActivity.java
index ed1d881..5931854 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/projection/touch/ProjectionTouchActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/projection/touch/ProjectionTouchActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.projection.touch;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.os.Bundle;
 import android.util.Log;
 
@@ -24,6 +25,7 @@
 import com.android.cts.verifier.projection.ProjectionPresentationType;
 import com.android.cts.verifier.projection.cube.ProjectionCubeActivity;
 
+@ConditionalTest(required_features = "android.hardware.faketouch:android.hardware.touchscreen.multitouch")
 public class ProjectionTouchActivity extends ProjectionActivity {
     private static final String TAG = ProjectionCubeActivity.class.getSimpleName();
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/projection/video/ProjectionVideoActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/projection/video/ProjectionVideoActivity.java
index 7a32b27..684abaa 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/projection/video/ProjectionVideoActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/projection/video/ProjectionVideoActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.projection.video;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.os.Bundle;
 import android.util.Log;
 
@@ -23,6 +24,7 @@
 import com.android.cts.verifier.projection.ProjectionActivity;
 import com.android.cts.verifier.projection.ProjectionPresentationType;
 
+@ConditionalTest(excluded_features = "android.hardware.type.watch")
 public class ProjectionVideoActivity extends ProjectionActivity {
     private static final String TAG = ProjectionVideoActivity.class.getSimpleName();
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/projection/widgets/ProjectionWidgetActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/projection/widgets/ProjectionWidgetActivity.java
index 9f8cb51..5c7f0a2 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/projection/widgets/ProjectionWidgetActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/projection/widgets/ProjectionWidgetActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.projection.widgets;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.os.Bundle;
 import android.os.RemoteException;
 import android.util.Log;
@@ -28,6 +29,7 @@
 import com.android.cts.verifier.projection.ProjectionActivity;
 import com.android.cts.verifier.projection.ProjectionPresentationType;
 
+@ConditionalTest(required_features = "android.hardware.faketouch")
 public class ProjectionWidgetActivity extends ProjectionActivity {
     private static final String TAG = ProjectionWidgetActivity.class.getSimpleName();
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/screenpinning/ScreenPinningTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/screenpinning/ScreenPinningTestActivity.java
index a6e5f98..75ae6e5 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/screenpinning/ScreenPinningTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/screenpinning/ScreenPinningTestActivity.java
@@ -15,6 +15,7 @@
  */
 package com.android.cts.verifier.screenpinning;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.ActivityManager;
 import android.os.Bundle;
 import android.util.Log;
@@ -27,6 +28,7 @@
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
+@ConditionalTest(excluded_features = "android.hardware.type.television:android.software.leanback:android.hardware.type.watch")
 public class ScreenPinningTestActivity extends PassFailButtons.Activity {
 
     private static final String TAG = "ScreenPinningTestActivity";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/CAInstallNotificationVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/CAInstallNotificationVerifierActivity.java
index 3e8110e..3f781ff 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/CAInstallNotificationVerifierActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/CAInstallNotificationVerifierActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.security;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.Service;
 import android.content.ActivityNotFoundException;
 import android.content.Intent;
@@ -39,6 +40,7 @@
 import java.io.InputStream;
 import java.util.concurrent.LinkedBlockingQueue;
 
+@ConditionalTest(excluded_features = "android.hardware.type.watch:android.hardware.type.television:android.software.leanback")
 public class CAInstallNotificationVerifierActivity extends PassFailButtons.Activity
 implements Runnable {
     static final String TAG = CAInstallNotificationVerifierActivity.class.getSimpleName();
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
index 5537b15..9a3d9b8 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
@@ -1,5 +1,6 @@
 package com.android.cts.verifier.security;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.content.ActivityNotFoundException;
 import android.content.Intent;
 import android.os.Bundle;
@@ -17,6 +18,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 
+@ConditionalTest(excluded_features = "android.hardware.type.watch:android.hardware.type.television:android.software.leanback")
 public class CANotifyOnBootActivity extends PassFailButtons.Activity {
 
     private static final String TAG = CANotifyOnBootActivity.class.getSimpleName();
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/FingerprintBoundKeysTest.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/FingerprintBoundKeysTest.java
index bca7a66..56ea969 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/FingerprintBoundKeysTest.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/FingerprintBoundKeysTest.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.security;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -58,6 +59,10 @@
 import javax.crypto.NoSuchPaddingException;
 import javax.crypto.SecretKey;
 
+@ConditionalTest(
+    required_features = "android.hardware.fingerprint",
+    excluded_features = "android.hardware.type.television:android.software.leanback:android.hardware.type.watch"
+)
 public class FingerprintBoundKeysTest extends PassFailButtons.Activity {
     private static final String TAG = "FingerprintBoundKeysTest";
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/KeyChainTest.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/KeyChainTest.java
index ebdb4c0..ec6ea0f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/KeyChainTest.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/KeyChainTest.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.security;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.Activity;
 import android.content.Intent;
 import android.content.res.Resources;
@@ -71,6 +72,7 @@
 /**
  * Simple activity based test that exercises the KeyChain API
  */
+@ConditionalTest(excluded_features = "android.hardware.type.watch:android.hardware.type.television:android.software.leanback")
 public class KeyChainTest extends PassFailButtons.Activity implements View.OnClickListener {
 
     private static final String TAG = "KeyChainTest";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/LockConfirmBypassTest.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/LockConfirmBypassTest.java
index a0f9c36..5fda5f3 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/LockConfirmBypassTest.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/LockConfirmBypassTest.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.security;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.KeyguardManager;
 import android.app.admin.DevicePolicyManager;
 import android.content.Intent;
@@ -36,6 +37,7 @@
  * if he/she was prompted for the original pattern or password. If the user wasn't prompted,
  * the test fails.
  */
+@ConditionalTest(required_features = "android.software.device_admin")
 public class LockConfirmBypassTest extends PassFailButtons.Activity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/ScreenLockBoundKeysTest.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/ScreenLockBoundKeysTest.java
index 863488b..7f63a81 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/ScreenLockBoundKeysTest.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/ScreenLockBoundKeysTest.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.security;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -50,6 +51,7 @@
 import javax.crypto.NoSuchPaddingException;
 import javax.crypto.SecretKey;
 
+@ConditionalTest(required_features = "android.software.device_admin")
 public class ScreenLockBoundKeysTest extends PassFailButtons.Activity {
 
     /** Alias for our key in the Android Key Store. */
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/WiFiCACertificateBugTest.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/WiFiCACertificateBugTest.java
index 474a157..d664e55 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/WiFiCACertificateBugTest.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/WiFiCACertificateBugTest.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.security;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.AlertDialog;
 import android.app.KeyguardManager;
 import android.content.DialogInterface;
@@ -49,6 +50,7 @@
 import javax.net.ssl.TrustManagerFactory;
 import javax.net.ssl.X509TrustManager;
 
+@ConditionalTest(excluded_features = "android.hardware.type.television:android.software.leanback:android.hardware.type.watch")
 public class WiFiCACertificateBugTest extends PassFailButtons.Activity {
 
     private static final String CERT_ASSET_NAME = "myCA.cer";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerMeasurementTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerMeasurementTestActivity.java
index 52b3dee..ee8f89f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerMeasurementTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerMeasurementTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 import com.android.cts.verifier.sensors.base.SensorCtsVerifierTestActivity;
 
@@ -30,6 +31,7 @@
 /**
  * Semi-automated test that focuses on characteristics associated with Accelerometer measurements.
  */
+@ConditionalTest(required_features = "android.hardware.sensor.accelerometer")
 public class AccelerometerMeasurementTestActivity extends SensorCtsVerifierTestActivity {
     public AccelerometerMeasurementTestActivity() {
         super(AccelerometerMeasurementTestActivity.class);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/BatchingTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/BatchingTestActivity.java
index 7ef63d7..d8a42a6 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/BatchingTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/BatchingTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 import com.android.cts.verifier.sensors.base.SensorCtsVerifierTestActivity;
 
@@ -33,6 +34,7 @@
  * If a sensor supports the batching mode, FifoReservedEventCount for that sensor should be greater
  * than one.
  */
+@ConditionalTest(applicable_features = "android.hardware.sensor.stepcounter:android.hardware.sensor.stepdetector:android.hardware.sensor.proximity:android.hardware.sensor.light")
 public class BatchingTestActivity extends SensorCtsVerifierTestActivity {
     public BatchingTestActivity() {
         super(BatchingTestActivity.class);
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 21a4f56..7dbfb67 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/DeviceSuspendTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/DeviceSuspendTestActivity.java
@@ -1,5 +1,6 @@
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Timer;
@@ -45,6 +46,7 @@
 
 import junit.framework.Assert;
 
+@ConditionalTest(excluded_features = "android.hardware.type.television:android.software.leanback")
 public class DeviceSuspendTestActivity
             extends SensorCtsVerifierTestActivity {
         public DeviceSuspendTestActivity() {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/GyroscopeMeasurementTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/GyroscopeMeasurementTestActivity.java
index 7be0fb1..47ef0fa 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/GyroscopeMeasurementTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/GyroscopeMeasurementTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 import com.android.cts.verifier.sensors.base.SensorCtsVerifierTestActivity;
 import com.android.cts.verifier.sensors.renderers.GLRotationGuideRenderer;
@@ -32,6 +33,7 @@
 /**
  * Semi-automated test that focuses on characteristics associated with Gyroscope measurements.
  */
+@ConditionalTest(required_features = "android.hardware.sensor.gyroscope")
 public class GyroscopeMeasurementTestActivity extends SensorCtsVerifierTestActivity {
     private static final float THRESHOLD_CALIBRATED_UNCALIBRATED_RAD_SEC = 0.01f;
     private static final float THRESHOLD_AXIS_UNDER_ROTATION_DEG = 10.0f;
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/HeartRateMonitorTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/HeartRateMonitorTestActivity.java
index b6a1c47..b8f2f7f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/HeartRateMonitorTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/HeartRateMonitorTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.AlertDialog;
 import android.content.Context;
 import android.hardware.Sensor;
@@ -33,6 +34,7 @@
  * CTS Verifier case for verifying correct integration of heart rate monitor.
  * If a user is wearing a device with an HRM, the value is between <> and <>
  */
+@ConditionalTest(required_features = "android.hardware.sensor.heartrate")
 public class HeartRateMonitorTestActivity extends PassFailButtons.Activity {
     private SensorManager mSensorManager;
     private Sensor mSensor;
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagneticFieldMeasurementTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagneticFieldMeasurementTestActivity.java
index 229a9dc..39fc0b3 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagneticFieldMeasurementTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagneticFieldMeasurementTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 import com.android.cts.verifier.sensors.base.SensorCtsVerifierTestActivity;
 
@@ -37,6 +38,7 @@
  * Also, it is recommended to execute these tests outdoors, or at least far from magnetic
  * disturbances.
  */
+@ConditionalTest(required_features = "android.hardware.sensor.compass")
 public class MagneticFieldMeasurementTestActivity extends SensorCtsVerifierTestActivity {
     private static final float THRESHOLD_CALIBRATED_UNCALIBRATED_UT = 3f;
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/RVCVXCheckTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/RVCVXCheckTestActivity.java
index 789de68..adfb380 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/RVCVXCheckTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/RVCVXCheckTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.AlertDialog;
 import android.content.Context;
 import android.content.DialogInterface;
@@ -52,6 +53,7 @@
  * Currently only ROTATION_VECTOR sensor is used.
  *
  */
+@ConditionalTest(required_features = "android.hardware.sensor.accelerometer:android.hardware.sensor.gyroscope:android.hardware.sensor.compass:android.hardware.camera.any")
 public class RVCVXCheckTestActivity
         extends SensorCtsVerifierTestActivity {
     public RVCVXCheckTestActivity() {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorBatchingTestsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorBatchingTestsActivity.java
index d1923cc..1d33158 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorBatchingTestsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorBatchingTestsActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.sensors.base.SensorCtsTestActivity;
 
 import android.hardware.cts.SensorBatchingTests;
@@ -24,6 +25,7 @@
  * Activity to execute CTS sensor batching tests.
  * It is a wrapper for {@link SensorBatchingTests} running with AndroidJUnitRunner.
  */
+@ConditionalTest(applicable_features = "android.hardware.sensor.accelerometer:android.hardware.sensor.compass:android.hardware.sensor.gyroscope:android.hardware.sensor.barometer")
 public class SensorBatchingTestsActivity extends SensorCtsTestActivity {
     public SensorBatchingTestsActivity() {
         super(SensorBatchingTests.class);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorIntegrationTestsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorIntegrationTestsActivity.java
index bda7f2b..adcf6c7 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorIntegrationTestsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorIntegrationTestsActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.sensors.base.SensorCtsTestActivity;
 
 import android.hardware.cts.SensorIntegrationTests;
@@ -24,6 +25,7 @@
  * Activity to execute CTS sensor integration tests.
  * It is a wrapper for {@link SensorIntegrationTests} running with AndroidJUnitRunner.
  */
+@ConditionalTest(applicable_features = "android.hardware.sensor.accelerometer:android.hardware.sensor.compass:android.hardware.sensor.gyroscope")
 public class SensorIntegrationTestsActivity extends SensorCtsTestActivity {
     public SensorIntegrationTestsActivity() {
         super(SensorIntegrationTests.class);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorTestActivity.java
index fd3d380..14ed380 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.sensors.base.SensorCtsTestActivity;
 
 import android.hardware.cts.SensorTest;
@@ -24,6 +25,7 @@
  * Activity to execute CTS sensor tests.
  * It is a wrapper for {@link SensorTest} running with AndroidJUnitRunner.
  */
+@ConditionalTest(applicable_features = "android.hardware.sensor.accelerometer:android.hardware.sensor.stepcounter:android.hardware.sensor.stepdetector:android.hardware.sensor.heartrate:android.hardware.sensor.compass:android.hardware.sensor.ambient_temperature")
 public class SensorTestActivity extends SensorCtsTestActivity {
     public SensorTestActivity() {
         super(SensorTest.class);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SignificantMotionTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SignificantMotionTestActivity.java
index e1cba26..585c3dd 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SignificantMotionTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SignificantMotionTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.CountDownLatch;
@@ -51,6 +52,7 @@
  * Test cases for Significant Motion sensor.
  * They use walking motion to change the location and trigger Significant Motion.
  */
+@ConditionalTest(required_features = "android.hardware.sensor.accelerometer")
 public class SignificantMotionTestActivity extends SensorCtsVerifierTestActivity {
     public SignificantMotionTestActivity() {
         super(SignificantMotionTestActivity.class);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SingleSensorTestsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SingleSensorTestsActivity.java
index 23b5707..731c426 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SingleSensorTestsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SingleSensorTestsActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.sensors;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.sensors.base.SensorCtsTestActivity;
 
 import android.hardware.cts.SingleSensorTests;
@@ -24,6 +25,7 @@
  * Activity to execute CTS single sensor tests.
  * It is a wrapper for {@link SingleSensorTests} running with AndroidJUnitRunner.
  */
+@ConditionalTest(applicable_features = "android.hardware.sensor.accelerometer:android.hardware.sensor.compass:android.hardware.sensor.gyroscope:android.hardware.sensor.barometer")
 public class SingleSensorTestsActivity extends SensorCtsTestActivity {
     public SingleSensorTestsActivity() {
         super(SingleSensorTests.class);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/streamquality/StreamingVideoActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/streamquality/StreamingVideoActivity.java
index 00a52ae..065701c 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/streamquality/StreamingVideoActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/streamquality/StreamingVideoActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.streamquality;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.ArrayTestListAdapter;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
@@ -46,6 +47,7 @@
  * different protocols for a short amount of time, after which users can mark Pass/Fail depending
  * on the smoothness and subjective quality of the video.
  */
+@ConditionalTest(excluded_features = "android.hardware.type.watch")
 public class StreamingVideoActivity extends PassFailButtons.TestListActivity {
     /**
      * Simple storage class for stream information.
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/tv/AppLinkTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/tv/AppLinkTestActivity.java
index 43f293a..71b3a00 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/tv/AppLinkTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/tv/AppLinkTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.tv;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.content.Intent;
 import android.database.Cursor;
 import android.graphics.drawable.Drawable;
@@ -30,6 +31,7 @@
 /**
  * Tests for verifying TV app behavior for TV app-link.
  */
+@ConditionalTest(required_features = "android.software.live_tv")
 public class AppLinkTestActivity extends TvAppVerifierActivity implements View.OnClickListener {
     private static final long TIMEOUT_MS = 5l * 60l * 1000l;  // 5 mins.
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/tv/MultipleTracksTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/tv/MultipleTracksTestActivity.java
index a912cc6..069b121 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/tv/MultipleTracksTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/tv/MultipleTracksTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.tv;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 import android.annotation.SuppressLint;
 import android.content.Intent;
@@ -37,6 +38,7 @@
  * Tests for verifying TV app behavior on multiple tracks and subtitle.
  */
 @SuppressLint("NewApi")
+@ConditionalTest(required_features = "android.software.live_tv")
 public class MultipleTracksTestActivity extends TvAppVerifierActivity
         implements View.OnClickListener {
     private static final String TAG = "MultipleTracksTestActivity";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/tv/ParentalControlTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/tv/ParentalControlTestActivity.java
index 5e3d08a..4fa6efc 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/tv/ParentalControlTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/tv/ParentalControlTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.tv;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.R;
 import android.annotation.SuppressLint;
 import android.content.Intent;
@@ -36,6 +37,7 @@
  * Tests for verifying TV app behavior on parental control.
  */
 @SuppressLint("NewApi")
+@ConditionalTest(required_features = "android.software.live_tv")
 public class ParentalControlTestActivity extends TvAppVerifierActivity
         implements View.OnClickListener {
     private static final String TAG = "ParentalControlTestActivity";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/tv/TvInputDiscoveryTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/tv/TvInputDiscoveryTestActivity.java
index d088e2d..5942838 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/tv/TvInputDiscoveryTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/tv/TvInputDiscoveryTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.tv;
 
+import com.android.cts.verifier.ConditionalTest;
 import android.app.SearchableInfo;
 import android.content.Context;
 import android.content.Intent;
@@ -28,6 +29,7 @@
 /**
  * Tests for verifying TV app behavior for third-party TV input apps.
  */
+@ConditionalTest(required_features = "android.software.live_tv")
 public class TvInputDiscoveryTestActivity extends TvAppVerifierActivity
         implements View.OnClickListener {
     private static final String TAG = "TvInputDiscoveryTestActivity";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/usb/UsbAccessoryTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/usb/UsbAccessoryTestActivity.java
index 5c31ea4..2c9b4ef 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/usb/UsbAccessoryTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/usb/UsbAccessoryTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.usb;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 import com.android.cts.verifier.TestResult;
@@ -54,6 +55,10 @@
  * Test for USB accessories. The test activity interacts with a cts-usb-accessory program that
  * acts as an accessory by exchanging a series of messages.
  */
+@ConditionalTest(
+    required_features = "android.hardware.usb.accessory",
+    excluded_features = "android.hardware.type.watch"
+)
 public class UsbAccessoryTestActivity extends PassFailButtons.Activity {
 
     private static final String TAG = "UsbAccessoryTest";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/widget/WidgetTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/widget/WidgetTestActivity.java
index 25f0a7a..2f7411f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/widget/WidgetTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/widget/WidgetTestActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.verifier.widget;
 
+import com.android.cts.verifier.ConditionalTest;
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -29,6 +30,7 @@
 /**
  * CTS Verifier case for verifying basic widget framework functionality.
  */
+@ConditionalTest(required_features = "android.software.app_widgets")
 public class WidgetTestActivity extends PassFailButtons.Activity {
 
     @Override