Merge "Skip UsbAccessory test on non-handheld devices" into marshmallow-cts-dev
diff --git a/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java b/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
index bf61ead..b245db5 100644
--- a/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
+++ b/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
@@ -456,11 +456,12 @@
     }
 
     public void testUsbAccessory() {
-        // USB accessory mode is only a requirement for devices with USB ports supporting
-        // peripheral mode. As there is no public API to distinguish a device with only host
-        // mode support from having both peripheral and host support, the test may have
-        // false negatives.
-        assertAvailable(PackageManager.FEATURE_USB_ACCESSORY);
+        // Per CDD requirement all handheld Android devices must support AOA
+        if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
+               && !mPackageManager.hasSystemFeature(PackageManager.FEATURE_WATCH)
+               && !mPackageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)) {
+            assertAvailable(PackageManager.FEATURE_USB_ACCESSORY);
+        }
     }
 
     public void testWifiFeature() throws Exception {