summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-04-13 11:25:57 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-04-13 11:25:57 +0000
commitf4c8bcc23469cb78e47dc4ab482bcb70279eda82 (patch)
tree06efecd705910b060dc012ea88c81c102b15ee00
parentc4482c0fb0865ca0407fda4e7ab4546e4365124b (diff)
parent89d5d9fee5adcf8bf90bbfb311080259aa64daeb (diff)
downloadcts-android11-mainline-networkstack-release.tar.gz
Snap for 7278887 from 89d5d9fee5adcf8bf90bbfb311080259aa64daeb to mainline-networkstack-releaseandroid-mainline-11.0.0_r41android11-mainline-networkstack-release
Change-Id: Ic7bb1999ff953ed50de6d3e00dad45bea629d767
-rw-r--r--hostsidetests/securitybulletin/securityPatch/CVE-2020-0224/Android.bp27
-rw-r--r--hostsidetests/securitybulletin/securityPatch/CVE-2020-0224/poc.cpp60
-rw-r--r--hostsidetests/securitybulletin/src/android/security/cts/CVE_2020_0224.java16
-rw-r--r--tests/framework/base/windowmanager/Android.mk2
-rw-r--r--tests/framework/base/windowmanager/alertwindowapp/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/alertwindowappsdk25/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/alertwindowservice/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/app/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/app27/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/appAShareUid/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/appBShareUid/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/appDeprecatedSdk/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/appDisplaySize/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/appPrereleaseSdk/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/appProfileable/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/appSecondUid/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/appThirdUid/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/dndsourceapp/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/dndtargetapp/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/dndtargetappsdk23/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/src/android/server/wm/PinnedStackTests.java2
-rw-r--r--tests/framework/base/windowmanager/translucentapp/Android.bp1
-rw-r--r--tests/framework/base/windowmanager/translucentappsdk26/Android.bp1
-rw-r--r--tests/inputmethod/mockime/Android.bp1
-rwxr-xr-xtests/tests/media/src/android/media/cts/DecoderTestXheAac.java9
-rw-r--r--tests/tests/media/src/android/media/cts/MediaMetadataRetrieverTest.java5
-rw-r--r--tests/tests/media/src/android/media/cts/TestUtils.java48
27 files changed, 78 insertions, 110 deletions
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0224/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0224/Android.bp
deleted file mode 100644
index 084a1fe3d2c..00000000000
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0224/Android.bp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-cc_test {
- name: "CVE-2020-0224",
- defaults: ["cts_hostsidetests_securitybulletin_defaults"],
- shared_libs: [
- "libpac",
- ],
- srcs: [
- "poc.cpp",
- ],
-}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0224/poc.cpp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0224/poc.cpp
deleted file mode 100644
index de62221ca8e..00000000000
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0224/poc.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <codecvt>
-#include <fstream>
-#include "../includes/common.h"
-#include <proxy_resolver_v8_wrapper.h>
-
-using namespace std;
-
-void poc(char* raw) {
- ProxyResolverV8Handle* handle = ProxyResolverV8Handle_new();
- string u8Script(raw);
- u16string u16Script =
- wstring_convert<codecvt_utf8_utf16<char16_t>, char16_t> { }
- .from_bytes(u8Script);
-
- ProxyResolverV8Handle_SetPacScript(handle, u16Script.data());
- const char16_t* spec = u"", *host = u"";
- ProxyResolverV8Handle_GetProxyForURL(handle, spec, host);
- ProxyResolverV8Handle_delete(handle);
-}
-
-int main(int argc, char **argv) {
- if (argc != 2) {
- return EXIT_FAILURE;
- }
-
- ifstream stream;
- stream.open(argv[1]);
- if (stream.rdstate() != ifstream::goodbit) {
- return EXIT_FAILURE;
- }
-
- stream.seekg(0, ios::end);
- size_t size = stream.tellg();
- stream.seekg(0);
- char* raw = (char*) calloc(size + 1, sizeof(char));
- stream.read(raw, size);
- time_t currentTime = start_timer();
- while (timer_active(currentTime)) {
- poc(raw);
- }
-
- free(raw);
- return EXIT_SUCCESS;
-}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2020_0224.java b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2020_0224.java
index b02eeea126a..4cd94c9187f 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2020_0224.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2020_0224.java
@@ -33,16 +33,10 @@ public class CVE_2020_0224 extends SecurityTestCase {
@SecurityTest(minPatchLevel = "2020-07")
@Test
public void testPocCVE_2020_0224() throws Exception {
- String inputFiles[] = {"cve_2020_0224.pac"};
- String binaryName = "CVE-2020-0224";
- String signals[] = {CrashUtils.SIGSEGV, CrashUtils.SIGBUS, CrashUtils.SIGABRT};
- AdbUtils.pocConfig testConfig = new AdbUtils.pocConfig(binaryName, getDevice());
- testConfig.config = new CrashUtils.Config().setProcessPatterns(binaryName);
- testConfig.config.setSignals(signals);
- testConfig.config.checkMinAddress(false);
- testConfig.arguments = AdbUtils.TMP_PATH + inputFiles[0];
- testConfig.inputFiles = Arrays.asList(inputFiles);
- testConfig.inputFilesDestination = AdbUtils.TMP_PATH;
- AdbUtils.runPocAssertNoCrashesNotVulnerable(testConfig);
+ AdbUtils.runProxyAutoConfig("cve_2020_0224", getDevice());
+ AdbUtils.assertNoCrashes(getDevice(), new CrashUtils.Config()
+ .setProcessPatterns("pacrunner")
+ .checkMinAddress(false)
+ .appendSignals(CrashUtils.SIGABRT));
}
}
diff --git a/tests/framework/base/windowmanager/Android.mk b/tests/framework/base/windowmanager/Android.mk
index ef6a95eb75a..39d08127976 100644
--- a/tests/framework/base/windowmanager/Android.mk
+++ b/tests/framework/base/windowmanager/Android.mk
@@ -44,7 +44,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
CtsMockInputMethodLib \
metrics-helper-lib \
-LOCAL_COMPATIBILITY_SUITE := cts vts10 general-tests
+LOCAL_COMPATIBILITY_SUITE := cts vts10 general-tests sts
LOCAL_SDK_VERSION := test_current
diff --git a/tests/framework/base/windowmanager/alertwindowapp/Android.bp b/tests/framework/base/windowmanager/alertwindowapp/Android.bp
index 07069deff76..c8245da1b6b 100644
--- a/tests/framework/base/windowmanager/alertwindowapp/Android.bp
+++ b/tests/framework/base/windowmanager/alertwindowapp/Android.bp
@@ -29,5 +29,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/alertwindowappsdk25/Android.bp b/tests/framework/base/windowmanager/alertwindowappsdk25/Android.bp
index e7cbcdba8f3..fd6d943be6f 100644
--- a/tests/framework/base/windowmanager/alertwindowappsdk25/Android.bp
+++ b/tests/framework/base/windowmanager/alertwindowappsdk25/Android.bp
@@ -31,5 +31,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/alertwindowservice/Android.bp b/tests/framework/base/windowmanager/alertwindowservice/Android.bp
index 58d8688919f..6aee4e4056d 100644
--- a/tests/framework/base/windowmanager/alertwindowservice/Android.bp
+++ b/tests/framework/base/windowmanager/alertwindowservice/Android.bp
@@ -27,6 +27,7 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
dex_preopt: {
diff --git a/tests/framework/base/windowmanager/app/Android.bp b/tests/framework/base/windowmanager/app/Android.bp
index b12f93b2d6d..3512924d721 100644
--- a/tests/framework/base/windowmanager/app/Android.bp
+++ b/tests/framework/base/windowmanager/app/Android.bp
@@ -33,5 +33,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/app27/Android.bp b/tests/framework/base/windowmanager/app27/Android.bp
index 6ddf919c573..79d2d22974e 100644
--- a/tests/framework/base/windowmanager/app27/Android.bp
+++ b/tests/framework/base/windowmanager/app27/Android.bp
@@ -26,5 +26,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/appAShareUid/Android.bp b/tests/framework/base/windowmanager/appAShareUid/Android.bp
index 57adfd61346..052f829921b 100644
--- a/tests/framework/base/windowmanager/appAShareUid/Android.bp
+++ b/tests/framework/base/windowmanager/appAShareUid/Android.bp
@@ -26,5 +26,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/appBShareUid/Android.bp b/tests/framework/base/windowmanager/appBShareUid/Android.bp
index ec15e80daf9..8fe4775ea67 100644
--- a/tests/framework/base/windowmanager/appBShareUid/Android.bp
+++ b/tests/framework/base/windowmanager/appBShareUid/Android.bp
@@ -26,5 +26,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/appDeprecatedSdk/Android.bp b/tests/framework/base/windowmanager/appDeprecatedSdk/Android.bp
index c83b44fd116..8582bf1e5a2 100644
--- a/tests/framework/base/windowmanager/appDeprecatedSdk/Android.bp
+++ b/tests/framework/base/windowmanager/appDeprecatedSdk/Android.bp
@@ -26,5 +26,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/appDisplaySize/Android.bp b/tests/framework/base/windowmanager/appDisplaySize/Android.bp
index 819a9bfafeb..d492d7bfcb7 100644
--- a/tests/framework/base/windowmanager/appDisplaySize/Android.bp
+++ b/tests/framework/base/windowmanager/appDisplaySize/Android.bp
@@ -26,5 +26,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/appPrereleaseSdk/Android.bp b/tests/framework/base/windowmanager/appPrereleaseSdk/Android.bp
index d110d199495..6f5d5e4b61e 100644
--- a/tests/framework/base/windowmanager/appPrereleaseSdk/Android.bp
+++ b/tests/framework/base/windowmanager/appPrereleaseSdk/Android.bp
@@ -24,5 +24,6 @@ android_test_helper_app {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/appProfileable/Android.bp b/tests/framework/base/windowmanager/appProfileable/Android.bp
index cd540941943..2dcd954868f 100644
--- a/tests/framework/base/windowmanager/appProfileable/Android.bp
+++ b/tests/framework/base/windowmanager/appProfileable/Android.bp
@@ -26,5 +26,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts"
],
}
diff --git a/tests/framework/base/windowmanager/appSecondUid/Android.bp b/tests/framework/base/windowmanager/appSecondUid/Android.bp
index 5f44f5c971b..692f73bbef1 100644
--- a/tests/framework/base/windowmanager/appSecondUid/Android.bp
+++ b/tests/framework/base/windowmanager/appSecondUid/Android.bp
@@ -26,5 +26,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/appThirdUid/Android.bp b/tests/framework/base/windowmanager/appThirdUid/Android.bp
index 08a878ccb79..22bab9d60ed 100644
--- a/tests/framework/base/windowmanager/appThirdUid/Android.bp
+++ b/tests/framework/base/windowmanager/appThirdUid/Android.bp
@@ -26,5 +26,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/dndsourceapp/Android.bp b/tests/framework/base/windowmanager/dndsourceapp/Android.bp
index 7abd47847ce..9a1463e1937 100644
--- a/tests/framework/base/windowmanager/dndsourceapp/Android.bp
+++ b/tests/framework/base/windowmanager/dndsourceapp/Android.bp
@@ -26,5 +26,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/dndtargetapp/Android.bp b/tests/framework/base/windowmanager/dndtargetapp/Android.bp
index 00b40551e91..0a14121d22e 100644
--- a/tests/framework/base/windowmanager/dndtargetapp/Android.bp
+++ b/tests/framework/base/windowmanager/dndtargetapp/Android.bp
@@ -24,6 +24,7 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
static_libs: ["cts-wm-app-base"],
diff --git a/tests/framework/base/windowmanager/dndtargetappsdk23/Android.bp b/tests/framework/base/windowmanager/dndtargetappsdk23/Android.bp
index 13dbca2e31f..4420670fa80 100644
--- a/tests/framework/base/windowmanager/dndtargetappsdk23/Android.bp
+++ b/tests/framework/base/windowmanager/dndtargetappsdk23/Android.bp
@@ -24,6 +24,7 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
static_libs: ["cts-wm-app-base"],
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/PinnedStackTests.java b/tests/framework/base/windowmanager/src/android/server/wm/PinnedStackTests.java
index 98e5ff5b874..6e19de2ec1c 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/PinnedStackTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/PinnedStackTests.java
@@ -91,6 +91,7 @@ import android.graphics.Rect;
import android.os.Handler;
import android.os.Looper;
import android.platform.test.annotations.Presubmit;
+import android.platform.test.annotations.SecurityTest;
import android.provider.Settings;
import android.server.wm.CommandSession.ActivityCallback;
import android.server.wm.CommandSession.SizeInfo;
@@ -278,6 +279,7 @@ public class PinnedStackTests extends ActivityManagerTestBase {
}
@Test
+ @SecurityTest(minPatchLevel="2021-03")
public void testEnterPipWithTinyMinimalSize() throws Exception {
// Launch a PiP activity with minimal size specified and smaller than allowed minimum
launchActivity(PIP_ACTIVITY_WITH_TINY_MINIMAL_SIZE, EXTRA_ENTER_PIP, "true");
diff --git a/tests/framework/base/windowmanager/translucentapp/Android.bp b/tests/framework/base/windowmanager/translucentapp/Android.bp
index c551c29896c..3a19970473d 100644
--- a/tests/framework/base/windowmanager/translucentapp/Android.bp
+++ b/tests/framework/base/windowmanager/translucentapp/Android.bp
@@ -31,5 +31,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/framework/base/windowmanager/translucentappsdk26/Android.bp b/tests/framework/base/windowmanager/translucentappsdk26/Android.bp
index 7c8d0d88929..4ec800b6fd0 100644
--- a/tests/framework/base/windowmanager/translucentappsdk26/Android.bp
+++ b/tests/framework/base/windowmanager/translucentappsdk26/Android.bp
@@ -29,5 +29,6 @@ android_test {
"cts",
"vts10",
"general-tests",
+ "sts",
],
}
diff --git a/tests/inputmethod/mockime/Android.bp b/tests/inputmethod/mockime/Android.bp
index 228354134ef..6159a6c4671 100644
--- a/tests/inputmethod/mockime/Android.bp
+++ b/tests/inputmethod/mockime/Android.bp
@@ -43,6 +43,7 @@ android_test_helper_app {
"vts10",
"general-tests",
"mts",
+ "sts",
],
static_libs: [
"androidx.annotation_annotation",
diff --git a/tests/tests/media/src/android/media/cts/DecoderTestXheAac.java b/tests/tests/media/src/android/media/cts/DecoderTestXheAac.java
index 8536f30483d..dbcba7f339e 100755
--- a/tests/tests/media/src/android/media/cts/DecoderTestXheAac.java
+++ b/tests/tests/media/src/android/media/cts/DecoderTestXheAac.java
@@ -33,8 +33,8 @@ import android.media.cts.DecoderTest.AudioParameter;
import android.media.cts.DecoderTestAacDrc.DrcParams;
import android.media.cts.R;
import android.os.Build;
-import android.util.Log;
import android.os.Bundle;
+import android.util.Log;
import androidx.test.InstrumentationRegistry;
@@ -567,6 +567,13 @@ public class DecoderTestXheAac {
@Test
public void testDecodeUsacSyncSampleSeekingM4a() throws Exception {
Log.v(TAG, "START testDecodeUsacSyncSampleSeekingM4a");
+ if(!sIsAndroidRAndAbove) {
+ // The fix for b/158471477 was released in mainline release 300802800
+ // See https://android-build.googleplex.com/builds/treetop/googleplex-android-review/11990700
+ final int MIN_VERSION = 300802800;
+ TestUtils.assumeMainlineModuleAtLeast("com.google.android.media.swcodec", MIN_VERSION);
+ TestUtils.assumeMainlineModuleAtLeast("com.google.android.media", MIN_VERSION);
+ }
assertTrue("No AAC decoder found", sAacDecoderNames.size() > 0);
diff --git a/tests/tests/media/src/android/media/cts/MediaMetadataRetrieverTest.java b/tests/tests/media/src/android/media/cts/MediaMetadataRetrieverTest.java
index 48208d9f63e..98acf0ba834 100644
--- a/tests/tests/media/src/android/media/cts/MediaMetadataRetrieverTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaMetadataRetrieverTest.java
@@ -345,6 +345,11 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
}
public void testID3v240ExtHeader() {
+ if(!ApiLevelUtil.isAtLeast(Build.VERSION_CODES.R)) {
+ // The fix for b/154357105 was released in mainline release 30.09.007.01
+ // See https://android-build.googleplex.com/builds/treetop/googleplex-android-review/11174063
+ TestUtils.assumeMainlineModuleAtLeast("com.google.android.media", 300900701);
+ }
setDataSourceFd(R.raw.sinesweepid3v24ext);
assertEquals("Mime type was other than expected",
"audio/mpeg",
diff --git a/tests/tests/media/src/android/media/cts/TestUtils.java b/tests/tests/media/src/android/media/cts/TestUtils.java
index 093cc8c80a1..fb8212f7528 100644
--- a/tests/tests/media/src/android/media/cts/TestUtils.java
+++ b/tests/tests/media/src/android/media/cts/TestUtils.java
@@ -16,21 +16,21 @@
package android.media.cts;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static android.content.pm.PackageManager.MATCH_APEX;
+
+import static org.junit.Assume.assumeNoException;
+import static org.junit.Assume.assumeTrue;
import android.content.Context;
-import android.media.session.MediaSessionManager;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import java.io.FileDescriptor;
-import java.util.ArrayList;
-import java.util.List;
+import androidx.test.core.app.ApplicationProvider;
+
+import org.junit.AssumptionViolatedException;
+
import java.util.Objects;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
/**
* Utilities for tests.
@@ -66,6 +66,34 @@ public final class TestUtils {
return true;
}
+ /**
+ * Checks {@code module} is at least {@code minVersion}
+ *
+ * The tests are skipped by throwing a {@link AssumptionViolatedException}. CTS test runners
+ * will report this as a {@code ASSUMPTION_FAILED}.
+ *
+ * @param module the apex module name
+ * @param minVersion the minimum version
+ * @throws AssumptionViolatedException if module.minVersion < minVersion
+ */
+ static void assumeMainlineModuleAtLeast(String module, long minVersion) {
+ Context context = ApplicationProvider.getApplicationContext();
+ PackageInfo info;
+ try {
+ info = context.getPackageManager().getPackageInfo(module,
+ MATCH_APEX);
+ long actualVersion = info.getLongVersionCode();
+ assumeTrue("Assumed Module " + module + " minVersion " + actualVersion + " >= "
+ + minVersion,
+ actualVersion >= minVersion);
+ } catch (PackageManager.NameNotFoundException e) {
+ assumeNoException(e);
+ }
+ }
+
+ private TestUtils() {
+ }
+
public static class Monitor {
private int mNumSignal;