diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-06-30 20:36:08 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-06-30 20:36:08 +0000 |
commit | 6638644b50d890edcea58e84aaaf2f7cf5893160 (patch) | |
tree | 30431f0315460c1420977c130b1931bd976b0d30 | |
parent | f850e7f892664c9f181caab991ad72dd544895b6 (diff) | |
parent | cdf100b81d8b8a93abc9bf3f3c14e7247125d685 (diff) | |
download | cts-6638644b50d890edcea58e84aaaf2f7cf5893160.tar.gz |
Merge "Snap for 10417522 from 1604ad3a801c659aea14fe4e8a4d091f5eedda8a to android13-tests-release" into android13-tests-release
5 files changed, 35 insertions, 5 deletions
diff --git a/apps/CtsVerifier/AndroidManifest.xml b/apps/CtsVerifier/AndroidManifest.xml index 601d706cbda..d4709f026cc 100644 --- a/apps/CtsVerifier/AndroidManifest.xml +++ b/apps/CtsVerifier/AndroidManifest.xml @@ -4357,6 +4357,10 @@ <meta-data android:name="test_excluded_features" android:value="android.hardware.type.television:android.software.leanback:android.hardware.type.automotive" /> <meta-data android:name="display_mode" android:value="single_display_mode" /> + <meta-data + android:name="test_required_configs" + android:value="config_battery_supported" /> + <meta-data android:name="CddTest" android:value="7.3/C-1-5" /> </activity> <service diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java b/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java index 9393283f006..7d970e500e3 100644 --- a/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java +++ b/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java @@ -32,6 +32,7 @@ import android.telephony.TelephonyManager; import android.util.Log; import android.widget.ListView; +import com.android.compatibility.common.util.BatteryUtils; import com.android.cts.verifier.TestListActivity.DisplayMode; import java.lang.reflect.InvocationTargetException; @@ -134,6 +135,8 @@ public class ManifestTestListAdapter extends TestListAdapter { private static final String TEST_DISPLAY_MODE_META_DATA = "display_mode"; + private static final String CONFIG_BATTERY_SUPPORTED = "config_battery_supported"; + private static final String CONFIG_NO_EMULATOR = "config_no_emulator"; private static final String CONFIG_VOICE_CAPABLE = "config_voice_capable"; @@ -481,6 +484,11 @@ public class ManifestTestListAdapter extends TestListAdapter { exception); } break; + case CONFIG_BATTERY_SUPPORTED: + if (!BatteryUtils.hasBattery()) { + return false; + } + break; case CONFIG_QUICK_SETTINGS_SUPPORTED: if (!getSystemResourceFlag("config_quickSettingsSupported")) { return false; diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java index 823f3268df7..324b5dbf87f 100644 --- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java +++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java @@ -108,7 +108,14 @@ public class USBAudioPeripheralButtonsActivity extends USBAudioPeripheralActivit private void calculateMatch() { if (mIsPeripheralAttached) { - boolean match = mHasBtnA && mHasBtnB && mHasBtnC; + boolean match; + boolean interceptedVolume = getResources().getBoolean(Resources.getSystem() + .getIdentifier("config_handleVolumeKeysInWindowManager", "bool", "android")); + if (interceptedVolume) { + match = mHasBtnA; + } else { + match = mHasBtnA && mHasBtnB && mHasBtnC; + } Log.i(TAG, "match:" + match); getPassButton().setEnabled(match); } else { diff --git a/tests/camera/api31test/src/android/camera/cts/api31test/SPerfClassTest.java b/tests/camera/api31test/src/android/camera/cts/api31test/SPerfClassTest.java index 7e88b27b560..5732182aaf1 100644 --- a/tests/camera/api31test/src/android/camera/cts/api31test/SPerfClassTest.java +++ b/tests/camera/api31test/src/android/camera/cts/api31test/SPerfClassTest.java @@ -122,11 +122,20 @@ public class SPerfClassTest extends AndroidTestCase { Size[] jpegSizes = staticInfo.getJpegOutputSizesChecked(); assertTrue("Primary cameras must support JPEG formats", jpegSizes != null && jpegSizes.length > 0); + int minEuclidDistSquare = Integer.MAX_VALUE; + Size closestJpegSizeToVga = VGA; for (Size jpegSize : jpegSizes) { mCollector.expectTrue( "Primary camera's JPEG size must be at least 1080p, but is " + jpegSize, jpegSize.getWidth() * jpegSize.getHeight() >= FULLHD.getWidth() * FULLHD.getHeight()); + int widthDist = jpegSize.getWidth() - VGA.getWidth(); + int heightDist = jpegSize.getHeight() - VGA.getHeight(); + int euclidDistSquare = widthDist * widthDist + heightDist * heightDist; + if (euclidDistSquare < minEuclidDistSquare) { + closestJpegSizeToVga = jpegSize; + minEuclidDistSquare = euclidDistSquare; + } } CameraDevice camera = null; @@ -144,7 +153,7 @@ public class SPerfClassTest extends AndroidTestCase { outputConfigs.add(new OutputConfiguration(jpegSurface)); // isSessionConfigurationSupported will return true for JPEG sizes smaller - // than 1080P, due to framework rouding up to closest supported size (1080p). + // than 1080P, due to framework rouding up to closest supported size. SessionConfigSupport sessionConfigSupport = isSessionConfigSupported( camera, mHandler, outputConfigs, /*inputConfig*/ null, SessionConfiguration.SESSION_REGULAR, true/*defaultSupport*/); @@ -154,7 +163,7 @@ public class SPerfClassTest extends AndroidTestCase { sessionConfigSupport.configSupported); // Session creation for JPEG sizes smaller than 1080p will succeed, and the - // result JPEG image dimension is rounded up to closest supported size (1080p). + // result JPEG image dimension is rounded up to closest supported size. CaptureRequest.Builder request = camera.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE); request.addTarget(jpegSurface); @@ -190,8 +199,8 @@ public class SPerfClassTest extends AndroidTestCase { byte[] data = CameraTestUtils.getDataFromImage(image); assertTrue("Invalid image data", data != null && data.length > 0); - CameraTestUtils.validateJpegData(data, FULLHD.getWidth(), FULLHD.getHeight(), - null /*filePath*/); + CameraTestUtils.validateJpegData(data, closestJpegSizeToVga.getWidth(), + closestJpegSizeToVga.getHeight(), null /*filePath*/); } finally { if (camera != null) { camera.close(); diff --git a/tools/cts-tradefed/res/config/cts-exclude.xml b/tools/cts-tradefed/res/config/cts-exclude.xml index 8914aeab06d..60b9609194c 100644 --- a/tools/cts-tradefed/res/config/cts-exclude.xml +++ b/tools/cts-tradefed/res/config/cts-exclude.xml @@ -39,6 +39,8 @@ <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:exclude-annotation:android.platform.test.annotations.AsbSecurityTest" /> <option name="compatibility:test-arg" value="com.android.compatibility.common.tradefed.testtype.JarHostTest:exclude-annotation:android.platform.test.annotations.AsbSecurityTest" /> + <!-- Exclude JvmtiHostTest911 as it's tested in MTS and depends on implementation details of the ART module. http://b/286797612 --> + <option name="compatibility:exclude-filter" value="CtsJvmtiRunTest911HostTestCases" /> <!-- Exclude few tests as it depends on implementation details of the ART module. b/287732826 --> <option name="compatibility:exclude-filter" value="CtsJvmtiRunTest913HostTestCases" /> <option name="compatibility:exclude-filter" value="CtsJvmtiRunTest912HostTestCases" /> |