Merge "Add duytruong@ to OWNERS of security tests." into main
diff --git a/OWNERS b/OWNERS
index adb9461..80b41d2 100644
--- a/OWNERS
+++ b/OWNERS
@@ -12,6 +12,8 @@
# Android EngProd Approvers
wenshan@google.com
+kgui@google.com
guangzhu@google.com #{LAST_RESORT_SUGGESTION}
jdesprez@google.com #{LAST_RESORT_SUGGESTION}
-normancheung@google.com #{LAST_RESORT_SUGGESTION}
\ No newline at end of file
+normancheung@google.com #{LAST_RESORT_SUGGESTION}
+
diff --git a/apps/CameraITS/tests/scene0/test_param_sensitivity_burst.py b/apps/CameraITS/tests/scene0/test_param_sensitivity_burst.py
index a56a130..a409f1c 100644
--- a/apps/CameraITS/tests/scene0/test_param_sensitivity_burst.py
+++ b/apps/CameraITS/tests/scene0/test_param_sensitivity_burst.py
@@ -22,7 +22,7 @@
import its_session_utils
_NUM_STEPS = 3
-_ERROR_TOLERANCE = 0.96 # Allow ISO to be rounded down by 4%
+_ERROR_TOLERANCE = 0.95 # Allow ISO to be rounded down by 5%
class ParamSensitivityBurstTest(its_base_test.ItsBaseTest):
diff --git a/apps/CameraITS/tests/scene2_a/test_preview_min_frame_rate.py b/apps/CameraITS/tests/scene2_a/test_preview_min_frame_rate.py
index 0647b1d..815f3cf 100644
--- a/apps/CameraITS/tests/scene2_a/test_preview_min_frame_rate.py
+++ b/apps/CameraITS/tests/scene2_a/test_preview_min_frame_rate.py
@@ -31,7 +31,7 @@
_NAME = os.path.splitext(os.path.basename(__file__))[0]
_PREVIEW_RECORDING_DURATION_SECONDS = 10
_MAX_VAR_FRAME_DELTA = 0.001 # variance of frame deltas, units: seconds^2
-_FPS_ATOL = 0.5
+_FPS_ATOL = 0.8
_DARKNESS_ATOL = 0.1
diff --git a/apps/CameraITS/tests/scene6/test_in_sensor_zoom.py b/apps/CameraITS/tests/scene6/test_in_sensor_zoom.py
index 2e26231..5acb877 100644
--- a/apps/CameraITS/tests/scene6/test_in_sensor_zoom.py
+++ b/apps/CameraITS/tests/scene6/test_in_sensor_zoom.py
@@ -29,7 +29,7 @@
_NUM_STEPS = 10
_ZOOM_MIN_THRESH = 2.0
-_THRESHOLD_MAX_RMS_DIFF_CROPPED_RAW_USE_CASE = 0.03
+_THRESHOLD_MAX_RMS_DIFF_CROPPED_RAW_USE_CASE = 0.06
_NAME = os.path.splitext(os.path.basename(__file__))[0]
diff --git a/apps/CameraITS/tests/scene_extensions/scene_hdr/test_hdr_extension.py b/apps/CameraITS/tests/scene_extensions/scene_hdr/test_hdr_extension.py
index 9710a27..4490697 100644
--- a/apps/CameraITS/tests/scene_extensions/scene_hdr/test_hdr_extension.py
+++ b/apps/CameraITS/tests/scene_extensions/scene_hdr/test_hdr_extension.py
@@ -224,7 +224,6 @@
# Take capture without HDR extension activated as baseline
logging.debug('Taking capture without HDR extension')
out_surfaces = {'format': _FMT_NAME, 'width': _WIDTH, 'height': _HEIGHT}
- cam.do_3a()
req = capture_request_utils.auto_capture_request()
no_hdr_start_of_capture = time.time()
no_hdr_cap = cam.do_capture(req, out_surfaces)
@@ -240,7 +239,6 @@
# Take capture with HDR extension
logging.debug('Taking capture with HDR extension')
out_surfaces = {'format': _FMT_NAME, 'width': _WIDTH, 'height': _HEIGHT}
- cam.do_3a()
req = capture_request_utils.auto_capture_request()
hdr_start_of_capture = time.time()
hdr_cap = cam.do_capture_with_extensions(
diff --git a/apps/CameraITS/tests/scene_extensions/scene_night/test_night_extension.py b/apps/CameraITS/tests/scene_extensions/scene_night/test_night_extension.py
index 376b47b..627a0c3 100644
--- a/apps/CameraITS/tests/scene_extensions/scene_night/test_night_extension.py
+++ b/apps/CameraITS/tests/scene_extensions/scene_night/test_night_extension.py
@@ -18,6 +18,7 @@
import os.path
import time
+import cv2
from mobly import test_runner
import numpy as np
@@ -37,8 +38,7 @@
_MIN_AREA = 0.001 # Circle must be >= 0.1% of image size
_WHITE = 255
-_FMT_NAME = 'yuv' # To detect noise without conversion to RGB
-_IMAGE_FORMAT_YUV_420_888_INT = 35
+_IMAGE_FORMATS_TO_CONSTANTS = (('yuv', 35), ('jpeg', 256))
_DOT_INTENSITY_DIFF_TOL = 20 # Min diff between dot/circle intensities [0:255]
_DURATION_DIFF_TOL = 0.5 # Night mode ON captures must take 0.5 seconds longer
@@ -79,7 +79,19 @@
Returns:
Tuple of y_plane, numpy image.
"""
- y, _, _ = image_processing_utils.convert_capture_to_planes(cap)
+ if cap['format'] == 'jpeg' or cap['format'] == 'jpeg_r':
+ # openCV needs [0, 255] images
+ rgb_image = (
+ image_processing_utils.decompress_jpeg_to_rgb_image(cap['data']) * 255
+ ).astype(np.uint8)
+ yuv_image = cv2.cvtColor(rgb_image, cv2.COLOR_RGB2YUV)
+ y, _, _ = cv2.split(yuv_image)
+ # Convert back to [0, 1] and cast numpy array
+ y = (y / 255.0)
+ elif cap['format'] == 'yuv':
+ y, _, _ = image_processing_utils.convert_capture_to_planes(cap)
+ else:
+ raise ValueError(f'Unsupported format: {cap["format"]}')
img = image_processing_utils.convert_capture_to_rgb_image(cap)
if file_stem:
image_processing_utils.write_image(img, f'{file_stem}.jpg')
@@ -276,40 +288,46 @@
self.tablet.adb.shell(
f'input tap {_TAP_COORDINATES[0]} {_TAP_COORDINATES[1]}')
- # Determine capture width and height
- width, height = None, None
- capture_sizes = capture_request_utils.get_available_output_sizes(
- _FMT_NAME, props)
- extension_capture_sizes_str = cam.get_supported_extension_sizes(
- self.camera_id, _EXTENSION_NIGHT, _IMAGE_FORMAT_YUV_420_888_INT
- )
- extension_capture_sizes = [
- tuple(int(size_part) for size_part in s.split(_X_STRING))
- for s in extension_capture_sizes_str
- ]
- # Extension capture sizes are ordered in ascending area order by default
- extension_capture_sizes.reverse()
- logging.debug('Capture sizes: %s', capture_sizes)
- logging.debug('Extension capture sizes: %s', extension_capture_sizes)
- width, height = extension_capture_sizes[0]
+ # Determine capture width, height, and format
+ for format_name, format_constant in _IMAGE_FORMATS_TO_CONSTANTS:
+ capture_sizes = capture_request_utils.get_available_output_sizes(
+ format_name, props)
+ extension_capture_sizes_str = cam.get_supported_extension_sizes(
+ self.camera_id, _EXTENSION_NIGHT, format_constant
+ )
+ if not extension_capture_sizes_str:
+ continue
+ extension_capture_sizes = [
+ tuple(int(size_part) for size_part in s.split(_X_STRING))
+ for s in extension_capture_sizes_str
+ ]
+ # Extension capture sizes ordered in ascending area order by default
+ extension_capture_sizes.reverse()
+ logging.debug('Capture sizes: %s', capture_sizes)
+ logging.debug('Extension capture sizes: %s', extension_capture_sizes)
+ logging.debug('Accepted capture format: %s', format_name)
+ width, height = extension_capture_sizes[0]
+ accepted_format = format_name
+ break
+ else:
+ raise AssertionError('No supported sizes/formats found!')
# Set tablet brightness to darken scene
self.set_screen_brightness(_TABLET_BRIGHTNESS)
- file_stem = f'{test_name}_{_FMT_NAME}_{width}x{height}'
- out_surfaces = {'format': _FMT_NAME, 'width': width, 'height': height}
+ file_stem = f'{test_name}_{accepted_format}_{width}x{height}'
+ out_surfaces = {
+ 'format': accepted_format, 'width': width, 'height': height}
req = capture_request_utils.auto_capture_request()
# Take auto capture with night mode on
logging.debug('Taking auto capture with night mode ON')
- cam.do_3a()
night_capture_duration, night_cap = self._time_and_take_captures(
cam, req, out_surfaces, use_extensions=True)
night_y, night_img = _convert_captures(night_cap, f'{file_stem}_night')
# Take auto capture with night mode OFF
logging.debug('Taking auto capture with night mode OFF')
- cam.do_3a()
no_night_capture_duration, no_night_cap = self._time_and_take_captures(
cam, req, out_surfaces, use_extensions=False)
_, no_night_img = _convert_captures(
diff --git a/apps/CameraITS/utils/its_session_utils.py b/apps/CameraITS/utils/its_session_utils.py
index a131723..3d62ba5 100644
--- a/apps/CameraITS/utils/its_session_utils.py
+++ b/apps/CameraITS/utils/its_session_utils.py
@@ -843,7 +843,8 @@
if data[_TAG_STR] != 'supportedExtensionSizes':
raise error_util.CameraItsError('Invalid command response')
if not data[_STR_VALUE]:
- raise error_util.CameraItsError('No supported extensions')
+ logging.debug('No supported extension sizes')
+ return ''
return data[_STR_VALUE].split(';')
def get_display_size(self):
diff --git a/apps/CtsVerifier/AndroidManifest.xml b/apps/CtsVerifier/AndroidManifest.xml
index 47226ce..c361fe3 100644
--- a/apps/CtsVerifier/AndroidManifest.xml
+++ b/apps/CtsVerifier/AndroidManifest.xml
@@ -18,7 +18,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.cts.verifier"
android:versionCode="5"
- android:versionName="14_r3">
+ android:versionName="14_r4">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="34"/>
@@ -43,6 +43,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA"/>
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>
<uses-permission android:name="android.permission.FULLSCREEN" />
<uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" />
<uses-permission android:name="android.permission.INTERNET" />
@@ -2202,6 +2203,12 @@
</intent-filter>
</activity-alias>
+ <service
+ android:name=".net.ConnectivityForegroundService"
+ android:foregroundServiceType="dataSync"
+ android:exported="false">
+ </service>
+
<activity android:name=".net.ConnectivityBackgroundTestActivity"
android:exported="true"
android:label="@string/network_background_test">
@@ -3391,6 +3398,8 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_notifications" />
<meta-data android:name="test_required_features" android:value="android.software.secure_lock_screen" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.watch" />
<meta-data android:name="display_mode"
android:value="multi_display_mode" />
<meta-data android:name="CddTest" android:value="3.8.3/H-0-4" />
@@ -4904,7 +4913,7 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_managed_provisioning" />
<meta-data android:name="test_excluded_features"
- android:value="android.software.lockscreen_disabled" />
+ android:value="android.software.lockscreen_disabled:com.google.android.feature.AMATI_EXPERIENCE" />
<meta-data android:name="test_required_features" android:value="android.software.device_admin" />
<meta-data android:name="display_mode"
android:value="single_display_mode" />
@@ -4939,7 +4948,7 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_managed_provisioning" />
<meta-data android:name="test_excluded_features"
- android:value="android.software.lockscreen_disabled" />
+ android:value="android.software.lockscreen_disabled:com.google.android.feature.AMATI_EXPERIENCE" />
<meta-data android:name="test_required_features" android:value="android.software.device_admin" />
<meta-data android:name="display_mode"
android:value="single_display_mode" />
@@ -4972,6 +4981,7 @@
<meta-data android:name="test_required_features" android:value="android.software.device_admin" />
<meta-data android:name="display_mode"
android:value="single_display_mode" />
+ <meta-data android:name="test_excluded_features" android:value="com.google.android.feature.AMATI_EXPERIENCE" />
</activity>
<activity android:name=".managedprovisioning.NonMarketAppsActivity"
@@ -5352,12 +5362,6 @@
android:value="multi_display_mode" />
</activity>
- <activity android:name=".managedprovisioning.NfcTestActivity">
- <meta-data android:name="test_required_features" android:value="android.hardware.nfc" />
- <meta-data android:name="display_mode"
- android:value="single_display_mode" />
- </activity>
-
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.android.cts.verifier.managedprovisioning.fileprovider"
@@ -5529,6 +5533,8 @@
<meta-data android:name="test_category" android:value="@string/test_category_tunnel" />
<meta-data android:name="test_required_features"
android:value="android.software.leanback" />
+ <meta-data android:name="test_required_configs"
+ android:value="config_changeable_volume" />
<meta-data android:name="test_excluded_features"
android:value="android.hardware.type.automotive" />
<meta-data android:name="display_mode"
diff --git a/apps/CtsVerifier/jni/audio_loopback/jni-bridge.cpp b/apps/CtsVerifier/jni/audio_loopback/jni-bridge.cpp
index 1a766c0..2bba6a4 100644
--- a/apps/CtsVerifier/jni/audio_loopback/jni-bridge.cpp
+++ b/apps/CtsVerifier/jni/audio_loopback/jni-bridge.cpp
@@ -157,14 +157,14 @@
JNIEXPORT jboolean JNICALL
Java_com_android_cts_verifier_audio_audiolib_AudioUtils_isMMapSupported(JNIEnv *env __unused) {
- return oboe::AAudioExtensions().isMMapSupported();
+ return oboe::AAudioExtensions::getInstance().isMMapSupported();
}
JNIEXPORT jboolean JNICALL
Java_com_android_cts_verifier_audio_audiolib_AudioUtils_isMMapExclusiveSupported(
JNIEnv *env __unused) {
- return oboe::AAudioExtensions().isMMapExclusiveSupported();
+ return oboe::AAudioExtensions::getInstance().isMMapExclusiveSupported();
}
}
diff --git a/apps/CtsVerifier/res/layout-watch/audio_headset_audio_activity.xml b/apps/CtsVerifier/res/layout-watch/audio_headset_audio_activity.xml
index 31e8db4..39c9819 100644
--- a/apps/CtsVerifier/res/layout-watch/audio_headset_audio_activity.xml
+++ b/apps/CtsVerifier/res/layout-watch/audio_headset_audio_activity.xml
@@ -18,6 +18,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:id="@+id/scrollView"
android:padding="29dp">
<LinearLayout
@@ -44,7 +45,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
-
<Button
android:id="@+id/headset_analog_port_yes"
android:layout_width="wrap_content"
@@ -68,6 +68,10 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:id="@+id/headset_analog_device_type"/>
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
android:id="@+id/headset_analog_name"/>
<!-- Player Controls -->
@@ -132,7 +136,8 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/analog_headset_keycodes_label"/>
+ android:text="@string/analog_headset_keycodes_label"
+ android:id="@+id/headset_keycodes"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/apps/CtsVerifier/res/layout/byod_nfc_test_activity.xml b/apps/CtsVerifier/res/layout/byod_nfc_test_activity.xml
deleted file mode 100644
index 52251b4..0000000
--- a/apps/CtsVerifier/res/layout/byod_nfc_test_activity.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
- android:layout_height="match_parent" >
-
- <Button android:text="@string/provisioning_byod_send_manual_beam"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/manual_beam_button" />
-
- <Button android:text="@string/provisioning_byod_send_share_intent"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/intent_share_button"
- android:layout_below="@+id/manual_beam_button" />
-
-</RelativeLayout>
diff --git a/apps/CtsVerifier/res/layout/capture_content_for_notes.xml b/apps/CtsVerifier/res/layout/capture_content_for_notes.xml
index 623d60a..c165cff 100644
--- a/apps/CtsVerifier/res/layout/capture_content_for_notes.xml
+++ b/apps/CtsVerifier/res/layout/capture_content_for_notes.xml
@@ -33,26 +33,28 @@
<TextView
android:id="@+id/test_instructions"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/ccfn_tests_info" />
+ android:layout_height="wrap_content" />
<Button
android:id="@+id/set_default_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/set_default_notes_button_label" />
+ android:text="@string/set_default_notes_button_label"
+ android:visibility="gone" />
<Button
android:id="@+id/setup_device_owner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/setup_device_owner_button_label" />
+ android:text="@string/setup_device_owner_button_label"
+ android:visibility="gone" />
<Button
android:id="@+id/clear_device_owner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/clear_device_owner_button_label" />
+ android:text="@string/clear_device_owner_button_label"
+ android:visibility="gone" />
<ListView
android:id="@+id/android:list"
diff --git a/apps/CtsVerifier/res/layout/system_switch.xml b/apps/CtsVerifier/res/layout/system_switch.xml
new file mode 100644
index 0000000..ffcadb8
--- /dev/null
+++ b/apps/CtsVerifier/res/layout/system_switch.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2023 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.
+-->
+
+<!-- Switch button to enable verifier-system plan. -->
+<RelativeLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal" >
+ <Switch
+ android:id="@+id/system_switch_button"
+ android:text="@string/system"
+ android:textOn="@string/system_on"
+ android:textOff="@string/system_off"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true" />
+</RelativeLayout>
\ No newline at end of file
diff --git a/apps/CtsVerifier/res/layout/usi_version.xml b/apps/CtsVerifier/res/layout/usi_version.xml
index 839ff4d..0626d71 100644
--- a/apps/CtsVerifier/res/layout/usi_version.xml
+++ b/apps/CtsVerifier/res/layout/usi_version.xml
@@ -14,46 +14,51 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="bottom"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/usi_instructions_text"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:layout_marginLeft="50dp"
- android:layout_marginRight="50dp"
- android:gravity="center" />
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/RootLayoutPadding"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="100dp"
- android:layout_marginLeft="50dp"
- android:layout_marginRight="50dp"
- android:layout_marginBottom="50dp"
- android:orientation="horizontal">
+ android:orientation="vertical">
- <Button
- android:id="@+id/usi_yes_button"
- android:layout_width="0dp"
- android:layout_height="match_parent"
+ <TextView
+ android:id="@+id/usi_instructions_text"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
android:layout_weight="1"
- android:text="@string/usi_version_yes" />
+ android:gravity="center" />
- <Button
- android:id="@+id/usi_no_button"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:text="@string/usi_version_no" />
+ <LinearLayout
+ style="?android:attr/buttonBarStyle"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="30dp"
+ android:layout_marginBottom="30dp"
+ android:gravity="center_horizontal"
+ android:orientation="horizontal">
+
+ <Button
+ style="?android:attr/buttonBarButtonStyle"
+ android:id="@+id/usi_yes_button"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:text="@string/usi_version_yes" />
+
+ <Button
+ style="?android:attr/buttonBarButtonStyle"
+ android:id="@+id/usi_no_button"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:text="@string/usi_version_no" />
+
+ </LinearLayout>
+
+ <include layout="@layout/pass_fail_buttons"/>
</LinearLayout>
-
- <include layout="@layout/pass_fail_buttons"/>
-
-</LinearLayout>
+</ScrollView>
diff --git a/apps/CtsVerifier/res/menu/test_list_menu.xml b/apps/CtsVerifier/res/menu/test_list_menu.xml
index 95bfd58..70982b0 100644
--- a/apps/CtsVerifier/res/menu/test_list_menu.xml
+++ b/apps/CtsVerifier/res/menu/test_list_menu.xml
@@ -4,7 +4,12 @@
android:id="@+id/switch_item"
android:title="@string/view"
android:actionLayout="@layout/display_mode_switch"
- android:showAsAction="ifRoom" />
+ android:showAsAction="always" />
+ <item
+ android:id="@+id/system_switch_item"
+ android:title="@string/system"
+ android:actionLayout="@layout/system_switch"
+ android:showAsAction="always" />
<item android:id="@+id/clear"
android:icon="@android:drawable/ic_menu_delete"
android:title="@string/clear"
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index 6e48b5c..3cf3294 100644
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -17,7 +17,8 @@
<string name="app_name">CTS Verifier</string>
<string name="module_id">noabi CtsVerifier</string>
- <string name="title_version">CTS Verifier %1$s</string>
+ <string name="title_version">Verifier %1$s</string>
+ <string name="version_number_format">Version #: %d</string>
<string name="pass_button_text">Pass</string>
<string name="info_button_text">Info</string>
@@ -36,6 +37,9 @@
<string name="search_label">TestListActivity</string>
<string name="search_hint">Search Tests</string>
<string name="search_title">Search</string>
+ <string name="system">System</string>
+ <string name="system_on">ON</string>
+ <string name="system_off">OFF</string>
<!-- Strings for CtsReportLog warning -->
<string name="reportlog_warning_title">CTS-Verifier Report Log</string>
@@ -1238,7 +1242,7 @@
<string name="nfc_scan_tag">Place device on a writable %s tag...</string>
<string name="nfc_write_tag_title">Writable tag discovered!</string>
- <string name="nfc_write_tag_message">Press OK to write to this tag...</string>
+ <string name="nfc_write_tag_message">Press OK to write to this tag(or auto write to this tag after 3s)...</string>
<string name="nfc_scan_tag_again">Tap the same %s tag again to confirm that its contents match...</string>
<string name="nfc_wrong_tag_title">Wrong type of tag scanned</string>
<string name="nfc_no_tech">No tag technologies detected...</string>
@@ -2479,7 +2483,7 @@
with Full Screen Intents.</string>
<string name="fsi_lockscreen_without_permission_instruction">Click the \"I\'m done\" button when you are ready.\n
After clicking, lock the screen and press the power button as quickly as possible to go to the lock screen.\n
- Wait for a heads up notification to appear first in the list with a pill button.\n
+ Wait for a heads up notification to appear.\n
Unlock screen to return to this page after seeing the notification or after 5 seconds.\n
Fail the test if the notification does not appear as described.
</string>
@@ -2491,7 +2495,7 @@
</string>
<string name="fsi_screen_off_without_permission_instruction">Click the \"I\'m done\" button when you are ready.\n
After clicking, press the power button as quickly as possible to turn off the screen.\n
- Wait for a notification to appear on the screen with a pill button.\n
+ Wait for a notification to appear on the screen.\n
Unlock screen to return to this page after seeing the notification or after 5 seconds.\n
Fail the test if the notification does not appear as described.
</string>
@@ -3624,27 +3628,6 @@
<string name="provisioning_byod_cross_profile_intent_filters">Cross profile intent filters are set</string>
- <string name="provisioning_byod_nfc_beam">Disable Nfc beam</string>
- <string name="provisioning_byod_nfc_beam_allowed_instruction">
- Please press the Go button to test if Nfc beam can be triggered in the work profile.\n
- \n
- For the first test, press \"Send manual beam\" to trigger a beam, then bump into another device to send the tag. Verify that the tag is successfully received.\n
- \n
- For the second test, press \"Send share intent\" to trigger a beam, then bump into another device to send the tag. Verify that the tag is successfully received.\n
- \n
- Then use the Back button to return to this test and mark accordingly.
- </string>
- <string name="provisioning_byod_nfc_beam_disallowed_instruction">
- Please press the Go button to test if Nfc beam is disallowed by policy
- \n
- Verify that Nfc beam is not triggered when pressing the button.\n
- \n
- Then use the Back button to return to this test and mark accordingly.
- </string>
- <string name="provisioning_byod_send_manual_beam">Send manual beam</string>
- <string name="provisioning_byod_send_share_intent">Send share intent</string>
- <string name="provisioning_byod_cannot_resolve_beam_activity">Cannot find beam activity</string>
-
<string name="test_failed_cannot_start_intent">Cannot start the given intent.</string>
<string name="provisioning_byod_no_activity">Cannot communicate with activity in the work profile.</string>
<string name="provisioning_byod_delete_profile">Initiate deletion of work profile.</string>
@@ -4371,7 +4354,8 @@
\n
Tap the \"DECLINE\" button and verify that:\n
\n
- - \"Taking bugreport...\" notification with an indefinite progress bar is no longer present.\n
+ <!-- Disabled in U due to b/317738856 -->
+ <!-- \"Taking bugreport...\" notification with an indefinite progress bar is no longer present.\n -->
- Notification titled \"Device Owner Requesting Bugreport Tests\" with message \"Bugreport sharing declined\" is present.\n
\n
Dismiss the notifications and mark test as passed or failed.
@@ -4386,7 +4370,8 @@
\n
Tap the \"SHARE\" button and verify that:\n
\n
- - \"Taking bugreport...\" notification with an indefinite progress bar is no longer present.\n
+ <!-- Disabled in U due to b/317738856 -->
+ <!-- \"Taking bugreport...\" notification with an indefinite progress bar is no longer present.\n -->
- Notification titled \"Sharing bugreport...\" with an indefinite progress bar is present.\n
- After a few minutes (time necessary to wait for bugreport being collected) notification titled \"Sharing bugreport...\" is automatically dismissed and notification titled \"Device Owner Requesting Bugreport Tests\" with message \"Bugreport shared successfully\" is present.\n
\n
@@ -4401,7 +4386,8 @@
\n
Wait for a few minutes (time necessary for bugreport to be collected) and verify that:\n
\n
- - \"Taking bugreport...\" notification with an indefinite progress bar is dismissed.\n
+ <!-- Disabled in U due to b/317738856 -->
+ <!-- \"Taking bugreport...\" notification with an indefinite progress bar is no longer present.\n -->
- Notification titled \"Share bug report?\", that contains a message \"Your IT admin requested a bug report to help troubleshoot this device. Apps and data may be shared.\" and two buttons - \"DECLINE\" and \"SHARE\" is shown.\n
\n
Tap the \"DECLINE\" button and verify that:\n
@@ -4420,7 +4406,8 @@
\n
Wait for a few minutes (time necessary for bugreport to be collected) and verify that:\n
\n
- - \"Taking bugreport...\" notification with an indefinite progress bar is dismissed.\n
+ <!-- Disabled in U due to b/317738856 -->
+ <!-- \"Taking bugreport...\" notification with an indefinite progress bar is no longer present.\n -->
- Notification titled \"Share bug report?\", that contains a message \"Your IT admin requested a bug report to help troubleshoot this device. Apps and data may be shared.\" and two buttons - \"DECLINE\" and \"SHARE\" is shown.\n
\n
Tap the \"SHARE\" button and verify that:\n
@@ -7069,11 +7056,15 @@
keyboards, or styluses that are connected through USB or Bluetooth.\n\n
Found %1$d built-in display(s). Are you ready to proceed?
</string>
+ <string name="usi_test_verify_display_usi_support">Does the display \"%1$s\" support styluses
+ that use the USI protocol? \n\n
+ For more information about the Universal Stylus Initiative (USI) protocol, see:
+ http://universalstylus.org
+ </string>
<string name="usi_test_verify_display_usi_version">The display \"%1$s\" reports its USI version
as %2$s.\n\n
Is this correct?
</string>
- <string name="usi_version_not_supported">not supported</string>
<string name="usi_test_passed">Test Passed\n\n
Press Pass.
</string>
@@ -7081,7 +7072,12 @@
Reason: %1$s
</string>
<string name="usi_fail_reason_not_ready">Not ready to check for USI stylus versions.</string>
- <string name="usi_fail_reason_incorrect_version">The USI version was incorrectly reported.
+ <string name="usi_fail_reason_version_not_found">The USI version for the display was not found.
+ </string>
+ <string name="usi_fail_reason_found_unexpected_version">The display reports support for a valid
+ USI version, even though it does not support USI.
+ </string>
+ <string name="usi_fail_reason_incorrect_version">The reported USI version is incorrect.
</string>
<!-- Strings for PreferredMixerAttributesTestActivity -->
@@ -7108,9 +7104,6 @@
This test verifies the support for Content Capture For Notes APIs on devices that have the
ROLE_NOTES enabled.
- \n\nIf the ROLE_NOTES is not enabled, no test should be shown in the list below, and you
- should mark the CTS test as passed.
-
\n\nFor this test you need to install CtsDefaultNotesApp.apk and set it as the Default notes
app.
@@ -7118,6 +7111,12 @@
\n\nPlease clear the device owner after all the test cases are run, if it was set up.
</string>
+ <string name="ccfn_tests_info_skip">
+ This test verifies the support for Content Capture For Notes APIs on devices that have the
+ ROLE_NOTES enabled.
+
+ \n\nPlease mark this test as passed since ROLE_NOTES is not enabled on this device.
+ </string>
<!-- Dialogs -->
<string name="set_default_notes_button_label">Set default notes app</string>
<string name="set_default_notes_button_info">
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java b/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
index c37788d..e0c94ae 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
@@ -157,6 +157,8 @@
private static final String CONFIG_HAS_CAMERA_TOGGLE = "config_has_camera_toggle";
+ private static final String CONFIG_CHANGEABLE_VOLUME = "config_changeable_volume";
+
/**
* The config to represent that a test is only needed to run in the main display mode (i.e.
* unfolded).
@@ -184,6 +186,13 @@
*/
private static final String USER_TYPE_VISIBLE_BG_USER = "visible_background_non-profile_user";
+ /** The name of the camera ITS test of a {@link TestListItem}. */
+ private static final String CAMERA_ITS_TEST =
+ "com.android.cts.verifier.camera.its.ItsTestActivity";
+
+ /** The name of the camera ITS test (folded mode) of a {@link TestListItem}. */
+ private static final String CAMERA_ITS_TEST_FOLDED = CAMERA_ITS_TEST + "[folded]";
+
private final HashSet<String> mDisabledTests;
private Context mContext;
@@ -221,8 +230,9 @@
}
}
- if (mTestFilter != null) {
- // Filter test rows dynamically when the filter is specified.
+ if (mTestFilter != null || TestListActivity.getIsSystemEnabled()) {
+ // Filter test rows dynamically when the filter is specified or verifier-system plan is
+ // enabled.
return getRowsWithDisplayMode(sCurrentDisplayMode.toString());
} else {
return mDisplayModesTests.getOrDefault(
@@ -535,6 +545,8 @@
case CONFIG_HAS_CAMERA_TOGGLE:
return isHardwareToggleSupported(
context, SensorPrivacyManager.Sensors.CAMERA);
+ case CONFIG_CHANGEABLE_VOLUME:
+ return !getSystemResourceFlag(context, "config_useFixedVolume");
default:
break;
}
@@ -603,6 +615,20 @@
.contains(mTestFilter.toLowerCase(Locale.getDefault()));
}
+ /**
+ * Checks whether the test matches the current status of verifier-system plan.
+ *
+ * <p>When verifier-system plan is disabled, all CTS-V tests are shown.
+ *
+ * <p>When verifier-system plan is enabled, specific tests are filtered out, e.g., camera ITS.
+ */
+ private static boolean matchSystemPlanStatus(String testName) {
+ if (testName == null || !TestListActivity.getIsSystemEnabled()) {
+ return true;
+ }
+ return !testName.equals(CAMERA_ITS_TEST) && !testName.equals(CAMERA_ITS_TEST_FOLDED);
+ }
+
private boolean isVisibleBackgroundNonProfileUser() {
if (!SdkLevel.isAtLeastU()) {
Log.d(LOG_TAG, "isVisibleBagroundNonProfileUser() returning false on pre-UDC device");
@@ -656,7 +682,8 @@
&& matchAllConfigs(mContext, test.requiredConfigs)
&& matchDisplayMode(test.displayMode, mode)
&& !matchAnyExcludedUserType(test.excludedUserTypes)
- && macthTestFilter(test.title)) {
+ && macthTestFilter(test.title)
+ && matchSystemPlanStatus(test.testName)) {
if (test.applicableFeatures == null || hasAnyFeature(test.applicableFeatures)) {
// Add suffix in test name if the test is in the folded mode.
test.testName = setTestNameSuffix(mode, test.testName);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/ReportExporter.java b/apps/CtsVerifier/src/com/android/cts/verifier/ReportExporter.java
index f95393a..baa1951 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/ReportExporter.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/ReportExporter.java
@@ -50,9 +50,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-/**
- * Background task to generate a report and save it to external storage.
- */
+/** Background task to generate a report and save it to external storage. */
public class ReportExporter extends AsyncTask<Void, Void, String> {
private static final String TAG = ReportExporter.class.getSimpleName();
private static final boolean DEBUG = true;
@@ -65,7 +63,10 @@
private static final String LOG_URL = null;
private static final String REFERENCE_URL = null;
private static final String SUITE_NAME_METADATA_KEY = "SuiteName";
- private static final String SUITE_PLAN = "verifier";
+ // Default CTS-V suite_plan shown in test_result.xml.
+ private static final String DEFAULT_SUITE_PLAN = "verifier";
+ // CTS Verifier System suite_plan shown in test_result.xml.
+ private static final String SYSTEM_SUITE_PLAN = "verifier-system";
private static final String SUITE_BUILD = "0";
private static final String ZIP_EXTENSION = ".zip";
private final long START_MS = System.currentTimeMillis();
@@ -88,9 +89,10 @@
}
File reportLogFolder =
- new File(Environment.getExternalStorageDirectory().getAbsolutePath()
- + File.separator
- + LOGS_DIRECTORY);
+ new File(
+ Environment.getExternalStorageDirectory().getAbsolutePath()
+ + File.separator
+ + LOGS_DIRECTORY);
copyFilesRecursively(reportLogFolder, tempDir);
}
@@ -104,10 +106,7 @@
for (File file : files) {
Path src = Paths.get(file.getAbsolutePath());
- Path dest = Paths.get(
- destFolder.getAbsolutePath()
- + File.separator
- + file.getName());
+ Path dest = Paths.get(destFolder.getAbsolutePath() + File.separator + file.getName());
try {
Files.copy(src, dest, StandardCopyOption.REPLACE_EXISTING);
} catch (IOException ex) {
@@ -119,7 +118,6 @@
}
}
-
@Override
protected String doInBackground(Void... params) {
if (!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
@@ -148,15 +146,24 @@
copyReportFiles(tempDir);
// create a File object for a report ZIP file
- File reportZipFile = new File(
- verifierReportsDir, getReportName(suiteName) + ZIP_EXTENSION);
+ File reportZipFile = new File(verifierReportsDir, getReportName(suiteName) + ZIP_EXTENSION);
try {
// Serialize the report
String versionName = Version.getVersionName(mContext);
- ResultHandler.writeResults(suiteName, versionName, SUITE_PLAN, SUITE_BUILD,
- result, tempDir, START_MS, END_MS, REFERENCE_URL, LOG_URL,
- COMMAND_LINE_ARGS, null);
+ ResultHandler.writeResults(
+ suiteName,
+ versionName,
+ TestListActivity.getIsSystemEnabled() ? SYSTEM_SUITE_PLAN : DEFAULT_SUITE_PLAN,
+ SUITE_BUILD,
+ result,
+ tempDir,
+ START_MS,
+ END_MS,
+ REFERENCE_URL,
+ LOG_URL,
+ COMMAND_LINE_ARGS,
+ null);
// Serialize the screenshots metadata if at least one exists
if (containsScreenshotMetadata(result)) {
@@ -200,8 +207,8 @@
Log.d(TAG, "---- saveReportOnInternalStorage(" + reportZipFile.getAbsolutePath() + ")");
}
try {
- ParcelFileDescriptor pfd = ParcelFileDescriptor.open(
- reportZipFile, ParcelFileDescriptor.MODE_READ_ONLY);
+ ParcelFileDescriptor pfd =
+ ParcelFileDescriptor.open(reportZipFile, ParcelFileDescriptor.MODE_READ_ONLY);
InputStream is = new ParcelFileDescriptor.AutoCloseInputStream(pfd);
File verifierDir = mContext.getDir(REPORT_DIRECTORY, Context.MODE_PRIVATE);
@@ -223,8 +230,7 @@
for (String resultFileName : ResultHandler.RESULT_RESOURCES) {
InputStream rawStream = null;
try {
- rawStream = mContext.getAssets().open(
- String.format("report/%s", resultFileName));
+ rawStream = mContext.getAssets().open(String.format("report/%s", resultFileName));
} catch (IOException e) {
LOG.log(Level.WARNING, "Failed to load " + resultFileName + " from assets.");
}
@@ -242,7 +248,8 @@
private String getReportName(String suiteName) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd_HH.mm.ss", Locale.ENGLISH);
String date = dateFormat.format(new Date());
- return String.format("%s-%s-%s-%s-%s-%s",
+ return String.format(
+ "%s-%s-%s-%s-%s-%s",
date, suiteName, Build.MANUFACTURER, Build.PRODUCT, Build.DEVICE, Build.ID);
}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/TestListActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/TestListActivity.java
index 790bf73..c269a91 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/TestListActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/TestListActivity.java
@@ -55,6 +55,11 @@
// Default is unfolded mode, and it will be changed when clicking the switch button.
public static volatile String sCurrentDisplayMode = DisplayMode.UNFOLDED.toString();
+ // Whether the verifier-system plan is enabled.
+ private static boolean sIsSystemEnabled = false;
+ // Whether the system switch has been toggled.
+ private static boolean sHasSystemToggled = false;
+
private String[] mRequestedPermissions;
// Enumerates the display modes, including unfolded and folded.
@@ -124,31 +129,6 @@
}
}
- private void createContinue() {
- if (!isTaskRoot()) {
- finish();
- }
-
- // Restores the last display mode when launching the app after killing the process.
- if (getCurrentDisplayMode().equals(DisplayMode.FOLDED.toString())) {
- sCurrentDisplayMode = DisplayMode.FOLDED.toString();
- }
-
- setTitle(getString(R.string.title_version, Version.getVersionName(this)));
-
- if (!getWindow().hasFeature(Window.FEATURE_ACTION_BAR)) {
- View footer = getLayoutInflater().inflate(R.layout.test_list_footer, null);
-
- footer.findViewById(R.id.clear).setOnClickListener(this);
- footer.findViewById(R.id.export).setOnClickListener(this);
-
- getListView().addFooterView(footer);
- }
-
- setTestListAdapter(
- new ManifestTestListAdapter(/* context= */ this, /* testParent= */ null));
- }
-
@Override
public void onRequestPermissionsResult(
int requestCode, String permissions[], int[] grantResults) {
@@ -175,25 +155,6 @@
}
}
- private AlertDialog sendUserToSettings() {
- return new AlertDialog.Builder(this)
- .setTitle("Please grant all permissions")
- .setPositiveButton(
- "Ok",
- (dialog, which) -> {
- if (which == AlertDialog.BUTTON_POSITIVE) {
- startActivity(
- new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
- .setData(
- Uri.fromParts(
- "package",
- getPackageName(),
- null)));
- }
- })
- .show();
- }
-
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
@@ -221,6 +182,29 @@
}
});
+ // Switch button for verifier-system plan.
+ item = (MenuItem) menu.findItem(R.id.system_switch_item);
+ if (item != null) {
+ item.setActionView(R.layout.system_switch);
+ final Switch systemSwitch = item.getActionView().findViewById(
+ R.id.system_switch_button);
+
+ systemSwitch.setChecked(sIsSystemEnabled);
+ systemSwitch.setOnCheckedChangeListener(
+ new CompoundButton.OnCheckedChangeListener() {
+
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ if (!sHasSystemToggled && isChecked) {
+ sHasSystemToggled = true;
+ notifyUserSystemPlan(systemSwitch);
+ } else {
+ updateIsSystemEnabled(isChecked);
+ }
+ }
+ });
+ }
+
SearchView searchView = (SearchView) menu.findItem(R.id.search_test).getActionView();
searchView.setOnQueryTextListener(
new SearchView.OnQueryTextListener() {
@@ -250,6 +234,129 @@
return handleMenuItemSelected(item.getItemId()) ? true : super.onOptionsItemSelected(item);
}
+ /** Gets the verifier-system plan enabled status. */
+ static boolean getIsSystemEnabled() {
+ return sIsSystemEnabled;
+ }
+
+ /** Checks if a list of int array contains a given int value. */
+ private static boolean arrayContains(int[] array, int value) {
+ if (array == null) {
+ return false;
+ }
+ for (int element : array) {
+ if (element == value) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /** Removes the first occurrence of a string from a given string array. */
+ private static String[] removeString(String[] cur, String val) {
+ if (cur == null) {
+ return null;
+ }
+ final int n = cur.length;
+ for (int i = 0; i < n; i++) {
+ if (Objects.equals(cur[i], val)) {
+ String[] ret = new String[n - 1];
+ if (i > 0) {
+ System.arraycopy(cur, 0, ret, 0, i);
+ }
+ if (i < (n - 1)) {
+ System.arraycopy(cur, i + 1, ret, i, n - i - 1);
+ }
+ return ret;
+ }
+ }
+ return cur;
+ }
+
+ private void createContinue() {
+ if (!isTaskRoot()) {
+ finish();
+ }
+
+ // Restores the last display mode when launching the app after killing the process.
+ if (getCurrentDisplayMode().equals(DisplayMode.FOLDED.toString())) {
+ sCurrentDisplayMode = DisplayMode.FOLDED.toString();
+ }
+
+ setTitle(getString(R.string.title_version, Version.getVersionName(this)));
+
+ if (!getWindow().hasFeature(Window.FEATURE_ACTION_BAR)) {
+ View footer = getLayoutInflater().inflate(R.layout.test_list_footer, null);
+
+ footer.findViewById(R.id.clear).setOnClickListener(this);
+ footer.findViewById(R.id.export).setOnClickListener(this);
+
+ getListView().addFooterView(footer);
+ }
+
+ setTestListAdapter(
+ new ManifestTestListAdapter(/* context= */ this, /* testParent= */ null));
+ }
+
+ private AlertDialog sendUserToSettings() {
+ return new AlertDialog.Builder(this)
+ .setTitle("Please grant all permissions")
+ .setPositiveButton(
+ "Ok",
+ (dialog, which) -> {
+ if (which == AlertDialog.BUTTON_POSITIVE) {
+ startActivity(
+ new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
+ .setData(
+ Uri.fromParts(
+ "package",
+ getPackageName(),
+ null)));
+ }
+ })
+ .show();
+ }
+
+ /** Notifies the user about the verifier-system plan. */
+ private AlertDialog notifyUserSystemPlan(Switch systemSwitch) {
+ return new AlertDialog.Builder(this)
+ .setTitle("Verifier System Plan")
+ .setMessage(
+ "This is a feature to execute verifier tests for the system layer"
+ + " partitions. Click \"Yes\" to proceed or \"No\" to run all of the"
+ + " verifier tests.")
+ .setPositiveButton(
+ "Yes",
+ new DialogInterface.OnClickListener() {
+
+ public void onClick(DialogInterface dialog, int whichButton) {
+ updateIsSystemEnabled(true);
+ }
+ })
+ .setNegativeButton(
+ "No",
+ new DialogInterface.OnClickListener() {
+
+ public void onClick(DialogInterface dialog, int whichButton) {
+ systemSwitch.setChecked(false);
+ }
+ })
+ .show();
+ }
+
+ /** Updates the verifier-system plan enabled status and refreshes the test list. */
+ private void updateIsSystemEnabled(boolean isChecked) {
+ Log.i(TAG, "verifier-system plan enabled: " + isChecked);
+ sIsSystemEnabled = isChecked;
+ handleSwitchItemSelected();
+ }
+
+ /** Sets up the flags after switching display mode and reloads tests on UI. */
+ private void handleSwitchItemSelected() {
+ setCurrentDisplayMode(sCurrentDisplayMode);
+ mAdapter.loadTestResults();
+ }
+
private void handleClearItemSelected() {
new AlertDialog.Builder(this)
.setMessage(R.string.test_results_clear_title)
@@ -273,12 +380,6 @@
new ReportExporter(this, mAdapter).execute();
}
- /** Sets up the flags after switching display mode and reloads tests on UI. */
- private void handleSwitchItemSelected() {
- setCurrentDisplayMode(sCurrentDisplayMode);
- mAdapter.loadTestResults();
- }
-
private boolean handleMenuItemSelected(int id) {
if (id == R.id.clear) {
handleClearItemSelected();
@@ -323,34 +424,4 @@
.getString(DisplayMode.class.getName(), "");
return mode;
}
-
- private static boolean arrayContains(int[] array, int value) {
- if (array == null) return false;
- for (int element : array) {
- if (element == value) {
- return true;
- }
- }
- return false;
- }
-
- private static String[] removeString(String[] cur, String val) {
- if (cur == null) {
- return null;
- }
- final int n = cur.length;
- for (int i = 0; i < n; i++) {
- if (Objects.equals(cur[i], val)) {
- String[] ret = new String[n - 1];
- if (i > 0) {
- System.arraycopy(cur, 0, ret, 0, i);
- }
- if (i < (n - 1)) {
- System.arraycopy(cur, i + 1, ret, i, n - i - 1);
- }
- return ret;
- }
- }
- return cur;
- }
}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleSecureClientTestListActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleSecureClientTestListActivity.java
index cde35be..7333eff 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleSecureClientTestListActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleSecureClientTestListActivity.java
@@ -52,10 +52,11 @@
"com.android.cts.verifier.bluetooth.BleAdvertiserHardwareScanFilterActivity.");
}
- // RPA is optional on TVs already released before Android 11
+ // RPA is optional on TVs and Cars already released before Android 11
boolean isTv = getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK);
+ boolean isCar = getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE);
int firstSdk = SystemProperties.getInt("ro.product.first_api_level", 0);
- if (isTv && (firstSdk <= Build.VERSION_CODES.Q)) {
+ if ((isTv || isCar) && (firstSdk <= Build.VERSION_CODES.Q)) {
disabledTest.add(
"com.android.cts.verifier.bluetooth.BleSecureConnectionPriorityClientTestActivity");
disabledTest.add(
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsService.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsService.java
index c403893..1528386 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsService.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsService.java
@@ -166,6 +166,7 @@
// State transition timeouts, in ms.
private static final long TIMEOUT_IDLE_MS = 2000;
+ private static final long TIMEOUT_IDLE_MS_EXTENSIONS = 20000;
private static final long TIMEOUT_STATE_MS = 500;
private static final long TIMEOUT_SESSION_CLOSE = 3000;
@@ -2990,7 +2991,7 @@
sessionListener,
has10bitOutput);
- mExtensionSession = sessionListener.waitAndGetSession(TIMEOUT_IDLE_MS);
+ mExtensionSession = sessionListener.waitAndGetSession(TIMEOUT_IDLE_MS_EXTENSIONS);
CaptureRequest.Builder captureBuilder = requests.get(0);
@@ -3000,19 +3001,22 @@
}
// Set repeating request and wait for AE convergence, using another ImageReader.
Logt.i(TAG, "Waiting for AE to converge before taking extensions capture.");
- captureBuilder.addTarget(mExtensionPreviewImageReader.getSurface());
+ CaptureRequest.Builder previewRequestBuilder = mCamera.createCaptureRequest(
+ CameraDevice.TEMPLATE_PREVIEW);
+ previewRequestBuilder.set(CaptureRequest.CONTROL_CAPTURE_INTENT,
+ CaptureRequest.CONTROL_CAPTURE_INTENT_PREVIEW);
+ previewRequestBuilder.addTarget(mExtensionPreviewImageReader.getSurface());
ImageReader.OnImageAvailableListener dropperListener =
createAvailableListenerDropper();
mExtensionPreviewImageReader.setOnImageAvailableListener(dropperListener,
mSaveHandlers[0]);
- mExtensionSession.setRepeatingRequest(captureBuilder.build(),
+ mExtensionSession.setRepeatingRequest(previewRequestBuilder.build(),
new HandlerExecutor(mResultHandler),
mExtAEResultListener);
mCountCallbacksRemaining.set(1);
long timeout = TIMEOUT_CALLBACK * 1000;
waitForCallbacks(timeout);
mExtensionSession.stopRepeating();
- captureBuilder.removeTarget(mExtensionPreviewImageReader.getSurface());
mResultThread.sleep(PIPELINE_WARMUP_TIME_MS);
}
@@ -3904,8 +3908,9 @@
if (request == null || result == null) {
throw new ItsException("Request/result is invalid");
}
- if (result.get(CaptureResult.CONTROL_AE_STATE) ==
- CaptureResult.CONTROL_AE_STATE_CONVERGED) {
+ int aeState = result.get(CaptureResult.CONTROL_AE_STATE);
+ if (aeState == CaptureResult.CONTROL_AE_STATE_CONVERGED
+ || aeState == CaptureResult.CONTROL_AE_STATE_FLASH_REQUIRED) {
synchronized(mCountCallbacksRemaining) {
mCountCallbacksRemaining.decrementAndGet();
mCountCallbacksRemaining.notify();
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/capturecontentfornotes/CaptureContentForNotesVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/capturecontentfornotes/CaptureContentForNotesVerifierActivity.java
index f05c636..84d3097 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/capturecontentfornotes/CaptureContentForNotesVerifierActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/capturecontentfornotes/CaptureContentForNotesVerifierActivity.java
@@ -31,6 +31,7 @@
import android.util.Log;
import android.view.View;
import android.widget.Button;
+import android.widget.TextView;
import androidx.annotation.Nullable;
@@ -123,7 +124,6 @@
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.capture_content_for_notes);
- setInfoResources(R.string.ccfn_tests, R.string.ccfn_tests_info, 0);
setPassFailButtonClickListeners();
ArrayTestListAdapter adapter = new ArrayTestListAdapter(this);
@@ -135,23 +135,37 @@
}
});
+ TextView testInstructionsView = findViewById(R.id.test_instructions);
+
if (isNotesRoleAvailable()) {
// If the notes role is available, disable the pass button and setup tests.
getPassButton().setEnabled(false);
addTestsToAdapter(adapter);
+
+ // Set up test info resources to ask user to go through the test cases.
+ setInfoResources(R.string.ccfn_tests, R.string.ccfn_tests_info, 0);
+ testInstructionsView.setText(R.string.ccfn_tests_info);
+
+ // Add these buttons only if the Notes role is available to avoid confusion.
+ Button setDefaultNotesButton = findViewById(R.id.set_default_notes);
+ setDefaultNotesButton.setOnClickListener(this);
+ setDefaultNotesButton.setVisibility(View.VISIBLE);
+
+ Button setupDeviceOwner = findViewById(R.id.setup_device_owner);
+ setupDeviceOwner.setOnClickListener(this);
+ setupDeviceOwner.setVisibility(View.VISIBLE);
+
+ Button clearDeviceOwner = findViewById(R.id.clear_device_owner);
+ clearDeviceOwner.setOnClickListener(this);
+ clearDeviceOwner.setVisibility(View.VISIBLE);
} else {
// Notes role is unavailable, let the verifier skip this test altogether.
getPassButton().setEnabled(true);
+
+ // Set up test info resources to ask user to skip the test.
+ setInfoResources(R.string.ccfn_tests, R.string.ccfn_tests_info_skip, 0);
+ testInstructionsView.setText(R.string.ccfn_tests_info_skip);
}
-
- Button setDefaultNotesButton = findViewById(R.id.set_default_notes);
- setDefaultNotesButton.setOnClickListener(this);
-
- Button setupDeviceOwner = findViewById(R.id.setup_device_owner);
- setupDeviceOwner.setOnClickListener(this);
-
- Button clearDeviceOwner = findViewById(R.id.clear_device_owner);
- clearDeviceOwner.setOnClickListener(this);
}
@Override
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureUtil.java b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureUtil.java
index 53f23a8..7ba284e 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureUtil.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureUtil.java
@@ -223,4 +223,12 @@
public static boolean isKeyguardShownWhenUserDoesntHaveCredentials(Context context) {
return !isAutomotive(context) && !isWatch(context);
}
+
+ /**
+ * Checks whether the device supports camera.
+ */
+ public static boolean supportCameraFeature(Context context) {
+ PackageManager pm = context.getPackageManager();
+ return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY);
+ }
}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/input/UsiVersionActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/input/UsiVersionActivity.java
index e9b15e8..9662aec 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/input/UsiVersionActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/input/UsiVersionActivity.java
@@ -20,6 +20,7 @@
import android.hardware.input.HostUsiVersion;
import android.hardware.input.InputManager;
import android.os.Bundle;
+import android.util.ArrayMap;
import android.view.Display;
import android.widget.Button;
import android.widget.TextView;
@@ -28,8 +29,6 @@
import com.android.cts.verifier.PassFailButtons;
import com.android.cts.verifier.R;
-import java.util.ArrayList;
-import java.util.List;
import java.util.Objects;
/**
@@ -45,7 +44,7 @@
Button mNoButton;
TestStage mCurrentStage;
- final List<Display> mInternalDisplays = new ArrayList<>();
+ final ArrayMap<Display, HostUsiVersion> mInternalDisplays = new ArrayMap<>();
/** Used for {@link TestStage#VERIFY_USI_VERSIONS}. */
int mCurrentDisplayIndex;
@@ -55,8 +54,10 @@
private enum TestStage {
// Ask whether the tester is ready to start.
START_INSTRUCTIONS,
- // Ask if the USI version reported for each of the built-in displays is correct.
- VERIFY_USI_VERSIONS,
+ // Ask if the current display supports USI.
+ VERIFY_USI_SUPPORT,
+ // If the current display does support USI, ask if the reported USI version is correct.
+ VERIFY_USI_VERSION,
// Test passed.
PASSED,
// Test failed.
@@ -85,16 +86,39 @@
switch (mCurrentStage) {
case START_INSTRUCTIONS:
mCurrentStage = fromYesButton
- ? TestStage.VERIFY_USI_VERSIONS
+ ? TestStage.VERIFY_USI_SUPPORT
: getFailState(R.string.usi_fail_reason_not_ready);
break;
- case VERIFY_USI_VERSIONS:
+ case VERIFY_USI_SUPPORT:
+ final var usiVersion = mInternalDisplays.valueAt(mCurrentDisplayIndex);
+ if (fromYesButton) {
+ // The user said that the display supports USI.
+ if (usiVersion != null) {
+ mCurrentStage = TestStage.VERIFY_USI_VERSION;
+ } else {
+ mCurrentStage = getFailState(R.string.usi_fail_reason_version_not_found);
+ }
+ } else {
+ // The user said that the display DOES NOT support USI.
+ if (usiVersion == null) {
+ mCurrentDisplayIndex++;
+ mCurrentStage = mCurrentDisplayIndex >= mInternalDisplays.size()
+ ? TestStage.PASSED
+ : TestStage.VERIFY_USI_SUPPORT;
+ } else {
+ mCurrentStage = getFailState(
+ R.string.usi_fail_reason_found_unexpected_version);
+ }
+ }
+ break;
+
+ case VERIFY_USI_VERSION:
if (fromYesButton) {
mCurrentDisplayIndex++;
mCurrentStage = mCurrentDisplayIndex >= mInternalDisplays.size()
? TestStage.PASSED
- : TestStage.VERIFY_USI_VERSIONS;
+ : TestStage.VERIFY_USI_SUPPORT;
} else {
mCurrentStage = getFailState(R.string.usi_fail_reason_incorrect_version);
}
@@ -115,7 +139,7 @@
private void processTestStage() {
switch (mCurrentStage) {
- case START_INSTRUCTIONS:
+ case START_INSTRUCTIONS: {
mFailReason = null;
mCurrentDisplayIndex = 0;
populateInternalDisplays();
@@ -125,44 +149,55 @@
mYesButton.setEnabled(true);
mNoButton.setEnabled(true);
break;
+ }
- case VERIFY_USI_VERSIONS:
- final Display display = mInternalDisplays.get(mCurrentDisplayIndex);
- final HostUsiVersion usiVersion =
- Objects.requireNonNull(getSystemService(InputManager.class))
- .getHostUsiVersion(display);
- final String version = usiVersion != null
- ? usiVersion.getMajorVersion() + "." + usiVersion.getMinorVersion()
- : getString(R.string.usi_version_not_supported);
+ case VERIFY_USI_SUPPORT: {
+ final Display display = mInternalDisplays.keyAt(mCurrentDisplayIndex);
+ mInstructionsTextView.setText(
+ getString(R.string.usi_test_verify_display_usi_support, display.getName()));
+ break;
+ }
+
+ case VERIFY_USI_VERSION: {
+ final Display display = mInternalDisplays.keyAt(mCurrentDisplayIndex);
+ final HostUsiVersion usiVersion = mInternalDisplays.valueAt(mCurrentDisplayIndex);
+ assert (usiVersion != null);
+
+ final String version =
+ usiVersion.getMajorVersion() + "." + usiVersion.getMinorVersion();
mInstructionsTextView.setText(
getString(R.string.usi_test_verify_display_usi_version, display.getName(),
version));
break;
+ }
- case PASSED:
+ case PASSED: {
if (mFailReason != null) throw new IllegalStateException("Fail reason is non null");
mInstructionsTextView.setText(getString(R.string.usi_test_passed));
getPassButton().setEnabled(true);
mYesButton.setEnabled(false);
mNoButton.setEnabled(false);
break;
+ }
- case FAILED:
+ case FAILED: {
Objects.requireNonNull(mFailReason);
mInstructionsTextView.setText(getString(R.string.usi_test_failed, mFailReason));
getPassButton().setEnabled(false);
mYesButton.setEnabled(false);
mNoButton.setEnabled(false);
break;
+ }
}
}
private void populateInternalDisplays() {
final Display[] displays = Objects.requireNonNull(getSystemService(DisplayManager.class))
.getDisplays();
+ final var inputManager = Objects.requireNonNull(getSystemService(InputManager.class));
for (Display display : displays) {
if (display.getType() == Display.TYPE_INTERNAL) {
- mInternalDisplays.add(display);
+ mInternalDisplays.put(display, inputManager.getHostUsiVersion(display));
}
}
}
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 17f4ded..09280ad 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodFlowTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodFlowTestActivity.java
@@ -106,7 +106,6 @@
private DialogTestListItem mCrossProfileVideoCaptureWithoutExtraOutputSupportTest;
private DialogTestListItem mCrossProfileAudioCaptureSupportTest;
private TestListItem mKeyguardDisabledFeaturesTest;
- private DialogTestListItem mDisableNfcBeamTest;
private TestListItem mAuthenticationBoundKeyTest;
private TestListItem mEnableLocationModeTest;
private TestListItem mDisableLocationModeThroughMainSwitchTest;
@@ -614,39 +613,6 @@
.show();
}
- if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC)
- && getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC_BEAM)) {
- mDisableNfcBeamTest = new DialogTestListItem(this, R.string.provisioning_byod_nfc_beam,
- "BYOD_DisableNfcBeamTest",
- R.string.provisioning_byod_nfc_beam_allowed_instruction,
- new Intent(ByodHelperActivity.ACTION_TEST_NFC_BEAM)) {
- @Override
- public void performTest(final DialogTestListActivity activity) {
- activity.showManualTestDialog(mDisableNfcBeamTest,
- new DefaultTestCallback(mDisableNfcBeamTest) {
- @Override
- public void onPass() {
- // Start a second test with beam disallowed by policy.
- Intent testNfcBeamIntent = new Intent(
- ByodHelperActivity.ACTION_TEST_NFC_BEAM);
- testNfcBeamIntent.putExtra(NfcTestActivity.EXTRA_DISALLOW_BY_POLICY,
- true);
- DialogTestListItem disableNfcBeamTest2 =
- new DialogTestListItem(activity,
- R.string.provisioning_byod_nfc_beam,
- "BYOD_DisableNfcBeamTest",
- R.string.provisioning_byod_nfc_beam_disallowed_instruction,
- testNfcBeamIntent);
- // The result should be reflected on the original test.
- activity.showManualTestDialog(disableNfcBeamTest2,
- new DefaultTestCallback(mDisableNfcBeamTest));
- }
- });
- }
- };
- adapter.add(mDisableNfcBeamTest);
- }
-
adapter.add(mKeyChainTest);
/* If there is an application that handles RECORD_SOUND_ACTION, test that it handles it
@@ -912,4 +878,4 @@
private static SharedPreferences getProvisioningPreferences(Context context) {
return context.getSharedPreferences(PROVISIONING_PREFERENCES, MODE_PRIVATE);
}
-}
\ No newline at end of file
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodHelperActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodHelperActivity.java
index cf32cb7..416d0c7 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodHelperActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodHelperActivity.java
@@ -83,7 +83,6 @@
"com.android.cts.verifier.managedprovisioning.BYOD_KEYGUARD_DISABLED_FEATURES";
public static final String ACTION_LOCKNOW =
"com.android.cts.verifier.managedprovisioning.BYOD_LOCKNOW";
- public static final String ACTION_TEST_NFC_BEAM = "com.android.cts.verifier.managedprovisioning.TEST_NFC_BEAM";
public static final String EXTRA_PROVISIONED = "extra_provisioned";
public static final String EXTRA_PARAMETER_1 = "extra_parameter_1";
@@ -335,12 +334,6 @@
} else if (ACTION_LOCKNOW.equals(action)) {
mDevicePolicyManager.lockNow();
setResult(RESULT_OK);
- } else if (action.equals(ACTION_TEST_NFC_BEAM)) {
- Intent testNfcBeamIntent = new Intent(this, NfcTestActivity.class);
- testNfcBeamIntent.putExtras(intent);
- startActivity(testNfcBeamIntent);
- finish();
- return;
} else if (action.equals(ACTION_TEST_CROSS_PROFILE_INTENTS_DIALOG)) {
sendIntentInsideChooser(new Intent(
CrossProfileTestActivity.ACTION_CROSS_PROFILE_TO_PERSONAL));
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceAdminTestReceiver.java b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceAdminTestReceiver.java
index ef216b6..38036f4 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceAdminTestReceiver.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/DeviceAdminTestReceiver.java
@@ -199,7 +199,6 @@
filter.addAction(ByodHelperActivity.ACTION_CAPTURE_AND_CHECK_AUDIO);
filter.addAction(ByodHelperActivity.ACTION_KEYGUARD_DISABLED_FEATURES);
filter.addAction(ByodHelperActivity.ACTION_LOCKNOW);
- filter.addAction(ByodHelperActivity.ACTION_TEST_NFC_BEAM);
filter.addAction(ByodHelperActivity.ACTION_TEST_CROSS_PROFILE_INTENTS_DIALOG);
filter.addAction(ByodHelperActivity.ACTION_TEST_APP_LINKING_DIALOG);
filter.addAction(ByodHelperActivity.ACTION_NOTIFICATION);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/EnterprisePrivacyTestListActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/EnterprisePrivacyTestListActivity.java
index 66e3d91..902a6b0 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/EnterprisePrivacyTestListActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/EnterprisePrivacyTestListActivity.java
@@ -170,10 +170,12 @@
R.string.enterprise_privacy_admin_granted_microphone_access,
R.string.enterprise_privacy_admin_granted_microphone_access_info,
Manifest.permission.RECORD_AUDIO));
- adapter.add(buildAdminGrantedPermissionTest(ENTERPRISE_PRIVACY_CAMERA_ACCESS,
- R.string.enterprise_privacy_admin_granted_camera_access,
- R.string.enterprise_privacy_admin_granted_camera_access_info,
- Manifest.permission.CAMERA));
+ if (FeatureUtil.supportCameraFeature(this)) {
+ adapter.add(buildAdminGrantedPermissionTest(ENTERPRISE_PRIVACY_CAMERA_ACCESS,
+ R.string.enterprise_privacy_admin_granted_camera_access,
+ R.string.enterprise_privacy_admin_granted_camera_access_info,
+ Manifest.permission.CAMERA));
+ }
adapter.add(createInteractiveTestItem(this, ENTERPRISE_PRIVACY_DEFAULT_APPS,
R.string.enterprise_privacy_default_apps,
R.string.enterprise_privacy_default_apps_info,
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/NfcTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/NfcTestActivity.java
deleted file mode 100755
index c27ffd1..0000000
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/NfcTestActivity.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2015 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.verifier.managedprovisioning;
-
-import android.app.Activity;
-import android.app.admin.DevicePolicyManager;
-import android.content.ActivityNotFoundException;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.nfc.NdefMessage;
-import android.nfc.NdefRecord;
-import android.nfc.NfcAdapter;
-import android.os.Bundle;
-import android.os.UserManager;
-import android.util.Log;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Toast;
-
-import com.android.cts.verifier.R;
-
-import java.nio.charset.Charset;
-
-public class NfcTestActivity extends Activity {
- private static final String TAG = "NfcTestActivity";
-
- /* package */ static final String EXTRA_DISALLOW_BY_POLICY = "disallowByPolicy";
-
- private static final String NFC_BEAM_PACKAGE = "com.android.nfc";
- private static final String NFC_BEAM_ACTIVITY = "com.android.nfc.BeamShareActivity";
- private static final String SAMPLE_TEXT = "sample text";
-
- private ComponentName mAdminReceiverComponent;
- private DevicePolicyManager mDevicePolicyManager;
- private UserManager mUserMangaer;
- private NfcAdapter mNfcAdapter;
- private boolean mDisallowByPolicy;
- private boolean mAddUserRestrictionOnFinish;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.byod_nfc_test_activity);
-
- mAdminReceiverComponent = new ComponentName(this, DeviceAdminTestReceiver.class.getName());
- mDevicePolicyManager = (DevicePolicyManager) getSystemService(
- Context.DEVICE_POLICY_SERVICE);
- mUserMangaer = (UserManager) getSystemService(Context.USER_SERVICE);
- mAddUserRestrictionOnFinish = mUserMangaer.hasUserRestriction(
- UserManager.DISALLOW_OUTGOING_BEAM);
- mDisallowByPolicy = getIntent().getBooleanExtra(EXTRA_DISALLOW_BY_POLICY, false);
- if (mDisallowByPolicy) {
- mDevicePolicyManager.addUserRestriction(mAdminReceiverComponent,
- UserManager.DISALLOW_OUTGOING_BEAM);
- } else {
- mDevicePolicyManager.clearUserRestriction(mAdminReceiverComponent,
- UserManager.DISALLOW_OUTGOING_BEAM);
- }
-
- mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
- mNfcAdapter.setNdefPushMessage(getTestMessage(), this);
-
- final Intent shareIntent = new Intent(Intent.ACTION_SEND);
- shareIntent.putExtra(Intent.EXTRA_TEXT, SAMPLE_TEXT);
- shareIntent.setType("text/plain");
-
- findViewById(R.id.manual_beam_button).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View view) {
- mNfcAdapter.invokeBeam(NfcTestActivity.this);
- }
- });
- findViewById(R.id.intent_share_button).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View view) {
- // Specify the package name of NfcBeamActivity so that the tester don't need to
- // select the activity manually.
- shareIntent.setClassName(NFC_BEAM_PACKAGE, NFC_BEAM_ACTIVITY);
- try {
- startActivity(shareIntent);
- } catch (ActivityNotFoundException e) {
- Toast.makeText(NfcTestActivity.this,
- R.string.provisioning_byod_cannot_resolve_beam_activity,
- Toast.LENGTH_SHORT).show();
- Log.e(TAG, "Nfc beam activity not found", e);
- }
- }
- });
- }
-
- @Override
- public void finish() {
- if (mAddUserRestrictionOnFinish) {
- mDevicePolicyManager.addUserRestriction(mAdminReceiverComponent,
- UserManager.DISALLOW_OUTGOING_BEAM);
- } else {
- mDevicePolicyManager.clearUserRestriction(mAdminReceiverComponent,
- UserManager.DISALLOW_OUTGOING_BEAM);
- }
- super.finish();
- }
-
- private NdefMessage getTestMessage() {
- byte[] mimeBytes = "application/com.android.cts.verifier.managedprovisioning"
- .getBytes(Charset.forName("US-ASCII"));
- byte[] id = new byte[] {1, 3, 3, 7};
- byte[] payload = SAMPLE_TEXT.getBytes(Charset.forName("US-ASCII"));
- return new NdefMessage(new NdefRecord[] {
- new NdefRecord(NdefRecord.TNF_MIME_MEDIA, mimeBytes, id, payload)
- });
- }
-}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/PolicyTransparencyTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/PolicyTransparencyTestActivity.java
index ae4b014..da4c5b3 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/PolicyTransparencyTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/PolicyTransparencyTestActivity.java
@@ -78,10 +78,13 @@
private static final Map<String, PolicyTestItem> POLICY_TEST_ITEMS = new ArrayMap<>();
/**
- * List of restrictions that might not have an optional for user to change on Settings.
+ * List of restrictions that might not have an option for user to change on Settings.
*/
private static final List<String> OPTIONAL_USER_RESTRICTION_ACTIONS = Arrays
- .asList(UserManager.DISALLOW_CONFIG_CELL_BROADCASTS);
+ .asList(
+ UserManager.DISALLOW_CONFIG_CELL_BROADCASTS,
+ UserManager.DISALLOW_NETWORK_RESET,
+ UserManager.DISALLOW_CONFIG_TETHERING);
static {
POLICY_TEST_ITEMS.put(TEST_CHECK_AUTO_TIME_REQUIRED, new PolicyTestItem(
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityBackgroundTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityBackgroundTestActivity.java
index 57da095..0b7b5a6 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityBackgroundTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityBackgroundTestActivity.java
@@ -16,8 +16,8 @@
package com.android.cts.verifier.net;
-import com.android.cts.verifier.PassFailButtons;
-import com.android.cts.verifier.R;
+import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
+import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -42,20 +42,20 @@
import android.widget.ScrollView;
import android.widget.TextView;
+import com.android.cts.verifier.PassFailButtons;
+import com.android.cts.verifier.R;
+
import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.io.IOException;
+import java.io.InputStreamReader;
import java.lang.reflect.Field;
+import java.net.HttpURLConnection;
import java.net.Inet6Address;
import java.net.InetAddress;
-import java.net.HttpURLConnection;
-import java.net.UnknownHostException;
import java.net.URL;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.net.UnknownHostException;
import java.util.Random;
-
-import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
-import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
+import java.util.concurrent.atomic.AtomicBoolean;
/**
* A CTS Verifier test case for testing IPv6 network background connectivity.
@@ -119,6 +119,8 @@
super.onCreate(savedInstanceState);
configureFromSystemServices();
setupUserInterface();
+ // start foreground service to avoid being frozen (b/284060686)
+ startForegroundService(new Intent(this, ConnectivityForegroundService.class));
}
@Override
@@ -127,6 +129,7 @@
stopAnyExistingTestingThread();
unregisterReceiver(mReceiver);
mWakeLock.release();
+ stopService(new Intent(this, ConnectivityForegroundService.class));
super.onDestroy();
}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityForegroundService.java b/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityForegroundService.java
new file mode 100644
index 0000000..7cd1da8
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityForegroundService.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2024 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.verifier.net;
+
+import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.app.Service;
+import android.content.Intent;
+import android.os.IBinder;
+
+import androidx.annotation.Nullable;
+
+/**
+ * Foreground service to avoid CtsVerifier is being frozen while ConnectivityBackgroundTestActivity
+ * is running background connectivity check
+ */
+public class ConnectivityForegroundService extends Service {
+ public static final String TAG = "ConnectivityForegroundService";
+ private static final String NOTIFICATION_CHANNEL_ID = "ctsVerifier/" + TAG;
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ NotificationManager notificationManager = getSystemService(NotificationManager.class);
+ notificationManager.createNotificationChannel(
+ new NotificationChannel(
+ NOTIFICATION_CHANNEL_ID,
+ NOTIFICATION_CHANNEL_ID,
+ NotificationManager.IMPORTANCE_DEFAULT));
+ Notification notification =
+ new Notification.Builder(getApplicationContext(), NOTIFICATION_CHANNEL_ID).build();
+ startForeground(1 /* id */, notification);
+
+ return START_NOT_STICKY;
+ }
+
+ @Nullable
+ @Override
+ public IBinder onBind(Intent intent) {
+ return null;
+ }
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/TagVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/TagVerifierActivity.java
index faee902..07b7821 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/TagVerifierActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/TagVerifierActivity.java
@@ -42,6 +42,9 @@
import android.widget.TextView;
import android.widget.Toast;
+import android.os.Handler;
+import android.os.HandlerThread;
+
/**
* Test activity for reading and writing NFC tags using different technologies.
* First, it asks the user to write some random data to the tag. Then it asks
@@ -82,6 +85,11 @@
private ArrayAdapter<String> mTechListAdapter;
private TextView mEmptyText;
+ private HandlerThread mHandlerThread;
+ private Handler mHandler;
+ // Auto write to this tag(DISCOVERED_DIALOG will be dismissed) when the waiting time out
+ private static final int WAIT_TIME_AUTO_WRITE_TAG = 3 * 1000;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -90,6 +98,10 @@
setPassFailButtonClickListeners();
getPassButton().setEnabled(false);
+ mHandlerThread = new HandlerThread("waitTimeAutoWriteTag");
+ mHandlerThread.start();
+ mHandler = new Handler(mHandlerThread.getLooper());
+
parseIntentExtras();
if (mTechClass != null) {
mTagTester = getTagTester(mTechClass);
@@ -307,6 +319,23 @@
}
}
+ @Override
+ protected void onPrepareDialog(int id, Dialog dialog) {
+ super.onPrepareDialog(id, dialog);
+ if (id == TESTABLE_TAG_DISCOVERED_DIALOG_ID) {
+ mHandler.removeCallbacks(waitTimeAutoWriteTagRunnable);
+ mHandler.postDelayed(waitTimeAutoWriteTagRunnable, WAIT_TIME_AUTO_WRITE_TAG);
+ }
+ }
+
+ private final Runnable waitTimeAutoWriteTagRunnable = new Runnable() {
+ @Override
+ public void run() {
+ brutallyDismissDialog(TESTABLE_TAG_DISCOVERED_DIALOG_ID);
+ runOnUiThread(() -> new WriteTagTask().execute(mTag));
+ }
+ };
+
private AlertDialog createTestableTagDiscoveredDialog() {
return new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_info)
@@ -315,12 +344,14 @@
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
+ mHandler.removeCallbacks(waitTimeAutoWriteTagRunnable);
new WriteTagTask().execute(mTag);
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
+ mHandler.removeCallbacks(waitTimeAutoWriteTagRunnable);
goToWriteStep();
}
})
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/BubbleActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/BubbleActivity.java
index a813454..214e79d 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/BubbleActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/BubbleActivity.java
@@ -6,6 +6,7 @@
import android.app.Activity;
import android.content.Intent;
import android.graphics.Insets;
+import android.graphics.Rect;
import android.os.Bundle;
import android.view.View;
import android.view.ViewTreeObserver;
@@ -95,8 +96,9 @@
WindowMetrics bubbleWindowMetrics =
getSystemService(WindowManager.class).getCurrentWindowMetrics();
if (mIsLargeScreen) {
- final float percentOfScreen = windowMetricsMax.getBounds().height() * 0.70f;
- if (bubbleWindowMetrics.getBounds().height() < percentOfScreen) {
+ Rect bounds = windowMetricsMax.getBounds();
+ final float percentOfScreen = Math.min(bounds.height(), bounds.width()) * 0.70f;
+ if (bubbleWindowMetrics.getBounds().height() <= percentOfScreen) {
mTestMessage.setText("Test failed --"
+ " the bubble expanded view is too small, it is: "
+ bubbleWindowMetrics.getBounds().height()
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationFullScreenIntentVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationFullScreenIntentVerifierActivity.java
index 9aa728d..864d46c 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationFullScreenIntentVerifierActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationFullScreenIntentVerifierActivity.java
@@ -127,7 +127,7 @@
// NOW TESTING: Screen unlocked FSI HUN with permission, should show sticky HUN for
// at least 60s
- tests.add(new ScreenUnlockedFsiHunWithPermissionTest());
+ //tests.add(new ScreenUnlockedFsiHunWithPermissionTest());
// NOW TESTING: lockscreen FSI HUN with FSI permission, should launch FSI
tests.add(new LockScreenFsiWithPermissionTestStep());
@@ -149,7 +149,7 @@
tests.add(new DenyFsiPermissionStep());
// NOW TESTING: Screen unlocked FSI without permission, should show sticky HUN for 60s
- tests.add(new ScreenUnlockedFsiHunWithoutPermissionTest());
+ //tests.add(new ScreenUnlockedFsiHunWithoutPermissionTest());
// NOW TESTING: lockscreen FSI HUN without FSI permission,
// HUN shows up first in list, expanded with pill buttons
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 a0f5bd0..b6abc3c 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/FingerprintBoundKeysTest.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/FingerprintBoundKeysTest.java
@@ -66,7 +66,7 @@
/** Alias for our key in the Android Key Store. */
private static final String KEY_NAME = "my_key";
private static final byte[] SECRET_BYTE_ARRAY = new byte[] {1, 2, 3, 4, 5, 6};
- private static final int AUTHENTICATION_DURATION_SECONDS = 2;
+ private static final int AUTHENTICATION_DURATION_SECONDS = 4;
private static final int CONFIRM_CREDENTIALS_REQUEST_CODE = 1;
private static final int BIOMETRIC_REQUEST_PERMISSION_CODE = 0;
@@ -343,12 +343,25 @@
.hasSystemFeature(PackageManager.FEATURE_STRONGBOX_KEYSTORE);
if (mActivity.tryEncrypt() &&
mActivity.doValidityDurationTest(false)) {
- try {
- Thread.sleep(3000);
- } catch (Exception e) {
- throw new RuntimeException("Failed to sleep", e);
+ boolean tokenExpired = false;
+ long startTime = System.currentTimeMillis();
+ while (((System.currentTimeMillis() - startTime)
+ < (AUTHENTICATION_DURATION_SECONDS * 1000))
+ && (!tokenExpired)) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ throw new RuntimeException("Failed to sleep", e);
+ }
+
+ tokenExpired = !mActivity.doValidityDurationTest(false);
+ }
+
+ if (DEBUG) {
+ Log.i(TAG,"Token expired = " + tokenExpired);
}
- if (!mActivity.doValidityDurationTest(false)) {
+
+ if (tokenExpired) {
showToast(String.format("Test passed. useStrongBox: %b",
mActivity.useStrongBox));
if (mActivity.useStrongBox || !hasStrongBox) {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/wifi/BaseTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/wifi/BaseTestActivity.java
index 8c4466d..be7d9e3 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/wifi/BaseTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/wifi/BaseTestActivity.java
@@ -111,10 +111,11 @@
}
@Override
- protected void onStop() {
- super.onStop();
+ protected void onDestroy() {
mTestCase.stop();
mWifiProgress.setVisibility(View.GONE);
+
+ super.onDestroy();
}
@Override
diff --git a/common/device-side/bedstead/eventlib/Android.bp b/common/device-side/bedstead/eventlib/Android.bp
index 72cfeec..1e82717 100644
--- a/common/device-side/bedstead/eventlib/Android.bp
+++ b/common/device-side/bedstead/eventlib/Android.bp
@@ -18,6 +18,9 @@
],
manifest: "src/main/AndroidManifest.xml",
min_sdk_version: "29",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
android_test {
@@ -42,4 +45,7 @@
data: [":EventLibTestApp"],
manifest: "src/test/AndroidManifest.xml",
min_sdk_version: "29",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
diff --git a/common/device-side/bedstead/harrier/Android.bp b/common/device-side/bedstead/harrier/Android.bp
index dedb50a..baec833 100644
--- a/common/device-side/bedstead/harrier/Android.bp
+++ b/common/device-side/bedstead/harrier/Android.bp
@@ -37,6 +37,7 @@
android_library {
name: "HarrierCommonAndroid",
+ sdk_version: "current",
srcs: [
"common/src/main/java/**/*.java",
],
diff --git a/common/device-side/bedstead/harrier/src/main/java/com/android/bedstead/harrier/DeviceState.java b/common/device-side/bedstead/harrier/src/main/java/com/android/bedstead/harrier/DeviceState.java
index ddfc0cd..dceb5c8 100644
--- a/common/device-side/bedstead/harrier/src/main/java/com/android/bedstead/harrier/DeviceState.java
+++ b/common/device-side/bedstead/harrier/src/main/java/com/android/bedstead/harrier/DeviceState.java
@@ -379,7 +379,7 @@
AssertionError assertionError = new AssertionError(
"Timed out executing test " + description.getDisplayName()
- + " after " + MAX_TEST_DURATION);
+ + " after " + MAX_TEST_DURATION, e);
assertionError.setStackTrace(stack);
throw assertionError;
}
diff --git a/common/device-side/bedstead/nene/Android.bp b/common/device-side/bedstead/nene/Android.bp
index e981ded..8053393 100644
--- a/common/device-side/bedstead/nene/Android.bp
+++ b/common/device-side/bedstead/nene/Android.bp
@@ -15,7 +15,11 @@
"common/src/main/java/**/*.java",
],
manifest: "src/main/AndroidManifestInternal.xml",
+ sdk_version: "current",
min_sdk_version: "29",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
// TODO(b/203507664): Remove NeneInternal once we no longer need QUERY_ALL_PACKAGES to install
@@ -35,6 +39,9 @@
"androidx.test.uiautomator_uiautomator",
],
min_sdk_version: "29",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
android_library {
@@ -53,6 +60,9 @@
"androidx.test.uiautomator_uiautomator",
],
min_sdk_version: "29",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
android_test {
@@ -78,6 +88,9 @@
data: [":NeneTestApp1"],
manifest: "src/test/AndroidManifest.xml",
min_sdk_version: "29",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
android_test {
@@ -104,6 +117,9 @@
manifest: "src/test/AndroidManifest.xml",
min_sdk_version: "29",
test_config: "InteractiveAndroidTest.xml",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
android_test {
@@ -130,6 +146,9 @@
manifest: "src/benchmarks/AndroidManifest.xml",
test_config: "src/benchmarks/AndroidTest.xml",
min_sdk_version: "29",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
android_test_helper_app {
@@ -139,4 +158,7 @@
],
manifest: "testapps/TestApp1.xml",
min_sdk_version: "29",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
diff --git a/common/device-side/bedstead/queryable/Android.bp b/common/device-side/bedstead/queryable/Android.bp
index 25fe552..af52128 100644
--- a/common/device-side/bedstead/queryable/Android.bp
+++ b/common/device-side/bedstead/queryable/Android.bp
@@ -24,6 +24,7 @@
"common/src/main/java/**/*.java",
],
manifest: "src/main/AndroidManifest.xml",
+ sdk_version: "current",
min_sdk_version: "29",
plugins: ["auto_annotation_plugin"],
}
diff --git a/common/device-side/bedstead/remoteframeworkclasses/Android.bp b/common/device-side/bedstead/remoteframeworkclasses/Android.bp
index e6a5012..903e6df 100644
--- a/common/device-side/bedstead/remoteframeworkclasses/Android.bp
+++ b/common/device-side/bedstead/remoteframeworkclasses/Android.bp
@@ -12,20 +12,24 @@
static_libs: [
"RemoteFrameworkClasses_Annotations",
"ConnectedAppsSDK_Annotations",
- "ConnectedAppsSDK"
+ "ConnectedAppsSDK",
],
manifest: "src/types/main/AndroidManifest.xml",
min_sdk_version: "29",
- plugins: ["ConnectedAppsSDK_Processor", "RemoteFrameworkClasses_Processor"],
+ plugins: [
+ "ConnectedAppsSDK_Processor",
+ "RemoteFrameworkClasses_Processor",
+ ],
}
java_library {
name: "RemoteFrameworkClasses_Annotations",
+ sdk_version: "current",
srcs: [
"src/processor/main/java/com/android/bedstead/remoteframeworkclasses/processor/annotations/*.java",
"src/processor/main/java/com/android/bedstead/remoteframeworkclasses/processor/annotations/*.kt",
],
- host_supported: true
+ host_supported: true,
}
java_library_host {
@@ -39,10 +43,10 @@
"javapoet",
"auto_service_annotations",
"RemoteFrameworkClasses_Annotations",
- "ConnectedAppsSDK_Annotations"
+ "ConnectedAppsSDK_Annotations",
],
java_resource_dirs: [
- "src/processor/res"
+ "src/processor/res",
],
plugins: ["auto_service_plugin"],
}
@@ -51,7 +55,7 @@
name: "RemoteFrameworkClasses_Processor",
processor_class: "com.android.bedstead.remoteframeworkclasses.processor.Processor",
static_libs: [
- "RemoteFrameworkClasses_Processor_Src"
+ "RemoteFrameworkClasses_Processor_Src",
],
generates_api: true,
-}
\ No newline at end of file
+}
diff --git a/common/device-side/bedstead/testapp/Android.bp b/common/device-side/bedstead/testapp/Android.bp
index 11f0c7a..4528011 100644
--- a/common/device-side/bedstead/testapp/Android.bp
+++ b/common/device-side/bedstead/testapp/Android.bp
@@ -4,6 +4,7 @@
java_library_static {
name: "TestApp_JavaProtos",
+ sdk_version: "core_current",
host_supported: true,
proto: {
type: "lite",
@@ -398,6 +399,7 @@
java_library {
name: "TestApp_Annotations",
+ sdk_version: "core_current",
srcs: [
"src/processor/main/java/com/android/bedstead/testapp/processor/annotations/*.java",
],
@@ -412,7 +414,7 @@
"auto_service_annotations",
"TestApp_Annotations",
"ConnectedAppsSDK_Annotations",
- "RemoteFrameworkClasses_Processor_Src"
+ "RemoteFrameworkClasses_Processor_Src",
],
srcs: [
"src/processor/main/java/com/android/bedstead/testapp/processor/Processor.java",
diff --git a/common/device-side/interactive/src/main/java/com/android/interactive/ScreenshotUtil.java b/common/device-side/interactive/src/main/java/com/android/interactive/ScreenshotUtil.java
new file mode 100644
index 0000000..f53f6a6
--- /dev/null
+++ b/common/device-side/interactive/src/main/java/com/android/interactive/ScreenshotUtil.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2023 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.interactive;
+
+import android.os.Environment;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.uiautomator.UiDevice;
+
+import java.io.File;
+
+/**
+ * Utility class for taking screenshots during xTS-Interactive tests.
+ *
+ * <p>It saves screenshots as files to the /Documents/xts/screenshots/ directory on the external
+ * storage.
+ */
+public final class ScreenshotUtil {
+
+ /**
+ * Captures a screenshot and saves it as a file.
+ *
+ * <p>The screenshot file is named using the provided screenshot name, appended with the current
+ * system time.
+ *
+ * @param screenshotName the screenshot name
+ * @throws IOException if fails to create and save the screenshot file
+ */
+ public static void captureScreenshot(String screenshotName) {
+ String screenshotDir =
+ Environment.getExternalStorageDirectory().getAbsolutePath()
+ + "/Documents/xts/screenshots/";
+ File file = new File(screenshotDir);
+ if (!file.exists()) {
+ file.mkdirs();
+ }
+
+ File screenshotFile =
+ new File(screenshotDir, screenshotName + "_" + System.currentTimeMillis() + ".png");
+ UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
+ .takeScreenshot(screenshotFile);
+ }
+}
diff --git a/common/device-side/interactive/src/main/java/com/android/interactive/Step.java b/common/device-side/interactive/src/main/java/com/android/interactive/Step.java
index abe25f1..4fdeb73 100644
--- a/common/device-side/interactive/src/main/java/com/android/interactive/Step.java
+++ b/common/device-side/interactive/src/main/java/com/android/interactive/Step.java
@@ -53,12 +53,13 @@
*/
public abstract class Step<E> {
- private static final TestLifecycleListener sLifecycleListener = new TestLifecycleListener() {
- @Override
- public void testFinished(String testName) {
- sForceManual.set(false);
- }
- };
+ private static final TestLifecycleListener sLifecycleListener =
+ new TestLifecycleListener() {
+ @Override
+ public void testFinished(String testName) {
+ sForceManual.set(false);
+ }
+ };
private static final String LOG_TAG = "Interactive.Step";
@@ -69,27 +70,33 @@
// We timeout 10 seconds before the infra would timeout
private static final Duration MAX_STEP_DURATION =
Duration.ofMillis(
- Long.parseLong(TestApis.instrumentation().arguments().getString(
- "timeout_msec", "600000")) - 10000);
+ Long.parseLong(
+ TestApis.instrumentation()
+ .arguments()
+ .getString("timeout_msec", "600000"))
+ - 10000);
- private static final Automator sAutomator =
- new Automator(AUTOMATION_FILE);
+ private static final Automator sAutomator = new Automator(AUTOMATION_FILE);
private View mInstructionView;
+ private Button mCollapseButton;
private static final WindowManager sWindowManager =
TestApis.context().instrumentedContext().getSystemService(WindowManager.class);
private Optional<E> mValue = Optional.empty();
private boolean mFailed = false;
+ // Whether there's a screenshot taken for this step.
+ // In case multiple close() calls creating multiple screenshot files.
+ private boolean mHasTakenScreenshot = false;
private static Map<Class<? extends Step<?>>, Object> sStepCache = new HashMap<>();
/**
* Executes a step.
*
- * <p>This will first try to execute the step automatically, falling back to manual
- * interaction if that fails.
+ * <p>This will first try to execute the step automatically, falling back to manual interaction
+ * if that fails.
*/
public static <E> E execute(Class<? extends Step<E>> stepClass) throws Exception {
Step<E> step;
@@ -105,10 +112,10 @@
}
if (!sForceManual.get()
- && TestApis.instrumentation().arguments().getBoolean(
- "ENABLE_AUTOMATION", true)) {
+ && TestApis.instrumentation().arguments().getBoolean("ENABLE_AUTOMATION", true)) {
if (sAutomator.canAutomate(step)) {
- AutomatingStep automatingStep = new AutomatingStep("Automating " + stepClass.getCanonicalName());
+ AutomatingStep automatingStep =
+ new AutomatingStep("Automating " + stepClass.getCanonicalName());
try {
automatingStep.interact();
@@ -117,7 +124,8 @@
// If it reaches this point then it has passed
Log.i(LOG_TAG, "Succeeded with automatic resolution of " + step);
- boolean stepIsCacheable = stepClass.getAnnotationsByType(CacheableStep.class).length > 0;
+ boolean stepIsCacheable =
+ stepClass.getAnnotationsByType(CacheableStep.class).length > 0;
if (stepIsCacheable) {
sStepCache.put(stepClass, returnValue);
}
@@ -125,24 +133,28 @@
} catch (Exception t) {
Log.e(LOG_TAG, "Error attempting automation of " + step, t);
- if (TestApis.instrumentation().arguments().getBoolean(
- "ENABLE_MANUAL", false)) {
+ if (TestApis.instrumentation().arguments().getBoolean("ENABLE_MANUAL", false)) {
AutomatingFailedStep automatingFailedStep =
- new AutomatingFailedStep("Automation "
- + stepClass.getCanonicalName()
- + " Failed due to " + t.toString());
+ new AutomatingFailedStep(
+ "Automation "
+ + stepClass.getCanonicalName()
+ + " Failed due to "
+ + t.toString());
automatingFailedStep.interact();
- Integer value = Poll.forValue("value", automatingFailedStep::getValue)
- .toMeet(Optional::isPresent)
- .terminalValue((b) -> step.hasFailed())
- .errorOnFail("Expected value from step. No value provided or step failed.")
- .timeout(MAX_STEP_DURATION)
- .await()
- .get();
+ Integer value =
+ Poll.forValue("value", automatingFailedStep::getValue)
+ .toMeet(Optional::isPresent)
+ .terminalValue((b) -> step.hasFailed())
+ .errorOnFail(
+ "Expected value from step. No value provided or"
+ + " step failed.")
+ .timeout(MAX_STEP_DURATION)
+ .await()
+ .get();
if (value == AutomatingFailedStep.FAIL) {
- throw(t);
+ throw (t);
} else if (value == AutomatingFailedStep.CONTINUE_MANUALLY) {
// Do nothing - we will fall through to the manual resolution
} else if (value == AutomatingFailedStep.RETRY) {
@@ -156,7 +168,7 @@
"Restarting manually after automatic failure");
}
} else {
- throw(t);
+ throw (t);
}
} finally {
automatingStep.close();
@@ -166,17 +178,17 @@
}
}
- if (TestApis.instrumentation().arguments().getBoolean(
- "ENABLE_MANUAL", false)) {
+ if (TestApis.instrumentation().arguments().getBoolean("ENABLE_MANUAL", false)) {
step.interact();
// Wait until we've reached a valid ending point
try {
- Optional<E> valueOptional = Poll.forValue("value", step::getValue)
- .toMeet(Optional::isPresent)
- .terminalValue((b) -> step.hasFailed())
- .timeout(MAX_STEP_DURATION)
- .await();
+ Optional<E> valueOptional =
+ Poll.forValue("value", step::getValue)
+ .toMeet(Optional::isPresent)
+ .terminalValue((b) -> step.hasFailed())
+ .timeout(MAX_STEP_DURATION)
+ .await();
if (step.hasFailed()) {
throw new StepFailedException(stepClass);
@@ -188,14 +200,16 @@
E value = valueOptional.get();
// After the test has been marked passed, we validate ourselves
- E returnValue = Poll.forValue("validated", () -> step.validate(value))
- .toMeet(Optional::isPresent)
- .errorOnFail("Step did not pass validation.")
- .timeout(MAX_STEP_DURATION)
- .await()
- .get();
+ E returnValue =
+ Poll.forValue("validated", () -> step.validate(value))
+ .toMeet(Optional::isPresent)
+ .errorOnFail("Step did not pass validation.")
+ .timeout(MAX_STEP_DURATION)
+ .await()
+ .get();
- boolean stepIsCacheable = stepClass.getAnnotationsByType(CacheableStep.class).length > 0;
+ boolean stepIsCacheable =
+ stepClass.getAnnotationsByType(CacheableStep.class).length > 0;
if (stepIsCacheable) {
sStepCache.put(stepClass, returnValue);
}
@@ -212,11 +226,10 @@
try {
pass((E) Nothing.NOTHING);
} catch (ClassCastException e) {
- throw new IllegalStateException("You cannot call pass() for a step which requires a"
- + " return value. If no return value is required, the step should use Nothing"
- + " (not Void)");
+ throw new IllegalStateException(
+ "You cannot call pass() for a step which requires a return value. If no return"
+ + " value is required, the step should use Nothing (not Void)");
}
-
}
protected final void pass(E value) {
@@ -229,23 +242,17 @@
close();
}
- /**
- * Returns present if the manual step has concluded successfully.
- */
+ /** Returns present if the manual step has concluded successfully. */
public Optional<E> getValue() {
return mValue;
}
- /**
- * Returns true if the manual step has failed.
- */
+ /** Returns true if the manual step has failed. */
public boolean hasFailed() {
return mFailed;
}
- /**
- * Adds a button to the interaction prompt.
- */
+ /** Adds a button to the interaction prompt. */
protected void addButton(String title, Runnable onClick) {
Button btn = new Button(TestApis.context().instrumentedContext());
btn.setText(title);
@@ -256,10 +263,9 @@
}
/**
- * Adds small button with a single up/down arrow, used for moving the text box to the
- * bottom of the screen in case it covers some critical area of the app
+ * Adds small button with a single up/down arrow, used for moving the text box to the bottom of
+ * the screen in case it covers some critical area of the app
*/
-
protected void addSwapButton() {
Button btn = new Button(TestApis.context().instrumentedContext());
// up/down arrow
@@ -271,6 +277,28 @@
}
/**
+ * Adds a small button that allows users to collapse the instructions.
+ */
+ protected void addCollapseInstructionsButton() {
+ mCollapseButton = new Button(TestApis.context().instrumentedContext());
+ mCollapseButton.setText("\u21F1");
+ mCollapseButton.setOnClickListener(v -> collapse());
+ GridLayout layout = mInstructionView.findViewById(R.id.buttons);
+ layout.addView(mCollapseButton);
+ }
+
+ private void collapse() {
+ TextView instructionsTextView = mInstructionView.findViewById(R.id.text);
+ if (instructionsTextView.getVisibility() != View.GONE) {
+ instructionsTextView.setVisibility(View.GONE);
+ mCollapseButton.setText("\u21F2");
+ } else {
+ instructionsTextView.setVisibility(View.VISIBLE);
+ mCollapseButton.setText("\u21F1");
+ }
+ }
+
+ /**
* Adds a button to immediately mark the test as failed and request the tester to provide the
* reason for failure.
*/
@@ -284,38 +312,48 @@
* <p>This should be called before any other methods on this class.
*/
protected void show(String instruction) {
- mInstructionView = LayoutInflater.from(TestApis.context().instrumentationContext())
- .inflate(R.layout.instruction, null);
+ mInstructionView =
+ LayoutInflater.from(TestApis.context().instrumentationContext())
+ .inflate(R.layout.instruction, null);
TextView text = mInstructionView.findViewById(R.id.text);
text.setText(instruction);
- WindowManager.LayoutParams params = new WindowManager.LayoutParams(
- WindowManager.LayoutParams.MATCH_PARENT,
- WindowManager.LayoutParams.WRAP_CONTENT,
- WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
- WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
- PixelFormat.TRANSLUCENT);
+ WindowManager.LayoutParams params =
+ new WindowManager.LayoutParams(
+ WindowManager.LayoutParams.MATCH_PARENT,
+ WindowManager.LayoutParams.WRAP_CONTENT,
+ WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
+ WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
+ PixelFormat.TRANSLUCENT);
params.gravity = Gravity.TOP; // TMP
params.x = 0;
params.y = 0;
- TestApis.context().instrumentationContext().getMainExecutor().execute(() -> {
- try (PermissionContext p = TestApis.permissions().withPermission(
- SYSTEM_ALERT_WINDOW, SYSTEM_APPLICATION_OVERLAY, INTERNAL_SYSTEM_WINDOW)) {
- params.setSystemApplicationOverlay(true);
- params.privateFlags = WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
- sWindowManager.addView(mInstructionView, params);
- }
- });
+ TestApis.context()
+ .instrumentationContext()
+ .getMainExecutor()
+ .execute(
+ () -> {
+ try (PermissionContext p =
+ TestApis.permissions()
+ .withPermission(
+ SYSTEM_ALERT_WINDOW,
+ SYSTEM_APPLICATION_OVERLAY,
+ INTERNAL_SYSTEM_WINDOW)) {
+ params.setSystemApplicationOverlay(true);
+ params.privateFlags =
+ WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
+ sWindowManager.addView(mInstructionView, params);
+ }
+ });
}
- /**
- * Swaps the prompt from the top to the bottom of the user screen
- */
+ /** Swaps the prompt from the top to the bottom of the user screen */
protected void swap() {
- WindowManager.LayoutParams params = (WindowManager.LayoutParams) mInstructionView.getLayoutParams();
+ WindowManager.LayoutParams params =
+ (WindowManager.LayoutParams) mInstructionView.getLayoutParams();
if (params.gravity == Gravity.TOP) {
params.gravity = Gravity.BOTTOM;
} else {
@@ -324,23 +362,34 @@
sWindowManager.updateViewLayout(mInstructionView, params);
}
+ /**
+ * Closes the step, takes a screenshot of the device if the feature is enabled, and removes the
+ * instruction view if it's still there.
+ */
protected void close() {
+ if (!mHasTakenScreenshot
+ && TestApis.instrumentation().arguments().getBoolean("TAKE_SCREENSHOT", false)) {
+ mHasTakenScreenshot = true;
+ ScreenshotUtil.captureScreenshot(getClass().getCanonicalName());
+ }
if (mInstructionView != null) {
- TestApis.context().instrumentationContext().getMainExecutor().execute(() -> {
- try {
- sWindowManager.removeViewImmediate(mInstructionView);
- mInstructionView = null;
- } catch (IllegalArgumentException e) {
- // This can happen if the view is no longer attached
- Log.i(LOG_TAG, "Error removing instruction view", e);
- }
- });
+ TestApis.context()
+ .instrumentationContext()
+ .getMainExecutor()
+ .execute(
+ () -> {
+ try {
+ sWindowManager.removeViewImmediate(mInstructionView);
+ mInstructionView = null;
+ } catch (IllegalArgumentException e) {
+ // This can happen if the view is no longer attached
+ Log.i(LOG_TAG, "Error removing instruction view", e);
+ }
+ });
}
}
- /**
- * Executes the manual step.
- */
+ /** Executes the manual step. */
public abstract void interact();
/**
diff --git a/common/device-side/interactive/src/main/java/com/android/interactive/steps/LaunchIntentStep.java b/common/device-side/interactive/src/main/java/com/android/interactive/steps/LaunchIntentStep.java
new file mode 100644
index 0000000..f7938e5
--- /dev/null
+++ b/common/device-side/interactive/src/main/java/com/android/interactive/steps/LaunchIntentStep.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2024 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.interactive.steps;
+
+import android.content.Intent;
+
+import com.android.bedstead.nene.TestApis;
+import com.android.interactive.Nothing;
+import com.android.interactive.Step;
+
+
+ /**
+ * A {@link Step} where the system launches an activity via an intent.
+ * If the intent cannot be started, the system will report a failure.
+ * <p>This will present "Launch" button.
+ */
+public abstract class LaunchIntentStep extends Step<Nothing> {
+ private static final String TAG = LaunchIntentStep.class.getSimpleName();
+
+ protected final String mInstruction;
+ protected final Intent mIntent;
+
+ protected LaunchIntentStep(String instruction, Intent intent) {
+ mInstruction = instruction;
+ mIntent = intent;
+ }
+
+ @Override
+ public void interact() {
+ show(mInstruction);
+ addButton("Launch", () -> {
+ startActivity(mIntent);
+ close();
+ });
+ }
+
+ protected void startActivity(Intent intent) {
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ try {
+ TestApis.context().instrumentedContext().startActivity(mIntent);
+ pass();
+ } catch (RuntimeException ex) {
+ fail(ex.getMessage());
+ }
+ }
+}
diff --git a/common/device-side/interactive/src/main/java/com/android/interactive/steps/ScreenshotValidationStep.java b/common/device-side/interactive/src/main/java/com/android/interactive/steps/ScreenshotValidationStep.java
new file mode 100644
index 0000000..6852660
--- /dev/null
+++ b/common/device-side/interactive/src/main/java/com/android/interactive/steps/ScreenshotValidationStep.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2024 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.interactive.steps;
+
+import com.android.interactive.ScreenshotUtil;
+import com.android.interactive.Step;
+
+/**
+ * A {@link Step} where the user is asked to provide a screenshot to
+ * ensure the test meets the specifications.
+ *
+ * <p>This will present "Pass Screenshot" and "Fail Screenshot" buttons.
+ */
+public abstract class ScreenshotValidationStep extends Step<Boolean> {
+
+ private final String mInstruction;
+ private final String mFilename;
+
+ protected ScreenshotValidationStep(String instruction, String filename) {
+ mInstruction = instruction;
+ mFilename = filename;
+ }
+
+ @Override
+ public void interact() {
+ show(mInstruction);
+ addButton("Pass & Take Screenshot", () -> {
+ ScreenshotUtil.captureScreenshot(mFilename);
+ pass(true);
+ });
+ addButton("Fail & Take Screenshot", () -> {
+ pass(false);
+ });
+ }
+}
diff --git a/common/device-side/interactive/src/main/res/layout-car/instruction.xml b/common/device-side/interactive/src/main/res/layout-car/instruction.xml
new file mode 100644
index 0000000..cc52943
--- /dev/null
+++ b/common/device-side/interactive/src/main/res/layout-car/instruction.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2024 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.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="30dp"
+ android:paddingBottom="30dp"
+ android:paddingLeft="30dp"
+ android:paddingRight="30dp"
+ android:orientation="horizontal">
+ <LinearLayout
+ android:paddingTop="10dp"
+ android:paddingBottom="10dp"
+ android:paddingLeft="10dp"
+ android:paddingRight="10dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:background="?android:attr/windowBackground"
+ android:layout_gravity="center">
+ <TextView
+ android:id="@+id/text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="10dp"
+ android:text=""
+ android:textAlignment="center"
+ android:textColor="?android:textColorPrimary" />
+ <GridLayout
+ android:id="@+id/buttons"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:useDefaultMargins="true"
+ android:paddingBottom="10dp"
+ android:columnCount="3">
+ </GridLayout>
+ </LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/common/device-side/util-axt/src/com/android/compatibility/common/util/PropertyUtil.java b/common/device-side/util-axt/src/com/android/compatibility/common/util/PropertyUtil.java
index 3ca979d..f1ee13c 100644
--- a/common/device-side/util-axt/src/com/android/compatibility/common/util/PropertyUtil.java
+++ b/common/device-side/util-axt/src/com/android/compatibility/common/util/PropertyUtil.java
@@ -44,6 +44,8 @@
private static final String CAMERAX_EXTENSIONS_ENABLED = "ro.camerax.extensions.enabled";
private static final String MANUFACTURER_PROPERTY = "ro.product.manufacturer";
private static final String TAG_DEV_KEYS = "dev-keys";
+ private static final String TAG_TEST_KEYS = "test-keys";
+ private static final String VENDOR_API_LEVEL = "ro.vendor.api_level";
private static final String VNDK_VERSION = "ro.vndk.version";
public static final String GOOGLE_SETTINGS_QUERY =
@@ -62,12 +64,12 @@
/** Returns whether this build is built with dev-keys */
public static boolean isDevKeysBuild() {
- for (String tag : Build.TAGS.split(",")) {
- if (TAG_DEV_KEYS.equals(tag.trim())) {
- return true;
- }
- }
- return false;
+ return isBuildWithKeyType(TAG_DEV_KEYS);
+ }
+
+ /** Returns whether this build is built with test-keys */
+ public static boolean isTestKeysBuild() {
+ return isBuildWithKeyType(TAG_TEST_KEYS);
}
/**
@@ -90,11 +92,16 @@
/**
* Return the API level that the VSR requirement must be fulfilled. It reads
- * ro.product.first_api_level and ro.board.first_api_level to find the minimum required VSR
- * api_level for the DUT.
+ * ro.vendor.api_level. If not provided for old devices, read ro.product.first_api_level,
+ * ro.board.api_level and ro.board.first_api_level to find the minimum required VSR api level of
+ * the DUT.
*/
public static int getVsrApiLevel() {
- // Api level properties of the board. The order of the properties must be kept.
+ int vendorApiLevel = getPropertyInt(VENDOR_API_LEVEL);
+ if (vendorApiLevel != INT_VALUE_IF_UNSET) {
+ return vendorApiLevel;
+ }
+ // Fallback to api level calculation for old devices.
String[] boardApiLevelProps = {BOARD_API_LEVEL, BOARD_FIRST_API_LEVEL};
for (String apiLevelProp : boardApiLevelProps) {
int apiLevel = getPropertyInt(apiLevelProp);
@@ -297,4 +304,19 @@
}
}
}
+
+ /**
+ * Checks if the current build uses a specific type of key.
+ *
+ * @param keyType The type of key to check for (e.g., "dev-keys", "test-keys")
+ * @return true if the build uses the specified key type, false otherwise
+ */
+ private static boolean isBuildWithKeyType(String keyType) {
+ for (String tag : Build.TAGS.split(",")) {
+ if (keyType.equals(tag.trim())) {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/common/device-side/util-axt/src/com/android/compatibility/common/util/UiAutomatorUtils2.java b/common/device-side/util-axt/src/com/android/compatibility/common/util/UiAutomatorUtils2.java
index 64b11c1..146dd76 100644
--- a/common/device-side/util-axt/src/com/android/compatibility/common/util/UiAutomatorUtils2.java
+++ b/common/device-side/util-axt/src/com/android/compatibility/common/util/UiAutomatorUtils2.java
@@ -34,6 +34,7 @@
import androidx.test.uiautomator.UiSelector;
import androidx.test.uiautomator.Until;
+import java.util.Objects;
import java.util.regex.Pattern;
public class UiAutomatorUtils2 {
@@ -140,7 +141,19 @@
scrolledPastCollapsibleToolbar = false;
} else {
Rect boundsBeforeScroll = scrollable.getBounds();
- boolean scrollAtStartOrEnd = !scrollable.scrollForward();
+ boolean scrollAtStartOrEnd;
+ boolean isWearCompose = FeatureUtil.isWatch() && Objects.equals(
+ scrollable.getPackageName(),
+ InstrumentationRegistry.getInstrumentation().getContext()
+ .getPackageManager().getPermissionControllerPackageName());
+ if (isWearCompose) {
+ // TODO(b/306483780): Removed the condition once the scrollForward is
+ // fixed.
+ scrollable.scrollForward();
+ scrollAtStartOrEnd = false;
+ } else {
+ scrollAtStartOrEnd = !scrollable.scrollForward();
+ }
// The scrollable view may no longer be scrollable after the toolbar is
// collapsed.
if (scrollable.exists()) {
diff --git a/flags/tests/aconfig/Android.bp b/flags/tests/aconfig/Android.bp
index 21aa730..865fee2 100644
--- a/flags/tests/aconfig/Android.bp
+++ b/flags/tests/aconfig/Android.bp
@@ -21,6 +21,7 @@
aconfig_declarations {
name: "cts_flags_tests",
package: "android.cts.flags.tests",
+ container: "system",
srcs: ["android.cts.flags.tests.aconfig"],
}
diff --git a/flags/tests/aconfig/android.cts.flags.tests.aconfig b/flags/tests/aconfig/android.cts.flags.tests.aconfig
index 809e6ee..74daf2b 100644
--- a/flags/tests/aconfig/android.cts.flags.tests.aconfig
+++ b/flags/tests/aconfig/android.cts.flags.tests.aconfig
@@ -1,4 +1,5 @@
package: "android.cts.flags.tests"
+container: "system"
flag {
name: "readwrite_disabled_flag"
namespace: "cts"
diff --git a/hostsidetests/accounts/Android.bp b/hostsidetests/accounts/Android.bp
index 0999cb0..df7081e 100644
--- a/hostsidetests/accounts/Android.bp
+++ b/hostsidetests/accounts/Android.bp
@@ -34,4 +34,7 @@
"cts",
"general-tests",
],
+ data: [
+ ":CtsAccountManagerCrossUserApp",
+ ],
}
diff --git a/hostsidetests/angle/src/android/angle/cts/CtsAngleCommon.java b/hostsidetests/angle/src/android/angle/cts/CtsAngleCommon.java
index 64e4d01..92cbe6c 100644
--- a/hostsidetests/angle/src/android/angle/cts/CtsAngleCommon.java
+++ b/hostsidetests/angle/src/android/angle/cts/CtsAngleCommon.java
@@ -40,30 +40,23 @@
// ANGLE
static final String ANGLE_PACKAGE_NAME = "com.android.angle";
+
static final String ANGLE_DRIVER_TEST_PKG = "com.android.angleintegrationtest.drivertest";
+ static final String ANGLE_DRIVER_TEST_APP = "CtsAngleDriverTestCases.apk";
+
static final String ANGLE_DRIVER_TEST_SEC_PKG =
"com.android.angleintegrationtest.drivertestsecondary";
- static final String ANGLE_DRIVER_DUMPSYS_PKG =
- "com.android.angleintegrationtest.dumpsysgputest";
-
- static final String ANGLE_DRIVER_TEST_CLASS = "AngleDriverTestActivity";
- static final String ANGLE_DRIVER_TEST_DEFAULT_METHOD = "testUseDefaultDriver";
- static final String ANGLE_DRIVER_TEST_ANGLE_METHOD = "testUseAngleDriver";
- static final String ANGLE_DRIVER_TEST_NATIVE_METHOD = "testUseNativeDriver";
-
- static final String ANGLE_DRIVER_TEST_APP = "CtsAngleDriverTestCases.apk";
static final String ANGLE_DRIVER_TEST_SEC_APP = "CtsAngleDriverTestCasesSecondary.apk";
static final String ANGLE_DUMPSYS_GPU_TEST_PKG =
"com.android.angleintegrationtest.dumpsysgputest";
static final String ANGLE_DUMPSYS_GPU_TEST_CLASS = "AngleDumpsysGpuTestActivity";
static final String ANGLE_DUMPSYS_GPU_TEST_APP = "CtsAngleDumpsysGpuTestApp.apk";
- static final String ANGLE_DRIVER_TEST_ACTIVITY =
- ANGLE_DRIVER_TEST_PKG
- + "/com.android.angleIntegrationTest.common.AngleIntegrationTestActivity";
- static final String ANGLE_DRIVER_TEST_SEC_ACTIVITY =
- ANGLE_DRIVER_TEST_SEC_PKG
- + "/com.android.angleIntegrationTest.common.AngleIntegrationTestActivity";
+
+ static final String ANGLE_DRIVER_TEST_CLASS = "AngleDriverTestActivity";
+ static final String ANGLE_DRIVER_TEST_DEFAULT_METHOD = "testUseDefaultDriver";
+ static final String ANGLE_DRIVER_TEST_ANGLE_METHOD = "testUseAngleDriver";
+ static final String ANGLE_DRIVER_TEST_NATIVE_METHOD = "testUseNativeDriver";
static final String ANGLE_NATIVE_DRIVER_CHECK_PKG =
"com.android.angleintegrationtest.nativedrivercheck";
diff --git a/hostsidetests/angle/src/android/angle/cts/CtsAngleDeveloperOptionHostTest.java b/hostsidetests/angle/src/android/angle/cts/CtsAngleDeveloperOptionHostTest.java
index 1cf8f010..f07ce7f 100644
--- a/hostsidetests/angle/src/android/angle/cts/CtsAngleDeveloperOptionHostTest.java
+++ b/hostsidetests/angle/src/android/angle/cts/CtsAngleDeveloperOptionHostTest.java
@@ -118,8 +118,8 @@
stopPackage(getDevice(), ANGLE_DRIVER_TEST_PKG);
stopPackage(getDevice(), ANGLE_DRIVER_TEST_SEC_PKG);
- stopPackage(getDevice(), ANGLE_DRIVER_DUMPSYS_PKG);
stopPackage(getDevice(), ANGLE_NATIVE_DRIVER_CHECK_PKG);
+ stopPackage(getDevice(), ANGLE_DUMPSYS_GPU_TEST_PKG);
if (!sSetupOnce) {
sSetupOnce = true;
diff --git a/hostsidetests/appbinding/hostside/src/com/android/cts/appbinding/AppBindingHostTest.java b/hostsidetests/appbinding/hostside/src/com/android/cts/appbinding/AppBindingHostTest.java
old mode 100755
new mode 100644
index f2e4a04..c161a3b
--- a/hostsidetests/appbinding/hostside/src/com/android/cts/appbinding/AppBindingHostTest.java
+++ b/hostsidetests/appbinding/hostside/src/com/android/cts/appbinding/AppBindingHostTest.java
@@ -66,6 +66,7 @@
private int mCurrentUserId;
private static final int DEFAULT_TIMEOUT_SEC = 30;
+ private static final int DEFAULT_LONG_TIMEOUT_SEC = 70;
private interface ThrowingRunnable {
void run() throws Throwable;
@@ -579,7 +580,7 @@
}
private void assertUserHasNoFinder(int userId) throws Throwable {
- runWithRetries(DEFAULT_TIMEOUT_SEC, () -> {
+ runWithRetries(DEFAULT_LONG_TIMEOUT_SEC, () -> {
runCommandAndNotMatch("dumpsys app_binding -s",
"^finder,\\[Default\\sSMS\\sapp\\]," + userId + ",");
});
diff --git a/hostsidetests/appcompat/compatchanges/Android.bp b/hostsidetests/appcompat/compatchanges/Android.bp
index 70d70ba..7ce9372 100644
--- a/hostsidetests/appcompat/compatchanges/Android.bp
+++ b/hostsidetests/appcompat/compatchanges/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_lse_app_compat",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -25,7 +26,7 @@
"tradefed",
"guava",
],
- static_libs:[
+ static_libs: [
"CompatChangeGatingTestBase",
],
// tag this module as a cts test artifact
diff --git a/hostsidetests/appcompat/compatchanges/app/Android.bp b/hostsidetests/appcompat/compatchanges/app/Android.bp
index a2c94d7..0d8413f 100644
--- a/hostsidetests/appcompat/compatchanges/app/Android.bp
+++ b/hostsidetests/appcompat/compatchanges/app/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_lse_app_compat",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appcompat/compatchanges/preInstallOverrideApps/Android.bp b/hostsidetests/appcompat/compatchanges/preInstallOverrideApps/Android.bp
index 9d2b53e..070d84f 100644
--- a/hostsidetests/appcompat/compatchanges/preInstallOverrideApps/Android.bp
+++ b/hostsidetests/appcompat/compatchanges/preInstallOverrideApps/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_lse_app_compat",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appcompat/compatchanges/selinuxapp/Android.bp b/hostsidetests/appcompat/compatchanges/selinuxapp/Android.bp
index e926a75..3c93556 100644
--- a/hostsidetests/appcompat/compatchanges/selinuxapp/Android.bp
+++ b/hostsidetests/appcompat/compatchanges/selinuxapp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_lse_app_compat",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appcompat/compatchanges/src/com/android/cts/appcompat/CompatChangesValidConfigTest.java b/hostsidetests/appcompat/compatchanges/src/com/android/cts/appcompat/CompatChangesValidConfigTest.java
index e6257f7..9c52798 100644
--- a/hostsidetests/appcompat/compatchanges/src/com/android/cts/appcompat/CompatChangesValidConfigTest.java
+++ b/hostsidetests/appcompat/compatchanges/src/com/android/cts/appcompat/CompatChangesValidConfigTest.java
@@ -16,7 +16,6 @@
package com.android.cts.appcompat;
-import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import android.compat.cts.Change;
@@ -43,6 +42,8 @@
private static final long PRIORITY_QUEUE_OFFER_NON_COMPARABLE_ONE_ELEMENT = 289878283L;
private static final long ASM_RESTRICTIONS = 230590090L;
private static final String FEATURE_WATCH = "android.hardware.type.watch";
+ // Version number for a current development build
+ private static final int CUR_DEVELOPMENT_VERSION = 10000;
private static final Set<String> OVERRIDES_ALLOWLIST = ImmutableSet.of(
// This change id will sometimes remain enabled if an instrumentation test fails.
@@ -69,6 +70,7 @@
"DOWNSCALE_85",
"DOWNSCALE_90",
"DO_NOT_DOWNSCALE_TO_1080P_ON_TV",
+ "ENFORCE_MINIMUM_TIME_WINDOWS",
"FGS_BG_START_RESTRICTION_CHANGE_ID",
"FGS_TYPE_DATA_SYNC_DEPRECATION_CHANGE_ID",
"FGS_TYPE_DATA_SYNC_DISABLED_CHANGE_ID",
@@ -97,6 +99,7 @@
"OVERRIDE_UNDEFINED_ORIENTATION_TO_NOSENSOR",
"OVERRIDE_LANDSCAPE_ORIENTATION_TO_REVERSE_LANDSCAPE",
"OVERRIDE_ANY_ORIENTATION",
+ "OVERRIDE_ANY_ORIENTATION_TO_USER",
"OVERRIDE_USE_DISPLAY_LANDSCAPE_NATURAL_ORIENTATION",
"OVERRIDE_ENABLE_COMPAT_IGNORE_REQUESTED_ORIENTATION",
"OVERRIDE_ORIENTATION_ONLY_FOR_CAMERA",
@@ -110,6 +113,7 @@
"DEFAULT_RESCIND_BAL_FG_PRIVILEGES_BOUND_SERVICE",
"DEFAULT_RESCIND_BAL_PRIVILEGES_FROM_PENDING_INTENT_SENDER",
"RETURN_DEVICE_VOLUME_BEHAVIOR_ABSOLUTE_ADJUST_ONLY",
+ "OVERRIDE_ENABLE_EXPECTED_PRSENTATION_TIME",
"ENFORCE_INTENTS_TO_MATCH_INTENT_FILTERS"
);
@@ -129,8 +133,10 @@
* Check that only approved changes are overridable.
*/
public void testOnlyAllowedlistedChangesAreOverridable() throws Exception {
+ int platformSdkVersion = getPlatformSdkVersion();
for (Change c : getOnDeviceCompatConfig()) {
- if (c.overridable) {
+ // Skip changeIDs with EnabledSince more than platform sdk version
+ if (c.overridable && c.sinceSdk <= platformSdkVersion) {
assertWithMessage("Please contact compat-team@google.com for approval")
.that(OVERRIDABLE_CHANGES).contains(c.changeName);
}
@@ -141,9 +147,10 @@
* Check that the on device config contains all the expected change ids defined in the platform.
* The device may contain extra changes, but none may be removed.
*/
- public void testDeviceContainsExpectedConfig() throws Exception {
- assertThat(getOnDeviceCompatConfig()).containsAtLeastElementsIn(getExpectedCompatConfig());
- }
+ // Ignored due to b/319227557
+ // public void testDeviceContainsExpectedConfig() throws Exception {
+ // assertThat(getOnDeviceCompatConfig()).containsAtLeastElementsIn(getExpectedCompatConfig());
+ // }
/**
@@ -185,4 +192,16 @@
return changes;
}
+ /**
+ * Return the current platform SDK version for release sdk, else current development version.
+ */
+ private int getPlatformSdkVersion() throws Exception {
+ String codeName = getDevice().getProperty("ro.build.version.codename");
+ if ("REL".equals(codeName)) {
+ String sdkAsString = getDevice().getProperty("ro.build.version.sdk");
+ return Integer.parseInt(sdkAsString);
+ }
+ return CUR_DEVELOPMENT_VERSION;
+ }
+
}
diff --git a/hostsidetests/appcompat/hiddenapi/Android.bp b/hostsidetests/appcompat/hiddenapi/Android.bp
index 1428c3c..88447bc 100644
--- a/hostsidetests/appcompat/hiddenapi/Android.bp
+++ b/hostsidetests/appcompat/hiddenapi/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_lse_app_compat",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appcompat/hiddenapi/app/Android.bp b/hostsidetests/appcompat/hiddenapi/app/Android.bp
index 78093aa..5a5af30 100644
--- a/hostsidetests/appcompat/hiddenapi/app/Android.bp
+++ b/hostsidetests/appcompat/hiddenapi/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_lse_app_compat",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appcompat/host/lib/Android.bp b/hostsidetests/appcompat/host/lib/Android.bp
index 9566a83..ba193e7 100644
--- a/hostsidetests/appcompat/host/lib/Android.bp
+++ b/hostsidetests/appcompat/host/lib/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_lse_app_compat",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appcompat/strictjavapackages/Android.bp b/hostsidetests/appcompat/strictjavapackages/Android.bp
index 0dc1e3f..f77cbcd 100644
--- a/hostsidetests/appcompat/strictjavapackages/Android.bp
+++ b/hostsidetests/appcompat/strictjavapackages/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_mainline_modularization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appcompat/strictjavapackages/OWNERS b/hostsidetests/appcompat/strictjavapackages/OWNERS
index b8822fa..92e37be 100644
--- a/hostsidetests/appcompat/strictjavapackages/OWNERS
+++ b/hostsidetests/appcompat/strictjavapackages/OWNERS
@@ -1,4 +1,4 @@
# Bug component: 819107
-mainline-modularization-rotation+reviews@google.com
-
+# Mainline modularization team
+include platform/packages/modules/common:/OWNERS
diff --git a/hostsidetests/appcompat/strictjavapackages/app/Android.bp b/hostsidetests/appcompat/strictjavapackages/app/Android.bp
index 53c7328..1bc01bc 100644
--- a/hostsidetests/appcompat/strictjavapackages/app/Android.bp
+++ b/hostsidetests/appcompat/strictjavapackages/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_mainline_modularization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appcompat/strictjavapackages/src/android/compat/sjp/cts/StrictJavaPackagesTest.java b/hostsidetests/appcompat/strictjavapackages/src/android/compat/sjp/cts/StrictJavaPackagesTest.java
index c5ff7a4..e8ffd23 100644
--- a/hostsidetests/appcompat/strictjavapackages/src/android/compat/sjp/cts/StrictJavaPackagesTest.java
+++ b/hostsidetests/appcompat/strictjavapackages/src/android/compat/sjp/cts/StrictJavaPackagesTest.java
@@ -246,7 +246,11 @@
"Landroid/app/sdksandbox/ISdkSandboxProcessDeathCallback;",
"Landroid/app/sdksandbox/ISendDataCallback;",
"Landroid/app/sdksandbox/ISharedPreferencesSyncCallback;",
- "Landroid/app/sdksandbox/ISdkToServiceCallback;"
+ "Landroid/app/sdksandbox/ISdkToServiceCallback;",
+ "Landroid/app/sdksandbox/IUnloadSdkCallback;",
+ // b/325060980 : Remove duplication between telephony-common.jar and
+ // services.jar
+ "Lcom/android/server/updates/ConfigUpdateInstallReceiver;"
);
private static final String FEATURE_WEARABLE = "android.hardware.type.watch";
@@ -448,7 +452,6 @@
"Lcom/android/sdksandbox/ISdkSandboxService;",
"Lcom/android/sdksandbox/SandboxLatencyInfo-IA;",
"Lcom/android/sdksandbox/SandboxLatencyInfo;",
- "Lcom/android/sdksandbox/IUnloadSdkCallback;",
"Lcom/android/sdksandbox/IComputeSdkStorageCallback;"
);
@@ -486,6 +489,64 @@
ADSERVICES_SANDBOX_APK_IN_APEX_BURNDOWN_LIST)
.build();
+ // Bluetooth has not been updated on pre-u device
+ private static ImmutableSet<String> PRE_U_APK_IN_APEX_BLUETOOTH_BURNDOWN_LIST =
+ ImmutableSet.of(
+ // b/310322439
+ "Lcom/android/bluetooth/x/android/sysprop/AdbProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/ApkVerityProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/BluetoothProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/CarProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/ContactsProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/CryptoProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/DeviceProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/DisplayProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/HdmiProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/HypervisorProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/InputProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/MediaProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/NetworkProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/OtaProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/PowerProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/SetupWizardProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/SocProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/TelephonyProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/TraceProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/VndkProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/VoldProperties;",
+ "Lcom/android/bluetooth/x/android/sysprop/WifiProperties;");
+
+ /**
+ * Lists of known failures when running testApkInApex_nonClasspathClasses against pre-U devices.
+ *
+ * <p>Add the new item into this list only if the failure is caused by base device image (not
+ * the mainline train).
+ */
+ private static final ImmutableMap<String, ImmutableSet<String>>
+ PRE_U_APK_IN_APEX_BURNDOWN_LIST =
+ new ImmutableMap.Builder<String, ImmutableSet<String>>()
+ .put(
+ "/apex/com.android.btservices/app/BluetoothGoogle/BluetoothGoogle.apk",
+ PRE_U_APK_IN_APEX_BLUETOOTH_BURNDOWN_LIST)
+ .put(
+ "/apex/com.android.btservices/app/Bluetooth/Bluetooth.apk",
+ PRE_U_APK_IN_APEX_BLUETOOTH_BURNDOWN_LIST)
+ .build();
+
+ /**
+ * Lists of known failures when running testApkInApex_nonClasspathClasses against pre-T devices.
+ *
+ * <p> Add the new item into this list only if the failure is caused by base device image (not the mainline train).
+ */
+ private static final ImmutableMap<String, ImmutableSet<String>> PRE_T_APK_IN_APEX_BURNDOWN_LIST =
+ new ImmutableMap.Builder<String, ImmutableSet<String>>()
+ .put("/apex/com.android.cellbroadcast/priv-app/GoogleCellBroadcastServiceModule/GoogleCellBroadcastServiceModule.apk",
+ ImmutableSet.of(
+ // b/303732833
+ "Lcom/android/internal/util/Preconditions;"
+ ))
+ .build();
+
/**
* Fetch all jar files in BCP, SSCP and shared libs and extract all the classes.
*
@@ -809,8 +870,22 @@
// e.g. /apex/com.android.btservices/app/Bluetooth@SC-DEV/Bluetooth.apk ->
// /apex/com.android.btservices/app/Bluetooth/Bluetooth.apk
apk = apk.replaceFirst("@[^/]*", "");
- final ImmutableSet<String> burndownClasses =
- FULL_APK_IN_APEX_BURNDOWN.getOrDefault(apk, ImmutableSet.of());
+ ImmutableSet<String> burndownClasses;
+ if (mDeviceSdkLevel.isDeviceAtLeastU()) {
+ burndownClasses = ImmutableSet.<String>builder()
+ .addAll(FULL_APK_IN_APEX_BURNDOWN.getOrDefault(apk, ImmutableSet.of())).build();
+ } else if (mDeviceSdkLevel.isDeviceAtLeastT()) {
+ burndownClasses = ImmutableSet.<String>builder()
+ .addAll(FULL_APK_IN_APEX_BURNDOWN.getOrDefault(apk, ImmutableSet.of()))
+ .addAll(PRE_U_APK_IN_APEX_BURNDOWN_LIST.getOrDefault(apk, ImmutableSet.of())).build();
+ } else {
+ // testApkInApex_nonClasspathClasses is not part of CTS until T
+ // therefore, running this for pre-T devices with additional list of known failures.
+ // Another option would be to skip this test entirely for pre-T devices.
+ burndownClasses = ImmutableSet.<String>builder()
+ .addAll(FULL_APK_IN_APEX_BURNDOWN.getOrDefault(apk, ImmutableSet.of()))
+ .addAll(PRE_T_APK_IN_APEX_BURNDOWN_LIST.getOrDefault(apk, ImmutableSet.of())).build();
+ }
final Multimap<String, String> duplicates =
Multimaps.filterValues(sJarsToClasses, apkClasses::contains);
final Multimap<String, String> filteredDuplicates =
diff --git a/hostsidetests/appsecurity/Android.bp b/hostsidetests/appsecurity/Android.bp
index c23a716..c9efc88 100644
--- a/hostsidetests/appsecurity/Android.bp
+++ b/hostsidetests/appsecurity/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/certs/Android.bp b/hostsidetests/appsecurity/certs/Android.bp
index 526db77..cf24190 100644
--- a/hostsidetests/appsecurity/certs/Android.bp
+++ b/hostsidetests/appsecurity/certs/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/certs/keysets/Android.bp b/hostsidetests/appsecurity/certs/keysets/Android.bp
index 4359b81..c5a249a 100644
--- a/hostsidetests/appsecurity/certs/keysets/Android.bp
+++ b/hostsidetests/appsecurity/certs/keysets/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/certs/pkgsigverify/Android.bp b/hostsidetests/appsecurity/certs/pkgsigverify/Android.bp
index 2635114..f340a4b 100644
--- a/hostsidetests/appsecurity/certs/pkgsigverify/Android.bp
+++ b/hostsidetests/appsecurity/certs/pkgsigverify/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_framework_android_packages",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/PkgInstallSignatureVerificationTest.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/PkgInstallSignatureVerificationTest.java
index 324e5e8..4361ee7 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/PkgInstallSignatureVerificationTest.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/PkgInstallSignatureVerificationTest.java
@@ -500,13 +500,6 @@
"v2-only-with-rsa-pkcs1-sha256-1024.apk", "signatures do not match");
}
- public void testInstallMaxSizedZipEocdComment() throws Exception {
- // Obtained by modifying apksigner to produce a max-sized (0xffff bytes long) ZIP End of
- // Central Directory comment, and signing the original.apk using the modified apksigner.
- assertInstallSucceeds("v1-only-max-sized-eocd-comment.apk");
- assertInstallSucceeds("v2-only-max-sized-eocd-comment.apk");
- }
-
public void testInstallEphemeralRequiresV2Signature() throws Exception {
assertInstallEphemeralFailsWithError("unsigned-ephemeral.apk",
"Failed to collect certificates");
diff --git a/hostsidetests/appsecurity/test-apps/AccessSerialLegacy/Android.bp b/hostsidetests/appsecurity/test-apps/AccessSerialLegacy/Android.bp
index ba51823..ff2b525 100644
--- a/hostsidetests/appsecurity/test-apps/AccessSerialLegacy/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/AccessSerialLegacy/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/AccessSerialModern/Android.bp b/hostsidetests/appsecurity/test-apps/AccessSerialModern/Android.bp
index 24b6ec1..c63e80d 100644
--- a/hostsidetests/appsecurity/test-apps/AccessSerialModern/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/AccessSerialModern/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/ApkVerityTestApp/Android.bp b/hostsidetests/appsecurity/test-apps/ApkVerityTestApp/Android.bp
index d3ae2a8..957e15f 100644
--- a/hostsidetests/appsecurity/test-apps/ApkVerityTestApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/ApkVerityTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/ApkVerityTestApp/testdata/Android.bp b/hostsidetests/appsecurity/test-apps/ApkVerityTestApp/testdata/Android.bp
index 786cc09..35f4e52 100644
--- a/hostsidetests/appsecurity/test-apps/ApkVerityTestApp/testdata/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/ApkVerityTestApp/testdata/Android.bp
@@ -14,6 +14,7 @@
// A rule to collect apps for debugging purpose. See ApkVerityTestAppPrebuilt/README.md.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/ApkVerityTestAppPrebuilt/Android.bp b/hostsidetests/appsecurity/test-apps/ApkVerityTestAppPrebuilt/Android.bp
index e68621a..727c166 100644
--- a/hostsidetests/appsecurity/test-apps/ApkVerityTestAppPrebuilt/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/ApkVerityTestAppPrebuilt/Android.bp
@@ -16,6 +16,7 @@
// build/make/target/product/security/fsverity-release.x509.der
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -28,4 +29,3 @@
"x86_64/*",
],
}
-
diff --git a/hostsidetests/appsecurity/test-apps/AppAccessData/Android.bp b/hostsidetests/appsecurity/test-apps/AppAccessData/Android.bp
index 32fabc6..8619c13 100644
--- a/hostsidetests/appsecurity/test-apps/AppAccessData/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/AppAccessData/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/Android.bp b/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/Android.bp
index a52e9e6..eb8d8ed 100644
--- a/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/AppWithData/Android.bp b/hostsidetests/appsecurity/test-apps/AppWithData/Android.bp
index 53931f9..38c65a4 100644
--- a/hostsidetests/appsecurity/test-apps/AppWithData/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/AppWithData/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/ApplicationVisibilityCrossUserApp/Android.bp b/hostsidetests/appsecurity/test-apps/ApplicationVisibilityCrossUserApp/Android.bp
index 61a66c0..98dd57a 100644
--- a/hostsidetests/appsecurity/test-apps/ApplicationVisibilityCrossUserApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/ApplicationVisibilityCrossUserApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/AuthBoundKeyApp/Android.bp b/hostsidetests/appsecurity/test-apps/AuthBoundKeyApp/Android.bp
index 5faab76..1ac4633 100644
--- a/hostsidetests/appsecurity/test-apps/AuthBoundKeyApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/AuthBoundKeyApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/CorruptApkTests/Android.bp b/hostsidetests/appsecurity/test-apps/CorruptApkTests/Android.bp
index a898fe7..3a6dd2c 100644
--- a/hostsidetests/appsecurity/test-apps/CorruptApkTests/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/CorruptApkTests/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/CorruptApkTests/compressed_arsc/Android.bp b/hostsidetests/appsecurity/test-apps/CorruptApkTests/compressed_arsc/Android.bp
index 20e6226..fb94418 100644
--- a/hostsidetests/appsecurity/test-apps/CorruptApkTests/compressed_arsc/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/CorruptApkTests/compressed_arsc/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/DeclareNotRuntimePermissions/Android.bp b/hostsidetests/appsecurity/test-apps/DeclareNotRuntimePermissions/Android.bp
index 85d6f86..3f74850 100644
--- a/hostsidetests/appsecurity/test-apps/DeclareNotRuntimePermissions/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/DeclareNotRuntimePermissions/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/DeviceIdentifiers/Android.bp b/hostsidetests/appsecurity/test-apps/DeviceIdentifiers/Android.bp
index 79b81c9..5145bc8 100644
--- a/hostsidetests/appsecurity/test-apps/DeviceIdentifiers/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/DeviceIdentifiers/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/DocumentClient/Android.bp b/hostsidetests/appsecurity/test-apps/DocumentClient/Android.bp
index d6b736d..e31c867 100644
--- a/hostsidetests/appsecurity/test-apps/DocumentClient/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/DocumentClient/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/DocumentProvider/Android.bp b/hostsidetests/appsecurity/test-apps/DocumentProvider/Android.bp
index 723d063..d7f047a 100644
--- a/hostsidetests/appsecurity/test-apps/DocumentProvider/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/DocumentProvider/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/DuplicatePermissionDeclareApp/Android.bp b/hostsidetests/appsecurity/test-apps/DuplicatePermissionDeclareApp/Android.bp
index d667402..6c6969c 100644
--- a/hostsidetests/appsecurity/test-apps/DuplicatePermissionDeclareApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/DuplicatePermissionDeclareApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/DuplicatePermissionSameGroup/Android.bp b/hostsidetests/appsecurity/test-apps/DuplicatePermissionSameGroup/Android.bp
index 037aab2..75cea53 100644
--- a/hostsidetests/appsecurity/test-apps/DuplicatePermissionSameGroup/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/DuplicatePermissionSameGroup/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/EncryptionApp/Android.bp b/hostsidetests/appsecurity/test-apps/EncryptionApp/Android.bp
index bf4df09..b42f081 100644
--- a/hostsidetests/appsecurity/test-apps/EncryptionApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EncryptionApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.bp
index 271fdbb..9a76228 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp2/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp2/Android.bp
index e34a72c..ed1675a 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp2/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp2/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.bp
index 2e0c1d0..9e15979 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.bp
index 284868a..76e4654 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/OWNERS b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UnexposedApp/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UnexposedApp/Android.bp
index 976a4a1..0f67497 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UnexposedApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UnexposedApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserApp/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserApp/Android.bp
index 57fe9ec..75ccaad 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserAppTest/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserAppTest/Android.bp
index d3766f1..fa13564 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserAppTest/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserAppTest/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/util/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/util/Android.bp
index c3e818d..ded3532 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/util/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/util/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/EscalateToRuntimePermissions/Android.bp b/hostsidetests/appsecurity/test-apps/EscalateToRuntimePermissions/Android.bp
index da18781..215603c 100644
--- a/hostsidetests/appsecurity/test-apps/EscalateToRuntimePermissions/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EscalateToRuntimePermissions/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.bp b/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.bp
index 2423476..8b2e58e 100644
--- a/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/InstantCookieApp/Android.bp b/hostsidetests/appsecurity/test-apps/InstantCookieApp/Android.bp
index 0c9df8e..e0f1f00 100644
--- a/hostsidetests/appsecurity/test-apps/InstantCookieApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/InstantCookieApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/InstantCookieApp/OWNERS b/hostsidetests/appsecurity/test-apps/InstantCookieApp/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/InstantCookieApp/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/InstantCookieApp/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/InstantCookieApp2/Android.bp b/hostsidetests/appsecurity/test-apps/InstantCookieApp2/Android.bp
index 5c4573b..6bec416 100644
--- a/hostsidetests/appsecurity/test-apps/InstantCookieApp2/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/InstantCookieApp2/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/InstantCookieApp2/OWNERS b/hostsidetests/appsecurity/test-apps/InstantCookieApp2/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/InstantCookieApp2/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/InstantCookieApp2/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/InstantUpgradeApp/Android.bp b/hostsidetests/appsecurity/test-apps/InstantUpgradeApp/Android.bp
index 677558a..2d4a716 100644
--- a/hostsidetests/appsecurity/test-apps/InstantUpgradeApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/InstantUpgradeApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/InstrumentationAppDiffCert/Android.bp b/hostsidetests/appsecurity/test-apps/InstrumentationAppDiffCert/Android.bp
index fcd862d..3eeaa4a 100644
--- a/hostsidetests/appsecurity/test-apps/InstrumentationAppDiffCert/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/InstrumentationAppDiffCert/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/Android.bp b/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/Android.bp
index 2c0c1b8..6c8d0af 100644
--- a/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/OWNERS b/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/OWNERS
index f17768d..bcbb12a 100644
--- a/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/OWNERS
@@ -1,3 +1,5 @@
# Bug component: 533114
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
-toddke@google.com
+
diff --git a/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_a/Android.bp b/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_a/Android.bp
index e16150a..8e07ff5 100644
--- a/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_a/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_a/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -69,6 +70,6 @@
// Assign a unique package ID to this feature split. Since these are
// isolated splits, it must only be unique across a dependency chain.
"--package-id 0x80",
- "--revision-code 10"
+ "--revision-code 10",
],
}
diff --git a/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_b/Android.bp b/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_b/Android.bp
index bee1a5c..a6c1226 100644
--- a/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_b/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_b/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_c/Android.bp b/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_c/Android.bp
index f5c109d..6d1f8ab 100644
--- a/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_c/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/feature_c/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/KeyRotationTest/Android.bp b/hostsidetests/appsecurity/test-apps/KeyRotationTest/Android.bp
index 09eb4e9..b03b51b 100644
--- a/hostsidetests/appsecurity/test-apps/KeyRotationTest/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/KeyRotationTest/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/KeyRotationTest/ServiceTest/Android.bp b/hostsidetests/appsecurity/test-apps/KeyRotationTest/ServiceTest/Android.bp
index 0b69677..7971d2c 100644
--- a/hostsidetests/appsecurity/test-apps/KeyRotationTest/ServiceTest/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/KeyRotationTest/ServiceTest/Android.bp
@@ -20,6 +20,7 @@
// the PackageManager checkSignatures APIs.
package {
+ default_team: "trendy_team_platform_security",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/ListeningPortsApp/Android.bp b/hostsidetests/appsecurity/test-apps/ListeningPortsApp/Android.bp
index 6fc4ac5..cac0105 100644
--- a/hostsidetests/appsecurity/test-apps/ListeningPortsApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/ListeningPortsApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/ListeningPortsApp/src/android/appsecurity/cts/listeningports/ListeningPortsTest.java b/hostsidetests/appsecurity/test-apps/ListeningPortsApp/src/android/appsecurity/cts/listeningports/ListeningPortsTest.java
index 6b90c92..cb36692 100644
--- a/hostsidetests/appsecurity/test-apps/ListeningPortsApp/src/android/appsecurity/cts/listeningports/ListeningPortsTest.java
+++ b/hostsidetests/appsecurity/test-apps/ListeningPortsApp/src/android/appsecurity/cts/listeningports/ListeningPortsTest.java
@@ -61,7 +61,7 @@
static {
// IPv4 exceptions
// Patterns containing ":" are allowed address port combinations
- // Pattterns contains " " are allowed address UID combinations
+ // Patterns contains " " are allowed address UID combinations
// Patterns containing both are allowed address, port, and UID combinations
EXCEPTION_PATTERNS.add("0.0.0.0:5555"); // emulator port
EXCEPTION_PATTERNS.add("0.0.0.0:9101"); // verified ports
diff --git a/hostsidetests/appsecurity/test-apps/LocationPolicyApp/Android.bp b/hostsidetests/appsecurity/test-apps/LocationPolicyApp/Android.bp
index 13e1934..4c9935a 100644
--- a/hostsidetests/appsecurity/test-apps/LocationPolicyApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/LocationPolicyApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/MajorVersionApp/OWNERS b/hostsidetests/appsecurity/test-apps/MajorVersionApp/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/MajorVersionApp/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/MajorVersionApp/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000000000ffff/Android.bp b/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000000000ffff/Android.bp
index 2bf1d0a..810f23d 100644
--- a/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000000000ffff/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000000000ffff/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version00000000ffffffff/Android.bp b/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version00000000ffffffff/Android.bp
index b8d3ddc..d05d3ef 100644
--- a/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version00000000ffffffff/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version00000000ffffffff/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000ff00000000/Android.bp b/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000ff00000000/Android.bp
index 3ba2c30..7bac940 100644
--- a/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000ff00000000/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000ff00000000/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000ffffffffff/Android.bp b/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000ffffffffff/Android.bp
index a037e79..7d738f7 100644
--- a/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000ffffffffff/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/MajorVersionApp/Version000000ffffffffff/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/MajorVersionApp/src-common/Android.bp b/hostsidetests/appsecurity/test-apps/MajorVersionApp/src-common/Android.bp
index e094370..9392c7d 100644
--- a/hostsidetests/appsecurity/test-apps/MajorVersionApp/src-common/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/MajorVersionApp/src-common/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/MalformedDuplicatePermission/Android.bp b/hostsidetests/appsecurity/test-apps/MalformedDuplicatePermission/Android.bp
index 1212186..a3c90ed8 100644
--- a/hostsidetests/appsecurity/test-apps/MalformedDuplicatePermission/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/MalformedDuplicatePermission/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/MediaStorageApp/Android.bp b/hostsidetests/appsecurity/test-apps/MediaStorageApp/Android.bp
index 8981816..50fcfa9 100644
--- a/hostsidetests/appsecurity/test-apps/MediaStorageApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/MediaStorageApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/MediaStorageApp/src/com/android/cts/mediastorageapp/MediaStorageTest.java b/hostsidetests/appsecurity/test-apps/MediaStorageApp/src/com/android/cts/mediastorageapp/MediaStorageTest.java
index c4da1a6..360024f 100644
--- a/hostsidetests/appsecurity/test-apps/MediaStorageApp/src/com/android/cts/mediastorageapp/MediaStorageTest.java
+++ b/hostsidetests/appsecurity/test-apps/MediaStorageApp/src/com/android/cts/mediastorageapp/MediaStorageTest.java
@@ -45,11 +45,6 @@
import android.os.ParcelFileDescriptor;
import android.provider.MediaStore;
import android.provider.MediaStore.MediaColumns;
-import android.support.test.uiautomator.UiDevice;
-import android.support.test.uiautomator.UiObject;
-import android.support.test.uiautomator.UiObjectNotFoundException;
-import android.support.test.uiautomator.UiScrollable;
-import android.support.test.uiautomator.UiSelector;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
@@ -970,15 +965,6 @@
}
}
- private static void scrollIntoView(UiSelector selector) {
- UiScrollable uiScrollable = new UiScrollable(new UiSelector().scrollable(true));
- try {
- uiScrollable.scrollIntoView(selector);
- } catch (UiObjectNotFoundException e) {
- // Scrolling can fail if the UI is not scrollable
- }
- }
-
private static Uri createDownload() throws IOException {
final String content = "<html><body>Content</body></html>";
final String displayName = "cts" + System.nanoTime();
diff --git a/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.bp b/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.bp
index da3f96e..e23f523 100644
--- a/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/NoDataStorageApp/Android.bp b/hostsidetests/appsecurity/test-apps/NoDataStorageApp/Android.bp
index 3599388..0997e41 100644
--- a/hostsidetests/appsecurity/test-apps/NoDataStorageApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/NoDataStorageApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/NoRestartApp/Android.bp b/hostsidetests/appsecurity/test-apps/NoRestartApp/Android.bp
index 6368312..19d9970 100644
--- a/hostsidetests/appsecurity/test-apps/NoRestartApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/NoRestartApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/NoRestartApp/OWNERS b/hostsidetests/appsecurity/test-apps/NoRestartApp/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/NoRestartApp/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/NoRestartApp/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/NoRestartApp/feature/Android.bp b/hostsidetests/appsecurity/test-apps/NoRestartApp/feature/Android.bp
index 0baacdb..e294d0f 100644
--- a/hostsidetests/appsecurity/test-apps/NoRestartApp/feature/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/NoRestartApp/feature/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/OrderedActivityApp/Android.bp b/hostsidetests/appsecurity/test-apps/OrderedActivityApp/Android.bp
index 75aa44f..cf41c28 100644
--- a/hostsidetests/appsecurity/test-apps/OrderedActivityApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/OrderedActivityApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/OrderedActivityApp/OWNERS b/hostsidetests/appsecurity/test-apps/OrderedActivityApp/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/OrderedActivityApp/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/OrderedActivityApp/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/PackageAccessApp/Android.bp b/hostsidetests/appsecurity/test-apps/PackageAccessApp/Android.bp
index 063432c..4798fba3 100644
--- a/hostsidetests/appsecurity/test-apps/PackageAccessApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/PackageAccessApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/PackageAccessApp/OWNERS b/hostsidetests/appsecurity/test-apps/PackageAccessApp/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/PackageAccessApp/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/PackageAccessApp/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/PackageInstallerPermissionRequestApp/Android.bp b/hostsidetests/appsecurity/test-apps/PackageInstallerPermissionRequestApp/Android.bp
index 22fbd46..df0ef39 100644
--- a/hostsidetests/appsecurity/test-apps/PackageInstallerPermissionRequestApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/PackageInstallerPermissionRequestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/PackageInstallerWhitelistApp/Android.bp b/hostsidetests/appsecurity/test-apps/PackageInstallerWhitelistApp/Android.bp
index 8580292..32f8e33 100644
--- a/hostsidetests/appsecurity/test-apps/PackageInstallerWhitelistApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/PackageInstallerWhitelistApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/Android.bp b/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/Android.bp
index 0360901..519e8b6 100644
--- a/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/PermissionDeclareAppCompat/Android.bp b/hostsidetests/appsecurity/test-apps/PermissionDeclareAppCompat/Android.bp
index 6081574..7ad4ba3 100644
--- a/hostsidetests/appsecurity/test-apps/PermissionDeclareAppCompat/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/PermissionDeclareAppCompat/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp/Android.bp b/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp/Android.bp
index 1825f01..0eebfdd 100644
--- a/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp/Android.bp
@@ -2,6 +2,7 @@
// Package w/ tests
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp/OWNERS b/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/Android.bp b/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/Android.bp
index f1eb155..7c675b4 100644
--- a/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/ReadSettingsFieldsApp/Android.bp b/hostsidetests/appsecurity/test-apps/ReadSettingsFieldsApp/Android.bp
index 0af7515..8717501 100644
--- a/hostsidetests/appsecurity/test-apps/ReadSettingsFieldsApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/ReadSettingsFieldsApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/ReadSettingsFieldsApp/OWNERS b/hostsidetests/appsecurity/test-apps/ReadSettingsFieldsApp/OWNERS
index 619063a..b98621c 100644
--- a/hostsidetests/appsecurity/test-apps/ReadSettingsFieldsApp/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/ReadSettingsFieldsApp/OWNERS
@@ -1,5 +1,5 @@
# Bug component: 856262
-svetoslavganov@google.com
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
schfan@google.com
diff --git a/hostsidetests/appsecurity/test-apps/RoleSecurityTestApp/Android.bp b/hostsidetests/appsecurity/test-apps/RoleSecurityTestApp/Android.bp
index 5af5618..e603ed8 100644
--- a/hostsidetests/appsecurity/test-apps/RoleSecurityTestApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/RoleSecurityTestApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SessionInspector/Android.bp b/hostsidetests/appsecurity/test-apps/SessionInspector/Android.bp
index 797e317..ffe904d 100644
--- a/hostsidetests/appsecurity/test-apps/SessionInspector/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SessionInspector/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -29,6 +30,7 @@
"general-tests",
],
}
+
android_test_helper_app {
name: "CtsSessionInspectorAppB",
defaults: ["cts_support_defaults"],
diff --git a/hostsidetests/appsecurity/test-apps/SessionInspector/OWNERS b/hostsidetests/appsecurity/test-apps/SessionInspector/OWNERS
index 9d4a924..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/SessionInspector/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/SessionInspector/OWNERS
@@ -1,4 +1,4 @@
# Bug component: 533114
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
-toddke@google.com
-chiuwinson@google.com
diff --git a/hostsidetests/appsecurity/test-apps/SettingsProviderInvalidKeyTestApp/Android.bp b/hostsidetests/appsecurity/test-apps/SettingsProviderInvalidKeyTestApp/Android.bp
index 85cf91a..eeba754 100644
--- a/hostsidetests/appsecurity/test-apps/SettingsProviderInvalidKeyTestApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SettingsProviderInvalidKeyTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SharedUidInstall/Android.bp b/hostsidetests/appsecurity/test-apps/SharedUidInstall/Android.bp
index 572f459..b4dbf3c 100644
--- a/hostsidetests/appsecurity/test-apps/SharedUidInstall/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SharedUidInstall/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SharedUidInstall/OWNERS b/hostsidetests/appsecurity/test-apps/SharedUidInstall/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/SharedUidInstall/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/SharedUidInstall/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/SharedUidInstallDiffCert/Android.bp b/hostsidetests/appsecurity/test-apps/SharedUidInstallDiffCert/Android.bp
index 2804998..d1ebefb 100644
--- a/hostsidetests/appsecurity/test-apps/SharedUidInstallDiffCert/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SharedUidInstallDiffCert/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SharedUidInstallDiffCert/OWNERS b/hostsidetests/appsecurity/test-apps/SharedUidInstallDiffCert/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/SharedUidInstallDiffCert/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/SharedUidInstallDiffCert/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/SimpleAppInstall/Android.bp b/hostsidetests/appsecurity/test-apps/SimpleAppInstall/Android.bp
index 12f8f73..41b9a07 100644
--- a/hostsidetests/appsecurity/test-apps/SimpleAppInstall/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SimpleAppInstall/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SimpleAppInstall/OWNERS b/hostsidetests/appsecurity/test-apps/SimpleAppInstall/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/SimpleAppInstall/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/SimpleAppInstall/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/SimpleAppInstallDiffCert/Android.bp b/hostsidetests/appsecurity/test-apps/SimpleAppInstallDiffCert/Android.bp
index ddad4ea..11b09be 100644
--- a/hostsidetests/appsecurity/test-apps/SimpleAppInstallDiffCert/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SimpleAppInstallDiffCert/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SimpleAppInstallDiffCert/OWNERS b/hostsidetests/appsecurity/test-apps/SimpleAppInstallDiffCert/OWNERS
index bdc654a..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/SimpleAppInstallDiffCert/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/SimpleAppInstallDiffCert/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/Android.bp
index 6edc9eb..59c1b28 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -65,6 +66,9 @@
"general-tests",
"mts-mainline-infra",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
// Define a variant with a different revision code
@@ -83,6 +87,9 @@
"cts",
"general-tests",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
// Define a variant with a different version code
@@ -100,6 +107,9 @@
"cts",
"general-tests",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
// Define a variant with a different signature
@@ -117,6 +127,9 @@
"cts",
"general-tests",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
// Define a variant requiring a split for install
@@ -135,6 +148,9 @@
"cts",
"general-tests",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
// Define a variant with different codes and resources for the inherit updated test of the base apk
@@ -163,6 +179,9 @@
"cts",
"general-tests",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
// Define a variant which includes a provider and service declared in other split apk. And they only
@@ -181,4 +200,7 @@
"cts",
"general-tests",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/OWNERS b/hostsidetests/appsecurity/test-apps/SplitApp/OWNERS
index f17768d..d2c1b9a 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/OWNERS
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/OWNERS
@@ -1,3 +1,4 @@
# Bug component: 533114
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
-toddke@google.com
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/feature_rose/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/feature_rose/Android.bp
index c2b20fa..c516d78 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/feature_rose/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/feature_rose/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -39,4 +40,7 @@
"--replace-version",
"--package-id 0x81",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/feature_warm/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/feature_warm/Android.bp
index 79af956..b2f32c0 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/feature_warm/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/feature_warm/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -47,6 +48,9 @@
"cts",
"general-tests",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
// Define a variant requiring a split for install
@@ -67,6 +71,9 @@
"cts",
"general-tests",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
// Define a variant with different codes and resources for the inherit updated test of the
@@ -74,10 +81,16 @@
android_test_helper_app {
name: "CtsSplitAppFeatureWarmRevisionA",
defaults: ["CtsSplitAppFeatureWarmDefaults"],
- srcs: ["src/**/*.java", "revision_a/src/**/*.java"],
- resource_dirs: ["res", "revision_a/res"],
+ srcs: [
+ "src/**/*.java",
+ "revision_a/src/**/*.java",
+ ],
+ resource_dirs: [
+ "res",
+ "revision_a/res",
+ ],
asset_dirs: ["revision_a/assets"],
- manifest : "revision_a/AndroidManifest.xml",
+ manifest: "revision_a/AndroidManifest.xml",
package_splits: ["v7"],
certificate: ":cts-testkey1",
aaptflags: [
@@ -92,4 +105,7 @@
"cts",
"general-tests",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/jni/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/jni/Android.bp
index 86dac91..20360c3 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/jni/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/jni/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -86,7 +87,6 @@
],
}
-
TARGET_TEST_SUITES = [
"cts",
"general-tests",
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/Android.bp
index 8c4ca1c..a45d104 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/Android.bp
@@ -18,6 +18,7 @@
// DO NOT MODIFY THIS FILE
package {
+ default_team: "trendy_team_framework_android_packages",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/Android.bp
index 4f25179..6781169 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/Android.bp
@@ -17,6 +17,7 @@
// DO NOT MODIFY THIS FILE.
package {
+ default_team: "trendy_team_framework_android_packages",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/Android.bp
index cad88dba..a9553cc 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/Android.bp
@@ -17,6 +17,7 @@
// DO NOT MODIFY THIS FILE.
package {
+ default_team: "trendy_team_framework_android_packages",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/Android.bp
index 09d946b..cc3d3f3 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/Android.bp
@@ -17,6 +17,7 @@
// DO NOT MODIFY THIS FILE.
package {
+ default_team: "trendy_team_framework_android_packages",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/Android.bp
index 17e323e..86d46fc 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/Android.bp
@@ -17,6 +17,7 @@
// DO NOT MODIFY THIS FILE.
package {
+ default_team: "trendy_team_framework_android_packages",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/Android.bp
index 10462a4..55a626f 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/Android.bp
@@ -17,6 +17,7 @@
// DO NOT MODIFY THIS FILE.
package {
+ default_team: "trendy_team_framework_android_packages",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/Android.bp
index 3492aca..714cf16 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/Android.bp
@@ -17,6 +17,7 @@
// DO NOT MODIFY THIS FILE.
package {
+ default_team: "trendy_team_framework_android_packages",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/requiredsplittype/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/requiredsplittype/Android.bp
index e8656a1..96e3581 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/requiredsplittype/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/requiredsplittype/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -73,4 +74,4 @@
"cts",
"general-tests",
],
-}
\ No newline at end of file
+}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/requiredsplittype/types/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/requiredsplittype/types/Android.bp
index ac1fbe8..b8477ba 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/requiredsplittype/types/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/requiredsplittype/types/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -98,4 +99,4 @@
"cts",
"general-tests",
],
-}
\ No newline at end of file
+}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/SplitAppTest.java b/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/SplitAppTest.java
index c1a5b1f..acd0c69 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/SplitAppTest.java
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/SplitAppTest.java
@@ -580,7 +580,7 @@
} catch (SecurityException expected) {
}
- // New Vibrate permision should be granted
+ // New Vibrate permission should be granted
getContext().enforceCallingOrSelfPermission(android.Manifest.permission.VIBRATE, null);
}
diff --git a/hostsidetests/appsecurity/test-apps/StatsdSecurityApp/Android.bp b/hostsidetests/appsecurity/test-apps/StatsdSecurityApp/Android.bp
index bf101d7..875b3f9 100644
--- a/hostsidetests/appsecurity/test-apps/StatsdSecurityApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/StatsdSecurityApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/StorageApp/Android.bp b/hostsidetests/appsecurity/test-apps/StorageApp/Android.bp
index ab51a4f..a852b73 100644
--- a/hostsidetests/appsecurity/test-apps/StorageApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/StorageApp/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -9,7 +10,7 @@
sdk_version: "test_current",
libs: [
"android.test.base",
- "ub-uiautomator",
+ "androidx.test.uiautomator_uiautomator",
],
}
@@ -19,7 +20,7 @@
sdk_version: "test_current",
static_libs: [
"androidx.test.rules",
- "ub-uiautomator",
+ "androidx.test.uiautomator_uiautomator",
],
libs: ["android.test.base"],
srcs: ["src/**/*.java"],
@@ -36,7 +37,7 @@
sdk_version: "test_current",
static_libs: [
"androidx.test.rules",
- "ub-uiautomator",
+ "androidx.test.uiautomator_uiautomator",
],
libs: ["android.test.base"],
srcs: ["src/**/*.java"],
diff --git a/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/StorageTest.java b/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/StorageTest.java
index 4672943..4720c05 100644
--- a/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/StorageTest.java
+++ b/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/StorageTest.java
@@ -44,12 +44,13 @@
import android.os.UserHandle;
import android.os.storage.StorageManager;
import android.provider.Settings;
-import android.support.test.uiautomator.UiDevice;
-import android.support.test.uiautomator.UiObjectNotFoundException;
-import android.support.test.uiautomator.UiScrollable;
-import android.support.test.uiautomator.UiSelector;
import android.test.InstrumentationTestCase;
+import androidx.test.uiautomator.UiDevice;
+import androidx.test.uiautomator.UiObjectNotFoundException;
+import androidx.test.uiautomator.UiScrollable;
+import androidx.test.uiautomator.UiSelector;
+
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -162,16 +163,22 @@
}
private void clearSpaceCar(UiDevice device) throws UiObjectNotFoundException {
- UiScrollable localObject = new UiScrollable(new UiSelector().scrollable(true));
- assertNotNull("Cannot find scrollable object.", localObject);
- ((UiScrollable) localObject).setMaxSearchSwipes(10);
- try {
- ((UiScrollable) localObject).scrollIntoView(
- new UiSelector().textContains("internal storage"));
- } catch (UiObjectNotFoundException localUiObjectNotFoundException) {
- // Scrolling can fail if the UI is not scrollable
+ String storageString = "internal storage";
+ int i = device.findObjects(androidx.test.uiautomator.By.scrollable(true)).size();
+ for (int j = 0; j < i; j++) {
+ UiScrollable localObject = new UiScrollable(
+ new UiSelector().scrollable(true).instance(j));
+ localObject.setMaxSearchSwipes(10);
+ try {
+ boolean found = localObject.scrollTextIntoView(storageString);
+ if (found) {
+ break;
+ }
+ } catch (UiObjectNotFoundException localUiObjectNotFoundException) {
+ // Scrolling can fail if the UI is not scrollable
+ }
}
- device.findObject(new UiSelector().textContains("internal storage")).click();
+ device.findObject(new UiSelector().textContains(storageString)).click();
device.waitForIdle();
device.findObject(new UiSelector().textContains("Clear storage")).click();
diff --git a/hostsidetests/appsecurity/test-apps/StorageStatsApp/Android.bp b/hostsidetests/appsecurity/test-apps/StorageStatsApp/Android.bp
index 4abe1a4..5479b59 100644
--- a/hostsidetests/appsecurity/test-apps/StorageStatsApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/StorageStatsApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/TargetInstrumentationApp/Android.bp b/hostsidetests/appsecurity/test-apps/TargetInstrumentationApp/Android.bp
index ba0bbee..206cbfd 100644
--- a/hostsidetests/appsecurity/test-apps/TargetInstrumentationApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/TargetInstrumentationApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/UseEmbeddedDexApp/Android.bp b/hostsidetests/appsecurity/test-apps/UseEmbeddedDexApp/Android.bp
index a76d28e..376bab8 100644
--- a/hostsidetests/appsecurity/test-apps/UseEmbeddedDexApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/UseEmbeddedDexApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.bp b/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.bp
index 873b10a..6cbbd3e 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/UseProcessFailActivity/Android.bp b/hostsidetests/appsecurity/test-apps/UseProcessFailActivity/Android.bp
index 6540ac9..5e91081 100644
--- a/hostsidetests/appsecurity/test-apps/UseProcessFailActivity/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/UseProcessFailActivity/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/UseProcessFailApplication/Android.bp b/hostsidetests/appsecurity/test-apps/UseProcessFailApplication/Android.bp
index 8665e69..5bf62bf 100644
--- a/hostsidetests/appsecurity/test-apps/UseProcessFailApplication/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/UseProcessFailApplication/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/UseProcessFailProvider/Android.bp b/hostsidetests/appsecurity/test-apps/UseProcessFailProvider/Android.bp
index f0b9223..f56b8c2 100644
--- a/hostsidetests/appsecurity/test-apps/UseProcessFailProvider/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/UseProcessFailProvider/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/UseProcessFailReceiver/Android.bp b/hostsidetests/appsecurity/test-apps/UseProcessFailReceiver/Android.bp
index b06920b..bc6d618 100644
--- a/hostsidetests/appsecurity/test-apps/UseProcessFailReceiver/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/UseProcessFailReceiver/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/UseProcessFailService/Android.bp b/hostsidetests/appsecurity/test-apps/UseProcessFailService/Android.bp
index bba62ad..a1ad59f 100644
--- a/hostsidetests/appsecurity/test-apps/UseProcessFailService/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/UseProcessFailService/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/UseProcessSuccess/Android.bp b/hostsidetests/appsecurity/test-apps/UseProcessSuccess/Android.bp
index aa9c52a..765831b 100644
--- a/hostsidetests/appsecurity/test-apps/UseProcessSuccess/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/UseProcessSuccess/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/V3SigningSchemeRotation/Android.bp b/hostsidetests/appsecurity/test-apps/V3SigningSchemeRotation/Android.bp
index c799d9d..23f414c 100644
--- a/hostsidetests/appsecurity/test-apps/V3SigningSchemeRotation/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/V3SigningSchemeRotation/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.bp b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.bp
index 27b2310..5a7e76a 100644
--- a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp2/Android.bp b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp2/Android.bp
index e28c0f0..a2f0715 100644
--- a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp2/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp2/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/malBadKey/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/malBadKey/Android.bp
index d69562c..afe310d 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/malBadKey/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/malBadKey/Android.bp
@@ -14,6 +14,7 @@
//apks signed cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/malNoDef/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/malNoDef/Android.bp
index a0d46f3..3fc5d97 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/malNoDef/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/malNoDef/Android.bp
@@ -14,6 +14,7 @@
//apks signed cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/malOneDef/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/malOneDef/Android.bp
index 50192fb..06f9680 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/malOneDef/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/malOneDef/Android.bp
@@ -14,6 +14,7 @@
//apks signed cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/permDef/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/permDef/Android.bp
index 841bef2..ab3ce07 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/permDef/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/permDef/Android.bp
@@ -14,6 +14,7 @@
//apks signed cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/permUse/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/permUse/Android.bp
index dbb58eb..0dda3a7 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/permUse/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/permUse/Android.bp
@@ -14,6 +14,7 @@
//apks signed cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/testApp/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/testApp/Android.bp
index 0788393..4966758 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/testApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/testApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/uA/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/uA/Android.bp
index cabba2b..fd2c2d1 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/uA/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/uA/Android.bp
@@ -14,6 +14,7 @@
//apks signed by cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/uAB/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/uAB/Android.bp
index 8461773..12da1af 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/uAB/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/uAB/Android.bp
@@ -14,6 +14,7 @@
//apks signed cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/uAuB/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/uAuB/Android.bp
index f233cf5..acdfaca 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/uAuB/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/uAuB/Android.bp
@@ -14,6 +14,7 @@
//apks signed cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/uB/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/uB/Android.bp
index a5d423c..fa0c7ec 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/uB/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/uB/Android.bp
@@ -14,6 +14,7 @@
//apks signed cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/uBsharedUser/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/uBsharedUser/Android.bp
index 1a9f810..ab22f3d 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/uBsharedUser/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/uBsharedUser/Android.bp
@@ -14,6 +14,7 @@
//apks signed cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/uEcA/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/uEcA/Android.bp
index c91a30d..4529b0f 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/uEcA/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/uEcA/Android.bp
@@ -14,6 +14,7 @@
//apks signed by cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/keysets/uNone/Android.bp b/hostsidetests/appsecurity/test-apps/keysets/uNone/Android.bp
index 2c8c2f4..a11b643 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/uNone/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/keysets/uNone/Android.bp
@@ -14,6 +14,7 @@
//apks signed cts-keyset-test-a
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/rro/OverlayAll/Android.bp b/hostsidetests/appsecurity/test-apps/rro/OverlayAll/Android.bp
index aba5c12..0b89c5b 100644
--- a/hostsidetests/appsecurity/test-apps/rro/OverlayAll/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/rro/OverlayAll/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/rro/OverlayAndroid/Android.bp b/hostsidetests/appsecurity/test-apps/rro/OverlayAndroid/Android.bp
index 65b17d9..b202ac8 100644
--- a/hostsidetests/appsecurity/test-apps/rro/OverlayAndroid/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/rro/OverlayAndroid/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/rro/OverlayApp/Android.bp b/hostsidetests/appsecurity/test-apps/rro/OverlayApp/Android.bp
index 515ee5b..d7d7dee 100644
--- a/hostsidetests/appsecurity/test-apps/rro/OverlayApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/rro/OverlayApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/rro/OverlayPolicyProduct/Android.bp b/hostsidetests/appsecurity/test-apps/rro/OverlayPolicyProduct/Android.bp
index dbc33d8..f32e7aa 100644
--- a/hostsidetests/appsecurity/test-apps/rro/OverlayPolicyProduct/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/rro/OverlayPolicyProduct/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/rro/OverlayPolicySignatureDifferent/Android.bp b/hostsidetests/appsecurity/test-apps/rro/OverlayPolicySignatureDifferent/Android.bp
index 8db00a3..f4c2764 100644
--- a/hostsidetests/appsecurity/test-apps/rro/OverlayPolicySignatureDifferent/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/rro/OverlayPolicySignatureDifferent/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/rro/OverlayPolicySystem/Android.bp b/hostsidetests/appsecurity/test-apps/rro/OverlayPolicySystem/Android.bp
index 865bb71..c3f5ffe 100644
--- a/hostsidetests/appsecurity/test-apps/rro/OverlayPolicySystem/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/rro/OverlayPolicySystem/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/rro/OverlayPolicyVendor/Android.bp b/hostsidetests/appsecurity/test-apps/rro/OverlayPolicyVendor/Android.bp
index 284b3c4..3c86246 100644
--- a/hostsidetests/appsecurity/test-apps/rro/OverlayPolicyVendor/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/rro/OverlayPolicyVendor/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/rro/OverlayTarget/Android.bp b/hostsidetests/appsecurity/test-apps/rro/OverlayTarget/Android.bp
index 1d7988a..cde5659 100644
--- a/hostsidetests/appsecurity/test-apps/rro/OverlayTarget/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/rro/OverlayTarget/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/stubime/Android.bp b/hostsidetests/appsecurity/test-apps/stubime/Android.bp
index 15fc232..e8417fa 100644
--- a/hostsidetests/appsecurity/test-apps/stubime/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/stubime/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/appsecurity/test-apps/tinyapp/Android.bp b/hostsidetests/appsecurity/test-apps/tinyapp/Android.bp
index e8e9a67..faabe95 100644
--- a/hostsidetests/appsecurity/test-apps/tinyapp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/tinyapp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/biometrics/Android.bp b/hostsidetests/biometrics/Android.bp
index 7882d44..99942bf 100644
--- a/hostsidetests/biometrics/Android.bp
+++ b/hostsidetests/biometrics/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_biometrics_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/biometrics/app/Android.bp b/hostsidetests/biometrics/app/Android.bp
index 2f24d4e..44d3e34 100644
--- a/hostsidetests/biometrics/app/Android.bp
+++ b/hostsidetests/biometrics/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_biometrics_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/blobstore/OWNERS b/hostsidetests/blobstore/OWNERS
index b6533e1..a58a512 100644
--- a/hostsidetests/blobstore/OWNERS
+++ b/hostsidetests/blobstore/OWNERS
@@ -1,4 +1,4 @@
-# Bug component: 533114
+# Bug component: 25692
set noparent
file:platform/frameworks/base:/apex/blobstore/OWNERS
diff --git a/hostsidetests/calllog/Android.bp b/hostsidetests/calllog/Android.bp
index 4979fed..f9333d7 100644
--- a/hostsidetests/calllog/Android.bp
+++ b/hostsidetests/calllog/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_telecom",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/calllog/app/Android.bp b/hostsidetests/calllog/app/Android.bp
index 1b6529b..e7093ec 100644
--- a/hostsidetests/calllog/app/Android.bp
+++ b/hostsidetests/calllog/app/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_telecom",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/car/util/src/android/car/cts/CarHostJUnit4TestCase.java b/hostsidetests/car/util/src/android/car/cts/CarHostJUnit4TestCase.java
index 5c158d9..6ca62f2 100644
--- a/hostsidetests/car/util/src/android/car/cts/CarHostJUnit4TestCase.java
+++ b/hostsidetests/car/util/src/android/car/cts/CarHostJUnit4TestCase.java
@@ -573,7 +573,17 @@
* Gets the system server uptime (or {@code -1} if not available).
*/
protected long getSystemServerUptime() throws DeviceNotAvailableException {
- return getDevice().getIntProperty("sys.system_server.start_uptime", -1);
+ // Do not use getDevice().getIntProperty because it internally caches the value and will
+ // not return the latest value.
+ try {
+ return Long.parseLong(getDevice().executeShellCommand(
+ "getprop sys.system_server.start_uptime").strip());
+ } catch (DeviceNotAvailableException e) {
+ throw e;
+ } catch (Exception e) {
+ CLog.w("Failed to getprop sys.system_server.start_uptime", e);
+ return -1;
+ }
}
/**
diff --git a/hostsidetests/classloaders/OWNERS b/hostsidetests/classloaders/OWNERS
index 18f4805..350fa41 100644
--- a/hostsidetests/classloaders/OWNERS
+++ b/hostsidetests/classloaders/OWNERS
@@ -2,7 +2,6 @@
jiakaiz@google.com
mast@google.com
ngeoffray@google.com
-oth@google.com
rpl@google.com
skvadrik@google.com
vmarko@google.com
diff --git a/hostsidetests/classpath/Android.bp b/hostsidetests/classpath/Android.bp
index 3397e24..92cd084 100644
--- a/hostsidetests/classpath/Android.bp
+++ b/hostsidetests/classpath/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_mainline_modularization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/credentials/OWNERS b/hostsidetests/credentials/OWNERS
new file mode 100644
index 0000000..ffef4ee
--- /dev/null
+++ b/hostsidetests/credentials/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 1218609
+include platform/frameworks/base:/core/java/android/credentials/OWNERS
\ No newline at end of file
diff --git a/hostsidetests/dexmetadata/OWNERS b/hostsidetests/dexmetadata/OWNERS
index 5a4431e..9442048 100644
--- a/hostsidetests/dexmetadata/OWNERS
+++ b/hostsidetests/dexmetadata/OWNERS
@@ -1,2 +1,4 @@
-calin@google.com
+# Bug component: 86431
ngeoffray@google.com
+dobrota@google.com
+jiakaiz@google.com
diff --git a/hostsidetests/dexmetadata/host/OWNERS b/hostsidetests/dexmetadata/host/OWNERS
deleted file mode 100644
index 9d50f1c..0000000
--- a/hostsidetests/dexmetadata/host/OWNERS
+++ /dev/null
@@ -1,2 +0,0 @@
-# Bug component: 86431
-calin@google.com
\ No newline at end of file
diff --git a/hostsidetests/graphics/displaymode/OWNERS b/hostsidetests/graphics/displaymode/OWNERS
index 7833911..15225ee 100644
--- a/hostsidetests/graphics/displaymode/OWNERS
+++ b/hostsidetests/graphics/displaymode/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 687598
-kritidang@google.com
-blindahl@google.com
\ No newline at end of file
+blindahl@google.com
diff --git a/hostsidetests/graphics/gpuprofiling/Android.bp b/hostsidetests/graphics/gpuprofiling/Android.bp
index c218858..6a4ee0e 100644
--- a/hostsidetests/graphics/gpuprofiling/Android.bp
+++ b/hostsidetests/graphics/gpuprofiling/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_gpu",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/graphics/gpuprofiling/app/Android.bp b/hostsidetests/graphics/gpuprofiling/app/Android.bp
index 0ff8fa4..ca47c63 100644
--- a/hostsidetests/graphics/gpuprofiling/app/Android.bp
+++ b/hostsidetests/graphics/gpuprofiling/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_gpu",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -21,7 +22,10 @@
srcs: [
"android_graphics_cts_GpuCounters.cpp",
],
- test_suites: ["cts", "general-tests"],
+ test_suites: [
+ "cts",
+ "general-tests",
+ ],
compile_multilib: "both",
multilib: {
lib32: {
@@ -71,7 +75,10 @@
srcs: ["src/**/*.java"],
sdk_version: "current",
// tag this module as a cts test artifact
- test_suites: ["cts", "general-tests"],
+ test_suites: [
+ "cts",
+ "general-tests",
+ ],
compile_multilib: "both",
jni_libs: [
"libctsgraphicsgpuprofiling_jni",
diff --git a/hostsidetests/hdmicec/Android.bp b/hostsidetests/hdmicec/Android.bp
index 93eb09b..d402950 100644
--- a/hostsidetests/hdmicec/Android.bp
+++ b/hostsidetests/hdmicec/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_tv_os",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/hdmicec/app/Android.bp b/hostsidetests/hdmicec/app/Android.bp
index 87c4262..a92bcc7 100644
--- a/hostsidetests/hdmicec/app/Android.bp
+++ b/hostsidetests/hdmicec/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_tv_os",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/BaseHdmiCecCtsTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/BaseHdmiCecCtsTest.java
index cb32055..5c45fa1 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/BaseHdmiCecCtsTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/BaseHdmiCecCtsTest.java
@@ -694,4 +694,18 @@
return isAudioOutputDeviceInList(audioOutputDevice,
"dumpsys audio | grep 'adjust-only absolute volume devices'");
}
+
+ /**
+ * On Google TV devices the only stream played is STREAM_MUSIC.
+ * The method returns whether "Devices" in "STREAM_MUSIC" contains "hdmi" in audio dumpsys.
+ * This is required by tests where the DUT has to redirect volume key events as CEC
+ * <User Control Pressed> messages.
+ * This method might return false, because the set-up contains an HDMI Stub.
+ * See {@link android.media.AudioSystem#STREAM_MUSIC} and
+ * {@link android.media.AudioSystem#DEVICE_OUT_HDMI}.
+ */
+ public boolean isPlayingStreamMusicOnHdmiOut() throws DeviceNotAvailableException {
+ return getDevice().executeShellCommand("dumpsys audio | sed -n '/^- STREAM_MUSIC:/,/^$/p'"
+ + " | grep \"Devices\"").contains("hdmi");
+ }
}
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/LogHelper.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/LogHelper.java
index 2074a49..74bcf67 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/LogHelper.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/LogHelper.java
@@ -47,16 +47,16 @@
TimeUnit.SECONDS.sleep(WAIT_TIME);
String logs = device.executeAdbCommand("logcat", "-v", "brief", "-d", tag + ":I", "*:S");
// Search for string.
- String testString = "";
+ StringBuilder testString = new StringBuilder();
Scanner in = new Scanner(logs);
while (in.hasNextLine()) {
String line = in.nextLine();
if (line.startsWith("I/" + tag)) {
- testString = line.split(":")[1].trim();
+ testString.append(line.split(":")[1].trim());
}
}
device.executeAdbCommand("logcat", "-c");
- return testString;
+ return testString.toString();
}
public static void waitForLog(
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/RemoteControlPassthrough.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/RemoteControlPassthrough.java
index 33465a1..296284b 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/RemoteControlPassthrough.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/RemoteControlPassthrough.java
@@ -254,12 +254,27 @@
for (Integer userControlPressKey : mUserControlPressKeys_20.keySet()) {
hdmiCecClient.sendUserControlPressAndRelease(
sourceDevice, dutLogicalAddress, userControlPressKey, false);
+ // KEYCODE_SETUP_MENU might trigger the notification panel quitting the activity
+ // HdmiCecKeyEventCapture.
+ if (userControlPressKey == HdmiCecConstants.CEC_KEYCODE_SETUP_MENU) {
+ try {
+ LogHelper.waitForLog(device, "ActivityTaskManager", 5,
+ "TOGGLE_NOTIFICATION_HANDLER_PANEL");
+ // HdmiCecKeyEventCapture activity should be resumed.
+ device.executeShellCommand(START_COMMAND);
+ continue;
+ } catch (Exception e) {
+ // We have to send the key again since logcat was cleared.
+ hdmiCecClient.sendUserControlPressAndRelease(
+ sourceDevice, dutLogicalAddress, userControlPressKey, false);
+ }
+ }
LogHelper.assertLog(
device,
CLASS,
"Short press KEYCODE_" + mUserControlPressKeys_20.get(userControlPressKey));
// KEYCODE_HOME pressing will let the activity HdmiCecKeyEventCapture be paused.
- // Resume the activity after tesing for KEYCODE_HOME pressing.
+ // Resume the activity after testing for KEYCODE_HOME pressing.
if (userControlPressKey == HdmiCecConstants.CEC_KEYCODE_ROOT_MENU) {
device.executeShellCommand(START_COMMAND);
}
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecGeneralProtocolTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecGeneralProtocolTest.java
index 298a0ad..03f6931 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecGeneralProtocolTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecGeneralProtocolTest.java
@@ -94,11 +94,13 @@
// DeviceDiscoveryAction will send GIVE_OSD_NAME and GIVE_DEVICE_VENDOR_ID
// HotplugDetectionAction will send GIVE_PHYSICAL_ADDRESS
// PowerStatusMonitorAction will send GIVE_POWER_STATUS
+ // AbsoluteVolumeAudioStatusAction will send GIVE_AUDIO_STATUS
List<CecOperand> excludeOperands = new ArrayList<>();
excludeOperands.add(CecOperand.GIVE_PHYSICAL_ADDRESS);
excludeOperands.add(CecOperand.GIVE_DEVICE_VENDOR_ID);
excludeOperands.add(CecOperand.GIVE_OSD_NAME);
excludeOperands.add(CecOperand.GIVE_POWER_STATUS);
+ excludeOperands.add(CecOperand.GIVE_AUDIO_STATUS);
hdmiCecClient.sendCecMessage(message, params);
// Default timeout for the incoming command to arrive in response to a request is 2 secs
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecStartupTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecStartupTest.java
index 4b80f54..f8a29f5 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecStartupTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecStartupTest.java
@@ -64,6 +64,7 @@
CecOperand.REPORT_PHYSICAL_ADDRESS);
List<CecOperand> allowedMessages = new ArrayList<>(
Arrays.asList(CecOperand.VENDOR_COMMAND, CecOperand.GIVE_DEVICE_VENDOR_ID,
+ CecOperand.VENDOR_COMMAND_WITH_ID,
CecOperand.SET_OSD_NAME, CecOperand.GIVE_OSD_NAME, CecOperand.CEC_VERSION,
CecOperand.DEVICE_VENDOR_ID, CecOperand.GIVE_POWER_STATUS,
CecOperand.GET_MENU_LANGUAGE, CecOperand.ACTIVE_SOURCE,
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecAvbToTvTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecAvbToTvTest.java
index 3772dd05..a46fe9e 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecAvbToTvTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecAvbToTvTest.java
@@ -18,6 +18,8 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assume.assumeFalse;
+
import android.hdmicec.cts.AudioManagerHelper;
import android.hdmicec.cts.BaseHdmiCecAbsoluteVolumeBehaviorTest;
import android.hdmicec.cts.BaseHdmiCecCtsTest;
@@ -107,6 +109,9 @@
*/
@Test
public void testEnableDisableAvb_triggeredByAvbSupportChanged() throws Exception {
+ assumeFalse("Skip for audio system devices (b/323469502)",
+ hasDeviceType(HdmiCecConstants.CEC_DEVICE_TYPE_AUDIO_SYSTEM));
+
setSettingsValue(HdmiCecConstants.SETTING_VOLUME_CONTROL_ENABLED,
HdmiCecConstants.VOLUME_CONTROL_ENABLED);
@@ -139,6 +144,9 @@
*/
@Test
public void testEnableAndDisableAvb_triggeredByVolumeControlSettingChange() throws Exception {
+ assumeFalse("Skip for audio system devices (b/323469502)",
+ hasDeviceType(HdmiCecConstants.CEC_DEVICE_TYPE_AUDIO_SYSTEM));
+
enableSystemAudioModeIfApplicable();
// System audio device reports support for <Set Audio Volume Level>
@@ -170,6 +178,9 @@
*/
@Test
public void testOutgoingVolumeUpdates() throws Exception {
+ assumeFalse("Skip for audio system devices (b/323469502)",
+ hasDeviceType(HdmiCecConstants.CEC_DEVICE_TYPE_AUDIO_SYSTEM));
+
// Enable AVB
setSettingsValue(HdmiCecConstants.SETTING_VOLUME_CONTROL_ENABLED,
HdmiCecConstants.VOLUME_CONTROL_ENABLED);
@@ -207,6 +218,9 @@
*/
@Test
public void testIncomingVolumeUpdates() throws Exception {
+ assumeFalse("Skip for audio system devices (b/323469502)",
+ hasDeviceType(HdmiCecConstants.CEC_DEVICE_TYPE_AUDIO_SYSTEM));
+
// Enable AVB
setSettingsValue(HdmiCecConstants.SETTING_VOLUME_CONTROL_ENABLED,
HdmiCecConstants.VOLUME_CONTROL_ENABLED);
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java
index 4a64e5c..c8d0d03 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java
@@ -19,6 +19,9 @@
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
+import static org.junit.Assume.assumeFalse;
+import static org.junit.Assume.assumeTrue;
+
import android.hdmicec.cts.BaseHdmiCecCtsTest;
import android.hdmicec.cts.CecMessage;
import android.hdmicec.cts.CecOperand;
@@ -206,6 +209,12 @@
*/
@Test
public void cect_sendVolumeKeyPressToTv() throws Exception {
+ assumeFalse("Skip for audio system devices (b/323469502)",
+ hasDeviceType(HdmiCecConstants.CEC_DEVICE_TYPE_AUDIO_SYSTEM));
+
+ // The DUT won't send <User Control Pressed> messages if this condition is not met.
+ assumeTrue(isPlayingStreamMusicOnHdmiOut());
+
ITestDevice device = getDevice();
String ucpMessage;
String command = "cmd hdmi_control setsam ";
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemAudioControlTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemAudioControlTest.java
index 701b6d7..f357a6b 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemAudioControlTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemAudioControlTest.java
@@ -18,6 +18,9 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assume.assumeFalse;
+import static org.junit.Assume.assumeTrue;
+
import android.hdmicec.cts.BaseHdmiCecCtsTest;
import android.hdmicec.cts.CecMessage;
import android.hdmicec.cts.CecOperand;
@@ -60,6 +63,10 @@
public void cect_hf4_10_5_RemoteControlCommandsWithSystemAudioControlProperty()
throws Exception {
setCec20();
+ assumeFalse("Skip for audio system devices (b/323469502)",
+ hasDeviceType(HdmiCecConstants.CEC_DEVICE_TYPE_AUDIO_SYSTEM));
+ // The DUT won't send <User Control Pressed> messages if this condition is not met.
+ assumeTrue(isPlayingStreamMusicOnHdmiOut());
ITestDevice device = getDevice();
String volumeControlEnabled =
diff --git a/hostsidetests/incrementalinstall/OWNERS b/hostsidetests/incrementalinstall/OWNERS
index 49bed85..9a71abd 100644
--- a/hostsidetests/incrementalinstall/OWNERS
+++ b/hostsidetests/incrementalinstall/OWNERS
@@ -1,7 +1,7 @@
# Bug component: 554432
+
dimuthu@google.com
alexbuy@google.com
schfan@google.com
-toddke@google.com
patb@google.com
zyy@google.com
\ No newline at end of file
diff --git a/hostsidetests/incrementalinstall/src/android/incrementalinstall/cts/IncrementalInstallTest.java b/hostsidetests/incrementalinstall/src/android/incrementalinstall/cts/IncrementalInstallTest.java
index 12668af..b5821ac 100644
--- a/hostsidetests/incrementalinstall/src/android/incrementalinstall/cts/IncrementalInstallTest.java
+++ b/hostsidetests/incrementalinstall/src/android/incrementalinstall/cts/IncrementalInstallTest.java
@@ -107,7 +107,7 @@
@Before
public void setup() throws Exception {
// Increase default timeout to 5 mins to accommodate for slow restarting devices.
- TestDeviceOptions options = new TestDeviceOptions();
+ TestDeviceOptions options = getDevice().getOptions();
options.setAdbCommandTimeout(DEFAULT_ADB_TIMEOUT_MS);
getDevice().setOptions(options);
diff --git a/hostsidetests/input/Android.bp b/hostsidetests/input/Android.bp
index fd0e3ef..5288176 100644
--- a/hostsidetests/input/Android.bp
+++ b/hostsidetests/input/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_input_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/input/app/Android.bp b/hostsidetests/input/app/Android.bp
index 0a4153d..f481256 100644
--- a/hostsidetests/input/app/Android.bp
+++ b/hostsidetests/input/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/inputmethodservice/common/Android.bp b/hostsidetests/inputmethodservice/common/Android.bp
index f2e0be6..e7c1b56 100644
--- a/hostsidetests/inputmethodservice/common/Android.bp
+++ b/hostsidetests/inputmethodservice/common/Android.bp
@@ -14,6 +14,7 @@
// Build the common library for use device-side
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/inputmethodservice/deviceside/devicetest/Android.bp b/hostsidetests/inputmethodservice/deviceside/devicetest/Android.bp
index b0b5201..694943a 100644
--- a/hostsidetests/inputmethodservice/deviceside/devicetest/Android.bp
+++ b/hostsidetests/inputmethodservice/deviceside/devicetest/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/inputmethodservice/deviceside/edittextapp/Android.bp b/hostsidetests/inputmethodservice/deviceside/edittextapp/Android.bp
index e0f6ed5..13f0c96 100644
--- a/hostsidetests/inputmethodservice/deviceside/edittextapp/Android.bp
+++ b/hostsidetests/inputmethodservice/deviceside/edittextapp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/inputmethodservice/deviceside/ime1/Android.bp b/hostsidetests/inputmethodservice/deviceside/ime1/Android.bp
index 1608365..edb0ddf 100644
--- a/hostsidetests/inputmethodservice/deviceside/ime1/Android.bp
+++ b/hostsidetests/inputmethodservice/deviceside/ime1/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/inputmethodservice/deviceside/ime2/Android.bp b/hostsidetests/inputmethodservice/deviceside/ime2/Android.bp
index 3426b86..086700c 100644
--- a/hostsidetests/inputmethodservice/deviceside/ime2/Android.bp
+++ b/hostsidetests/inputmethodservice/deviceside/ime2/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/inputmethodservice/deviceside/lib/Android.bp b/hostsidetests/inputmethodservice/deviceside/lib/Android.bp
index 0ec523f..077bcd1 100644
--- a/hostsidetests/inputmethodservice/deviceside/lib/Android.bp
+++ b/hostsidetests/inputmethodservice/deviceside/lib/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/inputmethodservice/deviceside/provider/Android.bp b/hostsidetests/inputmethodservice/deviceside/provider/Android.bp
index 2935fe8..7d092c3 100644
--- a/hostsidetests/inputmethodservice/deviceside/provider/Android.bp
+++ b/hostsidetests/inputmethodservice/deviceside/provider/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/inputmethodservice/hostside/Android.bp b/hostsidetests/inputmethodservice/hostside/Android.bp
index b4ec928..67c78fe 100644
--- a/hostsidetests/inputmethodservice/hostside/Android.bp
+++ b/hostsidetests/inputmethodservice/hostside/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/install/Android.bp b/hostsidetests/install/Android.bp
index 8a3071a..4b97f75 100644
--- a/hostsidetests/install/Android.bp
+++ b/hostsidetests/install/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/library/src/android/appmanifest/cts/UsesNativeLibraryTestCase.java b/hostsidetests/library/src/android/appmanifest/cts/UsesNativeLibraryTestCase.java
index 70fdcd3..09f2a43 100644
--- a/hostsidetests/library/src/android/appmanifest/cts/UsesNativeLibraryTestCase.java
+++ b/hostsidetests/library/src/android/appmanifest/cts/UsesNativeLibraryTestCase.java
@@ -16,9 +16,9 @@
package android.appmanifest.cts;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
import com.android.compatibility.common.util.CddTest;
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
@@ -296,13 +296,19 @@
getFile("CtsUsesNativeLibraryTestApp.jar")));
File signedApkFile = new File(buildRoot, "signed.apk");
- runCommand(String.format("java -Djava.library.path=%s -jar %s %s %s %s %s",
- mWorkDir,
- getFile("signapk.jar"),
- getFile("testkey.x509.pem"),
- getFile("testkey.pk8"),
- unsignedApkFile,
- signedApkFile));
+ try {
+ runCommand(String.format("java -Djava.library.path=%s -jar %s %s %s %s %s",
+ mWorkDir,
+ getFile("signapk.jar"),
+ getFile("testkey.x509.pem"),
+ getFile("testkey.pk8"),
+ unsignedApkFile,
+ signedApkFile));
+ } catch (RuntimeException e) {
+ String msg = "Failed to sign apk. This is likely due to the use of old JDK. Please "
+ + "update JDK to the latest. If you are a Googler, see b/208923903#comment19.";
+ throw new RuntimeException(msg, e);
+ }
return signedApkFile;
}
diff --git a/hostsidetests/library/src_target/com/android/test/usesnativesharedlibrary/LoadTest.java b/hostsidetests/library/src_target/com/android/test/usesnativesharedlibrary/LoadTest.java
index 17cbfd3..f477163 100644
--- a/hostsidetests/library/src_target/com/android/test/usesnativesharedlibrary/LoadTest.java
+++ b/hostsidetests/library/src_target/com/android/test/usesnativesharedlibrary/LoadTest.java
@@ -107,7 +107,11 @@
unexpected.add(t.getMessage());
}
};
- assertThat("Some libraries failed to load", unexpected, is(Collections.emptyList()));
+ assertThat("Some libraries failed to load. Libraries shown below are listed in " +
+ "/vendor/public.libraries.txt or /system/etc/public.libraries-COMPANYNAME.txt " +
+ "as public libraries, but they may not exist or inaccessible. " +
+ "You may fix this by unlisting them from the txt files"
+ , unexpected, is(Collections.emptyList()));
}
/**
diff --git a/hostsidetests/mediapc/videoencodingquality/Android.bp b/hostsidetests/mediapc/videoencodingquality/Android.bp
index d270af1..e76d7ea 100644
--- a/hostsidetests/mediapc/videoencodingquality/Android.bp
+++ b/hostsidetests/mediapc/videoencodingquality/Android.bp
@@ -21,6 +21,7 @@
srcs: ["src/*.java"],
static_libs: [
"compatibility-host-util",
+ "cts-host-utils",
],
libs: [
"cts-tradefed",
@@ -31,4 +32,7 @@
"cts",
"general-tests",
],
+ data: [
+ ":VideoEncodingApp",
+ ],
}
diff --git a/hostsidetests/mediapc/videoencodingquality/AndroidTest.xml b/hostsidetests/mediapc/videoencodingquality/AndroidTest.xml
index 4a436bd..42943e9 100644
--- a/hostsidetests/mediapc/videoencodingquality/AndroidTest.xml
+++ b/hostsidetests/mediapc/videoencodingquality/AndroidTest.xml
@@ -20,6 +20,10 @@
<option name="config-descriptor:metadata" key="parameter" value="instant_app" />
<option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
<option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
+ <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
+ <option name="cleanup-apks" value="true" />
+ <option name="test-file-name" value="VideoEncodingApp.apk" />
+ </target_preparer>
<test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
<option name="jar" value="CtsVideoEncodingQualityHostTestCases.jar" />
</test>
diff --git a/hostsidetests/mediapc/videoencodingquality/app/Android.bp b/hostsidetests/mediapc/videoencodingquality/app/Android.bp
new file mode 100644
index 0000000..8cc23b2
--- /dev/null
+++ b/hostsidetests/mediapc/videoencodingquality/app/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2023 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 {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+android_test {
+ name: "VideoEncodingApp",
+ defaults: ["cts_defaults"],
+ compile_multilib: "both",
+ static_libs: [
+ "compatibility-device-util-axt",
+ "ctsmediav2common",
+ "ctstestrunner-axt",
+ ],
+ platform_apis: true,
+ srcs: ["src/**/*.java"],
+ // Tag this module as a cts test artifact
+ test_suites: [
+ "cts",
+ "general-tests",
+ ],
+ min_sdk_version: "29",
+}
diff --git a/hostsidetests/mediapc/videoencodingquality/app/AndroidManifest.xml b/hostsidetests/mediapc/videoencodingquality/app/AndroidManifest.xml
new file mode 100644
index 0000000..a3c5336
--- /dev/null
+++ b/hostsidetests/mediapc/videoencodingquality/app/AndroidManifest.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2023 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="android.videoencoding.app">
+
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
+ <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
+ <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
+ <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
+ <uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
+
+ <application
+ android:debuggable="true"
+ android:allowClearUserData="true"
+ android:allowBackup="true"
+ android:requestLegacyExternalStorage="true"
+ android:usesCleartextTraffic="true">
+ </application>
+ <uses-sdk android:minSdkVersion="29" android:targetSdkVersion="31" />
+ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
+ android:targetPackage="android.videoencoding.app"
+ android:label="Video encoding app for android.media" >
+ <meta-data
+ android:name="listener"
+ android:value="com.android.cts.runner.CtsTestRunListener" />
+ </instrumentation>
+</manifest>
diff --git a/hostsidetests/mediapc/videoencodingquality/app/README.md b/hostsidetests/mediapc/videoencodingquality/app/README.md
new file mode 100644
index 0000000..721fd58
--- /dev/null
+++ b/hostsidetests/mediapc/videoencodingquality/app/README.md
@@ -0,0 +1,7 @@
+## Video Encoding CTS Tests Apk
+These tests are not run directly. But these are run as part of the host side test CtsVideoEncodingQualityHostTestCases. The host side test sends an input clip and encoding configuration parameters via json file to this apk. This apk parses the information sent and performs encoding. The encoded output is stored to disk. Host side test pulls this for further analysis.
+
+### Commands
+```sh
+$ atest CtsVideoEncodingTestCases -- --module-arg CtsVideoEncodingTestCases:instrumentation-arg:conf-json:=test.json
+```
diff --git a/hostsidetests/mediapc/videoencodingquality/app/src/android/videoencoding/app/VideoTranscoderTest.java b/hostsidetests/mediapc/videoencodingquality/app/src/android/videoencoding/app/VideoTranscoderTest.java
new file mode 100644
index 0000000..e3364bf
--- /dev/null
+++ b/hostsidetests/mediapc/videoencodingquality/app/src/android/videoencoding/app/VideoTranscoderTest.java
@@ -0,0 +1,203 @@
+/*
+ * Copyright (C) 2024 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.videoencoding.app;
+
+import static android.media.MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface;
+import static android.mediav2.common.cts.CodecTestBase.CONTEXT;
+import static android.mediav2.common.cts.CodecTestBase.MEDIA_CODEC_LIST_REGULAR;
+import static android.mediav2.common.cts.CodecTestBase.selectCodecs;
+import static android.mediav2.common.cts.DecodeStreamToYuv.getFormatInStream;
+import static android.os.Environment.buildPath;
+
+import android.Manifest;
+import android.content.pm.PackageManager;
+import android.media.MediaFormat;
+import android.mediav2.common.cts.CodecEncoderSurfaceTestBase;
+import android.mediav2.common.cts.CodecTestBase;
+import android.mediav2.common.cts.EncoderConfigParams;
+import android.mediav2.common.cts.OutputManager;
+import android.os.Environment;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.LargeTest;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import com.android.compatibility.common.util.Preconditions;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+
+/**
+ * Test transcoding using media codec api.
+ * <p>
+ * The test decodes an input clip to surface. This decoded output is fed as input to encoder.
+ * Assuming no frame drops, the test expects,
+ * <ul>
+ * <li>The number of encoded frames to be identical to number of frames present in input clip
+ * .</li>
+ * <li>The encoder output timestamps list should be identical to decoder input timestamp list
+ * .</li>
+ * </ul>
+ * <p>
+ * The test has provision to validate the encoded output by computing PSNR against input. This is
+ * however disabled as VMAF is chosen for analysis. This analysis is done on host side.
+ */
+@RunWith(AndroidJUnit4.class)
+public class VideoTranscoderTest {
+ private static final String MEDIA_DIR = "/sdcard/veq/input/";
+ public static final String ENC_CONFIG_JSON = "conf-json";
+ private static final String ENC_CONFIG_FILE;
+ private static String PATH_PREFIX;
+ public static final int DEFAULT_TEST_TIMEOUT_MS = 360000;
+
+ private String mEncoderName;
+ private String mEncMediaType;
+ private String mDecoderName;
+ private String mTestFileMediaType;
+ private String mTestFile;
+ private EncoderConfigParams[] mEncCfgParams;
+ private String[] mOutputFileNames;
+ private int mDecColorFormat;
+
+ static {
+ android.os.Bundle args = InstrumentationRegistry.getArguments();
+ ENC_CONFIG_FILE = args.getString(ENC_CONFIG_JSON);
+ }
+
+ static class TestTranscode extends CodecEncoderSurfaceTestBase {
+ private final String mOutputFileName;
+
+ TestTranscode(String encoder, String mediaType, String decoder, String testFileMediaType,
+ String testFile, EncoderConfigParams encCfgParams, String outputFileName,
+ int decColorFormat, boolean isOutputToneMapped, boolean usePersistentSurface,
+ String allTestParams) {
+ super(encoder, mediaType, decoder, testFileMediaType, testFile, encCfgParams,
+ decColorFormat, isOutputToneMapped, usePersistentSurface, allTestParams);
+ mOutputFileName = outputFileName;
+ }
+
+ @Override
+ public void setUpCodecEncoderSurfaceTestBase()
+ throws IOException, CloneNotSupportedException {
+ super.setUpCodecEncoderSurfaceTestBase();
+ mEncoderFormat = mEncCfgParams.getFormat();
+ }
+
+ private String getTempFilePath(String infix) throws IOException {
+ String totalPath = PATH_PREFIX + infix + ".mp4";
+ new FileOutputStream(totalPath).close();
+ return totalPath;
+ }
+
+ public void doTranscode()
+ throws IOException, InterruptedException, CloneNotSupportedException {
+ try {
+ setUpCodecEncoderSurfaceTestBase();
+ encodeToMemory(false, false, false, new OutputManager(), true,
+ getTempFilePath(mOutputFileName));
+ } finally {
+ tearDownCodecEncoderSurfaceTestBase();
+ }
+ }
+ }
+
+ private void parseEncoderConfigurationFile(String jsonPath) throws JSONException, IOException {
+ Preconditions.assertTestFileExists(jsonPath);
+ String jsonString =
+ new String(Files.readAllBytes(Paths.get(jsonPath)), StandardCharsets.UTF_8);
+ JSONArray jsonArray = new JSONArray(jsonString);
+ JSONObject obj = jsonArray.getJSONObject(0);
+ mTestFile = MEDIA_DIR + "samples/" + obj.getString("RefFileName");
+ mTestFileMediaType = obj.getString("RefMediaType");
+ mEncMediaType = obj.getString("TestMediaType");
+ int width = obj.getInt("Width");
+ int height = obj.getInt("Height");
+ String componentType = obj.getString("EncoderType");
+ CodecTestBase.ComponentClass cType = CodecTestBase.ComponentClass.ALL;
+ if (componentType.equals("hw")) {
+ cType = CodecTestBase.ComponentClass.HARDWARE;
+ } else if (componentType.equals("sw")) {
+ cType = CodecTestBase.ComponentClass.SOFTWARE;
+ }
+ mDecColorFormat = COLOR_FormatSurface;
+ JSONArray codecConfigs = obj.getJSONArray("CodecConfigs");
+ mEncCfgParams = new EncoderConfigParams[codecConfigs.length()];
+ mOutputFileNames = new String[codecConfigs.length()];
+ for (int i = 0; i < codecConfigs.length(); i++) {
+ JSONObject codecConfig = codecConfigs.getJSONObject(i);
+ mEncCfgParams[i] = new EncoderConfigParams.Builder(mEncMediaType)
+ .setWidth(width)
+ .setHeight(height)
+ .setKeyFrameInterval(codecConfig.getInt("KeyFrameInterval"))
+ .setMaxBFrames(codecConfig.getInt("MaxBFrames"))
+ .setBitRate(codecConfig.getInt("BitRate"))
+ .setProfile(codecConfig.getInt("Profile"))
+ .setLevel(codecConfig.getInt("Level"))
+ .setColorFormat(COLOR_FormatSurface)
+ .build();
+ String outFileName = codecConfig.getString("EncodedFileName");
+ mOutputFileNames[i] = outFileName.substring(0, outFileName.lastIndexOf('.'));
+ }
+ MediaFormat format = getFormatInStream(mTestFileMediaType, mTestFile);
+ mDecoderName = MEDIA_CODEC_LIST_REGULAR.findDecoderForFormat(format);
+ ArrayList<MediaFormat> formats = new ArrayList<>();
+ for (EncoderConfigParams param : mEncCfgParams) {
+ formats.add(param.getFormat());
+ }
+ ArrayList<String> codecs = selectCodecs(mEncMediaType, formats, null, true, cType);
+ if (!codecs.isEmpty()) mEncoderName = codecs.get(0);
+ }
+
+ @LargeTest
+ @Test(timeout = DEFAULT_TEST_TIMEOUT_MS)
+ public void testTranscode() throws IOException, InterruptedException,
+ JSONException, CloneNotSupportedException {
+ Assume.assumeTrue("Test did not receive config file for encoding", ENC_CONFIG_FILE != null);
+ parseEncoderConfigurationFile(MEDIA_DIR + "json/" + ENC_CONFIG_FILE);
+ Assume.assumeTrue("Found no encoder supporting the config file", mEncoderName != null);
+ Assume.assumeTrue("Found no decoder supporting the config file", mDecoderName != null);
+ Assert.assertEquals("Apk does not have permissions to write to external storage",
+ PackageManager.PERMISSION_GRANTED,
+ CONTEXT.checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE));
+ File pub = new File("/sdcard/veq/output/");
+ File dir = buildPath(pub,
+ "output_" + ENC_CONFIG_FILE.substring(0, ENC_CONFIG_FILE.lastIndexOf('.')));
+ if (!dir.exists()) {
+ Assert.assertTrue("Unable to create dir " + dir.getAbsolutePath(), dir.mkdirs());
+ }
+ PATH_PREFIX = dir.getAbsolutePath() + File.separator;
+ for (int i = 0; i < mEncCfgParams.length; i++) {
+ TestTranscode ep = new TestTranscode(mEncoderName, mEncMediaType,
+ mDecoderName, mTestFileMediaType, mTestFile, mEncCfgParams[i],
+ mOutputFileNames[i], mDecColorFormat, false, false, "");
+ ep.doTranscode();
+ }
+ }
+}
diff --git a/hostsidetests/mediapc/videoencodingquality/src/CtsVideoEncodingQualityHostTest.java b/hostsidetests/mediapc/videoencodingquality/src/CtsVideoEncodingQualityHostTest.java
index 7e6d846..5c30bf9 100644
--- a/hostsidetests/mediapc/videoencodingquality/src/CtsVideoEncodingQualityHostTest.java
+++ b/hostsidetests/mediapc/videoencodingquality/src/CtsVideoEncodingQualityHostTest.java
@@ -13,81 +13,208 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package android.videoencodingquality.cts;
+import android.cts.host.utils.DeviceJUnit4ClassRunnerWithParameters;
+import android.cts.host.utils.DeviceJUnit4Parameterized;
+import android.platform.test.annotations.AppModeFull;
+
import com.android.compatibility.common.util.CddTest;
-import com.android.tradefed.build.IBuildInfo;
+import com.android.ddmlib.testrunner.RemoteAndroidTestRunner;
import com.android.tradefed.config.Option;
import com.android.tradefed.config.OptionClass;
+import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.device.ITestDevice;
import com.android.tradefed.log.LogUtil;
-import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-import com.android.tradefed.testtype.IAbi;
-import com.android.tradefed.testtype.IAbiReceiver;
-import com.android.tradefed.testtype.IBuildReceiver;
+import com.android.tradefed.result.CollectingTestListener;
+import com.android.tradefed.result.TestDescription;
+import com.android.tradefed.result.TestResult;
+import com.android.tradefed.result.TestRunResult;
import com.android.tradefed.testtype.IDeviceTest;
+import org.json.JSONArray;
+import org.json.JSONObject;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.UseParametersRunnerFactory;
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import javax.annotation.Nullable;
/**
- * Run the host-side video encoding quality test (go/pc14-veq)
- * The body of this test is implemented in a test script, not within the java here. This java
- * code acquires the testsuite tar file, unpacks it, executes the script (which encodes and
- * measures) that report either PASS or FAIL.
+ * This class constitutes host-part of video encoding quality test (go/pc14-veq). This test is
+ * aimed towards benchmarking encoders on the target device.
+ * <p>
+ * Video encoding quality test quantifies encoders on the test device by encoding a set of clips
+ * at various configurations. The encoded output is analysed for vmaf and compared against
+ * reference. This entire process is not carried on the device. The host side of the test
+ * prepares the test environment by installing a VideoEncodingApp on the device. It also pushes
+ * the test vectors and test configurations on to the device. The VideoEncodingApp transcodes the
+ * input clips basing on the configurations shared. The host side of the test then pulls output
+ * files from the device and analyses for vmaf. These values are compared against reference using
+ * Bjontegaard metric.
**/
-@RunWith(DeviceJUnit4ClassRunner.class)
+@AppModeFull(reason = "Instant apps cannot access the SD card")
+@RunWith(DeviceJUnit4Parameterized.class)
+@UseParametersRunnerFactory(DeviceJUnit4ClassRunnerWithParameters.RunnerFactory.class)
@OptionClass(alias = "pc-veq-test")
-public class CtsVideoEncodingQualityHostTest implements IAbiReceiver, IBuildReceiver, IDeviceTest {
+public class CtsVideoEncodingQualityHostTest implements IDeviceTest {
+ private static final String RES_URL =
+ "https://storage.googleapis.com/android_media/cts/hostsidetests/pc14_veq/veqtests-1_2.tar.gz";
- static final String BASE_URL =
- "https://storage.googleapis.com/android_media/cts/hostsidetests/pc14_veq/";
+ // variables related to host-side of the test
+ private static final int MEDIA_PERFORMANCE_CLASS_14 = 34;
+ private static final int MINIMUM_VALID_SDK = 31;
+ // test is not valid before sdk 31, aka Android 12, aka Android S
- @Option(name = "force-to-run",
- description = "Force to run the test even if the device is not a right performance "
- + "class device.")
+ private static final Lock sLock = new ReentrantLock();
+ private static final Condition sCondition = sLock.newCondition();
+ private static boolean sIsTestSetUpDone = false;
+ // install apk, push necessary resources to device to run the test. lock/condition
+ // pair is to keep setupTestEnv() thread safe
+ private static File sHostWorkDir;
+
+ // Variables related to device-side of the test. These need to kept in sync with definitions of
+ // VideoEncodingApp.apk
+ private static final String DEVICE_IN_DIR = "/sdcard/veq/input/";
+ private static final String DEVICE_OUT_DIR = "/sdcard/veq/output/";
+ private static final String DEVICE_SIDE_TEST_PACKAGE = "android.videoencoding.app";
+ private static final String DEVICE_SIDE_TEST_CLASS =
+ "android.videoencoding.app.VideoTranscoderTest";
+ private static final String RUNNER = "androidx.test.runner.AndroidJUnitRunner";
+ private static final String TEST_CONFIG_INST_ARGS_KEY = "conf-json";
+ private static final long DEFAULT_SHELL_TIMEOUT_MILLIS = TimeUnit.MINUTES.toMillis(5);
+ private static final String TEST_TIMEOUT_INST_ARGS_KEY = "timeout_msec";
+ private static final long DEFAULT_TEST_TIMEOUT_MILLIS = TimeUnit.MINUTES.toMillis(3);
+
+ // local variables related to host-side of the test
+ private final String mJsonName;
+ private ITestDevice mDevice;
+
+ @Option(name = "force-to-run", description = "Force to run the test even if the device is not"
+ + " a right performance class device.")
private boolean mForceToRun = false;
- @Option(name = "disable-b", description = "Disable b-frame-encoding.")
- private boolean mDisableB = false;
+ @Option(name = "skip-avc", description = "Skip avc encoder testing")
+ private boolean mSkipAvc = false;
+
+ @Option(name = "skip-hevc", description = "Skip hevc encoder testing")
+ private boolean mSkipHevc = false;
+
+ @Option(name = "skip-p", description = "Skip P only testing")
+ private boolean mSkipP = false;
+
+ @Option(name = "skip-b", description = "Skip B frame testing")
+ private boolean mSkipB = false;
@Option(name = "reset", description = "Start with a fresh directory.")
- private boolean mReset = true;
+ private boolean mReset = false;
@Option(name = "quick-check", description = "Run a quick check.")
private boolean mQuickCheck = false;
- // test is not valid before sdk 31, aka Android 12, aka Android S
- static final int MINIMUM_VALID_SDK = 31;
-
- // media performance class 14
- static final int MEDIA_PERFORMANCE_CLASS_14 = 34;
-
- /** A reference to the build info. */
- private IBuildInfo mBuildInfo;
-
- /** A reference to the device under test. */
- private ITestDevice mDevice;
-
- /** A reference to the ABI under test. */
- private IAbi mAbi;
-
- @Override
- public void setAbi(IAbi abi) {
- mAbi = abi;
+ public CtsVideoEncodingQualityHostTest(String jsonName) {
+ mJsonName = jsonName;
}
- @Override
- public void setBuild(IBuildInfo buildInfo) {
- mBuildInfo = buildInfo;
+ private static final List<String> AVC_VBR_B0_PARAMS = Arrays.asList(
+ "AVICON-MOBILE-Beach-SO04-CRW02-L-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b0.json",
+ "AVICON-MOBILE-BirthdayHalfway-SI17-CRUW03-L-420-8bit-SDR-1080p"
+ + "-30fps_hw_avc_vbr_b0.json",
+ "AVICON-MOBILE-SelfieTeenKitchenSocialMedia-SS01-CF01-P-420-8bit-SDR-1080p"
+ + "-30fps_hw_avc_vbr_b0.json",
+ "AVICON-MOBILE-Waterfall-SO05-CRW01-P-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b0.json",
+ "AVICON-MOBILE-SelfieFamily-SF14-CF01-L-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b0"
+ + ".json",
+ "AVICON-MOBILE-River-SO03-CRW01-L-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b0.json",
+ "AVICON-MOBILE-SelfieGroupGarden-SF15-CF01-P-420-8bit-SDR-1080p"
+ + "-30fps_hw_avc_vbr_b0.json",
+ "AVICON-MOBILE-ConcertNear-SI10-CRW01-L-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b0"
+ + ".json",
+ "AVICON-MOBILE-SelfieCoupleCitySocialMedia-SS02-CF01-P-420-8bit-SDR-1080p"
+ + "-30fps_hw_avc_vbr_b0.json");
+
+ private static final List<String> AVC_VBR_B3_PARAMS = Arrays.asList(
+ "AVICON-MOBILE-Beach-SO04-CRW02-L-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b3.json",
+ "AVICON-MOBILE-BirthdayHalfway-SI17-CRUW03-L-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b3"
+ + ".json",
+ "AVICON-MOBILE-SelfieTeenKitchenSocialMedia-SS01-CF01-P-420-8bit-SDR-1080p"
+ + "-30fps_hw_avc_vbr_b3.json",
+ "AVICON-MOBILE-Waterfall-SO05-CRW01-P-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b3.json",
+ "AVICON-MOBILE-SelfieFamily-SF14-CF01-L-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b3.json",
+ "AVICON-MOBILE-River-SO03-CRW01-L-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b3.json",
+ "AVICON-MOBILE-SelfieGroupGarden-SF15-CF01-P-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b3"
+ + ".json",
+ "AVICON-MOBILE-ConcertNear-SI10-CRW01-L-420-8bit-SDR-1080p-30fps_hw_avc_vbr_b3.json",
+ "AVICON-MOBILE-SelfieCoupleCitySocialMedia-SS02-CF01-P-420-8bit-SDR-1080p"
+ + "-30fps_hw_avc_vbr_b3.json");
+
+ private static final List<String> HEVC_VBR_B0_PARAMS = Arrays.asList(
+ "AVICON-MOBILE-Beach-SO04-CRW02-L-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b0.json",
+ "AVICON-MOBILE-BirthdayHalfway-SI17-CRUW03-L-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b0"
+ + ".json",
+ "AVICON-MOBILE-SelfieTeenKitchenSocialMedia-SS01-CF01-P-420-8bit-SDR-1080p"
+ + "-30fps_hw_hevc_vbr_b0.json",
+ "AVICON-MOBILE-Waterfall-SO05-CRW01-P-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b0.json",
+ "AVICON-MOBILE-SelfieFamily-SF14-CF01-L-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b0.json",
+ "AVICON-MOBILE-River-SO03-CRW01-L-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b0.json",
+ "AVICON-MOBILE-SelfieGroupGarden-SF15-CF01-P-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b0"
+ + ".json",
+ "AVICON-MOBILE-ConcertNear-SI10-CRW01-L-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b0.json",
+ "AVICON-MOBILE-SelfieCoupleCitySocialMedia-SS02-CF01-P-420-8bit-SDR-1080p"
+ + "-30fps_hw_hevc_vbr_b0.json");
+
+ private static final List<String> HEVC_VBR_B3_PARAMS = Arrays.asList(
+ "AVICON-MOBILE-Beach-SO04-CRW02-L-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b3.json",
+ "AVICON-MOBILE-BirthdayHalfway-SI17-CRUW03-L-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b3"
+ + ".json",
+ "AVICON-MOBILE-SelfieTeenKitchenSocialMedia-SS01-CF01-P-420-8bit-SDR-1080p"
+ + "-30fps_hw_hevc_vbr_b3.json",
+ "AVICON-MOBILE-Waterfall-SO05-CRW01-P-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b3.json",
+ "AVICON-MOBILE-SelfieFamily-SF14-CF01-L-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b3.json",
+ "AVICON-MOBILE-River-SO03-CRW01-L-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b3.json",
+ // Abnormal curve, not monotonically increasing.
+ /*"AVICON-MOBILE-SelfieGroupGarden-SF15-CF01-P-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b3"
+ + ".json",*/
+ "AVICON-MOBILE-ConcertNear-SI10-CRW01-L-420-8bit-SDR-1080p-30fps_hw_hevc_vbr_b3.json",
+ "AVICON-MOBILE-SelfieCoupleCitySocialMedia-SS02-CF01-P-420-8bit-SDR-1080p"
+ + "-30fps_hw_hevc_vbr_b3.json");
+
+ private static final List<String> QUICK_RUN_PARAMS = Arrays.asList(
+ "AVICON-MOBILE-SelfieTeenKitchenSocialMedia-SS01-CF01-P-420-8bit-SDR-1080p"
+ + "-30fps_hw_avc_vbr_b0.json",
+ "AVICON-MOBILE-SelfieTeenKitchenSocialMedia-SS01-CF01-P-420-8bit-SDR-1080p"
+ + "-30fps_hw_hevc_vbr_b0.json");
+
+ @Parameterized.Parameters(name = "{index}_{0}")
+ public static List<String> input() {
+ final List<String> args = new ArrayList<>();
+ args.addAll(AVC_VBR_B0_PARAMS);
+ args.addAll(AVC_VBR_B3_PARAMS);
+ args.addAll(HEVC_VBR_B0_PARAMS);
+ args.addAll(HEVC_VBR_B3_PARAMS);
+ return args;
}
@Override
@@ -100,145 +227,221 @@
return mDevice;
}
- private String getProperty(String prop) throws Exception {
- return mDevice.executeShellCommand("getprop " + prop).replace("\n", "");
+ /**
+ * Sets up the necessary environment for the video encoding quality test.
+ */
+ public void setupTestEnv() throws Exception {
+ String sdkAsString = getDevice().getProperty("ro.build.version.sdk");
+ int sdk = Integer.parseInt(sdkAsString);
+ Assume.assumeTrue("Test requires sdk >= " + MINIMUM_VALID_SDK
+ + " test device has sdk = " + sdk, sdk >= MINIMUM_VALID_SDK);
+
+ String pcAsString = getDevice().getProperty("ro.odm.build.media_performance_class");
+ int mpc = 0;
+ try {
+ mpc = Integer.parseInt("0" + pcAsString);
+ } catch (Exception e) {
+ LogUtil.CLog.i("Invalid pcAsString: " + pcAsString + ", exception: " + e);
+ }
+ Assume.assumeTrue("Test device does not advertise performance class",
+ mForceToRun || (mpc >= MEDIA_PERFORMANCE_CLASS_14));
+
+ Assert.assertTrue("Failed to install package on device : " + DEVICE_SIDE_TEST_PACKAGE,
+ getDevice().isPackageInstalled(DEVICE_SIDE_TEST_PACKAGE));
+
+ // set up host-side working directory
+ String tmpBase = System.getProperty("java.io.tmpdir");
+ String dirName = "CtsVideoEncodingQualityHostTest_" + getDevice().getSerialNumber();
+ String tmpDir = tmpBase + "/" + dirName;
+ LogUtil.CLog.i("tmpBase= " + tmpBase + " tmpDir =" + tmpDir);
+ sHostWorkDir = new File(tmpDir);
+ if (mReset || sHostWorkDir.isFile()) {
+ File cwd = new File(".");
+ runCommand("rm -rf " + tmpDir, cwd);
+ }
+ try {
+ if (!sHostWorkDir.isDirectory()) {
+ Assert.assertTrue("Failed to create directory : " + sHostWorkDir.getAbsolutePath(),
+ sHostWorkDir.mkdirs());
+ }
+ } catch (SecurityException e) {
+ LogUtil.CLog.e("Unable to establish temp directory " + sHostWorkDir.getPath());
+ }
+
+ // Clean up output folders before starting the test
+ runCommand("rm -rf " + "output_*", sHostWorkDir);
+
+ // Download the test suite tar file.
+ downloadFile(RES_URL, sHostWorkDir);
+
+ // Unpack the test suite tar file.
+ String fileName = RES_URL.substring(RES_URL.lastIndexOf('/') + 1);
+ int result = runCommand("tar xvzf " + fileName, sHostWorkDir);
+ Assert.assertEquals("Failed to untar " + fileName, 0, result);
+
+ // Push input files to device
+ Assert.assertNotNull("Failed to create directory " + DEVICE_IN_DIR + " on device ",
+ getDevice().executeAdbCommand("shell", "mkdir", "-p", DEVICE_IN_DIR));
+ Assert.assertTrue("Failed to push json files to " + DEVICE_IN_DIR + " on device ",
+ getDevice().syncFiles(new File(sHostWorkDir.getPath() + "/json/"), DEVICE_IN_DIR));
+ Assert.assertTrue("Failed to push mp4 files to " + DEVICE_IN_DIR + " on device ",
+ getDevice().syncFiles(new File(sHostWorkDir.getPath() + "/samples/"),
+ DEVICE_IN_DIR));
+
+ sIsTestSetUpDone = true;
}
/**
- * TODO: Add JavaDoc
- */
- /**
* Verify the video encoding quality requirements for the performance class 14 devices.
*/
@CddTest(requirements = {"2.2.7.1/5.8/H-1-1"})
@Test
public void testEncoding() throws Exception {
- String sdkAsString = getProperty("ro.build.version.sdk");
- int sdk = Integer.parseInt(sdkAsString);
- Assume.assumeTrue(
- "Test requires sdk >= " + MINIMUM_VALID_SDK + " test device has sdk = " + sdk,
- sdk >= MINIMUM_VALID_SDK);
+ Assume.assumeFalse("Skipping due to quick run mode",
+ mQuickCheck && !QUICK_RUN_PARAMS.contains(mJsonName));
+ Assume.assumeFalse("Skipping avc encoder tests",
+ mSkipAvc && (AVC_VBR_B0_PARAMS.contains(mJsonName) || AVC_VBR_B3_PARAMS.contains(
+ mJsonName)));
+ Assume.assumeFalse("Skipping hevc encoder tests",
+ mSkipHevc && (HEVC_VBR_B0_PARAMS.contains(mJsonName) || HEVC_VBR_B3_PARAMS.contains(
+ mJsonName)));
+ Assume.assumeFalse("Skipping b-frame tests",
+ mSkipB && (AVC_VBR_B3_PARAMS.contains(mJsonName) || HEVC_VBR_B3_PARAMS.contains(
+ mJsonName)));
+ Assume.assumeFalse("Skipping non b-frame tests",
+ mSkipP && (AVC_VBR_B0_PARAMS.contains(mJsonName) || HEVC_VBR_B0_PARAMS.contains(
+ mJsonName)));
- String os = System.getProperty("os.name").toLowerCase();
- LogUtil.CLog.i("Host OS = " + os);
-
- String pcAsString = getProperty("ro.odm.build.media_performance_class");
- int mpc = 0;
+ // set up test environment
+ sLock.lock();
try {
- mpc = Integer.parseInt("0" + pcAsString);
- } catch (Exception e) {
- LogUtil.CLog.i("Invalid pcAsString: " + pcAsString + ", exception: " + e);
- mpc = 0;
+ if (!sIsTestSetUpDone) setupTestEnv();
+ sCondition.signalAll();
+ } finally {
+ sLock.unlock();
}
- // Enable early termination on errors on the devices whose mpc's are not valid.
- // Run the entire test til the end on the devices whose mpc's are valid.
- boolean earlyTermination = mpc < MEDIA_PERFORMANCE_CLASS_14;
- if (mForceToRun) {
- earlyTermination = false; // Force to run the test til the end.
- }
+ // transcode input
+ runDeviceTests(DEVICE_SIDE_TEST_PACKAGE, DEVICE_SIDE_TEST_CLASS, "testTranscode");
- String targetSerial = getDevice().getSerialNumber();
- LogUtil.CLog.i("serial:\n\n" + targetSerial);
-
- String tmpBase = System.getProperty("java.io.tmpdir");
- String dirName = "CtsVideoEncodingQualityHostTest_" + targetSerial;
- String tmpDir = tmpBase + "/" + dirName;
-
- LogUtil.CLog.i("tmpBase= " + tmpBase + " tmpDir =" + tmpDir);
-
- if (mReset) {
- // start with a fresh directory
- File cwd = new File(".");
- runCommand("rm -fr " + tmpDir, cwd);
- }
-
- // set up test directory, make sure it exists
- File destination = new File(tmpDir);
+ // copy the encoded output from the device to the host.
+ String outDir = "output_" + mJsonName.substring(0, mJsonName.indexOf('.'));
+ File outHostPath = new File(sHostWorkDir, outDir);
try {
- if (!destination.isDirectory()) {
- destination.mkdirs();
+ if (!outHostPath.isDirectory()) {
+ Assert.assertTrue("Failed to create directory : " + outHostPath.getAbsolutePath(),
+ outHostPath.mkdirs());
}
} catch (SecurityException e) {
- LogUtil.CLog.e("Unable to establish temp directory " + destination.getPath());
+ LogUtil.CLog.e("Unable to establish output host directory : " + outHostPath.getPath());
}
- Assert.assertTrue("Failed to create test director: " + tmpDir, destination.isDirectory());
+ String outDevPath = DEVICE_OUT_DIR + outDir;
+ Assert.assertTrue("Failed to pull mp4 files from " + outDevPath
+ + " to " + outHostPath.getPath(), getDevice().pullDir(outDevPath, outHostPath));
+ getDevice().deleteFile(outDevPath);
- // Download the testsuit tar file.
- downloadFile("veqtests.tar.gz", destination);
+ // Parse json file
+ String jsonPath = sHostWorkDir.getPath() + "/json/" + mJsonName;
+ String jsonString =
+ new String(Files.readAllBytes(Paths.get(jsonPath)), StandardCharsets.UTF_8);
+ JSONArray jsonArray = new JSONArray(jsonString);
+ JSONObject obj = jsonArray.getJSONObject(0);
+ String refFileName = obj.getString("RefFileName");
+ int fps = obj.getInt("FrameRate");
+ int frameCount = obj.getInt("FrameCount");
+ int clipDuration = frameCount / fps;
- // Unpack the testsuit tar file.
- int result = runCommand("tar xvzf veqtests.tar.gz", destination);
- Assert.assertTrue("Failed to untar veqtests.tar.gz", result == 0);
+ // Compute Vmaf
+ try (FileWriter writer = new FileWriter(outHostPath.getPath() + "/" + "all_vmafs.txt")) {
+ JSONArray codecConfigs = obj.getJSONArray("CodecConfigs");
+ int th = Runtime.getRuntime().availableProcessors() / 2;
+ th = Math.min(Math.max(1, th), 8);
+ String filter = "libvmaf=feature=name=psnr:model=version=vmaf_v0.6.1:n_threads=" + th;
+ for (int i = 0; i < codecConfigs.length(); i++) {
+ JSONObject codecConfig = codecConfigs.getJSONObject(i);
+ String outputName = codecConfig.getString("EncodedFileName");
+ outputName = outputName.substring(0, outputName.lastIndexOf("."));
+ String outputVmafPath = outDir + "/" + outputName + ".txt";
+ String cmd = "./bin/ffmpeg";
+ cmd += " -hide_banner";
+ cmd += " -i " + outDir + "/" + outputName + ".mp4" + " -an";
+ cmd += " -i " + "samples/" + refFileName + " -an";
+ cmd += " -filter_complex " + "\"" + filter + "\"";
+ cmd += " -f null -";
+ cmd += " > " + outputVmafPath + " 2>&1";
+ LogUtil.CLog.i("ffmpeg command : " + cmd);
+ int result = runCommand(cmd, sHostWorkDir);
+ Assert.assertEquals("Encountered error during vmaf computation.", 0, result);
- // Execute the script to run the test.
- String testCommand = "./testit.sh --serial " + targetSerial;
- if (mQuickCheck) testCommand += " --enablequickrun YES";
- if (mDisableB) testCommand += " --enableb NO";
- if (earlyTermination) testCommand += " --exitonerror YES";
- result = runCommand(testCommand, destination);
+ String vmafLine = "";
+ try (BufferedReader reader = new BufferedReader(
+ new FileReader(sHostWorkDir.getPath() + "/" + outputVmafPath))) {
+ String token = "VMAF score: ";
+ String line;
+ while ((line = reader.readLine()) != null) {
+ if (line.contains(token)) {
+ line = line.substring(line.indexOf(token));
+ vmafLine = "VMAF score = " + line.substring(token.length());
+ LogUtil.CLog.i(vmafLine);
+ break;
+ }
+ }
+ } catch (IOException e) {
+ throw new AssertionError("Unexpected IOException: " + e.getMessage());
+ }
- if (mpc >= MEDIA_PERFORMANCE_CLASS_14 || mForceToRun) {
- Assert.assertTrue(
- "test device advertises mpc=" + mpc
- + ", but failed to pass the video encoding quality test.",
- result == 0);
- } else {
- Assume.assumeTrue(
- "test device advertises mpc=" + mpc
- + ", and did not pass the video encoding quality test.",
- result == 0);
+ writer.write(vmafLine + "\n");
+ writer.write("Y4M file = " + refFileName + "\n");
+ writer.write("MP4 file = " + refFileName + "\n");
+ File file = new File(outHostPath + "/" + outputName + ".mp4");
+ Assert.assertTrue("output file from device missing", file.exists());
+ long fileSize = file.length();
+ writer.write("Filesize = " + fileSize + "\n");
+ writer.write("FPS = " + fps + "\n");
+ writer.write("FRAME_COUNT = " + frameCount + "\n");
+ writer.write("CLIP_DURATION = " + clipDuration + "\n");
+ long totalBits = fileSize * 8;
+ long totalBits_kbps = totalBits / 1000;
+ long bitrate_kbps = totalBits_kbps / clipDuration;
+ writer.write("Bitrate kbps = " + bitrate_kbps + "\n");
+ }
+ } catch (IOException e) {
+ throw new AssertionError("Unexpected IOException: " + e.getMessage());
}
- LogUtil.CLog.i("Finished executing " + testCommand);
+ // bd rate verification
+ String jarCmd = "java -jar " + "./bin/cts-media-videoquality-bdrate.jar "
+ + "--uid= --gid= --chroot= "
+ + "--REF_JSON_FILE=" + "json/" + mJsonName + " "
+ + "--TEST_VMAF_FILE=" + outDir + "/" + "all_vmafs.txt "
+ + "> " + outDir + "/result.txt";
+ LogUtil.CLog.i("bdrate command : " + jarCmd);
+ int result = runCommand(jarCmd, sHostWorkDir);
+ Assert.assertEquals("bd rate validation failed.", 0, result);
+
+ LogUtil.CLog.i("Finished executing the process.");
}
- private int runCommand(String cmd, File dir) throws IOException, InterruptedException {
- Process process = Runtime.getRuntime().exec(cmd, null, dir);
+ private int runCommand(String command, File dir) throws IOException, InterruptedException {
+ Process p = new ProcessBuilder("/bin/sh", "-c", command)
+ .directory(dir)
+ .redirectErrorStream(true)
+ .redirectOutput(ProcessBuilder.Redirect.INHERIT)
+ .start();
- BufferedReader stdInput =
- new BufferedReader(new InputStreamReader(process.getInputStream()));
- BufferedReader stdError =
- new BufferedReader(new InputStreamReader(process.getErrorStream()));
- String line = "";
- boolean isOutReady = false;
- boolean isErrorReady = false;
- boolean isProcessAlive = false;
-
- while (process.isAlive()) {
- do {
- isOutReady = stdInput.ready();
-
- if (isOutReady) {
- line = stdInput.readLine();
- LogUtil.CLog.i("== " + line + "\n");
- }
-
- isErrorReady = stdError.ready();
- if (isErrorReady) {
- line = stdError.readLine();
- LogUtil.CLog.i("xx " + line + "\n");
- }
-
- isProcessAlive = process.isAlive();
- if (!isProcessAlive) {
- LogUtil.CLog.i("::Process DIED! " + line + "\n");
- line = null;
- process.waitFor(1000, TimeUnit.MILLISECONDS);
- }
-
- } while (line != null);
-
- process.waitFor(100, TimeUnit.MILLISECONDS);
+ BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
+ String line;
+ while ((line = stdInput.readLine()) != null || (line = stdError.readLine()) != null) {
+ LogUtil.CLog.i(line + "\n");
}
-
- return process.exitValue();
+ return p.waitFor();
}
- // Download the indicated file (within the base_url folder) to
- // our desired destination/fileName.
- // simple caching -- if file exists, we do not redownload
- private void downloadFile(String fileName, File destDir) {
+ // Download the indicated file (within the base_url folder) to our desired destination
+ // simple caching -- if file exists, we do not re-download
+ private void downloadFile(String url, File destDir) {
+ String fileName = url.substring(RES_URL.lastIndexOf('/') + 1);
File destination = new File(destDir, fileName);
// save bandwidth, also allows a user to manually preload files
@@ -248,12 +451,10 @@
return;
}
- String url = BASE_URL + fileName;
String cmd = "wget -O " + destination.getPath() + " " + url;
LogUtil.CLog.i("wget_cmd = " + cmd);
int result = 0;
-
try {
result = runCommand(cmd, destDir);
} catch (IOException e) {
@@ -261,6 +462,53 @@
} catch (InterruptedException e) {
result = -3;
}
- Assert.assertTrue("downloadFile failed.\n", result == 0);
+ Assert.assertEquals("download file failed.\n", 0, result);
+ }
+
+ private void runDeviceTests(String pkgName, @Nullable String testClassName,
+ @Nullable String testMethodName) throws DeviceNotAvailableException {
+ RemoteAndroidTestRunner testRunner = getTestRunner(pkgName, testClassName, testMethodName);
+ CollectingTestListener listener = new CollectingTestListener();
+ Assert.assertTrue(getDevice().runInstrumentationTests(testRunner, listener));
+ assertTestsPassed(listener.getCurrentRunResults());
+ }
+
+ private RemoteAndroidTestRunner getTestRunner(String pkgName, String testClassName,
+ String testMethodName) {
+ if (testClassName != null && testClassName.startsWith(".")) {
+ testClassName = pkgName + testClassName;
+ }
+ RemoteAndroidTestRunner testRunner =
+ new RemoteAndroidTestRunner(pkgName, RUNNER, getDevice().getIDevice());
+ testRunner.setMaxTimeToOutputResponse(DEFAULT_SHELL_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
+ testRunner.addInstrumentationArg(TEST_TIMEOUT_INST_ARGS_KEY,
+ Long.toString(DEFAULT_TEST_TIMEOUT_MILLIS));
+ testRunner.addInstrumentationArg(TEST_CONFIG_INST_ARGS_KEY, mJsonName);
+ if (testClassName != null && testMethodName != null) {
+ testRunner.setMethodName(testClassName, testMethodName);
+ } else if (testClassName != null) {
+ testRunner.setClassName(testClassName);
+ }
+ return testRunner;
+ }
+
+ private void assertTestsPassed(TestRunResult testRunResult) {
+ if (testRunResult.isRunFailure()) {
+ throw new AssertionError("Failed to successfully run device tests for "
+ + testRunResult.getName() + ": " + testRunResult.getRunFailureMessage());
+ }
+ if (testRunResult.getNumTests() != testRunResult.getPassedTests().size()) {
+ StringBuilder errorBuilder = new StringBuilder("On-device tests failed:\n");
+ for (Map.Entry<TestDescription, TestResult> resultEntry :
+ testRunResult.getTestResults().entrySet()) {
+ if (!resultEntry.getValue().getStatus()
+ .equals(com.android.ddmlib.testrunner.TestResult.TestStatus.PASSED)) {
+ errorBuilder.append(resultEntry.getKey().toString());
+ errorBuilder.append(":\n");
+ errorBuilder.append(resultEntry.getValue().getStackTrace());
+ }
+ }
+ throw new AssertionError(errorBuilder.toString());
+ }
}
}
diff --git a/hostsidetests/multiuser/Android.bp b/hostsidetests/multiuser/Android.bp
index 01556a9..f2bcb30 100644
--- a/hostsidetests/multiuser/Android.bp
+++ b/hostsidetests/multiuser/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_multiuser",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/multiuser/app/Android.bp b/hostsidetests/multiuser/app/Android.bp
index fdaab65..f1e8ffb 100644
--- a/hostsidetests/multiuser/app/Android.bp
+++ b/hostsidetests/multiuser/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_multiuser",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/multiuser/dpc/Android.bp b/hostsidetests/multiuser/dpc/Android.bp
index 6d3b4c5..15c89c6 100644
--- a/hostsidetests/multiuser/dpc/Android.bp
+++ b/hostsidetests/multiuser/dpc/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_multiuser",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/numberblocking/Android.bp b/hostsidetests/numberblocking/Android.bp
index aaad013..f3d78a0 100644
--- a/hostsidetests/numberblocking/Android.bp
+++ b/hostsidetests/numberblocking/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telecom",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/numberblocking/app/Android.bp b/hostsidetests/numberblocking/app/Android.bp
index 6a60d13..227ca2f 100644
--- a/hostsidetests/numberblocking/app/Android.bp
+++ b/hostsidetests/numberblocking/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telecom",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibTestApp/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibTestApp/Android.bp
index 47c62ea..0edcd93 100644
--- a/hostsidetests/os/test-apps/StaticSharedLibTestApp/Android.bp
+++ b/hostsidetests/os/test-apps/StaticSharedLibTestApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibTestApp/OWNERS b/hostsidetests/os/test-apps/StaticSharedLibTestApp/OWNERS
index 4247866..33c65a8 100644
--- a/hostsidetests/os/test-apps/StaticSharedLibTestApp/OWNERS
+++ b/hostsidetests/os/test-apps/StaticSharedLibTestApp/OWNERS
@@ -1,5 +1,6 @@
# Bug component: 36137
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
rhedjao@google.com
patb@google.com
-toddke@google.com
diff --git a/hostsidetests/packagemanager/OWNERS b/hostsidetests/packagemanager/OWNERS
index 003fff4..bdc7ac5 100644
--- a/hostsidetests/packagemanager/OWNERS
+++ b/hostsidetests/packagemanager/OWNERS
@@ -1,7 +1,6 @@
# Bug component: 36137
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
-toddke@google.com
-svetoslavganov@google.com
-narayan@google.com
hackbod@google.com
diff --git a/hostsidetests/packagemanager/domainverification/OWNERS b/hostsidetests/packagemanager/domainverification/OWNERS
index dd85fa9..2437bbb 100644
--- a/hostsidetests/packagemanager/domainverification/OWNERS
+++ b/hostsidetests/packagemanager/domainverification/OWNERS
@@ -1,4 +1,5 @@
# Bug component: 36137
-chiuwinson@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
-toddke@google.com
+
diff --git a/hostsidetests/packagemanager/domainverification/apps/calling/Android.bp b/hostsidetests/packagemanager/domainverification/apps/calling/Android.bp
index 480bb77..312900c 100644
--- a/hostsidetests/packagemanager/domainverification/apps/calling/Android.bp
+++ b/hostsidetests/packagemanager/domainverification/apps/calling/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/domainverification/apps/declaring/Android.bp b/hostsidetests/packagemanager/domainverification/apps/declaring/Android.bp
index fa0e164..dfdbb26 100644
--- a/hostsidetests/packagemanager/domainverification/apps/declaring/Android.bp
+++ b/hostsidetests/packagemanager/domainverification/apps/declaring/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/domainverification/device/multiuser/Android.bp b/hostsidetests/packagemanager/domainverification/device/multiuser/Android.bp
index cb3795c..fc89515 100644
--- a/hostsidetests/packagemanager/domainverification/device/multiuser/Android.bp
+++ b/hostsidetests/packagemanager/domainverification/device/multiuser/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/domainverification/device/standalone/Android.bp b/hostsidetests/packagemanager/domainverification/device/standalone/Android.bp
index 3796eaa..eda345b 100644
--- a/hostsidetests/packagemanager/domainverification/device/standalone/Android.bp
+++ b/hostsidetests/packagemanager/domainverification/device/standalone/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/domainverification/host/Android.bp b/hostsidetests/packagemanager/domainverification/host/Android.bp
index bfbf975..c8106c0 100644
--- a/hostsidetests/packagemanager/domainverification/host/Android.bp
+++ b/hostsidetests/packagemanager/domainverification/host/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/domainverification/lib/constants/android/Android.bp b/hostsidetests/packagemanager/domainverification/lib/constants/android/Android.bp
index 1545eec..ba6031d 100644
--- a/hostsidetests/packagemanager/domainverification/lib/constants/android/Android.bp
+++ b/hostsidetests/packagemanager/domainverification/lib/constants/android/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/domainverification/lib/constants/java/Android.bp b/hostsidetests/packagemanager/domainverification/lib/constants/java/Android.bp
index c877610..a195f14 100644
--- a/hostsidetests/packagemanager/domainverification/lib/constants/java/Android.bp
+++ b/hostsidetests/packagemanager/domainverification/lib/constants/java/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/dynamicmime/Android.bp b/hostsidetests/packagemanager/dynamicmime/Android.bp
index fe71761..e0c597d 100644
--- a/hostsidetests/packagemanager/dynamicmime/Android.bp
+++ b/hostsidetests/packagemanager/dynamicmime/Android.bp
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/dynamicmime/app/Android.bp b/hostsidetests/packagemanager/dynamicmime/app/Android.bp
index 1d34cf4..40a3374 100644
--- a/hostsidetests/packagemanager/dynamicmime/app/Android.bp
+++ b/hostsidetests/packagemanager/dynamicmime/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/dynamicmime/common/Android.bp b/hostsidetests/packagemanager/dynamicmime/common/Android.bp
index 97a8893..d42e170 100644
--- a/hostsidetests/packagemanager/dynamicmime/common/Android.bp
+++ b/hostsidetests/packagemanager/dynamicmime/common/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/dynamicmime/test/Android.bp b/hostsidetests/packagemanager/dynamicmime/test/Android.bp
index 19bf606..f63ef64 100644
--- a/hostsidetests/packagemanager/dynamicmime/test/Android.bp
+++ b/hostsidetests/packagemanager/dynamicmime/test/Android.bp
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/extractnativelibs/Android.bp b/hostsidetests/packagemanager/extractnativelibs/Android.bp
index df535bc..fd263da 100644
--- a/hostsidetests/packagemanager/extractnativelibs/Android.bp
+++ b/hostsidetests/packagemanager/extractnativelibs/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/extractnativelibs/OWNERS b/hostsidetests/packagemanager/extractnativelibs/OWNERS
index 12c955a..1d2a085 100644
--- a/hostsidetests/packagemanager/extractnativelibs/OWNERS
+++ b/hostsidetests/packagemanager/extractnativelibs/OWNERS
@@ -1,5 +1,6 @@
# Bug component: 36137
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
schfan@google.com
alexbuy@google.com
diff --git a/hostsidetests/packagemanager/extractnativelibs/apps/Android.bp b/hostsidetests/packagemanager/extractnativelibs/apps/Android.bp
index cd9ea49..fadc66c 100644
--- a/hostsidetests/packagemanager/extractnativelibs/apps/Android.bp
+++ b/hostsidetests/packagemanager/extractnativelibs/apps/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/installedloadingprogess/Android.bp b/hostsidetests/packagemanager/installedloadingprogess/Android.bp
index 42e2370..8b80315 100644
--- a/hostsidetests/packagemanager/installedloadingprogess/Android.bp
+++ b/hostsidetests/packagemanager/installedloadingprogess/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/installedloadingprogess/OWNERS b/hostsidetests/packagemanager/installedloadingprogess/OWNERS
index d697d1f..49b2e69 100644
--- a/hostsidetests/packagemanager/installedloadingprogess/OWNERS
+++ b/hostsidetests/packagemanager/installedloadingprogess/OWNERS
@@ -1,5 +1,6 @@
# Bug component: 36137
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
schfan@google.com
alexbuy@google.com
\ No newline at end of file
diff --git a/hostsidetests/packagemanager/installedloadingprogess/apps/Android.bp b/hostsidetests/packagemanager/installedloadingprogess/apps/Android.bp
index 0d9e636..0bd29a1 100644
--- a/hostsidetests/packagemanager/installedloadingprogess/apps/Android.bp
+++ b/hostsidetests/packagemanager/installedloadingprogess/apps/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/installedloadingprogess/deviceside/Android.bp b/hostsidetests/packagemanager/installedloadingprogess/deviceside/Android.bp
index 208ae77..01abb33 100644
--- a/hostsidetests/packagemanager/installedloadingprogess/deviceside/Android.bp
+++ b/hostsidetests/packagemanager/installedloadingprogess/deviceside/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/installedloadingprogess/testdata/Android.bp b/hostsidetests/packagemanager/installedloadingprogess/testdata/Android.bp
index a749129..fa6d5b1 100644
--- a/hostsidetests/packagemanager/installedloadingprogess/testdata/Android.bp
+++ b/hostsidetests/packagemanager/installedloadingprogess/testdata/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/multiuser/Android.bp b/hostsidetests/packagemanager/multiuser/Android.bp
index b5afc85..8be6114 100644
--- a/hostsidetests/packagemanager/multiuser/Android.bp
+++ b/hostsidetests/packagemanager/multiuser/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/multiuser/app/Android.bp b/hostsidetests/packagemanager/multiuser/app/Android.bp
index 459e564..41d351c 100644
--- a/hostsidetests/packagemanager/multiuser/app/Android.bp
+++ b/hostsidetests/packagemanager/multiuser/app/Android.bp
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -21,13 +21,16 @@
name: "CtsPackageManagerMultiUserTestApp",
defaults: ["cts_defaults"],
sdk_version: "current",
- srcs: ["src/**/*.java",],
+ srcs: ["src/**/*.java"],
test_suites: [
"cts",
"vts",
"vts10",
"general-tests",
],
- static_libs: ["androidx.test.rules", "cts-install-lib"],
+ static_libs: [
+ "androidx.test.rules",
+ "cts-install-lib",
+ ],
compile_multilib: "both",
}
diff --git a/hostsidetests/packagemanager/multiuser/test-apps/emptytestapp/Android.bp b/hostsidetests/packagemanager/multiuser/test-apps/emptytestapp/Android.bp
index 4307d7a..528ca9a 100644
--- a/hostsidetests/packagemanager/multiuser/test-apps/emptytestapp/Android.bp
+++ b/hostsidetests/packagemanager/multiuser/test-apps/emptytestapp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -21,4 +22,4 @@
defaults: ["cts_defaults"],
sdk_version: "current",
min_sdk_version: "23",
-}
\ No newline at end of file
+}
diff --git a/hostsidetests/packagemanager/packagesetting/Android.bp b/hostsidetests/packagemanager/packagesetting/Android.bp
index 40ea0e4..68404d5 100644
--- a/hostsidetests/packagemanager/packagesetting/Android.bp
+++ b/hostsidetests/packagemanager/packagesetting/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/packagesetting/app/Android.bp b/hostsidetests/packagemanager/packagesetting/app/Android.bp
index a2d9da9..a0c5b18 100644
--- a/hostsidetests/packagemanager/packagesetting/app/Android.bp
+++ b/hostsidetests/packagemanager/packagesetting/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/parsing/OWNERS b/hostsidetests/packagemanager/parsing/OWNERS
index 541ab2e..2437bbb 100644
--- a/hostsidetests/packagemanager/parsing/OWNERS
+++ b/hostsidetests/packagemanager/parsing/OWNERS
@@ -1,5 +1,5 @@
# Bug component: 36137
-chiuwinson@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
-toddke@google.com
diff --git a/hostsidetests/packagemanager/parsing/host/Android.bp b/hostsidetests/packagemanager/parsing/host/Android.bp
index a5233fe..e941ff4 100644
--- a/hostsidetests/packagemanager/parsing/host/Android.bp
+++ b/hostsidetests/packagemanager/parsing/host/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -41,7 +42,7 @@
genrule {
name: "CtsPackageManagerParsingHostTestGen",
- defaults: [ "CtsPackageManagerParsingApkGenerator" ],
- srcs: [ "src/**/*.kt" ],
- out: [ "GeneratedApks.zip" ],
+ defaults: ["CtsPackageManagerParsingApkGenerator"],
+ srcs: ["src/**/*.kt"],
+ out: ["GeneratedApks.zip"],
}
diff --git a/hostsidetests/packagemanager/parsing/processing/Android.bp b/hostsidetests/packagemanager/parsing/processing/Android.bp
index 284dda3..26713f3 100644
--- a/hostsidetests/packagemanager/parsing/processing/Android.bp
+++ b/hostsidetests/packagemanager/parsing/processing/Android.bp
@@ -13,12 +13,13 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
java_library_host {
name: "CtsPackageManagerParsingAnnotationProcessorApi",
- srcs: [ "api/src/**/*.kt" ],
+ srcs: ["api/src/**/*.kt"],
defaults: ["cts_defaults"],
libs: [
"compatibility-host-util",
@@ -34,12 +35,12 @@
filegroup {
name: "CtsPackageManagerApkGeneratorSrc",
- srcs: [ "ApkGenerator.py" ],
+ srcs: ["ApkGenerator.py"],
}
filegroup {
name: "CtsPackageManagerApkGeneratorJks",
- srcs: [ "ApkGenerator.jks" ],
+ srcs: ["ApkGenerator.jks"],
}
genrule_defaults {
@@ -55,7 +56,7 @@
"soong_zip",
],
cmd: "python3 $(location :CtsPackageManagerApkGeneratorSrc) \"$(location aapt2)\" " +
- "\"$(location :framework-res)\" \"$(location apksigner)\" " +
- "\"$(location :CtsPackageManagerApkGeneratorJks)\" " +
- "\"$(genDir)\" $(in) && $(location soong_zip) -o $(out) -L 0 -C $(genDir)/out -D $(genDir)/out"
+ "\"$(location :framework-res)\" \"$(location apksigner)\" " +
+ "\"$(location :CtsPackageManagerApkGeneratorJks)\" " +
+ "\"$(genDir)\" $(in) && $(location soong_zip) -o $(out) -L 0 -C $(genDir)/out -D $(genDir)/out",
}
diff --git a/hostsidetests/packagemanager/preferredactivity/Android.bp b/hostsidetests/packagemanager/preferredactivity/Android.bp
index 2e7ecdf..a8fcc30 100644
--- a/hostsidetests/packagemanager/preferredactivity/Android.bp
+++ b/hostsidetests/packagemanager/preferredactivity/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/preferredactivity/apps/testapp/Android.bp b/hostsidetests/packagemanager/preferredactivity/apps/testapp/Android.bp
index 7a84451..d17a1e2 100644
--- a/hostsidetests/packagemanager/preferredactivity/apps/testapp/Android.bp
+++ b/hostsidetests/packagemanager/preferredactivity/apps/testapp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/stats/Android.bp b/hostsidetests/packagemanager/stats/Android.bp
index abae476..6a0332a 100644
--- a/hostsidetests/packagemanager/stats/Android.bp
+++ b/hostsidetests/packagemanager/stats/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/stats/OWNERS b/hostsidetests/packagemanager/stats/OWNERS
index fd0ce2d..46a04b9 100644
--- a/hostsidetests/packagemanager/stats/OWNERS
+++ b/hostsidetests/packagemanager/stats/OWNERS
@@ -1,7 +1,7 @@
# Bug component: 36137
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
schfan@google.com
-chiuwinson@google.com
alexbuy@google.com
zyy@google.com
\ No newline at end of file
diff --git a/hostsidetests/packagemanager/stats/apps/emptyapp/Android.bp b/hostsidetests/packagemanager/stats/apps/emptyapp/Android.bp
index 36e4935..3ab74b1 100644
--- a/hostsidetests/packagemanager/stats/apps/emptyapp/Android.bp
+++ b/hostsidetests/packagemanager/stats/apps/emptyapp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/stats/apps/emptyapp2/Android.bp b/hostsidetests/packagemanager/stats/apps/emptyapp2/Android.bp
index f4aea5c..fa05842 100644
--- a/hostsidetests/packagemanager/stats/apps/emptyapp2/Android.bp
+++ b/hostsidetests/packagemanager/stats/apps/emptyapp2/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/packagemanager/stats/device/Android.bp b/hostsidetests/packagemanager/stats/device/Android.bp
index 4781753..fe03363 100644
--- a/hostsidetests/packagemanager/stats/device/Android.bp
+++ b/hostsidetests/packagemanager/stats/device/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/resources/OWNERS b/hostsidetests/resources/OWNERS
new file mode 100644
index 0000000..12b25f7
--- /dev/null
+++ b/hostsidetests/resources/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 568761
+
+zyy@google.com
+branliu@google.com
\ No newline at end of file
diff --git a/hostsidetests/sample/Android.bp b/hostsidetests/sample/Android.bp
index f34bb09..371b398 100644
--- a/hostsidetests/sample/Android.bp
+++ b/hostsidetests/sample/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_partner_eng",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/sample/app/Android.bp b/hostsidetests/sample/app/Android.bp
index 536ce24..d061725 100644
--- a/hostsidetests/sample/app/Android.bp
+++ b/hostsidetests/sample/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_partner_eng",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/sample/app2/Android.bp b/hostsidetests/sample/app2/Android.bp
index 0aaff4c..3b71ceb 100644
--- a/hostsidetests/sample/app2/Android.bp
+++ b/hostsidetests/sample/app2/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_partner_eng",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/scopedstorage/device/src/android/scopedstorage/cts/device/ScopedStorageDeviceTest.java b/hostsidetests/scopedstorage/device/src/android/scopedstorage/cts/device/ScopedStorageDeviceTest.java
index bc6d644..d11dcda 100644
--- a/hostsidetests/scopedstorage/device/src/android/scopedstorage/cts/device/ScopedStorageDeviceTest.java
+++ b/hostsidetests/scopedstorage/device/src/android/scopedstorage/cts/device/ScopedStorageDeviceTest.java
@@ -1859,13 +1859,17 @@
assertCantRenameDirectory(downloadDir, new File(dcimDir, TEST_DIRECTORY_NAME), null);
// Moving media directory to Download directory is allowed.
+ // Allow falling back to a recursive copy, since the rename will fail on ARCVM
+ // due to EXDEV.
assertCanRenameDirectory(mediaDirectory1, mediaDirectory2, new File[] {videoFile1},
- new File[] {videoFile2});
+ new File[] {videoFile2}, true /* allowCopyFallback */);
// Moving media directory to Movies directory and renaming directory in new path is
// allowed.
+ // Allow falling back to a recursive copy, since the rename will fail on ARCVM
+ // due to EXDEV.
assertCanRenameDirectory(mediaDirectory2, mediaDirectory3, new File[] {videoFile2},
- new File[] {videoFile3});
+ new File[] {videoFile3}, true /* allowCopyFallback */);
// Can't rename a mediaDirectory to non empty non Media directory.
assertCantRenameDirectory(mediaDirectory3, nonMediaDirectory, new File[] {videoFile3});
diff --git a/hostsidetests/scopedstorage/libs/ScopedStorageTestLib/src/android/scopedstorage/cts/lib/TestUtils.java b/hostsidetests/scopedstorage/libs/ScopedStorageTestLib/src/android/scopedstorage/cts/lib/TestUtils.java
index 44d41ba..87dd75b 100644
--- a/hostsidetests/scopedstorage/libs/ScopedStorageTestLib/src/android/scopedstorage/cts/lib/TestUtils.java
+++ b/hostsidetests/scopedstorage/libs/ScopedStorageTestLib/src/android/scopedstorage/cts/lib/TestUtils.java
@@ -87,6 +87,9 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -1096,12 +1099,7 @@
// to keep rolling forward if we can't find our grant button
final UiSelector grant = new UiSelector().textMatches("(?i)Allow");
if (isWatch(inst.getContext().getPackageManager())) {
- UiScrollable uiScrollable = new UiScrollable(new UiSelector().scrollable(true));
- try {
- uiScrollable.scrollIntoView(grant);
- } catch (UiObjectNotFoundException e) {
- // Scrolling can fail if the UI is not scrollable
- }
+ scrollIntoView(grant);
}
final boolean grantExists = new UiObject(grant).waitForExists(timeout);
@@ -1118,6 +1116,9 @@
} else {
// fine the Deny button
final UiSelector deny = new UiSelector().textMatches("(?i)Deny");
+ if (isWatch(inst.getContext().getPackageManager())) {
+ scrollIntoView(deny);
+ }
final boolean denyExists = new UiObject(deny).waitForExists(timeout);
assertThat(denyExists).isTrue();
@@ -1138,6 +1139,15 @@
return packageManager.hasSystemFeature(feature);
}
+ private static void scrollIntoView(UiSelector selector) {
+ UiScrollable uiScrollable = new UiScrollable(new UiSelector().scrollable(true));
+ try {
+ uiScrollable.scrollIntoView(selector);
+ } catch (UiObjectNotFoundException e) {
+ // Scrolling can fail if the UI is not scrollable
+ }
+ }
+
/**
* A functional interface representing an operation that takes no arguments,
* returns no arguments and might throw an {@link Exception} of any kind.
@@ -1324,12 +1334,79 @@
}
}
+ private static void copyContentsAndDir(final Path source, final Path target)
+ throws IOException {
+ Files.walkFileTree(source, new java.nio.file.SimpleFileVisitor<Path>() {
+ private java.nio.file.FileVisitResult copyFileOrEmptyDir(final Path source,
+ final Path sourceRoot, final Path targetRoot) throws IOException {
+ final Path target = targetRoot.resolve(sourceRoot.relativize(source));
+ Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING,
+ java.nio.file.LinkOption.NOFOLLOW_LINKS);
+ return java.nio.file.FileVisitResult.CONTINUE;
+ }
+ @Override
+ public java.nio.file.FileVisitResult preVisitDirectory(Path sourceDir,
+ java.nio.file.attribute.BasicFileAttributes attrs) throws IOException {
+ return copyFileOrEmptyDir(sourceDir, source, target);
+ }
+ @Override
+ public java.nio.file.FileVisitResult visitFile(Path sourceFile,
+ java.nio.file.attribute.BasicFileAttributes attrs) throws IOException {
+ return copyFileOrEmptyDir(sourceFile, source, target);
+ }
+ });
+ }
+
+ private static boolean renameDirectoryWithOptionalFallbackToCopy(
+ File oldDirectory, File newDirectory, boolean allowCopyFallback) {
+ if (oldDirectory.renameTo(newDirectory)) {
+ return true;
+ }
+
+ if (!allowCopyFallback) {
+ return false;
+ }
+
+ if (!oldDirectory.isDirectory()) {
+ return false;
+ }
+ if (newDirectory.exists()
+ && (!newDirectory.isDirectory() || newDirectory.listFiles().length > 0)) {
+ return false;
+ }
+
+ final Path oldPath = oldDirectory.toPath();
+ final Path newPath = newDirectory.toPath();
+ Log.v(TAG, "Recovering failed rename from " + oldPath + " to " + newPath);
+ try {
+ copyContentsAndDir(oldPath, newPath);
+ } catch (IOException e) {
+ Log.v(TAG, "Failed to recover rename: ", e);
+ return false;
+ }
+ deleteRecursively(oldDirectory);
+ return true;
+ }
+
/**
* Asserts can rename directory.
*/
public static void assertCanRenameDirectory(File oldDirectory, File newDirectory,
@Nullable File[] oldFilesList, @Nullable File[] newFilesList) {
- assertThat(oldDirectory.renameTo(newDirectory)).isTrue();
+ assertCanRenameDirectory(oldDirectory, newDirectory, oldFilesList, newFilesList,
+ false /* allowCopyFallback */);
+ }
+
+ /**
+ * Asserts can rename directory. When {@code allowCopyFallback} is true and the simple rename
+ * fails, falls back to recursively copying {@code oldDirectory} into {@code newDirectory}.
+ * Note that the file attributes will not be copied on the fallback.
+ */
+ public static void assertCanRenameDirectory(File oldDirectory, File newDirectory,
+ @Nullable File[] oldFilesList, @Nullable File[] newFilesList,
+ boolean allowCopyFallback) {
+ assertThat(renameDirectoryWithOptionalFallbackToCopy(
+ oldDirectory, newDirectory, allowCopyFallback)).isTrue();
assertThat(oldDirectory.exists()).isFalse();
assertThat(newDirectory.exists()).isTrue();
for (File file : oldFilesList != null ? oldFilesList : new File[0]) {
diff --git a/hostsidetests/seccomp/Android.bp b/hostsidetests/seccomp/Android.bp
index 9e707df..b085ad4 100644
--- a/hostsidetests/seccomp/Android.bp
+++ b/hostsidetests/seccomp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/seccomp/app/Android.bp b/hostsidetests/seccomp/app/Android.bp
index d77756f..ba7108d 100644
--- a/hostsidetests/seccomp/app/Android.bp
+++ b/hostsidetests/seccomp/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/seccomp/app/jni/Android.bp b/hostsidetests/seccomp/app/jni/Android.bp
index 6e7b361..2a9ef5e 100644
--- a/hostsidetests/seccomp/app/jni/Android.bp
+++ b/hostsidetests/seccomp/app/jni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/security/Android.bp b/hostsidetests/security/Android.bp
index 28b30aa..d4e9d21 100644
--- a/hostsidetests/security/Android.bp
+++ b/hostsidetests/security/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/security/app/Android.bp b/hostsidetests/security/app/Android.bp
index 6ff4fbc..ae5b6b4 100644
--- a/hostsidetests/security/app/Android.bp
+++ b/hostsidetests/security/app/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/security/src/android/security/cts/KernelConfigTest.java b/hostsidetests/security/src/android/security/cts/KernelConfigTest.java
index ac330af..7b9d25a 100644
--- a/hostsidetests/security/src/android/security/cts/KernelConfigTest.java
+++ b/hostsidetests/security/src/android/security/cts/KernelConfigTest.java
@@ -397,7 +397,7 @@
}
/**
- * Test that the kernel enables fs-verity and its built-in signature support.
+ * Test that the kernel enables fs-verity.
*/
@CddTest(requirement="9.10")
@Test
@@ -408,9 +408,6 @@
}
assertTrue("Linux kernel must have fs-verity enabled: CONFIG_FS_VERITY=y",
configSet.contains("CONFIG_FS_VERITY=y"));
- assertTrue("Linux kernel must have fs-verity's builtin signature enabled: "
- + "CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y",
- configSet.contains("CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y"));
}
private void assumeSecurityModelCompat() throws Exception {
diff --git a/hostsidetests/securitybulletin/Android.bp b/hostsidetests/securitybulletin/Android.bp
index 8bd5c74..9375687 100644
--- a/hostsidetests/securitybulletin/Android.bp
+++ b/hostsidetests/securitybulletin/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/Bug-115739809/Android.bp b/hostsidetests/securitybulletin/securityPatch/Bug-115739809/Android.bp
index b145ce8..690fea9 100644
--- a/hostsidetests/securitybulletin/securityPatch/Bug-115739809/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/Bug-115739809/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/Bug-137878930/Android.bp b/hostsidetests/securitybulletin/securityPatch/Bug-137878930/Android.bp
index e3cc1df..047a89e 100644
--- a/hostsidetests/securitybulletin/securityPatch/Bug-137878930/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/Bug-137878930/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/Bug-187957589/Android.bp b/hostsidetests/securitybulletin/securityPatch/Bug-187957589/Android.bp
index 2f0d2d0..0aa5f1a 100644
--- a/hostsidetests/securitybulletin/securityPatch/Bug-187957589/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/Bug-187957589/Android.bp
@@ -15,16 +15,17 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_test {
name: "Bug-187957589",
defaults: [
- "cts_hostsidetests_securitybulletin_defaults"
+ "cts_hostsidetests_securitybulletin_defaults",
],
srcs: [
- "poc.cpp"
+ "poc.cpp",
],
shared_libs: [
"libstatssocket",
diff --git a/hostsidetests/securitybulletin/securityPatch/Bug-38195738/Android.bp b/hostsidetests/securitybulletin/securityPatch/Bug-38195738/Android.bp
index 9754423..9273268 100644
--- a/hostsidetests/securitybulletin/securityPatch/Bug-38195738/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/Bug-38195738/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2012-6702/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2012-6702/Android.bp
index ed60a1d..c66aaf4 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2012-6702/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2012-6702/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2014-3145/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2014-3145/Android.bp
index 0f770b3..6a76241 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2014-3145/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2014-3145/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2014-9803/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2014-9803/Android.bp
index 756e6d2..92f0111 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2014-9803/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2014-9803/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2015-1805/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2015-1805/Android.bp
index 7afaa2f..f2bbc74 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2015-1805/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2015-1805/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/Android.bp
index c2810d0..b12750d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2015-6616/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2015-6616/Android.bp
index 7fba1d6..db407d0 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2015-6616/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2015-6616/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-0844/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-0844/Android.bp
index 9aafbfe..d2be7b2 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-0844/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-0844/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-10229/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-10229/Android.bp
index 875923e..6262f22 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-10229/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-10229/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-10244/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-10244/Android.bp
index 92d8f05..81ace4e 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-10244/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-10244/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2109/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2109/Android.bp
index 816b323..5fcfbb4 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2109/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2109/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2182/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2182/Android.bp
index 282e6b3..48cff035 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2182/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2182/Android.bp
@@ -15,6 +15,7 @@
*
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2412/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2412/Android.bp
index 2788d97..9a84705 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2412/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2412/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2419/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2419/Android.bp
index c1e34fe..abcf1cb 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2419/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2419/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2460/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2460/Android.bp
index 028b0b1..e2d3b71 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2460/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2460/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2471/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2471/Android.bp
index 103f4ac..7df2dee 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2471/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2471/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2482/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2482/Android.bp
index e7fcb70..b35f942 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2482/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2482/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2485/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2485/Android.bp
index bf03223..c5664b1 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2485/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2485/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-3746/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-3746/Android.bp
index 7860cd0..059187d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-3746/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-3746/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-3747/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-3747/Android.bp
index 7ed84ee..8324abc 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-3747/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-3747/Android.bp
@@ -12,6 +12,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-3818/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-3818/Android.bp
index e134eeb..58ead83 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-3818/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-3818/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-3913/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-3913/Android.bp
index f41f66d..e3dcb2a 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-3913/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-3913/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-4658/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-4658/Android.bp
index e1c8cd0..6b823c6 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-4658/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-4658/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-5131/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-5131/Android.bp
index daea235..9956668 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-5131/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-5131/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-5862/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-5862/Android.bp
index a32e10f..63a20af 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-5862/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-5862/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-5867/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-5867/Android.bp
index 34c69f3..0adafaa 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-5867/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-5867/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6730/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6730/Android.bp
index 69c6230..7ace523 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6730/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6730/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6731/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6731/Android.bp
index 4cb05b5..a517575 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6731/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6731/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6732/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6732/Android.bp
index 10102eb..74a9a1f 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6732/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6732/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6733/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6733/Android.bp
index 123c22e..6ef1838 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6733/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6733/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6734/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6734/Android.bp
index a664d5c..e710469 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6734/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6734/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6735/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6735/Android.bp
index 4b648f4..d11aace 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6735/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6735/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6736/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6736/Android.bp
index 0f5053b..3dcbe4f 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-6736/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6736/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8332/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8332/Android.bp
index 382d629..da37606 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8332/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8332/Android.bp
@@ -15,6 +15,7 @@
*
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8425/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8425/Android.bp
index bbbf743..46b0783 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8425/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8425/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8426/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8426/Android.bp
index f6f688f..e014443 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8426/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8426/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8427/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8427/Android.bp
index 4e78056..491aa92 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8427/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8427/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8428/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8428/Android.bp
index 1400642..7ae848c 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8428/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8428/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8429/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8429/Android.bp
index a1f6df2..177769d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8429/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8429/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8430/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8430/Android.bp
index 303dcdb..1da810d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8430/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8430/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8431/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8431/Android.bp
index 31b47fb..d252327 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8431/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8431/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8432/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8432/Android.bp
index cfea314..e1bfbf1 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8432/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8432/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8434/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8434/Android.bp
index d3acc03..0fc451d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8434/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8434/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8460/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8460/Android.bp
index c1c40d8..261bc36 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8460/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8460/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8479/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8479/Android.bp
index 11eb61ee..14e9096 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8479/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8479/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8482/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8482/Android.bp
index b11576a..b500012 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-8482/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8482/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0333/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0333/Android.bp
index f247aeb..e7ed372 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0333/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0333/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0334/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0334/Android.bp
index 32bb9a7..de9a5ab 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0334/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0334/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0386/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0386/Android.bp
index 95faa49..120f3e9 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0386/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0386/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0415/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0415/Android.bp
index db9c363..834c5bf 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0415/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0415/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0426/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0426/Android.bp
index 73ced42..d70ca55 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0426/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0426/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0477/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0477/Android.bp
index ee72655..61b752e 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0477/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0477/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0479/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0479/Android.bp
index 6c3d704..33e2453 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0479/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0479/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0508/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0508/Android.bp
index 17207a8..aec4d76 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0508/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0508/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0553/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0553/Android.bp
index 770adb9..0a6e364 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0553/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0553/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0670/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0670/Android.bp
index 581efc1..d53e946 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0670/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0670/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0684/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0684/Android.bp
index e6ea6e1..797c729 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0684/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0684/Android.bp
@@ -15,6 +15,7 @@
*
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0697/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0697/Android.bp
index fe0fdf4..ee6b6d4 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0697/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0697/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0726/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0726/Android.bp
index f446bcb..d6ef0ce 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0726/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0726/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0814/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0814/Android.bp
index 31215a1..1ae2848 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0814/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0814/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0817/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0817/Android.bp
index 0859a1f..097b348 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0817/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0817/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0837/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0837/Android.bp
index a2a8734..496887c 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0837/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0837/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0840/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0840/Android.bp
index 52325db..138a9e3 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-0840/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0840/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13180/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13180/Android.bp
index 7d36722..1ee2ccc 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13180/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13180/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13194/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13194/Android.bp
index 9a466b1..d0cf492 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13194/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13194/Android.bp
@@ -15,6 +15,7 @@
*
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13232/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13232/Android.bp
index c8b45cb..5d921e8 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13232/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13232/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13234/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13234/Android.bp
index c7b481a..7bb3812 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13234/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13234/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13241/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13241/Android.bp
index f6d2bc8..6eac888 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13241/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13241/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13253/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13253/Android.bp
index ab30297..9bc5a82 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13253/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13253/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13273/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13273/Android.bp
index 5d59b96..254c3cf 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-13273/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-13273/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2017-6262/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2017-6262/Android.bp
index 35dcbde..4abac85c 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2017-6262/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2017-6262/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9344/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9344/Android.bp
index 45ae45e..62bcbc7 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9344/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9344/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9410/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9410/Android.bp
index e28a3a7..01cc9ae 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9410/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9410/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9424/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9424/Android.bp
index 9e49090..1e0e38f 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9424/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9424/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9466/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9466/Android.bp
index fa09b34..bdcaf30 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9466/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9466/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9472/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9472/Android.bp
index 42f1d5f9..d5706e5 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9472/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9472/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9491/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9491/Android.bp
index 438c690..ca25dce 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9491/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9491/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9515/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9515/Android.bp
index 2e751f4..a34e6d3 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9515/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9515/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9527/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9527/Android.bp
index 3f0ed80..ed4f017 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9527/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9527/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9537/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9537/Android.bp
index 5e9597d..07924b3 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9537/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9537/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9539/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9539/Android.bp
index 935c1d1..e71fd18 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9539/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9539/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9547/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9547/Android.bp
index ae94370..28cf795 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9547/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9547/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/Android.bp
index 651c36f..b023102 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/Android.bp
@@ -16,13 +16,14 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_test {
- name : "CVE-2018-9549",
- defaults : ["cts_hostsidetests_securitybulletin_defaults"],
- srcs : [
+ name: "CVE-2018-9549",
+ defaults: ["cts_hostsidetests_securitybulletin_defaults"],
+ srcs: [
"poc.cpp",
],
static_libs: [
@@ -31,7 +32,7 @@
shared_libs: [
"liblog",
],
- include_dirs : [
+ include_dirs: [
"external/aac/libSBRdec/src",
"external/aac/libSBRdec/include",
"external/aac/libFDK/include",
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9558/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9558/Android.bp
index 7226414..3c89092 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9558/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9558/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9584/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9584/Android.bp
index 48285f6..db8bef5 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9584/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9584/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9585/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9585/Android.bp
index 3180ff2..38e0a2d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9585/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9585/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-1988/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-1988/Android.bp
index 64eb5c4..3eb7987 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-1988/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-1988/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2007/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2007/Android.bp
index 0411a88..0aca07c 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2007/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2007/Android.bp
@@ -15,6 +15,7 @@
*
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2011/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2011/Android.bp
index 08f0244..96332ab 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2011/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2011/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2012/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2012/Android.bp
index 78f51bd..cca4789 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2012/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2012/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2013/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2013/Android.bp
index 3d90f1f..5e1c068 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2013/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2013/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2014/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2014/Android.bp
index 603130e..1310f25 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2014/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2014/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2015/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2015/Android.bp
index eefc03b..2e72397 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2015/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2015/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2017/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2017/Android.bp
index 5dac7f7a..84f29fa 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2017/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2017/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2019/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2019/Android.bp
index f5bf632..f4e714d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2019/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2019/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2021/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2021/Android.bp
index de0a9aa..beef9dd 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2021/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2021/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2022/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2022/Android.bp
index 2c21381..d0f765f 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2022/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2022/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2025/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2025/Android.bp
index 72d7dda..132f855 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2025/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2025/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2027/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2027/Android.bp
index a080e08..63f4726 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2027/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2027/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2031/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2031/Android.bp
index 639ca91..b129f3f 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2031/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2031/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2035/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2035/Android.bp
index 18c960cd..6112f23 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2035/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2035/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2038/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2038/Android.bp
index 032f4cd..7b17718 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2038/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2038/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -29,9 +30,8 @@
compile_multilib: "64",
shared_libs: [
"libnfc-nci",
- "libchrome",
"libbase",
- "liblog"
+ "liblog",
],
include_dirs: [
"system/nfc/src/nfc/include",
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2039/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2039/Android.bp
index 485c92a..5f8e1f6 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2039/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2039/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -29,9 +30,8 @@
compile_multilib: "64",
shared_libs: [
"libnfc-nci",
- "libchrome",
"libbase",
- "liblog"
+ "liblog",
],
include_dirs: [
"system/nfc/src/nfc/include",
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2040/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2040/Android.bp
index 0024ef8..3c1c46d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2040/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2040/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2044/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2044/Android.bp
index 0f49af7..0a1290b 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2044/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2044/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2099/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2099/Android.bp
index b818889..111aa18 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2099/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2099/Android.bp
@@ -15,6 +15,7 @@
*
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2115/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2115/Android.bp
index e0a3f81..1170147 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2115/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2115/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2126/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2126/Android.bp
index e301864..1467cac 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2126/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2126/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2136/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2136/Android.bp
index 0571475..df7c718 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2136/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2136/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2178/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2178/Android.bp
index 2901a02..5011c15 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2178/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2178/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -35,7 +36,6 @@
],
shared_libs: [
"libnfc-nci",
- "libchrome",
"libbase",
"liblog",
],
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2180/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2180/Android.bp
index 5fc8e88..c5738f2 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2180/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2180/Android.bp
@@ -16,13 +16,14 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_test {
name: "CVE-2019-2180",
defaults: [
- "cts_hostsidetests_securitybulletin_defaults"
+ "cts_hostsidetests_securitybulletin_defaults",
],
srcs: [
"poc.c",
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2206/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2206/Android.bp
index 7fea2a5..d173ec6 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2206/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2206/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -36,11 +37,10 @@
],
shared_libs: [
"libnfc-nci",
- "libchrome",
"libbase",
"liblog",
],
cflags: [
"-DCHECK_OVERFLOW",
- ]
+ ],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2207/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2207/Android.bp
index 439543b..a1041ff 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2207/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2207/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2228/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2228/Android.bp
index fc1addb..272e488 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-2228/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-2228/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9247/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9247/Android.bp
index 31572ca..5f5e346 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9247/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9247/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9308/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9308/Android.bp
index 8834e75..a819ec2 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9308/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9308/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9313/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9313/Android.bp
index 2794b11..f642fd4 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9313/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9313/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9347/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9347/Android.bp
index 0e5d17d..e2a39a9 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9347/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9347/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9357/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9357/Android.bp
index 56804eb..48a0f3e 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9357/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9357/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9362/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9362/Android.bp
index 30507a9..28c787b 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2019-9362/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2019-9362/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0006/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0006/Android.bp
index faa30ca..adb7b2b 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0006/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0006/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0007/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0007/Android.bp
index ea3f345..0da443a 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0007/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0007/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0034/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0034/Android.bp
index aa9a2f9..be062dc 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0034/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0034/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0037/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0037/Android.bp
index 53d8fe7..11b331e 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0037/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0037/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0038/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0038/Android.bp
index 836d134..3fa3d09 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0038/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0038/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0039/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0039/Android.bp
index cfad9f3..d0153e5 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0039/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0039/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0069/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0069/Android.bp
index 32d8415..8d92f42 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0069/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0069/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0072/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0072/Android.bp
index dad32cd..e148603 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0072/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0072/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0073/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0073/Android.bp
index 2a5682f..724f945 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0073/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0073/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0213/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0213/Android.bp
index 138f112..5c1fe4f 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0213/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0213/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0226/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0226/Android.bp
index 6007113..ceb1d9d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0226/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0226/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0241/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0241/Android.bp
index ac0cbd4..a468bd9 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0241/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0241/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0243/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0243/Android.bp
index 6fb13ed..92a7b6d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0243/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0243/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0381/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0381/Android.bp
index 8a90d2a..b7bc41b 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0381/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0381/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0383/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0383/Android.bp
index 6bbf2db..e0aca7c 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0383/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0383/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0384/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0384/Android.bp
index 1cd92dc..8128f51 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0384/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0384/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0385/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0385/Android.bp
index e0ee68f..b5f8ed5 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0385/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0385/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0409/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0409/Android.bp
index ece472a..d8f450d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0409/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0409/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0420/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0420/Android.bp
index 085fc4c..06f3412 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0420/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0420/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0421/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0421/Android.bp
index 66934b0..1414885 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0421/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0421/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0450/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0450/Android.bp
index 7def4e2..7eaa0ae 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0450/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0450/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0451/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0451/Android.bp
index cd1a59f..b6a0ff7 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0451/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0451/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0458/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0458/Android.bp
index 31fbfd2..9f0bd2e 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0458/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0458/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0470/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0470/Android.bp
index 7a47b0d..9377744 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-0470/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-0470/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-11173/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-11173/Android.bp
index 25576f7..e656d72 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-11173/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-11173/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-11282/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-11282/Android.bp
index 348e239..5f99220 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-11282/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-11282/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-29374/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-29374/Android.bp
index 6595bcc..3c7cd0e 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-29374/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-29374/Android.bp
@@ -16,11 +16,12 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_test {
name: "CVE-2020-29374",
defaults: ["cts_hostsidetests_securitybulletin_defaults"],
- srcs: ["poc.cpp",],
+ srcs: ["poc.cpp"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2020-29661/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2020-29661/Android.bp
index d3bf43e..442326b 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2020-29661/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2020-29661/Android.bp
@@ -16,11 +16,12 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_test {
name: "CVE-2020-29661",
defaults: ["cts_hostsidetests_securitybulletin_defaults"],
- srcs: ["poc.cpp",],
+ srcs: ["poc.cpp"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0313/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0313/Android.bp
index 5862db7..0be85df 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0313/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0313/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0318/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0318/Android.bp
index 3249347..e748d7d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0318/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0318/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -21,10 +22,10 @@
defaults: ["cts_hostsidetests_securitybulletin_defaults"],
srcs: ["poc.cpp"],
shared_libs: [
- "libsensor",
- "libsensorservice",
- "libbinder",
- "libutils",
+ "libsensor",
+ "libsensorservice",
+ "libbinder",
+ "libutils",
],
cflags: [
"-Wall",
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0330/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0330/Android.bp
index d15b00e..52af89b 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0330/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0330/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0430/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0430/Android.bp
index 5033b2e..c3a9fa6 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0430/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0430/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0439/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0439/Android.bp
index d03afff..a8e08e6 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0439/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0439/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,9 +24,9 @@
name: "CVE-2021-0439",
defaults: ["cts_hostsidetests_securitybulletin_defaults"],
srcs: [
- "poc.cpp"
+ "poc.cpp",
],
- shared_libs : [
+ shared_libs: [
"libutils",
"libbinder",
],
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0473/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0473/Android.bp
index 5eaab16..c74f6d6 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0473/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0473/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0484/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0484/Android.bp
index c24f1af..0881b19 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0484/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0484/Android.bp
@@ -16,16 +16,17 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_test {
name: "CVE-2021-0484",
defaults: [
- "cts_hostsidetests_securitybulletin_defaults"
+ "cts_hostsidetests_securitybulletin_defaults",
],
srcs: [
- "poc.cpp"
+ "poc.cpp",
],
shared_libs: [
"libbinder",
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0490/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0490/Android.bp
index 2013d52..537e59f 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0490/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0490/Android.bp
@@ -16,13 +16,14 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_test {
name: "CVE-2021-0490",
defaults: ["cts_hostsidetests_securitybulletin_defaults"],
- srcs: ["poc.cpp",],
+ srcs: ["poc.cpp"],
shared_libs: [
"libnfc-nci",
"liblog",
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0650/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0650/Android.bp
index 6a04af2..964a93c 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0650/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0650/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0689/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0689/Android.bp
index 85d5431..93f39d2 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0689/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0689/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0919/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0919/Android.bp
index accdc14..6244ce4 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0919/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0919/Android.bp
@@ -16,16 +16,17 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_test {
name: "CVE-2021-0919",
defaults: [
- "cts_hostsidetests_securitybulletin_defaults"
+ "cts_hostsidetests_securitybulletin_defaults",
],
srcs: [
- "poc.cpp"
+ "poc.cpp",
],
shared_libs: [
"libbinder",
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/Android.bp
index eea87e7..3eaa90d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -39,7 +40,7 @@
],
shared_libs: [
"libnfc-nci",
- "libchrome",
+ "libbase",
],
cflags: [
"-DCHECK_OVERFLOW",
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/stubs.cpp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/stubs.cpp
index d807232..2732ebc 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/stubs.cpp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/stubs.cpp
@@ -44,10 +44,9 @@
}
tNFC_STATUS NFC_SendData(uint8_t conn_id, NFC_HDR* p_data) {
- uint8_t* p = (uint8_t*)(p_data + 1) + p_data->offset;
uint8_t len = (uint8_t)p_data->len;
- FUZZLOG("conn_id=%d, data=%s", conn_id, BytesToHex(p, len).c_str());
+ FUZZLOG("conn_id=%d data=[%d]", conn_id, len);
GKI_freebuf(p_data);
return NFC_STATUS_OK;
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/t4t.cpp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/t4t.cpp
index 5746a9d..65cb764 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/t4t.cpp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0925/t4t.cpp
@@ -180,8 +180,8 @@
.p_data = p_msg,
}};
- FUZZLOG(MODULE_NAME ": SubType=%02X, Response[%zd/%zd]=%s", ctx.SubType,
- it - ctx.Data.cbegin(), ctx.Data.size() - 1, BytesToHex(*it).c_str());
+ FUZZLOG(MODULE_NAME ": SubType=%02X, Response[%zd/%zd]", ctx.SubType,
+ it - ctx.Data.cbegin(), ctx.Data.size() - 1);
/* CVE-2021-0925 starts */
testInProgress = true;
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0956/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0956/Android.bp
index 9cd2b81..e498b7d9 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-0956/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-0956/Android.bp
@@ -16,22 +16,23 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_test {
name: "CVE-2021-0956",
defaults: [
- "cts_hostsidetests_securitybulletin_defaults"
+ "cts_hostsidetests_securitybulletin_defaults",
],
srcs: [
- "poc.cpp"
+ "poc.cpp",
],
shared_libs: [
- "libnfc_nci_jni",
+ "libnfc_nci_jni",
],
header_libs: [
- "jni_headers"
+ "jni_headers",
],
include_dirs: [
"packages/apps/Nfc/nci/jni",
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-1906/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-1906/Android.bp
index cf67bca..3d9a17b 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-1906/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-1906/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-39623/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-39623/Android.bp
index 50662fd..940dc30 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-39623/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-39623/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-39664/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-39664/Android.bp
index 8fd6801..65d381d 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-39664/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-39664/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-39665/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-39665/Android.bp
index f077ca8..8797171 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-39665/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-39665/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-39675/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-39675/Android.bp
index b4bdd3c..68cf00a 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-39675/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-39675/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -29,7 +30,7 @@
"poc.cpp",
],
shared_libs: [
- "libnfc-nci",
+ "libnfc-nci",
],
include_dirs: [
"system/nfc/src/include",
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2021-39804/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2021-39804/Android.bp
index 109a665..33205f4 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2021-39804/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2021-39804/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2022-20127/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2022-20127/Android.bp
index 05c731a..0624a17 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2022-20127/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2022-20127/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2022-20131/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2022-20131/Android.bp
index c8c79c0..b9c7aff 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2022-20131/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2022-20131/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2022-20147/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2022-20147/Android.bp
index 62741e7..3affce0 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2022-20147/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2022-20147/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -24,7 +25,7 @@
defaults: ["cts_hostsidetests_securitybulletin_defaults"],
srcs: [
"poc.cpp",
- ":cts_hostsidetests_securitybulletin_memutils",
+ ":cts_hostsidetests_securitybulletin_memutils",
],
compile_multilib: "64",
shared_libs: [
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2022-20357/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2022-20357/Android.bp
index 579666e..2c5dc4f 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2022-20357/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2022-20357/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2023-21127/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2023-21127/Android.bp
index 99c3515..b6cf00c 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2023-21127/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2023-21127/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2023-21261/Android.bp b/hostsidetests/securitybulletin/securityPatch/CVE-2023-21261/Android.bp
index 88340f4..8bd31b7 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2023-21261/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2023-21261/Android.bp
@@ -16,21 +16,22 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_test {
name: "CVE-2023-21261",
defaults: [
- "cts_hostsidetests_securitybulletin_defaults",
+ "cts_hostsidetests_securitybulletin_defaults",
],
srcs: [
- "poc.cpp",
+ "poc.cpp",
],
shared_libs: [
- "libft2",
+ "libft2",
],
cflags: [
- "-DFT2_BUILD_LIBRARY",
+ "-DFT2_BUILD_LIBRARY",
],
}
diff --git a/hostsidetests/securitybulletin/securityPatch/includes/Android.bp b/hostsidetests/securitybulletin/securityPatch/includes/Android.bp
index 6b85dba..c8cf493 100644
--- a/hostsidetests/securitybulletin/securityPatch/includes/Android.bp
+++ b/hostsidetests/securitybulletin/securityPatch/includes/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9561.java b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9561.java
deleted file mode 100644
index d8027c0..0000000
--- a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9561.java
+++ /dev/null
@@ -1,40 +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;
-
-import android.platform.test.annotations.AsbSecurityTest;
-
-import com.android.sts.common.tradefed.testtype.NonRootSecurityTestCase;
-import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(DeviceJUnit4ClassRunner.class)
-public class CVE_2018_9561 extends NonRootSecurityTestCase {
-
- /**
- * b/111660010
- * Vulnerability Behaviour: SIGSEGV in self
- */
- @Test
- @AsbSecurityTest(cveBugId = 111660010)
- public void testPocCVE_2018_9561() throws Exception {
- pocPusher.only64();
- AdbUtils.runPocAssertNoCrashesNotVulnerable("CVE-2018-9561", null, getDevice());
- }
-}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9563.java b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9563.java
deleted file mode 100644
index 22f1c97..0000000
--- a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9563.java
+++ /dev/null
@@ -1,40 +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;
-
-import android.platform.test.annotations.AsbSecurityTest;
-
-import com.android.sts.common.tradefed.testtype.NonRootSecurityTestCase;
-import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(DeviceJUnit4ClassRunner.class)
-public class CVE_2018_9563 extends NonRootSecurityTestCase {
-
- /**
- * b/114237888
- * Vulnerability Behaviour: SIGSEGV in self
- */
- @Test
- @AsbSecurityTest(cveBugId = 114237888)
- public void testPocCVE_2018_9563() throws Exception {
- pocPusher.only64();
- AdbUtils.runPocAssertNoCrashesNotVulnerable("CVE-2018-9563", null, getDevice());
- }
-}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9564.java b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9564.java
deleted file mode 100644
index cafea31..0000000
--- a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9564.java
+++ /dev/null
@@ -1,41 +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;
-
-import android.platform.test.annotations.AsbSecurityTest;
-
-import com.android.sts.common.tradefed.testtype.NonRootSecurityTestCase;
-import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(DeviceJUnit4ClassRunner.class)
-public class CVE_2018_9564 extends NonRootSecurityTestCase {
-
- /**
- * b/114238578
- * Vulnerability Behaviour: SIGSEGV in self
- */
- @AsbSecurityTest(cveBugId = 114238578)
- @Test
- public void testPocCVE_2018_9564() throws Exception {
- AdbUtils.assumeHasNfc(getDevice());
- pocPusher.only64();
- AdbUtils.runPocAssertNoCrashesNotVulnerable("CVE-2018-9564", null, getDevice());
- }
-}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9593.java b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9593.java
deleted file mode 100644
index fb300c4..0000000
--- a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9593.java
+++ /dev/null
@@ -1,41 +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;
-
-import android.platform.test.annotations.AsbSecurityTest;
-
-import com.android.sts.common.tradefed.testtype.NonRootSecurityTestCase;
-import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(DeviceJUnit4ClassRunner.class)
-public class CVE_2018_9593 extends NonRootSecurityTestCase {
-
- /**
- * b/116722267
- * Vulnerability Behaviour: SIGSEGV in self
- */
- @AsbSecurityTest(cveBugId = 116722267)
- @Test
- public void testPocCVE_2018_9593() throws Exception {
- AdbUtils.assumeHasNfc(getDevice());
- pocPusher.only64();
- AdbUtils.runPocAssertNoCrashesNotVulnerable("CVE-2018-9593", null, getDevice());
- }
-}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9594.java b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9594.java
deleted file mode 100644
index d196681..0000000
--- a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9594.java
+++ /dev/null
@@ -1,41 +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;
-
-import android.platform.test.annotations.AsbSecurityTest;
-
-import com.android.sts.common.tradefed.testtype.NonRootSecurityTestCase;
-import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(DeviceJUnit4ClassRunner.class)
-public class CVE_2018_9594 extends NonRootSecurityTestCase {
-
- /**
- * b/116791157
- * Vulnerability Behaviour: SIGSEGV in self
- */
- @AsbSecurityTest(cveBugId = 116791157)
- @Test
- public void testPocCVE_2018_9594() throws Exception {
- AdbUtils.assumeHasNfc(getDevice());
- pocPusher.only64();
- AdbUtils.runPocAssertNoCrashesNotVulnerable("CVE-2018-9594", null, getDevice());
- }
-}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-182282630/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-182282630/Android.bp
index 34fb796..c1394fd 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-182282630/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-182282630/Android.bp
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-182808318/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-182808318/Android.bp
index 7496af2..36f2a49 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-182808318/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-182808318/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -32,4 +33,4 @@
"androidx.test.core",
],
sdk_version: "current",
-}
\ No newline at end of file
+}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-182810085/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-182810085/Android.bp
index 3e8f550..72d2ec4 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-182810085/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-182810085/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-183410508/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-183410508/Android.bp
index 53cebc4..0866511 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-183410508/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-183410508/Android.bp
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-183411210/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-183411210/Android.bp
index 6dbbfe5..afa80c0 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-183411210/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-183411210/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-183411279/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-183411279/Android.bp
index 4fe3834..32d76de 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-183411279/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-183411279/Android.bp
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-183613671/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-183613671/Android.bp
index b0d2778..907b0ae 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-183613671/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-183613671/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-183794206/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-183794206/Android.bp
index 0489ed1..0134c47 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-183794206/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-183794206/Android.bp
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-183963253/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-183963253/Android.bp
index f846854..449c6ef 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-183963253/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-183963253/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-237291548/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-237291548/Android.bp
index 9ac80ac..b16e3f4 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-237291548/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-237291548/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -61,4 +62,4 @@
srcs: ["AndroidManifest.xml"],
out: ["BadAndroidManifest.xml"],
cmd: "awk '/myMimeGroup/{print;for(i=0;i<501;i++){sub(/myMimeGroup[0-9]*/,\"myMimeGroup\"i);print}}1' $(in) > $(out)",
-}
\ No newline at end of file
+}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-261036568/content-provider/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-261036568/content-provider/Android.bp
index 1960327..a2c45dc 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-261036568/content-provider/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-261036568/content-provider/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/BUG-261036568/test-app/Android.bp b/hostsidetests/securitybulletin/test-apps/BUG-261036568/test-app/Android.bp
index f7103aa..e32f0f9 100644
--- a/hostsidetests/securitybulletin/test-apps/BUG-261036568/test-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/BUG-261036568/test-app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -30,4 +31,4 @@
],
sdk_version: "current",
platform_apis: true,
-}
\ No newline at end of file
+}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2020-0015/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2020-0015/Android.bp
index 4efed42..19fd0aa 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2020-0015/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2020-0015/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2020-0338/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2020-0338/Android.bp
index 810da9a..16d3df92 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2020-0338/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2020-0338/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2020-0448/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2020-0448/Android.bp
index bbf8e6f..8a8650d 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2020-0448/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2020-0448/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0305/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0305/Android.bp
index bc457eb..afc14a9 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0305/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0305/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0315/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0315/Android.bp
index 5fbde22..f96d09d 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0315/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0315/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0441/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0441/Android.bp
index f07b5cc..460c74a 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0441/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0441/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0478/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0478/Android.bp
index 0673f33..b326231 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0478/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0478/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0487/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0487/Android.bp
index 14d6baf..599d4e4 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0487/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0487/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0523/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0523/Android.bp
index 7ff1369..280174e 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0523/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0523/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0586/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0586/Android.bp
index cd7bef5..c64a89c 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0586/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0586/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0591/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0591/Android.bp
index 1fcf212..c902d6f 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0591/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0591/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0595/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0595/Android.bp
index 3de8ff7..fbf8201 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0595/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0595/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -25,7 +26,7 @@
"cts_support_defaults",
],
srcs: [
- "test-app/src/**/*.java"
+ "test-app/src/**/*.java",
],
test_suites: [
"sts",
@@ -45,7 +46,7 @@
android_test_helper_app {
name: "CVE-2021-0595-helper",
srcs: [
- "helper-app/src/**/*.java"
+ "helper-app/src/**/*.java",
],
test_suites: [
"sts",
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0602/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0602/Android.bp
index e05cfed..438a3e5 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0602/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0602/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -25,7 +26,7 @@
"cts_support_defaults",
],
srcs: [
- "src/**/*.java"
+ "src/**/*.java",
],
test_suites: [
"sts",
@@ -35,5 +36,5 @@
"androidx.test.rules",
"androidx.test.uiautomator_uiautomator",
],
- platform_apis: true
+ platform_apis: true,
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0685/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0685/Android.bp
index 7420689..6648237 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0685/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0685/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0691/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0691/Android.bp
index 85c4d6a..5ed3982 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0691/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0691/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0693/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0693/Android.bp
index 017710a..849dfbe 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0693/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0693/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0704/stub-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0704/stub-app/Android.bp
index 1f80b5b..98d895e 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0704/stub-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0704/stub-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0704/test-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0704/test-app/Android.bp
index ebbec94..fd03bac 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0704/test-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0704/test-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0706/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0706/Android.bp
index 7a51ab7..8d3adb81 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0706/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0706/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0921/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0921/Android.bp
index e7cd554..b19732b 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0921/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0921/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0928/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0928/Android.bp
index 3ba129b..991c6e3 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0928/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0928/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0953/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0953/Android.bp
index c458976..abf893d 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0953/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0953/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0954/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0954/Android.bp
index a3f1c33e..172cbfd 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0954/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0954/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,7 +24,7 @@
name: "CVE-2021-0954",
defaults: ["cts_support_defaults"],
srcs: [
- "src/**/*.java"
+ "src/**/*.java",
],
test_suites: [
"sts",
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0963/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0963/Android.bp
index 2a30791..f6c0020 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0963/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0963/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-0965/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-0965/Android.bp
index ee33256..dd99455 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-0965/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-0965/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-30351/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-30351/Android.bp
index 55d3ccf..bd17924 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-30351/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-30351/Android.bp
@@ -13,8 +13,10 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
+
android_test_helper_app {
name: "CVE-2021-30351",
defaults: ["cts_support_defaults"],
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39622/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39622/Android.bp
index 1a8fd19..d2ecb77 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39622/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39622/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39626/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39626/Android.bp
index 2f87b9c..ceca63d 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39626/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39626/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39692/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39692/Android.bp
index 602c426..3874816 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39692/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39692/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39701/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39701/Android.bp
index edbdf24..44b2b2e 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39701/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39701/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39702/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39702/Android.bp
index 034f865..516fc8c 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39702/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39702/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39704/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39704/Android.bp
index 044a5f5..d0f0e0e 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39704/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39704/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39706/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39706/Android.bp
index ea7eb99..7eafd0e 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39706/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39706/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39707/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39707/Android.bp
index 517619a..4f9bd43 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39707/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39707/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39794/receiver-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39794/receiver-app/Android.bp
index dbf8b37..511a816 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39794/receiver-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39794/receiver-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39794/test-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39794/test-app/Android.bp
index 0ddc4fa..8eaa400 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39794/test-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39794/test-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39795/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39795/Android.bp
index ade2215..1aa19a9 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39795/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39795/Android.bp
@@ -15,13 +15,14 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
android_test_helper_app {
name: "CVE-2021-39795",
defaults: [
- "cts_support_defaults"
+ "cts_support_defaults",
],
srcs: [
"src/**/*.java",
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39796/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39796/Android.bp
index 9ba76d0..37fdb80 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39796/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39796/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39796/harmful-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39796/harmful-app/Android.bp
index d669e9f..8f0e395 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39796/harmful-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39796/harmful-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39797/target-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39797/target-app/Android.bp
index 4a58ef3..4e92644 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39797/target-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39797/target-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39797/test-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39797/test-app/Android.bp
index aa4e813..c84fd67 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39797/test-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39797/test-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39808/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39808/Android.bp
index 13a86e3..9c400df 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39808/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39808/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2021-39810/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2021-39810/Android.bp
index 9a11e88..e1afc93 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2021-39810/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2021-39810/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20004/provider-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20004/provider-app/Android.bp
index 5c22d8f..502b0f4 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20004/provider-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20004/provider-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20004/test-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20004/test-app/Android.bp
index 7bd80ef..42f4d00 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20004/test-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20004/test-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/attacker-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/attacker-app/Android.bp
index 4ae6cbf..89fd5e8 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/attacker-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/attacker-app/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/second-test-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/second-test-app/Android.bp
index 98d5962..1d12b78 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/second-test-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/second-test-app/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/test-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/test-app/Android.bp
index 0633c69..bcddfe0 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/test-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20007/test-app/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20112/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20112/Android.bp
index cf3b7e2..5c1c83a 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20112/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20112/Android.bp
@@ -16,16 +16,17 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
android_test_helper_app {
name: "CVE-2022-20112",
defaults: [
- "cts_support_defaults"
+ "cts_support_defaults",
],
srcs: [
- "src/**/*.java"
+ "src/**/*.java",
],
test_suites: [
"sts",
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20115/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20115/Android.bp
index 4cb6abe..83e3cb4 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20115/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20115/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20116/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20116/Android.bp
index caa54b9..4e6242a 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20116/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20116/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20138/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20138/Android.bp
index 7b74f57..0b637d6 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20138/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20138/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20197/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20197/Android.bp
index 582076e..7eb3601 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20197/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20197/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20223/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20223/Android.bp
index df595c8..2ec8fa1 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20223/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20223/Android.bp
@@ -16,16 +16,17 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
android_test_helper_app {
name: "CVE-2022-20223",
defaults: [
- "cts_support_defaults"
+ "cts_support_defaults",
],
srcs: [
- "src/**/*.java"
+ "src/**/*.java",
],
test_suites: [
"sts",
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20230/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20230/Android.bp
index 6a1d4d5..0e48c52 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20230/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20230/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20348/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20348/Android.bp
index b07e9f2..4a8c89f 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20348/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20348/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20349/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20349/Android.bp
index 2accd9e..e4662a7 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20349/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20349/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20353/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20353/Android.bp
index 37d35eb..bcd02d6 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20353/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20353/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20360/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20360/Android.bp
index d9f8554..40ab40e 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20360/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20360/Android.bp
@@ -16,16 +16,17 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
android_test_helper_app {
name: "CVE-2022-20360",
defaults: [
- "cts_support_defaults"
+ "cts_support_defaults",
],
srcs: [
- "src/**/*.java"
+ "src/**/*.java",
],
test_suites: [
"sts",
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20415/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20415/Android.bp
index 1ba587f..e1f4f3f 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20415/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20415/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20475/target-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20475/target-app/Android.bp
index db55729..b8c30bc 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20475/target-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20475/target-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20475/test-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20475/test-app/Android.bp
index 043de912..003cc90 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20475/test-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20475/test-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2022-20501/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2022-20501/Android.bp
index 9498881..8a48522 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2022-20501/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2022-20501/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-20913/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-20913/Android.bp
index 81ce65d..ae0f7af 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-20913/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-20913/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-20917/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-20917/Android.bp
index a802152..81fe8d7 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-20917/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-20917/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-20918/attacker-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-20918/attacker-app/Android.bp
index af4ad21..8d248d1 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-20918/attacker-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-20918/attacker-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-20918/test-app/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-20918/test-app/Android.bp
index a32ae6c..b090af3 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-20918/test-app/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-20918/test-app/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-20955/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-20955/Android.bp
index e856574..da897cd 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-20955/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-20955/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21000/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21000/Android.bp
index 221de1f..0aa9f73 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21000/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21000/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21088/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21088/Android.bp
index 0642419..3f37a0e 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21088/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21088/Android.bp
@@ -14,6 +14,10 @@
* limitations under the License.
*/
+package {
+ default_team: "trendy_team_platform_security",
+}
+
android_test_helper_app {
name: "CVE-2023-21088",
defaults: [
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21091/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21091/Android.bp
index 240d8b4..ebd7482 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21091/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21091/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21107/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21107/Android.bp
index 81c0f02..b94df20 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21107/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21107/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -25,7 +26,7 @@
"cts_support_defaults",
],
srcs: [
- "test-app/src/**/*.java"
+ "test-app/src/**/*.java",
],
test_suites: [
"sts",
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21128/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21128/Android.bp
index b1773b5d..a0481df 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21128/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21128/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -25,7 +26,7 @@
"cts_support_defaults",
],
srcs: [
- "test-app/src/**/*.java"
+ "test-app/src/**/*.java",
],
test_suites: [
"sts",
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21129/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21129/Android.bp
index 4eee8f7..3ad7f36 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21129/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21129/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21135/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21135/Android.bp
index bc8abf5..861fef3 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21135/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21135/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21144/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21144/Android.bp
index a1132bb..0aaa863 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21144/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21144/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21145/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21145/Android.bp
index bb5bd8a..74c1813 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21145/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21145/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21238/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21238/Android.bp
index 949556b..1caccca 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21238/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21238/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21239/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21239/Android.bp
index 4a33f83..c48e224f 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21239/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21239/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21244/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21244/Android.bp
index 10d9d77..8bfcbf3 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21244/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21244/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21251/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21251/Android.bp
index bf22e03..e98acf0 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21251/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21251/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21254/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21254/Android.bp
index e8ef246..7cebc51 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21254/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21254/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21256/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21256/Android.bp
index 1f7e5c2..6c04308 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21256/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21256/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21260/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21260/Android.bp
index 454f3c5..eab86d2 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21260/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21260/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -24,7 +25,7 @@
"cts_support_defaults",
],
srcs: [
- "src/**/*.java"
+ "src/**/*.java",
],
test_suites: [
"sts",
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21272/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21272/Android.bp
index bc60c24..09ddd8a 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21272/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21272/Android.bp
@@ -16,13 +16,14 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
android_test_helper_app {
name: "CVE-2023-21272-test",
srcs: [
- "test-app/src/**/*.java"
+ "test-app/src/**/*.java",
],
test_suites: [
"sts",
@@ -41,7 +42,7 @@
"sts",
],
srcs: [
- "helper-app/src/**/*.java"
+ "helper-app/src/**/*.java",
],
manifest: "helper-app/AndroidManifest.xml",
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21279/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21279/Android.bp
index a1460c4..76c2dc9 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21279/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21279/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21285/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21285/Android.bp
index 3700d8b..9b24765 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21285/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21285/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21286/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21286/Android.bp
index c0e20ea..6813ed1 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21286/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21286/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE-2023-21291/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE-2023-21291/Android.bp
index 5b4d51f..e4c13ed 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE-2023-21291/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE-2023-21291/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/CVE_2023_20904/Android.bp b/hostsidetests/securitybulletin/test-apps/CVE_2023_20904/Android.bp
index 18e0331..361ce1a 100644
--- a/hostsidetests/securitybulletin/test-apps/CVE_2023_20904/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/CVE_2023_20904/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/TestBluetoothDiscoverable/Android.bp b/hostsidetests/securitybulletin/test-apps/TestBluetoothDiscoverable/Android.bp
index 7e827e4..a266ec2 100644
--- a/hostsidetests/securitybulletin/test-apps/TestBluetoothDiscoverable/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/TestBluetoothDiscoverable/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/TestLocationScanningServicesUsingSlices/Android.bp b/hostsidetests/securitybulletin/test-apps/TestLocationScanningServicesUsingSlices/Android.bp
index 5df144f..eb5521b 100644
--- a/hostsidetests/securitybulletin/test-apps/TestLocationScanningServicesUsingSlices/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/TestLocationScanningServicesUsingSlices/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/securitybulletin/test-apps/launchanywhere/Android.bp b/hostsidetests/securitybulletin/test-apps/launchanywhere/Android.bp
index 5a2039a..0952941 100644
--- a/hostsidetests/securitybulletin/test-apps/launchanywhere/Android.bp
+++ b/hostsidetests/securitybulletin/test-apps/launchanywhere/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/silentupdate/Android.bp b/hostsidetests/silentupdate/Android.bp
index 470d16f..7611f43 100644
--- a/hostsidetests/silentupdate/Android.bp
+++ b/hostsidetests/silentupdate/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/silentupdate/OWNERS b/hostsidetests/silentupdate/OWNERS
index 890677b..5849c07 100644
--- a/hostsidetests/silentupdate/OWNERS
+++ b/hostsidetests/silentupdate/OWNERS
@@ -1,4 +1,4 @@
# Bug component: 36137
-patb@google.com
-toddke@google.com
-chiuwinson@google.com
\ No newline at end of file
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
+patb@google.com
\ No newline at end of file
diff --git a/hostsidetests/silentupdate/app/Android.bp b/hostsidetests/silentupdate/app/Android.bp
index 3c481de..8a7d5e6 100644
--- a/hostsidetests/silentupdate/app/Android.bp
+++ b/hostsidetests/silentupdate/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/silentupdate/testapp/Android.bp b/hostsidetests/silentupdate/testapp/Android.bp
index 84b3a56..57945a4 100644
--- a/hostsidetests/silentupdate/testapp/Android.bp
+++ b/hostsidetests/silentupdate/testapp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/stagedinstall/Android.bp b/hostsidetests/stagedinstall/Android.bp
index c437d70..b253be4 100644
--- a/hostsidetests/stagedinstall/Android.bp
+++ b/hostsidetests/stagedinstall/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/stagedinstall/OWNERS b/hostsidetests/stagedinstall/OWNERS
index 1bccb47..4a79db2 100644
--- a/hostsidetests/stagedinstall/OWNERS
+++ b/hostsidetests/stagedinstall/OWNERS
@@ -1,7 +1,7 @@
# Bug component: 36137
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
dariofreni@google.com
-toddke@google.com
-narayan@google.com
patb@google.com
ioffe@google.com
olilan@google.com
diff --git a/hostsidetests/stagedinstall/testdata/apk/CtsShimTargetPSdk/Android.bp b/hostsidetests/stagedinstall/testdata/apk/CtsShimTargetPSdk/Android.bp
index 37652b2..d877bf6 100644
--- a/hostsidetests/stagedinstall/testdata/apk/CtsShimTargetPSdk/Android.bp
+++ b/hostsidetests/stagedinstall/testdata/apk/CtsShimTargetPSdk/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/statsdatom/src/android/cts/statsdatom/batterystats/BatteryUsageStatsTests.java b/hostsidetests/statsdatom/src/android/cts/statsdatom/batterystats/BatteryUsageStatsTests.java
index af6097c..7a688fc 100644
--- a/hostsidetests/statsdatom/src/android/cts/statsdatom/batterystats/BatteryUsageStatsTests.java
+++ b/hostsidetests/statsdatom/src/android/cts/statsdatom/batterystats/BatteryUsageStatsTests.java
@@ -16,13 +16,13 @@
package android.cts.statsdatom.batterystats;
-import com.android.tradefed.util.RunUtil;
import static com.google.common.truth.Truth.assertThat;
import android.cts.statsdatom.lib.AtomTestUtils;
import android.cts.statsdatom.lib.ConfigUtils;
import android.cts.statsdatom.lib.DeviceUtils;
import android.cts.statsdatom.lib.ReportUtils;
+import android.os.PowerComponentEnum;
import com.android.internal.os.StatsdConfigProto;
import com.android.os.AtomsProto;
@@ -32,6 +32,7 @@
import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.testtype.DeviceTestCase;
import com.android.tradefed.testtype.IBuildReceiver;
+import com.android.tradefed.util.RunUtil;
import java.util.List;
import java.util.function.Function;
@@ -148,25 +149,33 @@
}
}
- // If the test app consumed a measurable amount of power, the break-up
+ // If the test app consumed a measurable amount of power, the break-down
// by process state should also be present in the atom.
- if (testConsumer != null
- && testConsumer.getBatteryConsumerData().getTotalConsumedPowerDeciCoulombs()
- > 0.1) {
- boolean hasProcStateData = false;
- for (int i = 0; i < testConsumer.getBatteryConsumerData().getSlicesCount(); i++) {
- final BatteryConsumerData.PowerComponentUsageSlice slice =
- testConsumer.getBatteryConsumerData().getSlices(i);
- if (slice.getProcessState()
- != BatteryConsumerData.PowerComponentUsageSlice.ProcessState.UNSPECIFIED
- && (slice.getPowerComponent().getPowerDeciCoulombs() > 0
- || slice.getPowerComponent().getDurationMillis() > 0)) {
- hasProcStateData = true;
+ if (testConsumer != null) {
+ long consumedByCpu = 0;
+ for (BatteryConsumerData.PowerComponentUsage pcu :
+ testConsumer.getBatteryConsumerData().getPowerComponentsList()) {
+ if (pcu.getComponent() == PowerComponentEnum.POWER_COMPONENT_CPU.getNumber()) {
+ consumedByCpu = pcu.getPowerDeciCoulombs();
break;
}
}
+ if (consumedByCpu > 10) {
+ boolean hasProcStateData = false;
+ for (int i = 0; i < testConsumer.getBatteryConsumerData().getSlicesCount(); i++) {
+ final BatteryConsumerData.PowerComponentUsageSlice slice =
+ testConsumer.getBatteryConsumerData().getSlices(i);
+ if (slice.getProcessState()
+ != BatteryConsumerData.PowerComponentUsageSlice.ProcessState.UNSPECIFIED
+ && (slice.getPowerComponent().getPowerDeciCoulombs() > 0
+ || slice.getPowerComponent().getDurationMillis() > 0)) {
+ hasProcStateData = true;
+ break;
+ }
+ }
- assertThat(hasProcStateData).isTrue();
+ assertThat(hasProcStateData).isTrue();
+ }
}
}
diff --git a/hostsidetests/systemui/Android.bp b/hostsidetests/systemui/Android.bp
index 49b2568..7f92e89 100644
--- a/hostsidetests/systemui/Android.bp
+++ b/hostsidetests/systemui/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_system_ui_please_use_a_more_specific_subteam_if_possible_",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/systemui/app/Android.bp b/hostsidetests/systemui/app/Android.bp
index e93c921..13a9b1b 100644
--- a/hostsidetests/systemui/app/Android.bp
+++ b/hostsidetests/systemui/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_system_ui_please_use_a_more_specific_subteam_if_possible_",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/tagging/OWNERS b/hostsidetests/tagging/OWNERS
index 9686261..13edd31 100644
--- a/hostsidetests/tagging/OWNERS
+++ b/hostsidetests/tagging/OWNERS
@@ -2,4 +2,4 @@
eugenis@google.com
pcc@google.com
mitchp@google.com
-
+fmayer@google.com
diff --git a/hostsidetests/telecom/Android.bp b/hostsidetests/telecom/Android.bp
index 4ed8f1d..257928c 100644
--- a/hostsidetests/telecom/Android.bp
+++ b/hostsidetests/telecom/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -20,9 +21,9 @@
name: "CtsTelecomHostCases",
defaults: ["cts_defaults"],
srcs: ["src/**/*.java"],
- static_libs:[
- "CompatChangeGatingTestBase",
- "cts-statsd-atom-host-test-utils",
+ static_libs: [
+ "CompatChangeGatingTestBase",
+ "cts-statsd-atom-host-test-utils",
],
// tag this module as a cts test artifact
@@ -32,9 +33,12 @@
],
//compiles telecom CTS testcases for device
- target_required: ["CtsTelecomTestCases",],
+ target_required: ["CtsTelecomTestCases"],
- data: [":CtsTelecomTestCases", ":TelecomDeviceTest",],
+ data: [
+ ":CtsTelecomTestCases",
+ ":TelecomDeviceTest",
+ ],
libs: [
"cts-tradefed",
diff --git a/hostsidetests/telecom/devicetest/Android.bp b/hostsidetests/telecom/devicetest/Android.bp
index c095dde..9a57a9f1 100644
--- a/hostsidetests/telecom/devicetest/Android.bp
+++ b/hostsidetests/telecom/devicetest/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -31,7 +32,7 @@
static_libs: [
"compatibility-device-util-axt",
"ctstestrunner-axt",
- "androidx.test.ext.junit"
+ "androidx.test.ext.junit",
],
// Tag this module as a cts test artifact
diff --git a/hostsidetests/telecom/src/android/telecom/cts/TelecomHostStatsTest.java b/hostsidetests/telecom/src/android/telecom/cts/TelecomHostStatsTest.java
index fa51b4c..57383aa 100644
--- a/hostsidetests/telecom/src/android/telecom/cts/TelecomHostStatsTest.java
+++ b/hostsidetests/telecom/src/android/telecom/cts/TelecomHostStatsTest.java
@@ -48,6 +48,7 @@
private static final String TELECOM_CTS_TEST_PKG = "android.telecom.cts";
private static final String FEATURE_TELECOM = "android.software.telecom";
private static final String FEATURE_TELEPHONY = "android.hardware.telephony";
+ private static final String FEATURE_TELEPHONY_CALLING = "android.hardware.telephony.calling";
@Override
protected void setUp() throws Exception {
@@ -69,7 +70,8 @@
// being logged to statsd when a call is made
public void testCallStateChangedAtom_basicTest() throws Exception {
if (!DeviceUtils.hasFeature(getDevice(), FEATURE_TELECOM) || !DeviceUtils.hasFeature(
- getDevice(), FEATURE_TELEPHONY)) {
+ getDevice(), FEATURE_TELEPHONY) || !DeviceUtils.hasFeature(getDevice(),
+ FEATURE_TELEPHONY_CALLING)) {
return;
}
@@ -130,7 +132,8 @@
// being logged to statsd when a sos call is made
public void testEmergencyNumberDialedAtom() throws Exception {
if (!DeviceUtils.hasFeature(getDevice(), FEATURE_TELECOM) || !DeviceUtils.hasFeature(
- getDevice(), FEATURE_TELEPHONY)) {
+ getDevice(), FEATURE_TELEPHONY) || !DeviceUtils.hasFeature(getDevice(),
+ FEATURE_TELEPHONY_CALLING)) {
return;
}
diff --git a/hostsidetests/telephony/Android.bp b/hostsidetests/telephony/Android.bp
index f1bd4a8..fd720a3 100644
--- a/hostsidetests/telephony/Android.bp
+++ b/hostsidetests/telephony/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -20,7 +21,7 @@
name: "CtsTelephonyHostCases",
defaults: ["cts_defaults"],
srcs: ["src/**/*.java"],
- static_libs:["CompatChangeGatingTestBase"],
+ static_libs: ["CompatChangeGatingTestBase"],
// tag this module as a cts test artifact
test_suites: [
"cts",
diff --git a/hostsidetests/telephony/devicetest/Android.bp b/hostsidetests/telephony/devicetest/Android.bp
index c554d91..befe4cc 100644
--- a/hostsidetests/telephony/devicetest/Android.bp
+++ b/hostsidetests/telephony/devicetest/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/telephonyprovider/Android.bp b/hostsidetests/telephonyprovider/Android.bp
index 406c3d6..a150507 100644
--- a/hostsidetests/telephonyprovider/Android.bp
+++ b/hostsidetests/telephonyprovider/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -20,7 +21,7 @@
name: "CtsTelephonyProviderHostCases",
defaults: ["cts_defaults"],
srcs: ["src/**/*.java"],
- static_libs:["CompatChangeGatingTestBase"],
+ static_libs: ["CompatChangeGatingTestBase"],
// tag this module as a cts test artifact
test_suites: [
"cts",
diff --git a/hostsidetests/telephonyprovider/devicetest/Android.bp b/hostsidetests/telephonyprovider/devicetest/Android.bp
index ad0ca2c..ea2b0dc 100644
--- a/hostsidetests/telephonyprovider/devicetest/Android.bp
+++ b/hostsidetests/telephonyprovider/devicetest/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/theme/Android.bp b/hostsidetests/theme/Android.bp
index 55fdbd2..ca6515e 100644
--- a/hostsidetests/theme/Android.bp
+++ b/hostsidetests/theme/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/theme/app/Android.bp b/hostsidetests/theme/app/Android.bp
index 4c7cdc6..15961d8 100644
--- a/hostsidetests/theme/app/Android.bp
+++ b/hostsidetests/theme/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/voiceinteraction/Android.bp b/hostsidetests/voiceinteraction/Android.bp
index 301b12c..5227a38 100644
--- a/hostsidetests/voiceinteraction/Android.bp
+++ b/hostsidetests/voiceinteraction/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/voiceinteraction/app/Android.bp b/hostsidetests/voiceinteraction/app/Android.bp
index 3b66f321..05ddd61 100644
--- a/hostsidetests/voiceinteraction/app/Android.bp
+++ b/hostsidetests/voiceinteraction/app/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/webkit/Android.bp b/hostsidetests/webkit/Android.bp
index 734b1b8..15ee059 100644
--- a/hostsidetests/webkit/Android.bp
+++ b/hostsidetests/webkit/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_chromium_webview",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/webkit/app/Android.bp b/hostsidetests/webkit/app/Android.bp
index 7749f32..89acd47 100644
--- a/hostsidetests/webkit/app/Android.bp
+++ b/hostsidetests/webkit/app/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_chromium_webview",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/webkit/app/src/com/android/cts/webkit/WebViewDeviceSideMultipleProfileTest.java b/hostsidetests/webkit/app/src/com/android/cts/webkit/WebViewDeviceSideMultipleProfileTest.java
index f5e1775..502e311 100644
--- a/hostsidetests/webkit/app/src/com/android/cts/webkit/WebViewDeviceSideMultipleProfileTest.java
+++ b/hostsidetests/webkit/app/src/com/android/cts/webkit/WebViewDeviceSideMultipleProfileTest.java
@@ -17,20 +17,19 @@
package com.android.cts.webkit;
import android.app.admin.DeviceAdminReceiver;
-import android.util.Log;
import android.webkit.WebView;
import android.webkit.cts.WebViewSyncLoader;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.rules.ActivityScenarioRule;
+import com.android.compatibility.common.util.NullWebViewUtils;
+
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import java.io.IOException;
-
public class WebViewDeviceSideMultipleProfileTest {
// Profile owner component.
public static class BasicAdminReceiver extends DeviceAdminReceiver {}
@@ -51,6 +50,10 @@
@Test
@UiThreadTest
public void testCreateWebViewAndNavigate() {
+ if (!NullWebViewUtils.isWebViewAvailable()) {
+ return;
+ }
+
mActivity.createAndAttachWebView();
WebView webView = mActivity.getWebView();
Assert.assertNotNull(webView);
diff --git a/hostsidetests/wifibroadcasts/Android.bp b/hostsidetests/wifibroadcasts/Android.bp
index ea1f50d..13c3656b 100644
--- a/hostsidetests/wifibroadcasts/Android.bp
+++ b/hostsidetests/wifibroadcasts/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/hostsidetests/wifibroadcasts/app/Android.bp b/hostsidetests/wifibroadcasts/app/Android.bp
index 92f420f..37d73df 100644
--- a/hostsidetests/wifibroadcasts/app/Android.bp
+++ b/hostsidetests/wifibroadcasts/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/libs/input/src/com/android/cts/input/InputJsonParser.java b/libs/input/src/com/android/cts/input/InputJsonParser.java
index ebcfa23..65a0d87 100644
--- a/libs/input/src/com/android/cts/input/InputJsonParser.java
+++ b/libs/input/src/com/android/cts/input/InputJsonParser.java
@@ -95,7 +95,8 @@
return new JSONArray(data);
} catch (JSONException e) {
throw new RuntimeException(
- "Could not parse resource " + resourceId + ", received: " + data);
+ "Could not parse resource " + resourceId + ", received: " + data,
+ e);
}
}
diff --git a/libs/install/Android.bp b/libs/install/Android.bp
index edf55a6..2827551 100644
--- a/libs/install/Android.bp
+++ b/libs/install/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/libs/install/src/com/android/cts/install/lib/Install.java b/libs/install/src/com/android/cts/install/lib/Install.java
index f1fb0c0..cbbb925 100644
--- a/libs/install/src/com/android/cts/install/lib/Install.java
+++ b/libs/install/src/com/android/cts/install/lib/Install.java
@@ -47,6 +47,8 @@
private boolean mIsDowngrade = false;
private boolean mEnableRollback = false;
private int mRollbackDataPolicy = 0;
+ private long mLifetimeMillis = 0;
+ private int mRollbackImpactLevel = 0;
private int mSessionMode = PackageInstaller.SessionParams.MODE_FULL_INSTALL;
private int mInstallFlags = 0;
private boolean mBypassAllowedApexUpdateCheck = true;
@@ -145,6 +147,22 @@
}
/**
+ * Sets lifetimeMillis for rollback expiration.
+ */
+ public Install setRollbackLifetimeMillis(long lifetimeMillis) {
+ mLifetimeMillis = lifetimeMillis;
+ return this;
+ }
+
+ /**
+ * Sets rollbackImpactLevel for the install.
+ */
+ public Install setRollbackImpactLevel(int impactLevel) {
+ mRollbackImpactLevel = impactLevel;
+ return this;
+ }
+
+ /**
* Sets the session mode {@link PackageInstaller.SessionParams#MODE_INHERIT_EXISTING}.
* If it's not set, then the default session mode is
* {@link PackageInstaller.SessionParams#MODE_FULL_INSTALL}
@@ -279,6 +297,12 @@
}
params.setRequestDowngrade(mIsDowngrade);
params.setEnableRollback(mEnableRollback, mRollbackDataPolicy);
+ if (mEnableRollback && mLifetimeMillis > 0) {
+ params.setRollbackLifetimeMillis(mLifetimeMillis);
+ }
+ if (mEnableRollback && mRollbackImpactLevel >= 0) {
+ params.setRollbackImpactLevel(mRollbackImpactLevel);
+ }
if (mInstallFlags != 0) {
InstallUtils.mutateInstallFlags(params, mInstallFlags);
}
diff --git a/libs/install/testapp/signing/Android.bp b/libs/install/testapp/signing/Android.bp
index 9cc6862..f41ed77 100644
--- a/libs/install/testapp/signing/Android.bp
+++ b/libs/install/testapp/signing/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/libs/midi/Android.bp b/libs/midi/Android.bp
index 5317ab2..b549528 100644
--- a/libs/midi/Android.bp
+++ b/libs/midi/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_media_audio_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/libs/webkit-shared/Android.bp b/libs/webkit-shared/Android.bp
index acd9074..2f156c3 100644
--- a/libs/webkit-shared/Android.bp
+++ b/libs/webkit-shared/Android.bp
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package {
+ default_team: "trendy_team_chromium_webview",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/libs/webkit-shared/src/android/webkit/cts/SharedWebViewTest.java b/libs/webkit-shared/src/android/webkit/cts/SharedWebViewTest.java
index 3265e26..86638ec 100644
--- a/libs/webkit-shared/src/android/webkit/cts/SharedWebViewTest.java
+++ b/libs/webkit-shared/src/android/webkit/cts/SharedWebViewTest.java
@@ -34,7 +34,7 @@
mEnvironment = sharedWebViewTestEnvironment;
}
- protected SharedWebViewTestEnvironment getTestEnvironment() {
+ public SharedWebViewTestEnvironment getTestEnvironment() {
if (mEnvironment == null) {
mEnvironment = createTestEnvironment();
}
diff --git a/tests/AlarmManager/src/android/alarmmanager/cts/AppStandbyTests.java b/tests/AlarmManager/src/android/alarmmanager/cts/AppStandbyTests.java
index 0abc2df..a61e90d 100644
--- a/tests/AlarmManager/src/android/alarmmanager/cts/AppStandbyTests.java
+++ b/tests/AlarmManager/src/android/alarmmanager/cts/AppStandbyTests.java
@@ -281,8 +281,7 @@
private void updateAlarmManagerConstants() {
mConfigHelper.with("min_futurity", MIN_FUTURITY)
.with("app_standby_window", APP_STANDBY_WINDOW)
- .with("min_window", MIN_WINDOW)
- .with("exact_alarm_deny_list", TEST_APP_PACKAGE);
+ .with("min_window", MIN_WINDOW);
for (int i = 0; i < APP_STANDBY_QUOTAS.length; i++) {
mConfigHelper.with(APP_BUCKET_QUOTA_KEYS[i], APP_STANDBY_QUOTAS[i]);
}
diff --git a/tests/AlarmManager/src/android/alarmmanager/cts/ExactAlarmsTest.java b/tests/AlarmManager/src/android/alarmmanager/cts/ExactAlarmsTest.java
index ad25886..34ad678 100644
--- a/tests/AlarmManager/src/android/alarmmanager/cts/ExactAlarmsTest.java
+++ b/tests/AlarmManager/src/android/alarmmanager/cts/ExactAlarmsTest.java
@@ -230,21 +230,11 @@
public void hasPermissionWhenAllowed() throws Exception {
setAppOp(TEST_APP_PACKAGE, AppOpsManager.MODE_ALLOWED);
assertTrue(getCanScheduleExactAlarmFromTestApp(TEST_APP_PACKAGE));
-
- // The deny list shouldn't matter in this case.
- mDeviceConfigHelper.with("exact_alarm_deny_list", TEST_APP_PACKAGE)
- .commitAndAwaitPropagation();
- assertTrue(getCanScheduleExactAlarmFromTestApp(TEST_APP_PACKAGE));
}
@Test
public void canScheduleExactAlarmWithPolicyPermission() {
assertTrue(mAlarmManager.canScheduleExactAlarms());
-
- // The deny list shouldn't do anything.
- mDeviceConfigHelper.with("exact_alarm_deny_list", sContext.getOpPackageName())
- .commitAndAwaitPropagation();
- assertTrue(mAlarmManager.canScheduleExactAlarms());
}
@Test
@@ -257,12 +247,6 @@
public void canScheduleExactAlarmWithUserPermissionSdk32() throws Exception {
// Should be allowed by default.
assertTrue(getCanScheduleExactAlarmFromTestApp(TEST_APP_WITH_SCHEDULE_EXACT_ALARM_32));
-
- mDeviceConfigHelper.with("exact_alarm_deny_list", TEST_APP_WITH_SCHEDULE_EXACT_ALARM_32)
- .commitAndAwaitPropagation();
-
- assertFalse("canScheduleExactAlarm returned true when app was in deny list",
- getCanScheduleExactAlarmFromTestApp(TEST_APP_WITH_SCHEDULE_EXACT_ALARM_32));
}
@Test
@@ -344,7 +328,7 @@
alarmLatch.countDown();
}
};
- sContext.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED_UNAUDITED);
+ sContext.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED);
try {
Thread.sleep(5_000);
assertTrue("AlarmClock expiration not reported",
@@ -638,7 +622,7 @@
latch.countDown();
}
};
- sContext.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED_UNAUDITED);
+ sContext.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED);
try {
Log.d(TAG, "Granting the appop");
setAppOp(TEST_APP_PACKAGE, AppOpsManager.MODE_ALLOWED);
@@ -650,45 +634,4 @@
sContext.unregisterReceiver(receiver);
}
}
-
- @Test
- public void scheduleExactAlarmPermissionStateChangedSentDenyListSdk32() throws Exception {
- // App is targeting SDK 32, deny list will dictate the default grant state.
- prepareTestAppForBroadcast(mPermissionChangeReceiver32);
-
- // App op hasn't been touched, should be default.
- Log.d(TAG, "Putting in deny list");
- mDeviceConfigHelper.with("exact_alarm_deny_list", TEST_APP_WITH_SCHEDULE_EXACT_ALARM_32)
- .commitAndAwaitPropagation();
- removeFromWhitelists(TEST_APP_WITH_SCHEDULE_EXACT_ALARM_32);
-
- final int uid = Utils.getPackageUid(TEST_APP_WITH_SCHEDULE_EXACT_ALARM_32);
- TestUtils.waitUntil("Package still allowlisted",
- () -> !checkThisAppTempAllowListed(uid));
-
- final IntentFilter filter = new IntentFilter(
- PermissionStateChangedReceiver.ACTION_FGS_START_RESULT);
- final AtomicReference<String> resultHolder = new AtomicReference<>();
- final CountDownLatch latch = new CountDownLatch(1);
- final BroadcastReceiver receiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- Log.d(TAG, "Received response intent: " + intent);
- resultHolder.set(intent.getStringExtra(
- FgsTester.EXTRA_FGS_START_RESULT));
- latch.countDown();
- }
- };
- sContext.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED_UNAUDITED);
- try {
- Log.d(TAG, "Removing from deny list");
- mDeviceConfigHelper.without("exact_alarm_deny_list").commitAndAwaitPropagation();
-
- assertTrue("Didn't receive response",
- latch.await(30, TimeUnit.SECONDS));
- assertEquals("Failure message should be empty", "", resultHolder.get());
- } finally {
- sContext.unregisterReceiver(receiver);
- }
- }
}
diff --git a/tests/BlobStore/OWNERS b/tests/BlobStore/OWNERS
index b6533e1..a58a512 100644
--- a/tests/BlobStore/OWNERS
+++ b/tests/BlobStore/OWNERS
@@ -1,4 +1,4 @@
-# Bug component: 533114
+# Bug component: 25692
set noparent
file:platform/frameworks/base:/apex/blobstore/OWNERS
diff --git a/tests/PhotoPicker/src/android/photopicker/cts/ActionPickImagesOnlyTest.java b/tests/PhotoPicker/src/android/photopicker/cts/ActionPickImagesOnlyTest.java
index 76ff217..3ef7a4d 100644
--- a/tests/PhotoPicker/src/android/photopicker/cts/ActionPickImagesOnlyTest.java
+++ b/tests/PhotoPicker/src/android/photopicker/cts/ActionPickImagesOnlyTest.java
@@ -25,6 +25,7 @@
import static android.photopicker.cts.util.ResultsAssertionsUtils.assertPersistedGrant;
import static android.photopicker.cts.util.ResultsAssertionsUtils.assertPickerUriFormat;
import static android.photopicker.cts.util.ResultsAssertionsUtils.assertRedactedReadOnlyAccess;
+import static android.provider.MediaStore.ACTION_PICK_IMAGES;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
@@ -74,7 +75,7 @@
@Test
public void testPhotoPickerIntentDelegation() throws Exception {
- final Intent intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
+ final Intent intent = new Intent(ACTION_PICK_IMAGES);
for (String mimeType: new String[] {
null,
@@ -93,7 +94,7 @@
@Test
public void testMultiSelect_invalidParam() throws Exception {
- final Intent intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
+ final Intent intent = new Intent(ACTION_PICK_IMAGES);
intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, MediaStore.getPickImagesMaxLimit() + 1);
mActivity.startActivityForResult(intent, REQUEST_CODE);
final GetResultActivity.Result res = mActivity.getResult();
@@ -102,7 +103,7 @@
@Test
public void testMultiSelect_invalidNegativeParam() throws Exception {
- final Intent intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
+ final Intent intent = new Intent(ACTION_PICK_IMAGES);
intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, -1);
mActivity.startActivityForResult(intent, REQUEST_CODE);
final GetResultActivity.Result res = mActivity.getResult();
@@ -115,7 +116,7 @@
final int imageCount = maxCount + 1;
mUriList.addAll(createImagesAndGetUris(imageCount, mContext.getUserId()));
- final Intent intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
+ final Intent intent = new Intent(ACTION_PICK_IMAGES);
intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, maxCount);
mActivity.startActivityForResult(intent, REQUEST_CODE);
@@ -146,7 +147,7 @@
public void testDoesNotRespectExtraAllowMultiple() throws Exception {
final int imageCount = 2;
mUriList.addAll(createImagesAndGetUris(imageCount, mContext.getUserId()));
- final Intent intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
+ final Intent intent = new Intent(ACTION_PICK_IMAGES);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
mActivity.startActivityForResult(intent, REQUEST_CODE);
@@ -157,14 +158,14 @@
clickAndWait(sDevice, itemList.get(0));
final Uri uri = mActivity.getResult().data.getData();
- assertPickerUriFormat(uri, mContext.getUserId());
+ assertPickerUriFormat(ACTION_PICK_IMAGES, uri, mContext.getUserId());
assertPersistedGrant(uri, mContext.getContentResolver());
assertRedactedReadOnlyAccess(uri);
}
@Test
public void testMimeTypeFilter() throws Exception {
- final Intent intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
+ final Intent intent = new Intent(ACTION_PICK_IMAGES);
intent.setType("audio/*");
assertThrows(ActivityNotFoundException.class,
() -> mActivity.startActivityForResult(intent, REQUEST_CODE));
@@ -172,7 +173,7 @@
@Test
public void testExtraMimeTypeFilter() throws Exception {
- final Intent intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
+ final Intent intent = new Intent(ACTION_PICK_IMAGES);
intent.putExtra(Intent.EXTRA_MIME_TYPES, new String[]{"audio/*"});
mActivity.startActivityForResult(intent, REQUEST_CODE);
final GetResultActivity.Result res = mActivity.getResult();
diff --git a/tests/PhotoPicker/src/android/photopicker/cts/ActionUserSelectImagesForAppTest.java b/tests/PhotoPicker/src/android/photopicker/cts/ActionUserSelectImagesForAppTest.java
index 6bb3b00..698ac66 100644
--- a/tests/PhotoPicker/src/android/photopicker/cts/ActionUserSelectImagesForAppTest.java
+++ b/tests/PhotoPicker/src/android/photopicker/cts/ActionUserSelectImagesForAppTest.java
@@ -58,6 +58,7 @@
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -169,6 +170,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testNoCloudContent() throws Exception {
final List<Uri> uriList = new ArrayList<>();
final String cloudId = "cloud_id1";
diff --git a/tests/PhotoPicker/src/android/photopicker/cts/CloudPhotoPickerTest.java b/tests/PhotoPicker/src/android/photopicker/cts/CloudPhotoPickerTest.java
index 4c80b64..93bfc76 100644
--- a/tests/PhotoPicker/src/android/photopicker/cts/CloudPhotoPickerTest.java
+++ b/tests/PhotoPicker/src/android/photopicker/cts/CloudPhotoPickerTest.java
@@ -51,6 +51,7 @@
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -114,6 +115,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testCloudOnlySync() throws Exception {
initPrimaryCloudProviderWithImage(Pair.create(null, CLOUD_ID1));
@@ -124,6 +126,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testCloudPlusLocalSyncWithoutDedupe() throws Exception {
mUriList.addAll(createImagesAndGetUris(1, mContext.getUserId()));
initPrimaryCloudProviderWithImage(Pair.create(null, CLOUD_ID1));
@@ -147,6 +150,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testDeleteCloudMedia() throws Exception {
initPrimaryCloudProviderWithImage(Pair.create(null, CLOUD_ID1),
Pair.create(null, CLOUD_ID2));
@@ -167,6 +171,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testVersionChange() throws Exception {
initPrimaryCloudProviderWithImage(Pair.create(null, CLOUD_ID1),
Pair.create(null, CLOUD_ID2));
@@ -208,6 +213,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testProviderSwitchSuccess() throws Exception {
setCloudProvider(mContext, CloudProviderPrimary.AUTHORITY);
assertThat(MediaStore.isCurrentCloudMediaProviderAuthority(mContext.getContentResolver(),
@@ -245,6 +251,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testUriAccessWithValidProjection() throws Exception {
initPrimaryCloudProviderWithImage(Pair.create(null, CLOUD_ID1));
@@ -280,6 +287,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testUriAccessWithInvalidProjection() throws Exception {
initPrimaryCloudProviderWithImage(Pair.create(null, CLOUD_ID1));
@@ -301,6 +309,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testCloudEventNotification() throws Exception {
// Create a placeholder local image to ensure that the picker UI is never empty.
// The PhotoPickerUiUtils#findItemList needs to select an item and it times out if the
diff --git a/tests/PhotoPicker/src/android/photopicker/cts/PhotoPickerCrossProfileTest.java b/tests/PhotoPicker/src/android/photopicker/cts/PhotoPickerCrossProfileTest.java
index a4f7b90..98d1df0 100644
--- a/tests/PhotoPicker/src/android/photopicker/cts/PhotoPickerCrossProfileTest.java
+++ b/tests/PhotoPicker/src/android/photopicker/cts/PhotoPickerCrossProfileTest.java
@@ -24,6 +24,7 @@
import static android.photopicker.cts.util.PhotoPickerUiUtils.findProfileButton;
import static android.photopicker.cts.util.ResultsAssertionsUtils.assertPickerUriFormat;
import static android.photopicker.cts.util.ResultsAssertionsUtils.assertRedactedReadOnlyAccess;
+import static android.provider.MediaStore.ACTION_PICK_IMAGES;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
@@ -93,7 +94,7 @@
final int imageCount = 2;
mUriList.addAll(createImagesAndGetUris(imageCount, primaryUserId));
- Intent intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
+ Intent intent = new Intent(ACTION_PICK_IMAGES);
intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, imageCount);
mActivity.startActivityForResult(intent, REQUEST_CODE);
@@ -120,7 +121,7 @@
assertThat(count).isEqualTo(imageCount);
for (int i = 0; i < count; i++) {
Uri uri = clipData.getItemAt(i).getUri();
- assertPickerUriFormat(uri, primaryUserId);
+ assertPickerUriFormat(ACTION_PICK_IMAGES, uri, primaryUserId);
assertRedactedReadOnlyAccess(uri);
}
}
@@ -147,7 +148,7 @@
}
private void assertBlockedByAdmin(boolean isInvokedFromWorkProfile) throws Exception {
- Intent intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
+ Intent intent = new Intent(ACTION_PICK_IMAGES);
intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, MediaStore.getPickImagesMaxLimit());
mActivity.startActivityForResult(intent, REQUEST_CODE);
diff --git a/tests/PhotoPicker/src/android/photopicker/cts/PhotoPickerTest.java b/tests/PhotoPicker/src/android/photopicker/cts/PhotoPickerTest.java
index 293cbac..d166c35 100644
--- a/tests/PhotoPicker/src/android/photopicker/cts/PhotoPickerTest.java
+++ b/tests/PhotoPicker/src/android/photopicker/cts/PhotoPickerTest.java
@@ -39,6 +39,7 @@
import static android.photopicker.cts.util.ResultsAssertionsUtils.assertPersistedGrant;
import static android.photopicker.cts.util.ResultsAssertionsUtils.assertPickerUriFormat;
import static android.photopicker.cts.util.ResultsAssertionsUtils.assertRedactedReadOnlyAccess;
+import static android.provider.MediaStore.ACTION_PICK_IMAGES;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
@@ -122,7 +123,7 @@
clickAndWait(sDevice, item);
final Uri uri = mActivity.getResult().data.getData();
- assertPickerUriFormat(uri, mContext.getUserId());
+ assertPickerUriFormat(mAction, uri, mContext.getUserId());
assertPersistedGrant(uri, mContext.getContentResolver());
assertRedactedReadOnlyAccess(uri);
}
@@ -146,7 +147,7 @@
clickAndWait(sDevice, item);
final Uri uri = mActivity.getResult().data.getData();
- assertPickerUriFormat(uri, mContext.getUserId());
+ assertPickerUriFormat(mAction, uri, mContext.getUserId());
assertRedactedReadOnlyAccess(uri);
}
@@ -200,7 +201,7 @@
clickAndWait(sDevice, addButton);
final Uri uri = mActivity.getResult().data.getData();
- assertPickerUriFormat(uri, mContext.getUserId());
+ assertPickerUriFormat(mAction, uri, mContext.getUserId());
assertRedactedReadOnlyAccess(uri);
}
@@ -226,7 +227,7 @@
assertThat(count).isEqualTo(itemCount);
for (int i = 0; i < count; i++) {
final Uri uri = clipData.getItemAt(i).getUri();
- assertPickerUriFormat(uri, mContext.getUserId());
+ assertPickerUriFormat(mAction, uri, mContext.getUserId());
assertPersistedGrant(uri, mContext.getContentResolver());
assertRedactedReadOnlyAccess(uri);
}
@@ -274,7 +275,7 @@
assertThat(count).isEqualTo(3);
for (int i = 0; i < count; i++) {
final Uri uri = clipData.getItemAt(i).getUri();
- assertPickerUriFormat(uri, mContext.getUserId());
+ assertPickerUriFormat(mAction, uri, mContext.getUserId());
assertPersistedGrant(uri, mContext.getContentResolver());
assertRedactedReadOnlyAccess(uri);
}
@@ -314,7 +315,7 @@
assertThat(count).isEqualTo(itemCount - 1);
for (int i = 0; i < count; i++) {
final Uri uri = clipData.getItemAt(i).getUri();
- assertPickerUriFormat(uri, mContext.getUserId());
+ assertPickerUriFormat(mAction, uri, mContext.getUserId());
assertPersistedGrant(uri, mContext.getContentResolver());
assertRedactedReadOnlyAccess(uri);
}
@@ -576,7 +577,7 @@
assertThat(count).isEqualTo(itemCount);
for (int i = 0; i < count; i++) {
final Uri uri = clipData.getItemAt(i).getUri();
- assertPickerUriFormat(uri, mContext.getUserId());
+ assertPickerUriFormat(mAction, uri, mContext.getUserId());
assertPersistedGrant(uri, mContext.getContentResolver());
assertRedactedReadOnlyAccess(uri);
assertMimeType(uri, mimeType);
@@ -622,7 +623,7 @@
.that(clipData.getItemCount()).isEqualTo(itemCount);
for (int i = 0; i < itemCount; i++) {
final Uri uri = clipData.getItemAt(i).getUri();
- assertPickerUriFormat(uri, mContext.getUserId());
+ assertPickerUriFormat(mAction, uri, mContext.getUserId());
assertPersistedGrant(uri, mContext.getContentResolver());
assertRedactedReadOnlyAccess(uri);
assertContainsMimeType(uri, mimeTypes);
@@ -659,7 +660,7 @@
.that(clipData.getItemCount()).isEqualTo(itemCount);
for (int i = 0; i < itemCount; i++) {
final Uri uri = clipData.getItemAt(i).getUri();
- assertPickerUriFormat(uri, mContext.getUserId());
+ assertPickerUriFormat(mAction, uri, mContext.getUserId());
assertPersistedGrant(uri, mContext.getContentResolver());
assertRedactedReadOnlyAccess(uri);
assertMimeType(uri, mimeType);
@@ -870,14 +871,14 @@
private static List<String> getTestParameters() {
return Arrays.asList(
- MediaStore.ACTION_PICK_IMAGES,
+ ACTION_PICK_IMAGES,
Intent.ACTION_GET_CONTENT
);
}
private void addMultipleSelectionFlag(Intent intent) {
switch (intent.getAction()) {
- case MediaStore.ACTION_PICK_IMAGES:
+ case ACTION_PICK_IMAGES:
intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX,
MediaStore.getPickImagesMaxLimit());
break;
diff --git a/tests/PhotoPicker/src/android/photopicker/cts/RemoteVideoPreviewTest.java b/tests/PhotoPicker/src/android/photopicker/cts/RemoteVideoPreviewTest.java
index afd2695..08e0a17 100644
--- a/tests/PhotoPicker/src/android/photopicker/cts/RemoteVideoPreviewTest.java
+++ b/tests/PhotoPicker/src/android/photopicker/cts/RemoteVideoPreviewTest.java
@@ -229,6 +229,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testVideoPreviewProgressIndicator() throws Exception {
initCloudProviderWithVideo(Arrays.asList(Pair.create(null, CLOUD_ID1)));
launchPreviewMultiple(/* count */ 1);
@@ -239,6 +240,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testVideoPreviewPermanentError() throws Exception {
initCloudProviderWithVideo(Arrays.asList(Pair.create(null, CLOUD_ID1)));
launchPreviewMultiple(/* count */ 1);
@@ -249,6 +251,7 @@
}
@Test
+ @Ignore("Test have changed after Android U CTS cut")
public void testVideoPreviewRetriableError() throws Exception {
initCloudProviderWithVideo(Arrays.asList(Pair.create(null, CLOUD_ID1)));
final int surfaceId = 0;
diff --git a/tests/PhotoPicker/src/android/photopicker/cts/util/ResultsAssertionsUtils.java b/tests/PhotoPicker/src/android/photopicker/cts/util/ResultsAssertionsUtils.java
index 2f34677..03e6cc9 100644
--- a/tests/PhotoPicker/src/android/photopicker/cts/util/ResultsAssertionsUtils.java
+++ b/tests/PhotoPicker/src/android/photopicker/cts/util/ResultsAssertionsUtils.java
@@ -32,6 +32,7 @@
import android.net.Uri;
import android.os.FileUtils;
import android.os.ParcelFileDescriptor;
+import android.provider.MediaStore;
import androidx.annotation.NonNull;
import androidx.test.InstrumentationRegistry;
@@ -53,13 +54,17 @@
public class ResultsAssertionsUtils {
private static final String TAG = "PhotoPickerTestAssertions";
- public static void assertPickerUriFormat(Uri uri, int expectedUserId) {
+ public static void assertPickerUriFormat(String action, Uri uri, int expectedUserId) {
// content://media/picker/<user-id>/<media-id>
final int userId = Integer.parseInt(uri.getPathSegments().get(1));
assertThat(userId).isEqualTo(expectedUserId);
final String auth = uri.getPathSegments().get(0);
- assertThat(auth).isEqualTo("picker");
+ if (action.equalsIgnoreCase(MediaStore.ACTION_PICK_IMAGES)) {
+ assertThat(auth).isEqualTo("picker");
+ } else {
+ assertThat(auth).contains("picker");
+ }
}
public static void assertPersistedGrant(Uri uri, ContentResolver resolver) {
diff --git a/tests/PhotoPicker/src/android/photopicker/cts/util/UiAssertionUtils.java b/tests/PhotoPicker/src/android/photopicker/cts/util/UiAssertionUtils.java
index 7caeb6a..18f4ca0 100644
--- a/tests/PhotoPicker/src/android/photopicker/cts/util/UiAssertionUtils.java
+++ b/tests/PhotoPicker/src/android/photopicker/cts/util/UiAssertionUtils.java
@@ -42,8 +42,9 @@
PhotoPickerUiUtils.REGEX_PACKAGE_NAME + ":id/privacy_text"))
.exists()).isTrue();
- // Assert that "Photos" and "Albums" headers are shown.
- assertThat(new UiObject(new UiSelector().text("Photos")).exists()).isTrue();
+ // Assert that "Photos"/"Videos" and "Albums" headers are shown.
+ assertThat((new UiObject(new UiSelector().text("Photos")).exists())
+ || (new UiObject(new UiSelector().text("Videos")).exists())).isTrue();
assertThat(new UiObject(new UiSelector().text("Albums")).exists()).isTrue();
}
}
diff --git a/tests/acceleration/Android.bp b/tests/acceleration/Android.bp
index 51911f9..44d2fa8 100644
--- a/tests/acceleration/Android.bp
+++ b/tests/acceleration/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java b/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java
index c4883ee..d71e8ef 100644
--- a/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java
+++ b/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java
@@ -26,6 +26,7 @@
import static android.accessibilityservice.cts.utils.ActivityLaunchUtils.supportsMultiDisplay;
import static android.accessibilityservice.cts.utils.AsyncUtils.DEFAULT_TIMEOUT_MS;
import static android.accessibilityservice.cts.utils.DisplayUtils.VirtualDisplaySession;
+import static android.accessibilityservice.cts.utils.DisplayUtils.getNavBarHeight;
import static android.accessibilityservice.cts.utils.DisplayUtils.getStatusBarHeight;
import static android.content.pm.PackageManager.FEATURE_PICTURE_IN_PICTURE;
import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED;
@@ -883,6 +884,7 @@
}, activity),
addWindow(R.string.button2, params -> {
params.gravity = Gravity.BOTTOM;
+ params.y = getNavBarHeight(activity);
}, activity)
};
}
diff --git a/tests/accessibilityservice/src/android/accessibilityservice/cts/utils/DisplayUtils.java b/tests/accessibilityservice/src/android/accessibilityservice/cts/utils/DisplayUtils.java
index cadca22..f29a5ce 100644
--- a/tests/accessibilityservice/src/android/accessibilityservice/cts/utils/DisplayUtils.java
+++ b/tests/accessibilityservice/src/android/accessibilityservice/cts/utils/DisplayUtils.java
@@ -52,6 +52,11 @@
.getInsets(WindowInsets.Type.statusBars()).top;
}
+ public static int getNavBarHeight(Activity activity) {
+ return activity.getWindow().getDecorView().getRootWindowInsets()
+ .getInsets(WindowInsets.Type.statusBars()).bottom;
+ }
+
/**
* Checks if the bounds origin match the provided point, to a tolerance of
* {@link #BOUNDS_IN_SCREEN_TOLERANCE_PX} pixels.
diff --git a/tests/app/Android.bp b/tests/app/Android.bp
index 27d0f10..d73dbc5 100644
--- a/tests/app/Android.bp
+++ b/tests/app/Android.bp
@@ -75,6 +75,9 @@
":WallpaperTest",
],
per_testcase_directory: true,
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
android_test {
@@ -188,6 +191,9 @@
":CtsAppTestStubs",
],
per_testcase_directory: true,
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
android_test {
@@ -230,4 +236,7 @@
":CtsAppTestFgsTestHelperApi33",
],
per_testcase_directory: true,
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
diff --git a/tests/app/BroadcastsTest/src/android/app/cts/broadcasts/BroadcastFreezerTest.java b/tests/app/BroadcastsTest/src/android/app/cts/broadcasts/BroadcastFreezerTest.java
index aba2b86..a1ef30f 100644
--- a/tests/app/BroadcastsTest/src/android/app/cts/broadcasts/BroadcastFreezerTest.java
+++ b/tests/app/BroadcastsTest/src/android/app/cts/broadcasts/BroadcastFreezerTest.java
@@ -116,7 +116,10 @@
isProcessFrozen(testPid));
SystemClock.sleep(APP_FREEZING_DELAY_MS + ERROR_MARGIN_MS
- (SystemClock.uptimeMillis() - startTimeMs));
- assertTrue("Unfrozen for longer than expected", isProcessFrozen(testPid));
+ // Depending on the MCP limits, the process should have got killed or should be frozen at
+ // this point.
+ assertThrows("Process is still alive and unfrozen for longer than expected",
+ RemoteException.class, () -> cmdReceiver.getPid());
}
/**
diff --git a/tests/app/ShortFgsTest/ShortFgsTestHelper/src/android/app/cts/shortfgstesthelper/ShortFgsMessage.java b/tests/app/ShortFgsTest/ShortFgsTestHelper/src/android/app/cts/shortfgstesthelper/ShortFgsMessage.java
index ae863f8..e3a8f38 100644
--- a/tests/app/ShortFgsTest/ShortFgsTestHelper/src/android/app/cts/shortfgstesthelper/ShortFgsMessage.java
+++ b/tests/app/ShortFgsTest/ShortFgsTestHelper/src/android/app/cts/shortfgstesthelper/ShortFgsMessage.java
@@ -102,7 +102,7 @@
private String mExpectedExceptionClass;
@Nullable
- private String mActualExceptionClasss;
+ private String mActualExceptionClass;
@Nullable
private String mActualExceptionMessage;
@@ -130,7 +130,7 @@
}
public void setException(Throwable e) {
- mActualExceptionClasss = e.getClass().getName();
+ mActualExceptionClass = e.getClass().getName();
mActualExceptionMessage = e.getMessage();
try (StringWriter sw = new StringWriter();
@@ -180,7 +180,7 @@
boolean doFinishActivity,
boolean callGetTestInfo,
@Nullable String expectedExceptionClass,
- @Nullable String actualExceptionClasss,
+ @Nullable String actualExceptionClass,
@Nullable String actualExceptionMessage,
long lastTestStartUptime,
long lastTestEndUptime,
@@ -205,7 +205,7 @@
this.mDoFinishActivity = doFinishActivity;
this.mCallGetTestInfo = callGetTestInfo;
this.mExpectedExceptionClass = expectedExceptionClass;
- this.mActualExceptionClasss = actualExceptionClasss;
+ this.mActualExceptionClass = actualExceptionClass;
this.mActualExceptionMessage = actualExceptionMessage;
this.mLastTestStartUptime = lastTestStartUptime;
this.mLastTestEndUptime = lastTestEndUptime;
@@ -345,7 +345,7 @@
@DataClass.Generated.Member
public @Nullable String getActualExceptionClasss() {
- return mActualExceptionClasss;
+ return mActualExceptionClass;
}
@DataClass.Generated.Member
@@ -524,7 +524,7 @@
@DataClass.Generated.Member
public @NonNull ShortFgsMessage setActualExceptionClasss(@NonNull String value) {
- mActualExceptionClasss = value;
+ mActualExceptionClass = value;
return this;
}
@@ -582,7 +582,7 @@
"doFinishActivity = " + mDoFinishActivity + ", " +
"callGetTestInfo = " + mCallGetTestInfo + ", " +
"expectedExceptionClass = " + mExpectedExceptionClass + ", " +
- "actualExceptionClasss = " + mActualExceptionClasss + ", " +
+ "actualExceptionClass = " + mActualExceptionClass + ", " +
"actualExceptionMessage = " + mActualExceptionMessage + ", " +
"lastTestStartUptime = " + mLastTestStartUptime + ", " +
"lastTestEndUptime = " + mLastTestEndUptime + ", " +
@@ -613,7 +613,7 @@
if (mComponentName != null) flg |= 0x40;
if (mMethodName != null) flg |= 0x80;
if (mExpectedExceptionClass != null) flg |= 0x80000;
- if (mActualExceptionClasss != null) flg |= 0x100000;
+ if (mActualExceptionClass != null) flg |= 0x100000;
if (mActualExceptionMessage != null) flg |= 0x200000;
dest.writeLong(flg);
dest.writeLong(mTimestamp);
@@ -624,7 +624,7 @@
if (mComponentName != null) dest.writeTypedObject(mComponentName, flags);
if (mMethodName != null) dest.writeString(mMethodName);
if (mExpectedExceptionClass != null) dest.writeString(mExpectedExceptionClass);
- if (mActualExceptionClasss != null) dest.writeString(mActualExceptionClasss);
+ if (mActualExceptionClass != null) dest.writeString(mActualExceptionClass);
if (mActualExceptionMessage != null) dest.writeString(mActualExceptionMessage);
dest.writeLong(mLastTestStartUptime);
dest.writeLong(mLastTestEndUptime);
@@ -663,7 +663,7 @@
ComponentName componentName = (flg & 0x40) == 0 ? null : (ComponentName) in.readTypedObject(ComponentName.CREATOR);
String methodName = (flg & 0x80) == 0 ? null : in.readString();
String expectedExceptionClass = (flg & 0x80000) == 0 ? null : in.readString();
- String actualExceptionClasss = (flg & 0x100000) == 0 ? null : in.readString();
+ String actualExceptionClass = (flg & 0x100000) == 0 ? null : in.readString();
String actualExceptionMessage = (flg & 0x200000) == 0 ? null : in.readString();
long lastTestStartUptime = in.readLong();
long lastTestEndUptime = in.readLong();
@@ -689,7 +689,7 @@
this.mDoFinishActivity = doFinishActivity;
this.mCallGetTestInfo = callGetTestInfo;
this.mExpectedExceptionClass = expectedExceptionClass;
- this.mActualExceptionClasss = actualExceptionClasss;
+ this.mActualExceptionClass = actualExceptionClass;
this.mActualExceptionMessage = actualExceptionMessage;
this.mLastTestStartUptime = lastTestStartUptime;
this.mLastTestEndUptime = lastTestEndUptime;
@@ -739,7 +739,7 @@
private boolean mDoFinishActivity;
private boolean mCallGetTestInfo;
private @Nullable String mExpectedExceptionClass;
- private @Nullable String mActualExceptionClasss;
+ private @Nullable String mActualExceptionClass;
private @Nullable String mActualExceptionMessage;
private long mLastTestStartUptime;
private long mLastTestEndUptime;
@@ -797,7 +797,7 @@
boolean doFinishActivity,
boolean callGetTestInfo,
@Nullable String expectedExceptionClass,
- @Nullable String actualExceptionClasss,
+ @Nullable String actualExceptionClass,
@Nullable String actualExceptionMessage,
long lastTestStartUptime,
long lastTestEndUptime) {
@@ -821,7 +821,7 @@
mDoFinishActivity = doFinishActivity;
mCallGetTestInfo = callGetTestInfo;
mExpectedExceptionClass = expectedExceptionClass;
- mActualExceptionClasss = actualExceptionClasss;
+ mActualExceptionClass = actualExceptionClass;
mActualExceptionMessage = actualExceptionMessage;
mLastTestStartUptime = lastTestStartUptime;
mLastTestEndUptime = lastTestEndUptime;
@@ -1028,7 +1028,7 @@
public @NonNull Builder setActualExceptionClasss(@NonNull String value) {
checkNotUsed();
mBuilderFieldsSet |= 0x100000;
- mActualExceptionClasss = value;
+ mActualExceptionClass = value;
return this;
}
@@ -1096,7 +1096,7 @@
mDoFinishActivity,
mCallGetTestInfo,
mExpectedExceptionClass,
- mActualExceptionClasss,
+ mActualExceptionClass,
mActualExceptionMessage,
mLastTestStartUptime,
mLastTestEndUptime,
diff --git a/tests/app/WallpaperTest/Android.bp b/tests/app/WallpaperTest/Android.bp
index 7551dfb..2fe7393 100644
--- a/tests/app/WallpaperTest/Android.bp
+++ b/tests/app/WallpaperTest/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_system_ui_please_use_a_more_specific_subteam_if_possible_",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/app/WallpaperTest/src/android/app/cts/wallpapers/WallpaperManagerTest.java b/tests/app/WallpaperTest/src/android/app/cts/wallpapers/WallpaperManagerTest.java
index 66515d8..1a9b14c 100644
--- a/tests/app/WallpaperTest/src/android/app/cts/wallpapers/WallpaperManagerTest.java
+++ b/tests/app/WallpaperTest/src/android/app/cts/wallpapers/WallpaperManagerTest.java
@@ -26,6 +26,7 @@
import static android.app.cts.wallpapers.util.WallpaperTestUtils.isSimilar;
import static android.content.pm.PackageManager.FEATURE_LIVE_WALLPAPER;
import static android.content.pm.PackageManager.FEATURE_SECURE_LOCK_SCREEN;
+import static android.content.pm.PackageManager.FEATURE_WATCH;
import static android.opengl.cts.Egl14Utils.getMaxTextureSize;
import static com.android.compatibility.common.util.SystemUtil.runWithShellPermissionIdentity;
@@ -1316,6 +1317,9 @@
*/
@Test
public void testSystemAndLockWallpaperVisibility_onHomeScreen() {
+ assumeFalse("Test requires support for different lock and home screen wallpapers",
+ mContext.getPackageManager().hasSystemFeature(FEATURE_WATCH));
+
assumeTrue(mWallpaperManager.isLockscreenLiveWallpaperEnabled());
assumeTrue("Skipping testSystemAndLockWallpaperVisibility_onHomeScreen:"
+ " FEATURE_LIVE_WALLPAPER missing.",
@@ -1352,6 +1356,9 @@
*/
@Test
public void testSystemAndLockWallpaperVisibility_onLockScreen() throws Exception {
+ assumeFalse("Test requires support for different lock and home screen wallpapers",
+ mContext.getPackageManager().hasSystemFeature(FEATURE_WATCH));
+
assumeTrue(mWallpaperManager.isLockscreenLiveWallpaperEnabled());
assumeTrue("Skipping assert_SystemWallpaperHidden_LockWallpaperShow_OnLockscreen:"
+ " FEATURE_SECURE_LOCK_SCREEN missing.",
diff --git a/tests/app/WallpaperTest/testsdk33/Android.bp b/tests/app/WallpaperTest/testsdk33/Android.bp
index 00f982b..2823058 100644
--- a/tests/app/WallpaperTest/testsdk33/Android.bp
+++ b/tests/app/WallpaperTest/testsdk33/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_system_ui_please_use_a_more_specific_subteam_if_possible_",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/app/shared/Android.bp b/tests/app/shared/Android.bp
index 77c1b77..05d1c81 100644
--- a/tests/app/shared/Android.bp
+++ b/tests/app/shared/Android.bp
@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -36,4 +35,7 @@
],
platform_apis: true,
min_sdk_version: "20",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
diff --git a/tests/app/src/android/app/cts/ManageFsiTest.java b/tests/app/src/android/app/cts/ManageFsiTest.java
index 852855a..c06a577 100644
--- a/tests/app/src/android/app/cts/ManageFsiTest.java
+++ b/tests/app/src/android/app/cts/ManageFsiTest.java
@@ -45,6 +45,8 @@
final PackageManager pm = context.getPackageManager();
assumeFalse("TV does not support fullscreen intents",
pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK));
+ assumeFalse("Watch does not support fullscreen intents",
+ pm.hasSystemFeature(PackageManager.FEATURE_WATCH));
final Intent intent = new Intent(Settings.ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT);
intent.setData(Uri.parse("package:" + STUB_PACKAGE_NAME));
diff --git a/tests/app/src/android/app/cts/OWNERS b/tests/app/src/android/app/cts/OWNERS
index 41bbb86..1fa658e 100644
--- a/tests/app/src/android/app/cts/OWNERS
+++ b/tests/app/src/android/app/cts/OWNERS
@@ -3,3 +3,6 @@
# Bug component: 46626 = per-file DownloadManager*
per-file DownloadManager* = file:platform/frameworks/base:/core/java/android/os/storage/OWNERS
+
+# Bug component: 41727 = per-file SystemFeaturesTest*
+per-file SystemFeaturesTest* = file:platform/frameworks/av:/camera/OWNERS
diff --git a/tests/app/src/android/app/cts/SystemFeaturesTest.java b/tests/app/src/android/app/cts/SystemFeaturesTest.java
index d0caf69..25e01d4 100644
--- a/tests/app/src/android/app/cts/SystemFeaturesTest.java
+++ b/tests/app/src/android/app/cts/SystemFeaturesTest.java
@@ -51,7 +51,6 @@
import androidx.test.platform.app.InstrumentationRegistry;
import com.android.compatibility.common.util.CddTest;
-import com.android.compatibility.common.util.PropertyUtil;
import com.android.compatibility.common.util.SystemUtil;
import org.junit.Before;
@@ -70,9 +69,6 @@
*/
@RunWith(JUnit4.class)
public class SystemFeaturesTest {
- private static final String FEATURE_GOOGLE_ENTERPRISE_DEVICE =
- "com.google.android.feature.ENTERPRISE_DEVICE";
-
private Context mContext;
private PackageManager mPackageManager;
private Set<String> mAvailableFeatures;
@@ -333,16 +329,8 @@
@Test
public void testNfcFeatures() {
if (NfcAdapter.getDefaultAdapter(mContext) != null) {
- // Watches/Enterprise devices MAY support all FEATURE_NFC features when an NfcAdapter
- // is available, but other MUST support them both.
- if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_WATCH)
- || mPackageManager.hasSystemFeature(FEATURE_GOOGLE_ENTERPRISE_DEVICE)) {
- assertOneAvailable(PackageManager.FEATURE_NFC,
- PackageManager.FEATURE_NFC_HOST_CARD_EMULATION);
- } else {
- assertAvailable(PackageManager.FEATURE_NFC);
- assertAvailable(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION);
- }
+ assertOneAvailable(PackageManager.FEATURE_NFC,
+ PackageManager.FEATURE_NFC_HOST_CARD_EMULATION);
} else {
assertNotAvailable(PackageManager.FEATURE_NFC);
assertNotAvailable(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION);
@@ -610,7 +598,7 @@
!mPackageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK) &&
!mPackageManager.hasSystemFeature(PackageManager.FEATURE_WATCH) &&
!mPackageManager.hasSystemFeature(PackageManager.FEATURE_EMBEDDED) &&
- !isAndroidEmulator() &&
+ !Build.IS_EMULATOR &&
!mPackageManager.hasSystemFeature(PackageManager.FEATURE_PC) &&
mPackageManager.hasSystemFeature(PackageManager.FEATURE_MICROPHONE) &&
mPackageManager.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)) {
@@ -671,10 +659,6 @@
}
}
- private boolean isAndroidEmulator() {
- return PropertyUtil.propertyEquals("ro.boot.qemu", "1");
- }
-
private void assertFeature(boolean exist, String feature) {
if (exist) {
assertAvailable(feature);
diff --git a/tests/apppredictionservice/OWNERS b/tests/apppredictionservice/OWNERS
index b764e24..99cff17 100644
--- a/tests/apppredictionservice/OWNERS
+++ b/tests/apppredictionservice/OWNERS
@@ -1,3 +1,5 @@
# Bug component: 555429
+pinyaoting@google.com
+sunnygoyal@google.com
winsonc@google.com
-mett@google.com
+adamcohen@google.com
diff --git a/tests/appsearch/src/com/android/cts/appsearch/app/GlobalSearchSessionPlatformCtsTest.java b/tests/appsearch/src/com/android/cts/appsearch/app/GlobalSearchSessionPlatformCtsTest.java
index 53d6e27..16448e7 100644
--- a/tests/appsearch/src/com/android/cts/appsearch/app/GlobalSearchSessionPlatformCtsTest.java
+++ b/tests/appsearch/src/com/android/cts/appsearch/app/GlobalSearchSessionPlatformCtsTest.java
@@ -85,7 +85,7 @@
@AppModeFull(reason = "Can't bind to helper apps from instant mode")
public class GlobalSearchSessionPlatformCtsTest {
- private static final long TIMEOUT_BIND_SERVICE_SEC = 2;
+ private static final long TIMEOUT_BIND_SERVICE_SEC = 10;
private static final String TAG = "GlobalSearchSessionPlatformCtsTest";
@@ -1398,11 +1398,15 @@
if (mCommandReceiver == null) {
mCommandReceiver = ICommandReceiver.Stub.asInterface(getService());
}
+ if (mCommandReceiver == null) {
+ Log.e(TAG, "Cannot bind to a service in " + TIMEOUT_BIND_SERVICE_SEC + " second.");
+ }
return mCommandReceiver;
}
public void unbind() {
mCommandReceiver = null;
+ Log.i(TAG, "Service got unbinded.");
mContext.unbindService(this);
}
}
diff --git a/tests/aslr/Android.bp b/tests/aslr/Android.bp
index 952926c..b3f413d 100644
--- a/tests/aslr/Android.bp
+++ b/tests/aslr/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/autofillservice/Android.bp b/tests/autofillservice/Android.bp
index bfdbfea..4e3b8bb 100644
--- a/tests/autofillservice/Android.bp
+++ b/tests/autofillservice/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_autofill",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/autofillservice/TestAutofillService/Android.bp b/tests/autofillservice/TestAutofillService/Android.bp
index 9f565e1..a07d4d8 100644
--- a/tests/autofillservice/TestAutofillService/Android.bp
+++ b/tests/autofillservice/TestAutofillService/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_autofill",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/autofillservice/src/android/autofillservice/cts/activities/AbstractAutoFillActivity.java b/tests/autofillservice/src/android/autofillservice/cts/activities/AbstractAutoFillActivity.java
index af30990..6b7baff 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/activities/AbstractAutoFillActivity.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/activities/AbstractAutoFillActivity.java
@@ -124,7 +124,7 @@
/**
* Unregister the callback from the {@link AutofillManager}.
*
- * <p>This method just neeed to be called when a test case wants to explicitly test the behavior
+ * <p>This method just need to be called when a test case wants to explicitly test the behavior
* of the activity when the callback is unregistered.
*/
public void unregisterCallback() {
diff --git a/tests/autofillservice/src/android/autofillservice/cts/activities/AuthenticationActivity.java b/tests/autofillservice/src/android/autofillservice/cts/activities/AuthenticationActivity.java
index f669002..2a0d6ac 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/activities/AuthenticationActivity.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/activities/AuthenticationActivity.java
@@ -50,7 +50,7 @@
import java.util.function.Function;
/**
- * This class simulates authentication at the dataset at reponse level
+ * This class simulates authentication at the dataset at response level
*/
public class AuthenticationActivity extends AbstractAutoFillActivity {
diff --git a/tests/autofillservice/src/android/autofillservice/cts/dropdown/AuthenticationTest.java b/tests/autofillservice/src/android/autofillservice/cts/dropdown/AuthenticationTest.java
index 4a6bf6c..bd3f859 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/dropdown/AuthenticationTest.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/dropdown/AuthenticationTest.java
@@ -498,14 +498,6 @@
mActivity.onUsername((v) -> v.setText("du"));
mUiBot.assertDatasets("DS1", "DS2");
mActivity.onUsername((v) -> v.setText("dud"));
- mUiBot.assertDatasets("DS1", "DS2");
- mActivity.onUsername((v) -> v.setText("dude"));
- mUiBot.assertDatasets("DS1", "DS2");
- mActivity.onUsername((v) -> v.setText("dude,"));
- mUiBot.assertDatasets("DS2");
-
- // Now delete the char and assert 2 are shown again...
- mActivity.onUsername((v) -> v.setText("dude"));
final UiObject2 picker = mUiBot.assertDatasets("DS1", "DS2");
// ...and select it this time
diff --git a/tests/autofillservice/src/android/autofillservice/cts/dropdown/FillEventHistoryTest.java b/tests/autofillservice/src/android/autofillservice/cts/dropdown/FillEventHistoryTest.java
index 8a7f91c..c964229 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/dropdown/FillEventHistoryTest.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/dropdown/FillEventHistoryTest.java
@@ -124,18 +124,18 @@
sReplier.addResponse(new CannedFillResponse.Builder().addDataset(
new CannedDataset.Builder()
- .setField(ID_USERNAME, "username1")
- .setField(ID_PASSWORD, "password1")
+ .setField(ID_USERNAME, "ab1")
+ .setField(ID_PASSWORD, "ab1")
.setPresentation(createPresentation("dataset1"))
.build())
.addDataset(new CannedDataset.Builder()
- .setField(ID_USERNAME, "username2")
- .setField(ID_PASSWORD, "password2")
+ .setField(ID_USERNAME, "ab2")
+ .setField(ID_PASSWORD, "ab2")
.setPresentation(createPresentation("dataset2"))
.build())
.setFillResponseFlags(FillResponse.FLAG_TRACK_CONTEXT_COMMITED)
.build());
- mActivity.expectAutoFill("username1", "password1");
+ mActivity.expectAutoFill("ab1", "ab1");
// Trigger autofill on username
mActivity.onUsername(View::requestFocus);
@@ -153,10 +153,10 @@
}
// Finish the context by login in
- mActivity.onUsername((v) -> v.setText("USERNAME"));
- mActivity.onPassword((v) -> v.setText("USERNAME"));
+ mActivity.onUsername((v) -> v.setText("AB"));
+ mActivity.onPassword((v) -> v.setText("AB"));
- final String expectedMessage = getWelcomeMessage("USERNAME");
+ final String expectedMessage = getWelcomeMessage("AB");
final String actualMessage = mActivity.tapLogin();
assertWithMessage("Wrong welcome msg").that(actualMessage).isEqualTo(expectedMessage);
mUiBot.assertSaveNotShowing(SAVE_DATA_TYPE_PASSWORD);
@@ -368,19 +368,19 @@
sReplier.addResponse(new CannedFillResponse.Builder().addDataset(
new CannedDataset.Builder()
.setId("id1")
- .setField(ID_USERNAME, "username1")
- .setField(ID_PASSWORD, "password1")
+ .setField(ID_USERNAME, "ab1")
+ .setField(ID_PASSWORD, "ab1")
.setPresentation(createPresentation("dataset1"))
.build())
.addDataset(new CannedDataset.Builder()
.setId("id2")
- .setField(ID_USERNAME, "username2")
- .setField(ID_PASSWORD, "password2")
+ .setField(ID_USERNAME, "ab2")
+ .setField(ID_PASSWORD, "ab2")
.setPresentation(createPresentation("dataset2"))
.build())
.setFillResponseFlags(FillResponse.FLAG_TRACK_CONTEXT_COMMITED)
.build());
- mActivity.expectAutoFill("username1", "password1");
+ mActivity.expectAutoFill("ab1", "ab1");
// Trigger autofill on username
mActivity.onUsername(View::requestFocus);
@@ -398,10 +398,10 @@
}
// Finish the context by login in
- mActivity.onUsername((v) -> v.setText("USERNAME"));
- mActivity.onPassword((v) -> v.setText("USERNAME"));
+ mActivity.onUsername((v) -> v.setText("AB"));
+ mActivity.onPassword((v) -> v.setText("AB"));
- final String expectedMessage = getWelcomeMessage("USERNAME");
+ final String expectedMessage = getWelcomeMessage("AB");
final String actualMessage = mActivity.tapLogin();
assertWithMessage("Wrong welcome msg").that(actualMessage).isEqualTo(expectedMessage);
mUiBot.assertSaveNotShowing(SAVE_DATA_TYPE_PASSWORD);
@@ -612,13 +612,13 @@
sReplier.addResponse(new CannedFillResponse.Builder().addDataset(
new CannedDataset.Builder()
.setId("id1")
- .setField(ID_USERNAME, "username")
- .setField(ID_PASSWORD, "username")
+ .setField(ID_USERNAME, "abc")
+ .setField(ID_PASSWORD, "abc")
.setPresentation(createPresentation("dataset1"))
.build())
.setFillResponseFlags(FillResponse.FLAG_TRACK_CONTEXT_COMMITED)
.build());
- mActivity.expectAutoFill("username", "username");
+ mActivity.expectAutoFill("abc", "abc");
// Trigger autofill on username
mActivity.onUsername(View::requestFocus);
@@ -634,15 +634,15 @@
assertFillEventForDatasetSelected(events.get(1), "id1", UI_TYPE_MENU);
}
- // Change the fields to different values from0 datasets
- mActivity.onUsername((v) -> v.setText("USERNAME"));
- mActivity.onPassword((v) -> v.setText("USERNAME"));
+ // Change the fields to different values from original datasets
+ mActivity.onUsername((v) -> v.setText("ABC"));
+ mActivity.onPassword((v) -> v.setText("ABC"));
// Then change back to dataset values
- mActivity.onUsername((v) -> v.setText("username"));
- mActivity.onPassword((v) -> v.setText("username"));
+ mActivity.onUsername((v) -> v.setText("abc"));
+ mActivity.onPassword((v) -> v.setText("abc"));
- final String expectedMessage = getWelcomeMessage("username");
+ final String expectedMessage = getWelcomeMessage("abc");
final String actualMessage = mActivity.tapLogin();
assertWithMessage("Wrong welcome msg").that(actualMessage).isEqualTo(expectedMessage);
mUiBot.assertSaveNotShowing(SAVE_DATA_TYPE_PASSWORD);
diff --git a/tests/autofillservice/src/android/autofillservice/cts/dropdown/LoginActivityTest.java b/tests/autofillservice/src/android/autofillservice/cts/dropdown/LoginActivityTest.java
index 5fc1e36..5cbc127 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/dropdown/LoginActivityTest.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/dropdown/LoginActivityTest.java
@@ -2451,11 +2451,11 @@
*/
// Set expectations.
sReplier.addResponse(new CannedDataset.Builder()
- .setField(ID_USERNAME, "dude")
+ .setField(ID_USERNAME, "dud")
.setField(ID_PASSWORD, "sweet")
.setPresentation(createPresentation("The Dude"))
.build());
- mActivity.expectAutoFill("dude", "sweet");
+ mActivity.expectAutoFill("dud", "sweet");
// Trigger auto-fill.
requestFocusOnUsername();
@@ -2491,7 +2491,7 @@
// Assert request.
final FillRequest fillRequest2 = sReplier.getNextFillRequest();
assertHasFlags(fillRequest2.flags, FLAG_MANUAL_REQUEST);
- assertValue(fillRequest2.structure, ID_USERNAME, "dude");
+ assertValue(fillRequest2.structure, ID_USERNAME, "dud");
assertTextIsSanitized(fillRequest2.structure, ID_PASSWORD);
// Select it.
@@ -2512,11 +2512,11 @@
*/
// Set expectations.
sReplier.addResponse(new CannedDataset.Builder()
- .setField(ID_USERNAME, "dude")
+ .setField(ID_USERNAME, "dud")
.setField(ID_PASSWORD, "sweet")
.setPresentation(createPresentation("The Dude"))
.build());
- mActivity.expectAutoFill("dude", "sweet");
+ mActivity.expectAutoFill("dud", "sweet");
// Trigger auto-fill.
mActivity.forceAutofillOnUsername();
@@ -2552,7 +2552,7 @@
// Assert request.
final FillRequest fillRequest2 = sReplier.getNextFillRequest();
assertHasFlags(fillRequest2.flags, FLAG_MANUAL_REQUEST);
- assertValue(fillRequest2.structure, ID_USERNAME, "dude");
+ assertValue(fillRequest2.structure, ID_USERNAME, "dud");
assertTextIsSanitized(fillRequest2.structure, ID_PASSWORD);
// Select it.
diff --git a/tests/autofillservice/src/android/autofillservice/cts/servicebehavior/SettingsIntentTest.java b/tests/autofillservice/src/android/autofillservice/cts/servicebehavior/SettingsIntentTest.java
index bf1bd2a..5c01e0c 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/servicebehavior/SettingsIntentTest.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/servicebehavior/SettingsIntentTest.java
@@ -80,7 +80,9 @@
mActivity.startForResult(newSettingsIntent(), MY_REQUEST_CODE);
// Asserts services are shown.
+ mUiBot.scrollToTextObject(InstrumentedAutoFillService.sServiceLabel);
mUiBot.assertShownByText(InstrumentedAutoFillService.sServiceLabel);
+ mUiBot.scrollToTextObject(InstrumentedAutoFillServiceCompatMode.sServiceLabel);
mUiBot.assertShownByText(InstrumentedAutoFillServiceCompatMode.sServiceLabel);
mUiBot.scrollToTextObject(NoOpAutofillService.SERVICE_LABEL);
mUiBot.assertShownByText(NoOpAutofillService.SERVICE_LABEL);
@@ -99,6 +101,7 @@
mActivity.startForResult(newSettingsIntent(), MY_REQUEST_CODE);
// Asserts services are shown.
+ mUiBot.scrollToTextObject(InstrumentedAutoFillService.sServiceLabel);
final UiObject2 object = mUiBot
.assertShownByText(InstrumentedAutoFillService.sServiceLabel);
object.click();
diff --git a/tests/autofillservice/src/android/autofillservice/cts/testcore/UiBot.java b/tests/autofillservice/src/android/autofillservice/cts/testcore/UiBot.java
index e10c9c2..259f04a 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/testcore/UiBot.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/testcore/UiBot.java
@@ -1449,7 +1449,8 @@
public void touchOutsideDialog() throws Exception {
Log.v(TAG, "touchOutsideDialog()");
final UiObject2 picker = findFillDialogPicker();
- assertThat(injectClick(new Point(1, picker.getVisibleBounds().top / 2))).isTrue();
+ final Rect bounds = picker.getVisibleBounds();
+ assertThat(injectClick(new Point(bounds.left, bounds.top / 2))).isTrue();
}
/**
@@ -1459,7 +1460,8 @@
Log.v(TAG, "touchOutsideSaveDialog()");
final UiObject2 picker = waitForObject(SAVE_UI_SELECTOR, SAVE_TIMEOUT);
Log.v(TAG, "got picker: " + picker);
- assertThat(injectClick(new Point(1, picker.getVisibleBounds().top / 2))).isTrue();
+ final Rect bounds = picker.getVisibleBounds();
+ assertThat(injectClick(new Point(bounds.left, bounds.top / 2))).isTrue();
}
/**
diff --git a/tests/camera/Android.bp b/tests/camera/Android.bp
index 74fba98..b6b8212 100644
--- a/tests/camera/Android.bp
+++ b/tests/camera/Android.bp
@@ -14,6 +14,7 @@
// Reusable Camera performance test classes and helpers
package {
+ default_team: "trendy_team_camera_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -69,6 +70,7 @@
"MediaPerformanceClassCommon",
"cts-wm-util",
"cts-install-lib",
+ "androidx.camera_camera-camera2",
"androidx.camera_camera-core",
"androidx.camera_camera-extensions",
"androidx.camera_camera-lifecycle",
diff --git a/tests/camera/api25test/Android.bp b/tests/camera/api25test/Android.bp
index cf55b53..de35012 100644
--- a/tests/camera/api25test/Android.bp
+++ b/tests/camera/api25test/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/camera/libctscamera2jni/Android.bp b/tests/camera/libctscamera2jni/Android.bp
index d894731..91dcb08 100644
--- a/tests/camera/libctscamera2jni/Android.bp
+++ b/tests/camera/libctscamera2jni/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_camera_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/camera/propertyTestApp/Android.bp b/tests/camera/propertyTestApp/Android.bp
index 4b14bcc..ab5b831 100644
--- a/tests/camera/propertyTestApp/Android.bp
+++ b/tests/camera/propertyTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_camera_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java b/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java
index 4140333..2a3e9bc 100644
--- a/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java
+++ b/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java
@@ -870,8 +870,8 @@
@Test
@AppModeFull(reason = "PropertyUtil methods don't work for instant apps")
public void testZoomTimestampIncrease() throws Exception {
- if (PropertyUtil.getVendorApiLevel() <= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
- // Only run test for Vendor API level V or higher
+ if (PropertyUtil.getFirstApiLevel() <= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
+ // Only run test for first API level V or higher
return;
}
@@ -2839,46 +2839,50 @@
}
}
- /*
- * Validate resulting crop regions
- */
- if (previousCrop != null) {
- Rect currentCrop = cropRegion;
- mCollector.expectTrue(String.format(
- "Crop region should shrink or stay the same " +
- "(previous = %s, current = %s)",
- previousCrop, currentCrop),
- previousCrop.equals(currentCrop) ||
- (previousCrop.width() > currentCrop.width() &&
- previousCrop.height() > currentCrop.height()));
- }
+ if (CameraTestUtils.isStabilizationOff(requests[i])) {
+ /*
+ * Validate resulting crop regions
+ */
+ if (previousCrop != null) {
+ Rect currentCrop = cropRegion;
+ mCollector.expectTrue(String.format(
+ "Crop region should shrink or stay the same "
+ + "(previous = %s, current = %s)",
+ previousCrop, currentCrop),
+ previousCrop.equals(currentCrop)
+ || (previousCrop.width() > currentCrop.width()
+ && previousCrop.height() > currentCrop.height()));
+ }
- if (mStaticInfo.isHardwareLevelAtLeastLimited()) {
- mCollector.expectRectsAreSimilar(
- "Request and result crop region should be similar",
- cropRegions[i], cropRegion, CROP_REGION_ERROR_PERCENT_DELTA);
- }
+ if (mStaticInfo.isHardwareLevelAtLeastLimited()) {
+ mCollector.expectRectsAreSimilar(
+ "Request and result crop region should be similar",
+ cropRegions[i], cropRegion, CROP_REGION_ERROR_PERCENT_DELTA);
+ }
- if (croppingType == SCALER_CROPPING_TYPE_CENTER_ONLY) {
- mCollector.expectRectCentered(
- "Result crop region should be centered inside the active array",
- new Size(activeArraySize.width(), activeArraySize.height()),
- cropRegion, CROP_REGION_ERROR_PERCENT_CENTERED);
- }
+ if (croppingType == SCALER_CROPPING_TYPE_CENTER_ONLY) {
+ mCollector.expectRectCentered(
+ "Result crop region should be centered inside the active array",
+ new Size(activeArraySize.width(), activeArraySize.height()),
+ cropRegion, CROP_REGION_ERROR_PERCENT_CENTERED);
+ }
- /*
- * Validate resulting metering regions
- */
+ /*
+ * Validate resulting metering regions
+ */
- // Use the actual reported crop region to calculate the resulting metering region
- expectRegions[i] = getExpectedOutputRegion(
- /*requestRegion*/meteringRect,
- /*cropRect*/ cropRegion);
+ // Use the actual reported crop region to calculate the resulting
+ // metering region
+ expectRegions[i] = getExpectedOutputRegion(
+ /*requestRegion*/meteringRect,
+ /*cropRect*/ cropRegion);
- // Verify Output 3A region is intersection of input 3A region and crop region
- for (int algo = 0; algo < NUM_ALGORITHMS; algo++) {
- validate3aRegion(result, partialResults, algo, expectRegions[i],
- false/*scaleByZoomRatio*/, mStaticInfo);
+ // Verify Output 3A region is intersection of input 3A region and
+ // crop region
+ for (int algo = 0; algo < NUM_ALGORITHMS; algo++) {
+ validate3aRegion(result, partialResults, algo, expectRegions[i],
+ false/*scaleByZoomRatio*/, mStaticInfo);
+ }
}
previousCrop = cropRegion;
@@ -2991,40 +2995,42 @@
Math.abs(previousRatio - resultZoomRatio) < ZOOM_ERROR_MARGIN ||
(previousRatio < resultZoomRatio));
- mCollector.expectTrue(String.format(
- "Request and result zoom ratio should be similar " +
- "(requested = %f, result = %f", zoomFactor, resultZoomRatio),
- Math.abs(zoomFactor - resultZoomRatio)/zoomFactor <= ZOOM_ERROR_MARGIN);
+ if (CameraTestUtils.isStabilizationOff(request)) {
+ mCollector.expectTrue(String.format(
+ "Request and result zoom ratio should be similar "
+ + "(requested = %f, result = %f", zoomFactor, resultZoomRatio),
+ Math.abs(zoomFactor - resultZoomRatio) / zoomFactor <= ZOOM_ERROR_MARGIN);
- //In case zoom ratio is converted to crop region at HAL, due to error magnification
- //when converting to post-zoom crop region, scale the error threshold for crop region
- //check.
- float errorMultiplier = Math.max(1.0f, zoomFactor);
- if (mStaticInfo.isHardwareLevelAtLeastLimited()) {
- mCollector.expectRectsAreSimilar(
- "Request and result crop region should be similar",
- defaultCropRegion, cropRegion,
- CROP_REGION_ERROR_PERCENT_DELTA * errorMultiplier);
- }
+ //In case zoom ratio is converted to crop region at HAL, due to error magnification
+ //when converting to post-zoom crop region, scale the error threshold for crop
+ //region check.
+ float errorMultiplier = Math.max(1.0f, zoomFactor);
+ if (mStaticInfo.isHardwareLevelAtLeastLimited()) {
+ mCollector.expectRectsAreSimilar(
+ "Request and result crop region should be similar",
+ defaultCropRegion, cropRegion,
+ CROP_REGION_ERROR_PERCENT_DELTA * errorMultiplier);
+ }
- mCollector.expectRectCentered(
- "Result crop region should be centered inside the active array",
- new Size(activeArraySize.width(), activeArraySize.height()),
- cropRegion, CROP_REGION_ERROR_PERCENT_CENTERED * errorMultiplier);
+ mCollector.expectRectCentered(
+ "Result crop region should be centered inside the active array",
+ new Size(activeArraySize.width(), activeArraySize.height()),
+ cropRegion, CROP_REGION_ERROR_PERCENT_CENTERED * errorMultiplier);
- /*
- * Validate resulting metering regions
- */
- // Use the actual reported crop region to calculate the resulting metering region
- expectRegions[i] = getExpectedOutputRegion(
- /*requestRegion*/defaultMeteringRect,
- /*cropRect*/ cropRegion);
+ /*
+ * Validate resulting metering regions
+ */
+ // Use the actual reported crop region to calculate the resulting metering region
+ expectRegions[i] = getExpectedOutputRegion(
+ /*requestRegion*/defaultMeteringRect,
+ /*cropRect*/ cropRegion);
- // Verify Output 3A region is intersection of input 3A region and crop region
- boolean scaleByZoomRatio = zoomFactor > 1.0f;
- for (int algo = 0; algo < NUM_ALGORITHMS; algo++) {
- validate3aRegion(result, partialResults, algo, expectRegions[i], scaleByZoomRatio,
- mStaticInfo);
+ // Verify Output 3A region is intersection of input 3A region and crop region
+ boolean scaleByZoomRatio = zoomFactor > 1.0f;
+ for (int algo = 0; algo < NUM_ALGORITHMS; algo++) {
+ validate3aRegion(result, partialResults, algo, expectRegions[i],
+ scaleByZoomRatio, mStaticInfo);
+ }
}
previousRatio = resultZoomRatio;
@@ -3216,8 +3222,10 @@
verifyCaptureResultForKey(CaptureResult.CONTROL_EXTENDED_SCENE_MODE,
mode, listener, NUM_FRAMES_VERIFIED);
float zoomRatioDelta = ZOOM_RATIO_ERROR_PERCENT_DELTA * ratio;
- verifyCaptureResultForKey(CaptureResult.CONTROL_ZOOM_RATIO,
- ratio, listener, NUM_FRAMES_VERIFIED, zoomRatioDelta);
+ if (CameraTestUtils.isStabilizationOff(requestBuilder.build())) {
+ verifyCaptureResultForKey(CaptureResult.CONTROL_ZOOM_RATIO,
+ ratio, listener, NUM_FRAMES_VERIFIED, zoomRatioDelta);
+ }
}
}
}
@@ -3282,10 +3290,9 @@
}
numFrames++;
}
- assertTrue("Autoframing state didn't converge within " + kMaxNumFrames
- + " frames", numFrames < kMaxNumFrames);
- if (expectedZoomRatio == 0.0f) {
+ if (autoframingState == CameraMetadata.CONTROL_AUTOFRAMING_STATE_CONVERGED
+ && expectedZoomRatio == 0.0f) {
expectedZoomRatio = resultZoomRatio;
}
} else {
@@ -3297,12 +3304,16 @@
verifyCaptureResultForKey(CaptureResult.CONTROL_AUTOFRAMING, mode, listener,
NUM_FRAMES_VERIFIED);
- mCollector.expectTrue(String.format(
- "Zoom Ratio in Capture Request does not match the expected zoom"
- + "ratio in Capture Result (expected = %f, actual = %f)",
- expectedZoomRatio, resultZoomRatio),
- Math.abs(expectedZoomRatio - resultZoomRatio) / expectedZoomRatio
- <= zoomErrorMargin);
+ // If autoframing was OFF, or the framing state CONVERGED, the zoom ratio in result
+ // should be within the margin of error.
+ if (autoframingState != CameraMetadata.CONTROL_AUTOFRAMING_STATE_FRAMING) {
+ mCollector.expectTrue(String.format(
+ "Zoom Ratio in Capture Request does not match the expected zoom"
+ + "ratio in Capture Result (expected = %f, actual = %f)",
+ expectedZoomRatio, resultZoomRatio),
+ Math.abs(expectedZoomRatio - resultZoomRatio) / expectedZoomRatio
+ <= zoomErrorMargin);
+ }
}
}
}
diff --git a/tests/camera/src/android/hardware/camera2/cts/ExtendedCameraCharacteristicsTest.java b/tests/camera/src/android/hardware/camera2/cts/ExtendedCameraCharacteristicsTest.java
index 8ab9304..94d3990a 100644
--- a/tests/camera/src/android/hardware/camera2/cts/ExtendedCameraCharacteristicsTest.java
+++ b/tests/camera/src/android/hardware/camera2/cts/ExtendedCameraCharacteristicsTest.java
@@ -3375,13 +3375,13 @@
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED)
.addRequiredValue(
Build.VERSION_CODES.S,
- CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL)
+ CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED)
.addRequiredValue(
Build.VERSION_CODES.TIRAMISU,
- CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL)
+ CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED)
.addRequiredValue(
Build.VERSION_CODES.UPSIDE_DOWN_CAKE,
- CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL)
+ CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED)
.build();
return new PrimaryCameraHwLevelReq(RequirementConstants.R7_5__H_1_3,
rearCameraHwlLevel, frontCameraHwlLevel);
@@ -3573,11 +3573,9 @@
}
// H-1-12
- boolean previewStab = staticInfo.isPreviewStabilizationSupported();
if (isPrimaryRear) {
+ boolean previewStab = staticInfo.isPreviewStabilizationSupported();
previewStabilizationReq.setRearPreviewStabilizationSupported(previewStab);
- } else {
- previewStabilizationReq.setFrontPreviewStabilizationSupported(previewStab);
}
// H-1-13
@@ -3622,7 +3620,6 @@
timestampSourceReq.setFrontCameraTimestampSource(
CameraMetadata.SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN);
ultrawideZoomRatioReq.setFrontUltraWideZoomRatioReqMet(false);
- previewStabilizationReq.setFrontPreviewStabilizationSupported(false);
streamUseCaseReq.setFrontStreamUseCaseSupported(false);
}
diff --git a/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java b/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java
index a5314a3..48af6fd 100644
--- a/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java
+++ b/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java
@@ -16,6 +16,7 @@
package android.hardware.camera2.cts;
+import static android.hardware.camera2.cts.CameraTestUtils.CAMERA_IDLE_TIMEOUT_MS;
import static android.hardware.camera2.cts.CameraTestUtils.CAPTURE_RESULT_TIMEOUT_MS;
import static android.hardware.camera2.cts.CameraTestUtils.SESSION_READY_TIMEOUT_MS;
import static android.hardware.camera2.cts.CameraTestUtils.SimpleCaptureCallback;
@@ -1815,6 +1816,10 @@
outputSurfaces.add(mReader.getSurface());
CaptureRequest.Builder requestBuilder = prepareCaptureRequestForSurfaces(
outputSurfaces, CameraDevice.TEMPLATE_STILL_CAPTURE);
+ // Need to consume the SESSION_READY state because stopCapture() waits
+ // on an additional SESSION_READY state.
+ mCameraSessionListener.getStateWaiter().
+ waitForState(BlockingSessionCallback.SESSION_READY, CAMERA_IDLE_TIMEOUT_MS);
requestBuilder.set(
CaptureRequest.CONTROL_MODE, CaptureRequest.CONTROL_MODE_OFF);
diff --git a/tests/camera/src/android/hardware/camera2/cts/PerformanceTest.java b/tests/camera/src/android/hardware/camera2/cts/PerformanceTest.java
index ca5d18c..48d1580 100644
--- a/tests/camera/src/android/hardware/camera2/cts/PerformanceTest.java
+++ b/tests/camera/src/android/hardware/camera2/cts/PerformanceTest.java
@@ -1032,6 +1032,8 @@
// Start viewfinder with settings override set and the starting zoom ratio,
// and wait for some number of frames.
CaptureRequest.Builder previewBuilder = configurePreviewOutputs(id);
+ previewBuilder.set(CaptureRequest.CONTROL_VIDEO_STABILIZATION_MODE,
+ CameraMetadata.CONTROL_VIDEO_STABILIZATION_MODE_OFF);
previewBuilder.set(CaptureRequest.CONTROL_SETTINGS_OVERRIDE,
CameraMetadata.CONTROL_SETTINGS_OVERRIDE_ZOOM);
previewBuilder.set(CaptureRequest.CONTROL_ZOOM_RATIO, startRatio);
diff --git a/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java b/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java
index 9738b08..a50383b 100644
--- a/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java
+++ b/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java
@@ -28,41 +28,41 @@
import android.hardware.camera2.CaptureRequest;
import android.hardware.camera2.CaptureResult;
import android.hardware.camera2.DngCreator;
-import android.hardware.camera2.params.DynamicRangeProfiles;
-import android.hardware.camera2.params.OutputConfiguration;
-import android.location.Location;
-import android.location.LocationManager;
-import android.media.ImageReader;
-import android.util.Pair;
-import android.util.Size;
import android.hardware.camera2.cts.CameraTestUtils.SimpleCaptureCallback;
import android.hardware.camera2.cts.CameraTestUtils.SimpleImageReaderListener;
import android.hardware.camera2.cts.helpers.Camera2Focuser;
import android.hardware.camera2.cts.helpers.StaticMetadata;
import android.hardware.camera2.cts.testcases.Camera2SurfaceViewTestCase;
+import android.hardware.camera2.params.DynamicRangeProfiles;
import android.hardware.camera2.params.MeteringRectangle;
+import android.hardware.camera2.params.OutputConfiguration;
+import android.location.Location;
+import android.location.LocationManager;
import android.media.Image;
+import android.media.ImageReader;
import android.os.ConditionVariable;
import android.util.Log;
+import android.util.Pair;
import android.util.Range;
import android.util.Rational;
+import android.util.Size;
import android.view.Surface;
import com.android.ex.camera2.blocking.BlockingSessionCallback;
import com.android.ex.camera2.exceptions.TimeoutRuntimeException;
+import junit.framework.Assert;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
-import junit.framework.Assert;
-
-import org.junit.runners.Parameterized;
-import org.junit.runner.RunWith;
-import org.junit.Test;
-
@RunWith(Parameterized.class)
public class StillCaptureTest extends Camera2SurfaceViewTestCase {
private static final String TAG = "StillCaptureTest";
@@ -972,7 +972,7 @@
mCollector.expectEquals("AWB mode in result and request should be same",
previewRequest.get(CaptureRequest.CONTROL_AWB_MODE),
result.get(CaptureResult.CONTROL_AWB_MODE));
- if (canSetAwbRegion) {
+ if (canSetAwbRegion && CameraTestUtils.isStabilizationOff(previewRequest.build())) {
MeteringRectangle[] resultAwbRegions =
getValueNotNull(result, CaptureResult.CONTROL_AWB_REGIONS);
mCollector.expectEquals("AWB regions in result and request should be same",
@@ -1016,7 +1016,7 @@
mCollector.expectEquals("AE mode in result and request should be same",
previewRequest.get(CaptureRequest.CONTROL_AE_MODE),
result.get(CaptureResult.CONTROL_AE_MODE));
- if (canSetAeRegion) {
+ if (canSetAeRegion && CameraTestUtils.isStabilizationOff(previewRequest.build())) {
MeteringRectangle[] resultAeRegions =
getValueNotNull(result, CaptureResult.CONTROL_AE_REGIONS);
@@ -1038,7 +1038,7 @@
mCollector.expectEquals("AF mode in result and request should be same",
stillRequest.get(CaptureRequest.CONTROL_AF_MODE),
result.get(CaptureResult.CONTROL_AF_MODE));
- if (canSetAfRegion) {
+ if (canSetAfRegion && CameraTestUtils.isStabilizationOff(stillRequest.build())) {
MeteringRectangle[] resultAfRegions =
getValueNotNull(result, CaptureResult.CONTROL_AF_REGIONS);
mCollector.expectMeteringRegionsAreSimilar(
diff --git a/tests/camera/src/android/hardware/multiprocess/camera/cts/CameraEvictionTest.java b/tests/camera/src/android/hardware/multiprocess/camera/cts/CameraEvictionTest.java
index 52c42c0..2556a1e 100644
--- a/tests/camera/src/android/hardware/multiprocess/camera/cts/CameraEvictionTest.java
+++ b/tests/camera/src/android/hardware/multiprocess/camera/cts/CameraEvictionTest.java
@@ -520,6 +520,9 @@
assertFalse(eventTagCountMap.containsKey(
TestConstants.EVENT_ACTIVITY_TOP_RESUMED_TRUE));
}
+
+ mTaskOrganizer.unregisterOrganizerIfNeeded();
+ Thread.sleep(WAIT_TIME);
}
/**
diff --git a/tests/camera/utils/Android.bp b/tests/camera/utils/Android.bp
index 403c114..27332e8 100644
--- a/tests/camera/utils/Android.bp
+++ b/tests/camera/utils/Android.bp
@@ -15,6 +15,7 @@
// CtsCameraUtils package
package {
+ default_team: "trendy_team_camera_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/camera/utils/src/android/hardware/camera2/cts/CameraTestUtils.java b/tests/camera/utils/src/android/hardware/camera2/cts/CameraTestUtils.java
index bbc2e05..aaa7200 100644
--- a/tests/camera/utils/src/android/hardware/camera2/cts/CameraTestUtils.java
+++ b/tests/camera/utils/src/android/hardware/camera2/cts/CameraTestUtils.java
@@ -4430,4 +4430,19 @@
}
}
+
+ /**
+ * Check if the camera device keeps stabilization off
+ *
+ * @param result The capture request builder
+ * @return true if stabilization is OFF
+ */
+ public static boolean isStabilizationOff(CaptureRequest request) {
+ Integer stabilizationMode = request.get(
+ CaptureRequest.CONTROL_VIDEO_STABILIZATION_MODE);
+ assertNotNull("Value of Key CONTROL_VIDEO_STABILIZATION_MODE shouldn't be null",
+ stabilizationMode);
+
+ return (stabilizationMode == CameraMetadata.CONTROL_VIDEO_STABILIZATION_MODE_OFF);
+ }
}
diff --git a/tests/core/runner-axt/Android.bp b/tests/core/runner-axt/Android.bp
index 79c7099..9f01042 100644
--- a/tests/core/runner-axt/Android.bp
+++ b/tests/core/runner-axt/Android.bp
@@ -19,6 +19,7 @@
// temporary cts-core-test-runner variant that brings in androidx.test transitively, instead
// of android.support.test target. Will be removed after androidx.test CTS conversion is complete.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/credentials/Android.bp b/tests/credentials/Android.bp
index 4ea4ead..e8b542e 100644
--- a/tests/credentials/Android.bp
+++ b/tests/credentials/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_credential_manager",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/credentials/src/android/credentials/cts/CtsCredentialProviderServiceDeviceTest.java b/tests/credentials/src/android/credentials/cts/CtsCredentialProviderServiceDeviceTest.java
index 7592ba2..bedd95b 100644
--- a/tests/credentials/src/android/credentials/cts/CtsCredentialProviderServiceDeviceTest.java
+++ b/tests/credentials/src/android/credentials/cts/CtsCredentialProviderServiceDeviceTest.java
@@ -24,6 +24,7 @@
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
import android.content.ComponentName;
@@ -139,6 +140,7 @@
@Before
public void setUp() {
+ assumeFalse("Skipping test: Wear does not support CredentialManager yet", isWatch());
Log.i(TAG, "Enabling service from scratch for " + CTS_SERVICE_NAME);
Log.i(TAG, "Enabling CredentialManager flags as well...");
enableCredentialManagerDeviceFeature(mContext);
@@ -759,4 +761,9 @@
// one or more activity can handle this intent.
assertTrue(resolveInfoList.size() > 0);
}
+
+ private boolean isWatch() {
+ PackageManager pm = mContext.getPackageManager();
+ return pm.hasSystemFeature(PackageManager.FEATURE_WATCH);
+ }
}
diff --git a/tests/devicepolicy/src/android/devicepolicy/cts/AccountManagementTest.java b/tests/devicepolicy/src/android/devicepolicy/cts/AccountManagementTest.java
index 3cadf2a..7816f4c1 100644
--- a/tests/devicepolicy/src/android/devicepolicy/cts/AccountManagementTest.java
+++ b/tests/devicepolicy/src/android/devicepolicy/cts/AccountManagementTest.java
@@ -71,6 +71,7 @@
import org.junit.Assume;
import org.junit.Before;
import org.junit.ClassRule;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -614,6 +615,7 @@
}
}
+ @Ignore("b/312605194 Ignore until test failure is root caused")
@Postsubmit(reason = "new test")
@PolicyAppliesTest(policy = AccountManagement.class)
@ApiTest(apis = {"android.app.admin.DevicePolicyManager#setAccountManagementDisabled",
diff --git a/tests/devicepolicy/src/android/devicepolicy/cts/DeviceManagementCoexistenceTest.java b/tests/devicepolicy/src/android/devicepolicy/cts/DeviceManagementCoexistenceTest.java
index 6faab3b..54d939e 100644
--- a/tests/devicepolicy/src/android/devicepolicy/cts/DeviceManagementCoexistenceTest.java
+++ b/tests/devicepolicy/src/android/devicepolicy/cts/DeviceManagementCoexistenceTest.java
@@ -1335,9 +1335,8 @@
/* applicationHidden= */ true);
- // Remove DPC
- sDeviceState.dpc().devicePolicyManager().clearDeviceOwnerApp(
- sDeviceState.dpc().packageName());
+ // Remove DPC - we know it is a device owner due to @EnsureHasDeviceOwner
+ sDeviceState.deviceOwner().remove();
// Get policies from policy engine
PolicyState<LockTaskPolicy> lockTaskPolicy = getLockTaskPolicyState(
diff --git a/tests/devicepolicy/src/android/devicepolicy/cts/InstallUnknownSourcesTest.java b/tests/devicepolicy/src/android/devicepolicy/cts/InstallUnknownSourcesTest.java
index 6657f54..4030152 100644
--- a/tests/devicepolicy/src/android/devicepolicy/cts/InstallUnknownSourcesTest.java
+++ b/tests/devicepolicy/src/android/devicepolicy/cts/InstallUnknownSourcesTest.java
@@ -25,6 +25,7 @@
import com.android.bedstead.harrier.BedsteadJUnit4;
import com.android.bedstead.harrier.DeviceState;
+import com.android.bedstead.harrier.annotations.EnsureDoesNotHaveUserRestriction;
import com.android.bedstead.harrier.annotations.Postsubmit;
import com.android.bedstead.harrier.annotations.enterprise.CannotSetPolicyTest;
import com.android.bedstead.harrier.annotations.enterprise.PolicyAppliesTest;
@@ -57,6 +58,7 @@
}
@PolicyAppliesTest(policy = DisallowInstallUnknownSources.class)
+ @EnsureDoesNotHaveUserRestriction(DISALLOW_INSTALL_UNKNOWN_SOURCES)
@Postsubmit(reason = "new test")
@ApiTest(apis = "android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES")
public void addUserRestriction_disallowInstallUnknownSources_isSet() {
@@ -74,6 +76,7 @@
}
@PolicyDoesNotApplyTest(policy = DisallowInstallUnknownSources.class)
+ @EnsureDoesNotHaveUserRestriction(DISALLOW_INSTALL_UNKNOWN_SOURCES)
@Postsubmit(reason = "new test")
@ApiTest(apis = "android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES")
public void addUserRestriction_disallowInstallUnknownSources_isNotSet() {
@@ -92,6 +95,7 @@
}
@PolicyAppliesTest(policy = DisallowInstallUnknownSourcesGlobally.class)
+ @EnsureDoesNotHaveUserRestriction(DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY)
@Postsubmit(reason = "new test")
@ApiTest(apis = "android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY")
public void addUserRestriction_disallowInstallUnknownSourcesGlobally_isSet() {
diff --git a/tests/devicepolicy/src/android/devicepolicy/cts/LockTaskTest.java b/tests/devicepolicy/src/android/devicepolicy/cts/LockTaskTest.java
index d16d726..1584bf7 100644
--- a/tests/devicepolicy/src/android/devicepolicy/cts/LockTaskTest.java
+++ b/tests/devicepolicy/src/android/devicepolicy/cts/LockTaskTest.java
@@ -33,6 +33,7 @@
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.pm.PackageManager.FEATURE_TELEPHONY;
+import static android.content.pm.PackageManager.FEATURE_TELEPHONY_CALLING;
import static android.devicepolicy.cts.utils.PolicyEngineUtils.FINANCED_DEVICE_CONTROLLER_ROLE;
import static com.android.bedstead.harrier.annotations.enterprise.MostImportantCoexistenceTest.LESS_IMPORTANT;
@@ -998,7 +999,7 @@
}
@PolicyAppliesTest(policy = LockTaskFinance.class)
- @RequireFeature(FEATURE_TELEPHONY)
+ @RequireFeature(FEATURE_TELEPHONY_CALLING)
@Postsubmit(reason = "b/181993922 automatically marked flaky")
// Tests that the default dialer doesn't crash or otherwise misbehave in lock task mode
public void launchDefaultDialerInLockTaskMode_launches() {
diff --git a/tests/devicepolicy/src/android/devicepolicy/cts/MaximumTimeOffTest.java b/tests/devicepolicy/src/android/devicepolicy/cts/MaximumTimeOffTest.java
index c9480df..8bf8801 100644
--- a/tests/devicepolicy/src/android/devicepolicy/cts/MaximumTimeOffTest.java
+++ b/tests/devicepolicy/src/android/devicepolicy/cts/MaximumTimeOffTest.java
@@ -19,6 +19,7 @@
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
+import static com.android.bedstead.nene.notifications.NotificationListenerQuerySubject.assertThat;
import static com.android.queryable.queries.ActivityQuery.activity;
import static com.google.common.truth.Truth.assertThat;
@@ -26,6 +27,7 @@
import static org.testng.Assert.assertThrows;
import android.content.Intent;
+import android.util.Log;
import com.android.bedstead.harrier.BedsteadJUnit4;
import com.android.bedstead.harrier.DeviceState;
@@ -37,6 +39,7 @@
import com.android.bedstead.nene.TestApis;
import com.android.bedstead.nene.notifications.NotificationListener;
import com.android.bedstead.nene.notifications.NotificationListenerQuerySubject;
+import com.android.bedstead.nene.packages.ComponentReference;
import com.android.bedstead.nene.utils.Poll;
import com.android.bedstead.testapp.TestApp;
import com.android.bedstead.testapp.TestAppActivityReference;
@@ -64,6 +67,7 @@
).get();
@PolicyAppliesTest(policy = MaximumTimeOff.class)
+ @NotificationsTest
public void setManagedProfileMaximumTimeOff_timesOut_personalAppsAreSuspended()
throws Exception {
long originalMaximumTimeOff =
@@ -75,25 +79,19 @@
sDeviceState.dpc().devicePolicyManager().setManagedProfileMaximumTimeOff(
sDeviceState.dpc().componentName(), /* timeoutMs= */ 1);
- sDeviceState.workProfile().setQuietMode(true);
+ try (NotificationListener notifications = TestApis.notifications().createListener()) {
+ sDeviceState.workProfile().setQuietMode(true);
- // TODO(264248238): We should create a more direct way of figuring out the launch
- // was refused
- Poll.forValue("Successfully launched", () -> {
- // Ensure that we only see events from the current iteration
- EventLogs.resetLogs();
- startActivityWithoutBlocking(activity);
+ // Wait for us to be notified that personal apps are disabled
+ assertThat(notifications.query()
+ .wherePackageName().isEqualTo("android")
+ .whereNotification().channelId().isEqualTo("DEVICE_ADMIN_ALERTS"))
+ .wasPosted();
+ }
- try {
- activity.events().activityStarted().waitForEvent(Duration.ofSeconds(2));
- return true;
- } catch (AssertionError e) {
- // No event
- return false;
- }
- }).toBeEqualTo(false)
- .errorOnFail()
- .await();
+ startActivityWithoutBlocking(activity);
+
+ assertBlockedByAdminDialogAppears();
} finally {
sDeviceState.workProfile().setQuietMode(false);
sDeviceState.dpc().devicePolicyManager().setManagedProfileMaximumTimeOff(
@@ -122,7 +120,7 @@
sDeviceState.workProfile().setQuietMode(true);
- NotificationListenerQuerySubject.assertThat(
+ assertThat(
notifications.query()
.wherePackageName().isEqualTo("android")
.whereNotification().channelId().isEqualTo("DEVICE_ADMIN_ALERTS")
@@ -161,4 +159,17 @@
}
// TODO(264249662): Add missing coverage
+
+ private static final String BLOCKED_BY_ADMIN_DIALOG_CLASSNAME =
+ "com.android.settings.enterprise.ActionDisabledByAdminDialog";
+
+ private void assertBlockedByAdminDialogAppears() {
+ // TODO: We should move this into the enterprise/bedstead infra
+ Poll.forValue(
+ "foreground activity", () -> TestApis.activities().foregroundActivity())
+ .toMeet(
+ (v) -> v.className()
+ .equals(BLOCKED_BY_ADMIN_DIALOG_CLASSNAME))
+ .errorOnFail().await();
+ }
}
diff --git a/tests/devicepolicy/src/android/devicepolicy/cts/ScreenCaptureDisabledTest.java b/tests/devicepolicy/src/android/devicepolicy/cts/ScreenCaptureDisabledTest.java
index 0e9903e..dfba181 100644
--- a/tests/devicepolicy/src/android/devicepolicy/cts/ScreenCaptureDisabledTest.java
+++ b/tests/devicepolicy/src/android/devicepolicy/cts/ScreenCaptureDisabledTest.java
@@ -594,11 +594,18 @@
// as there could be notifications in the top part and white line(navigation bar) at bottom
// which are included in the screenshot and are not redacted(black). It's not perfect, but
// seems best option to avoid any flakiness at this point.
- int[] pixels = new int[width * (height / 2)];
+ int len = width * (height / 2);
+ int[] pixels = new int[len];
screenshot.getPixels(pixels, 0, width, 0, height / 4, width, height / 2);
- for (int pixel : pixels) {
- if (!(pixel == Color.BLACK || (pixel == Color.TRANSPARENT && isAutomotive()))) {
+ for (int i = 0; i < len; ++i) {
+ // Skip some pixels from the right to accommodate for the edge panel(present on
+ // some devices) which will not be redacted in the screenshot.
+ if ((i % width) /* X-position */ > (width - 34)) {
+ // skipping edge panel
+ continue;
+ }
+ if (!(pixels[i] == Color.BLACK || (pixels[i] == Color.TRANSPARENT && isAutomotive()))) {
return false;
}
}
diff --git a/tests/fragment/Android.bp b/tests/fragment/Android.bp
index 15e9af9..db8d3d9 100644
--- a/tests/fragment/Android.bp
+++ b/tests/fragment/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/fragment/sdk26/Android.bp b/tests/fragment/sdk26/Android.bp
index c4be694..6432846 100644
--- a/tests/fragment/sdk26/Android.bp
+++ b/tests/fragment/sdk26/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/framework/base/biometrics/Android.bp b/tests/framework/base/biometrics/Android.bp
index 5403db2..14bbcef 100644
--- a/tests/framework/base/biometrics/Android.bp
+++ b/tests/framework/base/biometrics/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_biometrics_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/framework/base/biometrics/apps/biometrics/Android.bp b/tests/framework/base/biometrics/apps/biometrics/Android.bp
index 4dc5e220..8bc5f41 100644
--- a/tests/framework/base/biometrics/apps/biometrics/Android.bp
+++ b/tests/framework/base/biometrics/apps/biometrics/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_biometrics_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/framework/base/biometrics/apps/fingerprint/Android.bp b/tests/framework/base/biometrics/apps/fingerprint/Android.bp
index ef7ceb4a..c349375 100644
--- a/tests/framework/base/biometrics/apps/fingerprint/Android.bp
+++ b/tests/framework/base/biometrics/apps/fingerprint/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_biometrics_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/framework/base/biometrics/apps/util/Android.bp b/tests/framework/base/biometrics/apps/util/Android.bp
index 5fa1367..2130406 100644
--- a/tests/framework/base/biometrics/apps/util/Android.bp
+++ b/tests/framework/base/biometrics/apps/util/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_biometrics_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/framework/base/locale/src/android/localemanager/cts/LocaleManagerTests.java b/tests/framework/base/locale/src/android/localemanager/cts/LocaleManagerTests.java
index 0c63b2a..bfbfe86 100644
--- a/tests/framework/base/locale/src/android/localemanager/cts/LocaleManagerTests.java
+++ b/tests/framework/base/locale/src/android/localemanager/cts/LocaleManagerTests.java
@@ -55,6 +55,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.pm.PackageManager;
import android.os.LocaleList;
import android.server.wm.ActivityManagerTestBase;
@@ -680,8 +681,13 @@
}
private void setTestImeAsActive() throws Exception {
- ShellUtils.runShellCommand("ime enable " + mTestIme);
- ShellUtils.runShellCommand("ime set " + mTestIme);
+ if (sContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
+ ShellUtils.runShellCommand("ime enable " + mTestIme + " --user 10");
+ ShellUtils.runShellCommand("ime set " + mTestIme + " --user 10");
+ } else {
+ ShellUtils.runShellCommand("ime enable " + mTestIme);
+ ShellUtils.runShellCommand("ime set " + mTestIme);
+ }
mNeedsImeReset = true;
assertTrue(mImeChangedBroadcastReceiver.await());
diff --git a/tests/framework/base/suggestions/Android.bp b/tests/framework/base/suggestions/Android.bp
index 9ce4ff4..a13aa33 100644
--- a/tests/framework/base/suggestions/Android.bp
+++ b/tests/framework/base/suggestions/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_settings_app",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/framework/base/windowmanager/backgroundactivity/Android.bp b/tests/framework/base/windowmanager/backgroundactivity/Android.bp
index cb7e6fe..2e98680 100644
--- a/tests/framework/base/windowmanager/backgroundactivity/Android.bp
+++ b/tests/framework/base/windowmanager/backgroundactivity/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/framework/base/windowmanager/backgroundactivity/AppA/Android.bp b/tests/framework/base/windowmanager/backgroundactivity/AppA/Android.bp
index a67f0684..7511c4c 100644
--- a/tests/framework/base/windowmanager/backgroundactivity/AppA/Android.bp
+++ b/tests/framework/base/windowmanager/backgroundactivity/AppA/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/framework/base/windowmanager/backgroundactivity/AppB/Android.bp b/tests/framework/base/windowmanager/backgroundactivity/AppB/Android.bp
index 61fd0eb..d9464c6 100644
--- a/tests/framework/base/windowmanager/backgroundactivity/AppB/Android.bp
+++ b/tests/framework/base/windowmanager/backgroundactivity/AppB/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/framework/base/windowmanager/backgroundactivity/AppC/Android.bp b/tests/framework/base/windowmanager/backgroundactivity/AppC/Android.bp
index e135d5d..d1165e0 100644
--- a/tests/framework/base/windowmanager/backgroundactivity/AppC/Android.bp
+++ b/tests/framework/base/windowmanager/backgroundactivity/AppC/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/framework/base/windowmanager/backgroundactivity/common/Android.bp b/tests/framework/base/windowmanager/backgroundactivity/common/Android.bp
index 2b54222..ce22274 100644
--- a/tests/framework/base/windowmanager/backgroundactivity/common/Android.bp
+++ b/tests/framework/base/windowmanager/backgroundactivity/common/Android.bp
@@ -13,13 +13,17 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
java_test {
name: "cts-background-activity-common",
- srcs: ["src/**/*.java", "aidl/**/*.aidl"],
+ srcs: [
+ "src/**/*.java",
+ "aidl/**/*.aidl",
+ ],
static_libs: [
"androidx.annotation_annotation",
diff --git a/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingBoundsTests.java b/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingBoundsTests.java
index 86640af..1a94a85 100644
--- a/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingBoundsTests.java
+++ b/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingBoundsTests.java
@@ -21,6 +21,7 @@
import static android.server.wm.jetpack.utils.ActivityEmbeddingUtil.HINGE_SPLIT_ATTRS;
import static android.server.wm.jetpack.utils.ActivityEmbeddingUtil.assertValidSplit;
import static android.server.wm.jetpack.utils.ActivityEmbeddingUtil.createSplitPairRuleBuilder;
+import static android.server.wm.jetpack.utils.ActivityEmbeddingUtil.getTaskBounds;
import static android.server.wm.jetpack.utils.ActivityEmbeddingUtil.startActivityAndVerifySplitAttributes;
import static android.server.wm.jetpack.utils.ActivityEmbeddingUtil.waitAndAssertNotVisible;
import static android.server.wm.jetpack.utils.ActivityEmbeddingUtil.waitAndAssertResumedAndFillsTask;
@@ -28,6 +29,7 @@
import android.app.Activity;
import android.content.Intent;
+import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
import android.server.wm.jetpack.utils.TestActivity;
import android.server.wm.jetpack.utils.TestActivityWithId;
@@ -78,8 +80,9 @@
// Set split pair rule such that if the parent bounds is any smaller than it is now, then
// the parent cannot support a split.
- final int originalTaskWidth = getTaskWidth();
- final int originalTaskHeight = getTaskHeight();
+ final Rect taskBounds = getTaskBounds(primaryActivity, true /* shouldWaitForResume */);
+ final int originalTaskWidth = taskBounds.width();
+ final int originalTaskHeight = taskBounds.height();
final SplitPairRule splitPairRule = createSplitPairRuleBuilder(
activityActivityPair -> true /* activityPairPredicate */,
activityIntentPair -> true /* activityIntentPredicate */,
diff --git a/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingLifecycleTests.java b/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingLifecycleTests.java
index 89ca9ab..150e60e 100644
--- a/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingLifecycleTests.java
+++ b/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingLifecycleTests.java
@@ -60,6 +60,7 @@
import androidx.window.extensions.embedding.SplitInfo;
import androidx.window.extensions.embedding.SplitPairRule;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -524,6 +525,7 @@
* Tests launching a new activity on an ActivityStack with wildcard split rule, new activity
* shows on top.
*/
+ @Ignore("It's only available after Window Manager Extensions vendor API level 5.")
@Test
public void testLaunchActivityInActivityStack() {
// Launch primary activity
diff --git a/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingPlaceholderTests.java b/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingPlaceholderTests.java
index ca3b25c..123135f 100644
--- a/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingPlaceholderTests.java
+++ b/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityEmbeddingPlaceholderTests.java
@@ -23,14 +23,15 @@
import static android.server.wm.jetpack.utils.ActivityEmbeddingUtil.waitAndAssertResumed;
import static android.server.wm.jetpack.utils.ActivityEmbeddingUtil.waitAndAssertResumedAndFillsTask;
import static android.server.wm.jetpack.utils.TestActivityLauncher.KEY_ACTIVITY_ID;
-import static android.view.Surface.ROTATION_0;
import static androidx.window.extensions.embedding.SplitRule.FINISH_NEVER;
import android.app.Activity;
import android.content.Intent;
+import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
-import android.server.wm.RotationSession;
+import android.server.wm.WindowManagerStateHelper;
+import android.server.wm.jetpack.utils.ActivityEmbeddingUtil;
import android.server.wm.jetpack.utils.TestActivity;
import android.server.wm.jetpack.utils.TestActivityWithId;
import android.util.Pair;
@@ -171,40 +172,38 @@
*/
@Test
public void testPlaceholderFinishedWhenTaskWidthDecreased() {
- try (RotationSession rotationSession = new RotationSession()) {
- rotationSession.set(ROTATION_0);
- final int taskWidth = getTaskWidth();
- final int taskHeight = getTaskHeight();
+ final Rect taskBounds = getTaskBounds();
+ final int taskWidth = taskBounds.width();
+ final int taskHeight = taskBounds.height();
- // Set embedding rules with the parent window metrics only allowing side-by-side
- // activities on a task bounds at least the current bounds.
- final SplitPlaceholderRule splitPlaceholderRule =
- new SplitPlaceholderRuleBuilderWithDefaults(PRIMARY_ACTIVITY_ID,
- PLACEHOLDER_ACTIVITY_ID)
- .setParentWindowMetrics(windowMetrics ->
- windowMetrics.getBounds().width() >= taskWidth
- && windowMetrics.getBounds().height() >= taskHeight)
- .build();
- mActivityEmbeddingComponent.setEmbeddingRules(
- Collections.singleton(splitPlaceholderRule));
+ // Set embedding rules with the parent window metrics only allowing side-by-side
+ // activities on a task bounds at least the current bounds.
+ final SplitPlaceholderRule splitPlaceholderRule =
+ new SplitPlaceholderRuleBuilderWithDefaults(PRIMARY_ACTIVITY_ID,
+ PLACEHOLDER_ACTIVITY_ID)
+ .setParentWindowMetrics(windowMetrics ->
+ windowMetrics.getBounds().width() >= taskWidth
+ && windowMetrics.getBounds().height() >= taskHeight)
+ .build();
+ mActivityEmbeddingComponent.setEmbeddingRules(
+ Collections.singleton(splitPlaceholderRule));
- // Launch activity with placeholder
- final Pair<Activity, Activity> activityPair =
- launchActivityWithPlaceholderAndVerifySplit(
- PRIMARY_ACTIVITY_ID, PLACEHOLDER_ACTIVITY_ID, splitPlaceholderRule);
- final TestActivity primaryActivity = (TestActivity) activityPair.first;
- final Activity placeholderActivity = activityPair.second;
+ // Launch activity with placeholder
+ final Pair<Activity, Activity> activityPair =
+ launchActivityWithPlaceholderAndVerifySplit(
+ PRIMARY_ACTIVITY_ID, PLACEHOLDER_ACTIVITY_ID, splitPlaceholderRule);
+ final TestActivity primaryActivity = (TestActivity) activityPair.first;
+ final Activity placeholderActivity = activityPair.second;
- // Shrink display size by 10% so that the primary and placeholder activities are stacked
- final Size currentSize = mReportedDisplayMetrics.getSize();
- mReportedDisplayMetrics.setSize(new Size((int) (currentSize.getWidth() * 0.9),
- (int) (currentSize.getHeight() * 0.9)));
+ // Shrink display size by 10% so that the primary and placeholder activities are stacked
+ final Size currentSize = mReportedDisplayMetrics.getSize();
+ mReportedDisplayMetrics.setSize(new Size((int) (currentSize.getWidth() * 0.9),
+ (int) (currentSize.getHeight() * 0.9)));
- // Verify that the placeholder activity was finished and that the primary activity now
- // fills the task.
- waitAndAssertFinishing(placeholderActivity);
- waitAndAssertResumedAndFillsTask(primaryActivity);
- }
+ // Verify that the placeholder activity was finished and that the primary activity now
+ // fills the task.
+ waitAndAssertFinishing(placeholderActivity);
+ waitAndAssertResumedAndFillsTask(primaryActivity);
}
/**
@@ -213,50 +212,47 @@
*/
@Test
public void testPlaceholderLaunchedWhenTaskWidthIncreased() {
- try (RotationSession rotationSession = new RotationSession()) {
- rotationSession.set(ROTATION_0);
+ // Reduce display size by 50% so that display size won't exceed the maximum display
+ // size during the test.
+ final Size currentSize = mReportedDisplayMetrics.getSize();
+ final Size displaySize = new Size((int) (currentSize.getWidth() * 0.5),
+ (int) (currentSize.getHeight() * 0.5));
+ mReportedDisplayMetrics.setSize(displaySize);
- // Reduce display size by 50% so that display size won't exceed the maximum display
- // size during the test.
- final Size currentSize = mReportedDisplayMetrics.getSize();
- final Size displaySize = new Size((int) (currentSize.getWidth() * 0.5),
- (int) (currentSize.getHeight() * 0.5));
- mReportedDisplayMetrics.setSize(displaySize);
+ final Rect taskBounds = getTaskBounds();
+ final double splitTaskWidth = taskBounds.width() * 1.05;
+ final double splitTaskHeight = taskBounds.height() * 1.05;
- final double splitTaskWidth = getTaskWidth() * 1.05;
- final double splitTaskHeight = getTaskHeight() * 1.05;
+ // Set embedding rules with the parent window metrics only allowing side-by-side
+ // activities on a task bounds 5% larger than the current task bounds.
+ final SplitPlaceholderRule splitPlaceholderRule =
+ new SplitPlaceholderRuleBuilderWithDefaults(PRIMARY_ACTIVITY_ID,
+ PLACEHOLDER_ACTIVITY_ID)
+ .setParentWindowMetrics(windowMetrics ->
+ windowMetrics.getBounds().width() >= splitTaskWidth
+ && windowMetrics.getBounds().height()
+ >= splitTaskHeight)
+ .build();
+ mActivityEmbeddingComponent.setEmbeddingRules(
+ Collections.singleton(splitPlaceholderRule));
- // Set embedding rules with the parent window metrics only allowing side-by-side
- // activities on a task bounds 5% larger than the current task bounds.
- final SplitPlaceholderRule splitPlaceholderRule =
- new SplitPlaceholderRuleBuilderWithDefaults(PRIMARY_ACTIVITY_ID,
- PLACEHOLDER_ACTIVITY_ID)
- .setParentWindowMetrics(windowMetrics ->
- windowMetrics.getBounds().width() >= splitTaskWidth
- && windowMetrics.getBounds().height()
- >= splitTaskHeight)
- .build();
- mActivityEmbeddingComponent.setEmbeddingRules(
- Collections.singleton(splitPlaceholderRule));
+ // Launch activity and verify that it fills the task and that a placeholder activity is
+ // not launched
+ Activity primaryActivity = startFullScreenActivityNewTask(TestActivityWithId.class,
+ PRIMARY_ACTIVITY_ID);
+ waitAndAssertResumedAndFillsTask(primaryActivity);
+ waitAndAssertNotResumed(PLACEHOLDER_ACTIVITY_ID);
- // Launch activity and verify that it fills the task and that a placeholder activity is
- // not launched
- Activity primaryActivity = startFullScreenActivityNewTask(TestActivityWithId.class,
- PRIMARY_ACTIVITY_ID);
- waitAndAssertResumedAndFillsTask(primaryActivity);
- waitAndAssertNotResumed(PLACEHOLDER_ACTIVITY_ID);
+ // Increase display size by 10% so that the primary and placeholder activities are
+ // stacked
+ mReportedDisplayMetrics.setSize(new Size((int) (displaySize.getWidth() * 1.1),
+ (int) (displaySize.getHeight() * 1.1)));
- // Increase display size by 10% so that the primary and placeholder activities are
- // stacked
- mReportedDisplayMetrics.setSize(new Size((int) (displaySize.getWidth() * 1.1),
- (int) (displaySize.getHeight() * 1.1)));
-
- // Verify that the placeholder activity is launched into a split with the primary
- // activity
- waitAndAssertResumed(PLACEHOLDER_ACTIVITY_ID);
- Activity placeholderActivity = getResumedActivityById(PLACEHOLDER_ACTIVITY_ID);
- assertValidSplit(primaryActivity, placeholderActivity, splitPlaceholderRule);
- }
+ // Verify that the placeholder activity is launched into a split with the primary
+ // activity
+ waitAndAssertResumed(PLACEHOLDER_ACTIVITY_ID);
+ Activity placeholderActivity = getResumedActivityById(PLACEHOLDER_ACTIVITY_ID);
+ assertValidSplit(primaryActivity, placeholderActivity, splitPlaceholderRule);
}
/**
@@ -266,39 +262,37 @@
*/
@Test
public void testStickyPlaceholder() {
- try (RotationSession rotationSession = new RotationSession()) {
- rotationSession.set(ROTATION_0);
- final int taskWidth = getTaskWidth();
- final int taskHeight = getTaskHeight();
+ final Rect taskBounds = getTaskBounds();
+ final int taskWidth = taskBounds.width();
+ final int taskHeight = taskBounds.height();
- // Set embedding rules with isSticky set to true and the parent window metrics only
- // allowing side-by-side activities on a task width at least the current width.
- final SplitPlaceholderRule splitPlaceholderRule =
- new SplitPlaceholderRuleBuilderWithDefaults(PRIMARY_ACTIVITY_ID,
- PLACEHOLDER_ACTIVITY_ID).setIsSticky(true)
- .setParentWindowMetrics(windowMetrics ->
- windowMetrics.getBounds().width() >= taskWidth
- && windowMetrics.getBounds().height() >= taskHeight)
- .build();
- mActivityEmbeddingComponent.setEmbeddingRules(
- Collections.singleton(splitPlaceholderRule));
+ // Set embedding rules with isSticky set to true and the parent window metrics only
+ // allowing side-by-side activities on a task width at least the current width.
+ final SplitPlaceholderRule splitPlaceholderRule =
+ new SplitPlaceholderRuleBuilderWithDefaults(PRIMARY_ACTIVITY_ID,
+ PLACEHOLDER_ACTIVITY_ID).setIsSticky(true)
+ .setParentWindowMetrics(windowMetrics ->
+ windowMetrics.getBounds().width() >= taskWidth
+ && windowMetrics.getBounds().height() >= taskHeight)
+ .build();
+ mActivityEmbeddingComponent.setEmbeddingRules(
+ Collections.singleton(splitPlaceholderRule));
- // Launch activity with placeholder
- final Pair<Activity, Activity> activityPair =
- launchActivityWithPlaceholderAndVerifySplit(
- PRIMARY_ACTIVITY_ID, PLACEHOLDER_ACTIVITY_ID, splitPlaceholderRule);
- final TestActivity placeholderActivity = (TestActivity) activityPair.second;
+ // Launch activity with placeholder
+ final Pair<Activity, Activity> activityPair =
+ launchActivityWithPlaceholderAndVerifySplit(
+ PRIMARY_ACTIVITY_ID, PLACEHOLDER_ACTIVITY_ID, splitPlaceholderRule);
+ final TestActivity placeholderActivity = (TestActivity) activityPair.second;
- // Shrink display width by 10% so that the primary and placeholder activities are
- // stacked
- final Size currentSize = mReportedDisplayMetrics.getSize();
- mReportedDisplayMetrics.setSize(new Size((int) (currentSize.getWidth() * 0.9),
- (int) (currentSize.getHeight() * 0.9)));
+ // Shrink display width by 10% so that the primary and placeholder activities are
+ // stacked
+ final Size currentSize = mReportedDisplayMetrics.getSize();
+ mReportedDisplayMetrics.setSize(new Size((int) (currentSize.getWidth() * 0.9),
+ (int) (currentSize.getHeight() * 0.9)));
- // Verify that the placeholder was not finished and fills the task
- waitAndAssertResumedAndFillsTask(placeholderActivity);
- waitAndAssertResumed(Arrays.asList(placeholderActivity));
- }
+ // Verify that the placeholder was not finished and fills the task
+ waitAndAssertResumedAndFillsTask(placeholderActivity);
+ waitAndAssertResumed(Arrays.asList(placeholderActivity));
}
/**
@@ -389,4 +383,15 @@
assertValidSplit(primaryActivity, placeholderActivity, splitPlaceholderRule);
return new Pair<>(primaryActivity, placeholderActivity);
}
+
+ @NonNull
+ private Rect getTaskBounds() {
+ final Activity activity = startFullScreenActivityNewTask(TestActivity.class);
+ final Rect taskBounds = ActivityEmbeddingUtil
+ .getTaskBounds(activity, true /* shouldWaitForResume */);
+ activity.finish();
+ new WindowManagerStateHelper().waitAndAssertActivityRemoved(activity.getComponentName());
+
+ return taskBounds;
+ }
}
diff --git a/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityStackApisTests.java b/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityStackApisTests.java
index 22f0f4b..58b6199 100644
--- a/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityStackApisTests.java
+++ b/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/embedding/ActivityStackApisTests.java
@@ -42,6 +42,7 @@
import com.android.compatibility.common.util.ApiTest;
+import org.junit.Ignore;
import org.junit.Test;
import java.util.Collections;
@@ -56,6 +57,7 @@
* Build/Install/Run:
* atest CtsWindowManagerJetpackTestCases:ActivityStackApisTests
*/
+@Ignore("It's only available after Window Manager Extensions vendor API level 5.")
public class ActivityStackApisTests extends ActivityEmbeddingTestBase {
@ApiTest(apis = {"androidx.window.extensions.embedding.ActivityEmbeddingComponent"
+ "#finishActivityStacks"})
diff --git a/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/utils/ActivityEmbeddingUtil.java b/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/utils/ActivityEmbeddingUtil.java
index 1db3e89..8e61928 100644
--- a/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/utils/ActivityEmbeddingUtil.java
+++ b/tests/framework/base/windowmanager/jetpack/src/android/server/wm/jetpack/utils/ActivityEmbeddingUtil.java
@@ -390,9 +390,12 @@
}
@NonNull
- private static Rect getTaskBounds(@NonNull Activity activity, boolean shouldWaitForResume) {
+ public static Rect getTaskBounds(@NonNull Activity activity, boolean shouldWaitForResume) {
final WindowManagerStateHelper wmState = new WindowManagerStateHelper();
final ComponentName activityName = activity.getComponentName();
+ // Wait for display idle before getting the task bounds since the display may be still
+ // resizing.
+ wmState.waitForAppTransitionIdleOnDisplay(activity.getDisplayId());
if (shouldWaitForResume) {
wmState.waitAndAssertActivityState(activityName, STATE_RESUMED);
} else {
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/ActivityTransitionTests.java b/tests/framework/base/windowmanager/src/android/server/wm/ActivityTransitionTests.java
index 42f634e..acdff14 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/ActivityTransitionTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/ActivityTransitionTests.java
@@ -27,14 +27,14 @@
import static android.server.wm.ActivityTransitionTests.EdgeExtensionActivity.TOP;
import static android.server.wm.app.Components.TEST_ACTIVITY;
import static android.view.Display.DEFAULT_DISPLAY;
-import static android.view.RoundedCorner.POSITION_BOTTOM_LEFT;
import static android.view.RoundedCorner.POSITION_BOTTOM_RIGHT;
import static android.view.RoundedCorner.POSITION_TOP_LEFT;
-import static android.view.RoundedCorner.POSITION_TOP_RIGHT;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
+import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeFalse;
import android.app.Activity;
import android.app.ActivityOptions;
@@ -73,7 +73,6 @@
import org.junit.Test;
import org.junit.rules.TestRule;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -279,6 +278,11 @@
*/
@Test
public void testAnimationBackgroundColorIsUsedDuringActivityTransition() {
+ // TODO (b/319637823): Find proper fix for background overriding in ActivityTransitionTests
+ // This test expects the default task display area to show a red color during the
+ // transition. But since in auto split screen UI, the launcher activity is always
+ // shown, no screenshot of the test would return the red background color.
+ assumeFalse(hasAutomotiveSplitscreenMultitaskingFeature());
final int backgroundColor = Color.RED;
final ActivityOptions activityOptions = ActivityOptions.makeCustomAnimation(mContext,
R.anim.alpha_0_with_red_backdrop, R.anim.alpha_0_with_red_backdrop);
@@ -296,6 +300,11 @@
*/
@Test
public void testCustomTransitionCanOverrideBackgroundColor() {
+ // TODO (b/319637823): Find proper fix for background overriding in ActivityTransitionTests
+ // This test expects the default task display area to show a green color during the
+ // transition. But since in auto split screen UI, the launcher activity is always
+ // shown, no screenshot of the test would return the green background color.
+ assumeFalse(hasAutomotiveSplitscreenMultitaskingFeature());
final int backgroundColor = Color.GREEN;
final ActivityOptions activityOptions = ActivityOptions.makeCustomAnimation(mContext,
R.anim.alpha_0_with_backdrop, R.anim.alpha_0_with_backdrop, backgroundColor
@@ -314,6 +323,11 @@
*/
@Test
public void testPendingTransitionCanOverrideBackgroundColor() {
+ // TODO (b/319637823): Find proper fix for background overriding in ActivityTransitionTests
+ // This test expects the default task display area to show a green color during the
+ // transition. But since in auto split screen UI, the launcher activity is always
+ // shown, no screenshot of the test would return the green background color.
+ assumeFalse(hasAutomotiveSplitscreenMultitaskingFeature());
final int backgroundColor = Color.GREEN;
final Bundle extras = new Bundle();
@@ -330,6 +344,11 @@
@Test
public void testSetTransitionCanOverrideBackgroundColor() {
+ // TODO (b/319637823): Find proper fix for background overriding in ActivityTransitionTests
+ // This test expects the default task display area to show a green color during the
+ // transition. But since in auto split screen UI, the launcher activity is always
+ // shown, no screenshot of the test would return the green background color.
+ assumeFalse(hasAutomotiveSplitscreenMultitaskingFeature());
final int backgroundColor = Color.GREEN;
final Bundle extras = new Bundle();
@@ -368,8 +387,9 @@
extras.putInt(DIRECTION_KEY, LEFT);
addTestMethodToExtras(TEST_METHOD_OVERRIDE_PENDING_TRANSITION, 0, extras);
final TestBounds testBounds = getTestBounds();
- final Rect appBounds = testBounds.appBounds;
- final int xIndex = appBounds.left + (appBounds.right - appBounds.left) * 3 / 4;
+ final Rect transitionBounds = testBounds.transitionBounds;
+ final int xIndex = transitionBounds.left
+ + (transitionBounds.right - transitionBounds.left) * 3 / 4;
getTestBuilder().setClass(EdgeExtensionActivity.class).setExtras(extras)
.setTestFunction(createAssertColorChangeXIndex(xIndex, testBounds))
.run();
@@ -394,8 +414,8 @@
extras.putInt(DIRECTION_KEY, TOP);
addTestMethodToExtras(TEST_METHOD_OVERRIDE_PENDING_TRANSITION, 0, extras);
final TestBounds testBounds = getTestBounds();
- final Rect appBounds = testBounds.appBounds;
- final int xIndex = (appBounds.left + appBounds.right) / 2;
+ final Rect transitionBounds = testBounds.transitionBounds;
+ final int xIndex = (transitionBounds.left + transitionBounds.right) / 2;
getTestBuilder().setClass(EdgeExtensionActivity.class).setExtras(extras)
.setTestFunction(createAssertColorChangeXIndex(xIndex, testBounds))
.run();
@@ -419,8 +439,9 @@
extras.putInt(DIRECTION_KEY, RIGHT);
addTestMethodToExtras(TEST_METHOD_OVERRIDE_PENDING_TRANSITION, 0, extras);
final TestBounds testBounds = getTestBounds();
- final Rect appBounds = testBounds.appBounds;
- final int xIndex = appBounds.left + (appBounds.right - appBounds.left) / 4;
+ final Rect transitionBounds = testBounds.transitionBounds;
+ final int xIndex = transitionBounds.left
+ + (transitionBounds.right - transitionBounds.left) / 4;
getTestBuilder().setClass(EdgeExtensionActivity.class).setExtras(extras)
.setTestFunction(createAssertColorChangeXIndex(xIndex, testBounds))
.run();
@@ -437,8 +458,9 @@
addTestMethodToExtras(TEST_METHOD_OVERRIDE_ACTIVITY_TRANSITION,
TRANSITION_TYPE_OPEN | TRANSITION_TYPE_CLOSE, extras);
final TestBounds testBounds = getTestBounds();
- final Rect appBounds = testBounds.appBounds;
- final int xIndex = appBounds.left + (appBounds.right - appBounds.left) / 4;
+ final Rect transitionBounds = testBounds.transitionBounds;
+ final int xIndex = transitionBounds.left
+ + (transitionBounds.right - transitionBounds.left) / 4;
getTestBuilder().setClass(EdgeExtensionActivity.class).setExtras(extras)
.setTestFunction(createAssertColorChangeXIndex(xIndex, testBounds))
.run();
@@ -459,8 +481,6 @@
addTestMethodToExtras(TEST_METHOD_OVERRIDE_ACTIVITY_TRANSITION,
TRANSITION_TYPE_OPEN | TRANSITION_TYPE_CLOSE, extras);
final TestBounds testBounds = getTestBounds();
- final Rect appBounds = testBounds.appBounds;
- final int xIndex = appBounds.left + (appBounds.right - appBounds.left) / 4;
final LauncherActivity launcherActivity = startLauncherActivity();
launcherActivity.startActivity(null, EdgeExtensionActivity.class, extras);
@@ -493,8 +513,8 @@
extras.putInt(DIRECTION_KEY, BOTTOM);
addTestMethodToExtras(TEST_METHOD_OVERRIDE_PENDING_TRANSITION, 0, extras);
final TestBounds testBounds = getTestBounds();
- final Rect appBounds = testBounds.appBounds;
- final int xIndex = (appBounds.left + appBounds.right) / 2;
+ final Rect transitionBounds = testBounds.transitionBounds;
+ final int xIndex = (transitionBounds.left + transitionBounds.right) / 2;
getTestBuilder().setClass(EdgeExtensionActivity.class).setExtras(extras)
.setTestFunction(createAssertColorChangeXIndex(xIndex, testBounds))
.run();
@@ -539,16 +559,14 @@
private static class TestBounds {
public Rect rect;
- public Rect appBounds;
- public ArrayList<Rect> excluded;
+ public Rect transitionBounds;
}
private TestBounds getTestBounds() {
final LauncherActivity activity = startLauncherActivity();
final TestBounds bounds = new TestBounds();
- bounds.rect = activity.getActivityFullyVisibleRegion();
- bounds.appBounds = getTopAppBounds();
- bounds.excluded = activity.getRoundedCornersRegions();
+ bounds.rect = activity.getActivityTestableRegion();
+ bounds.transitionBounds = getTransitionAppBounds();
launchHomeActivityNoWait();
removeRootTasksWithActivityTypes(ALL_ACTIVITY_TYPE_BUT_HOME);
mWmState.waitForAppTransitionIdleOnDisplay(DEFAULT_DISPLAY);
@@ -635,10 +653,6 @@
for (int x = testBounds.rect.left; x < testBounds.rect.right; x++) {
for (int y = testBounds.rect.top;
y < testBounds.rect.bottom; y++) {
- if (rectsContain(testBounds.excluded, x, y)) {
- continue;
- }
-
final Color rawColor = screen.getColor(x, y);
final Color sRgbColor;
if (!rawColor.getColorSpace().equals(ColorSpace.get(ColorSpace.Named.SRGB))) {
@@ -679,11 +693,11 @@
return false;
}
- private Rect getTopAppBounds() {
+ private Rect getTransitionAppBounds() {
getWmState().computeState();
final WindowManagerState.Activity activity = getWmState().getActivity(
ComponentName.unflattenFromString(getWmState().getFocusedActivity()));
- return activity.getAppBounds();
+ return activity.getBounds();
}
private static class AssertionResult {
@@ -733,10 +747,6 @@
for (int x = testBounds.rect.left; x < testBounds.rect.right; x++) {
for (int y = testBounds.rect.top;
y < testBounds.rect.bottom; y++) {
- if (rectsContain(testBounds.excluded, x, y)) {
- continue;
- }
-
// Edge pixels can have any color depending on the blending strategy of the device.
if (Math.abs(x - xIndex) <= 1) {
continue;
@@ -786,6 +796,8 @@
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ getWindow().getAttributes().layoutInDisplayCutoutMode =
+ LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
// Ensure the activity is edge-to-edge
// In tests we rely on the activity's content filling the entire window
getWindow().setDecorFitsSystemWindows(false);
@@ -797,53 +809,41 @@
setContentView(view);
}
- private Rect getActivityFullyVisibleRegion() {
+ private Rect getActivityTestableRegion() {
final Rect activityBounds = getWindowManager().getCurrentWindowMetrics().getBounds();
final Insets insets = mInsets.getInsets(WindowInsets.Type.systemBars()
| WindowInsets.Type.displayCutout());
activityBounds.inset(insets);
-
+ cropRoundedCornersRegions(activityBounds);
return new Rect(activityBounds);
}
- private ArrayList<Rect> getRoundedCornersRegions() {
- RoundedCorner topRightCorner = mInsets.getRoundedCorner(POSITION_TOP_RIGHT);
+ private void cropRoundedCornersRegions(Rect activityBounds) {
RoundedCorner topLeftCorner = mInsets.getRoundedCorner(POSITION_TOP_LEFT);
RoundedCorner bottomRightCorner = mInsets.getRoundedCorner(POSITION_BOTTOM_RIGHT);
- RoundedCorner bottomLeftCorner = mInsets.getRoundedCorner(POSITION_BOTTOM_LEFT);
- final ArrayList<Rect> roundedCornersRects = new ArrayList<>();
+ final Rect innerRectangle = new Rect(activityBounds);
+ // There will be no testable region if the radius of rounded corner equals to the
+ // center of screen on a circle shape display. So instead of ignore rounded corner
+ // areas, consider the internal rectangle of rounded corner region as testable region.
+ // Where radius * cosine(45) == the projected length to x and y direction.
+ final double projectionConst = Math.cos(45);
- if (topRightCorner != null) {
- final Point center = topRightCorner.getCenter();
- final int radius = topRightCorner.getRadius();
- roundedCornersRects.add(
- new Rect(center.x, center.y - radius,
- center.x + radius, center.y));
- }
if (topLeftCorner != null) {
final Point center = topLeftCorner.getCenter();
final int radius = topLeftCorner.getRadius();
- roundedCornersRects.add(
- new Rect(center.x - radius, center.y - radius,
- center.x, center.y));
+ final double projectLength = Math.ceil(radius * projectionConst);
+ innerRectangle.left = center.x - (int) projectLength;
+ innerRectangle.top = center.y - (int) projectLength;
}
if (bottomRightCorner != null) {
final Point center = bottomRightCorner.getCenter();
final int radius = bottomRightCorner.getRadius();
- roundedCornersRects.add(
- new Rect(center.x, center.y,
- center.x + radius, center.y + radius));
+ final double projectLength = Math.ceil(radius * projectionConst);
+ innerRectangle.right = center.x + (int) projectLength;
+ innerRectangle.bottom = center.y + (int) projectLength;
}
- if (bottomLeftCorner != null) {
- final Point center = bottomLeftCorner.getCenter();
- final int radius = bottomLeftCorner.getRadius();
- roundedCornersRects.add(
- new Rect(center.x - radius, center.y,
- center.x, center.y + radius));
- }
-
- return roundedCornersRects;
+ activityBounds.setIntersect(activityBounds, innerRectangle);
}
public void startActivity(ActivityOptions activityOptions, Class<?> klass) {
@@ -952,6 +952,8 @@
super.onCreate(savedInstanceState);
setContentView(R.layout.vertical_color_split);
+ getWindow().getAttributes().layoutInDisplayCutoutMode =
+ LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
// Ensure the activity is edge-to-edge
// In tests we rely on the activity's content filling the entire window
getWindow().setDecorFitsSystemWindows(false);
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/ActivityVisibilityTests.java b/tests/framework/base/windowmanager/src/android/server/wm/ActivityVisibilityTests.java
index c255eab..069ad28 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/ActivityVisibilityTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/ActivityVisibilityTests.java
@@ -58,6 +58,7 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
+import static org.junit.Assume.assumeFalse;
import android.content.ComponentName;
import android.platform.test.annotations.Presubmit;
@@ -749,7 +750,7 @@
@Test
public void testTurnScreenOnSingleTask() {
assumeTrue(supportsLockScreen());
-
+ assumeFalse(isCar() && supportsMultiDisplay());
final LockScreenSession lockScreenSession = createManagedLockScreenSession();
lockScreenSession.sleepDevice();
separateTestJournal();
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/BlurTests.java b/tests/framework/base/windowmanager/src/android/server/wm/BlurTests.java
index 5f0f9fb..5c49a60 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/BlurTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/BlurTests.java
@@ -71,6 +71,11 @@
Settings.Global::getInt,
Settings.Global::putInt,
0);
+ private final TestRule mDisableTransitionAnimationRule = SettingsSession.overrideForTest(
+ Settings.Global.getUriFor(Settings.Global.TRANSITION_ANIMATION_SCALE),
+ Settings.Global::getFloat,
+ Settings.Global::putFloat,
+ 0f);
private final ActivityTestRule<BackgroundActivity> mBackgroundActivity =
new ActivityTestRule<>(BackgroundActivity.class);
@@ -78,6 +83,7 @@
@Rule
public final TestRule methodRules = RuleChain.outerRule(mDumpOnFailure)
.around(mEnableBlurRule)
+ .around(mDisableTransitionAnimationRule)
.around(mBackgroundActivity);
@Before
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/DragDropTest.java b/tests/framework/base/windowmanager/src/android/server/wm/DragDropTest.java
index 4ae4604..b2dff9a 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/DragDropTest.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/DragDropTest.java
@@ -339,6 +339,7 @@
assumeFalse(isWatchDevice());
UiAutomatorUtils.getUiDevice().waitForIdle();
mActivity = startActivityInWindowingMode(DragDropActivity.class, WINDOWING_MODE_FULLSCREEN);
+ mWmState.waitUntilActivityReadyForInputInjection(mActivity, TAG, "test: " + TAG);
mStartReceived = new CountDownLatch(1);
mEndReceived = new CountDownLatch(1);
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/LocationOnScreenTests.java b/tests/framework/base/windowmanager/src/android/server/wm/LocationOnScreenTests.java
index b7b8376..40cb346 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/LocationOnScreenTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/LocationOnScreenTests.java
@@ -16,6 +16,7 @@
package android.server.wm;
+import static android.server.wm.CtsWindowInfoUtils.waitForStableWindowGeometry;
import static android.server.wm.LocationOnScreenTests.TestActivity.COLOR_TOLERANCE;
import static android.server.wm.LocationOnScreenTests.TestActivity.EXTRA_LAYOUT_PARAMS;
import static android.server.wm.LocationOnScreenTests.TestActivity.TEST_COLOR_1;
@@ -28,6 +29,8 @@
import static androidx.test.InstrumentationRegistry.getInstrumentation;
+import static junit.framework.Assert.assertTrue;
+
import static org.hamcrest.Matchers.is;
import android.app.Activity;
@@ -48,7 +51,6 @@
import android.view.WindowManager.LayoutParams;
import android.widget.FrameLayout;
-import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
@@ -63,6 +65,7 @@
import org.junit.Test;
import org.junit.rules.ErrorCollector;
+import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
@SmallTest
@@ -81,11 +84,13 @@
private Context mContext;
@Before
- public void setUp() {
+ public void setUp() throws InterruptedException {
mContext = getInstrumentation().getContext();
mLayoutParams = new LayoutParams(MATCH_PARENT, MATCH_PARENT, LayoutParams.TYPE_APPLICATION,
LayoutParams.FLAG_LAYOUT_IN_SCREEN | LayoutParams.FLAG_LAYOUT_INSET_DECOR,
PixelFormat.TRANSLUCENT);
+ assertTrue("Failed to reach stable window geometry",
+ waitForStableWindowGeometry(5, TimeUnit.SECONDS));
}
@Test
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/StartActivityTests.java b/tests/framework/base/windowmanager/src/android/server/wm/StartActivityTests.java
index 83f04b8..bd241e3 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/StartActivityTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/StartActivityTests.java
@@ -315,10 +315,9 @@
if (useShellPermission) {
waitAndAssertResumedActivity(BROADCAST_RECEIVER_ACTIVITY,
"Activity should be started and resumed");
- if (type == ACTIVITY_TYPE_HOME && isAutomotive(mContext)
- && hasSplitscreenMultitaskingFeature(mContext)) {
- // For automotive devices with splitscreen multitasking, home activity might
- // not be in front of the stack, hence, check for its visibility instead.
+ if (type == ACTIVITY_TYPE_HOME && isAutomotive(mContext)) {
+ // For automotive devices, home activity might not be in front of the stack,
+ // hence, check for its visibility instead.
mWmState.assertHomeActivityVisible(/* visible= */ true);
} else {
mWmState.assertFrontStackActivityType(
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsControllerTests.java b/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsControllerTests.java
index 955af40..42a8d3c 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsControllerTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsControllerTests.java
@@ -63,6 +63,7 @@
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
+import android.graphics.Insets;
import android.os.Bundle;
import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
@@ -313,6 +314,8 @@
// Assume we have the bars and they can be visible.
final int types = statusBars();
assumeTrue(rootView.getRootWindowInsets().isVisible(types));
+ // Get insets before hiding them.
+ final Insets insets = rootView.getRootWindowInsets().getInsets(types);
rootView.getWindowInsetsController().setSystemBarsBehavior(BEHAVIOR_DEFAULT);
@@ -326,8 +329,8 @@
// dragFromTopToCenter might expand notification shade.
SystemClock.sleep(TIMEOUT_UPDATING_INPUT_WINDOW);
- // Swiping from top of display can show bars.
- dragFromTopToCenter(rootView);
+ // Swiping from edge of screen can show bars. Here edge can be top, bottom, right & left.
+ swipeFromEdgeOfScreen(insets, rootView);
PollingCheck.waitFor(TIMEOUT, () -> rootView.getRootWindowInsets().isVisible(types));
}
@@ -504,6 +507,8 @@
// Assume we have the bars and they can be visible.
final int types = statusBars();
assumeTrue(rootView.getRootWindowInsets().isVisible(types));
+ // Get insets before hiding them.
+ final Insets insets = rootView.getRootWindowInsets().getInsets(types);
final int targetFlags = SYSTEM_UI_FLAG_IMMERSIVE | SYSTEM_UI_FLAG_FULLSCREEN;
@@ -522,7 +527,8 @@
// Swiping from top of display can show bars.
ANIMATION_CALLBACK.reset();
- dragFromTopToCenter(rootView);
+ // Swiping from edge of screen can show bars. Here edge can be top, bottom, right & left.
+ swipeFromEdgeOfScreen(insets, rootView);
ANIMATION_CALLBACK.waitForFinishing();
PollingCheck.waitFor(TIMEOUT, () -> rootView.getRootWindowInsets().isVisible(types)
&& rootView.getSystemUiVisibility() != targetFlags);
@@ -542,7 +548,8 @@
// Swiping from top of display can show bars.
ANIMATION_CALLBACK.reset();
- dragFromTopToCenter(rootView);
+ // Swiping from edge of screen can show bars. Here edge can be top, bottom, right & left.
+ swipeFromEdgeOfScreen(insets, rootView);
ANIMATION_CALLBACK.waitForFinishing();
PollingCheck.waitFor(TIMEOUT, () -> rootView.getRootWindowInsets().isVisible(types));
@@ -867,11 +874,35 @@
dragOnDisplay(x, y, x, y);
}
+ private void swipeFromEdgeOfScreen(Insets insets, View view) {
+ // Using the insets we determine where the insets are positioned.
+ // Based on insets location, swipe is done in the respective direction.
+ if (insets.right > 0) {
+ dragFromRightToCenter(view);
+ } else if (insets.bottom > 0) {
+ dragFromBottomToCenter(view);
+ } else if (insets.left > 0) {
+ dragFromLeftToCenter(view);
+ } else {
+ dragFromTopToCenter(view);
+ }
+ }
+
private void dragFromTopToCenter(View view) {
dragOnDisplay(view.getWidth() / 2f, 0 /* downY */,
view.getWidth() / 2f, view.getHeight() / 2f);
}
+ private void dragFromRightToCenter(View view) {
+ dragOnDisplay(view.getWidth() -1, view.getHeight() / 2f,
+ view.getWidth() / 2f, view.getHeight() / 2f);
+ }
+
+ private void dragFromBottomToCenter(View view) {
+ dragOnDisplay(view.getWidth() / 2f, view.getHeight() -1,
+ view.getWidth() / 2f, view.getHeight() / 2f);
+ }
+
private void dragFromLeftToCenter(View view) {
dragOnDisplay(0 /* downX */, view.getHeight() / 2f,
view.getWidth() / 2f, view.getHeight() / 2f);
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsLayoutTests.java b/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsLayoutTests.java
index 9e6d82f..fbe7d80 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsLayoutTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsLayoutTests.java
@@ -20,7 +20,7 @@
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
-import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
+import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
import static androidx.test.InstrumentationRegistry.getInstrumentation;
@@ -53,7 +53,7 @@
@android.server.wm.annotation.Group2
public class WindowInsetsLayoutTests extends WindowManagerTestBase {
- private final static long TIMEOUT = 1000; // milliseconds
+ private static final long TIMEOUT = 1000; // milliseconds
@Test
public void testSetFitInsetsTypes() {
@@ -76,18 +76,18 @@
private void testSetFitInsetsTypesInner(int types, TestActivity activity) {
getInstrumentation().runOnMainSync(() -> {
- activity.addChildWindow(types, Side.all(), false);
+ activity.addOverlayWindow(types, Side.all(), false);
});
- // Make sure the child window has been laid out.
- final View childWindowRoot = activity.getChildWindowRoot();
- PollingCheck.waitFor(TIMEOUT, () -> childWindowRoot.getWidth() > 0);
+ // Make sure the overlay window has been laid out.
+ final View overlayWindowRoot = activity.getOverlayWindowRoot();
+ PollingCheck.waitFor(TIMEOUT, () -> overlayWindowRoot.getWidth() > 0);
getInstrumentation().runOnMainSync(() -> {
- final WindowInsets windowInsets = childWindowRoot.getRootWindowInsets();
+ final WindowInsets windowInsets = overlayWindowRoot.getRootWindowInsets();
final Insets insets = windowInsets.getInsets(types);
assertEquals(Insets.NONE, insets);
- activity.removeChildWindow();
+ activity.removeOverlayWindow();
});
}
@@ -114,15 +114,15 @@
private void testSetFitInsetsSidesInner(int sides, TestActivity activity) {
final int types = Type.systemBars();
getInstrumentation().runOnMainSync(() -> {
- activity.addChildWindow(types, sides, false);
+ activity.addOverlayWindow(types, sides, false);
});
- // Make sure the child window has been laid out.
- final View childWindowRoot = activity.getChildWindowRoot();
- PollingCheck.waitFor(TIMEOUT, () -> childWindowRoot.getWidth() > 0);
+ // Make sure the overlay window has been laid out.
+ final View overlayWindowRoot = activity.getOverlayWindowRoot();
+ PollingCheck.waitFor(TIMEOUT, () -> overlayWindowRoot.getWidth() > 0);
getInstrumentation().runOnMainSync(() -> {
- final WindowInsets windowInsets = childWindowRoot.getRootWindowInsets();
+ final WindowInsets windowInsets = overlayWindowRoot.getRootWindowInsets();
final Insets insets = windowInsets.getInsets(types);
if ((sides & Side.LEFT) != 0) {
assertEquals(0, insets.left);
@@ -136,7 +136,7 @@
if ((sides & Side.BOTTOM) != 0) {
assertEquals(0, insets.bottom);
}
- activity.removeChildWindow();
+ activity.removeOverlayWindow();
});
}
@@ -157,33 +157,33 @@
getInstrumentation().runOnMainSync(() -> {
activity.assertMatchesWindowBounds();
- activity.addChildWindow(types, sides, false);
+ activity.addOverlayWindow(types, sides, false);
});
- // Make sure the 1st child window has been laid out.
- final View childWindowRoot1 = activity.getChildWindowRoot();
- PollingCheck.waitFor(TIMEOUT, () -> childWindowRoot1.getWidth() > 0);
+ // Make sure the 1st overlay window has been laid out.
+ final View overlayWindowRoot1 = activity.getOverlayWindowRoot();
+ PollingCheck.waitFor(TIMEOUT, () -> overlayWindowRoot1.getWidth() > 0);
getInstrumentation().runOnMainSync(() -> {
- childWindowRoot1.getLocationOnScreen(locationAndSize1);
- locationAndSize1[2] = childWindowRoot1.getWidth();
- locationAndSize1[3] = childWindowRoot1.getHeight();
- activity.removeChildWindow();
+ overlayWindowRoot1.getLocationOnScreen(locationAndSize1);
+ locationAndSize1[2] = overlayWindowRoot1.getWidth();
+ locationAndSize1[3] = overlayWindowRoot1.getHeight();
+ activity.removeOverlayWindow();
mainWindowRoot.getWindowInsetsController().hide(types);
- activity.addChildWindow(types, sides, true);
+ activity.addOverlayWindow(types, sides, true);
});
- // Make sure the 2nd child window has been laid out.
- final View childWindowRoot2 = activity.getChildWindowRoot();
- PollingCheck.waitFor(TIMEOUT, () -> childWindowRoot2.getWidth() > 0);
+ // Make sure the 2nd overlay window has been laid out.
+ final View overlayWindowRoot2 = activity.getOverlayWindowRoot();
+ PollingCheck.waitFor(TIMEOUT, () -> overlayWindowRoot2.getWidth() > 0);
getInstrumentation().runOnMainSync(() -> {
- childWindowRoot2.getLocationOnScreen(locationAndSize2);
- locationAndSize2[2] = childWindowRoot2.getWidth();
- locationAndSize2[3] = childWindowRoot2.getHeight();
- activity.removeChildWindow();
+ overlayWindowRoot2.getLocationOnScreen(locationAndSize2);
+ locationAndSize2[2] = overlayWindowRoot2.getWidth();
+ locationAndSize2[3] = overlayWindowRoot2.getHeight();
+ activity.removeOverlayWindow();
});
for (int i = 0; i < 4; i++) {
@@ -193,7 +193,7 @@
public static class TestActivity extends FocusableActivity {
- private View mChildWindowRoot;
+ private View mOverlayWindowRoot;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -205,9 +205,13 @@
getWindow().setAttributes(lp);
}
- void addChildWindow(int types, int sides, boolean ignoreVis) {
+ void addOverlayWindow(int types, int sides, boolean ignoreVis) {
final WindowManager.LayoutParams attrs = new WindowManager.LayoutParams();
- attrs.type = TYPE_APPLICATION_PANEL;
+ // In targets like automotive portrait UI, when the system bars are hidden, the
+ // system can change the bounds of the app to be fullscreen which can cause issues
+ // with the location. Use TYPE_APPLICATION_OVERLAY so that overlay window always ends
+ // up taking the fullscreen bounds.
+ attrs.type = TYPE_APPLICATION_OVERLAY;
attrs.width = MATCH_PARENT;
attrs.height = MATCH_PARENT;
attrs.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
@@ -215,16 +219,16 @@
attrs.setFitInsetsTypes(types);
attrs.setFitInsetsSides(sides);
attrs.setFitInsetsIgnoringVisibility(ignoreVis);
- mChildWindowRoot = new View(this);
- getWindowManager().addView(mChildWindowRoot, attrs);
+ mOverlayWindowRoot = new View(this);
+ getWindowManager().addView(mOverlayWindowRoot, attrs);
}
- void removeChildWindow() {
- getWindowManager().removeViewImmediate(mChildWindowRoot);
+ void removeOverlayWindow() {
+ getWindowManager().removeViewImmediate(mOverlayWindowRoot);
}
- View getChildWindowRoot() {
- return mChildWindowRoot;
+ View getOverlayWindowRoot() {
+ return mOverlayWindowRoot;
}
void assertMatchesWindowBounds() {
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/WindowMetricsActivityTests.java b/tests/framework/base/windowmanager/src/android/server/wm/WindowMetricsActivityTests.java
index 04b77dd..0266e19 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/WindowMetricsActivityTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/WindowMetricsActivityTests.java
@@ -58,7 +58,7 @@
@Presubmit
@ApiTest(apis = {"android.view.WindowManager#getCurrentWindowMetrics",
"android.view.WindowManager#getMaximumWindowMetrics",
- "android.app.Activity"})
+ "android.app.Activity#getWindowManager"})
public class WindowMetricsActivityTests extends WindowManagerTestBase {
private static final Rect WINDOW_BOUNDS = new Rect(100, 100, 400, 400);
private static final Rect RESIZED_WINDOW_BOUNDS = new Rect(100, 100, 900, 900);
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/WindowMetricsTestHelper.java b/tests/framework/base/windowmanager/src/android/server/wm/WindowMetricsTestHelper.java
index 417c154..14e2c9c 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/WindowMetricsTestHelper.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/WindowMetricsTestHelper.java
@@ -26,6 +26,7 @@
import android.app.Activity;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.Insets;
import android.graphics.Point;
import android.graphics.Rect;
@@ -36,6 +37,10 @@
import android.view.WindowManager;
import android.view.WindowMetrics;
+import androidx.test.core.app.ApplicationProvider;
+
+import com.android.modules.utils.build.SdkLevel;
+
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -103,7 +108,7 @@
// Max window bounds should match either DisplayArea bounds, or current window bounds.
if (maxWindowBoundsSandboxed(displayAreaBounds, maxBounds)) {
final Rect currentBounds = isFreeForm ? currentMetrics.getBounds()
- : getBoundsExcludingNavigationBarAndCutout(currentMetrics);
+ : getBoundsExcludingInsetsTypes(currentMetrics, configExcludedInsetsTypes());
// Max window bounds are sandboxed, so max window bounds and real display size
// should match current window bounds.
assertEquals("Max window size matches current window size, due to sandboxing",
@@ -138,7 +143,7 @@
final DisplayMetrics displayMetrics = new DisplayMetrics();
display.getMetrics(displayMetrics);
final Rect currentBounds = shouldBoundsIncludeInsets ? currentMetrics.getBounds()
- : getBoundsExcludingNavigationBarAndCutout(currentMetrics);
+ : getBoundsExcludingInsetsTypes(currentMetrics, configExcludedInsetsTypes());
assertEquals("Reported display width must match window width",
displayMetrics.widthPixels, currentBounds.width());
assertEquals("Reported display height must match window height",
@@ -158,13 +163,14 @@
realDisplayMetrics.density, currentMetrics.getDensity(), 0.0f);
}
- public static Rect getBoundsExcludingNavigationBarAndCutout(WindowMetrics windowMetrics) {
+ public static Rect getBoundsExcludingInsetsTypes(WindowMetrics windowMetrics,
+ int excludingTypes) {
WindowInsets windowInsets = windowMetrics.getWindowInsets();
- final Insets insetsWithCutout =
- windowInsets.getInsetsIgnoringVisibility(navigationBars() | displayCutout());
+ final Insets excludingInsets =
+ windowInsets.getInsetsIgnoringVisibility(excludingTypes);
final Rect bounds = windowMetrics.getBounds();
- return inset(bounds, insetsWithCutout);
+ return inset(bounds, excludingInsets);
}
/**
@@ -184,6 +190,27 @@
return new Rect(left, top, right, bottom);
}
+ private static int configExcludedInsetsTypes() {
+ // The device owners can choose to decouple the display cutout from the configuration app
+ // bounds to ensure a better experience. Return the legacy value if the decouple config is
+ // not set to true.
+ final int legacyNonDecorTypes = navigationBars() | displayCutout();
+ if (!SdkLevel.isAtLeastU()) {
+ return legacyNonDecorTypes;
+ }
+ try {
+ final boolean isScreenSizeDecoupledFromStatusBarAndCutout =
+ ApplicationProvider.getApplicationContext().getResources().getBoolean(
+ Resources.getSystem().getIdentifier(
+ "config_decoupleStatusBarAndDisplayCutoutFromScreenSize",
+ "bool", "android"));
+ return isScreenSizeDecoupledFromStatusBarAndCutout
+ ? navigationBars() : legacyNonDecorTypes;
+ } catch (Resources.NotFoundException e) {
+ return legacyNonDecorTypes;
+ }
+ }
+
public static class OnLayoutChangeListener implements View.OnLayoutChangeListener {
private final CountDownLatch mLayoutLatch = new CountDownLatch(1);
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/WindowUntrustedTouchTest.java b/tests/framework/base/windowmanager/src/android/server/wm/WindowUntrustedTouchTest.java
index f0c2858..fd1ebeb 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/WindowUntrustedTouchTest.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/WindowUntrustedTouchTest.java
@@ -25,6 +25,7 @@
import static android.server.wm.WindowManagerState.STATE_RESUMED;
import static android.server.wm.overlay.Components.OverlayActivity.EXTRA_TOKEN;
import static android.view.WindowInsets.Type.navigationBars;
+import static android.view.WindowInsets.Type.statusBars;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
@@ -173,7 +174,7 @@
mContainer = mActivity.view;
// On ARC++, text toast is fixed on the screen. Its position may overlays the navigation
// bar. Hide it to ensure the text toast overlays the app. b/191075641
- mContainer.getWindowInsetsController().hide(navigationBars());
+ mContainer.getWindowInsetsController().hide(statusBars() | navigationBars());
mContainer.setOnTouchListener(this::onTouchEvent);
});
mInstrumentation = getInstrumentation();
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/lifecycle/ActivityLifecycleKeyguardTests.java b/tests/framework/base/windowmanager/src/android/server/wm/lifecycle/ActivityLifecycleKeyguardTests.java
index b958cd8..7481c15 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/lifecycle/ActivityLifecycleKeyguardTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/lifecycle/ActivityLifecycleKeyguardTests.java
@@ -35,6 +35,9 @@
import androidx.test.filters.MediumTest;
+import com.android.compatibility.common.util.UiAutomatorUtils2;
+
+import org.junit.Before;
import org.junit.Test;
import java.util.Arrays;
@@ -48,6 +51,12 @@
@Presubmit
@android.server.wm.annotation.Group3
public class ActivityLifecycleKeyguardTests extends ActivityLifecycleClientTestBase {
+ @Before
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ UiAutomatorUtils2.getUiDevice().waitForIdle();
+ }
@Test
public void testSingleLaunch() throws Exception {
diff --git a/tests/framework/base/windowmanager/util/Android.bp b/tests/framework/base/windowmanager/util/Android.bp
index a6f8976..bb0ce31 100644
--- a/tests/framework/base/windowmanager/util/Android.bp
+++ b/tests/framework/base/windowmanager/util/Android.bp
@@ -44,6 +44,7 @@
srcs: [
"src/android/server/wm/Condition.java",
"src/android/server/wm/ComponentNameUtils.java",
+ "src/android/server/wm/CtsWindowInfoUtils.java",
"src/android/server/wm/ProtoExtractors.java",
"src/android/server/wm/StateLogger.java",
"src/android/server/wm/WaitForValidActivityState.java",
diff --git a/tests/framework/base/windowmanager/util/src/android/server/wm/CtsWindowInfoUtils.java b/tests/framework/base/windowmanager/util/src/android/server/wm/CtsWindowInfoUtils.java
index ecf2ee2..fc9447f 100644
--- a/tests/framework/base/windowmanager/util/src/android/server/wm/CtsWindowInfoUtils.java
+++ b/tests/framework/base/windowmanager/util/src/android/server/wm/CtsWindowInfoUtils.java
@@ -43,6 +43,7 @@
import org.junit.rules.TestName;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Set;
import java.util.Timer;
@@ -308,34 +309,39 @@
}
};
- var waitForWindow = new ThrowingRunnable() {
- @Override
- public void run() throws InterruptedException {
- var listener = new WindowInfosListenerForTest();
- try {
- listener.addWindowInfosListener(windowNotOccluded);
- latch.await(timeout, unit);
- } finally {
- listener.removeWindowInfosListener(windowNotOccluded);
- }
+ runWithSurfaceFlingerPermission(() -> {
+ var listener = new WindowInfosListenerForTest();
+ try {
+ listener.addWindowInfosListener(windowNotOccluded);
+ latch.await(timeout, unit);
+ } finally {
+ listener.removeWindowInfosListener(windowNotOccluded);
}
- };
+ });
+
+ return satisfied.get();
+ }
+
+ private interface InterruptableRunnable {
+ void run() throws InterruptedException;
+ };
+
+ private static void runWithSurfaceFlingerPermission(@NonNull InterruptableRunnable runnable)
+ throws InterruptedException {
Set<String> shellPermissions =
InstrumentationRegistry.getInstrumentation().getUiAutomation()
.getAdoptedShellPermissions();
if (shellPermissions.isEmpty()) {
- SystemUtil.runWithShellPermissionIdentity(waitForWindow,
+ SystemUtil.runWithShellPermissionIdentity(runnable::run,
Manifest.permission.ACCESS_SURFACE_FLINGER);
} else if (shellPermissions.contains(Manifest.permission.ACCESS_SURFACE_FLINGER)) {
- waitForWindow.run();
+ runnable.run();
} else {
throw new IllegalStateException(
"waitForWindowOnTop called with adopted shell permissions that don't include "
+ "ACCESS_SURFACE_FLINGER");
}
-
- return satisfied.get();
}
/**
@@ -369,6 +375,76 @@
}
/**
+ * Waits until the set of windows and their geometries are unchanged for 200ms.
+ *
+ * <p>
+ * <strong>Note:</strong>If the caller has any adopted shell permissions, they must include
+ * android.permission.ACCESS_SURFACE_FLINGER.
+ * </p>
+ *
+ * @param timeout The amount of time to wait for the window to be visible.
+ * @param unit The units associated with timeout.
+ * @return True if window geometry becomes stable before the timeout is reached. False
+ * otherwise.
+ */
+ public static boolean waitForStableWindowGeometry(int timeout, @NonNull TimeUnit unit)
+ throws InterruptedException {
+ var latch = new CountDownLatch(1);
+ var satisfied = new AtomicBoolean();
+
+ var timer = new Timer();
+ TimerTask[] task = {null};
+
+ var previousBounds = new HashMap<IBinder, Rect>();
+ var currentBounds = new HashMap<IBinder, Rect>();
+
+ Consumer<List<WindowInfo>> consumer = windowInfos -> {
+ if (satisfied.get()) {
+ return;
+ }
+
+ currentBounds.clear();
+ for (var windowInfo : windowInfos) {
+ currentBounds.put(windowInfo.windowToken, windowInfo.bounds);
+ }
+
+ if (currentBounds.equals(previousBounds)) {
+ // No changes detected. Let the previously scheduled timer task continue.
+ return;
+ }
+
+ previousBounds.clear();
+ previousBounds.putAll(currentBounds);
+
+ // Something has changed. Cancel the previous timer task and schedule a new task
+ // to countdown the latch in 200ms.
+ if (task[0] != null) {
+ task[0].cancel();
+ }
+ task[0] = new TimerTask() {
+ @Override
+ public void run() {
+ satisfied.set(true);
+ latch.countDown();
+ }
+ };
+ timer.schedule(task[0], 200L * HW_TIMEOUT_MULTIPLIER);
+ };
+
+ runWithSurfaceFlingerPermission(() -> {
+ var listener = new WindowInfosListenerForTest();
+ try {
+ listener.addWindowInfosListener(consumer);
+ latch.await(timeout, unit);
+ } finally {
+ listener.removeWindowInfosListener(consumer);
+ }
+ });
+
+ return satisfied.get();
+ }
+
+ /**
* Tap on the center coordinates of the specified window.
* </p>
* @param instrumentation Instrumentation object to use for tap.
@@ -485,11 +561,16 @@
public static void dumpWindowsOnScreen(String tag, TestName testName)
throws InterruptedException {
+ dumpWindowsOnScreen(tag, testName.getMethodName());
+ }
+
+ public static void dumpWindowsOnScreen(String tag, String message)
+ throws InterruptedException {
waitForWindowInfos(windowInfos -> {
if (windowInfos.size() == 0) {
return false;
}
- Log.d(tag, "Dumping windows on screen for test " + testName.getMethodName());
+ Log.d(tag, "Dumping windows on screen for test " + message);
for (var windowInfo : windowInfos) {
Log.d(tag, " " + windowInfo);
}
diff --git a/tests/framework/base/windowmanager/util/src/android/server/wm/WindowManagerState.java b/tests/framework/base/windowmanager/util/src/android/server/wm/WindowManagerState.java
index b6fd395f..c3ce3b4 100644
--- a/tests/framework/base/windowmanager/util/src/android/server/wm/WindowManagerState.java
+++ b/tests/framework/base/windowmanager/util/src/android/server/wm/WindowManagerState.java
@@ -871,7 +871,7 @@
public int getRootTaskIdByActivity(ComponentName activityName) {
final Task rootTask = getRootTaskByActivity(activityName);
- return (rootTask == null) ? INVALID_TASK_ID : rootTask.mTaskId;
+ return (rootTask == null) ? INVALID_TASK_ID : rootTask.mRootTaskId;
}
public Task getTaskByActivity(ComponentName activityName) {
diff --git a/tests/framework/base/windowmanager/util/src/android/server/wm/WindowManagerStateHelper.java b/tests/framework/base/windowmanager/util/src/android/server/wm/WindowManagerStateHelper.java
index b2a8520..26f3764 100644
--- a/tests/framework/base/windowmanager/util/src/android/server/wm/WindowManagerStateHelper.java
+++ b/tests/framework/base/windowmanager/util/src/android/server/wm/WindowManagerStateHelper.java
@@ -44,10 +44,12 @@
import android.content.ComponentName;
import android.graphics.Rect;
import android.util.SparseArray;
+import android.view.InputEvent;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
+import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
@@ -450,6 +452,24 @@
}
/**
+ * Waits until the given activity is ready for input, this is only needed when directly
+ * injecting input on screen via
+ * {@link android.hardware.input.InputManager#injectInputEvent(InputEvent, int)}.
+ */
+ public <T extends android.app.Activity> void waitUntilActivityReadyForInputInjection(T activity,
+ String tag, String windowDumpErrMsg) throws InterruptedException {
+ // If we requested an orientation change, just waiting for the window to be visible is not
+ // sufficient. We should first wait for the transitions to stop, and the for app's UI thread
+ // to process them before making sure the window is visible.
+ CtsWindowInfoUtils.waitForStableWindowGeometry(5, TimeUnit.SECONDS);
+ if (activity.getWindow() != null
+ && !CtsWindowInfoUtils.waitForWindowOnTop(activity.getWindow())) {
+ CtsWindowInfoUtils.dumpWindowsOnScreen(tag, windowDumpErrMsg);
+ fail("Activity window did not become visible: " + activity);
+ }
+ }
+
+ /**
* @return true if should wait for some activities to become visible.
*/
private boolean shouldWaitForActivities(WaitForValidActivityState... waitForActivitiesVisible) {
diff --git a/tests/input/Android.bp b/tests/input/Android.bp
index a390113..57522f1 100644
--- a/tests/input/Android.bp
+++ b/tests/input/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/input/AndroidManifest.xml b/tests/input/AndroidManifest.xml
index b2ffd77..a2b70cd 100644
--- a/tests/input/AndroidManifest.xml
+++ b/tests/input/AndroidManifest.xml
@@ -40,9 +40,12 @@
android:turnScreenOn="true"
android:exported="true">
</activity>
+ <!-- Disable onBackInvokedCallback to allow us to make assertions about
+ the app receiving KEYCODE_BACK. -->
<activity android:name="android.input.cts.CaptureEventActivity"
android:label="Capture events"
android:configChanges="touchscreen|uiMode|orientation|screenSize|screenLayout|keyboardHidden|uiMode|navigation|keyboard|density|fontScale|layoutDirection|locale|mcc|mnc|smallestScreenSize"
+ android:enableOnBackInvokedCallback="false"
android:turnScreenOn="true"
android:exported="true">
</activity>
diff --git a/tests/input/InputInjectionApp/Android.bp b/tests/input/InputInjectionApp/Android.bp
index c83cf74..9d25c05 100644
--- a/tests/input/InputInjectionApp/Android.bp
+++ b/tests/input/InputInjectionApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/input/res/raw/test_keyboard_register.json b/tests/input/res/raw/test_keyboard_register.json
index 044ea0d..c5d7a08 100644
--- a/tests/input/res/raw/test_keyboard_register.json
+++ b/tests/input/res/raw/test_keyboard_register.json
@@ -8,8 +8,8 @@
"bus": "usb",
"configuration":[
{"type": 100, "data": [1]}, // UI_SET_EVBIT : EV_KEY
- // UI_SET_KEYBIT : KEY_Q, KEY_W, KEY_E, KEY_A, KEY_B, KEY_C, KEY_ALT_LEFT, KEY_GRAVE,
+ // UI_SET_KEYBIT : KEY_Q, KEY_W, KEY_E, KEY_A, KEY_B, KEY_C, KEY_ALT_LEFT, KEY_ESC,
// KEY_META_LEFT, KEY_DEL, KEY_DPAD_LEFT
- {"type": 101, "data": [16, 17, 18, 30, 48, 46, 56, 41, 125, 14, 105]}
+ {"type": 101, "data": [16, 17, 18, 30, 48, 46, 56, 1, 125, 14, 105]}
]
}
diff --git a/tests/input/src/android/input/cts/BackKeyShortcutsTest.kt b/tests/input/src/android/input/cts/BackKeyShortcutsTest.kt
index 91f352c..2b5581c 100644
--- a/tests/input/src/android/input/cts/BackKeyShortcutsTest.kt
+++ b/tests/input/src/android/input/cts/BackKeyShortcutsTest.kt
@@ -55,10 +55,10 @@
class BackKeyShortcutsTest {
companion object {
- const val KEY_META_LEFT = 125
- const val KEY_GRAVE = 41
- const val KEY_DEL = 14
- const val KEY_DPAD_LEFT = 105
+ const val KEY_LEFTMETA = 125
+ const val KEY_ESC = 1
+ const val KEY_BACKSPACE = 14
+ const val KEY_LEFT = 105
}
private val instrumentation = InstrumentationRegistry.getInstrumentation()
@@ -93,25 +93,20 @@
@Test
fun testBackKeyMetaShortcuts() {
- val keyboardDevice = UinputDevice.create(
+ UinputDevice.create(
instrumentation, R.raw.test_keyboard_register,
InputDevice.SOURCE_KEYBOARD
- )
+ ).use { keyboardDevice ->
+ activity.assertNoEvents()
- // Wait for device to be added
- PollingCheck.waitFor { inputManager.getInputDevice(keyboardDevice.deviceId) != null }
- activity.assertNoEvents()
+ for (scanCode in intArrayOf(KEY_BACKSPACE, KEY_LEFT)) {
+ injectKeyDown(keyboardDevice, KEY_LEFTMETA)
+ injectKeyDown(keyboardDevice, scanCode)
+ injectKeyUp(keyboardDevice, scanCode)
+ injectKeyUp(keyboardDevice, KEY_LEFTMETA)
- for (scanCode in intArrayOf(KEY_GRAVE, KEY_DEL, KEY_DPAD_LEFT)) {
- injectKeyDown(keyboardDevice, KEY_META_LEFT)
- injectKeyDown(keyboardDevice, scanCode)
- injectKeyUp(keyboardDevice, scanCode)
- injectKeyUp(keyboardDevice, KEY_META_LEFT)
-
- assertReceivedEventsCorrectlyMapped(2, KeyEvent.KEYCODE_BACK)
+ assertReceivedEventsCorrectlyMapped(2, KeyEvent.KEYCODE_BACK)
+ }
}
-
- // Remove the device
- keyboardDevice.close()
}
}
diff --git a/tests/input/src/android/input/cts/MultiTouchTest.kt b/tests/input/src/android/input/cts/MultiTouchTest.kt
index aa493f9..db47fef 100644
--- a/tests/input/src/android/input/cts/MultiTouchTest.kt
+++ b/tests/input/src/android/input/cts/MultiTouchTest.kt
@@ -16,6 +16,7 @@
package android.input.cts
import android.app.ActivityOptions
+import android.content.ComponentName
import android.content.Intent
import android.content.pm.ActivityInfo
import android.graphics.PointF
@@ -38,6 +39,8 @@
private val instrumentation = InstrumentationRegistry.getInstrumentation()
private lateinit var verifier: EventVerifier
private val touchInjector = TouchInjector(instrumentation)
+ private val activityName =
+ ComponentName(instrumentation.targetContext, CaptureEventActivity::class.java)
@JvmField
@Parameterized.Parameter(0)
@@ -54,7 +57,7 @@
fun setUp() {
val bundle = ActivityOptions.makeBasic().setLaunchDisplayId(0).toBundle()
val intent = Intent(Intent.ACTION_VIEW)
- .setClass(instrumentation.targetContext, CaptureEventActivity::class.java)
+ .setComponent(activityName)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
.putExtra(CaptureEventActivity.EXTRA_FIXED_ORIENTATION, orientation)
.putExtra(CaptureEventActivity.EXTRA_WINDOW_FLAGS, flags)
@@ -64,7 +67,10 @@
PollingCheck.waitFor { activity.hasWindowFocus() }
verifier = EventVerifier(activity::getInputEvent)
- WindowManagerStateHelper().waitForAppTransitionIdleOnDisplay(DEFAULT_DISPLAY)
+ val wmState = WindowManagerStateHelper()
+ wmState.waitForAppTransitionIdleOnDisplay(DEFAULT_DISPLAY)
+ wmState.waitForActivityOrientation(activityName, orientation)
+
instrumentation.uiAutomation.syncInputTransactions()
instrumentation.waitForIdleSync()
}
diff --git a/tests/inputmethod/Android.bp b/tests/inputmethod/Android.bp
index 6aea19a..318ec62 100644
--- a/tests/inputmethod/Android.bp
+++ b/tests/inputmethod/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/hiddenfrompickerime/Android.bp b/tests/inputmethod/hiddenfrompickerime/Android.bp
index 155cc6a..845fd65 100644
--- a/tests/inputmethod/hiddenfrompickerime/Android.bp
+++ b/tests/inputmethod/hiddenfrompickerime/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/legacyimeclienttestlib/Android.bp b/tests/inputmethod/legacyimeclienttestlib/Android.bp
index 59d7782..131db85 100644
--- a/tests/inputmethod/legacyimeclienttestlib/Android.bp
+++ b/tests/inputmethod/legacyimeclienttestlib/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/mocka11yime/client/Android.bp b/tests/inputmethod/mocka11yime/client/Android.bp
index ccaca7d..728fe3d1 100644
--- a/tests/inputmethod/mocka11yime/client/Android.bp
+++ b/tests/inputmethod/mocka11yime/client/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/mocka11yime/common/Android.bp b/tests/inputmethod/mocka11yime/common/Android.bp
index 7e483d8..7d15b02 100644
--- a/tests/inputmethod/mocka11yime/common/Android.bp
+++ b/tests/inputmethod/mocka11yime/common/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/mocka11yime/service/Android.bp b/tests/inputmethod/mocka11yime/service/Android.bp
index 0c542af..226bd94 100644
--- a/tests/inputmethod/mocka11yime/service/Android.bp
+++ b/tests/inputmethod/mocka11yime/service/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/mockime/Android.bp b/tests/inputmethod/mockime/Android.bp
index 8b7f73e..88db529 100644
--- a/tests/inputmethod/mockime/Android.bp
+++ b/tests/inputmethod/mockime/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/mockimewithsubtypes/Android.bp b/tests/inputmethod/mockimewithsubtypes/Android.bp
index 0d42788..8b78dce 100644
--- a/tests/inputmethod/mockimewithsubtypes/Android.bp
+++ b/tests/inputmethod/mockimewithsubtypes/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/mocklargeresourceime/Android.bp b/tests/inputmethod/mocklargeresourceime/Android.bp
index 94fa4e5..8618425 100644
--- a/tests/inputmethod/mocklargeresourceime/Android.bp
+++ b/tests/inputmethod/mocklargeresourceime/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/mockspellchecker/Android.bp b/tests/inputmethod/mockspellchecker/Android.bp
index 875331c..ef4b230 100644
--- a/tests/inputmethod/mockspellchecker/Android.bp
+++ b/tests/inputmethod/mockspellchecker/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/spellcheckingime/Android.bp b/tests/inputmethod/spellcheckingime/Android.bp
index a9a08cb..c9918c6 100644
--- a/tests/inputmethod/spellcheckingime/Android.bp
+++ b/tests/inputmethod/spellcheckingime/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/testapp/Android.bp b/tests/inputmethod/testapp/Android.bp
index 7f67a11..313b9be 100644
--- a/tests/inputmethod/testapp/Android.bp
+++ b/tests/inputmethod/testapp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/tests32/Android.bp b/tests/inputmethod/tests32/Android.bp
index e5bda6a..5c5f27b 100644
--- a/tests/inputmethod/tests32/Android.bp
+++ b/tests/inputmethod/tests32/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/util/Android.bp b/tests/inputmethod/util/Android.bp
index 828aa50..f4337cc 100644
--- a/tests/inputmethod/util/Android.bp
+++ b/tests/inputmethod/util/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_input_method_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/inputmethod/util/AndroidManifest.xml b/tests/inputmethod/util/AndroidManifest.xml
index 898fd38..1d0ce47 100644
--- a/tests/inputmethod/util/AndroidManifest.xml
+++ b/tests/inputmethod/util/AndroidManifest.xml
@@ -24,7 +24,7 @@
android:supportsRtl="true">
<activity android:name="android.view.inputmethod.cts.util.TestActivity"
- android:theme="@style/no_starting_window"
+ android:theme="@style/AppTheme"
android:label="TestActivity"
android:configChanges="fontScale|smallestScreenSize|screenSize|screenLayout|orientation"
android:exported="true">
@@ -34,7 +34,7 @@
</intent-filter>
</activity>
<activity android:name="android.view.inputmethod.cts.util.TestActivity2"
- android:theme="@style/no_starting_window"
+ android:theme="@style/AppTheme"
android:label="TestActivity2"
android:exported="true">
<intent-filter>
@@ -44,7 +44,7 @@
</activity>
<activity android:name="android.view.inputmethod.cts.util.StateInitializeActivity"
- android:theme="@style/no_starting_window"
+ android:theme="@style/AppTheme"
android:label="StateInitializeActivity"
android:configChanges="fontScale"
android:exported="true">
diff --git a/tests/inputmethod/util/res/values/styles.xml b/tests/inputmethod/util/res/values/styles.xml
index 32f277f..793d2ea 100644
--- a/tests/inputmethod/util/res/values/styles.xml
+++ b/tests/inputmethod/util/res/values/styles.xml
@@ -19,4 +19,12 @@
<style name="no_starting_window" parent="@android:style/Theme.DeviceDefault">
<item name="android:windowDisablePreview">true</item>
</style>
-</resources>
\ No newline at end of file
+
+ <style name="AppTheme" parent="no_starting_window">
+ <!--
+ On Wear, swipe to dismiss is enabled by default which can cause unintended handling of
+ back presses. This disables it.
+ -->
+ <item name="android:windowSwipeToDismiss">false</item>
+ </style>
+</resources>
diff --git a/tests/libcore/jsr166/Android.bp b/tests/libcore/jsr166/Android.bp
index 9ffff77..76d6232 100644
--- a/tests/libcore/jsr166/Android.bp
+++ b/tests/libcore/jsr166/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/libcore/luni/Android.bp b/tests/libcore/luni/Android.bp
index e60d895..b4dd5fe 100644
--- a/tests/libcore/luni/Android.bp
+++ b/tests/libcore/luni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/libcore/ojluni/Android.bp b/tests/libcore/ojluni/Android.bp
index 221d497..1ee4d5a 100644
--- a/tests/libcore/ojluni/Android.bp
+++ b/tests/libcore/ojluni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/libcore/okhttp/Android.bp b/tests/libcore/okhttp/Android.bp
index 25fe13b..64f7559 100644
--- a/tests/libcore/okhttp/Android.bp
+++ b/tests/libcore/okhttp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -53,7 +54,7 @@
"mts-conscrypt",
],
host_required: ["cts-dalvik-host-test-runner"],
- test_config: "CtsLibcoreOkHttpTestCases.xml"
+ test_config: "CtsLibcoreOkHttpTestCases.xml",
}
// Tests used in ART MTS.
@@ -65,5 +66,5 @@
"mts-art",
],
host_required: ["cts-dalvik-host-test-runner"],
- test_config: "MtsLibcoreOkHttpTestCases.xml"
+ test_config: "MtsLibcoreOkHttpTestCases.xml",
}
diff --git a/tests/libcore/runner/Android.bp b/tests/libcore/runner/Android.bp
index 12d3496..cd95ef9a 100644
--- a/tests/libcore/runner/Android.bp
+++ b/tests/libcore/runner/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/libcore/wycheproof-bc/Android.bp b/tests/libcore/wycheproof-bc/Android.bp
index a7b90af..2c0fbce 100644
--- a/tests/libcore/wycheproof-bc/Android.bp
+++ b/tests/libcore/wycheproof-bc/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/libcore/wycheproof/Android.bp b/tests/libcore/wycheproof/Android.bp
index caf98a7..2138676 100644
--- a/tests/libcore/wycheproof/Android.bp
+++ b/tests/libcore/wycheproof/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/location/location_fine/src/android/location/cts/fine/ScanningSettingsTest.java b/tests/location/location_fine/src/android/location/cts/fine/ScanningSettingsTest.java
index ed8cdad..299d5c4 100644
--- a/tests/location/location_fine/src/android/location/cts/fine/ScanningSettingsTest.java
+++ b/tests/location/location_fine/src/android/location/cts/fine/ScanningSettingsTest.java
@@ -27,34 +27,33 @@
import android.os.HandlerThread;
import android.platform.test.annotations.AppModeFull;
import android.provider.Settings;
-import android.support.test.uiautomator.By;
-import android.support.test.uiautomator.UiDevice;
-import android.support.test.uiautomator.UiObject2;
-import android.support.test.uiautomator.UiObjectNotFoundException;
-import android.support.test.uiautomator.UiScrollable;
-import android.support.test.uiautomator.UiSelector;
-import android.support.test.uiautomator.Until;
import android.test.AndroidTestCase;
import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.uiautomator.By;
+import androidx.test.uiautomator.Direction;
+import androidx.test.uiautomator.StaleObjectException;
+import androidx.test.uiautomator.UiDevice;
+import androidx.test.uiautomator.UiObject2;
+import androidx.test.uiautomator.Until;
import com.android.compatibility.common.util.CddTest;
import com.android.compatibility.common.util.FeatureUtil;
import com.android.compatibility.common.util.PollingCheck;
import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-/**
- * Tests if system settings app provides scanning settings.
- */
+/** Tests if system settings app provides scanning settings. */
@AppModeFull(reason = "Test cases don't apply for Instant apps")
public class ScanningSettingsTest extends AndroidTestCase {
private static final String TAG = "ScanningSettingsTest";
- private static final int TIMEOUT = 8_000; // 8 seconds
+ private static final int TIMEOUT = 300_000; // 5 minutes
+ private static final int POLLING_INTERVAL_MILLIS = 1000; // 1 seconds.
private static final String SETTINGS_PACKAGE = "com.android.settings";
+ private static final String LOCATION_SERVICES_PREFERENCE_TITLE_RES =
+ "location_services_preference_title";
private static final String WIFI_SCANNING_TITLE_RES =
"location_scanning_wifi_always_scanning_title";
private static final String BLUETOOTH_SCANNING_TITLE_RES =
@@ -81,14 +80,18 @@
mPackageManager = mContext.getPackageManager();
final Intent launcherIntent = new Intent(Intent.ACTION_MAIN);
launcherIntent.addCategory(Intent.CATEGORY_HOME);
- mLauncherPackage = mPackageManager.resolveActivity(launcherIntent,
- PackageManager.MATCH_DEFAULT_ONLY).activityInfo.packageName;
+ mLauncherPackage =
+ mPackageManager.resolveActivity(launcherIntent, PackageManager.MATCH_DEFAULT_ONLY)
+ .activityInfo
+ .packageName;
}
@CddTest(requirement = "7.4.2/C-2-1")
public void testWifiScanningSettings() throws Exception {
- if (FeatureUtil.isTV() || FeatureUtil.isAutomotive()
- || FeatureUtil.isWatch() || FeatureUtil.isArc()) {
+ if (FeatureUtil.isTV()
+ || FeatureUtil.isAutomotive()
+ || FeatureUtil.isWatch()
+ || FeatureUtil.isArc()) {
return;
}
launchLocationServicesSettings();
@@ -107,36 +110,32 @@
PollingCheck.check(
"Scan Always Available wasn't toggled from " + checked + " to " + !checked,
TIMEOUT,
- () -> !checked == wifiManager.isScanAlwaysAvailable()
- );
+ () -> !checked == wifiManager.isScanAlwaysAvailable());
// Click the preference again to toggle the setting back.
pref.click();
PollingCheck.check(
"Scan Always Available wasn't toggled from " + !checked + " to " + checked,
TIMEOUT,
- () -> checked == wifiManager.isScanAlwaysAvailable()
- );
+ () -> checked == wifiManager.isScanAlwaysAvailable());
}
@CddTest(requirement = "7.4.3/C-4-1")
public void testBleScanningSettings() throws PackageManager.NameNotFoundException {
- if (FeatureUtil.isTV() || FeatureUtil.isAutomotive()
- || FeatureUtil.isWatch() || FeatureUtil.isArc()) {
+ if (FeatureUtil.isTV()
+ || FeatureUtil.isAutomotive()
+ || FeatureUtil.isWatch()
+ || FeatureUtil.isArc()) {
return;
}
launchLocationServicesSettings();
launchScanningSettingsFragment(BLUETOOTH_SCANNING_TITLE_RES);
- toggleSettingAndVerify(BLUETOOTH_SCANNING_TITLE_RES,
- Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE);
+ toggleSettingAndVerify(
+ BLUETOOTH_SCANNING_TITLE_RES, Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE);
}
private void launchLocationServicesSettings() {
- // Start from the home screen
- mDevice.pressHome();
- mDevice.wait(Until.hasObject(By.pkg(mLauncherPackage).depth(0)), TIMEOUT);
-
final Intent intent = new Intent(Settings.ACTION_LOCATION_SCANNING_SETTINGS);
// Clear out any previous instances
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
@@ -149,42 +148,68 @@
private void launchScanningSettingsFragment(String name)
throws PackageManager.NameNotFoundException {
final Resources res = mPackageManager.getResourcesForApplication(SETTINGS_PACKAGE);
- int resId = res.getIdentifier(name, "string", SETTINGS_PACKAGE);
- UiScrollable uiScrollable = new UiScrollable(new UiSelector().scrollable(true));
- try {
- uiScrollable.scrollTextIntoView(res.getString(resId));
- } catch (UiObjectNotFoundException e) {
- // Scrolling can fail if the UI is not scrollable
+ int resIdMenu = res.getIdentifier(name, "string", SETTINGS_PACKAGE);
+ int resIdTitle =
+ res.getIdentifier(
+ LOCATION_SERVICES_PREFERENCE_TITLE_RES, "string", SETTINGS_PACKAGE);
+ UiObject2 pref = mDevice.findObject(By.text(res.getString(resIdMenu)));
+ while (pref == null) {
+ // Scroll to preference if the UI is scrollable
+ UiObject2 scrollable =
+ mDevice.findObject(
+ By.scrollable(true).hasDescendant(By.desc(res.getString(resIdTitle))));
+ if (scrollable != null) {
+ try {
+ pref =
+ scrollable.scrollUntil(
+ Direction.DOWN,
+ Until.findObject(By.text(res.getString(resIdMenu))));
+ } catch (StaleObjectException exception) {
+ // Ignore
+ }
+ }
+ if (pref == null) {
+ pref = mDevice.findObject(By.text(res.getString(resIdMenu)));
+ }
}
- // Wait for the preference to appear
- mDevice.wait(Until.hasObject(By.text(res.getString(resId))), TIMEOUT);
-
- UiObject2 pref = mDevice.findObject(By.text(res.getString(resId)));
- // Click the preference to show the Scanning fragment
- pref.click();
-
- // Wait for the Scanning fragment to appear
- mDevice.wait(Until.hasObject(By.pkg(SETTINGS_PACKAGE).depth(1)), TIMEOUT);
+ // Click the preference to show the Scanning fragment. The preference could be unclickable
+ // initially. So keep retrying until it's finally clicked.
+ //
+ // The following code:
+ // ```
+ // pref.wait(Until.clickable(true), TIMEOUT);
+ // ```
+ // couldn't detect the clickable state of the object unfortunately. We still need to do the
+ // check-and-retry hack.
+ do {
+ try {
+ pref.click();
+ } catch (StaleObjectException exception) {
+ // Ignore
+ }
+ } while (!mDevice.wait(
+ Until.hasObject(By.res("com.android.settings:id/settingslib_main_switch_bar")),
+ POLLING_INTERVAL_MILLIS));
}
- private void clickAndWaitForSettingChange(UiObject2 pref, ContentResolver resolver,
- String settingKey) {
+ private void clickAndWaitForSettingChange(
+ UiObject2 pref, ContentResolver resolver, String settingKey) {
final CountDownLatch latch = new CountDownLatch(1);
final HandlerThread handlerThread = new HandlerThread(TAG);
handlerThread.start();
- final ContentObserver observer = new ContentObserver(
- new Handler(handlerThread.getLooper())) {
- @Override
- public void onChange(boolean selfChange) {
- super.onChange(selfChange);
- latch.countDown();
- }
- };
+ final ContentObserver observer =
+ new ContentObserver(new Handler(handlerThread.getLooper())) {
+ @Override
+ public void onChange(boolean selfChange) {
+ super.onChange(selfChange);
+ latch.countDown();
+ }
+ };
resolver.registerContentObserver(Settings.Global.getUriFor(settingKey), false, observer);
pref.click();
try {
- latch.await(TIMEOUT, TimeUnit.MILLISECONDS);
+ latch.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
diff --git a/tests/media/Android.bp b/tests/media/Android.bp
index 57d76a6..7cf0707 100644
--- a/tests/media/Android.bp
+++ b/tests/media/Android.bp
@@ -26,6 +26,7 @@
"ctstestrunner-axt",
"ctstestserver",
"ctsmediav2common",
+ "aconfig_mediacodec_flags_java_lib",
],
libs: [
"org.apache.http.legacy",
diff --git a/tests/media/AndroidManifest.xml b/tests/media/AndroidManifest.xml
index 0a1f5e0..2896a9d 100644
--- a/tests/media/AndroidManifest.xml
+++ b/tests/media/AndroidManifest.xml
@@ -28,7 +28,6 @@
<application
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true">
- <uses-library android:name="android.test.runner" />
<uses-library android:name="org.apache.http.legacy" />
<activity android:name="android.mediav2.cts.CodecTestActivity" />
</application>
diff --git a/tests/media/AndroidTest.xml b/tests/media/AndroidTest.xml
index 9056d6d..6d7f7a3 100644
--- a/tests/media/AndroidTest.xml
+++ b/tests/media/AndroidTest.xml
@@ -35,7 +35,7 @@
</target_preparer>
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.MediaPreparer">
<option name="push-all" value="true" />
- <option name="media-folder-name" value="CtsMediaV2TestCases-3.6" />
+ <option name="media-folder-name" value="CtsMediaV2TestCases-4.0" />
<option name="dynamic-config-module" value="CtsMediaV2TestCases" />
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
diff --git a/tests/media/DynamicConfig.xml b/tests/media/DynamicConfig.xml
index 3ab84f6..fc1ada6 100644
--- a/tests/media/DynamicConfig.xml
+++ b/tests/media/DynamicConfig.xml
@@ -1,5 +1,5 @@
<dynamicConfig>
<entry key="media_files_url">
- <value>https://dl.google.com/android/xts/cts/tests/media/CtsMediaV2TestCases-3.6.zip</value>
+ <value>https://dl.google.com/android/xts/cts/tests/media/CtsMediaV2TestCases-4.0.zip</value>
</entry>
</dynamicConfig>
diff --git a/tests/media/README.md b/tests/media/README.md
index 60ff258..a48091b 100644
--- a/tests/media/README.md
+++ b/tests/media/README.md
@@ -3,10 +3,11 @@
The aim of these tests is not solely to verify the CDD requirements but also to test components, their plugins and their interactions with media framework.
-The test vectors used by the test suite is available at [link](https://dl.google.com/android/xts/cts/tests/media/CtsMediaV2TestCases-3.6.zip) and is downloaded automatically while running tests. Manual installation of these can be done using copy_media.sh script in this directory.
+The test vectors used by the test suite is available at [link](https://dl.google.com/android/xts/cts/tests/media/CtsMediaV2TestCases-4.0.zip) and is downloaded automatically while running tests. Manual installation of these can be done using copy_media.sh script in this directory.
All Big Buck Bunny(bbb) test vectors are of 8-bit format. They are downloaded from [link](https://peach.blender.org/download/) and resampled according to the test requirements.
All Cosmos Laundromat(cosmat) test vectors are of 10-bit format. They are downloaded from [link](https://media.xiph.org/) and resampled according to the test requirements.
+VideoEncoderParamTest uses stefan_sif_yuv420p_30fps.yuv. This is downloaded from [link](https://media.xiph.org/).
The test suite looks to cover sdk/ndk api in normal and error scenarios. Error scenarios are separated from regular usage and are placed under class *UnitTest (MuxerUnitTest, ExtractorUnitTest, ...).
diff --git a/tests/media/common/src/android/mediav2/common/cts/BitStreamUtils.java b/tests/media/common/src/android/mediav2/common/cts/BitStreamUtils.java
index 66ed70f..af5f679 100644
--- a/tests/media/common/src/android/mediav2/common/cts/BitStreamUtils.java
+++ b/tests/media/common/src/android/mediav2/common/cts/BitStreamUtils.java
@@ -967,7 +967,7 @@
@Override
public int getFrameType() {
- ArrayList<FrameHeaderObu> headers = new ArrayList();
+ ArrayList<FrameHeaderObu> headers = new ArrayList<>();
for (int pos = mOffset; pos < mLimit; ) {
ObuInfo obuDetails = parseObuHeader(mData, pos, mLimit);
ObuParsableBitArray bitArray =
diff --git a/tests/media/common/src/android/mediav2/common/cts/CodecAsyncHandler.java b/tests/media/common/src/android/mediav2/common/cts/CodecAsyncHandler.java
index 785c32d..344ce75 100644
--- a/tests/media/common/src/android/mediav2/common/cts/CodecAsyncHandler.java
+++ b/tests/media/common/src/android/mediav2/common/cts/CodecAsyncHandler.java
@@ -41,13 +41,13 @@
*/
public class CodecAsyncHandler extends MediaCodec.Callback {
private static final String LOG_TAG = CodecAsyncHandler.class.getSimpleName();
- private final Lock mLock = new ReentrantLock();
- private final Condition mCondition = mLock.newCondition();
- private final LinkedList<Pair<Integer, MediaCodec.BufferInfo>> mCbInputQueue;
+ protected final Lock mLock = new ReentrantLock();
+ protected final Condition mCondition = mLock.newCondition();
+ protected final LinkedList<Pair<Integer, MediaCodec.BufferInfo>> mCbInputQueue;
private final LinkedList<Pair<Integer, MediaCodec.BufferInfo>> mCbOutputQueue;
private MediaFormat mOutFormat;
private boolean mSignalledOutFormatChanged;
- private volatile boolean mSignalledError;
+ protected volatile boolean mSignalledError;
private String mErrorMsg;
public CodecAsyncHandler() {
diff --git a/tests/media/common/src/android/mediav2/common/cts/CodecAsyncHandlerMultiAccessUnits.java b/tests/media/common/src/android/mediav2/common/cts/CodecAsyncHandlerMultiAccessUnits.java
new file mode 100644
index 0000000..6e50737
--- /dev/null
+++ b/tests/media/common/src/android/mediav2/common/cts/CodecAsyncHandlerMultiAccessUnits.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2024 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.mediav2.common.cts;
+
+import static org.junit.Assert.assertTrue;
+
+import android.annotation.NonNull;
+import android.media.MediaCodec;
+import android.os.Build;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.util.Pair;
+
+import androidx.test.filters.SdkSuppress;
+
+import com.android.media.codec.flags.Flags;
+
+import java.util.ArrayDeque;
+import java.util.LinkedList;
+
+/**
+ * Helper class for running mediacodec in asynchronous mode in large buffer mode. All mediacodec
+ * callback events are registered in this object so that the client can take appropriate action
+ * in time.
+ */
+@SdkSuppress(minSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM, codeName = "VanillaIceCream")
+@RequiresFlagsEnabled(Flags.FLAG_LARGE_AUDIO_FRAME)
+public class CodecAsyncHandlerMultiAccessUnits extends CodecAsyncHandler {
+ private final LinkedList<Pair<Integer, ArrayDeque<MediaCodec.BufferInfo>>> mCbOutputQueue;
+
+ public CodecAsyncHandlerMultiAccessUnits() {
+ super();
+ mCbOutputQueue = new LinkedList<>();
+ }
+
+ @Override
+ public void clearQueues() {
+ super.clearQueues();
+ mLock.lock();
+ try {
+ mCbOutputQueue.clear();
+ } finally {
+ mLock.unlock();
+ }
+ }
+
+ @Override
+ public void resetContext() {
+ super.resetContext();
+ }
+
+ @Override
+ public void onOutputBuffersAvailable(@NonNull MediaCodec codec, int bufferIndex,
+ @NonNull ArrayDeque<MediaCodec.BufferInfo> infos) {
+ assertTrue(bufferIndex >= 0);
+ mLock.lock();
+ try {
+ mCbOutputQueue.add(new Pair<>(bufferIndex, infos));
+ mCondition.signalAll();
+ } finally {
+ mLock.unlock();
+ }
+ }
+
+ @Override
+ public void onOutputBufferAvailable(@NonNull MediaCodec codec, int bufferIndex,
+ @NonNull MediaCodec.BufferInfo info) {
+ assertTrue(bufferIndex >= 0);
+ mLock.lock();
+ try {
+ ArrayDeque<MediaCodec.BufferInfo> infos = new ArrayDeque<>();
+ infos.add(info);
+ mCbOutputQueue.add(new Pair<>(bufferIndex, infos));
+ mCondition.signalAll();
+ } finally {
+ mLock.unlock();
+ }
+ }
+
+ public Pair<Integer, ArrayDeque<MediaCodec.BufferInfo>> getOutputs()
+ throws InterruptedException {
+ Pair<Integer, ArrayDeque<MediaCodec.BufferInfo>> element = null;
+ mLock.lock();
+ try {
+ while (!mSignalledError) {
+ if (mCbOutputQueue.isEmpty()) {
+ mCondition.await();
+ } else {
+ element = mCbOutputQueue.remove(0);
+ break;
+ }
+ }
+ } finally {
+ mLock.unlock();
+ }
+ return element;
+ }
+
+ public Pair<Integer, ArrayDeque<MediaCodec.BufferInfo>> getWorkList()
+ throws InterruptedException {
+ Pair<Integer, ArrayDeque<MediaCodec.BufferInfo>> element = null;
+ mLock.lock();
+ try {
+ while (!mSignalledError) {
+ if (mCbInputQueue.isEmpty() && mCbOutputQueue.isEmpty()) {
+ mCondition.await();
+ } else {
+ if (!mCbOutputQueue.isEmpty()) {
+ element = mCbOutputQueue.remove(0);
+ } else {
+ Pair<Integer, MediaCodec.BufferInfo> item = mCbInputQueue.remove(0);
+ element = new Pair<>(item.first, null);
+ }
+ break;
+ }
+ }
+ } finally {
+ mLock.unlock();
+ }
+ return element;
+ }
+}
diff --git a/tests/media/common/src/android/mediav2/common/cts/CodecDecoderBlockModelMultiAccessUnitTestBase.java b/tests/media/common/src/android/mediav2/common/cts/CodecDecoderBlockModelMultiAccessUnitTestBase.java
new file mode 100644
index 0000000..9332650
--- /dev/null
+++ b/tests/media/common/src/android/mediav2/common/cts/CodecDecoderBlockModelMultiAccessUnitTestBase.java
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 2024 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.mediav2.common.cts;
+
+import static android.mediav2.common.cts.CodecDecoderMultiAccessUnitTestBase.getCompressionRatio;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import android.media.AudioFormat;
+import android.media.MediaCodec;
+import android.media.MediaExtractor;
+import android.media.MediaFormat;
+import android.os.Build;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.util.Log;
+import android.util.Pair;
+
+import androidx.test.filters.SdkSuppress;
+
+import com.android.media.codec.flags.Flags;
+
+import org.junit.Assert;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.ArrayDeque;
+import java.util.Locale;
+
+/**
+ * Wrapper class for trying and testing mediacodec decoder components in large buffer block model
+ * mode
+ */
+@SdkSuppress(minSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM, codeName = "VanillaIceCream")
+@RequiresFlagsEnabled(Flags.FLAG_LARGE_AUDIO_FRAME)
+public class CodecDecoderBlockModelMultiAccessUnitTestBase extends CodecDecoderBlockModelTestBase {
+ private static final String LOG_TAG =
+ CodecDecoderBlockModelMultiAccessUnitTestBase.class.getSimpleName();
+
+ protected final CodecAsyncHandlerMultiAccessUnits mAsyncHandleMultiAccessUnits =
+ new CodecAsyncHandlerMultiAccessUnits();
+ protected int mMaxInputSize;
+ protected int mMaxOutputSizeBytes;
+ protected int mMaxInputLimitMs;
+
+ public CodecDecoderBlockModelMultiAccessUnitTestBase(String decoder, String mediaType,
+ String testFile, String allTestParams) {
+ super(decoder, mediaType, testFile, allTestParams);
+ mAsyncHandle = mAsyncHandleMultiAccessUnits;
+ }
+
+ @Override
+ protected void resetContext(boolean isAsync, boolean signalEOSWithLastFrame) {
+ super.resetContext(isAsync, signalEOSWithLastFrame);
+ mMaxOutputSizeBytes = 0;
+ mMaxInputLimitMs = 0;
+ }
+
+ @Override
+ protected void enqueueInput(int bufferIndex) {
+ ArrayDeque<MediaCodec.BufferInfo> infos = new ArrayDeque<>();
+ mLinearInputBlock.allocateBlock(mCodecName, mMaxInputSize);
+ int basePts = (int) mExtractor.getSampleTime();
+ while (true) {
+ int size = (int) mExtractor.getSampleSize();
+ if (size <= 0) break;
+ int deltaPts = (int) mExtractor.getSampleTime() - basePts;
+ assertTrue("Difference between basePts: " + basePts + " and current pts: "
+ + mExtractor.getSampleTime() + " should be greater than or equal "
+ + "to zero.\n" + mTestConfig + mTestEnv, deltaPts >= 0);
+ if (deltaPts / 1000 > mMaxInputLimitMs) {
+ break;
+ }
+ if (mLinearInputBlock.getOffset() + size <= mLinearInputBlock.getBufferCapacity()) {
+ mExtractor.readSampleData(mLinearInputBlock.getBuffer(),
+ mLinearInputBlock.getOffset());
+ } else {
+ if (mLinearInputBlock.getOffset() == 0) {
+ throw new RuntimeException(String.format(Locale.getDefault(),
+ "access unit size %d exceeds capacity of the buffer %d, unable to "
+ + "queue input", size, mLinearInputBlock.getBufferCapacity()));
+ }
+ break;
+ }
+ int extractorFlags = mExtractor.getSampleFlags();
+ long pts = mExtractor.getSampleTime();
+ int codecFlags = 0;
+ if ((extractorFlags & MediaExtractor.SAMPLE_FLAG_SYNC) != 0) {
+ codecFlags |= MediaCodec.BUFFER_FLAG_KEY_FRAME;
+ }
+ if ((extractorFlags & MediaExtractor.SAMPLE_FLAG_PARTIAL_FRAME) != 0) {
+ codecFlags |= MediaCodec.BUFFER_FLAG_PARTIAL_FRAME;
+ }
+ if (!mExtractor.advance() && mSignalEOSWithLastFrame) {
+ codecFlags |= MediaCodec.BUFFER_FLAG_END_OF_STREAM;
+ mSawInputEOS = true;
+ }
+ MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo();
+ bufferInfo.set(mLinearInputBlock.getOffset(), size, pts, codecFlags);
+ mLinearInputBlock.setOffset(mLinearInputBlock.getOffset() + bufferInfo.size);
+ infos.add(bufferInfo);
+ }
+ if (infos.size() > 0) {
+ MediaCodec.QueueRequest request = mCodec.getQueueRequest(bufferIndex);
+ request.setMultiFrameLinearBlock(mLinearInputBlock.getBlock(), infos);
+ request.queue();
+ for (MediaCodec.BufferInfo info : infos) {
+ if (info.size > 0 && (info.flags & (MediaCodec.BUFFER_FLAG_CODEC_CONFIG
+ | MediaCodec.BUFFER_FLAG_PARTIAL_FRAME)) == 0) {
+ mOutputBuff.saveInPTS(info.presentationTimeUs);
+ mInputCount++;
+ }
+ if (ENABLE_LOGS) {
+ Log.v(LOG_TAG, "input: id: " + bufferIndex + " size: " + info.size
+ + " pts: " + info.presentationTimeUs + " flags: " + info.flags);
+ }
+ }
+ }
+ }
+
+ private void validateOutputFormat(MediaFormat outFormat) {
+ Assert.assertTrue("Output format " + outFormat + " does not contain key "
+ + MediaFormat.KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE + ". \n"
+ + mTestConfig + mTestEnv,
+ outFormat.containsKey(MediaFormat.KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE));
+ mMaxOutputSizeBytes = outFormat.getInteger(MediaFormat.KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE);
+ }
+
+ private void dequeueOutputs(int bufferIndex, ArrayDeque<MediaCodec.BufferInfo> infos) {
+ if (ENABLE_LOGS) {
+ Log.v(LOG_TAG, "output: id: " + bufferIndex);
+ }
+ if (mOutputCount == 0) {
+ validateOutputFormat(mCodec.getOutputFormat(bufferIndex));
+ }
+ MediaCodec.OutputFrame frame = mCodec.getOutputFrame(bufferIndex);
+ ByteBuffer buf = frame.getLinearBlock() != null ? frame.getLinearBlock().map() : null;
+ MediaCodec.BufferInfo[] frameInfos =
+ frame.getBufferInfos().toArray(new MediaCodec.BufferInfo[0]);
+ MediaCodec.BufferInfo[] callBackInfos = infos.toArray(new MediaCodec.BufferInfo[0]);
+ assertEquals("Lengths of frameInfos received via callback and getBufferInfos api are not "
+ + "identical. \n" + mTestConfig + mTestEnv, frameInfos.length,
+ callBackInfos.length);
+
+ int totalSize = 0;
+ for (int i = 0; i < frameInfos.length; ++i) {
+ MediaCodec.BufferInfo frameInfo = frameInfos[i];
+ MediaCodec.BufferInfo callBackInfo = callBackInfos[i];
+ Assert.assertNotNull("received null entry in dequeueOutput frame infos list. \n"
+ + mTestConfig + mTestEnv, frameInfo);
+ Assert.assertNotNull("received null entry in dequeueOutput callback infos list. \n"
+ + mTestConfig + mTestEnv, callBackInfo);
+
+ long framePts = frameInfo.presentationTimeUs;
+ long infoPts = callBackInfo.presentationTimeUs;
+ int frameFlags = frameInfo.flags;
+ int infoFlags = callBackInfo.flags;
+ assertEquals("presentation timestamps from OutputFrame does not match with the value "
+ + "obtained from callback: framePts=" + framePts + ", infoPts=" + infoPts
+ + "\n" + mTestConfig + mTestEnv, framePts, infoPts);
+ assertEquals("Flags from OutputFrame does not match with the value obtained from "
+ + "callback: frameFlags=" + frameFlags + ", infoFlags=" + infoFlags + "\n"
+ + mTestConfig + mTestEnv, frameFlags, infoFlags);
+ if (ENABLE_LOGS) {
+ Log.v(LOG_TAG, "flags: " + infoFlags + " size: " + callBackInfo.size
+ + " timestamp: " + infoPts);
+ }
+ if ((infoFlags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
+ mSawOutputEOS = true;
+ }
+ if (callBackInfo.size > 0) {
+ if (buf != null && mSaveToMem) {
+ mOutputBuff.saveToMemory(buf, callBackInfo);
+ }
+ if ((infoFlags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) == 0) {
+ mOutputBuff.saveOutPTS(infoPts);
+ mOutputCount++;
+ }
+ }
+ totalSize += callBackInfo.size;
+ }
+ if (frame.getLinearBlock() != null) {
+ frame.getLinearBlock().recycle();
+ }
+ assertTrue("Sum of all info sizes: " + totalSize + " exceeds max output size: "
+ + mMaxOutputSizeBytes + " \n" + mTestConfig + mTestEnv,
+ totalSize <= mMaxOutputSizeBytes);
+ mCodec.releaseOutputBuffer(bufferIndex, false);
+ }
+
+ @Override
+ protected void doWork(int frameLimit) throws InterruptedException, IOException {
+ // dequeue output after inputEOS is expected to be done in waitForAllOutputs()
+ while (!mAsyncHandleMultiAccessUnits.hasSeenError() && !mSawInputEOS
+ && mInputCount < frameLimit) {
+ Pair<Integer, ArrayDeque<MediaCodec.BufferInfo>> element =
+ mAsyncHandleMultiAccessUnits.getWorkList();
+ if (element != null) {
+ int bufferID = element.first;
+ ArrayDeque<MediaCodec.BufferInfo> infos = element.second;
+ if (infos != null) {
+ // <id, infos> corresponds to output callback. Handle it accordingly
+ dequeueOutputs(bufferID, infos);
+ } else {
+ // <id, null> corresponds to input callback. Handle it accordingly
+ enqueueInput(bufferID);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void waitForAllOutputs() throws InterruptedException {
+ while (!mAsyncHandleMultiAccessUnits.hasSeenError() && !mSawOutputEOS) {
+ Pair<Integer, ArrayDeque<MediaCodec.BufferInfo>> element =
+ mAsyncHandleMultiAccessUnits.getOutputs();
+ if (element != null) {
+ dequeueOutputs(element.first, element.second);
+ }
+ }
+ validateTestState();
+ }
+
+ protected void configureKeysForLargeAudioBlockModelFrameMode(MediaFormat format,
+ int maxInputSizeInBytes, int maxOutSizeInMs, int thresOutSizeInMs) {
+ int bytesPerSample = AudioFormat.getBytesPerSample(
+ format.getInteger(MediaFormat.KEY_PCM_ENCODING, AudioFormat.ENCODING_PCM_16BIT));
+ int sampleRate = format.getInteger(MediaFormat.KEY_SAMPLE_RATE);
+ int channelCount = format.getInteger(MediaFormat.KEY_CHANNEL_COUNT);
+ int maxOutputSize = (maxOutSizeInMs * bytesPerSample * sampleRate * channelCount) / 1000;
+ mMaxInputSize = Math.max(maxInputSizeInBytes,
+ (int) (maxOutputSize * getCompressionRatio(mMediaType)));
+ int thresholdOutputSize =
+ (thresOutSizeInMs * bytesPerSample * sampleRate * channelCount) / 1000;
+ format.setInteger(MediaFormat.KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE, maxOutputSize);
+ format.setInteger(MediaFormat.KEY_BUFFER_BATCH_THRESHOLD_OUTPUT_SIZE,
+ thresholdOutputSize);
+ }
+}
diff --git a/tests/media/common/src/android/mediav2/common/cts/CodecDecoderBlockModelTestBase.java b/tests/media/common/src/android/mediav2/common/cts/CodecDecoderBlockModelTestBase.java
new file mode 100644
index 0000000..e7cbcfe
--- /dev/null
+++ b/tests/media/common/src/android/mediav2/common/cts/CodecDecoderBlockModelTestBase.java
@@ -0,0 +1,204 @@
+/*
+ * Copyright (C) 2024 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.mediav2.common.cts;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeNotNull;
+
+import android.media.MediaCodec;
+import android.media.MediaExtractor;
+import android.media.MediaFormat;
+import android.os.Build;
+import android.util.Log;
+
+import androidx.annotation.RequiresApi;
+
+import org.junit.After;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Wrapper class for trying and testing mediacodec decoder components in block model mode.
+ */
+@RequiresApi(api = Build.VERSION_CODES.R)
+public class CodecDecoderBlockModelTestBase extends CodecDecoderTestBase {
+ private static final String LOG_TAG = CodecDecoderBlockModelTestBase.class.getSimpleName();
+
+ protected final LinearBlockWrapper mLinearInputBlock = new LinearBlockWrapper();
+
+ /**
+ * Wrapper class for {@link MediaCodec.LinearBlock}
+ */
+ public static class LinearBlockWrapper {
+ private MediaCodec.LinearBlock mBlock;
+ private ByteBuffer mBuffer;
+ private int mOffset;
+
+ public MediaCodec.LinearBlock getBlock() {
+ return mBlock;
+ }
+
+ public ByteBuffer getBuffer() {
+ return mBuffer;
+ }
+
+ public int getBufferCapacity() {
+ return mBuffer == null ? 0 : mBuffer.capacity();
+ }
+
+ public int getOffset() {
+ return mOffset;
+ }
+
+ public void setOffset(int size) {
+ mOffset = size;
+ }
+
+ public void allocateBlock(String codec, int size) {
+ recycle();
+ mBlock = MediaCodec.LinearBlock.obtain(size, new String[]{codec});
+ assumeNotNull("failed to obtain LinearBlock for component " + codec + "\n", mBlock);
+ assertTrue("Blocks obtained through LinearBlock.obtain must be mappable" + "\n",
+ mBlock.isMappable());
+ mBuffer = mBlock.map();
+ mOffset = 0;
+ }
+
+ public void recycle() {
+ if (mBlock != null) {
+ mBlock.recycle();
+ mBlock = null;
+ }
+ mBuffer = null;
+ mOffset = 0;
+ }
+ }
+
+ public CodecDecoderBlockModelTestBase(String decoder, String mediaType, String testFile,
+ String allTestParams) {
+ super(decoder, mediaType, testFile, allTestParams);
+ }
+
+ @After
+ public void tearDownCodecDecoderBlockModelTestBase() {
+ mLinearInputBlock.recycle();
+ }
+
+ @Override
+ protected void configureCodec(MediaFormat format, boolean isAsyncUnUsed,
+ boolean signalEOSWithLastFrameUnUsed, boolean isEncoder) {
+ if (ENABLE_LOGS) {
+ if (!isAsyncUnUsed) {
+ Log.d(LOG_TAG, "Ignoring synchronous mode of operation request");
+ }
+ if (!signalEOSWithLastFrameUnUsed) {
+ Log.d(LOG_TAG, "Ignoring signal eos separately request");
+ }
+ }
+ configureCodec(format, true, true, isEncoder, MediaCodec.CONFIGURE_FLAG_USE_BLOCK_MODEL);
+ }
+
+ @Override
+ protected void resetContext(boolean isAsync, boolean signalEOSWithLastFrame) {
+ mLinearInputBlock.recycle();
+ super.resetContext(isAsync, signalEOSWithLastFrame);
+ }
+
+ @Override
+ void enqueueCodecConfig(int bufferIndex) {
+ throw new RuntimeException("In block model mode, client MUST NOT submit csd(s) explicitly."
+ + " These are to be sent via format during configure");
+ }
+
+ @Override
+ protected void enqueueInput(int bufferIndex) {
+ int sampleSize = (int) mExtractor.getSampleSize();
+ if (mLinearInputBlock.getOffset() + sampleSize > mLinearInputBlock.getBufferCapacity()) {
+ int requestSize = 8192;
+ requestSize = Math.max(sampleSize, requestSize);
+ mLinearInputBlock.allocateBlock(mCodecName, requestSize);
+ }
+ long pts = mExtractor.getSampleTime();
+ mExtractor.readSampleData(mLinearInputBlock.getBuffer(), mLinearInputBlock.getOffset());
+ int extractorFlags = mExtractor.getSampleFlags();
+ int codecFlags = 0;
+ if ((extractorFlags & MediaExtractor.SAMPLE_FLAG_SYNC) != 0) {
+ codecFlags |= MediaCodec.BUFFER_FLAG_KEY_FRAME;
+ }
+ if ((extractorFlags & MediaExtractor.SAMPLE_FLAG_PARTIAL_FRAME) != 0) {
+ codecFlags |= MediaCodec.BUFFER_FLAG_PARTIAL_FRAME;
+ }
+ if (!mExtractor.advance() && mSignalEOSWithLastFrame) {
+ codecFlags |= MediaCodec.BUFFER_FLAG_END_OF_STREAM;
+ mSawInputEOS = true;
+ }
+ if (ENABLE_LOGS) {
+ Log.v(LOG_TAG, "input: id: " + bufferIndex + " size: " + sampleSize + " pts: " + pts
+ + " flags: " + codecFlags);
+ }
+ MediaCodec.QueueRequest request = mCodec.getQueueRequest(bufferIndex);
+ request.setLinearBlock(mLinearInputBlock.getBlock(), mLinearInputBlock.getOffset(),
+ sampleSize);
+ request.setPresentationTimeUs(pts);
+ request.setFlags(codecFlags);
+ request.queue();
+ if (sampleSize > 0 && (codecFlags & (MediaCodec.BUFFER_FLAG_CODEC_CONFIG
+ | MediaCodec.BUFFER_FLAG_PARTIAL_FRAME)) == 0) {
+ mOutputBuff.saveInPTS(pts);
+ mInputCount++;
+ mLinearInputBlock.setOffset(mLinearInputBlock.getOffset() + sampleSize);
+ }
+ }
+
+ @Override
+ protected void dequeueOutput(int bufferIndex, MediaCodec.BufferInfo info) {
+ MediaCodec.OutputFrame frame = mCodec.getOutputFrame(bufferIndex);
+ long framePts = frame.getPresentationTimeUs();
+ long infoPts = info.presentationTimeUs;
+ int frameFlags = frame.getFlags();
+ int infoFlags = info.flags;
+ assertEquals("presentation timestamps from OutputFrame does not match with the value "
+ + "obtained from callback: framePts=" + framePts + ", infoPts=" + infoPts + "\n"
+ + mTestConfig + mTestEnv, framePts, infoPts);
+ assertEquals("Flags from OutputFrame does not match with the value obtained from "
+ + "callback: frameFlags=" + frameFlags + ", infoFlags=" + infoFlags + "\n"
+ + mTestConfig + mTestEnv, frameFlags, infoFlags);
+ if (info.size > 0 && mSaveToMem) {
+ flattenBufferInfo(info, mIsAudio);
+ mOutputBuff.checksum(mFlatBuffer, mFlatBuffer.limit());
+ if (frame.getLinearBlock() != null) {
+ ByteBuffer buf = frame.getLinearBlock().map();
+ mOutputBuff.checksum(buf, info.size);
+ mOutputBuff.saveToMemory(buf, info);
+ frame.getLinearBlock().recycle();
+ }
+ }
+ if ((infoFlags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
+ mSawOutputEOS = true;
+ }
+ if (ENABLE_LOGS) {
+ Log.v(LOG_TAG, "output: id: " + bufferIndex + " flags: " + infoFlags + " size: "
+ + info.size + " timestamp: " + infoPts);
+ }
+ if (info.size > 0 && (infoFlags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) == 0) {
+ mOutputBuff.saveOutPTS(infoPts);
+ mOutputCount++;
+ }
+ mCodec.releaseOutputBuffer(bufferIndex, false);
+ }
+}
diff --git a/tests/media/common/src/android/mediav2/common/cts/CodecDecoderMultiAccessUnitTestBase.java b/tests/media/common/src/android/mediav2/common/cts/CodecDecoderMultiAccessUnitTestBase.java
new file mode 100644
index 0000000..cf8bcb0
--- /dev/null
+++ b/tests/media/common/src/android/mediav2/common/cts/CodecDecoderMultiAccessUnitTestBase.java
@@ -0,0 +1,256 @@
+/*
+ * Copyright (C) 2024 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.mediav2.common.cts;
+
+import static org.junit.Assert.assertTrue;
+
+import android.media.AudioFormat;
+import android.media.MediaCodec;
+import android.media.MediaExtractor;
+import android.media.MediaFormat;
+import android.os.Build;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.util.Log;
+import android.util.Pair;
+
+import androidx.test.filters.SdkSuppress;
+
+import com.android.media.codec.flags.Flags;
+
+import org.junit.Assert;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.ArrayDeque;
+import java.util.Locale;
+
+/**
+ * Wrapper class for trying and testing mediacodec decoder components in large buffer mode
+ */
+@SdkSuppress(minSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM, codeName = "VanillaIceCream")
+@RequiresFlagsEnabled(Flags.FLAG_LARGE_AUDIO_FRAME)
+public class CodecDecoderMultiAccessUnitTestBase extends CodecDecoderTestBase {
+ private static final String LOG_TAG = CodecDecoderMultiAccessUnitTestBase.class.getSimpleName();
+
+ protected final CodecAsyncHandlerMultiAccessUnits mAsyncHandleMultiAccessUnits =
+ new CodecAsyncHandlerMultiAccessUnits();
+ protected int mMaxOutputSizeBytes;
+ protected int mMaxInputLimitMs;
+
+ public CodecDecoderMultiAccessUnitTestBase(String decoder, String mediaType, String testFile,
+ String allTestParams) {
+ super(decoder, mediaType, testFile, allTestParams);
+ mAsyncHandle = mAsyncHandleMultiAccessUnits;
+ }
+
+ public static float getCompressionRatio(String mediaType) {
+ switch (mediaType) {
+ case MediaFormat.MIMETYPE_AUDIO_FLAC:
+ return 0.7f;
+ case MediaFormat.MIMETYPE_AUDIO_G711_MLAW:
+ case MediaFormat.MIMETYPE_AUDIO_G711_ALAW:
+ case MediaFormat.MIMETYPE_AUDIO_MSGSM:
+ return 0.5f;
+ case MediaFormat.MIMETYPE_AUDIO_RAW:
+ return 1.0f;
+ }
+ return 0.1f;
+ }
+
+ @Override
+ protected void resetContext(boolean isAsync, boolean signalEOSWithLastFrame) {
+ super.resetContext(isAsync, signalEOSWithLastFrame);
+ mMaxOutputSizeBytes = 0;
+ mMaxInputLimitMs = 0;
+ }
+
+ @Override
+ protected void enqueueInput(int bufferIndex) {
+ if (mExtractor.getSampleSize() < 0) {
+ enqueueEOS(bufferIndex);
+ } else {
+ ArrayDeque<MediaCodec.BufferInfo> infos = new ArrayDeque<>();
+ ByteBuffer inputBuffer = mCodec.getInputBuffer(bufferIndex);
+ Assert.assertNotNull("error, getInputBuffer returned null.\n" + mTestConfig + mTestEnv,
+ inputBuffer);
+ int offset = 0;
+ int basePts = (int) mExtractor.getSampleTime();
+ while (true) {
+ int size = (int) mExtractor.getSampleSize();
+ if (size <= 0) break;
+ int deltaPts = (int) mExtractor.getSampleTime() - basePts;
+ assertTrue("Difference between basePts: " + basePts + " and current pts: "
+ + mExtractor.getSampleTime() + " should be greater than or equal "
+ + "to zero.\n" + mTestConfig + mTestEnv, deltaPts >= 0);
+ if (deltaPts / 1000 > mMaxInputLimitMs) {
+ break;
+ }
+ if (offset + size <= inputBuffer.capacity()) {
+ mExtractor.readSampleData(inputBuffer, offset);
+ } else {
+ if (offset == 0) {
+ throw new RuntimeException(String.format(Locale.getDefault(),
+ "access unit size %d exceeds capacity of the buffer %d, unable to "
+ + "queue input", size, inputBuffer.capacity()));
+ }
+ break;
+ }
+ int extractorFlags = mExtractor.getSampleFlags();
+ long pts = mExtractor.getSampleTime();
+ int codecFlags = 0;
+ if ((extractorFlags & MediaExtractor.SAMPLE_FLAG_SYNC) != 0) {
+ codecFlags |= MediaCodec.BUFFER_FLAG_KEY_FRAME;
+ }
+ if ((extractorFlags & MediaExtractor.SAMPLE_FLAG_PARTIAL_FRAME) != 0) {
+ codecFlags |= MediaCodec.BUFFER_FLAG_PARTIAL_FRAME;
+ }
+ if (!mExtractor.advance() && mSignalEOSWithLastFrame) {
+ codecFlags |= MediaCodec.BUFFER_FLAG_END_OF_STREAM;
+ mSawInputEOS = true;
+ }
+ MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo();
+ bufferInfo.set(offset, size, pts, codecFlags);
+ offset += bufferInfo.size;
+ infos.add(bufferInfo);
+ }
+ if (infos.size() > 0) {
+ mCodec.queueInputBuffers(bufferIndex, infos);
+ for (MediaCodec.BufferInfo info : infos) {
+ if (info.size > 0 && (info.flags & (MediaCodec.BUFFER_FLAG_CODEC_CONFIG
+ | MediaCodec.BUFFER_FLAG_PARTIAL_FRAME)) == 0) {
+ mOutputBuff.saveInPTS(info.presentationTimeUs);
+ mInputCount++;
+ }
+ if (ENABLE_LOGS) {
+ Log.v(LOG_TAG, "input: id: " + bufferIndex + " size: " + info.size
+ + " pts: " + info.presentationTimeUs + " flags: " + info.flags);
+ }
+ }
+ }
+ }
+ }
+
+ private void validateOutputFormat(MediaFormat outFormat) {
+ Assert.assertTrue("Output format " + outFormat + " does not contain key "
+ + MediaFormat.KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE + ". \n"
+ + mTestConfig + mTestEnv,
+ outFormat.containsKey(MediaFormat.KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE));
+ mMaxOutputSizeBytes = outFormat.getInteger(MediaFormat.KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE);
+ }
+
+ private void dequeueOutputs(int bufferIndex, ArrayDeque<MediaCodec.BufferInfo> infos) {
+ if (ENABLE_LOGS) {
+ Log.v(LOG_TAG, "output: id: " + bufferIndex);
+ }
+ if (mOutputCount == 0) {
+ validateOutputFormat(mCodec.getOutputFormat(bufferIndex));
+ }
+ ByteBuffer buf = mCodec.getOutputBuffer(bufferIndex);
+ int totalSize = 0;
+ for (MediaCodec.BufferInfo info : infos) {
+ Assert.assertNotNull("received null entry in dequeueOutput infos list. \n"
+ + mTestConfig + mTestEnv, info);
+ if (info.size > 0 && mSaveToMem) {
+ mOutputBuff.saveToMemory(buf, info);
+ }
+ if ((info.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
+ mSawOutputEOS = true;
+ }
+ if (ENABLE_LOGS) {
+ Log.v(LOG_TAG, " flags: " + info.flags + " size: " + info.size + " timestamp: "
+ + info.presentationTimeUs);
+ }
+ if (info.size > 0 && ((info.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) == 0)) {
+ mOutputBuff.saveOutPTS(info.presentationTimeUs);
+ mOutputCount++;
+ }
+ totalSize += info.size;
+ }
+ assertTrue("Sum of all info sizes: " + totalSize + " exceeds max output size: "
+ + mMaxOutputSizeBytes + " \n" + mTestConfig + mTestEnv,
+ totalSize <= mMaxOutputSizeBytes);
+ mCodec.releaseOutputBuffer(bufferIndex, false);
+ }
+
+ @Override
+ protected void doWork(int frameLimit) throws InterruptedException, IOException {
+ // dequeue output after inputEOS is expected to be done in waitForAllOutputs()
+ while (!mAsyncHandleMultiAccessUnits.hasSeenError() && !mSawInputEOS
+ && mInputCount < frameLimit) {
+ Pair<Integer, ArrayDeque<MediaCodec.BufferInfo>> element =
+ mAsyncHandleMultiAccessUnits.getWorkList();
+ if (element != null) {
+ int bufferID = element.first;
+ ArrayDeque<MediaCodec.BufferInfo> infos = element.second;
+ if (infos != null) {
+ // <id, infos> corresponds to output callback. Handle it accordingly
+ dequeueOutputs(bufferID, infos);
+ } else {
+ // <id, null> corresponds to input callback. Handle it accordingly
+ enqueueInput(bufferID);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void queueEOS() throws InterruptedException {
+ while (!mAsyncHandleMultiAccessUnits.hasSeenError() && !mSawInputEOS) {
+ Pair<Integer, ArrayDeque<MediaCodec.BufferInfo>> element =
+ mAsyncHandleMultiAccessUnits.getWorkList();
+ if (element != null) {
+ int bufferID = element.first;
+ ArrayDeque<MediaCodec.BufferInfo> infos = element.second;
+ if (infos != null) {
+ dequeueOutputs(bufferID, infos);
+ } else {
+ enqueueEOS(element.first);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void waitForAllOutputs() throws InterruptedException {
+ while (!mAsyncHandleMultiAccessUnits.hasSeenError() && !mSawOutputEOS) {
+ Pair<Integer, ArrayDeque<MediaCodec.BufferInfo>> element =
+ mAsyncHandleMultiAccessUnits.getOutputs();
+ if (element != null) {
+ dequeueOutputs(element.first, element.second);
+ }
+ }
+ validateTestState();
+ }
+
+ protected void configureKeysForLargeAudioFrameMode(MediaFormat format, int maxInputSizeInBytes,
+ int maxOutSizeInMs, int thresOutSizeInMs) {
+ int bytesPerSample = AudioFormat.getBytesPerSample(
+ format.getInteger(MediaFormat.KEY_PCM_ENCODING, AudioFormat.ENCODING_PCM_16BIT));
+ int sampleRate = format.getInteger(MediaFormat.KEY_SAMPLE_RATE);
+ int channelCount = format.getInteger(MediaFormat.KEY_CHANNEL_COUNT);
+ int maxOutputSize = (maxOutSizeInMs * bytesPerSample * sampleRate * channelCount) / 1000;
+ int maxInputSize = Math.max(maxInputSizeInBytes,
+ (int) (maxOutputSize * getCompressionRatio(mMediaType)));
+ int thresholdOutputSize =
+ (thresOutSizeInMs * bytesPerSample * sampleRate * channelCount) / 1000;
+ format.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE, maxInputSize);
+ format.setInteger(MediaFormat.KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE, maxOutputSize);
+ format.setInteger(MediaFormat.KEY_BUFFER_BATCH_THRESHOLD_OUTPUT_SIZE,
+ thresholdOutputSize);
+ }
+}
+
diff --git a/tests/media/common/src/android/mediav2/common/cts/CodecDecoderTestBase.java b/tests/media/common/src/android/mediav2/common/cts/CodecDecoderTestBase.java
index 828b6db..415f140 100644
--- a/tests/media/common/src/android/mediav2/common/cts/CodecDecoderTestBase.java
+++ b/tests/media/common/src/android/mediav2/common/cts/CodecDecoderTestBase.java
@@ -56,9 +56,9 @@
protected boolean mSkipChecksumVerification;
protected final ArrayList<ByteBuffer> mCsdBuffers;
- private int mCurrCsdIdx;
+ protected int mCurrCsdIdx;
- private final ByteBuffer mFlatBuffer = ByteBuffer.allocate(4 * Integer.BYTES);
+ protected final ByteBuffer mFlatBuffer = ByteBuffer.allocate(4 * Integer.BYTES);
protected MediaExtractor mExtractor;
@@ -83,6 +83,33 @@
}
}
+ public static int getMaxSampleSizeForMediaType(String fileName, String mediaType)
+ throws IOException {
+ Preconditions.assertTestFileExists(fileName);
+ int maxSampleSize = 0;
+ MediaExtractor extractor = new MediaExtractor();
+ extractor.setDataSource(fileName);
+ for (int trackID = 0; trackID < extractor.getTrackCount(); trackID++) {
+ MediaFormat format = extractor.getTrackFormat(trackID);
+ if (mediaType.equalsIgnoreCase(format.getString(MediaFormat.KEY_MIME))) {
+ extractor.selectTrack(trackID);
+ if (format.containsKey(MediaFormat.KEY_MAX_INPUT_SIZE)) {
+ maxSampleSize = format.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE);
+ } else {
+ int size;
+ while ((size = (int) extractor.getSampleSize()) != -1) {
+ maxSampleSize = Math.max(maxSampleSize, size);
+ extractor.advance();
+ }
+ }
+ extractor.release();
+ return maxSampleSize;
+ }
+ }
+ fail("No track with mediaType: " + mediaType + " found in file: " + fileName + "\n");
+ return maxSampleSize;
+ }
+
protected MediaFormat setUpSource(String srcFile) throws IOException {
Preconditions.assertTestFileExists(srcFile);
mExtractor = new MediaExtractor();
@@ -90,6 +117,13 @@
for (int trackID = 0; trackID < mExtractor.getTrackCount(); trackID++) {
MediaFormat format = mExtractor.getTrackFormat(trackID);
if (mMediaType.equalsIgnoreCase(format.getString(MediaFormat.KEY_MIME))) {
+ // This is required for some mlaw and alaw test vectors where access unit size is
+ // exceeding default max input size
+ if (mMediaType.equalsIgnoreCase(MediaFormat.MIMETYPE_AUDIO_G711_ALAW)
+ || mMediaType.equalsIgnoreCase(MediaFormat.MIMETYPE_AUDIO_G711_MLAW)) {
+ format.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE,
+ getMaxSampleSizeForMediaType(srcFile, mMediaType));
+ }
mExtractor.selectTrack(trackID);
if (mIsVideo) {
ArrayList<MediaFormat> formatList = new ArrayList<>();
@@ -154,7 +188,7 @@
return format.containsKey("csd-0");
}
- void flattenBufferInfo(MediaCodec.BufferInfo info, boolean isAudio) {
+ protected void flattenBufferInfo(MediaCodec.BufferInfo info, boolean isAudio) {
if (isAudio) {
mFlatBuffer.putInt(info.size);
}
@@ -235,7 +269,7 @@
flattenBufferInfo(info, mIsAudio);
mOutputBuff.checksum(mFlatBuffer, mFlatBuffer.limit());
if (mIsAudio) {
- mOutputBuff.checksum(buf, info.size);
+ mOutputBuff.checksum(buf, info);
mOutputBuff.saveToMemory(buf, info);
} else {
// tests both getOutputImage and getOutputBuffer. Can do time division
@@ -322,7 +356,7 @@
}
}
- void validateTestState() {
+ protected void validateTestState() {
super.validateTestState();
if (!mOutputBuff.isPtsStrictlyIncreasing(mPrevOutputPts)) {
fail("Output timestamps are not strictly increasing \n" + mTestConfig + mTestEnv
@@ -338,10 +372,10 @@
}
}
- public void decodeToMemory(String file, String decoder, long pts, int mode, int frameLimit)
- throws IOException, InterruptedException {
+ public void decodeToMemory(String file, String decoder, OutputManager outputBuff, long pts,
+ int mode, int frameLimit) throws IOException, InterruptedException {
mSaveToMem = true;
- mOutputBuff = new OutputManager();
+ mOutputBuff = outputBuff;
mCodec = MediaCodec.createByCodecName(decoder);
MediaFormat format = setUpSource(file);
configureCodec(format, false, true, false);
@@ -356,6 +390,11 @@
mSaveToMem = false;
}
+ public void decodeToMemory(String file, String decoder, long pts, int mode, int frameLimit)
+ throws IOException, InterruptedException {
+ decodeToMemory(file, decoder, new OutputManager(), pts, mode, frameLimit);
+ }
+
public void decodeToMemory(ByteBuffer buffer, ArrayList<MediaCodec.BufferInfo> list,
MediaFormat format, String decoder) throws IOException, InterruptedException {
mSaveToMem = true;
diff --git a/tests/media/common/src/android/mediav2/common/cts/CodecEncoderTestBase.java b/tests/media/common/src/android/mediav2/common/cts/CodecEncoderTestBase.java
index bd3466c..0ef1410 100644
--- a/tests/media/common/src/android/mediav2/common/cts/CodecEncoderTestBase.java
+++ b/tests/media/common/src/android/mediav2/common/cts/CodecEncoderTestBase.java
@@ -525,6 +525,7 @@
info.flags);
mInfoList.add(copy);
+ mOutputBuff.checksum(buf, info);
mOutputBuff.saveToMemory(buf, info);
}
if ((info.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) == 0) {
@@ -554,7 +555,7 @@
}
@Override
- public void waitForAllOutputs() throws InterruptedException {
+ protected void waitForAllOutputs() throws InterruptedException {
super.waitForAllOutputs();
if (mMuxOutput) {
if (mTrackID != -1) {
@@ -610,7 +611,7 @@
return mMuxedOutputFile;
}
- void validateTestState() {
+ protected void validateTestState() {
super.validateTestState();
if ((mIsAudio || (mIsVideo && mActiveEncCfg.mMaxBFrames == 0))
&& !mOutputBuff.isPtsStrictlyIncreasing(mPrevOutputPts)) {
diff --git a/tests/media/common/src/android/mediav2/common/cts/CodecTestBase.java b/tests/media/common/src/android/mediav2/common/cts/CodecTestBase.java
index 40d0047..50e815d 100644
--- a/tests/media/common/src/android/mediav2/common/cts/CodecTestBase.java
+++ b/tests/media/common/src/android/mediav2/common/cts/CodecTestBase.java
@@ -32,6 +32,7 @@
import android.hardware.camera2.CameraMetadata;
import android.hardware.camera2.params.DynamicRangeProfiles;
import android.hardware.display.DisplayManager;
+import android.media.Image;
import android.media.MediaCodec;
import android.media.MediaCodecInfo;
import android.media.MediaCodecInfo.CodecCapabilities;
@@ -66,8 +67,10 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.IntStream;
@@ -130,6 +133,10 @@
public static final boolean BOARD_SDK_IS_AT_LEAST_T =
SystemProperties.getInt("ro.board.api_level", Build.VERSION_CODES.CUR_DEVELOPMENT)
>= Build.VERSION_CODES.TIRAMISU;
+ public static final int ANDROID_VENDOR_API_202404 = 202404;
+ public static final boolean BOARD_SDK_IS_AT_LEAST_202404 =
+ SystemProperties.getInt("ro.board.api_level", Build.VERSION_CODES.CUR_DEVELOPMENT)
+ >= ANDROID_VENDOR_API_202404;
public static final boolean IS_HDR_EDITING_SUPPORTED;
public static final boolean IS_HDR_CAPTURE_SUPPORTED;
private static final String LOG_TAG = CodecTestBase.class.getSimpleName();
@@ -340,7 +347,7 @@
protected final boolean mIsAudio;
protected final boolean mIsVideo;
- protected final CodecAsyncHandler mAsyncHandle;
+ protected CodecAsyncHandler mAsyncHandle;
protected boolean mIsCodecInAsyncMode;
protected boolean mSawInputEOS;
protected boolean mSawOutputEOS;
@@ -363,6 +370,7 @@
// This doesn't own the handle. The ownership with instances that manage
// SurfaceView or TextureView, ... They hold the responsibility of calling release().
protected CodecTestActivity mActivity;
+ protected ImageSurface mImageSurface;
public static final MediaCodecList MEDIA_CODEC_LIST_ALL;
public static final MediaCodecList MEDIA_CODEC_LIST_REGULAR;
@@ -477,7 +485,16 @@
public static void checkFormatSupport(String codecName, String mediaType, boolean isEncoder,
ArrayList<MediaFormat> formats, String[] features, SupportClass supportRequirements)
throws IOException {
- if (!areFormatsSupported(codecName, mediaType, formats)) {
+ boolean hasSupport = true;
+ if (formats != null) {
+ hasSupport &= areFormatsSupported(codecName, mediaType, formats);
+ }
+ if (features != null) {
+ for (String feature : features) {
+ hasSupport &= isFeatureSupported(codecName, mediaType, feature);
+ }
+ }
+ if (!hasSupport) {
switch (supportRequirements) {
case CODEC_ALL:
fail("format(s) not supported by codec: " + codecName + " for mediaType : "
@@ -684,6 +701,20 @@
return false;
}
+ /**
+ * Stop the current codec session and transfer component to uninitialized state.
+ * <p>
+ * Some legacy OMX components do not properly clear the internal state at stop().
+ * Workaround the issue with resetting the component.
+ */
+ public static void endCodecSession(MediaCodec codec) {
+ if (codec.getName().toUpperCase(Locale.getDefault()).startsWith("OMX")) {
+ codec.reset();
+ } else {
+ codec.stop();
+ }
+ }
+
protected static String paramToString(Object[] param) {
StringBuilder paramStr = new StringBuilder("[ ");
for (int j = 0; j < param.length - 1; j++) {
@@ -1048,6 +1079,10 @@
mActivity.finish();
mActivity = null;
}
+ if (mImageSurface != null) {
+ mImageSurface.release();
+ mImageSurface = null;
+ }
if (mCodec != null) {
mCodec.release();
mCodec = null;
@@ -1056,16 +1091,27 @@
protected void configureCodec(MediaFormat format, boolean isAsync,
boolean signalEOSWithLastFrame, boolean isEncoder) {
+ configureCodec(format, isAsync, signalEOSWithLastFrame, isEncoder, 0);
+ }
+
+ protected void configureCodec(MediaFormat format, boolean isAsync,
+ boolean signalEOSWithLastFrame, boolean isEncoder, int flag) {
+ if (IS_AT_LEAST_R && ((flag & MediaCodec.CONFIGURE_FLAG_USE_BLOCK_MODEL) != 0)) {
+ if (!isAsync || !signalEOSWithLastFrame) {
+ throw new RuntimeException("Block model feature testing requires mode of operation"
+ + " to be asynchronous and eos to be signalled along with last frame");
+ }
+ }
resetContext(isAsync, signalEOSWithLastFrame);
mAsyncHandle.setCallBack(mCodec, isAsync);
// signalEOS flag has nothing to do with configure. We are using this flag to try all
// available configure apis
if (signalEOSWithLastFrame) {
mCodec.configure(format, mSurface, null,
- isEncoder ? MediaCodec.CONFIGURE_FLAG_ENCODE : 0);
+ (isEncoder ? MediaCodec.CONFIGURE_FLAG_ENCODE : 0) | flag);
} else {
- mCodec.configure(format, mSurface, isEncoder ? MediaCodec.CONFIGURE_FLAG_ENCODE : 0,
- null);
+ mCodec.configure(format, mSurface,
+ (isEncoder ? MediaCodec.CONFIGURE_FLAG_ENCODE : 0) | flag, null);
}
mTestEnv.setLength(0);
mTestEnv.append("################### Test Environment #####################\n");
@@ -1358,4 +1404,12 @@
assertNotNull("Surface created is null \n" + mTestConfig + mTestEnv, mSurface);
assertTrue("Surface created is invalid \n" + mTestConfig + mTestEnv, mSurface.isValid());
}
+
+ protected void setUpSurface(int width, int height, int format, int maxImages,
+ Function<Image, Boolean> predicate) {
+ mImageSurface.createSurface(width, height, format, maxImages, predicate);
+ mSurface = mImageSurface.getSurface();
+ assertNotNull("Surface created is null \n" + mTestConfig + mTestEnv, mSurface);
+ assertTrue("Surface created is invalid \n" + mTestConfig + mTestEnv, mSurface.isValid());
+ }
}
diff --git a/tests/media/common/src/android/mediav2/common/cts/DecodeStreamToYuv.java b/tests/media/common/src/android/mediav2/common/cts/DecodeStreamToYuv.java
index 5c3b741..bd03bd5 100644
--- a/tests/media/common/src/android/mediav2/common/cts/DecodeStreamToYuv.java
+++ b/tests/media/common/src/android/mediav2/common/cts/DecodeStreamToYuv.java
@@ -108,7 +108,7 @@
.build();
}
- static MediaFormat getFormatInStream(String mediaType, String file) throws IOException {
+ public static MediaFormat getFormatInStream(String mediaType, String file) throws IOException {
File tmp = new File(file);
if (!tmp.exists()) {
throw new FileNotFoundException("Test Setup Error, missing file: " + file);
diff --git a/tests/media/common/src/android/mediav2/common/cts/HDREncoderTestBase.java b/tests/media/common/src/android/mediav2/common/cts/HDREncoderTestBase.java
index 7ae2420..a2c1bed 100644
--- a/tests/media/common/src/android/mediav2/common/cts/HDREncoderTestBase.java
+++ b/tests/media/common/src/android/mediav2/common/cts/HDREncoderTestBase.java
@@ -116,7 +116,7 @@
int frameLimit = 4;
if (mHdrDynamicInfo != null) {
mTotalMetadataQueued = new ArrayList<>();
- mHdrDynamicInfoReceived = new HashMap();
+ mHdrDynamicInfoReceived = new HashMap<>();
Long lastHdr10PlusFramePts =
Collections.max(mHdrDynamicInfo.entrySet(), Map.Entry.comparingByKey())
.getKey();
diff --git a/tests/media/common/src/android/mediav2/common/cts/ImageSurface.java b/tests/media/common/src/android/mediav2/common/cts/ImageSurface.java
new file mode 100644
index 0000000..00c0a7a
--- /dev/null
+++ b/tests/media/common/src/android/mediav2/common/cts/ImageSurface.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2023 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.mediav2.common.cts;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import android.media.Image;
+import android.media.ImageReader;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.util.Log;
+import android.util.Pair;
+import android.view.Surface;
+
+import java.util.ArrayDeque;
+import java.util.Locale;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.function.Function;
+
+/**
+ * Wrapper class to hold surface provided by ImageReader.
+ */
+public class ImageSurface implements ImageReader.OnImageAvailableListener {
+ private static final String LOG_TAG = ImageSurface.class.getSimpleName();
+
+ private final ArrayDeque<Pair<Image, Exception>> mQueue = new ArrayDeque<>();
+ private final Lock mLock = new ReentrantLock();
+ private final Condition mCondition = mLock.newCondition();
+ private ImageReader mReader;
+ private Surface mReaderSurface;
+ private HandlerThread mHandlerThread;
+ private Handler mHandler;
+ private Function<Image, Boolean> mPredicate;
+
+ @Override
+ public void onImageAvailable(ImageReader reader) {
+ mLock.lock();
+ try {
+ if (mQueue.size() == reader.getMaxImages()) {
+ Log.w(LOG_TAG, "image queue is at full capacity, releasing oldest image to"
+ + " make space for image just received");
+ releaseImage(mQueue.poll());
+ }
+ Image image = reader.acquireNextImage();
+ Log.d(LOG_TAG, "received image" + image);
+ mQueue.add(Pair.create(image, null /* Exception */));
+ mCondition.signalAll();
+ } catch (Exception e) {
+ Log.e(LOG_TAG, "Can't handle Exceptions in onImageAvailable " + e);
+ mQueue.add(Pair.create(null /* Image */, e));
+ } finally {
+ mLock.unlock();
+ }
+ }
+
+ public Image getImage(long timeout) throws InterruptedException {
+ int retry = 3;
+ Image image = null;
+ mLock.lock();
+ try {
+ while (mQueue.size() == 0 && retry > 0) {
+ if (!mCondition.await(timeout, TimeUnit.MILLISECONDS)) {
+ retry--;
+ }
+ }
+ if (mQueue.size() > 0) {
+ Pair<Image, Exception> imageResult = mQueue.poll();
+ assertNotNull("bad element in image queue", imageResult);
+ image = imageResult.first;
+ Exception e = imageResult.second;
+ assertNull("onImageAvailable() generated an exception: " + e, e);
+ assertNotNull("Wait for an image timed out in " + timeout + "ms", image);
+ }
+ } finally {
+ mLock.unlock();
+ }
+ return image;
+ }
+
+ public void createSurface(int width, int height, int format, int maxNumImages,
+ Function<Image, Boolean> predicate) {
+ if (mReader != null) {
+ throw new RuntimeException(
+ "Current instance of ImageSurface already has a weak reference to some "
+ + "surface, release older surface or reuse it");
+ }
+ mHandlerThread = new HandlerThread(LOG_TAG);
+ mHandlerThread.start();
+ mHandler = new Handler(mHandlerThread.getLooper());
+ mReader = ImageReader.newInstance(width, height, format, maxNumImages);
+ mReader.setOnImageAvailableListener(this, mHandler);
+ mReaderSurface = mReader.getSurface();
+ mPredicate = predicate;
+ Log.v(LOG_TAG, String.format(Locale.getDefault(), "Created ImageReader size (%dx%d),"
+ + " format %d, maxNumImages %d", width, height, format, maxNumImages));
+ }
+
+ public Surface getSurface() {
+ return mReaderSurface;
+ }
+
+ private void releaseImage(Pair<Image, Exception> imageResult) {
+ assertNotNull("bad element in image queue", imageResult);
+ Image image = imageResult.first;
+ Exception e = imageResult.second;
+ assertNull("onImageAvailable() generated an exception: " + e, e);
+ assertNotNull("received null for image", image);
+ if (mPredicate != null) {
+ assertTrue("predicate failed on image instance", mPredicate.apply(image));
+ }
+ image.close();
+ }
+
+ public void release() {
+ mReaderSurface = null;
+ if (mReader != null) {
+ mLock.lock();
+ try {
+ mQueue.forEach(this::releaseImage);
+ mQueue.clear();
+ Image image = mReader.acquireLatestImage();
+ if (image != null) {
+ image.close();
+ }
+ } finally {
+ mReader.close();
+ mReader = null;
+ mLock.unlock();
+ }
+ }
+ if (mHandlerThread != null) {
+ mHandlerThread.quitSafely();
+ mHandlerThread = null;
+ }
+ mHandler = null;
+ }
+}
diff --git a/tests/media/common/src/android/mediav2/common/cts/OutputManager.java b/tests/media/common/src/android/mediav2/common/cts/OutputManager.java
index 0caca62..5ddf121 100644
--- a/tests/media/common/src/android/mediav2/common/cts/OutputManager.java
+++ b/tests/media/common/src/android/mediav2/common/cts/OutputManager.java
@@ -44,7 +44,7 @@
* in memory and outPtsList fields of this class. For video decoders, the decoded information can
* be overwhelming as it is uncompressed YUV. For them we compute the CRC32 checksum of the
* output image and buffer and store it instead.
- *
+ * <p>
* ByteBuffer output of encoder/decoder components can be written to disk by setting ENABLE_DUMP
* to true. Exercise CAUTION while running tests with ENABLE_DUMP set to true as this will crowd
* the storage with files. These files are configured to be deleted on exit. So, in order to see
@@ -106,10 +106,11 @@
mErrorLogs.append("Frame indices around which timestamp values decreased :- \n");
for (int j = Math.max(0, i - 3); j < Math.min(mOutPtsList.size(), i + 3); j++) {
if (j == 0) {
- mErrorLogs.append(String.format("pts of frame idx -1 is %d \n", lastPts));
+ mErrorLogs.append(String.format(Locale.getDefault(),
+ "pts of frame idx -1 is %d \n", lastPts));
}
- mErrorLogs.append(String.format("pts of frame idx %d is %d \n", j,
- mOutPtsList.get(j)));
+ mErrorLogs.append(String.format(Locale.getDefault(),
+ "pts of frame idx %d is %d \n", j, mOutPtsList.get(j)));
}
res = false;
break;
@@ -123,8 +124,10 @@
boolean res = true;
if (refList.size() != testList.size()) {
msg.append("Reference and test timestamps list sizes are not identical \n");
- msg.append(String.format("reference pts list size is %d \n", refList.size()));
- msg.append(String.format("test pts list size is %d \n", testList.size()));
+ msg.append(String.format(Locale.getDefault(), "reference pts list size is %d \n",
+ refList.size()));
+ msg.append(String.format(Locale.getDefault(), "test pts list size is %d \n",
+ testList.size()));
res = false;
}
for (int i = 0; i < Math.min(refList.size(), testList.size()); i++) {
@@ -171,6 +174,13 @@
checksum(buf, size, 0, 0, 0, 0);
}
+ public void checksum(ByteBuffer buf, MediaCodec.BufferInfo info) {
+ int pos = buf.position();
+ buf.position(info.offset);
+ checksum(buf, info.size, 0, 0, 0, 0);
+ buf.position(pos);
+ }
+
public void checksum(ByteBuffer buf, int size, int width, int height, int stride,
int bytesPerSample) {
int cap = buf.capacity();
@@ -328,9 +338,11 @@
if (mMemIndex + info.size >= mMemory.length) {
mMemory = Arrays.copyOf(mMemory, mMemIndex + info.size);
}
+ int base = buf.position();
buf.position(info.offset);
buf.get(mMemory, mMemIndex, info.size);
mMemIndex += info.size;
+ buf.position(base);
}
void position(int index) {
@@ -449,7 +461,7 @@
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!this.equalsPtsList(o)) return false;
- if (!this.equalsByteOutput(o)) return false;
+ if (!this.equalsDequeuedOutput(o)) return false;
return true;
}
@@ -460,72 +472,22 @@
return arePtsListsIdentical(mOutPtsList, that.mOutPtsList, mSharedErrorLogs);
}
- // TODO: Timestamps for deinterlaced content are under review. (E.g. can decoders
- // produce multiple progressive frames?) For now, do not verify timestamps.
public boolean equalsByteOutput(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
OutputManager that = (OutputManager) o;
boolean isEqual = true;
- if (mCrc32UsingImage.getValue() != that.mCrc32UsingImage.getValue()) {
- isEqual = false;
- mSharedErrorLogs.append("CRC32 checksums computed for image buffers received from "
- + "getOutputImage() do not match between ref and test runs. \n");
- mSharedErrorLogs.append(String.format("Ref CRC32 checksum value is %d \n",
- mCrc32UsingImage.getValue()));
- mSharedErrorLogs.append(String.format("Test CRC32 checksum value is %d \n",
- that.mCrc32UsingImage.getValue()));
- if (ENABLE_DUMP) {
- mSharedErrorLogs.append(String.format("Decoded Ref YUV file is at : %s \n",
- mOutFileYuv.getAbsolutePath()));
- mSharedErrorLogs.append(String.format("Decoded Test YUV file is at : %s \n",
- that.mOutFileYuv.getAbsolutePath()));
- } else {
- mSharedErrorLogs.append("As the reference YUV and test YUV are different, try "
- + "re-running the test by changing ENABLE_DUMP of OutputManager class to "
- + "'true' to dump the decoded YUVs for further analysis. \n");
- }
- }
- if (mCrc32UsingBuffer.getValue() != that.mCrc32UsingBuffer.getValue()) {
- isEqual = false;
- mSharedErrorLogs.append("CRC32 checksums computed for byte buffers received from "
- + "getOutputBuffer() do not match between ref and test runs. \n");
- mSharedErrorLogs.append(String.format("Ref CRC32 checksum value is %d \n",
- mCrc32UsingBuffer.getValue()));
- mSharedErrorLogs.append(String.format("Test CRC32 checksum value is %d \n",
- that.mCrc32UsingBuffer.getValue()));
- if (ENABLE_DUMP) {
- if (mOutFileY != null) {
- mSharedErrorLogs.append(String.format("Decoded Ref Y file is at : %s \n",
- mOutFileY.getAbsolutePath()));
- }
- if (that.mOutFileY != null) {
- mSharedErrorLogs.append(String.format("Decoded Test Y file is at : %s \n",
- that.mOutFileY.getAbsolutePath()));
- }
- if (mMemIndex > 0) {
- mSharedErrorLogs.append(
- String.format("Output Ref ByteBuffer is dumped at : %s \n",
- dumpBuffer()));
- }
- if (that.mMemIndex > 0) {
- mSharedErrorLogs.append(
- String.format("Output Test ByteBuffer is dumped at : %s \n",
- that.dumpBuffer()));
- }
- } else {
- mSharedErrorLogs.append("As the output of the component is not consistent, try "
- + "re-running the test by changing ENABLE_DUMP of OutputManager class to "
- + "'true' to dump the outputs for further analysis. \n");
- }
- if (mMemIndex == that.mMemIndex) {
+ if (mMemIndex == that.mMemIndex) {
+ if (!Arrays.equals(mMemory, that.mMemory)) {
+ isEqual = false;
int count = 0;
StringBuilder msg = new StringBuilder();
for (int i = 0; i < mMemIndex; i++) {
if (mMemory[i] != that.mMemory[i]) {
count++;
- msg.append(String.format("At offset %d, ref buffer val is %x and test "
- + "buffer val is %x \n", i, mMemory[i], that.mMemory[i]));
+ msg.append(String.format(Locale.getDefault(),
+ "At offset %d, ref buffer val is %x and test buffer val is %x \n",
+ i, mMemory[i], that.mMemory[i]));
if (count == 20) {
msg.append("stopping after 20 mismatches, ...\n");
break;
@@ -536,13 +498,78 @@
mSharedErrorLogs.append("Ref and Test outputs are not identical \n");
mSharedErrorLogs.append(msg);
}
- } else {
- mSharedErrorLogs.append("CRC32 byte buffer checksums are different because ref and"
- + " test output sizes are not identical \n");
- mSharedErrorLogs.append(String.format("Ref output buffer size %d \n", mMemIndex));
- mSharedErrorLogs.append(String.format("Test output buffer size %d \n",
- that.mMemIndex));
}
+ } else {
+ isEqual = false;
+ mSharedErrorLogs.append("ref and test output sizes are not identical \n");
+ mSharedErrorLogs.append(
+ String.format(Locale.getDefault(), "Ref output buffer size %d \n", mMemIndex));
+ mSharedErrorLogs.append(
+ String.format(Locale.getDefault(), "Test output buffer size %d \n",
+ that.mMemIndex));
+ }
+ return isEqual;
+ }
+
+ // TODO: Timestamps for deinterlaced content are under review. (E.g. can decoders
+ // produce multiple progressive frames?) For now, do not verify timestamps.
+ public boolean equalsDequeuedOutput(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ OutputManager that = (OutputManager) o;
+ boolean isEqual = true;
+ if (mCrc32UsingImage.getValue() != that.mCrc32UsingImage.getValue()) {
+ isEqual = false;
+ mSharedErrorLogs.append("CRC32 checksums computed for image buffers received from "
+ + "getOutputImage() do not match between ref and test runs. \n");
+ mSharedErrorLogs.append(String.format(Locale.getDefault(),
+ "Ref CRC32 checksum value is %d \n", mCrc32UsingImage.getValue()));
+ mSharedErrorLogs.append(String.format(Locale.getDefault(),
+ "Test CRC32 checksum value is %d \n", that.mCrc32UsingImage.getValue()));
+ if (ENABLE_DUMP) {
+ mSharedErrorLogs.append(String.format(Locale.getDefault(),
+ "Decoded Ref YUV file is at : %s \n", mOutFileYuv.getAbsolutePath()));
+ mSharedErrorLogs.append(String.format(Locale.getDefault(),
+ "Decoded Test YUV file is at : %s \n", that.mOutFileYuv.getAbsolutePath()));
+ } else {
+ mSharedErrorLogs.append("As the reference YUV and test YUV are different, try "
+ + "re-running the test by changing ENABLE_DUMP of OutputManager class to "
+ + "'true' to dump the decoded YUVs for further analysis. \n");
+ }
+ }
+ if (mCrc32UsingBuffer.getValue() != that.mCrc32UsingBuffer.getValue()) {
+ isEqual = false;
+ mSharedErrorLogs.append("CRC32 checksums computed for byte buffers received from "
+ + "getOutputBuffer() do not match between ref and test runs. \n");
+ mSharedErrorLogs.append(String.format(Locale.getDefault(),
+ "Ref CRC32 checksum value is %d \n", mCrc32UsingBuffer.getValue()));
+ mSharedErrorLogs.append(String.format(Locale.getDefault(),
+ "Test CRC32 checksum value is %d \n", that.mCrc32UsingBuffer.getValue()));
+ if (ENABLE_DUMP) {
+ if (mOutFileY != null) {
+ mSharedErrorLogs.append(String.format(Locale.getDefault(),
+ "Decoded Ref Y file is at : %s \n", mOutFileY.getAbsolutePath()));
+ }
+ if (that.mOutFileY != null) {
+ mSharedErrorLogs.append(String.format(Locale.getDefault(),
+ "Decoded Test Y file is at : %s \n", that.mOutFileY.getAbsolutePath()));
+ }
+ if (mMemIndex > 0) {
+ mSharedErrorLogs.append(String.format(Locale.getDefault(),
+ "Output Ref ByteBuffer is dumped at : %s \n", dumpBuffer()));
+ }
+ if (that.mMemIndex > 0) {
+ mSharedErrorLogs.append(String.format(Locale.getDefault(),
+ "Output Test ByteBuffer is dumped at : %s \n", that.dumpBuffer()));
+ }
+ } else {
+ mSharedErrorLogs.append("As the output of the component is not consistent, try "
+ + "re-running the test by changing ENABLE_DUMP of OutputManager class to "
+ + "'true' to dump the outputs for further analysis. \n");
+ }
+ }
+ if (!equalsByteOutput(that)) {
+ isEqual = false;
}
return isEqual;
}
diff --git a/tests/media/copy_media.sh b/tests/media/copy_media.sh
index c402f15..ad9387a 100755
--- a/tests/media/copy_media.sh
+++ b/tests/media/copy_media.sh
@@ -17,7 +17,7 @@
## script to install mediav2 test files manually
adbOptions=" "
-resLabel=CtsMediaV2TestCases-3.6
+resLabel=CtsMediaV2TestCases-4.0
srcDir="/tmp/$resLabel"
tgtDir="/sdcard/test"
usage="Usage: $0 [-h] [-s serial]"
diff --git a/tests/media/jni/NativeCodecDecoderTestCommon.cpp b/tests/media/jni/NativeCodecDecoderTestCommon.cpp
index 09ada05..1efb4cd 100644
--- a/tests/media/jni/NativeCodecDecoderTestCommon.cpp
+++ b/tests/media/jni/NativeCodecDecoderTestCommon.cpp
@@ -252,6 +252,8 @@
size_t buffSize;
uint8_t* buf = AMediaCodec_getOutputBuffer(mCodec, bufferIndex, &buffSize);
RETURN_IF_NULL(buf, std::string{"AMediaCodec_getOutputBuffer returned nullptr"})
+ // NdkMediaCodec calls ABuffer::data, which already adds offset
+ info->offset = 0;
if (mIsAudio) {
mOutputBuff->saveToMemory(buf, info);
mOutputBuff->updateChecksum(buf, info);
diff --git a/tests/media/jni/NativeCodecEncoderTest.cpp b/tests/media/jni/NativeCodecEncoderTest.cpp
index bb93b9a..530f5ad 100644
--- a/tests/media/jni/NativeCodecEncoderTest.cpp
+++ b/tests/media/jni/NativeCodecEncoderTest.cpp
@@ -275,7 +275,10 @@
size_t buffSize;
uint8_t* buf = AMediaCodec_getOutputBuffer(mCodec, bufferIndex, &buffSize);
RETURN_IF_NULL(buf, std::string{"AMediaCodec_getOutputBuffer returned nullptr"})
+ // NdkMediaCodec calls ABuffer::data, which already adds offset
+ info->offset = 0;
mOutputBuff->saveToMemory(buf, info);
+ mOutputBuff->updateChecksum(buf, info);
}
if ((info->flags & AMEDIACODEC_BUFFER_FLAG_KEY_FRAME) != 0) {
mNumSyncFramesReceived += 1;
diff --git a/tests/media/jni/NativeCodecTestBase.cpp b/tests/media/jni/NativeCodecTestBase.cpp
index 6ce937f..4f4ad61 100644
--- a/tests/media/jni/NativeCodecTestBase.cpp
+++ b/tests/media/jni/NativeCodecTestBase.cpp
@@ -309,21 +309,25 @@
bool OutputManager::equals(OutputManager* that) {
if (this == that) return true;
if (that == nullptr) return false;
- if (!equalsByteOutput(that)) return false;
+ if (!equalsDequeuedOutput(that)) return false;
if (!equalsPtsList(that)) return false;
return true;
}
-bool OutputManager::equalsByteOutput(OutputManager* that) {
+bool OutputManager::equalsDequeuedOutput(OutputManager* that) {
if (this == that) return true;
if (that == nullptr) return false;
+ bool isEqual = true;
if (crc32value != that->crc32value) {
mSharedErrorLogs->append("CRC32 checksums computed for byte buffers received from "
"getOutputBuffer() do not match between ref and test runs. \n");
mSharedErrorLogs->append(StringFormat("Ref CRC32 checksum value is %lu \n", crc32value));
mSharedErrorLogs->append(
StringFormat("Test CRC32 checksum value is %lu \n", that->crc32value));
- if (memory.size() == that->memory.size()) {
+ isEqual = false;
+ }
+ if (memory.size() == that->memory.size()) {
+ if (memory != that->memory) {
int count = 0;
for (int i = 0; i < memory.size(); i++) {
if (memory[i] != that->memory[i]) {
@@ -340,16 +344,16 @@
if (count != 0) {
mSharedErrorLogs->append("Ref and Test outputs are not identical \n");
}
- } else {
- mSharedErrorLogs->append("CRC32 byte buffer checksums are different because ref and "
- "test output sizes are not identical \n");
- mSharedErrorLogs->append(StringFormat("Ref output buffer size %d \n", memory.size()));
- mSharedErrorLogs->append(
- StringFormat("Test output buffer size %d \n", that->memory.size()));
+ isEqual = false;
}
- return false;
+ } else {
+ mSharedErrorLogs->append("ref and test output sizes are not identical \n");
+ mSharedErrorLogs->append(StringFormat("Ref output buffer size %d \n", memory.size()));
+ mSharedErrorLogs->append(
+ StringFormat("Test output buffer size %d \n", that->memory.size()));
+ isEqual = false;
}
- return true;
+ return isEqual;
}
bool OutputManager::equalsPtsList(OutputManager* that) {
diff --git a/tests/media/jni/NativeCodecTestBase.h b/tests/media/jni/NativeCodecTestBase.h
index fee087d..42d7d45 100644
--- a/tests/media/jni/NativeCodecTestBase.h
+++ b/tests/media/jni/NativeCodecTestBase.h
@@ -146,7 +146,7 @@
mSharedErrorLogs->clear();
}
bool equalsPtsList(OutputManager* that);
- bool equalsByteOutput(OutputManager* that);
+ bool equalsDequeuedOutput(OutputManager* that);
bool equals(OutputManager* that);
float getRmsError(uint8_t* refData, int length);
std::string getErrorMsg() { return mErrorLogs + *mSharedErrorLogs; }
diff --git a/tests/media/src/android/mediav2/cts/AdaptivePlaybackTest.java b/tests/media/src/android/mediav2/cts/AdaptivePlaybackTest.java
index d46b985..6d0a33a 100644
--- a/tests/media/src/android/mediav2/cts/AdaptivePlaybackTest.java
+++ b/tests/media/src/android/mediav2/cts/AdaptivePlaybackTest.java
@@ -32,7 +32,9 @@
import androidx.test.filters.LargeTest;
import com.android.compatibility.common.util.ApiTest;
+import com.android.compatibility.common.util.CddTest;
+import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
@@ -46,6 +48,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.HashSet;
import java.util.List;
/**
@@ -62,9 +65,17 @@
private final String[] mSrcFiles;
private final SupportClass mSupportRequirements;
private static final String MEDIA_DIR = WorkDir.getMediaDirString();
+ private static final HashSet<String> MUST_SUPPORT_APB = new HashSet<>();
private long mMaxPts = 0;
+ static {
+ MUST_SUPPORT_APB.add(MediaFormat.MIMETYPE_VIDEO_VP8);
+ MUST_SUPPORT_APB.add(MediaFormat.MIMETYPE_VIDEO_VP9);
+ MUST_SUPPORT_APB.add(MediaFormat.MIMETYPE_VIDEO_AVC);
+ MUST_SUPPORT_APB.add(MediaFormat.MIMETYPE_VIDEO_HEVC);
+ }
+
public AdaptivePlaybackTest(String decoder, String mediaType, String[] srcFiles,
SupportClass supportRequirements, String allTestParams) {
super(decoder, mediaType, null, allTestParams);
@@ -233,21 +244,26 @@
/**
* Test video decoder for seamless resolution changes.
*/
+ @CddTest(requirement = "5.3/C-1-1")
@ApiTest(apis = "android.media.MediaCodecInfo.CodecCapabilities#FEATURE_AdaptivePlayback")
@LargeTest
@Test(timeout = PER_TEST_TIMEOUT_LARGE_TEST_MS)
public void testAdaptivePlayback() throws IOException, InterruptedException {
- Assume.assumeTrue("codec: " + mCodecName + " does not support FEATURE_AdaptivePlayback",
- isFeatureSupported(mCodecName, mMediaType,
- MediaCodecInfo.CodecCapabilities.FEATURE_AdaptivePlayback));
+ boolean hasSupport = isFeatureSupported(mCodecName, mMediaType,
+ MediaCodecInfo.CodecCapabilities.FEATURE_AdaptivePlayback);
+ if (MUST_SUPPORT_APB.contains(mMediaType)) {
+ Assert.assertTrue("codec: " + mCodecName + " is required to support "
+ + "FEATURE_AdaptivePlayback" + " for mediaType: " + mMediaType, hasSupport);
+ } else {
+ Assume.assumeTrue("codec: " + mCodecName + " does not support FEATURE_AdaptivePlayback",
+ hasSupport);
+ }
ArrayList<MediaFormat> formats = new ArrayList<>();
for (String file : mSrcFiles) {
formats.add(setUpSource(MEDIA_DIR + file));
mExtractor.release();
}
- checkFormatSupport(mCodecName, mMediaType, false, formats,
- new String[]{MediaCodecInfo.CodecCapabilities.FEATURE_AdaptivePlayback},
- mSupportRequirements);
+ checkFormatSupport(mCodecName, mMediaType, false, formats, null, mSupportRequirements);
formats.clear();
int totalSize = 0;
for (String srcFile : mSrcFiles) {
diff --git a/tests/media/src/android/mediav2/cts/CodecDecoderBlockModelMultiAccessUnitTest.java b/tests/media/src/android/mediav2/cts/CodecDecoderBlockModelMultiAccessUnitTest.java
new file mode 100644
index 0000000..2f7be64
--- /dev/null
+++ b/tests/media/src/android/mediav2/cts/CodecDecoderBlockModelMultiAccessUnitTest.java
@@ -0,0 +1,386 @@
+/*
+ * Copyright (C) 2024 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.mediav2.cts;
+
+import static android.media.MediaCodecInfo.CodecCapabilities.FEATURE_MultipleFrames;
+import static android.mediav2.common.cts.CodecTestBase.SupportClass.CODEC_OPTIONAL;
+
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
+
+import android.media.MediaCodec;
+import android.media.MediaExtractor;
+import android.media.MediaFormat;
+import android.mediav2.common.cts.CodecDecoderBlockModelMultiAccessUnitTestBase;
+import android.mediav2.common.cts.CodecDecoderBlockModelTestBase;
+import android.mediav2.common.cts.CodecDecoderTestBase;
+import android.mediav2.common.cts.OutputManager;
+import android.os.Build;
+import android.platform.test.annotations.AppModeFull;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+
+import androidx.test.filters.LargeTest;
+import androidx.test.filters.SdkSuppress;
+
+import com.android.compatibility.common.util.ApiTest;
+import com.android.media.codec.flags.Flags;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Tests audio decoders support for feature MultipleFrames in block model mode.
+ * <p>
+ * MultipleFrames feature is optional and is not required to support by all components. If a
+ * component supports this feature, then multiple access units are grouped together (demarcated
+ * with access unit offsets and timestamps) are sent as input to the component. The components
+ * processes the input sent and returns output in a large enough buffer (demarcated with access
+ * unit offsets and timestamps). The number of access units that can be grouped is dependent on
+ * format keys, KEY_MAX_INPUT_SIZE, KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE.
+ * <p>
+ * The test runs the component in MultipleFrames block model mode and normal mode and expects same
+ * output for a given input.
+ **/
+@SdkSuppress(minSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM, codeName = "VanillaIceCream")
+@AppModeFull(reason = "Instant apps cannot access the SD card")
+@RequiresFlagsEnabled(Flags.FLAG_LARGE_AUDIO_FRAME)
+@RunWith(Parameterized.class)
+public class CodecDecoderBlockModelMultiAccessUnitTest
+ extends CodecDecoderBlockModelMultiAccessUnitTestBase {
+ private static final String LOG_TAG =
+ CodecDecoderBlockModelMultiAccessUnitTest.class.getSimpleName();
+ private static final String MEDIA_DIR = WorkDir.getMediaDirString();
+ private static final int[][] OUT_SIZE_IN_MS = {
+ {1000, 250}, // max out size, threshold batch out size
+ {1000, 100},
+ {500, 20},
+ {100, 100},
+ {40, 100}
+ };
+
+ @Parameterized.Parameters(name = "{index}_{0}_{1}")
+ public static Collection<Object[]> input() {
+ final List<Object[]> exhaustiveArgsList = new ArrayList<>(Arrays.asList(new Object[][]{
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "bbb_1ch_16kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "bbb_2ch_44kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_8kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_16kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_22kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_24kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_32kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_44kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_48kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_8kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_16kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_22kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_24kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_32kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_44kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_48kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_1ch_96kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_2ch_96kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/sd_2ch_48kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bellezza_2ch_48kHz_s32le.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bellezza_2ch_48kHz_s24le.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_1ch_176kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_1ch_192kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_2ch_176kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_2ch_192kHz.wav"},
+
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_1ch_8kHz_lame_cbr.mp3"},
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_2ch_44kHz_lame_cbr.mp3"},
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_2ch_44kHz_lame_vbr.mp3"},
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_1ch_16kHz_lame_vbr.mp3"},
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_2ch_44kHz_lame_crc.mp3"},
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_stereo_48kHz_192kbps_mp3.mp3"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "bbb_1ch_16kHz_16kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "bbb_1ch_16kHz_23kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_6.6kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_8.85kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_12.65kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_14.25kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_15.85kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_18.25kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_19.85kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_23.05kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_23.85kbps_amrwb.3gp"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "bbb_1ch_8kHz_10kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "bbb_1ch_8kHz_8kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_12.2kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_10.2kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_7.95kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_7.40kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_6.70kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_5.90kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_5.15kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_4.75kbps_amrnb.3gp"},
+
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "bbb_1ch_16kHz_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "bbb_2ch_44kHz_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_8kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_12kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_16kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_22kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_24kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_32kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_44kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_48kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_8kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_12kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_16kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_22kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_24kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_32kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_44kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_48kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_1ch_96kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_1ch_176kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_1ch_192kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_2ch_96kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_2ch_176kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_2ch_192kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/sd_2ch_48kHz_lvl4_flac.mka"},
+
+ {MediaFormat.MIMETYPE_AUDIO_G711_ALAW, "bbb_1ch_8kHz_alaw.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_G711_ALAW, "bbb_2ch_8kHz_alaw.wav"},
+
+ {MediaFormat.MIMETYPE_AUDIO_G711_MLAW, "bbb_1ch_8kHz_mulaw.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_G711_MLAW, "bbb_2ch_8kHz_mulaw.wav"},
+
+ {MediaFormat.MIMETYPE_AUDIO_MSGSM, "bbb_1ch_8kHz_gsm.wav"},
+
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "bbb_1ch_16kHz_vorbis.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "bbb_2ch_44kHz_vorbis.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_8kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_12kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_16kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_24kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_32kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_48kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_8kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_12kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_16kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_24kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_32kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_48kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/highres_1ch_96kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/highres_2ch_96kHz_q10_vorbis.ogg"},
+
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "bbb_2ch_48kHz_opus.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "bbb_1ch_48kHz_opus.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_8kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_12kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_16kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_24kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_32kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_48kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_8kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_12kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_16kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_24kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_32kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_48kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_8kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_12kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_16kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_24kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_32kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_48kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_8kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_12kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_16kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_24kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_32kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_48kHz_opus.ogg"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "bbb_1ch_16kHz_aac.mp4"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "bbb_2ch_44kHz_aac.mp4"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_8kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_12kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_16kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_22kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_24kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_32kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_44kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_48kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_8kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_12kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_16kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_22kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_24kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_32kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_44kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_48kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_8kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_12kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_16kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_22kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_24kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_32kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_44kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_48kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_8kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_12kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_16kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_22kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_24kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_32kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_44kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_48kHz_aac_lc.m4a"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_16kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_22kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_24kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_32kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_44kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_48kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_16kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_22kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_24kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_32kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_44kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_48kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_16kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_22kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_24kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_32kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_44kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_48kHz_aac_he.m4a"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_16kHz_aac_hev2.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_22kHz_aac_hev2.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_24kHz_aac_hev2.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_32kHz_aac_hev2.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_44kHz_aac_hev2.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_48kHz_aac_hev2.m4a"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_16kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_22kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_24kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_32kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_44kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_48kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_16kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_22kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_24kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_32kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_44kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_48kHz_aac_eld.m4a"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_8kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_16kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_22kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_24kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_32kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_44kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_48kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_8kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_16kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_22kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_24kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_32kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_44kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_48kHz_usac.m4a"},
+ }));
+ return prepareParamList(exhaustiveArgsList, false, true, false, true);
+ }
+
+ public CodecDecoderBlockModelMultiAccessUnitTest(String decoder, String mediaType,
+ String testFile, String allTestParams) {
+ super(decoder, mediaType, MEDIA_DIR + testFile, allTestParams);
+ }
+
+ @Before
+ public void setUp() throws IOException {
+ MediaFormat format = setUpSource(mTestFile);
+ mExtractor.release();
+ ArrayList<MediaFormat> formatList = new ArrayList<>();
+ formatList.add(format);
+ checkFormatSupport(mCodecName, mMediaType, false, formatList, null, CODEC_OPTIONAL);
+ }
+
+ /**
+ * Verifies if the component under test can decode the test file correctly in multiple frame
+ * block model mode. The decoding happens in asynchronous mode with eos flag signalled with
+ * last compressed frame. The test verifies if the component / framework output is consistent
+ * with single access unit normal mode and single access unit block model mode.
+ * <p>
+ * Check description of class {@link CodecDecoderBlockModelMultiAccessUnitTest}
+ */
+ @ApiTest(apis = {"android.media.MediaFormat#KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE",
+ "android.media.MediaFormat#KEY_BUFFER_BATCH_THRESHOLD_OUTPUT_SIZE",
+ "android.media.MediaCodec.Callback#onOutputBuffersAvailable",
+ "android.media.MediaCodec#CONFIGURE_FLAG_USE_BLOCK_MODEL"})
+ @LargeTest
+ @Test(timeout = PER_TEST_TIMEOUT_LARGE_TEST_MS)
+ public void testSimpleDecode() throws IOException, InterruptedException {
+ assumeTrue(mCodecName + " does not support FEATURE_MultipleFrames",
+ isFeatureSupported(mCodecName, mMediaType, FEATURE_MultipleFrames));
+
+ CodecDecoderTestBase cdtb = new CodecDecoderTestBase(mCodecName, mMediaType, null,
+ mAllTestParams);
+ cdtb.decodeToMemory(mTestFile, mCodecName, 0, MediaExtractor.SEEK_TO_CLOSEST_SYNC,
+ Integer.MAX_VALUE);
+ OutputManager ref = cdtb.getOutputManager();
+
+ CodecDecoderBlockModelTestBase cdbmtb = new CodecDecoderBlockModelTestBase(
+ mCodecName, mMediaType, null, mAllTestParams);
+ OutputManager test = new OutputManager(ref.getSharedErrorLogs());
+ cdbmtb.decodeToMemory(mTestFile, mCodecName, test, 0,
+ MediaExtractor.SEEK_TO_CLOSEST_SYNC, Integer.MAX_VALUE);
+ if (!ref.equals(test)) {
+ fail("Output in block model mode is not same as output in normal mode. \n"
+ + mTestConfig + mTestEnv + test.getErrMsg());
+ }
+
+ mSaveToMem = true;
+ mOutputBuff = test;
+ MediaFormat format = setUpSource(mTestFile);
+ int maxSampleSize = getMaxSampleSizeForMediaType(mTestFile, mMediaType);
+ mCodec = MediaCodec.createByCodecName(mCodecName);
+ for (int[] outSizeInMs : OUT_SIZE_IN_MS) {
+ configureKeysForLargeAudioBlockModelFrameMode(format, maxSampleSize, outSizeInMs[0],
+ outSizeInMs[1]);
+ mOutputBuff.reset();
+ configureCodec(format, true, true, false);
+ mMaxInputLimitMs = outSizeInMs[0];
+ mCodec.start();
+ mExtractor.seekTo(0, MediaExtractor.SEEK_TO_CLOSEST_SYNC);
+ doWork(Integer.MAX_VALUE);
+ queueEOS();
+ waitForAllOutputs();
+ mCodec.reset();
+ if (!ref.equalsByteOutput(mOutputBuff)) {
+ fail("Output of decoder component when fed with multiple access units in single"
+ + " enqueue call differs from output received when each access unit is fed"
+ + " separately. \n" + mTestConfig + mTestEnv + mOutputBuff.getErrMsg());
+ }
+ }
+ mCodec.release();
+ mExtractor.release();
+ }
+}
diff --git a/tests/media/src/android/mediav2/cts/CodecDecoderMultiAccessUnitTest.java b/tests/media/src/android/mediav2/cts/CodecDecoderMultiAccessUnitTest.java
new file mode 100644
index 0000000..d0fdb7d
--- /dev/null
+++ b/tests/media/src/android/mediav2/cts/CodecDecoderMultiAccessUnitTest.java
@@ -0,0 +1,385 @@
+/*
+ * Copyright (C) 2024 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.mediav2.cts;
+
+import static android.media.MediaCodecInfo.CodecCapabilities.FEATURE_MultipleFrames;
+import static android.mediav2.common.cts.CodecTestBase.SupportClass.CODEC_OPTIONAL;
+
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
+
+import android.media.MediaCodec;
+import android.media.MediaExtractor;
+import android.media.MediaFormat;
+import android.mediav2.common.cts.CodecDecoderMultiAccessUnitTestBase;
+import android.mediav2.common.cts.CodecDecoderTestBase;
+import android.mediav2.common.cts.OutputManager;
+import android.os.Build;
+import android.platform.test.annotations.AppModeFull;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+
+import androidx.test.filters.LargeTest;
+import androidx.test.filters.SdkSuppress;
+
+import com.android.compatibility.common.util.ApiTest;
+import com.android.media.codec.flags.Flags;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Tests audio decoders support for feature MultipleFrames.
+ * <p>
+ * MultipleFrames feature is optional and is not required to support by all components. If a
+ * component supports this feature, then multiple access units are grouped together (demarcated
+ * with access unit offsets and timestamps) and sent as input to the component. The components
+ * processes the input sent and returns output in a large enough buffer (demarcated with access
+ * unit offsets and timestamps). The number of access units that can be grouped is dependent on
+ * format keys, KEY_MAX_INPUT_SIZE, KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE.
+ * <p>
+ * The test runs the component in MultipleFrames mode and normal mode and expects same output for
+ * a given input.
+ **/
+@SdkSuppress(minSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM, codeName = "VanillaIceCream")
+@AppModeFull(reason = "Instant apps cannot access the SD card")
+@RequiresFlagsEnabled(Flags.FLAG_LARGE_AUDIO_FRAME)
+@RunWith(Parameterized.class)
+public class CodecDecoderMultiAccessUnitTest extends CodecDecoderMultiAccessUnitTestBase {
+ private static final String LOG_TAG = CodecDecoderMultiAccessUnitTest.class.getSimpleName();
+ private static final String MEDIA_DIR = WorkDir.getMediaDirString();
+ private static final int[][] OUT_SIZE_IN_MS = {
+ {1000, 250}, // max out size, threshold batch out size
+ {1000, 100},
+ {500, 20},
+ {100, 100},
+ {40, 100}
+ };
+
+ @Parameterized.Parameters(name = "{index}_{0}_{1}")
+ public static Collection<Object[]> input() {
+ final List<Object[]> exhaustiveArgsList = new ArrayList<>(Arrays.asList(new Object[][]{
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "bbb_1ch_16kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "bbb_2ch_44kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_8kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_16kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_22kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_24kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_32kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_44kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_1ch_48kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_8kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_16kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_22kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_24kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_32kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_44kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bbb_2ch_48kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_1ch_96kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_2ch_96kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/sd_2ch_48kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bellezza_2ch_48kHz_s32le.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/bellezza_2ch_48kHz_s24le.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_1ch_176kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_1ch_192kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_2ch_176kHz.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_RAW, "audio/highres_2ch_192kHz.wav"},
+
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_1ch_8kHz_lame_cbr.mp3"},
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_2ch_44kHz_lame_cbr.mp3"},
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_2ch_44kHz_lame_vbr.mp3"},
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_1ch_16kHz_lame_vbr.mp3"},
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_2ch_44kHz_lame_crc.mp3"},
+ {MediaFormat.MIMETYPE_AUDIO_MPEG, "bbb_stereo_48kHz_192kbps_mp3.mp3"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "bbb_1ch_16kHz_16kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "bbb_1ch_16kHz_23kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_6.6kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_8.85kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_12.65kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_14.25kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_15.85kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_18.25kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_19.85kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_23.05kbps_amrwb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_WB, "audio/bbb_mono_16kHz_23.85kbps_amrwb.3gp"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "bbb_1ch_8kHz_10kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "bbb_1ch_8kHz_8kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_12.2kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_10.2kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_7.95kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_7.40kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_6.70kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_5.90kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_5.15kbps_amrnb.3gp"},
+ {MediaFormat.MIMETYPE_AUDIO_AMR_NB, "audio/bbb_mono_8kHz_4.75kbps_amrnb.3gp"},
+
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "bbb_1ch_16kHz_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "bbb_2ch_44kHz_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_8kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_12kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_16kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_22kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_24kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_32kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_44kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_1ch_48kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_8kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_12kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_16kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_22kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_24kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_32kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_44kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/bbb_2ch_48kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_1ch_96kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_1ch_176kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_1ch_192kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_2ch_96kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_2ch_176kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/highres_2ch_192kHz_lvl4_flac.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_FLAC, "audio/sd_2ch_48kHz_lvl4_flac.mka"},
+
+ {MediaFormat.MIMETYPE_AUDIO_G711_ALAW, "bbb_1ch_8kHz_alaw.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_G711_ALAW, "bbb_2ch_8kHz_alaw.wav"},
+
+ {MediaFormat.MIMETYPE_AUDIO_G711_MLAW, "bbb_1ch_8kHz_mulaw.wav"},
+ {MediaFormat.MIMETYPE_AUDIO_G711_MLAW, "bbb_2ch_8kHz_mulaw.wav"},
+
+ {MediaFormat.MIMETYPE_AUDIO_MSGSM, "bbb_1ch_8kHz_gsm.wav"},
+
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "bbb_1ch_16kHz_vorbis.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "bbb_2ch_44kHz_vorbis.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_8kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_12kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_16kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_24kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_32kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_1ch_48kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_8kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_12kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_16kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_24kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_32kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/bbb_2ch_48kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/highres_1ch_96kHz_q10_vorbis.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_VORBIS, "audio/highres_2ch_96kHz_q10_vorbis.ogg"},
+
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "bbb_2ch_48kHz_opus.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "bbb_1ch_48kHz_opus.mka"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_8kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_12kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_16kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_24kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_32kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_1ch_48kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_8kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_12kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_16kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_24kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_32kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_2ch_48kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_8kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_12kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_16kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_24kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_32kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_5ch_48kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_8kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_12kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_16kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_24kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_32kHz_opus.ogg"},
+ {MediaFormat.MIMETYPE_AUDIO_OPUS, "audio/bbb_6ch_48kHz_opus.ogg"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "bbb_1ch_16kHz_aac.mp4"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "bbb_2ch_44kHz_aac.mp4"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_8kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_12kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_16kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_22kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_24kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_32kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_44kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_48kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_8kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_12kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_16kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_22kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_24kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_32kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_44kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_48kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_8kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_12kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_16kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_22kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_24kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_32kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_44kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_48kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_8kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_12kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_16kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_22kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_24kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_32kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_44kHz_aac_lc.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_48kHz_aac_lc.m4a"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_16kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_22kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_24kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_32kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_44kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_48kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_16kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_22kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_24kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_32kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_44kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_5ch_48kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_16kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_22kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_24kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_32kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_44kHz_aac_he.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_6ch_48kHz_aac_he.m4a"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_16kHz_aac_hev2.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_22kHz_aac_hev2.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_24kHz_aac_hev2.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_32kHz_aac_hev2.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_44kHz_aac_hev2.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_48kHz_aac_hev2.m4a"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_16kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_22kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_24kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_32kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_44kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_48kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_16kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_22kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_24kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_32kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_44kHz_aac_eld.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_48kHz_aac_eld.m4a"},
+
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_8kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_16kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_22kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_24kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_32kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_44kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_1ch_48kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_8kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_16kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_22kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_24kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_32kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_44kHz_usac.m4a"},
+ {MediaFormat.MIMETYPE_AUDIO_AAC, "audio/bbb_2ch_48kHz_usac.m4a"},
+ }));
+ return prepareParamList(exhaustiveArgsList, false, true, false, true);
+ }
+
+ public CodecDecoderMultiAccessUnitTest(String decoder, String mediaType, String testFile,
+ String allTestParams) {
+ super(decoder, mediaType, MEDIA_DIR + testFile, allTestParams);
+ }
+
+ @Before
+ public void setUp() throws IOException {
+ MediaFormat format = setUpSource(mTestFile);
+ mExtractor.release();
+ ArrayList<MediaFormat> formatList = new ArrayList<>();
+ formatList.add(format);
+ checkFormatSupport(mCodecName, mMediaType, false, formatList, null, CODEC_OPTIONAL);
+ }
+
+ /**
+ * Verifies if the component under test can decode the test file correctly in multiple frame
+ * mode. The decoding happens in asynchronous mode with eos flag signalled with last
+ * compressed frame and eos flag signalled separately after sending all compressed frames. It
+ * expects consistent output in all these runs. That is, the ByteBuffer info and output
+ * timestamp list has to be same in all the runs. The test verifies if the output timestamp
+ * is strictly increasing. The test also verifies if the component / framework output is
+ * consistent with normal mode (single access unit mode).
+ * <p>
+ * Check description of class {@link CodecDecoderMultiAccessUnitTest}
+ */
+ @ApiTest(apis = {"android.media.MediaFormat#KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE",
+ "android.media.MediaFormat#KEY_BUFFER_BATCH_THRESHOLD_OUTPUT_SIZE",
+ "android.media.MediaCodec.Callback#onOutputBuffersAvailable"})
+ @LargeTest
+ @Test(timeout = PER_TEST_TIMEOUT_LARGE_TEST_MS)
+ public void testMultipleAccessUnits() throws IOException, InterruptedException {
+ assumeTrue(mCodecName + " does not support FEATURE_MultipleFrames",
+ isFeatureSupported(mCodecName, mMediaType, FEATURE_MultipleFrames));
+
+ CodecDecoderTestBase cdtb = new CodecDecoderTestBase(mCodecName, mMediaType, null,
+ mAllTestParams);
+ cdtb.decodeToMemory(mTestFile, mCodecName, 0, MediaExtractor.SEEK_TO_CLOSEST_SYNC,
+ Integer.MAX_VALUE);
+ OutputManager ref = cdtb.getOutputManager();
+
+ boolean[] boolStates = {true, false};
+ mSaveToMem = true;
+ OutputManager testA = new OutputManager(ref.getSharedErrorLogs());
+ OutputManager testB = new OutputManager(ref.getSharedErrorLogs());
+ MediaFormat format = setUpSource(mTestFile);
+ int maxSampleSize = getMaxSampleSizeForMediaType(mTestFile, mMediaType);
+ mCodec = MediaCodec.createByCodecName(mCodecName);
+ for (int[] outSizeInMs : OUT_SIZE_IN_MS) {
+ configureKeysForLargeAudioFrameMode(format, maxSampleSize, outSizeInMs[0],
+ outSizeInMs[1]);
+ for (boolean eosType : boolStates) {
+ mOutputBuff = eosType ? testA : testB;
+ mOutputBuff.reset();
+ configureCodec(format, true, eosType, false);
+ mMaxInputLimitMs = outSizeInMs[0];
+ mCodec.start();
+ mExtractor.seekTo(0, MediaExtractor.SEEK_TO_CLOSEST_SYNC);
+ doWork(Integer.MAX_VALUE);
+ queueEOS();
+ waitForAllOutputs();
+ mCodec.reset();
+ if (!ref.equalsByteOutput(mOutputBuff)) {
+ fail("Output of decoder component when fed with multiple access units in "
+ + "single enqueue call differs from output received when each access "
+ + "unit is fed separately. \n"
+ + mTestConfig + mTestEnv + mOutputBuff.getErrMsg());
+ }
+ }
+ if (!testA.equals(testB)) {
+ fail("Output of decoder component is not consistent across runs. \n" + mTestConfig
+ + mTestEnv + testB.getErrMsg());
+ }
+ }
+ mCodec.release();
+ mExtractor.release();
+ }
+}
diff --git a/tests/media/src/android/mediav2/cts/CodecDecoderSurfaceTest.java b/tests/media/src/android/mediav2/cts/CodecDecoderSurfaceTest.java
index d3760f7..3a05171 100644
--- a/tests/media/src/android/mediav2/cts/CodecDecoderSurfaceTest.java
+++ b/tests/media/src/android/mediav2/cts/CodecDecoderSurfaceTest.java
@@ -112,7 +112,7 @@
doWork(frameLimit);
queueEOS();
waitForAllOutputs();
- mCodec.stop();
+ endCodecSession(mCodec);
mCodec.release();
mExtractor.release();
mSurface = sf; // restore surface
@@ -243,8 +243,8 @@
doWork(Integer.MAX_VALUE);
queueEOS();
waitForAllOutputs();
- mCodec.stop();
- if (!(mIsInterlaced ? ref.equalsByteOutput(test) : ref.equals(test))) {
+ endCodecSession(mCodec);
+ if (!(mIsInterlaced ? ref.equalsDequeuedOutput(test) : ref.equals(test))) {
fail("Decoder output in surface mode does not match with output in bytebuffer "
+ "mode \n" + mTestConfig + mTestEnv + test.getErrMsg());
}
@@ -333,7 +333,7 @@
doWork(Integer.MAX_VALUE);
queueEOS();
waitForAllOutputs();
- if (!(mIsInterlaced ? ref.equalsByteOutput(test) : ref.equals(test))) {
+ if (!(mIsInterlaced ? ref.equalsDequeuedOutput(test) : ref.equals(test))) {
fail("Decoder output in surface mode does not match with output in bytebuffer "
+ "mode \n" + mTestConfig + mTestEnv + test.getErrMsg());
}
@@ -346,8 +346,8 @@
doWork(Integer.MAX_VALUE);
queueEOS();
waitForAllOutputs();
- mCodec.stop();
- if (!(mIsInterlaced ? ref.equalsByteOutput(test) : ref.equals(test))) {
+ endCodecSession(mCodec);
+ if (!(mIsInterlaced ? ref.equalsDequeuedOutput(test) : ref.equals(test))) {
fail("Decoder output in surface mode does not match with output in bytebuffer "
+ "mode \n" + mTestConfig + mTestEnv + test.getErrMsg());
}
@@ -436,8 +436,8 @@
doWork(Integer.MAX_VALUE);
queueEOS();
waitForAllOutputs();
- mCodec.stop();
- if (!(mIsInterlaced ? ref.equalsByteOutput(test) : ref.equals(test))) {
+ endCodecSession(mCodec);
+ if (!(mIsInterlaced ? ref.equalsDequeuedOutput(test) : ref.equals(test))) {
fail("Decoder output in surface mode does not match with output in bytebuffer "
+ "mode \n" + mTestConfig + mTestEnv + test.getErrMsg());
}
@@ -450,8 +450,8 @@
doWork(Integer.MAX_VALUE);
queueEOS();
waitForAllOutputs();
- mCodec.stop();
- if (!(mIsInterlaced ? ref.equalsByteOutput(test) : ref.equals(test))) {
+ endCodecSession(mCodec);
+ if (!(mIsInterlaced ? ref.equalsDequeuedOutput(test) : ref.equals(test))) {
fail("Decoder output in surface mode does not match with output in bytebuffer "
+ "mode \n" + mTestConfig + mTestEnv + test.getErrMsg());
}
@@ -468,8 +468,8 @@
doWork(Integer.MAX_VALUE);
queueEOS();
waitForAllOutputs();
- mCodec.stop();
- if (!(mIsInterlaced ? configRef.equalsByteOutput(configTest) :
+ endCodecSession(mCodec);
+ if (!(mIsInterlaced ? configRef.equalsDequeuedOutput(configTest) :
configRef.equals(configTest))) {
fail("Decoder output in surface mode does not match with output in bytebuffer "
+ "mode \n" + mTestConfig + mTestEnv + configTest.getErrMsg());
diff --git a/tests/media/src/android/mediav2/cts/CodecDecoderTest.java b/tests/media/src/android/mediav2/cts/CodecDecoderTest.java
index 6865b65..3bf73ed 100644
--- a/tests/media/src/android/mediav2/cts/CodecDecoderTest.java
+++ b/tests/media/src/android/mediav2/cts/CodecDecoderTest.java
@@ -32,6 +32,7 @@
import android.media.MediaCodecInfo;
import android.media.MediaExtractor;
import android.media.MediaFormat;
+import android.mediav2.common.cts.CodecDecoderBlockModelTestBase;
import android.mediav2.common.cts.CodecDecoderTestBase;
import android.mediav2.common.cts.OutputManager;
import android.util.Log;
@@ -359,12 +360,14 @@
* to be same as input timestamp list (no frame drops) and for completely normative codecs,
* the output checksum has to be identical to reference checksum. For non-normative codecs,
* the output has to be consistent. The test also verifies if the component / framework
- * behavior is consistent between SDK and NDK.
+ * behavior is consistent between SDK and NDK. The test also verifies if the
+ * component / framework behavior is consistent between block model mode and normal mode.
*/
@CddTest(requirements = {"2.2.2", "2.3.2", "2.5.2", "5.1.2"})
@ApiTest(apis = {"android.media.MediaCodecInfo.CodecCapabilities#COLOR_FormatYUV420Flexible",
"android.media.MediaCodecInfo.CodecCapabilities#COLOR_FormatYUVP010",
- "android.media.AudioFormat#ENCODING_PCM_16BIT"})
+ "android.media.AudioFormat#ENCODING_PCM_16BIT",
+ "android.media.MediaCodec#CONFIGURE_FLAG_USE_BLOCK_MODEL"})
@LargeTest
@Test(timeout = PER_TEST_TIMEOUT_LARGE_TEST_MS)
public void testSimpleDecode() throws IOException, InterruptedException {
@@ -400,7 +403,7 @@
queueEOS();
waitForAllOutputs();
validateMetrics(mCodecName, format);
- mCodec.stop();
+ endCodecSession(mCodec);
if (loopCounter != 0 && !ref.equals(test)) {
fail("Decoder output is not consistent across runs \n" + mTestConfig
+ mTestEnv + test.getErrMsg());
@@ -413,6 +416,17 @@
}
mCodec.release();
mExtractor.release();
+ if (IS_AT_LEAST_R && mSaveToMem && mIsAudio) {
+ test.reset();
+ CodecDecoderBlockModelTestBase cdbmtb = new CodecDecoderBlockModelTestBase(
+ mCodecName, mMediaType, null, mAllTestParams);
+ cdbmtb.decodeToMemory(mTestFile, mCodecName, test, 0,
+ MediaExtractor.SEEK_TO_CLOSEST_SYNC, Integer.MAX_VALUE);
+ if (!ref.equals(test)) {
+ fail("Output in block model mode is not same as output in normal mode. \n"
+ + mTestConfig + mTestEnv + test.getErrMsg());
+ }
+ }
int colorFormat = mIsAudio ? 0 : format.getInteger(MediaFormat.KEY_COLOR_FORMAT);
boolean isPass = nativeTestSimpleDecode(mCodecName, null, mMediaType, mTestFile,
mRefFile, colorFormat, mRmsError, ref.getCheckSumBuffer(), mTestConfig);
@@ -529,7 +543,7 @@
doWork(Integer.MAX_VALUE);
queueEOS();
waitForAllOutputs();
- mCodec.stop();
+ endCodecSession(mCodec);
if (isMediaTypeOutputUnAffectedBySeek(mMediaType) && (!ref.equals(test))) {
fail("Decoder output is not consistent across runs \n" + mTestConfig + mTestEnv
+ test.getErrMsg());
@@ -659,7 +673,7 @@
doWork(Integer.MAX_VALUE);
queueEOS();
waitForAllOutputs();
- mCodec.stop();
+ endCodecSession(mCodec);
if (!ref.equals(test)) {
fail("Decoder output is not consistent across runs \n" + mTestConfig + mTestEnv
+ test.getErrMsg());
@@ -676,7 +690,7 @@
doWork(Integer.MAX_VALUE);
queueEOS();
waitForAllOutputs();
- mCodec.stop();
+ endCodecSession(mCodec);
if (!ref.equals(test)) {
fail("Decoder output is not consistent across runs \n" + mTestConfig + mTestEnv
+ test.getErrMsg());
@@ -703,7 +717,7 @@
queueEOS();
waitForAllOutputs();
validateMetrics(mCodecName, newFormat);
- mCodec.stop();
+ endCodecSession(mCodec);
if (!configRef.equals(configTest)) {
fail("Decoder output is not consistent across runs \n" + mTestConfig + mTestEnv
+ configTest.getErrMsg());
@@ -742,7 +756,7 @@
mCodec.start();
queueEOS();
waitForAllOutputs();
- mCodec.stop();
+ endCodecSession(mCodec);
if (loopCounter != 0 && !ref.equals(test)) {
fail("Decoder output is not consistent across runs \n" + mTestConfig + mTestEnv
+ test.getErrMsg());
@@ -829,7 +843,7 @@
queueEOS();
waitForAllOutputs();
validateMetrics(mCodecName);
- mCodec.stop();
+ endCodecSession(mCodec);
if (loopCounter != 0 && !ref.equals(test)) {
fail("Decoder output is not consistent across runs \n" + mTestConfig
+ mTestEnv + test.getErrMsg());
@@ -905,7 +919,7 @@
doWork(buffer, list);
queueEOS();
waitForAllOutputs();
- mCodec.stop();
+ endCodecSession(mCodec);
if (!ref.equals(test)) {
fail("Decoder output of a compressed stream segmented at frame/access unit "
+ "boundaries is different from a compressed stream segmented at "
@@ -944,8 +958,7 @@
queueEOS();
waitForAllOutputs();
MediaFormat outputFormat = mCodec.getOutputFormat();
- mCodec.stop();
- mCodec.reset();
+ endCodecSession(mCodec);
mCodec.release();
assertTrue("Output format from decoder does not contain KEY_COLOR_FORMAT \n" + mTestConfig
diff --git a/tests/media/src/android/mediav2/cts/CodecDecoderValidationTest.java b/tests/media/src/android/mediav2/cts/CodecDecoderValidationTest.java
index d6450e4..268e8ff 100644
--- a/tests/media/src/android/mediav2/cts/CodecDecoderValidationTest.java
+++ b/tests/media/src/android/mediav2/cts/CodecDecoderValidationTest.java
@@ -800,7 +800,7 @@
mCodec.stop();
mCodec.release();
mExtractor.release();
- if (!(mIsInterlaced ? ref.equalsByteOutput(mOutputBuff) :
+ if (!(mIsInterlaced ? ref.equalsDequeuedOutput(mOutputBuff) :
ref.equals(mOutputBuff))) {
fail("Decoder output received for file " + mSrcFiles[0]
+ " is not identical to the output received for file " + file + "\n"
diff --git a/tests/media/src/android/mediav2/cts/CodecInfoTest.java b/tests/media/src/android/mediav2/cts/CodecInfoTest.java
index 6a94a72..0765f85 100644
--- a/tests/media/src/android/mediav2/cts/CodecInfoTest.java
+++ b/tests/media/src/android/mediav2/cts/CodecInfoTest.java
@@ -25,6 +25,8 @@
import static android.media.MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar;
import static android.media.MediaCodecInfo.CodecCapabilities.COLOR_FormatYUVP010;
import static android.media.MediaCodecInfo.CodecCapabilities.FEATURE_HdrEditing;
+import static android.media.codec.Flags.FLAG_IN_PROCESS_SW_AUDIO_CODEC;
+import static android.mediav2.common.cts.CodecTestBase.BOARD_SDK_IS_AT_LEAST_202404;
import static android.mediav2.common.cts.CodecTestBase.BOARD_SDK_IS_AT_LEAST_T;
import static android.mediav2.common.cts.CodecTestBase.FIRST_SDK_IS_AT_LEAST_T;
import static android.mediav2.common.cts.CodecTestBase.IS_AT_LEAST_T;
@@ -35,24 +37,31 @@
import static android.mediav2.common.cts.CodecTestBase.canDisplaySupportHDRContent;
import static android.mediav2.common.cts.CodecTestBase.codecFilter;
import static android.mediav2.common.cts.CodecTestBase.codecPrefix;
+import static android.mediav2.common.cts.CodecTestBase.isFeatureSupported;
import static android.mediav2.common.cts.CodecTestBase.isVendorCodec;
import static android.mediav2.common.cts.CodecTestBase.selectCodecs;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import android.media.MediaCodecInfo;
import android.media.MediaCodecInfo.CodecProfileLevel;
import android.media.MediaCodecList;
+import android.media.MediaFormat;
import android.mediav2.common.cts.CodecTestBase;
import android.os.Build;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.util.Range;
+import androidx.test.filters.SdkSuppress;
import androidx.test.filters.SmallTest;
import com.android.compatibility.common.util.ApiTest;
import com.android.compatibility.common.util.CddTest;
import com.android.compatibility.common.util.MediaUtils;
import com.android.compatibility.common.util.NonMainlineTest;
+import com.android.compatibility.common.util.VsrTest;
import org.junit.Assume;
import org.junit.Test;
@@ -240,5 +249,45 @@
selectCodecs(mMediaType, null, null, false).size() > 0);
}
}
-}
+ /**
+ * For all the available regulard codecs on the device, the test checks
+ * none of them are marked as suitable only for trusted content.
+ */
+ @Test
+ @RequiresFlagsEnabled(FLAG_IN_PROCESS_SW_AUDIO_CODEC)
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM,
+ codeName = "VanillaIceCream")
+ @ApiTest(apis = "android.media.MediaCodecInfo#getSecurityModel")
+ public void testSecurityModel() {
+ assertTrue("Codecs in REGULAR_CODECS list should have security model "
+ + "SANDBOXED or MEMORY_SAFE",
+ List.of(MediaCodecInfo.SECURITY_MODEL_SANDBOXED,
+ MediaCodecInfo.SECURITY_MODEL_MEMORY_SAFE).contains(
+ mCodecInfo.getSecurityModel()));
+ }
+
+ /**
+ * Components advertising support for compression technologies that were introduced after 2002
+ * must support a given resolution in both portrait and landscape mode.
+ */
+ @VsrTest(requirements = {"VSR-4.2.004.002"})
+ @Test
+ public void testResolutionSupport() {
+ Assume.assumeTrue("Test is applicable for video codecs", mMediaType.startsWith("video/"));
+ Assume.assumeTrue("Skipping, Only intended for coding technologies introduced after 2002.",
+ !mMediaType.equals(MediaFormat.MIMETYPE_VIDEO_MPEG4)
+ && !mMediaType.equals(MediaFormat.MIMETYPE_VIDEO_H263)
+ && !mMediaType.equals(MediaFormat.MIMETYPE_VIDEO_MPEG2));
+ Assume.assumeTrue("Skipping, Only intended for devices with SDK >= 202404",
+ BOARD_SDK_IS_AT_LEAST_202404);
+ if (!isFeatureSupported(mCodecName, mMediaType, "can-swap-width-height")) {
+ MediaCodecInfo.VideoCapabilities vCaps =
+ mCodecInfo.getCapabilitiesForType(mMediaType).getVideoCapabilities();
+ Range<Integer> widths = vCaps.getSupportedWidths();
+ Range<Integer> heights = vCaps.getSupportedHeights();
+ assertEquals(mCodecName + " does not support identical size ranges. Width range "
+ + widths + " height range " + heights, widths, heights);
+ }
+ }
+}
diff --git a/tests/media/src/android/mediav2/cts/DecoderPushBlankBufferOnStopTest.java b/tests/media/src/android/mediav2/cts/DecoderPushBlankBufferOnStopTest.java
new file mode 100644
index 0000000..0133136
--- /dev/null
+++ b/tests/media/src/android/mediav2/cts/DecoderPushBlankBufferOnStopTest.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2023 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.mediav2.cts;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import android.graphics.PixelFormat;
+import android.media.Image;
+import android.media.MediaCodec;
+import android.media.MediaFormat;
+import android.mediav2.common.cts.CodecDecoderTestBase;
+import android.mediav2.common.cts.ImageSurface;
+import android.mediav2.common.cts.OutputManager;
+import android.os.Build;
+
+import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
+
+import com.android.compatibility.common.util.ApiTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Verify support for MediaFormat.KEY_PUSH_BLANK_BUFFERS_ON_STOP
+ * <p>
+ * The component decodes a test clip to the surface provided by image reader. As the test has no
+ * interest in the contents of input clip, the frames decoded are not rendered. After decoding
+ * few frames, a call to stop is made. The image surface is observed for frames received. If
+ * KEY_PUSH_BLANK_BUFFERS_ON_STOP is configured as '0' then image surface is expected to receive no
+ * frames and if KEY_PUSH_BLANK_BUFFERS_ON_STOP is configured to 1, the image surface is expected
+ * to receive frame(s) and they are expected to be blank
+ */
+@RunWith(Parameterized.class)
+public class DecoderPushBlankBufferOnStopTest extends CodecDecoderTestBase {
+ private static final String MEDIA_DIR = WorkDir.getMediaDirString();
+ private static final long WAIT_FOR_IMAGE_TIMEOUT_MS = 300;
+
+ private final boolean mPushBlankBuffersOnStop;
+
+ public DecoderPushBlankBufferOnStopTest(String decoder, String mediaType, String testFile,
+ boolean pushBlankBuffersOnStop, @SuppressWarnings("unused") String testLabel,
+ String allTestParams) {
+ super(decoder, mediaType, MEDIA_DIR + testFile, allTestParams);
+ mPushBlankBuffersOnStop = pushBlankBuffersOnStop;
+ }
+
+ @Parameterized.Parameters(name = "{index}_{0}_{1}_{4}")
+ public static Collection<Object[]> input() {
+ final List<Object[]> args = new ArrayList<>(Arrays.asList(new Object[][]{
+ {MediaFormat.MIMETYPE_VIDEO_MPEG2, "bbb_340x280_768kbps_30fps_mpeg2.mp4"},
+ {MediaFormat.MIMETYPE_VIDEO_AVC, "bbb_340x280_768kbps_30fps_avc.mp4"},
+ {MediaFormat.MIMETYPE_VIDEO_HEVC, "bbb_340x280_768kbps_30fps_hevc.mp4"},
+ {MediaFormat.MIMETYPE_VIDEO_MPEG4, "bbb_128x96_64kbps_12fps_mpeg4.mp4"},
+ {MediaFormat.MIMETYPE_VIDEO_H263, "bbb_176x144_128kbps_15fps_h263.3gp"},
+ {MediaFormat.MIMETYPE_VIDEO_VP8, "bbb_340x280_768kbps_30fps_vp8.webm"},
+ {MediaFormat.MIMETYPE_VIDEO_VP9, "bbb_340x280_768kbps_30fps_vp9.webm"},
+ {MediaFormat.MIMETYPE_VIDEO_AV1, "bbb_340x280_768kbps_30fps_av1.mp4"},
+ }));
+ final List<Object[]> exhaustiveArgsList = new ArrayList<>();
+ boolean[] boolStates = new boolean[]{true, false};
+ for (Object[] arg : args) {
+ for (boolean pushBlankOnStop : boolStates) {
+ Object[] testArgs = new Object[arg.length + 2];
+ testArgs[0] = arg[0]; // mediaType
+ testArgs[1] = arg[1]; // test file
+ testArgs[2] = pushBlankOnStop;
+ testArgs[3] = String.format("%s", pushBlankOnStop ? "pushBlank" : "pushNone");
+ exhaustiveArgsList.add(testArgs);
+ }
+ }
+ return prepareParamList(exhaustiveArgsList, false, false, true, false,
+ ComponentClass.SOFTWARE);
+ }
+
+ private boolean isBlankFrame(Image image) {
+ int threshold = 0;
+ for (Image.Plane plane : image.getPlanes()) {
+ ByteBuffer buffer = plane.getBuffer();
+ while (buffer.hasRemaining()) {
+ int pixelValue = buffer.get() & 0xFF;
+ if (pixelValue > threshold) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Check description of class {@link DecoderPushBlankBufferOnStopTest}
+ */
+ @ApiTest(apis = {"android.media.MediaFormat#KEY_PUSH_BLANK_BUFFERS_ON_STOP"})
+ @SmallTest
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE, codeName = "UpsideDownCake")
+ @Test(timeout = PER_TEST_TIMEOUT_SMALL_TEST_MS)
+ public void testSimpleDecodeToSurface() throws IOException, InterruptedException {
+ MediaFormat format = setUpSource(mTestFile);
+ ArrayList<MediaFormat> formatList = new ArrayList<>();
+ formatList.add(format);
+ assertTrue("Codec: " + mCodecName + " doesn't support format: " + format,
+ areFormatsSupported(mCodecName, mMediaType, formatList));
+ mImageSurface = new ImageSurface();
+ setUpSurface(getWidth(format), getHeight(format), PixelFormat.RGBX_8888, 1,
+ this::isBlankFrame);
+ mSurface = mImageSurface.getSurface();
+ mCodec = MediaCodec.createByCodecName(mCodecName);
+ mOutputBuff = new OutputManager();
+ if (mPushBlankBuffersOnStop) {
+ format.setInteger(MediaFormat.KEY_PUSH_BLANK_BUFFERS_ON_STOP, 1);
+ }
+ configureCodec(format, true, false, false);
+ mCodec.start();
+ doWork(10);
+ queueEOS();
+ waitForAllOutputs();
+ mCodec.stop();
+ try (Image img = mImageSurface.getImage(WAIT_FOR_IMAGE_TIMEOUT_MS)) {
+ if (!mPushBlankBuffersOnStop) {
+ assertNull("Blank buffers are received by image surface for format: "
+ + format + "\n" + mTestConfig + mTestEnv, img);
+ } else {
+ assertNotNull("Blank buffers are not received by image surface for format: "
+ + format + "\n" + mTestConfig + mTestEnv, img);
+ assertTrue("received image is not a blank buffer \n" + mTestConfig + mTestEnv,
+ isBlankFrame(img));
+ }
+ }
+ mCodec.release();
+ mExtractor.release();
+ }
+}
diff --git a/tests/media/src/android/mediav2/cts/WorkDir.java b/tests/media/src/android/mediav2/cts/WorkDir.java
index 9584c74..9bdbabd 100644
--- a/tests/media/src/android/mediav2/cts/WorkDir.java
+++ b/tests/media/src/android/mediav2/cts/WorkDir.java
@@ -24,6 +24,6 @@
*/
class WorkDir extends WorkDirBase {
static final String getMediaDirString() {
- return getMediaDirString("CtsMediaV2TestCases-3.6");
+ return getMediaDirString("CtsMediaV2TestCases-4.0");
}
}
diff --git a/tests/mediapc/Android.bp b/tests/mediapc/Android.bp
index dbcb34e..b71a8ba 100644
--- a/tests/mediapc/Android.bp
+++ b/tests/mediapc/Android.bp
@@ -24,14 +24,8 @@
"compatibility-device-util-axt",
"ctsmediav2common",
"ctstestrunner-axt",
- "ctstestserver",
"MediaPerformanceClassCommon",
],
- libs: [
- "org.apache.http.legacy",
- "android.test.runner",
- "android.test.base",
- ],
platform_apis: true,
srcs: ["src/**/*.java"],
// Tag this module as a cts test artifact
diff --git a/tests/mediapc/AndroidManifest.xml b/tests/mediapc/AndroidManifest.xml
index bbb1934..17bdc6a 100644
--- a/tests/mediapc/AndroidManifest.xml
+++ b/tests/mediapc/AndroidManifest.xml
@@ -29,8 +29,6 @@
<application
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true">
- <uses-library android:name="android.test.runner" />
- <uses-library android:name="org.apache.http.legacy" />
<activity android:name="android.mediapc.cts.TestActivity" />
</application>
<uses-sdk android:minSdkVersion="30" android:targetSdkVersion="30" />
diff --git a/tests/mediapc/AndroidTest.xml b/tests/mediapc/AndroidTest.xml
index d8bd794..d21d0ed 100644
--- a/tests/mediapc/AndroidTest.xml
+++ b/tests/mediapc/AndroidTest.xml
@@ -39,7 +39,7 @@
</target_preparer>
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.MediaPreparer">
<option name="push-all" value="true" />
- <option name="media-folder-name" value="CtsMediaPerformanceClassTestCases-2.3" />
+ <option name="media-folder-name" value="CtsMediaPerformanceClassTestCases-3.0" />
<option name="dynamic-config-module" value="CtsMediaPerformanceClassTestCases" />
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
diff --git a/tests/mediapc/DynamicConfig.xml b/tests/mediapc/DynamicConfig.xml
index 1268d76..85064d7 100644
--- a/tests/mediapc/DynamicConfig.xml
+++ b/tests/mediapc/DynamicConfig.xml
@@ -1,6 +1,6 @@
<dynamicConfig>
<entry key="media_files_url">
- <value>https://dl.google.com/android/xts/cts/tests/mediapc/CtsMediaPerformanceClassTestCases-2.3.zip</value>
+ <value>https://dl.google.com/android/xts/cts/tests/mediapc/CtsMediaPerformanceClassTestCases-3.0.zip</value>
</entry>
</dynamicConfig>
diff --git a/tests/mediapc/README.md b/tests/mediapc/README.md
index 62067ef..97646be 100644
--- a/tests/mediapc/README.md
+++ b/tests/mediapc/README.md
@@ -1,7 +1,7 @@
## Media Performance Class CTS Tests
Current folder comprises of files necessary for testing media performance class.
-The test vectors used by the test suite is available at [link](https://dl.google.com/android/xts/cts/tests/mediapc/CtsMediaPerformanceClassTestCases-2.3.zip) and is downloaded automatically while running tests. Manual installation of these can be done using copy_media.sh script in this directory.
+The test vectors used by the test suite is available at [link](https://dl.google.com/android/xts/cts/tests/mediapc/CtsMediaPerformanceClassTestCases-3.0.zip) and is downloaded automatically while running tests. Manual installation of these can be done using copy_media.sh script in this directory.
### Commands
#### To run all tests in CtsMediaPerformanceClassTestCases
diff --git a/tests/mediapc/common/src/android/mediapc/cts/common/PerformanceClassEvaluator.java b/tests/mediapc/common/src/android/mediapc/cts/common/PerformanceClassEvaluator.java
index 996ac26..57f4d26 100644
--- a/tests/mediapc/common/src/android/mediapc/cts/common/PerformanceClassEvaluator.java
+++ b/tests/mediapc/common/src/android/mediapc/cts/common/PerformanceClassEvaluator.java
@@ -1596,14 +1596,9 @@
supported);
}
- public void setFrontPreviewStabilizationSupported(boolean supported) {
- this.setMeasuredValue(RequirementConstants.FRONT_CAMERA_PREVIEW_STABILIZATION_SUPPORTED,
- supported);
- }
-
/**
* [2.2.7.2/7.5/H-1-12] MUST support CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION
- * for both primary front and primary back camera.
+ * for the primary back camera.
*/
public static PreviewStabilizationRequirement createPreviewStabilizationReq() {
RequiredMeasurement<Boolean> rearRequirement = RequiredMeasurement
@@ -1613,16 +1608,9 @@
.addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
.addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
.build();
- RequiredMeasurement<Boolean> frontRequirement = RequiredMeasurement
- .<Boolean>builder()
- .setId(RequirementConstants.FRONT_CAMERA_PREVIEW_STABILIZATION_SUPPORTED)
- .setPredicate(RequirementConstants.BOOLEAN_EQ)
- .addRequiredValue(Build.VERSION_CODES.TIRAMISU, true)
- .addRequiredValue(Build.VERSION_CODES.UPSIDE_DOWN_CAKE, true)
- .build();
return new PreviewStabilizationRequirement(RequirementConstants.R7_5__H_1_12,
- rearRequirement, frontRequirement);
+ rearRequirement);
}
}
diff --git a/tests/mediapc/common/src/android/mediapc/cts/common/RequirementConstants.java b/tests/mediapc/common/src/android/mediapc/cts/common/RequirementConstants.java
index f675520..6c3e99a 100644
--- a/tests/mediapc/common/src/android/mediapc/cts/common/RequirementConstants.java
+++ b/tests/mediapc/common/src/android/mediapc/cts/common/RequirementConstants.java
@@ -129,8 +129,6 @@
public static final String FRONT_CAMERA_LATENCY = "front_camera_latency";
public static final String FRONT_CAMERA_LOGICAL_MULTI_CAMERA_REQ_MET =
"front_camera_logical_multi_camera_req_met";
- public static final String FRONT_CAMERA_PREVIEW_STABILIZATION_SUPPORTED =
- "front_camera_preview_stabilization_supported";
public static final String FRONT_CAMERA_STREAM_USECASE_SUPPORTED =
"front_camera_stream_usecase_supported";
public static final String FRONT_CAMERA_TIMESTAMP_SOURCE =
diff --git a/tests/mediapc/copy_media.sh b/tests/mediapc/copy_media.sh
index 4e74f5a..b8a07a4 100755
--- a/tests/mediapc/copy_media.sh
+++ b/tests/mediapc/copy_media.sh
@@ -17,7 +17,7 @@
## script to install media performance class test files manually
adbOptions=" "
-resLabel=CtsMediaPerformanceClassTestCases-2.3
+resLabel=CtsMediaPerformanceClassTestCases-3.0
srcDir="/tmp/$resLabel"
tgtDir="/sdcard/test"
usage="Usage: $0 [-h] [-s serial]"
diff --git a/tests/mediapc/src/android/mediapc/cts/CodecInitializationLatencyTest.java b/tests/mediapc/src/android/mediapc/cts/CodecInitializationLatencyTest.java
index c08fdb9..1948e4f 100644
--- a/tests/mediapc/src/android/mediapc/cts/CodecInitializationLatencyTest.java
+++ b/tests/mediapc/src/android/mediapc/cts/CodecInitializationLatencyTest.java
@@ -82,7 +82,7 @@
private static final String AVC = MediaFormat.MIMETYPE_VIDEO_AVC;
private static final String HEVC = MediaFormat.MIMETYPE_VIDEO_HEVC;
- private static final String AVC_TRANSCODE_FILE = "bbb_1280x720_3mbps_30fps_avc.mp4";
+ private static final String AVC_TRANSCODE_FILE = "bbb_1920x1080_8mbps_60fps_avc.mp4";
private static String AVC_DECODER_NAME;
private static String AVC_ENCODER_NAME;
private static final Map<String, String> mTestFiles = new HashMap<>();
@@ -219,8 +219,7 @@
}
private void startLoad() throws Exception {
- // TODO: b/183671436
- // Create Transcode load (AVC Decoder(720p) + AVC Encoder(720p))
+ // Create Transcode load (AVC Decoder(1080p) + AVC Encoder(720p))
mTranscodeLoadStatus = new LoadStatus();
mTranscodeLoadThread = new Thread(() -> {
try {
diff --git a/tests/mediapc/src/android/mediapc/cts/CodecTestBase.java b/tests/mediapc/src/android/mediapc/cts/CodecTestBase.java
index ac5e62a..85d1a4e 100644
--- a/tests/mediapc/src/android/mediapc/cts/CodecTestBase.java
+++ b/tests/mediapc/src/android/mediapc/cts/CodecTestBase.java
@@ -609,8 +609,25 @@
isEncoder ? MediaCodec.CONFIGURE_FLAG_ENCODE : 0);
Map<UUID, byte[]> psshInfo = mExtractor.getPsshInfo();
- assertNotNull("Extractor is missing pssh info", psshInfo);
- byte[] emeInitData = psshInfo.get(WIDEVINE_UUID);
+ byte[] emeInitData = null;
+
+ // TODO(b/230682028) Remove the following once webm extractor returns PSSH info for VP9
+ if (psshInfo == null && mMime.equals(MediaFormat.MIMETYPE_VIDEO_VP9)) {
+ if (format.getInteger(MediaFormat.KEY_HEIGHT) == 1080) {
+ emeInitData = new byte[]{8, 1, 18, 1, 51, 26, 13, 119, 105, 100, 101, 118,
+ 105, 110, 101, 95, 116, 101, 115, 116, 34, 10, 50, 48, 49, 53,
+ 95, 116, 101, 97, 114, 115, 42, 2, 72, 68};
+ } else if (format.getInteger(MediaFormat.KEY_HEIGHT) == 2160) {
+ emeInitData = new byte[]{8, 1, 18, 1, 56, 26, 13, 119, 105, 100, 101, 118,
+ 105, 110, 101, 95, 116, 101, 115, 116, 34, 10, 50, 48, 49, 53,
+ 95, 116, 101, 97, 114, 115, 42, 4, 85, 72, 68, 49};
+ } else {
+ fail("unable to get pssh info for the given resolution in vp9");
+ }
+ } else {
+ assertNotNull("Extractor is missing pssh info", psshInfo);
+ emeInitData = psshInfo.get(WIDEVINE_UUID);
+ }
assertNotNull("Extractor pssh info is missing data for scheme: " + WIDEVINE_UUID,
emeInitData);
KeyRequester requester =
diff --git a/tests/mediapc/src/android/mediapc/cts/CodecTranscoderTestBase.java b/tests/mediapc/src/android/mediapc/cts/CodecTranscoderTestBase.java
index 7e47545..00bb02e 100644
--- a/tests/mediapc/src/android/mediapc/cts/CodecTranscoderTestBase.java
+++ b/tests/mediapc/src/android/mediapc/cts/CodecTranscoderTestBase.java
@@ -54,6 +54,8 @@
MediaCodec mDecoder;
CodecAsyncHandler mAsyncHandleDecoder;
Surface mSurface;
+ InputSurface mInputSurface;
+ OutputSurface mOutputSurface;
boolean mSawDecInputEOS;
boolean mSawDecOutputEOS;
@@ -360,6 +362,7 @@
if (mUseHighBitDepth) {
encoderFormat.setInteger(MediaFormat.KEY_PROFILE,
Objects.requireNonNull(PROFILE_HLG_MAP.get(mMime))[0]);
+ encoderFormat.setInteger(MediaFormat.KEY_LEVEL, 1);
}
return encoderFormat;
}
@@ -371,9 +374,9 @@
class Transcode extends CodecTranscoderTestBase implements Callable<Double> {
private static final String LOG_TAG = Transcode.class.getSimpleName();
- private final String mDecoderName;
- private final String mEncoderName;
- private final boolean mIsAsync;
+ final String mDecoderName;
+ final String mEncoderName;
+ final boolean mIsAsync;
Transcode(String mime, String testFile, String decoderName, String encoderName,
boolean isAsync, boolean useHighBitDepth) {
@@ -433,6 +436,10 @@
* If input reaches eos, it will rewind the input to start position.
*/
class TranscodeLoad extends Transcode {
+ private static final String LOG_TAG = TranscodeLoad.class.getSimpleName();
+ private static final boolean DEBUG = false;
+ private static final int TARGET_WIDTH = 1280;
+ private static final int TARGET_HEIGHT = 720;
private final LoadStatus mLoadStatus;
private long mMaxPts;
@@ -447,6 +454,31 @@
}
@Override
+ MediaFormat setUpEncoderFormat(MediaFormat decoderFormat) {
+ MediaFormat encoderFormat = new MediaFormat();
+ encoderFormat.setString(MediaFormat.KEY_MIME, mMime);
+ encoderFormat.setInteger(MediaFormat.KEY_FRAME_RATE, mFrameRate);
+ encoderFormat.setInteger(MediaFormat.KEY_BIT_RATE, mBitrate);
+ encoderFormat.setFloat(MediaFormat.KEY_I_FRAME_INTERVAL, 1.0f);
+ encoderFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT,
+ MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
+ encoderFormat.setInteger(MediaFormat.KEY_MAX_B_FRAMES, mMaxBFrames);
+ encoderFormat.setInteger(MediaFormat.KEY_PRIORITY,
+ decoderFormat.getInteger(MediaFormat.KEY_PRIORITY));
+ if ((decoderFormat.getInteger(MediaFormat.KEY_WIDTH) != TARGET_WIDTH)
+ || (decoderFormat.getInteger(MediaFormat.KEY_HEIGHT) != TARGET_HEIGHT)) {
+ encoderFormat.setInteger(MediaFormat.KEY_WIDTH, TARGET_WIDTH);
+ encoderFormat.setInteger(MediaFormat.KEY_HEIGHT, TARGET_HEIGHT);
+ } else {
+ encoderFormat.setInteger(MediaFormat.KEY_WIDTH,
+ decoderFormat.getInteger(MediaFormat.KEY_WIDTH));
+ encoderFormat.setInteger(MediaFormat.KEY_HEIGHT,
+ decoderFormat.getInteger(MediaFormat.KEY_HEIGHT));
+ }
+ return encoderFormat;
+ }
+
+ @Override
void configureCodec(MediaFormat decFormat, MediaFormat encFormat, boolean isAsync,
boolean signalEOSWithLastFrame) {
decFormat.setInteger(MediaFormat.KEY_PRIORITY, 1);
@@ -460,8 +492,140 @@
}
mSurface = mEncoder.createInputSurface();
assertTrue("Surface is not valid", mSurface.isValid());
+ mInputSurface = new InputSurface(mSurface);
+ mInputSurface.updateSize(TARGET_WIDTH, TARGET_HEIGHT);
+ mInputSurface.makeCurrent();
mAsyncHandleDecoder.setCallBack(mDecoder, isAsync);
- mDecoder.configure(decFormat, mSurface, null, 0);
+ mOutputSurface = new OutputSurface();
+ mDecoder.configure(decFormat, mOutputSurface.getSurface(), null, 0);
+ }
+
+ @Override
+ public Double doTranscode() throws Exception {
+ MediaFormat decoderFormat = setUpSource(mTestFile);
+ mDecoder = MediaCodec.createByCodecName(mDecoderName);
+ MediaFormat encoderFormat = setUpEncoderFormat(decoderFormat);
+ mEncoder = MediaCodec.createByCodecName(mEncoderName);
+ mExtractor.seekTo(0, MediaExtractor.SEEK_TO_CLOSEST_SYNC);
+ configureCodec(decoderFormat, encoderFormat, false, false);
+ mEncoder.start();
+ mDecoder.start();
+ long start = System.currentTimeMillis();
+ doWork(Integer.MAX_VALUE);
+ long end = System.currentTimeMillis();
+ mSurface.release();
+ mInputSurface.release();
+ mOutputSurface.release();
+ mDecoder.stop();
+ mDecoder.release();
+ mEncoder.stop();
+ mEncoder.release();
+ mExtractor.release();
+ double fps = mEncOutputCount / ((end - start) / 1000.0);
+ Log.d(LOG_TAG,
+ "Mime: " + mMime + " Decoder: " + mDecoderName + " Encoder: " + mEncoderName
+ + " Achieved fps: " + fps);
+ return fps;
+ }
+
+ @Override
+ void doWork(int frameLimit) {
+ MediaCodec.BufferInfo outInfo = new MediaCodec.BufferInfo();
+ boolean outputDone = false;
+ boolean inputDone = false;
+ boolean decoderDone = false;
+
+ while (!outputDone) {
+ // Feed data to the decoder
+ if (!inputDone) {
+ int inputBufferId = mDecoder.dequeueInputBuffer(CodecTestBase.Q_DEQ_TIMEOUT_US);
+ if (inputBufferId != -1) {
+ enqueueDecoderInput(inputBufferId);
+ if (mSawDecInputEOS) {
+ inputDone = true;
+ if (DEBUG) Log.d(LOG_TAG, "Sent input EOS");
+ }
+ } else {
+ if (DEBUG) Log.e(LOG_TAG, "Input buffer not available");
+ }
+ }
+
+ // Assume output is available. Loop until both assumptions are false.
+ boolean decoderOutputAvailable = !decoderDone;
+ boolean encoderOutputAvailable = true;
+ while (decoderOutputAvailable || encoderOutputAvailable) {
+ // Start by draining any pending output from the encoder. It's important to
+ // do this before we try to stuff any more data in.
+ int outputBufferId =
+ mEncoder.dequeueOutputBuffer(outInfo, CodecTestBase.Q_DEQ_TIMEOUT_US);
+ if (outputBufferId == MediaCodec.INFO_TRY_AGAIN_LATER) {
+ // no output available yet
+ if (DEBUG) Log.d(LOG_TAG, "no output from encoder available");
+ encoderOutputAvailable = false;
+ } else if (outputBufferId == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
+ if (DEBUG) Log.d(LOG_TAG, "encoder output buffers changed");
+ } else if (outputBufferId == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
+ MediaFormat newFormat = mEncoder.getOutputFormat();
+ if (DEBUG) Log.d(LOG_TAG, "encoder output format changed: " + newFormat);
+ } else if (outputBufferId < 0) {
+ fail("unexpected result from encoder.dequeueOutputBuffer: " + outputBufferId);
+ } else { // outputBufferId >= 0
+ dequeueEncoderOutput(outputBufferId, outInfo);
+ if (mSawEncOutputEOS) {
+ outputDone = true;
+ }
+ }
+ if (outputBufferId != MediaCodec.INFO_TRY_AGAIN_LATER) {
+ continue;
+ }
+
+ if (!decoderDone) {
+ outputBufferId =
+ mDecoder.dequeueOutputBuffer(outInfo, CodecTestBase.Q_DEQ_TIMEOUT_US);
+ if (outputBufferId == MediaCodec.INFO_TRY_AGAIN_LATER) {
+ // no output available yet
+ if (DEBUG) Log.d(LOG_TAG, "no output from decoder available");
+ decoderOutputAvailable = false;
+ } else if (outputBufferId == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
+ if (DEBUG) Log.d(LOG_TAG, "decoder output buffers changed (we don't care)");
+ } else if (outputBufferId == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
+ // expected before first buffer of data
+ MediaFormat newFormat = mDecoder.getOutputFormat();
+ if (DEBUG) Log.d(LOG_TAG, "decoder output format changed: " + newFormat);
+ } else if (outputBufferId < 0) {
+ fail("unexpected result from decoder.dequeueOutputBuffer: "
+ + outputBufferId);
+ } else { // outputBufferId >= 0
+ // The ByteBuffers are null references, but we still get a nonzero
+ // size for the decoded data.
+ boolean doRender = (outInfo.size != 0);
+
+ // As soon as we call releaseOutputBuffer, the buffer will be forwarded
+ // to SurfaceTexture to convert to a texture. The API doesn't
+ // guarantee that the texture will be available before the call
+ // returns, so we need to wait for the onFrameAvailable callback to
+ // fire. If we don't wait, we risk rendering from the previous frame.
+ mDecoder.releaseOutputBuffer(outputBufferId, doRender);
+ if (doRender) {
+ // This waits for the image and renders it after it arrives.
+ if (DEBUG) Log.d(LOG_TAG, "awaiting frame");
+ mOutputSurface.awaitNewImage();
+ mOutputSurface.drawImage();
+
+ // Send it to the encoder.
+ mInputSurface.setPresentationTime(outInfo.presentationTimeUs * 1000);
+ if (DEBUG) Log.d(LOG_TAG, "swapBuffers");
+ mInputSurface.swapBuffers();
+ }
+ if ((outInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
+ // forward decoder EOS to encoder
+ if (DEBUG) Log.d(LOG_TAG, "signaling input EOS");
+ mEncoder.signalEndOfInputStream();
+ }
+ }
+ }
+ }
+ }
}
@Override
diff --git a/tests/mediapc/src/android/mediapc/cts/FrameDropTestBase.java b/tests/mediapc/src/android/mediapc/cts/FrameDropTestBase.java
index 4f1422f..39dfd51 100644
--- a/tests/mediapc/src/android/mediapc/cts/FrameDropTestBase.java
+++ b/tests/mediapc/src/android/mediapc/cts/FrameDropTestBase.java
@@ -52,7 +52,7 @@
static final String AV1 = MediaFormat.MIMETYPE_VIDEO_AV1;
static final String AAC = MediaFormat.MIMETYPE_AUDIO_AAC;
static final String AAC_LOAD_FILE_NAME = "bbb_1c_128kbps_aac_audio.mp4";
- static final String AVC_LOAD_FILE_NAME = "bbb_1280x720_3mbps_30fps_avc.mp4";
+ static final String AVC_LOAD_FILE_NAME = "bbb_1920x1080_8mbps_60fps_avc.mp4";
static final long DECODE_31S = 31000; // In ms
static final int MAX_FRAME_DROP_FOR_30S;
// For perf class R, one frame drop per 10 seconds at 30 fps i.e. 3 drops per 30 seconds
@@ -247,8 +247,7 @@
}
private void startLoad() {
- // TODO: b/183671436
- // Start Transcode load (Decoder(720p) + Encoder(720p))
+ // Start Transcode load (Decoder(1080p) + Encoder(720p))
mLoadStatus = new LoadStatus();
mTranscodeLoadThread = createTranscodeLoad();
mTranscodeLoadThread.start();
diff --git a/tests/mediapc/src/android/mediapc/cts/InputSurface.java b/tests/mediapc/src/android/mediapc/cts/InputSurface.java
new file mode 100644
index 0000000..0c9856f
--- /dev/null
+++ b/tests/mediapc/src/android/mediapc/cts/InputSurface.java
@@ -0,0 +1,207 @@
+/*
+ * 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.mediapc.cts;
+
+import android.opengl.EGL14;
+import android.opengl.EGLConfig;
+import android.opengl.EGLContext;
+import android.opengl.EGLDisplay;
+import android.opengl.EGLExt;
+import android.opengl.EGLSurface;
+import android.util.Log;
+import android.view.Surface;
+
+class InputSurface {
+ private static final String LOG_TAG = InputSurface.class.getSimpleName();
+ private EGLDisplay mEGLDisplay = EGL14.EGL_NO_DISPLAY;
+ private EGLContext mEGLContext = EGL14.EGL_NO_CONTEXT;
+ private EGLSurface mEGLSurface = EGL14.EGL_NO_SURFACE;
+ private EGLConfig[] mConfigs = new EGLConfig[1];
+
+ private Surface mSurface;
+ private int mWidth;
+ private int mHeight;
+
+ /**
+ * Checks for EGL errors.
+ */
+ private void checkEglError(String msg) {
+ int error = EGL14.eglGetError();
+ if (error != EGL14.EGL_SUCCESS) {
+ throw new RuntimeException(msg + ": EGL error: 0x" + Integer.toHexString(error));
+ }
+ }
+
+ /**
+ * Prepares EGL. We want a GLES 2.0 context and a surface that supports recording.
+ */
+ private void eglSetup() {
+ mEGLDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY);
+ if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) {
+ throw new RuntimeException("unable to get EGL14 display");
+ }
+ int[] version = new int[2];
+ if (!EGL14.eglInitialize(mEGLDisplay, version, 0, version, 1)) {
+ mEGLDisplay = null;
+ throw new RuntimeException("unable to initialize EGL14");
+ }
+
+ // Configure EGL for recordable and OpenGL ES 2.0. We want enough RGB bits
+ // to minimize artifacts from possible YUV conversion.
+ int[] attribList = {
+ EGL14.EGL_RED_SIZE, 8,
+ EGL14.EGL_GREEN_SIZE, 8,
+ EGL14.EGL_BLUE_SIZE, 8,
+ EGL14.EGL_RENDERABLE_TYPE, EGL14.EGL_OPENGL_ES2_BIT,
+ EGLExt.EGL_RECORDABLE_ANDROID, 1,
+ EGL14.EGL_NONE
+ };
+ int[] numConfigs = new int[1];
+ if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, mConfigs, 0, mConfigs.length,
+ numConfigs, 0)) {
+ throw new RuntimeException("unable to find RGB888+recordable ES2 EGL config");
+ }
+
+ // Configure context for OpenGL ES 2.0.
+ int[] attrib_list = {
+ EGL14.EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL14.EGL_NONE
+ };
+ mEGLContext = EGL14.eglCreateContext(mEGLDisplay, mConfigs[0], EGL14.EGL_NO_CONTEXT,
+ attrib_list, 0);
+ checkEglError("eglCreateContext");
+ if (mEGLContext == null) {
+ throw new RuntimeException("null context");
+ }
+
+ // Create a window surface, and attach it to the Surface we received.
+ createEGLSurface();
+ mWidth = getWidth();
+ mHeight = getHeight();
+ }
+
+ private void createEGLSurface() {
+ //EGLConfig[] configs = new EGLConfig[1];
+ int[] surfaceAttribs = {
+ EGL14.EGL_NONE
+ };
+ mEGLSurface = EGL14.eglCreateWindowSurface(mEGLDisplay, mConfigs[0], mSurface,
+ surfaceAttribs, 0);
+ checkEglError("eglCreateWindowSurface");
+ if (mEGLSurface == null) {
+ throw new RuntimeException("surface was null");
+ }
+ }
+
+ /**
+ * Queries the surface's width.
+ */
+ public int getWidth() {
+ int[] value = new int[1];
+ EGL14.eglQuerySurface(mEGLDisplay, mEGLSurface, EGL14.EGL_WIDTH, value, 0);
+ return value[0];
+ }
+
+ /**
+ * Queries the surface's height.
+ */
+ public int getHeight() {
+ int[] value = new int[1];
+ EGL14.eglQuerySurface(mEGLDisplay, mEGLSurface, EGL14.EGL_HEIGHT, value, 0);
+ return value[0];
+ }
+
+ /**
+ * Creates an InputSurface from a Surface.
+ */
+ public InputSurface(Surface surface) {
+ if (surface == null) {
+ throw new NullPointerException();
+ }
+ mSurface = surface;
+ eglSetup();
+ }
+
+ /**
+ * Discard all resources held by this class, notably the EGL context.
+ */
+ public void release() {
+ if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) {
+ EGL14.eglDestroySurface(mEGLDisplay, mEGLSurface);
+ EGL14.eglDestroyContext(mEGLDisplay, mEGLContext);
+ EGL14.eglReleaseThread();
+ EGL14.eglTerminate(mEGLDisplay);
+ }
+
+ mEGLDisplay = EGL14.EGL_NO_DISPLAY;
+ mEGLContext = EGL14.EGL_NO_CONTEXT;
+ mEGLSurface = EGL14.EGL_NO_SURFACE;
+
+ mSurface = null;
+ }
+
+ /**
+ * Makes our EGL context and surface current.
+ */
+ public void makeCurrent() {
+ if (!EGL14.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext)) {
+ throw new RuntimeException("eglMakeCurrent failed");
+ }
+ }
+
+ /**
+ * Calls eglSwapBuffers. Use this to "publish" the current frame.
+ */
+ public boolean swapBuffers() {
+ return EGL14.eglSwapBuffers(mEGLDisplay, mEGLSurface);
+ }
+
+ /**
+ * Returns the Surface that the MediaCodec receives buffers from.
+ */
+ public Surface getSurface() {
+ return mSurface;
+ }
+
+
+ /**
+ * Sends the presentation time stamp to EGL. Time is expressed in nanoseconds.
+ */
+ public void setPresentationTime(long nsecs) {
+ EGLExt.eglPresentationTimeANDROID(mEGLDisplay, mEGLSurface, nsecs);
+ }
+
+
+ public void updateSize(int width, int height) {
+ if (width != mWidth || height != mHeight) {
+ Log.d(LOG_TAG, "re-create EGLSurface");
+ releaseEGLSurface();
+ createEGLSurface();
+ mWidth = getWidth();
+ mHeight = getHeight();
+ }
+ }
+
+
+ private void releaseEGLSurface() {
+ if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) {
+ EGL14.eglDestroySurface(mEGLDisplay, mEGLSurface);
+ mEGLSurface = EGL14.EGL_NO_SURFACE;
+ }
+ }
+
+}
diff --git a/tests/mediapc/src/android/mediapc/cts/MultiCodecPerfTestBase.java b/tests/mediapc/src/android/mediapc/cts/MultiCodecPerfTestBase.java
index 0e295fc..71e414f 100644
--- a/tests/mediapc/src/android/mediapc/cts/MultiCodecPerfTestBase.java
+++ b/tests/mediapc/src/android/mediapc/cts/MultiCodecPerfTestBase.java
@@ -111,9 +111,8 @@
.put(MediaFormat.MIMETYPE_VIDEO_AVC, "bbb_1920x1080_6mbps_30fps_avc_cenc.mp4");
m1080pWidevineTestFiles
.put(MediaFormat.MIMETYPE_VIDEO_HEVC, "bbb_1920x1080_4mbps_30fps_hevc_cenc.mp4");
- // TODO(b/230682028)
- // m1080pWidevineTestFiles
- // .put(MediaFormat.MIMETYPE_VIDEO_VP9, "bbb_1920x1080_4mbps_30fps_vp9_cenc.webm");
+ m1080pWidevineTestFiles
+ .put(MediaFormat.MIMETYPE_VIDEO_VP9, "bbb_1920x1080_4mbps_30fps_vp9_cenc.webm");
m1080pWidevineTestFiles
.put(MediaFormat.MIMETYPE_VIDEO_AV1, "bbb_1920x1080_4mbps_30fps_av1_cenc.mp4");
@@ -121,9 +120,8 @@
.put(MediaFormat.MIMETYPE_VIDEO_AVC, "bbb_3840x2160_18mbps_30fps_avc_cenc.mp4");
m2160pPc14WidevineTestFiles
.put(MediaFormat.MIMETYPE_VIDEO_HEVC, "bbb_3840x2160_12mbps_30fps_hevc_cenc.mp4");
- // TODO(b/230682028)
- // m2160pWidevineTestFiles
- // .put(MediaFormat.MIMETYPE_VIDEO_VP9, "bbb_3840x2160_12mbps_30fps_vp9_cenc.webm");
+ m2160pPc14WidevineTestFiles
+ .put(MediaFormat.MIMETYPE_VIDEO_VP9, "bbb_3840x2160_12mbps_30fps_vp9_cenc.webm");
// Limit AV1 4k tests to 1080p as per PC14 requirements
m2160pPc14WidevineTestFiles
.put(MediaFormat.MIMETYPE_VIDEO_AV1, "bbb_1920x1080_4mbps_30fps_av1_cenc.mp4");
diff --git a/tests/mediapc/src/android/mediapc/cts/MultiDecoderPairPerfTest.java b/tests/mediapc/src/android/mediapc/cts/MultiDecoderPairPerfTest.java
index 1053221..6c80d5e 100644
--- a/tests/mediapc/src/android/mediapc/cts/MultiDecoderPairPerfTest.java
+++ b/tests/mediapc/src/android/mediapc/cts/MultiDecoderPairPerfTest.java
@@ -283,6 +283,7 @@
for (Future<Double> result : resultList) {
achievedFrameRate += result.get();
}
+ pool.shutdown();
}
PerformanceClassEvaluator pce = new PerformanceClassEvaluator(this.mTestName);
diff --git a/tests/mediapc/src/android/mediapc/cts/MultiDecoderPerfTest.java b/tests/mediapc/src/android/mediapc/cts/MultiDecoderPerfTest.java
index 5c4530f..ecc499c 100644
--- a/tests/mediapc/src/android/mediapc/cts/MultiDecoderPerfTest.java
+++ b/tests/mediapc/src/android/mediapc/cts/MultiDecoderPerfTest.java
@@ -197,6 +197,7 @@
for (Future<Double> result : resultList) {
achievedFrameRate += result.get();
}
+ pool.shutdown();
}
PerformanceClassEvaluator pce = new PerformanceClassEvaluator(this.mTestName);
diff --git a/tests/mediapc/src/android/mediapc/cts/MultiEncoderPairPerfTest.java b/tests/mediapc/src/android/mediapc/cts/MultiEncoderPairPerfTest.java
index 2d14dc6..715242b 100644
--- a/tests/mediapc/src/android/mediapc/cts/MultiEncoderPairPerfTest.java
+++ b/tests/mediapc/src/android/mediapc/cts/MultiEncoderPairPerfTest.java
@@ -197,6 +197,7 @@
for (Future<Double> result : resultList) {
achievedFrameRate += result.get();
}
+ pool.shutdown();
}
PerformanceClassEvaluator pce = new PerformanceClassEvaluator(this.mTestName);
PerformanceClassEvaluator.ConcurrentCodecRequirement r5_1__H_1_3;
diff --git a/tests/mediapc/src/android/mediapc/cts/MultiEncoderPerfTest.java b/tests/mediapc/src/android/mediapc/cts/MultiEncoderPerfTest.java
index 2fe1037..460cf9d 100644
--- a/tests/mediapc/src/android/mediapc/cts/MultiEncoderPerfTest.java
+++ b/tests/mediapc/src/android/mediapc/cts/MultiEncoderPerfTest.java
@@ -165,6 +165,7 @@
for (Future<Double> result : resultList) {
achievedFrameRate += result.get();
}
+ pool.shutdown();
}
PerformanceClassEvaluator pce = new PerformanceClassEvaluator(this.mTestName);
PerformanceClassEvaluator.ConcurrentCodecRequirement r5_1__H_1_3;
diff --git a/tests/mediapc/src/android/mediapc/cts/OutputSurface.java b/tests/mediapc/src/android/mediapc/cts/OutputSurface.java
new file mode 100644
index 0000000..d83d4d1
--- /dev/null
+++ b/tests/mediapc/src/android/mediapc/cts/OutputSurface.java
@@ -0,0 +1,322 @@
+/*
+ * 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.mediapc.cts;
+
+import static org.junit.Assert.assertTrue;
+
+import android.graphics.SurfaceTexture;
+import android.opengl.EGL14;
+import android.opengl.EGLConfig;
+import android.opengl.EGLContext;
+import android.opengl.EGLDisplay;
+import android.opengl.EGLSurface;
+import android.util.Log;
+import android.view.Surface;
+
+
+/**
+ * Holds state associated with a Surface used for MediaCodec decoder output.
+ * <p>
+ * The (width,height) constructor for this class will prepare GL, create a SurfaceTexture,
+ * and then create a Surface for that SurfaceTexture. The Surface can be passed to
+ * MediaCodec.configure() to receive decoder output. When a frame arrives, we latch the
+ * texture with updateTexImage, then render the texture with GL to a pbuffer.
+ * <p>
+ * The no-arg constructor skips the GL preparation step and doesn't allocate a pbuffer.
+ * Instead, it just creates the Surface and SurfaceTexture, and when a frame arrives
+ * we just draw it on whatever surface is current.
+ * <p>
+ * By default, the Surface will be using a BufferQueue in asynchronous mode, so we
+ * can potentially drop frames.
+ */
+class OutputSurface implements SurfaceTexture.OnFrameAvailableListener {
+ private static final String TAG = OutputSurface.class.getSimpleName();
+ private static final boolean VERBOSE = false;
+
+ private EGLDisplay mEGLDisplay = EGL14.EGL_NO_DISPLAY;
+ private EGLContext mEGLContext = EGL14.EGL_NO_CONTEXT;
+ private EGLSurface mEGLSurface = EGL14.EGL_NO_SURFACE;
+
+ private SurfaceTexture mSurfaceTexture;
+ private Surface mSurface;
+
+ private Object mFrameSyncObject = new Object(); // guards mFrameAvailable
+ private boolean mFrameAvailable;
+
+ private TextureRender mTextureRender;
+
+ /**
+ * Creates an OutputSurface backed by a pbuffer with the specified dimensions. The new
+ * EGL context and surface will be made current. Creates a Surface that can be passed
+ * to MediaCodec.configure().
+ */
+ public OutputSurface(int width, int height) {
+ if (width <= 0 || height <= 0) {
+ throw new IllegalArgumentException();
+ }
+
+ eglSetup(width, height);
+ makeCurrent();
+
+ setup(this);
+ }
+
+ /**
+ * Creates an OutputSurface using the current EGL context (rather than establishing a
+ * new one). Creates a Surface that can be passed to MediaCodec.configure().
+ */
+ public OutputSurface() {
+ setup(this);
+ }
+
+ public OutputSurface(final SurfaceTexture.OnFrameAvailableListener listener) {
+ setup(listener);
+ }
+
+ /**
+ * Creates instances of TextureRender and SurfaceTexture, and a Surface associated
+ * with the SurfaceTexture.
+ */
+ private void setup(SurfaceTexture.OnFrameAvailableListener listener) {
+ assertTrue(EGL14.eglGetCurrentContext() != EGL14.EGL_NO_CONTEXT);
+ assertTrue(EGL14.eglGetCurrentDisplay() != EGL14.EGL_NO_DISPLAY);
+ assertTrue(EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW) != EGL14.EGL_NO_SURFACE);
+ assertTrue(EGL14.eglGetCurrentSurface(EGL14.EGL_READ) != EGL14.EGL_NO_SURFACE);
+ mTextureRender = new TextureRender();
+ mTextureRender.surfaceCreated();
+
+ // Even if we don't access the SurfaceTexture after the constructor returns, we
+ // still need to keep a reference to it. The Surface doesn't retain a reference
+ // at the Java level, so if we don't either then the object can get GCed, which
+ // causes the native finalizer to run.
+ if (VERBOSE) Log.d(TAG, "textureID=" + mTextureRender.getTextureId());
+ mSurfaceTexture = new SurfaceTexture(mTextureRender.getTextureId());
+
+ // This doesn't work if OutputSurface is created on the thread that CTS started for
+ // these test cases.
+ //
+ // The CTS-created thread has a Looper, and the SurfaceTexture constructor will
+ // create a Handler that uses it. The "frame available" message is delivered
+ // there, but since we're not a Looper-based thread we'll never see it. For
+ // this to do anything useful, OutputSurface must be created on a thread without
+ // a Looper, so that SurfaceTexture uses the main application Looper instead.
+ //
+ // Java language note: passing "this" out of a constructor is generally unwise,
+ // but we should be able to get away with it here.
+ mSurfaceTexture.setOnFrameAvailableListener(listener);
+
+ mSurface = new Surface(mSurfaceTexture);
+ }
+
+ /**
+ * Prepares EGL. We want a GLES 2.0 context and a surface that supports pbuffer.
+ */
+ private void eglSetup(int width, int height) {
+ mEGLDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY);
+ if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) {
+ throw new RuntimeException("unable to get EGL14 display");
+ }
+ int[] version = new int[2];
+ if (!EGL14.eglInitialize(mEGLDisplay, version, 0, version, 1)) {
+ mEGLDisplay = null;
+ throw new RuntimeException("unable to initialize EGL14");
+ }
+
+ // Configure EGL for pbuffer and OpenGL ES 2.0. We want enough RGB bits
+ // to be able to tell if the frame is reasonable.
+ int[] attribList = {
+ EGL14.EGL_RED_SIZE, 8,
+ EGL14.EGL_GREEN_SIZE, 8,
+ EGL14.EGL_BLUE_SIZE, 8,
+ EGL14.EGL_RENDERABLE_TYPE, EGL14.EGL_OPENGL_ES2_BIT,
+ EGL14.EGL_SURFACE_TYPE, EGL14.EGL_PBUFFER_BIT,
+ EGL14.EGL_NONE
+ };
+ EGLConfig[] configs = new EGLConfig[1];
+ int[] numConfigs = new int[1];
+ if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
+ numConfigs, 0)) {
+ throw new RuntimeException("unable to find RGB888+recordable ES2 EGL config");
+ }
+
+ // Configure context for OpenGL ES 2.0.
+ int[] attrib_list = {
+ EGL14.EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL14.EGL_NONE
+ };
+ mEGLContext = EGL14.eglCreateContext(mEGLDisplay, configs[0], EGL14.EGL_NO_CONTEXT,
+ attrib_list, 0);
+ checkEglError("eglCreateContext");
+ if (mEGLContext == null) {
+ throw new RuntimeException("null context");
+ }
+
+ // Create a pbuffer surface. By using this for output, we can use glReadPixels
+ // to test values in the output.
+ int[] surfaceAttribs = {
+ EGL14.EGL_WIDTH, width,
+ EGL14.EGL_HEIGHT, height,
+ EGL14.EGL_NONE
+ };
+ mEGLSurface = EGL14.eglCreatePbufferSurface(mEGLDisplay, configs[0], surfaceAttribs, 0);
+ checkEglError("eglCreatePbufferSurface");
+ if (mEGLSurface == null) {
+ throw new RuntimeException("surface was null");
+ }
+ }
+
+ /**
+ * Discard all resources held by this class, notably the EGL context.
+ */
+ public void release() {
+ if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) {
+ EGL14.eglDestroySurface(mEGLDisplay, mEGLSurface);
+ EGL14.eglDestroyContext(mEGLDisplay, mEGLContext);
+ EGL14.eglReleaseThread();
+ EGL14.eglTerminate(mEGLDisplay);
+ }
+
+ mSurface.release();
+
+ mSurfaceTexture.release();
+
+ mEGLDisplay = EGL14.EGL_NO_DISPLAY;
+ mEGLContext = EGL14.EGL_NO_CONTEXT;
+ mEGLSurface = EGL14.EGL_NO_SURFACE;
+
+ mTextureRender = null;
+ mSurface = null;
+ mSurfaceTexture = null;
+ }
+
+ /**
+ * Makes our EGL context and surface current.
+ */
+ public void makeCurrent() {
+ if (!EGL14.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext)) {
+ throw new RuntimeException("eglMakeCurrent failed");
+ }
+ }
+
+ /**
+ * Returns the Surface that we draw onto.
+ */
+ public Surface getSurface() {
+ return mSurface;
+ }
+
+ /**
+ * Replaces the fragment shader.
+ */
+ public void changeFragmentShader(String fragmentShader) {
+ mTextureRender.changeFragmentShader(fragmentShader);
+ }
+
+ /**
+ * Latches the next buffer into the texture. Must be called from the thread that created
+ * the OutputSurface object, after the onFrameAvailable callback has signaled that new
+ * data is available.
+ */
+ public void awaitNewImage() {
+ final int TIMEOUT_MS = 2000;
+
+ synchronized (mFrameSyncObject) {
+ while (!mFrameAvailable) {
+ try {
+ // Wait for onFrameAvailable() to signal us. Use a timeout to avoid
+ // stalling the test if it doesn't arrive.
+ mFrameSyncObject.wait(TIMEOUT_MS);
+ if (!mFrameAvailable) {
+ // TODO: if "spurious wakeup", continue while loop
+ throw new RuntimeException("Surface frame wait timed out");
+ }
+ } catch (InterruptedException ie) {
+ // shouldn't happen
+ throw new RuntimeException(ie);
+ }
+ }
+ mFrameAvailable = false;
+ }
+
+ // Latch the data.
+ mTextureRender.checkGlError("before updateTexImage");
+ mSurfaceTexture.updateTexImage();
+ }
+
+ /**
+ * Wait for new image to become available or until timeout, whichever comes first.
+ * @param timeoutMs
+ * @return true if new image is available. false for no new image until timeout.
+ */
+ public boolean checkForNewImage(int timeoutMs) {
+ synchronized (mFrameSyncObject) {
+ while (!mFrameAvailable) {
+ try {
+ // Wait for onFrameAvailable() to signal us. Use a timeout to avoid
+ // stalling the test if it doesn't arrive.
+ mFrameSyncObject.wait(timeoutMs);
+ if (!mFrameAvailable) {
+ return false;
+ }
+ } catch (InterruptedException ie) {
+ // shouldn't happen
+ throw new RuntimeException(ie);
+ }
+ }
+ mFrameAvailable = false;
+ }
+
+ // Latch the data.
+ mTextureRender.checkGlError("before updateTexImage");
+ mSurfaceTexture.updateTexImage();
+ return true;
+ }
+
+ /**
+ * Draws the data from SurfaceTexture onto the current EGL surface.
+ */
+ public void drawImage() {
+ mTextureRender.drawFrame(mSurfaceTexture);
+ }
+
+ public void latchImage() {
+ mTextureRender.checkGlError("before updateTexImage");
+ mSurfaceTexture.updateTexImage();
+ }
+
+ @Override
+ public void onFrameAvailable(SurfaceTexture st) {
+ if (VERBOSE) Log.d(TAG, "new frame available");
+ synchronized (mFrameSyncObject) {
+ if (mFrameAvailable) {
+ throw new RuntimeException("mFrameAvailable already set, frame could be dropped");
+ }
+ mFrameAvailable = true;
+ mFrameSyncObject.notifyAll();
+ }
+ }
+
+ /**
+ * Checks for EGL errors.
+ */
+ private void checkEglError(String msg) {
+ int error = EGL14.eglGetError();
+ if (error != EGL14.EGL_SUCCESS) {
+ throw new RuntimeException(msg + ": EGL error: 0x" + Integer.toHexString(error));
+ }
+ }
+}
diff --git a/tests/mediapc/src/android/mediapc/cts/TextureRender.java b/tests/mediapc/src/android/mediapc/cts/TextureRender.java
new file mode 100644
index 0000000..39cf36d
--- /dev/null
+++ b/tests/mediapc/src/android/mediapc/cts/TextureRender.java
@@ -0,0 +1,302 @@
+/*
+ * 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.mediapc.cts;
+
+import android.graphics.Bitmap;
+import android.graphics.SurfaceTexture;
+import android.opengl.GLES11Ext;
+import android.opengl.GLES20;
+import android.opengl.Matrix;
+import android.util.Log;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.FloatBuffer;
+
+/**
+ * Code for rendering a texture onto a surface using OpenGL ES 2.0.
+ */
+class TextureRender {
+ private static final String TAG = TextureRender.class.getSimpleName();
+
+ private static final int FLOAT_SIZE_BYTES = 4;
+ private static final int TRIANGLE_VERTICES_DATA_STRIDE_BYTES = 5 * FLOAT_SIZE_BYTES;
+ private static final int TRIANGLE_VERTICES_DATA_POS_OFFSET = 0;
+ private static final int TRIANGLE_VERTICES_DATA_UV_OFFSET = 3;
+ private final float[] mTriangleVerticesData = {
+ // X, Y, Z, U, V
+ -1.0f, -1.0f, 0.0f, 0.0f, 0.0f,
+ 1.0f, -1.0f, 0.0f, 1.0f, 0.0f,
+ -1.0f, 1.0f, 0.0f, 0.0f, 1.0f,
+ 1.0f, 1.0f, 0.0f, 1.0f, 1.0f,
+ };
+
+ private FloatBuffer mTriangleVertices;
+
+ private static final String VERTEX_SHADER =
+ "uniform mat4 uMVPMatrix;\n"
+ + "uniform mat4 uSTMatrix;\n"
+ + "attribute vec4 aPosition;\n"
+ + "attribute vec4 aTextureCoord;\n"
+ + "varying vec2 vTextureCoord;\n"
+ + "void main() {\n"
+ + " gl_Position = uMVPMatrix * aPosition;\n"
+ + " vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n"
+ + "}\n";
+
+ private static final String FRAGMENT_SHADER =
+ "#extension GL_OES_EGL_image_external : require\n"
+ + "precision mediump float;\n" // highp here doesn't seem to matter
+ + "varying vec2 vTextureCoord;\n"
+ + "uniform samplerExternalOES sTexture;\n"
+ + "void main() {\n"
+ + " gl_FragColor = texture2D(sTexture, vTextureCoord);\n"
+ + "}\n";
+
+ private float[] mMVPMatrix = new float[16];
+ private float[] mSTMatrix = new float[16];
+
+ private int mProgram;
+ private int mTextureID;
+ private int muMVPMatrixHandle;
+ private int muSTMatrixHandle;
+ private int maPositionHandle;
+ private int maTextureHandle;
+
+ public TextureRender() {
+ mTriangleVertices = ByteBuffer.allocateDirect(
+ mTriangleVerticesData.length * FLOAT_SIZE_BYTES)
+ .order(ByteOrder.nativeOrder()).asFloatBuffer();
+ mTriangleVertices.put(mTriangleVerticesData).position(0);
+
+ Matrix.setIdentityM(mSTMatrix, 0);
+ }
+
+ public int getTextureId() {
+ return mTextureID;
+ }
+
+ public void drawFrame(SurfaceTexture st) {
+ checkGlError("onDrawFrame start");
+ st.getTransformMatrix(mSTMatrix);
+
+ GLES20.glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
+ GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
+
+ GLES20.glUseProgram(mProgram);
+ checkGlError("glUseProgram");
+
+ GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
+ GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, mTextureID);
+
+ mTriangleVertices.position(TRIANGLE_VERTICES_DATA_POS_OFFSET);
+ GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false,
+ TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
+ checkGlError("glVertexAttribPointer maPosition");
+ GLES20.glEnableVertexAttribArray(maPositionHandle);
+ checkGlError("glEnableVertexAttribArray maPositionHandle");
+
+ mTriangleVertices.position(TRIANGLE_VERTICES_DATA_UV_OFFSET);
+ GLES20.glVertexAttribPointer(maTextureHandle, 2, GLES20.GL_FLOAT, false,
+ TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
+ checkGlError("glVertexAttribPointer maTextureHandle");
+ GLES20.glEnableVertexAttribArray(maTextureHandle);
+ checkGlError("glEnableVertexAttribArray maTextureHandle");
+
+ Matrix.setIdentityM(mMVPMatrix, 0);
+ GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mMVPMatrix, 0);
+ GLES20.glUniformMatrix4fv(muSTMatrixHandle, 1, false, mSTMatrix, 0);
+
+ GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
+ checkGlError("glDrawArrays");
+ GLES20.glFinish();
+ }
+
+ /**
+ * Initializes GL state. Call this after the EGL surface has been created and made current.
+ */
+ public void surfaceCreated() {
+ mProgram = createProgram(VERTEX_SHADER, FRAGMENT_SHADER);
+ if (mProgram == 0) {
+ throw new RuntimeException("failed creating program");
+ }
+ maPositionHandle = GLES20.glGetAttribLocation(mProgram, "aPosition");
+ checkGlError("glGetAttribLocation aPosition");
+ if (maPositionHandle == -1) {
+ throw new RuntimeException("Could not get attrib location for aPosition");
+ }
+ maTextureHandle = GLES20.glGetAttribLocation(mProgram, "aTextureCoord");
+ checkGlError("glGetAttribLocation aTextureCoord");
+ if (maTextureHandle == -1) {
+ throw new RuntimeException("Could not get attrib location for aTextureCoord");
+ }
+
+ muMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uMVPMatrix");
+ checkGlError("glGetUniformLocation uMVPMatrix");
+ if (muMVPMatrixHandle == -1) {
+ throw new RuntimeException("Could not get attrib location for uMVPMatrix");
+ }
+
+ muSTMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uSTMatrix");
+ checkGlError("glGetUniformLocation uSTMatrix");
+ if (muSTMatrixHandle == -1) {
+ throw new RuntimeException("Could not get attrib location for uSTMatrix");
+ }
+
+
+ int[] textures = new int[1];
+ GLES20.glGenTextures(1, textures, 0);
+
+ mTextureID = textures[0];
+ GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, mTextureID);
+ checkGlError("glBindTexture mTextureID");
+
+ GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER,
+ GLES20.GL_LINEAR);
+ GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER,
+ GLES20.GL_LINEAR);
+ GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S,
+ GLES20.GL_CLAMP_TO_EDGE);
+ GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T,
+ GLES20.GL_CLAMP_TO_EDGE);
+ checkGlError("glTexParameter");
+ }
+
+ /**
+ * Replaces the fragment shader.
+ */
+ public void changeFragmentShader(String fragmentShader) {
+ GLES20.glDeleteProgram(mProgram);
+ mProgram = createProgram(VERTEX_SHADER, fragmentShader);
+ if (mProgram == 0) {
+ throw new RuntimeException("failed creating program");
+ }
+ }
+
+ private int loadShader(int shaderType, String source) {
+ int shader = GLES20.glCreateShader(shaderType);
+ checkGlError("glCreateShader type=" + shaderType);
+ GLES20.glShaderSource(shader, source);
+ GLES20.glCompileShader(shader);
+ int[] compiled = new int[1];
+ GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);
+ if (compiled[0] == 0) {
+ Log.e(TAG, "Could not compile shader " + shaderType + ":");
+ Log.e(TAG, " " + GLES20.glGetShaderInfoLog(shader));
+ GLES20.glDeleteShader(shader);
+ shader = 0;
+ }
+ return shader;
+ }
+
+ private int createProgram(String vertexSource, String fragmentSource) {
+ int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
+ if (vertexShader == 0) {
+ return 0;
+ }
+ int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
+ if (pixelShader == 0) {
+ return 0;
+ }
+
+ int program = GLES20.glCreateProgram();
+ checkGlError("glCreateProgram");
+ if (program != 0) {
+ GLES20.glAttachShader(program, vertexShader);
+ checkGlError("glAttachShader");
+ GLES20.glAttachShader(program, pixelShader);
+ checkGlError("glAttachShader");
+ GLES20.glLinkProgram(program);
+ int[] linkStatus = new int[1];
+ GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
+ if (linkStatus[0] != GLES20.GL_TRUE) {
+ Log.e(TAG, "Could not link program: ");
+ Log.e(TAG, GLES20.glGetProgramInfoLog(program));
+ GLES20.glDeleteProgram(program);
+ program = 0;
+ }
+ } else {
+ Log.e(TAG, "Could not create program");
+ }
+
+ return program;
+ }
+
+ public void checkGlError(String op) {
+ int error;
+ while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
+ Log.e(TAG, op + ": glError " + error);
+ throw new RuntimeException(op + ": glError " + error);
+ }
+ }
+
+ /**
+ * Saves the current frame to disk as a PNG image. Frame starts from (0,0).
+ * <p>
+ * Useful for debugging.
+ */
+ public static void saveFrame(String filename, int width, int height) {
+ // glReadPixels gives us a ByteBuffer filled with what is essentially big-endian RGBA
+ // data (i.e. a byte of red, followed by a byte of green...). We need an int[] filled
+ // with native-order ARGB data to feed to Bitmap.
+ //
+ // If we implement this as a series of buf.get() calls, we can spend 2.5 seconds just
+ // copying data around for a 720p frame. It's better to do a bulk get() and then
+ // rearrange the data in memory. (For comparison, the PNG compress takes about 500ms
+ // for a trivial frame.)
+ //
+ // So... we set the ByteBuffer to little-endian, which should turn the bulk IntBuffer
+ // get() into a straight memcpy on most Android devices. Our ints will hold ABGR data.
+ // Swapping B and R gives us ARGB. We need about 30ms for the bulk get(), and another
+ // 270ms for the color swap.
+ //
+ // Making this even more interesting is the upside-down nature of GL, which means we
+ // flip the image vertically here.
+
+ ByteBuffer buf = ByteBuffer.allocateDirect(width * height * 4);
+ buf.order(ByteOrder.LITTLE_ENDIAN);
+ GLES20.glReadPixels(0, 0, width, height, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buf);
+ buf.rewind();
+
+ int pixelCount = width * height;
+ int[] colors = new int[pixelCount];
+ buf.asIntBuffer().get(colors);
+ for (int i = 0; i < pixelCount; i++) {
+ int c = colors[i];
+ colors[i] = (c & 0xff00ff00) | ((c & 0x00ff0000) >> 16) | ((c & 0x000000ff) << 16);
+ }
+
+ FileOutputStream fos = null;
+ try {
+ fos = new FileOutputStream(filename);
+ Bitmap bmp = Bitmap.createBitmap(colors, width, height, Bitmap.Config.ARGB_8888);
+ bmp.compress(Bitmap.CompressFormat.PNG, 90, fos);
+ bmp.recycle();
+ } catch (IOException ioe) {
+ throw new RuntimeException("Failed to write file " + filename, ioe);
+ } finally {
+ try {
+ if (fos != null) fos.close();
+ } catch (IOException ioe2) {
+ throw new RuntimeException("Failed to close file " + filename, ioe2);
+ }
+ }
+ Log.d(TAG, "Saved " + width + "x" + height + " frame as '" + filename + "'");
+ }
+}
diff --git a/tests/mediapc/src/android/mediapc/cts/WorkDir.java b/tests/mediapc/src/android/mediapc/cts/WorkDir.java
index 9cb990a..e48b2ab 100644
--- a/tests/mediapc/src/android/mediapc/cts/WorkDir.java
+++ b/tests/mediapc/src/android/mediapc/cts/WorkDir.java
@@ -24,6 +24,6 @@
*/
class WorkDir extends WorkDirBase {
static final String getMediaDirString() {
- return getMediaDirString("CtsMediaPerformanceClassTestCases-2.3");
+ return getMediaDirString("CtsMediaPerformanceClassTestCases-3.0");
}
}
diff --git a/tests/net/Android.bp b/tests/net/Android.bp
index 5b0178d..5e4a8ce 100644
--- a/tests/net/Android.bp
+++ b/tests/net/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_core_networking",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,7 +24,7 @@
name: "CtsNetTestsNonUpdatableLib",
srcs: ["src/**/*.java"],
static_libs: [
- "androidx.test.rules"
+ "androidx.test.rules",
],
libs: [
"net-tests-utils",
diff --git a/tests/netlegacy22.permission/Android.bp b/tests/netlegacy22.permission/Android.bp
index 86c17ae..28438da 100644
--- a/tests/netlegacy22.permission/Android.bp
+++ b/tests/netlegacy22.permission/Android.bp
@@ -24,6 +24,7 @@
static_libs: ["ctstestrunner-axt"],
// Tag this module as a cts test artifact
test_suites: [
+ "androidx.test.rules",
"cts",
"general-tests",
],
diff --git a/tests/netlegacy22.permission/src/android/net/cts/legacy/api22/permission/ConnectivityManagerPermissionTest.java b/tests/netlegacy22.permission/src/android/net/cts/legacy/api22/permission/ConnectivityManagerPermissionTest.java
index 0e59288..ad9b485d 100644
--- a/tests/netlegacy22.permission/src/android/net/cts/legacy/api22/permission/ConnectivityManagerPermissionTest.java
+++ b/tests/netlegacy22.permission/src/android/net/cts/legacy/api22/permission/ConnectivityManagerPermissionTest.java
@@ -19,7 +19,8 @@
import android.content.Context;
import android.net.ConnectivityManager;
import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
+
+import androidx.test.filters.SmallTest;
/**
* Test that protected android.net.ConnectivityManager methods cannot be called without
diff --git a/tests/netlegacy22.permission/src/android/net/cts/legacy/api22/permission/NoNetworkStatePermissionTest.java b/tests/netlegacy22.permission/src/android/net/cts/legacy/api22/permission/NoNetworkStatePermissionTest.java
index 8547261..0b1e20c 100644
--- a/tests/netlegacy22.permission/src/android/net/cts/legacy/api22/permission/NoNetworkStatePermissionTest.java
+++ b/tests/netlegacy22.permission/src/android/net/cts/legacy/api22/permission/NoNetworkStatePermissionTest.java
@@ -19,8 +19,8 @@
import android.content.Context;
import android.net.ConnectivityManager;
import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-import java.net.InetAddress;
+
+import androidx.test.filters.SmallTest;
/**
* Verify ConnectivityManager related methods without specific network state permissions.
diff --git a/tests/quickaccesswallet/OWNERS b/tests/quickaccesswallet/OWNERS
index b633530..eb4c458 100644
--- a/tests/quickaccesswallet/OWNERS
+++ b/tests/quickaccesswallet/OWNERS
@@ -1,8 +1,6 @@
-# Bug component: 802986
+# Bug component: 510713
seanpont@google.com
-steell@google.com
granger@google.com
sbasi@google.com
franksalim@google.com
-juliacr@google.com
-asc@google.com
+jwillcox@google.com
diff --git a/tests/quickaccesswallet/src/android/quickaccesswallet/QuickAccessWalletDelegateTargetActivityService.java b/tests/quickaccesswallet/src/android/quickaccesswallet/QuickAccessWalletDelegateTargetActivityService.java
index aa6ea95..0fa66bd 100644
--- a/tests/quickaccesswallet/src/android/quickaccesswallet/QuickAccessWalletDelegateTargetActivityService.java
+++ b/tests/quickaccesswallet/src/android/quickaccesswallet/QuickAccessWalletDelegateTargetActivityService.java
@@ -21,10 +21,8 @@
import androidx.annotation.Nullable;
-/**
- * Extends {@link TestQuickAccessWalletService} to allow for a different manifest configuration.
- */
-public class QuickAccessWalletDelegateTargetActivityService extends TestQuickAccessWalletService {
+public class QuickAccessWalletDelegateTargetActivityService extends
+ TestBaseQuickAccessWalletService {
@Nullable
@Override
diff --git a/tests/quickaccesswallet/src/android/quickaccesswallet/TestBaseQuickAccessWalletService.java b/tests/quickaccesswallet/src/android/quickaccesswallet/TestBaseQuickAccessWalletService.java
new file mode 100644
index 0000000..c4e7947
--- /dev/null
+++ b/tests/quickaccesswallet/src/android/quickaccesswallet/TestBaseQuickAccessWalletService.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2023 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.quickaccesswallet;
+
+import android.app.PendingIntent;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Icon;
+import android.os.IBinder;
+import android.service.quickaccesswallet.GetWalletCardsCallback;
+import android.service.quickaccesswallet.GetWalletCardsError;
+import android.service.quickaccesswallet.GetWalletCardsRequest;
+import android.service.quickaccesswallet.GetWalletCardsResponse;
+import android.service.quickaccesswallet.QuickAccessWalletService;
+import android.service.quickaccesswallet.SelectWalletCardRequest;
+import android.service.quickaccesswallet.WalletCard;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Extends {@link QuickAccessWalletService} to allow for a different manifest configuration.
+ */
+public class TestBaseQuickAccessWalletService extends QuickAccessWalletService{
+ private static final String TAG = "QAWalletServiceBase";
+
+ private static GetWalletCardsError sWalletCardsError;
+ private static GetWalletCardsResponse sWalletCardsResponse;
+ private static boolean sWalletDismissed;
+ private static List<SelectWalletCardRequest> sSelectWalletCardRequests = new ArrayList<>();
+ private static CountDownLatch sRequestCountDownLatch = new CountDownLatch(0);
+ private static CountDownLatch sBindCounter = new CountDownLatch(0);
+ private static CountDownLatch sUnbindCounter = new CountDownLatch(0);
+
+ public static void resetStaticFields() {
+ sWalletCardsError = null;
+ sWalletCardsResponse = null;
+ sWalletDismissed = false;
+ sSelectWalletCardRequests = new ArrayList<>();
+ sRequestCountDownLatch = new CountDownLatch(0);
+ sBindCounter = new CountDownLatch(0);
+ sUnbindCounter = new CountDownLatch(0);
+ }
+
+ @Nullable
+ @Override
+ public IBinder onBind(@NonNull Intent intent) {
+ sBindCounter.countDown();
+ return super.onBind(intent);
+ }
+
+ @Override
+ public boolean onUnbind(Intent intent) {
+ sUnbindCounter.countDown();
+ return super.onUnbind(intent);
+ }
+
+ @Override
+ public void onWalletCardsRequested(
+ GetWalletCardsRequest request,
+ GetWalletCardsCallback callback) {
+ Log.i(TAG, "onWalletCardsRequested");
+ GetWalletCardsError error = sWalletCardsError;
+ if (error != null) {
+ callback.onFailure(error);
+ return;
+ }
+ GetWalletCardsResponse response = sWalletCardsResponse;
+ if (response == null) {
+ Bitmap bitmap = Bitmap.createBitmap(
+ request.getCardWidthPx(), request.getCardHeightPx(), Bitmap.Config.ARGB_8888);
+ Icon cardImage = Icon.createWithBitmap(bitmap.copy(Bitmap.Config.HARDWARE, false));
+ Intent intent = new Intent(this, QuickAccessWalletActivity.class);
+ PendingIntent pendingIntent =
+ PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE);
+ WalletCard walletCard = new WalletCard.Builder("card1", cardImage, "Card 1",
+ pendingIntent).build();
+ List<WalletCard> walletCards = Collections.singletonList(walletCard);
+ response = new GetWalletCardsResponse(walletCards, 0);
+ }
+ callback.onSuccess(response);
+ }
+
+ @Override
+ public void onWalletCardSelected(SelectWalletCardRequest request) {
+ Log.i(TAG, "onWalletCardSelected");
+ sSelectWalletCardRequests.add(request);
+ sRequestCountDownLatch.countDown();
+ }
+
+ @Override
+ public void onWalletDismissed() {
+ Log.i(TAG, "onWalletDismissed");
+ sWalletDismissed = true;
+ sRequestCountDownLatch.countDown();
+ }
+
+ public static boolean isWalletDismissed() {
+ return sWalletDismissed;
+ }
+
+ public static void setWalletCardsResponse(GetWalletCardsResponse response) {
+ sWalletCardsResponse = response;
+ }
+
+ public static void setWalletCardsError(GetWalletCardsError error) {
+ sWalletCardsError = error;
+ }
+
+ public static List<SelectWalletCardRequest> getSelectRequests() {
+ return new ArrayList<>(sSelectWalletCardRequests);
+ }
+
+ public static void setExpectedRequestCount(int countdown) {
+ sRequestCountDownLatch = new CountDownLatch(countdown);
+ }
+
+ public static void awaitRequests(long timeout, TimeUnit timeUnit) throws InterruptedException {
+ sRequestCountDownLatch.await(timeout, timeUnit);
+ }
+
+ public static void setExpectedBindCount(int count) {
+ sBindCounter = new CountDownLatch(count);
+ }
+
+ public static void awaitBinding(long timeout, TimeUnit unit) throws InterruptedException {
+ sBindCounter.await(timeout, unit);
+ }
+
+ public static void setExpectedUnbindCount(int count) {
+ sUnbindCounter = new CountDownLatch(count);
+ }
+
+ public static void awaitUnbinding(long timeout, TimeUnit unit) throws InterruptedException {
+ sUnbindCounter.await(timeout, unit);
+ }
+}
\ No newline at end of file
diff --git a/tests/quickaccesswallet/src/android/quickaccesswallet/TestQuickAccessWalletService.java b/tests/quickaccesswallet/src/android/quickaccesswallet/TestQuickAccessWalletService.java
index 05c6a38..3a6fe46 100644
--- a/tests/quickaccesswallet/src/android/quickaccesswallet/TestQuickAccessWalletService.java
+++ b/tests/quickaccesswallet/src/android/quickaccesswallet/TestQuickAccessWalletService.java
@@ -16,159 +16,37 @@
package android.quickaccesswallet;
-import android.app.PendingIntent;
import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.drawable.Icon;
import android.os.IBinder;
-import android.service.quickaccesswallet.GetWalletCardsCallback;
-import android.service.quickaccesswallet.GetWalletCardsError;
-import android.service.quickaccesswallet.GetWalletCardsRequest;
-import android.service.quickaccesswallet.GetWalletCardsResponse;
-import android.service.quickaccesswallet.QuickAccessWalletService;
-import android.service.quickaccesswallet.SelectWalletCardRequest;
-import android.service.quickaccesswallet.WalletCard;
import android.service.quickaccesswallet.WalletServiceEvent;
-import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-public class TestQuickAccessWalletService extends QuickAccessWalletService {
+public class TestQuickAccessWalletService extends TestBaseQuickAccessWalletService {
- private static final String TAG = "TestQAWalletSvc";
- private static GetWalletCardsResponse sWalletCardsResponse;
- private static GetWalletCardsError sWalletCardsError;
- private static List<SelectWalletCardRequest> sSelectWalletCardRequests = new ArrayList<>();
- private static boolean sWalletDismissed;
private static WeakReference<TestQuickAccessWalletService> sServiceRef =
new WeakReference<>(null);
- private static CountDownLatch sRequestCountDownLatch = new CountDownLatch(0);
- private static CountDownLatch sBindCounter = new CountDownLatch(0);
- private static CountDownLatch sUnbindCounter = new CountDownLatch(0);
-
- public static void resetStaticFields() {
- sWalletCardsResponse = null;
- sWalletCardsError = null;
- sSelectWalletCardRequests = new ArrayList<>();
- sWalletDismissed = false;
- sRequestCountDownLatch = new CountDownLatch(0);
- sBindCounter = new CountDownLatch(0);
- sUnbindCounter = new CountDownLatch(0);
- sServiceRef.clear();
- }
-
- @Override
- public void onCreate() {
- super.onCreate();
- sServiceRef = new WeakReference<>(this);
- }
@Nullable
@Override
public IBinder onBind(@NonNull Intent intent) {
- sBindCounter.countDown();
sServiceRef = new WeakReference<>(this);
return super.onBind(intent);
}
@Override
public boolean onUnbind(Intent intent) {
- sUnbindCounter.countDown();
+ sServiceRef.clear();
return super.onUnbind(intent);
}
- @Override
- public void onWalletCardsRequested(
- GetWalletCardsRequest request,
- GetWalletCardsCallback callback) {
- Log.i(TAG, "onWalletCardsRequested");
- GetWalletCardsError error = sWalletCardsError;
- if (error != null) {
- callback.onFailure(error);
- return;
- }
- GetWalletCardsResponse response = sWalletCardsResponse;
- if (response == null) {
- Bitmap bitmap = Bitmap.createBitmap(
- request.getCardWidthPx(), request.getCardHeightPx(), Bitmap.Config.ARGB_8888);
- Icon cardImage = Icon.createWithBitmap(bitmap.copy(Bitmap.Config.HARDWARE, false));
- Intent intent = new Intent(this, QuickAccessWalletActivity.class);
- PendingIntent pendingIntent =
- PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE);
- WalletCard walletCard = new WalletCard.Builder("card1", cardImage, "Card 1",
- pendingIntent).build();
- List<WalletCard> walletCards = Collections.singletonList(walletCard);
- response = new GetWalletCardsResponse(walletCards, 0);
- }
- callback.onSuccess(response);
- }
-
- @Override
- public void onWalletCardSelected(SelectWalletCardRequest request) {
- Log.i(TAG, "onWalletCardSelected");
- sSelectWalletCardRequests.add(request);
- sRequestCountDownLatch.countDown();
- }
-
- @Override
- public void onWalletDismissed() {
- Log.i(TAG, "onWalletDismissed");
- sWalletDismissed = true;
- sRequestCountDownLatch.countDown();
- }
-
public static void sendEvent(WalletServiceEvent event) {
TestQuickAccessWalletService service = sServiceRef.get();
if (service != null) {
service.sendWalletServiceEvent(event);
}
}
-
- public static List<SelectWalletCardRequest> getSelectRequests() {
- return new ArrayList<>(sSelectWalletCardRequests);
- }
-
- public static void setWalletCardsResponse(GetWalletCardsResponse response) {
- sWalletCardsResponse = response;
- }
-
- public static void setWalletCardsError(GetWalletCardsError error) {
- sWalletCardsError = error;
- }
-
- public static boolean isWalletDismissed() {
- return sWalletDismissed;
- }
-
- public static void setExpectedRequestCount(int countdown) {
- sRequestCountDownLatch = new CountDownLatch(countdown);
- }
-
- public static void awaitRequests(long timeout, TimeUnit timeUnit) throws InterruptedException {
- sRequestCountDownLatch.await(timeout, timeUnit);
- }
-
- public static void setExpectedBindCount(int count) {
- sBindCounter = new CountDownLatch(count);
- }
-
- public static void awaitBinding(long timeout, TimeUnit unit) throws InterruptedException {
- sBindCounter.await(timeout, unit);
- }
-
- public static void setExpectedUnbindCount(int count) {
- sUnbindCounter = new CountDownLatch(count);
- }
-
- public static void awaitUnbinding(long timeout, TimeUnit unit) throws InterruptedException {
- sUnbindCounter.await(timeout, unit);
- }
}
diff --git a/tests/rollback/Android.bp b/tests/rollback/Android.bp
index 9c1f501..78b692f 100644
--- a/tests/rollback/Android.bp
+++ b/tests/rollback/Android.bp
@@ -19,7 +19,13 @@
android_test {
name: "CtsRollbackManagerTestCases",
srcs: ["src/**/*.java"],
- static_libs: ["androidx.test.rules", "cts-rollback-lib", "cts-install-lib"],
+ static_libs: [
+ "android.content.pm.flags-aconfig-java",
+ "androidx.test.rules",
+ "cts-rollback-lib",
+ "cts-install-lib",
+ "flag-junit",
+ ],
test_suites: [
"cts",
"general-tests",
diff --git a/tests/rollback/src/com/android/cts/rollback/RollbackManagerTest.java b/tests/rollback/src/com/android/cts/rollback/RollbackManagerTest.java
index 05c4ca7..e3ca9ea 100644
--- a/tests/rollback/src/com/android/cts/rollback/RollbackManagerTest.java
+++ b/tests/rollback/src/com/android/cts/rollback/RollbackManagerTest.java
@@ -25,9 +25,13 @@
import android.Manifest;
import android.content.Intent;
+import android.content.pm.Flags;
import android.content.pm.PackageManager;
import android.content.rollback.RollbackInfo;
import android.content.rollback.RollbackManager;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.provider.DeviceConfig;
import androidx.test.InstrumentationRegistry;
@@ -43,6 +47,7 @@
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -62,6 +67,10 @@
private static final String PROPERTY_ENABLE_ROLLBACK_TIMEOUT_MILLIS = "enable_rollback_timeout";
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule =
+ DeviceFlagsValueProvider.createCheckFlagsRule();
+
/**
* Adopts common permissions needed to test rollbacks and uninstalls the
* test apps.
@@ -629,6 +638,29 @@
}
/**
+ * Tests we fail to enable rollbacks if rollbackLifetime times out.
+ */
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_ROLLBACK_LIFETIME)
+ public void testEnableRollbackLifetimeTimeoutFailsRollback() throws Exception {
+
+ Install.single(TestApp.A1).commit();
+ RollbackUtils.waitForUnavailableRollback(TestApp.A);
+
+ RollbackManager rm = RollbackUtils.getRollbackManager();
+ rm.blockRollbackManager(TimeUnit.SECONDS.toMillis(1));
+ Install.single(TestApp.A2).setEnableRollback()
+ .setRollbackLifetimeMillis(100).commit();
+ assertThat(InstallUtils.getInstalledVersion(TestApp.A)).isEqualTo(2);
+
+ // Give plenty of time for RollbackManager to unblock and attempt
+ // to make the rollback available before asserting that the
+ // rollback was not made available.
+ Thread.sleep(TimeUnit.SECONDS.toMillis(2));
+ assertThat(RollbackUtils.getAvailableRollback(TestApp.A)).isNull();
+ }
+
+ /**
* Tests we fail to enable rollbacks if enable-rollback times out for any child session.
*/
@Test
@@ -694,6 +726,35 @@
}
/**
+ * Test the scheduling aspect of rollback expiration via setRollbackLifetimeMillis.
+ */
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_ROLLBACK_LIFETIME)
+ public void testRollbackExpiresAfterRollbackLifetime() throws Exception {
+ long expirationTimeA = TimeUnit.SECONDS.toMillis(4);
+ Install.single(TestApp.A1).commit();
+ Install.single(TestApp.A2).setEnableRollback()
+ .setRollbackLifetimeMillis(expirationTimeA).commit();
+ RollbackUtils.waitForAvailableRollback(TestApp.A);
+
+ long expirationTimeB = TimeUnit.SECONDS.toMillis(40);
+ Install.single(TestApp.B1).commit();
+ Install.single(TestApp.B2).setEnableRollback()
+ .setRollbackLifetimeMillis(expirationTimeB).commit();
+ RollbackUtils.waitForAvailableRollback(TestApp.B);
+
+ // Give it a little more time, but still not long enough to expire
+ Thread.sleep(expirationTimeA / 2);
+ assertThat(RollbackUtils.getAvailableRollback(TestApp.A)).isNotNull();
+ assertThat(RollbackUtils.getAvailableRollback(TestApp.B)).isNotNull();
+
+ // Check that the data has expired after the expiration time (with a buffer of 1 second)
+ Thread.sleep(expirationTimeA / 2 + TimeUnit.SECONDS.toMillis(1));
+ assertThat(RollbackUtils.getAvailableRollback(TestApp.A)).isNull();
+ assertThat(RollbackUtils.getAvailableRollback(TestApp.B)).isNotNull();
+ }
+
+ /**
* Test that available rollbacks should expire correctly when the property
* {@link RollbackManager#PROPERTY_ROLLBACK_LIFETIME_MILLIS} is changed
*/
@@ -719,6 +780,37 @@
}
/**
+ * Test that available rollbacks should expire correctly when set via
+ * setRollbackLifetimeMillis and not affected by device config value
+ */
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_ROLLBACK_LIFETIME)
+ public void testRollbackExpiresWhenLifetimeStays() throws Exception {
+ long expirationTime = TimeUnit.SECONDS.toMillis(5);
+ Install.single(TestApp.A1).commit();
+ Install.single(TestApp.A2).setEnableRollback()
+ .setRollbackLifetimeMillis(expirationTime).commit();
+ RollbackUtils.waitForAvailableRollback(TestApp.A);
+
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_ROLLBACK_BOOT,
+ RollbackManager.PROPERTY_ROLLBACK_LIFETIME_MILLIS,
+ Long.toString(0), false /* makeDefault*/);
+
+ try {
+ Thread.sleep(expirationTime / 2);
+ assertThat(RollbackUtils.getAvailableRollback(TestApp.A)).isNotNull();
+ // The rollback now should expire
+ Thread.sleep(expirationTime / 2 + TimeUnit.SECONDS.toMillis(1));
+ assertThat(RollbackUtils.getAvailableRollback(TestApp.A)).isNull();
+ } finally {
+ // Restore default config values
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_ROLLBACK_BOOT,
+ RollbackManager.PROPERTY_ROLLBACK_LIFETIME_MILLIS,
+ null, false /* makeDefault*/);
+ }
+ }
+
+ /**
* Test that changing time on device does not affect the duration of time that we keep
* rollback available
*/
@@ -754,4 +846,58 @@
null, false /* makeDefault*/);
}
}
+
+ /**
+ * Test that changing time on device does not affect the duration of time that we keep
+ * rollback available which is set by setRollbackLifetimeMillis
+ */
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_ROLLBACK_LIFETIME)
+ public void testTimeChangeDoesNotAffectLifetimeMillis() throws Exception {
+ long expirationTime = TimeUnit.SECONDS.toMillis(10);
+
+ Install.single(TestApp.A1).commit();
+ Install.single(TestApp.A2).setEnableRollback()
+ .setRollbackLifetimeMillis(expirationTime).commit();
+ RollbackUtils.waitForAvailableRollback(TestApp.A);
+ RollbackUtils.forwardTimeBy(expirationTime);
+
+ try {
+ // The rollback should be still available after forwarding time
+ assertThat(RollbackUtils.getAvailableRollback(TestApp.A)).isNotNull();
+ // The rollback shouldn't expire when half of the expiration time elapses
+ Thread.sleep(expirationTime / 2);
+ assertThat(RollbackUtils.getAvailableRollback(TestApp.A)).isNotNull();
+ // The rollback now should expire
+ Thread.sleep(expirationTime / 2 + TimeUnit.SECONDS.toMillis(1));
+ assertThat(RollbackUtils.getAvailableRollback(TestApp.A)).isNull();
+ } finally {
+ RollbackUtils.forwardTimeBy(-expirationTime);
+ }
+
+ }
+
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_RECOVERABILITY_DETECTION)
+ public void testImpactLevelInRollback() throws Exception {
+ Install.single(TestApp.A1).commit();
+ Install.single(TestApp.A2).setEnableRollback().setRollbackImpactLevel(1).commit();
+ RollbackUtils.waitForAvailableRollback(TestApp.A);
+ RollbackInfo rollback = RollbackUtils.getAvailableRollback(TestApp.A);
+
+ assertThat(rollback).isNotNull();
+ assertThat(rollback.getRollbackImpactLevel()).isEqualTo(1);
+ }
+
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_RECOVERABILITY_DETECTION)
+ public void testImpactLevelInRollbackDefault() throws Exception {
+ Install.single(TestApp.A1).commit();
+ Install.single(TestApp.A2).setEnableRollback().commit();
+ RollbackUtils.waitForAvailableRollback(TestApp.A);
+ RollbackInfo rollback = RollbackUtils.getAvailableRollback(TestApp.A);
+
+ assertThat(rollback).isNotNull();
+ assertThat(rollback.getRollbackImpactLevel()).isEqualTo(0);
+ }
}
diff --git a/tests/sample/Android.bp b/tests/sample/Android.bp
index bb4eaa2..9f045ae 100644
--- a/tests/sample/Android.bp
+++ b/tests/sample/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_partner_eng",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/sensor/Android.bp b/tests/sensor/Android.bp
index 58f341d..22251a7 100644
--- a/tests/sensor/Android.bp
+++ b/tests/sensor/Android.bp
@@ -16,6 +16,7 @@
// Reusable Sensor test classes and helpers
//
package {
+ default_team: "trendy_team_android_sensors",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/sensor/sensorratepermission/Android.bp b/tests/sensor/sensorratepermission/Android.bp
index d22b475..99c6317 100644
--- a/tests/sensor/sensorratepermission/Android.bp
+++ b/tests/sensor/sensorratepermission/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_sensors",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/sensor/sensorratepermission/DebuggableAPI31/Android.bp b/tests/sensor/sensorratepermission/DebuggableAPI31/Android.bp
index 9533b50..0e99c7e 100644
--- a/tests/sensor/sensorratepermission/DebuggableAPI31/Android.bp
+++ b/tests/sensor/sensorratepermission/DebuggableAPI31/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_sensors",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/sensor/sensorratepermission/DirectReportAPI30/Android.bp b/tests/sensor/sensorratepermission/DirectReportAPI30/Android.bp
index f9fbbac..960fef0 100644
--- a/tests/sensor/sensorratepermission/DirectReportAPI30/Android.bp
+++ b/tests/sensor/sensorratepermission/DirectReportAPI30/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_sensors",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/sensor/sensorratepermission/DirectReportAPI31/Android.bp b/tests/sensor/sensorratepermission/DirectReportAPI31/Android.bp
index 2c725e8..7660702 100644
--- a/tests/sensor/sensorratepermission/DirectReportAPI31/Android.bp
+++ b/tests/sensor/sensorratepermission/DirectReportAPI31/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_sensors",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/sensor/sensorratepermission/EventConnectionAPI30/Android.bp b/tests/sensor/sensorratepermission/EventConnectionAPI30/Android.bp
index f8f0d04..e2e3e07 100644
--- a/tests/sensor/sensorratepermission/EventConnectionAPI30/Android.bp
+++ b/tests/sensor/sensorratepermission/EventConnectionAPI30/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_sensors",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/sensor/sensorratepermission/EventConnectionAPI31/Android.bp b/tests/sensor/sensorratepermission/EventConnectionAPI31/Android.bp
index b8e3dcd..0147b16 100644
--- a/tests/sensor/sensorratepermission/EventConnectionAPI31/Android.bp
+++ b/tests/sensor/sensorratepermission/EventConnectionAPI31/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_sensors",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/sensor/sensorratepermission/ReturnedRateInfo/Android.bp b/tests/sensor/sensorratepermission/ReturnedRateInfo/Android.bp
index 5d0c039..a023f73 100644
--- a/tests/sensor/sensorratepermission/ReturnedRateInfo/Android.bp
+++ b/tests/sensor/sensorratepermission/ReturnedRateInfo/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_sensors",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/Android.bp b/tests/signature/api-check/Android.bp
index c95cf4a..be01ded 100644
--- a/tests/signature/api-check/Android.bp
+++ b/tests/signature/api-check/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -95,7 +96,7 @@
defaults: ["signature-api-check-defaults"],
java_resources: [
":platform-bootclasspath{hiddenapi-flags.csv}",
- ":cts-api-hiddenapi-filter-csv"
+ ":cts-api-hiddenapi-filter-csv",
],
jni_libs: [
"libcts_dexchecker",
@@ -107,6 +108,6 @@
filegroup {
name: "CtsHiddenApiBlocklistApiDynamicConfig",
srcs: [
- "CtsHiddenApiBlocklistApiDynamicConfig.dynamic",
+ "CtsHiddenApiBlocklistApiDynamicConfig.dynamic",
],
}
diff --git a/tests/signature/api-check/android-test-base-29-api/Android.bp b/tests/signature/api-check/android-test-base-29-api/Android.bp
index a4def69..b3b8a06 100644
--- a/tests/signature/api-check/android-test-base-29-api/Android.bp
+++ b/tests/signature/api-check/android-test-base-29-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_mainline_modularization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/android-test-base-current-api/Android.bp b/tests/signature/api-check/android-test-base-current-api/Android.bp
index 737dde0..68d5345 100644
--- a/tests/signature/api-check/android-test-base-current-api/Android.bp
+++ b/tests/signature/api-check/android-test-base-current-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_mainline_modularization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/android-test-base-uses-library-api/Android.bp b/tests/signature/api-check/android-test-base-uses-library-api/Android.bp
index 708d430..1ba42ae 100644
--- a/tests/signature/api-check/android-test-base-uses-library-api/Android.bp
+++ b/tests/signature/api-check/android-test-base-uses-library-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_mainline_modularization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/android-test-mock-current-api/Android.bp b/tests/signature/api-check/android-test-mock-current-api/Android.bp
index 63e6bf6..40f0eb5 100644
--- a/tests/signature/api-check/android-test-mock-current-api/Android.bp
+++ b/tests/signature/api-check/android-test-mock-current-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_mainline_modularization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/android-test-runner-current-api/Android.bp b/tests/signature/api-check/android-test-runner-current-api/Android.bp
index f6e3e63..0a4570e 100644
--- a/tests/signature/api-check/android-test-runner-current-api/Android.bp
+++ b/tests/signature/api-check/android-test-runner-current-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_mainline_modularization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/apache-http-legacy-27-api/Android.bp b/tests/signature/api-check/apache-http-legacy-27-api/Android.bp
index dab62ce..37bc240 100644
--- a/tests/signature/api-check/apache-http-legacy-27-api/Android.bp
+++ b/tests/signature/api-check/apache-http-legacy-27-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_mainline_modularization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/apache-http-legacy-current-api/Android.bp b/tests/signature/api-check/apache-http-legacy-current-api/Android.bp
index e47f82c..b92a1d1 100644
--- a/tests/signature/api-check/apache-http-legacy-current-api/Android.bp
+++ b/tests/signature/api-check/apache-http-legacy-current-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_mainline_modularization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/apache-http-legacy-uses-library-api/Android.bp b/tests/signature/api-check/apache-http-legacy-uses-library-api/Android.bp
index c02629ff..d866d3d 100644
--- a/tests/signature/api-check/apache-http-legacy-uses-library-api/Android.bp
+++ b/tests/signature/api-check/apache-http-legacy-uses-library-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_mainline_modularization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/current-api/Android.bp b/tests/signature/api-check/current-api/Android.bp
index 88bce59..e66deb3 100644
--- a/tests/signature/api-check/current-api/Android.bp
+++ b/tests/signature/api-check/current-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/hidden-api-blocklist-27-api/Android.bp b/tests/signature/api-check/hidden-api-blocklist-27-api/Android.bp
index 10912bb..4677c31 100644
--- a/tests/signature/api-check/hidden-api-blocklist-27-api/Android.bp
+++ b/tests/signature/api-check/hidden-api-blocklist-27-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/hidden-api-blocklist-28-api/Android.bp b/tests/signature/api-check/hidden-api-blocklist-28-api/Android.bp
index d65467c..c7c8af9 100644
--- a/tests/signature/api-check/hidden-api-blocklist-28-api/Android.bp
+++ b/tests/signature/api-check/hidden-api-blocklist-28-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/hidden-api-blocklist-current-api/Android.bp b/tests/signature/api-check/hidden-api-blocklist-current-api/Android.bp
index 6cf1a56..5c1bb37 100644
--- a/tests/signature/api-check/hidden-api-blocklist-current-api/Android.bp
+++ b/tests/signature/api-check/hidden-api-blocklist-current-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/hidden-api-blocklist-debug-class/Android.bp b/tests/signature/api-check/hidden-api-blocklist-debug-class/Android.bp
index ab4040a..0223122 100644
--- a/tests/signature/api-check/hidden-api-blocklist-debug-class/Android.bp
+++ b/tests/signature/api-check/hidden-api-blocklist-debug-class/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/hidden-api-blocklist-test-api/Android.bp b/tests/signature/api-check/hidden-api-blocklist-test-api/Android.bp
index ade111b..54061d9 100644
--- a/tests/signature/api-check/hidden-api-blocklist-test-api/Android.bp
+++ b/tests/signature/api-check/hidden-api-blocklist-test-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/hidden-api-killswitch-debug-class/Android.bp b/tests/signature/api-check/hidden-api-killswitch-debug-class/Android.bp
index d6a1c14..1c3552e 100644
--- a/tests/signature/api-check/hidden-api-killswitch-debug-class/Android.bp
+++ b/tests/signature/api-check/hidden-api-killswitch-debug-class/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/hidden-api-killswitch-sdklist/Android.bp b/tests/signature/api-check/hidden-api-killswitch-sdklist/Android.bp
index 333a3aa..5780341 100644
--- a/tests/signature/api-check/hidden-api-killswitch-sdklist/Android.bp
+++ b/tests/signature/api-check/hidden-api-killswitch-sdklist/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/hidden-api-killswitch-wildcard/Android.bp b/tests/signature/api-check/hidden-api-killswitch-wildcard/Android.bp
index 1be25d4..4d967d3 100644
--- a/tests/signature/api-check/hidden-api-killswitch-wildcard/Android.bp
+++ b/tests/signature/api-check/hidden-api-killswitch-wildcard/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/shared-libs-api/Android.bp b/tests/signature/api-check/shared-libs-api/Android.bp
index 6a53a75..0c9b32f 100644
--- a/tests/signature/api-check/shared-libs-api/Android.bp
+++ b/tests/signature/api-check/shared-libs-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_mainline_modularization",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/signature/api-check/src/java/android/signature/cts/api/HiddenApiTest.java b/tests/signature/api-check/src/java/android/signature/cts/api/HiddenApiTest.java
index 5fae541..dfd25b6 100644
--- a/tests/signature/api-check/src/java/android/signature/cts/api/HiddenApiTest.java
+++ b/tests/signature/api-check/src/java/android/signature/cts/api/HiddenApiTest.java
@@ -32,6 +32,7 @@
import java.util.Set;
import java.util.function.Predicate;
import org.junit.Test;
+import org.junit.Ignore;
/**
* Checks that it is not possible to access hidden APIs.
@@ -66,22 +67,29 @@
private final static Predicate<DexMember> FIELD_FILTER =
dexMember -> (dexMember instanceof DexField);
+ // All tests here are currently skipped. If any gets enabled, the timeout
+ // for the first test to run needs to be sufficiently large on it to allow
+ // for loadFilters() to complete.
@Test(timeout = 900000)
+ @Ignore("b/301075649")
public void testSignatureMethodsThroughReflection() {
doTestSignature(METHOD_FILTER,/* reflection= */ true, /* jni= */ false);
}
@Test
+ @Ignore("b/301075649")
public void testSignatureMethodsThroughJni() {
doTestSignature(METHOD_FILTER, /* reflection= */ false, /* jni= */ true);
}
@Test
+ @Ignore("b/301075649")
public void testSignatureFieldsThroughReflection() {
doTestSignature(FIELD_FILTER, /* reflection= */ true, /* jni= */ false);
}
@Test
+ @Ignore("b/301075649")
public void testSignatureFieldsThroughJni() {
doTestSignature(FIELD_FILTER, /* reflection= */ false, /* jni= */ true);
}
diff --git a/tests/signature/api-check/src/java/android/signature/cts/api/SignatureTest.java b/tests/signature/api-check/src/java/android/signature/cts/api/SignatureTest.java
index 4b7e402..e938f81 100644
--- a/tests/signature/api-check/src/java/android/signature/cts/api/SignatureTest.java
+++ b/tests/signature/api-check/src/java/android/signature/cts/api/SignatureTest.java
@@ -31,6 +31,7 @@
import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.junit.Test;
+import org.junit.Ignore;
/**
* Performs the signature check via a JUnit test.
@@ -90,6 +91,7 @@
* <p>Will check the entire API, and then report the complete list of failures</p>
*/
@Test(timeout = 600000)
+ @Ignore("b/301075649")
public void testRuntimeCompatibilityWithCurrentApi() {
runWithTestResultObserver(mResultObserver -> {
ApiComplianceChecker complianceChecker =
diff --git a/tests/signature/api-check/system-annotation/Android.bp b/tests/signature/api-check/system-annotation/Android.bp
index eb36adc..5044a8a 100644
--- a/tests/signature/api-check/system-annotation/Android.bp
+++ b/tests/signature/api-check/system-annotation/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -34,7 +35,10 @@
use_embedded_native_libs: false,
test_suites: [
- "cts",
+ // b/307877675 this test can no longer be correctly implemented with Trunk Stable.
+ // TODO: remove this completely. For now, we just remove it from cts with an hope
+ // that we may be able to fix this in the future.
+ // "cts",
"general-tests",
],
}
diff --git a/tests/signature/api-check/system-annotation/src/java/android/signature/cts/api/AnnotationTest.java b/tests/signature/api-check/system-annotation/src/java/android/signature/cts/api/AnnotationTest.java
index e6d5b06..71f8f64 100644
--- a/tests/signature/api-check/system-annotation/src/java/android/signature/cts/api/AnnotationTest.java
+++ b/tests/signature/api-check/system-annotation/src/java/android/signature/cts/api/AnnotationTest.java
@@ -32,6 +32,7 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.function.Predicate;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -65,6 +66,7 @@
* android.annotation.SystemApi) match the API definition.
*/
@Test
+ @Ignore("b/301075649")
public void testAnnotation() {
AnnotationChecker.ResultFilter filter = new AnnotationChecker.ResultFilter() {
@Override
diff --git a/tests/signature/api-check/system-api/Android.bp b/tests/signature/api-check/system-api/Android.bp
index 3ddba35..0ce7285 100644
--- a/tests/signature/api-check/system-api/Android.bp
+++ b/tests/signature/api-check/system-api/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/storageaccess/OWNERS b/tests/storageaccess/OWNERS
index cdda1bb..5dbc71b 100644
--- a/tests/storageaccess/OWNERS
+++ b/tests/storageaccess/OWNERS
@@ -2,7 +2,6 @@
# Bug component: 46626
# Primary.
-sergeynv@google.com
# Secondary.
tylersaunders@google.com
diff --git a/tests/surfacecontrol/Android.bp b/tests/surfacecontrol/Android.bp
index 4774d08..39c6676 100644
--- a/tests/surfacecontrol/Android.bp
+++ b/tests/surfacecontrol/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_windowing_infra_",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/surfacecontrol/jni/Android.bp b/tests/surfacecontrol/jni/Android.bp
index b31b7aa..3bf7dfb 100644
--- a/tests/surfacecontrol/jni/Android.bp
+++ b/tests/surfacecontrol/jni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_windowing_infra_",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/surfacecontrol/surfacevalidator/Android.bp b/tests/surfacecontrol/surfacevalidator/Android.bp
index 7dac2d9..229de26 100644
--- a/tests/surfacecontrol/surfacevalidator/Android.bp
+++ b/tests/surfacecontrol/surfacevalidator/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_windowing_infra_",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/surfacecontrol/surfacevalidator/src/android/view/cts/surfacevalidator/CapturedActivity.java b/tests/surfacecontrol/surfacevalidator/src/android/view/cts/surfacevalidator/CapturedActivity.java
index 89c3763..f0c0431 100644
--- a/tests/surfacecontrol/surfacevalidator/src/android/view/cts/surfacevalidator/CapturedActivity.java
+++ b/tests/surfacecontrol/surfacevalidator/src/android/view/cts/surfacevalidator/CapturedActivity.java
@@ -30,6 +30,8 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Insets;
import android.graphics.Point;
@@ -46,8 +48,12 @@
import android.provider.Settings;
import android.server.wm.settings.SettingsSession;
import android.support.test.uiautomator.By;
+import android.support.test.uiautomator.BySelector;
import android.support.test.uiautomator.UiDevice;
import android.support.test.uiautomator.UiObject2;
+import android.support.test.uiautomator.UiObjectNotFoundException;
+import android.support.test.uiautomator.UiScrollable;
+import android.support.test.uiautomator.UiSelector;
import android.support.test.uiautomator.Until;
import android.util.DisplayMetrics;
import android.util.Log;
@@ -105,6 +111,11 @@
private static final long WAIT_TIMEOUT_S = 5L * HW_TIMEOUT_MULTIPLIER;
private static final String ACCEPT_RESOURCE_ID = "android:id/button1";
+ private static final String SYSTEM_UI_PACKAGE = "com.android.systemui";
+ private static final String SPINNER_RESOURCE_ID =
+ SYSTEM_UI_PACKAGE + ":id/screen_share_mode_spinner";
+ private static final String ENTIRE_SCREEN_STRING_RES_NAME =
+ "screen_share_permission_dialog_option_entire_screen";
private final Handler mHandler = new Handler(Looper.getMainLooper());
private volatile boolean mOnEmbedded;
@@ -174,19 +185,84 @@
mLogicalDisplaySize.set(logicalDisplaySize.x, logicalDisplaySize.y);
}
+ /** The permission dialog will be auto-opened by the activity - find it and accept */
public boolean dismissPermissionDialog() {
- // The permission dialog will be auto-opened by the activity - find it and accept
- UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
- UiObject2 acceptButton = uiDevice.wait(Until.findObject(By.res(ACCEPT_RESOURCE_ID)),
- PERMISSION_DIALOG_WAIT_MS);
- if (acceptButton != null) {
- Log.d(TAG, "found permission dialog after searching all windows, clicked");
- acceptButton.click();
- return true;
- } else {
- Log.e(TAG, "Failed to find permission dialog");
+ // Ensure the device is initialized before interacting with any UI elements.
+ UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
+ final boolean isWatch = getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH);
+ if (!isWatch) {
+ // if not testing on a watch device, then we need to select the entire screen option
+ // before pressing "Start recording" button.
+ if (!selectEntireScreenOption()) {
+ Log.e(TAG, "Couldn't select entire screen option");
+ }
+ }
+ return pressStartRecording(isWatch);
+ }
+
+ private boolean selectEntireScreenOption() {
+ UiObject2 spinner = waitForObject(By.res(SPINNER_RESOURCE_ID));
+ if (spinner == null) {
+ Log.e(TAG, "Couldn't find spinner to select projection mode");
return false;
}
+ spinner.click();
+
+ UiObject2 entireScreenOption = waitForObject(By.text(getEntireScreenString()));
+ if (entireScreenOption == null) {
+ Log.e(TAG, "Couldn't find entire screen option");
+ return false;
+ }
+ entireScreenOption.click();
+ return true;
+ }
+
+ private String getEntireScreenString() {
+ Resources sysUiResources;
+ try {
+ sysUiResources = getPackageManager().getResourcesForApplication(SYSTEM_UI_PACKAGE);
+ } catch (NameNotFoundException e) {
+ return null;
+ }
+ int resourceId =
+ sysUiResources.getIdentifier(
+ ENTIRE_SCREEN_STRING_RES_NAME, /* defType= */ "string", SYSTEM_UI_PACKAGE);
+ return sysUiResources.getString(resourceId);
+ }
+
+ private boolean pressStartRecording(boolean isWatch) {
+ if (isWatch) {
+ scrollToStartRecordingButton();
+ }
+ UiObject2 startRecordingButton = waitForObject(By.res(ACCEPT_RESOURCE_ID));
+ if (startRecordingButton == null) {
+ Log.e(TAG, "Couldn't find start recording button");
+ return false;
+ } else {
+ Log.d(TAG, "found permission dialog after searching all windows, clicked");
+ startRecordingButton.click();
+ return true;
+ }
+ }
+
+ /** When testing on a small screen device, scrolls to a Start Recording button. */
+ private void scrollToStartRecordingButton() {
+ // Scroll down the dialog; on a device with a small screen the elements may not be visible.
+ final UiScrollable scrollable = new UiScrollable(new UiSelector().scrollable(true));
+ try {
+ if (!scrollable.scrollIntoView(new UiSelector().resourceId(ACCEPT_RESOURCE_ID))) {
+ Log.e(TAG, "Didn't find " + ACCEPT_RESOURCE_ID + " when scrolling");
+ return;
+ }
+ Log.d(TAG, "This is a watch; we finished scrolling down to the ui elements");
+ } catch (UiObjectNotFoundException e) {
+ Log.d(TAG, "This is a watch, but there was no scrolling (UI may not be scrollable");
+ }
+ }
+
+ private UiObject2 waitForObject(BySelector selector) {
+ UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
+ return uiDevice.wait(Until.findObject(selector), PERMISSION_DIALOG_WAIT_MS);
}
/**
diff --git a/tests/suspendapps/permission/Android.bp b/tests/suspendapps/permission/Android.bp
index a68f68c..aa4f0a6 100644
--- a/tests/suspendapps/permission/Android.bp
+++ b/tests/suspendapps/permission/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/suspendapps/test-apps/SuspendTestApp/Android.bp b/tests/suspendapps/test-apps/SuspendTestApp/Android.bp
index 376c4c8..7efef0bd 100644
--- a/tests/suspendapps/test-apps/SuspendTestApp/Android.bp
+++ b/tests/suspendapps/test-apps/SuspendTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/suspendapps/test-apps/TestDeviceAdmin/Android.bp b/tests/suspendapps/test-apps/TestDeviceAdmin/Android.bp
index 8af8053..74b692c 100644
--- a/tests/suspendapps/test-apps/TestDeviceAdmin/Android.bp
+++ b/tests/suspendapps/test-apps/TestDeviceAdmin/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/suspendapps/tests/Android.bp b/tests/suspendapps/tests/Android.bp
index a4510ae..bacff92 100644
--- a/tests/suspendapps/tests/Android.bp
+++ b/tests/suspendapps/tests/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/accounts/common/Android.bp b/tests/tests/accounts/common/Android.bp
index 16400f5..4e36956 100644
--- a/tests/tests/accounts/common/Android.bp
+++ b/tests/tests/accounts/common/Android.bp
@@ -28,4 +28,7 @@
},
min_sdk_version: "1",
sdk_version: "current",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
}
diff --git a/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java b/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java
index 47bda38..82437be 100644
--- a/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java
+++ b/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java
@@ -38,7 +38,6 @@
import android.test.ActivityInstrumentationTestCase2;
import java.io.IOException;
-import java.lang.Math;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -324,7 +323,7 @@
callback,
handler);
- Bundle resultBundle = futureBundle.getResult();
+ Bundle resultBundle = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
assertNotNull(resultBundle);
@@ -335,7 +334,7 @@
throws OperationCanceledException, AuthenticatorException, IOException {
AccountManagerFuture<Account> futureAccount = am.renameAccount(
account, newName, null /* callback */, null /* handler */);
- Account renamedAccount = futureAccount.getResult();
+ Account renamedAccount = futureAccount.getResult(30, TimeUnit.SECONDS);
assertTrue(futureAccount.isDone());
assertNotNull(renamedAccount);
return renamedAccount;
@@ -347,7 +346,7 @@
AccountManagerFuture<Boolean> futureBoolean = am.removeAccount(account,
callback,
null /* handler */);
- Boolean resultBoolean = futureBoolean.getResult();
+ Boolean resultBoolean = futureBoolean.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBoolean.isDone());
return resultBoolean;
@@ -361,7 +360,7 @@
activity,
callback,
null /* handler */);
- Bundle resultBundle = futureBundle.getResult();
+ Bundle resultBundle = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
return resultBundle;
@@ -375,7 +374,7 @@
activity,
callback,
null /* handler */);
- Bundle resultBundle = futureBundle.getResult();
+ Bundle resultBundle = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
return resultBundle;
@@ -402,7 +401,7 @@
null /* no handler */
);
- Bundle resultBundle = futureBundle.getResult();
+ Bundle resultBundle = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
assertNotNull(resultBundle);
@@ -506,7 +505,7 @@
null,
null);
- futureBundle.getResult();
+ futureBundle.getResult(30, TimeUnit.SECONDS);
fail();
} catch (AuthenticatorException expectedException) {
return;
@@ -523,7 +522,7 @@
public void run(AccountManagerFuture<Bundle> bundleFuture) {
Bundle resultBundle = null;
try {
- resultBundle = bundleFuture.getResult();
+ resultBundle = bundleFuture.getResult(30, TimeUnit.SECONDS);
} catch (OperationCanceledException e) {
fail("should not throw an OperationCanceledException");
} catch (IOException e) {
@@ -1043,7 +1042,7 @@
AccountManagerFuture<Account[]> futureAccounts = am.getAccountsByTypeAndFeatures(
ACCOUNT_TYPE, REQUIRED_FEATURES, null, null);
- Account[] accounts = futureAccounts.getResult();
+ Account[] accounts = futureAccounts.getResult(30, TimeUnit.SECONDS);
assertNotNull(accounts);
assertEquals(1, accounts.length);
@@ -1053,7 +1052,7 @@
new String[] { NON_EXISTING_FEATURE },
null /* callback*/,
null /* handler */);
- accounts = futureAccounts.getResult();
+ accounts = futureAccounts.getResult(30, TimeUnit.SECONDS);
assertNotNull(accounts);
assertEquals(0, accounts.length);
@@ -1080,7 +1079,7 @@
@Override
public void run(AccountManagerFuture<Account[]> accountsFuture) {
try {
- Account[] accounts = accountsFuture.getResult();
+ Account[] accounts = accountsFuture.getResult(30, TimeUnit.SECONDS);
assertNotNull(accounts);
assertEquals(1, accounts.length);
assertEquals(true, isAccountPresent(accounts, ACCOUNT));
@@ -1102,7 +1101,7 @@
callback1,
handler);
- Account[] accounts = futureAccounts.getResult();
+ Account[] accounts = futureAccounts.getResult(30, TimeUnit.SECONDS);
assertNotNull(accounts);
assertEquals(1, accounts.length);
@@ -1121,7 +1120,7 @@
@Override
public void run(AccountManagerFuture<Account[]> accountsFuture) {
try {
- Account[] accounts = accountsFuture.getResult();
+ Account[] accounts = accountsFuture.getResult(30, TimeUnit.SECONDS);
assertNotNull(accounts);
assertEquals(0, accounts.length);
} catch (OperationCanceledException e) {
@@ -1143,7 +1142,7 @@
callback2,
handler);
- accounts = futureAccounts.getResult();
+ accounts = futureAccounts.getResult(30, TimeUnit.SECONDS);
assertNotNull(accounts);
assertEquals(0, accounts.length);
@@ -1248,7 +1247,7 @@
null /* no handler */
);
- Bundle resultBundle = futureBundle.getResult();
+ Bundle resultBundle = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
assertNotNull(resultBundle);
@@ -1276,7 +1275,7 @@
null /* no callback */,
null /* no handler */
);
- Bundle actual = futureBundle.getResult();
+ Bundle actual = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
assertNotNull(actual);
return actual;
@@ -1307,7 +1306,7 @@
null /* no handler */
);
- Bundle resultBundle = futureBundle.getResult();
+ Bundle resultBundle = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
assertNotNull(resultBundle);
@@ -1341,7 +1340,7 @@
null /* no callback */,
null /* no handler */
);
- Bundle actual = futureBundle.getResult();
+ Bundle actual = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
assertNotNull(actual);
return actual;
@@ -1378,7 +1377,7 @@
public void run(AccountManagerFuture<Bundle> bundleFuture) {
Bundle resultBundle = null;
try {
- resultBundle = bundleFuture.getResult();
+ resultBundle = bundleFuture.getResult(30, TimeUnit.SECONDS);
actualRef.set(resultBundle);
} catch (OperationCanceledException e) {
fail("should not throw an OperationCanceledException");
@@ -1438,7 +1437,7 @@
public void run(AccountManagerFuture<Bundle> bundleFuture) {
Bundle resultBundle = null;
try {
- resultBundle = bundleFuture.getResult();
+ resultBundle = bundleFuture.getResult(30, TimeUnit.SECONDS);
actualRef.set(resultBundle);
} catch (OperationCanceledException e) {
fail("should not throw an OperationCanceledException");
@@ -1500,7 +1499,7 @@
Bundle resultBundle = null;
try {
- resultBundle = bundleFuture.getResult();
+ resultBundle = bundleFuture.getResult(30, TimeUnit.SECONDS);
// Assert returned result
validateAccountAndAuthTokenResult(resultBundle);
@@ -1525,7 +1524,7 @@
handler
);
- Bundle resultBundle = futureBundle.getResult();
+ Bundle resultBundle = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
assertNotNull(resultBundle);
@@ -1561,7 +1560,7 @@
Bundle resultBundle = null;
try {
- resultBundle = bundleFuture.getResult();
+ resultBundle = bundleFuture.getResult(30, TimeUnit.SECONDS);
// Assert returned result
validateAccountAndAuthTokenResult(resultBundle);
} catch (OperationCanceledException e) {
@@ -1585,7 +1584,7 @@
handler
);
- Bundle resultBundle = futureBundle.getResult();
+ Bundle resultBundle = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
assertNotNull(resultBundle);
@@ -1683,7 +1682,7 @@
null /* callback*/,
null /* handler */);
- futureBundle.getResult();
+ futureBundle.getResult(30, TimeUnit.SECONDS);
// Assert returned result
validateCredentials();
@@ -1714,7 +1713,7 @@
null /* callback */,
null /* handler */);
- futureBundle.getResult();
+ futureBundle.getResult(30, TimeUnit.SECONDS);
}
/**
@@ -1735,7 +1734,7 @@
OPTIONS_BUNDLE, /* options */
null, /* activity */
null /* callback */,
- null /* handler */).getResult();
+ null /* handler */).getResult(30, TimeUnit.SECONDS);
long confirmedCredTime = result.getLong(
AccountManager.KEY_LAST_AUTHENTICATED_TIME, -1);
assertTrue(confirmedCredTime > accountAddTime);
@@ -1758,7 +1757,7 @@
OPTIONS_BUNDLE,
mActivity,
null /* callback */,
- null /* handler */).getResult();
+ null /* handler */).getResult(30, TimeUnit.SECONDS);
long updateCredTime = getLastAuthenticatedTime(ACCOUNT);
assertTrue(updateCredTime > accountAddTime);
}
@@ -1794,7 +1793,7 @@
Bundle resultBundle = null;
try {
- resultBundle = bundleFuture.getResult();
+ resultBundle = bundleFuture.getResult(30, TimeUnit.SECONDS);
// Assert returned result
validateCredentials();
@@ -1840,7 +1839,7 @@
null /* callback*/,
null /* handler */);
- Bundle result = futureBundle.getResult();
+ Bundle result = futureBundle.getResult(30, TimeUnit.SECONDS);
validateAccountAndNoAuthTokenResult(result);
@@ -1871,7 +1870,7 @@
Bundle resultBundle = null;
try {
- resultBundle = bundleFuture.getResult();
+ resultBundle = bundleFuture.getResult(30, TimeUnit.SECONDS);
// Assert returned result
validateCredentials();
@@ -1897,7 +1896,7 @@
callback,
handler);
- futureBundle.getResult();
+ futureBundle.getResult(30, TimeUnit.SECONDS);
// Wait with timeout for the callback to do its work
try {
@@ -1918,7 +1917,7 @@
null /* callback */,
null /* handler*/);
- Bundle result = futureBundle.getResult();
+ Bundle result = futureBundle.getResult(30, TimeUnit.SECONDS);
validateAccountAndNoAuthTokenResult(result);
@@ -2024,6 +2023,9 @@
public void testAddOnAccountsUpdatedListenerWithVisibility() throws IOException,
AuthenticatorException, OperationCanceledException {
+ // Cleanup account in case it was left over from different test case.
+ assertTrue(removeAccountExplicitly(am, ACCOUNT));
+
testAddOnAccountsUpdatedListenerWithVisibility(null /* handler */,
false /* updateImmediately */, new String[] {ACCOUNT_TYPE, ACCOUNT_TYPE_ABSENT});
@@ -2144,37 +2146,37 @@
new String[]{FEATURE_1},
null /* callback */,
handler);
- assertTrue(booleanFuture.getResult());
+ assertTrue(booleanFuture.getResult(30, TimeUnit.SECONDS));
booleanFuture = am.hasFeatures(ACCOUNT,
new String[]{FEATURE_2},
null /* callback */,
handler);
- assertTrue(booleanFuture.getResult());
+ assertTrue(booleanFuture.getResult(30, TimeUnit.SECONDS));
booleanFuture = am.hasFeatures(ACCOUNT,
new String[]{FEATURE_1, FEATURE_2},
null /* callback */,
handler);
- assertTrue(booleanFuture.getResult());
+ assertTrue(booleanFuture.getResult(30, TimeUnit.SECONDS));
booleanFuture = am.hasFeatures(ACCOUNT,
new String[]{NON_EXISTING_FEATURE},
null /* callback */,
handler);
- assertFalse(booleanFuture.getResult());
+ assertFalse(booleanFuture.getResult(30, TimeUnit.SECONDS));
booleanFuture = am.hasFeatures(ACCOUNT,
new String[]{NON_EXISTING_FEATURE, FEATURE_1},
null /* callback */,
handler);
- assertFalse(booleanFuture.getResult());
+ assertFalse(booleanFuture.getResult(30, TimeUnit.SECONDS));
booleanFuture = am.hasFeatures(ACCOUNT,
new String[]{NON_EXISTING_FEATURE, FEATURE_1, FEATURE_2},
null /* callback */,
handler);
- assertFalse(booleanFuture.getResult());
+ assertFalse(booleanFuture.getResult(30, TimeUnit.SECONDS));
}
private AccountManagerCallback<Boolean> getAssertTrueCallback(final CountDownLatch latch) {
@@ -2183,7 +2185,7 @@
public void run(AccountManagerFuture<Boolean> booleanFuture) {
try {
// Assert returned result should be TRUE
- assertTrue(booleanFuture.getResult());
+ assertTrue(booleanFuture.getResult(30, TimeUnit.SECONDS));
} catch (Exception e) {
fail("Exception: " + e);
} finally {
@@ -2199,7 +2201,7 @@
public void run(AccountManagerFuture<Boolean> booleanFuture) {
try {
// Assert returned result should be FALSE
- assertFalse(booleanFuture.getResult());
+ assertFalse(booleanFuture.getResult(30, TimeUnit.SECONDS));
} catch (Exception e) {
fail("Exception: " + e);
} finally {
@@ -2285,7 +2287,7 @@
options,// OPTIONS_BUNDLE,
null, /* activity */
null /* callback */,
- null /* handler */).getResult();
+ null /* handler */).getResult(30, TimeUnit.SECONDS);
return result.getLong(
AccountManager.KEY_LAST_AUTHENTICATED_TIME, -1);
}
@@ -2725,7 +2727,7 @@
@Override
public void run(AccountManagerFuture<Bundle> bundleFuture) {
try {
- bundleFuture.getResult();
+ bundleFuture.getResult(30, TimeUnit.SECONDS);
fail("should have thrown an AuthenticatorException");
} catch (OperationCanceledException e) {
fail("should not throw an OperationCanceledException");
@@ -3122,7 +3124,7 @@
@Override
public void run(AccountManagerFuture<Bundle> bundleFuture) {
try {
- bundleFuture.getResult();
+ bundleFuture.getResult(30, TimeUnit.SECONDS);
fail("should have thrown an AuthenticatorException");
} catch (OperationCanceledException e) {
fail("should not throw an OperationCanceledException");
@@ -3169,7 +3171,7 @@
callback,
handler);
- Bundle resultBundle = futureBundle.getResult();
+ Bundle resultBundle = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
assertNotNull(resultBundle);
@@ -3195,7 +3197,7 @@
callback,
handler);
- Bundle resultBundle = futureBundle.getResult();
+ Bundle resultBundle = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
assertNotNull(resultBundle);
@@ -3289,7 +3291,7 @@
private Bundle getResultExpectNoException(AccountManagerFuture<Bundle> bundleFuture) {
try {
- return bundleFuture.getResult();
+ return bundleFuture.getResult(30, TimeUnit.SECONDS);
} catch (OperationCanceledException e) {
fail("should not throw an OperationCanceledException");
} catch (IOException e) {
@@ -4074,7 +4076,7 @@
@Override
public void run(AccountManagerFuture<Bundle> bundleFuture) {
try {
- bundleFuture.getResult();
+ bundleFuture.getResult(30, TimeUnit.SECONDS);
fail("should have thrown an AuthenticatorException");
} catch (OperationCanceledException e) {
fail("should not throw an OperationCanceledException");
@@ -4108,7 +4110,7 @@
callback,
handler);
- Bundle resultBundle = futureBundle.getResult();
+ Bundle resultBundle = futureBundle.getResult(30, TimeUnit.SECONDS);
assertTrue(futureBundle.isDone());
assertNotNull(resultBundle);
@@ -4250,7 +4252,7 @@
public void run(AccountManagerFuture<Boolean> booleanFuture) {
Boolean result = false;
try {
- result = booleanFuture.getResult();
+ result = booleanFuture.getResult(30, TimeUnit.SECONDS);
} catch (OperationCanceledException e) {
fail("should not throw an OperationCanceledException");
} catch (IOException e) {
@@ -4291,7 +4293,7 @@
@Override
public void run(AccountManagerFuture<Boolean> booleanFuture) {
try {
- booleanFuture.getResult();
+ booleanFuture.getResult(30, TimeUnit.SECONDS);
// AuthenticatorException should be thrown when authenticator
// returns AccountManager.ERROR_CODE_INVALID_RESPONSE.
fail("should have thrown an AuthenticatorException");
@@ -4334,7 +4336,7 @@
Boolean result = false;
if (callback == null) {
- result = booleanFuture.getResult();
+ result = booleanFuture.getResult(30, TimeUnit.SECONDS);
assertTrue(booleanFuture.isDone());
}
diff --git a/tests/tests/accounts/src/android/accounts/cts/AccountManagerUnaffiliatedAuthenticatorTests.java b/tests/tests/accounts/src/android/accounts/cts/AccountManagerUnaffiliatedAuthenticatorTests.java
index a11de75..1779f9c 100644
--- a/tests/tests/accounts/src/android/accounts/cts/AccountManagerUnaffiliatedAuthenticatorTests.java
+++ b/tests/tests/accounts/src/android/accounts/cts/AccountManagerUnaffiliatedAuthenticatorTests.java
@@ -23,8 +23,6 @@
import android.accounts.OperationCanceledException;
import android.accounts.cts.common.AuthenticatorContentProvider;
import android.accounts.cts.common.Fixtures;
-import android.accounts.cts.common.tx.StartAddAccountSessionTx;
-import android.accounts.cts.common.tx.StartUpdateCredentialsSessionTx;
import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.os.Bundle;
@@ -295,8 +293,6 @@
assertTrue(future.isDone());
assertNotNull(result);
- validateStartAddAccountSessionParameters(options);
-
// Validate that auth token was stripped from result.
assertNull(result.get(AccountManager.KEY_AUTHTOKEN));
@@ -331,9 +327,6 @@
Bundle result = future.getResult();
assertTrue(future.isDone());
assertNotNull(result);
-
- validateStartUpdateCredentialsSessionParameters(options);
-
// Validate no auth token in result.
assertNull(result.get(AccountManager.KEY_AUTHTOKEN));
@@ -461,29 +454,6 @@
}
}
- private void validateStartAddAccountSessionParameters(Bundle inOpt)
- throws RemoteException {
- Bundle params = mProviderClient.call(AuthenticatorContentProvider.METHOD_GET, null, null);
- params.setClassLoader(StartAddAccountSessionTx.class.getClassLoader());
- StartAddAccountSessionTx tx = params.<StartAddAccountSessionTx>getParcelable(
- AuthenticatorContentProvider.KEY_TX);
- assertEquals(tx.accountType, Fixtures.TYPE_STANDARD_UNAFFILIATED);
- assertEquals(tx.options.getString(Fixtures.KEY_ACCOUNT_NAME),
- inOpt.getString(Fixtures.KEY_ACCOUNT_NAME));
- }
-
- private void validateStartUpdateCredentialsSessionParameters(Bundle inOpt)
- throws RemoteException {
- Bundle params = mProviderClient.call(AuthenticatorContentProvider.METHOD_GET, null, null);
- params.setClassLoader(StartUpdateCredentialsSessionTx.class.getClassLoader());
- StartUpdateCredentialsSessionTx tx =
- params.<StartUpdateCredentialsSessionTx>getParcelable(
- AuthenticatorContentProvider.KEY_TX);
- assertEquals(tx.account, Fixtures.ACCOUNT_UNAFFILIATED_FIXTURE_SUCCESS);
- assertEquals(tx.options.getString(Fixtures.KEY_ACCOUNT_NAME),
- inOpt.getString(Fixtures.KEY_ACCOUNT_NAME));
- }
-
private Bundle createOptionsWithAccountName(final String accountName) {
Bundle options = new Bundle();
options.putString(Fixtures.KEY_ACCOUNT_NAME, accountName);
diff --git a/tests/tests/accounts/src/android/accounts/cts/MockAccountAuthenticator.java b/tests/tests/accounts/src/android/accounts/cts/MockAccountAuthenticator.java
index 68bd5cd..1a0f791 100644
--- a/tests/tests/accounts/src/android/accounts/cts/MockAccountAuthenticator.java
+++ b/tests/tests/accounts/src/android/accounts/cts/MockAccountAuthenticator.java
@@ -160,6 +160,7 @@
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType,
String authTokenType, String[] requiredFeatures, Bundle options)
throws NetworkErrorException {
+ Log.i(TAG, "MockAuth - addAccount");
this.mResponse = response;
this.mAccountType = accountType;
this.mAuthTokenType = authTokenType;
@@ -225,7 +226,7 @@
Account account,
String authTokenType,
Bundle options) throws NetworkErrorException {
- Log.w(TAG, "MockAuth - getAuthToken@" + System.currentTimeMillis());
+ Log.i(TAG, "MockAuth - getAuthToken@" + System.currentTimeMillis());
mIsRecentlyCalled.set(true);
this.mResponse = response;
this.mAccount = account;
@@ -266,7 +267,7 @@
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account,
String[] features) throws NetworkErrorException {
-
+ Log.i(TAG, "MockAuth - hasFeatures");
this.mResponse = response;
this.mAccount = account;
this.mFeatures = features;
@@ -291,6 +292,7 @@
@Override
public Bundle getAccountRemovalAllowed(AccountAuthenticatorResponse response,
Account account) throws NetworkErrorException {
+ Log.i(TAG, "MockAuth - getAccountRemovalAllowed");
final Bundle result = new Bundle();
if (ACCOUNT_NAME_FOR_NEW_REMOVE_API.equals(account.name)) {
Intent intent = AccountRemovalDummyActivity.createIntent(mContext);
@@ -390,6 +392,7 @@
Account account,
String authTokenType,
Bundle options) throws NetworkErrorException {
+ Log.i(TAG, "MockAuth - startUpdateCredentialsSession");
mResponse = response;
mAccount = account;
mAuthTokenType = authTokenType;
diff --git a/tests/tests/activityrecognition/Android.bp b/tests/tests/activityrecognition/Android.bp
index e81d9ae..04953fe 100644
--- a/tests/tests/activityrecognition/Android.bp
+++ b/tests/tests/activityrecognition/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/apache-http/Android.bp b/tests/tests/apache-http/Android.bp
index 4f75917..ba4d752 100644
--- a/tests/tests/apache-http/Android.bp
+++ b/tests/tests/apache-http/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/app/OWNERS b/tests/tests/app/OWNERS
index 5bcaa2b..a38386b 100644
--- a/tests/tests/app/OWNERS
+++ b/tests/tests/app/OWNERS
@@ -9,3 +9,4 @@
per-file AndroidManifest.xml = mpgroover@google.com
per-file AndroidTest.xml = mpgroover@google.com
per-file ShareIdentityTest.java = mpgroover@google.com
+per-file ComponentCallerTest.java = mpgroover@google.com,azharaa@google.com
diff --git a/tests/tests/app/test-apps/TestShareIdentityApp/Android.bp b/tests/tests/app/test-apps/TestShareIdentityApp/Android.bp
index 90dc3bd..7aeb992 100644
--- a/tests/tests/app/test-apps/TestShareIdentityApp/Android.bp
+++ b/tests/tests/app/test-apps/TestShareIdentityApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/appenumeration/Android.bp b/tests/tests/appenumeration/Android.bp
index ce1fec4..1569c90 100644
--- a/tests/tests/appenumeration/Android.bp
+++ b/tests/tests/appenumeration/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/appenumeration/OWNERS b/tests/tests/appenumeration/OWNERS
index 572f16f..a2f84ba 100644
--- a/tests/tests/appenumeration/OWNERS
+++ b/tests/tests/appenumeration/OWNERS
@@ -1,5 +1,5 @@
# Bug component: 36137
include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
-chiuwinson@google.com
zyy@google.com
diff --git a/tests/tests/appenumeration/app/source/Android.bp b/tests/tests/appenumeration/app/source/Android.bp
index 2f88d57..5cc20af 100644
--- a/tests/tests/appenumeration/app/source/Android.bp
+++ b/tests/tests/appenumeration/app/source/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/appenumeration/app/target/Android.bp b/tests/tests/appenumeration/app/target/Android.bp
index 0912cbe..21c7a11 100644
--- a/tests/tests/appenumeration/app/target/Android.bp
+++ b/tests/tests/appenumeration/app/target/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/appenumeration/lib/Android.bp b/tests/tests/appenumeration/lib/Android.bp
index 841f404..93d61c2 100644
--- a/tests/tests/appenumeration/lib/Android.bp
+++ b/tests/tests/appenumeration/lib/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/appop/Android.bp b/tests/tests/appop/Android.bp
index 0a37a18..6330e28 100644
--- a/tests/tests/appop/Android.bp
+++ b/tests/tests/appop/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/appop/AppForDiscreteTest/Android.bp b/tests/tests/appop/AppForDiscreteTest/Android.bp
index 4ed88d4..23cd766 100644
--- a/tests/tests/appop/AppForDiscreteTest/Android.bp
+++ b/tests/tests/appop/AppForDiscreteTest/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -29,5 +30,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppInBackground/Android.bp b/tests/tests/appop/AppInBackground/Android.bp
index be4e36f..85569a8 100644
--- a/tests/tests/appop/AppInBackground/Android.bp
+++ b/tests/tests/appop/AppInBackground/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,5 +24,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppThatCanBeForcedIntoForegroundStates/Android.bp b/tests/tests/appop/AppThatCanBeForcedIntoForegroundStates/Android.bp
index 67a147b..aca7861 100644
--- a/tests/tests/appop/AppThatCanBeForcedIntoForegroundStates/Android.bp
+++ b/tests/tests/appop/AppThatCanBeForcedIntoForegroundStates/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -29,5 +30,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppThatUsesAppOps/Android.bp b/tests/tests/appop/AppThatUsesAppOps/Android.bp
index 6fe4cd9..bdc2dd3 100644
--- a/tests/tests/appop/AppThatUsesAppOps/Android.bp
+++ b/tests/tests/appop/AppThatUsesAppOps/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/appop/AppToBlame1/Android.bp b/tests/tests/appop/AppToBlame1/Android.bp
index 324871a..13973b1 100644
--- a/tests/tests/appop/AppToBlame1/Android.bp
+++ b/tests/tests/appop/AppToBlame1/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,5 +24,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppToBlame2/Android.bp b/tests/tests/appop/AppToBlame2/Android.bp
index 8ab5d12..862ce40 100644
--- a/tests/tests/appop/AppToBlame2/Android.bp
+++ b/tests/tests/appop/AppToBlame2/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,5 +24,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppToCollect/Android.bp b/tests/tests/appop/AppToCollect/Android.bp
index 15e6ec7..1ebca28 100644
--- a/tests/tests/appop/AppToCollect/Android.bp
+++ b/tests/tests/appop/AppToCollect/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,5 +24,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppWithAttributionInheritingFromExisting/Android.bp b/tests/tests/appop/AppWithAttributionInheritingFromExisting/Android.bp
index cfe96db..437123c 100644
--- a/tests/tests/appop/AppWithAttributionInheritingFromExisting/Android.bp
+++ b/tests/tests/appop/AppWithAttributionInheritingFromExisting/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,5 +24,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppWithAttributionInheritingFromSameAsOther/Android.bp b/tests/tests/appop/AppWithAttributionInheritingFromSameAsOther/Android.bp
index dc51700..63b300c 100644
--- a/tests/tests/appop/AppWithAttributionInheritingFromSameAsOther/Android.bp
+++ b/tests/tests/appop/AppWithAttributionInheritingFromSameAsOther/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,5 +24,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppWithAttributionInheritingFromSelf/Android.bp b/tests/tests/appop/AppWithAttributionInheritingFromSelf/Android.bp
index 640ea8f..9f52ebf 100644
--- a/tests/tests/appop/AppWithAttributionInheritingFromSelf/Android.bp
+++ b/tests/tests/appop/AppWithAttributionInheritingFromSelf/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,5 +24,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppWithDuplicateAttribution/Android.bp b/tests/tests/appop/AppWithDuplicateAttribution/Android.bp
index 71c5564..da96f18 100644
--- a/tests/tests/appop/AppWithDuplicateAttribution/Android.bp
+++ b/tests/tests/appop/AppWithDuplicateAttribution/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,5 +24,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppWithLongAttributionTag/Android.bp b/tests/tests/appop/AppWithLongAttributionTag/Android.bp
index 29748ee..d66ed31 100644
--- a/tests/tests/appop/AppWithLongAttributionTag/Android.bp
+++ b/tests/tests/appop/AppWithLongAttributionTag/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,5 +24,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppWithReceiverAttribution/Android.bp b/tests/tests/appop/AppWithReceiverAttribution/Android.bp
index 3aa5569..20046ec 100644
--- a/tests/tests/appop/AppWithReceiverAttribution/Android.bp
+++ b/tests/tests/appop/AppWithReceiverAttribution/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -25,5 +26,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/AppWithTooManyAttributions/Android.bp b/tests/tests/appop/AppWithTooManyAttributions/Android.bp
index c495251..3649088 100644
--- a/tests/tests/appop/AppWithTooManyAttributions/Android.bp
+++ b/tests/tests/appop/AppWithTooManyAttributions/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,5 +24,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/appop/aidl/AppOpsForegroundControlService/Android.bp b/tests/tests/appop/aidl/AppOpsForegroundControlService/Android.bp
index b077110..58c451f 100644
--- a/tests/tests/appop/aidl/AppOpsForegroundControlService/Android.bp
+++ b/tests/tests/appop/aidl/AppOpsForegroundControlService/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -20,6 +21,6 @@
name: "AppOpsForegroundControlServiceAidl",
srcs: [
- "src/**/*.aidl"
+ "src/**/*.aidl",
],
}
diff --git a/tests/tests/appop/aidl/AppOpsUserService/Android.bp b/tests/tests/appop/aidl/AppOpsUserService/Android.bp
index 85563a1..645c99e 100644
--- a/tests/tests/appop/aidl/AppOpsUserService/Android.bp
+++ b/tests/tests/appop/aidl/AppOpsUserService/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -23,20 +24,20 @@
local_include_dir: "src",
srcs: [
- "src/**/*.aidl"
+ "src/**/*.aidl",
],
backend: {
java: {
sdk_version: "current",
- }
- }
+ },
+ },
}
java_library {
name: "AppOpsUserServiceAidl",
srcs: [
- "src/**/*.aidl"
+ "src/**/*.aidl",
],
}
diff --git a/tests/tests/appop/appopsTestUtilLib/Android.bp b/tests/tests/appop/appopsTestUtilLib/Android.bp
index bc95a5b..be5463c 100644
--- a/tests/tests/appop/appopsTestUtilLib/Android.bp
+++ b/tests/tests/appop/appopsTestUtilLib/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/appop2/Android.bp b/tests/tests/appop2/Android.bp
index 3a3512f..b8a40ec 100644
--- a/tests/tests/appop2/Android.bp
+++ b/tests/tests/appop2/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/appop2/OWNERS b/tests/tests/appop2/OWNERS
index 3753dee..b4b2b9e 100644
--- a/tests/tests/appop2/OWNERS
+++ b/tests/tests/appop2/OWNERS
@@ -1,7 +1,3 @@
# Bug component: 137825
-moltmann@google.com
-zhanghai@google.com
-ntmyren@google.com
-eugenesusla@google.com
-svetoslavganov@google.com
-evanseverson@google.com
+
+include platform/frameworks/base:/core/java/android/permission/OWNERS
\ No newline at end of file
diff --git a/tests/tests/assist/Android.bp b/tests/tests/assist/Android.bp
index 9eaf048..e00d292 100644
--- a/tests/tests/assist/Android.bp
+++ b/tests/tests/assist/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -28,7 +29,7 @@
"CtsAssistCommon",
"ctstestrunner-axt",
"compatibility-device-util-axt",
- "androidx.test.ext.junit",
+ "androidx.test.ext.junit",
],
srcs: ["src/**/*.java"],
diff --git a/tests/tests/assist/common/Android.bp b/tests/tests/assist/common/Android.bp
index b82668d..c89f52d 100644
--- a/tests/tests/assist/common/Android.bp
+++ b/tests/tests/assist/common/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/assist/service/Android.bp b/tests/tests/assist/service/Android.bp
index c21a601..2733c9f 100644
--- a/tests/tests/assist/service/Android.bp
+++ b/tests/tests/assist/service/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/assist/testapp/Android.bp b/tests/tests/assist/testapp/Android.bp
index 07bab73..969f37c 100644
--- a/tests/tests/assist/testapp/Android.bp
+++ b/tests/tests/assist/testapp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/attributionsource/Android.bp b/tests/tests/attributionsource/Android.bp
index 6762344..9a0a5f9 100644
--- a/tests/tests/attributionsource/Android.bp
+++ b/tests/tests/attributionsource/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/attributionsource/BlamedPermissionApp/Android.bp b/tests/tests/attributionsource/BlamedPermissionApp/Android.bp
index 7b85847..e3f450c 100644
--- a/tests/tests/attributionsource/BlamedPermissionApp/Android.bp
+++ b/tests/tests/attributionsource/BlamedPermissionApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -24,4 +25,3 @@
"src/**/*.kt",
],
}
-
diff --git a/tests/tests/attributionsource/BlamedPermissionApp2/Android.bp b/tests/tests/attributionsource/BlamedPermissionApp2/Android.bp
index a517522..de9776d 100644
--- a/tests/tests/attributionsource/BlamedPermissionApp2/Android.bp
+++ b/tests/tests/attributionsource/BlamedPermissionApp2/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -25,4 +26,3 @@
"src/**/*.kt",
],
}
-
diff --git a/tests/tests/batteryhealth/Android.bp b/tests/tests/batteryhealth/Android.bp
index 81316e7..ca3cd08 100644
--- a/tests/tests/batteryhealth/Android.bp
+++ b/tests/tests/batteryhealth/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_pixel_system_sw_battery",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/binder_ndk/libbinder_ndk_test/Android.bp b/tests/tests/binder_ndk/libbinder_ndk_test/Android.bp
index 3afaa3f..497ad3e 100644
--- a/tests/tests/binder_ndk/libbinder_ndk_test/Android.bp
+++ b/tests/tests/binder_ndk/libbinder_ndk_test/Android.bp
@@ -60,6 +60,9 @@
cpp: {
enabled: false,
},
+ rust: {
+ enabled: false,
+ },
},
unstable: true,
}
diff --git a/tests/tests/binder_ndk/libbinder_ndk_test/test_parcel.cpp b/tests/tests/binder_ndk/libbinder_ndk_test/test_parcel.cpp
index a87a1a4..0a24f84 100644
--- a/tests/tests/binder_ndk/libbinder_ndk_test/test_parcel.cpp
+++ b/tests/tests/binder_ndk/libbinder_ndk_test/test_parcel.cpp
@@ -59,6 +59,16 @@
return NdkBinderSenseOfEquality<const AStatus*>(a, b);
}
+template <typename T>
+auto castForStream(T val) {
+ return val;
+}
+
+template <>
+auto castForStream(char16_t val) {
+ return static_cast<int>(val);
+}
+
// These reads and writes an array of possible values all of the same type.
template <typename T,
binder_status_t (*write)(AParcel*, typename WriteFrom<T>::type),
@@ -84,7 +94,7 @@
T readTarget = {};
EXPECT_OK(read(out, &readTarget));
EXPECT_TRUE(NdkBinderSenseOfEquality<T>(value, readTarget))
- << value << " is not " << readTarget;
+ << castForStream(value) << " is not " << castForStream(readTarget);
return STATUS_OK;
}));
}
diff --git a/tests/tests/binder_ndk/libbinder_ndk_test/test_persistable_bundle.cpp b/tests/tests/binder_ndk/libbinder_ndk_test/test_persistable_bundle.cpp
index ee485d1..daa78a6 100644
--- a/tests/tests/binder_ndk/libbinder_ndk_test/test_persistable_bundle.cpp
+++ b/tests/tests/binder_ndk/libbinder_ndk_test/test_persistable_bundle.cpp
@@ -149,8 +149,8 @@
EXPECT_EQ(outLong, kLongVal);
EXPECT_TRUE(APersistableBundle_getDouble(bundle, "double", &outDouble));
EXPECT_EQ(outDouble, kDoubleVal);
- EXPECT_TRUE(
- APersistableBundle_getString(bundle, "string", &outString, &stringAllocator, nullptr));
+ EXPECT_EQ(APersistableBundle_getString(bundle, "string", &outString, &stringAllocator, nullptr),
+ kStringVal.size());
EXPECT_EQ(outString, kStringVal);
int32_t sizeBytes = APersistableBundle_getBooleanVector(bundle, "boolv", outBoolV, 0);
@@ -214,6 +214,88 @@
EXPECT_TRUE(APersistableBundle_isEqual(innerBundle, outInnerBundle));
}
+TEST_F(NdkBinderTest_APersistableBundle, WrongKeyBool) {
+ APersistableBundle* bundle = APersistableBundle_new();
+ ASSERT_NE(nullptr, bundle);
+
+ bool outBool = false;
+ EXPECT_FALSE(APersistableBundle_getBoolean(bundle, "not the right key", &outBool));
+}
+
+TEST_F(NdkBinderTest_APersistableBundle, WrongKeyString) {
+ APersistableBundle* bundle = APersistableBundle_new();
+ ASSERT_NE(nullptr, bundle);
+
+ char* outString = nullptr;
+ EXPECT_EQ(APersistableBundle_getString(bundle, "not the right key", &outString, &stringAllocator,
+ nullptr),
+ APERSISTABLEBUNDLE_KEY_NOT_FOUND);
+}
+
+TEST_F(NdkBinderTest_APersistableBundle, WrongKeyVector) {
+ APersistableBundle* bundle = APersistableBundle_new();
+ ASSERT_NE(nullptr, bundle);
+
+ bool* outBools = nullptr;
+ EXPECT_EQ(APersistableBundle_getBooleanVector(bundle, "not the right key", outBools, 0),
+ APERSISTABLEBUNDLE_KEY_NOT_FOUND);
+}
+
+TEST_F(NdkBinderTest_APersistableBundle, EmptyStringVal) {
+ APersistableBundle* bundle = APersistableBundle_new();
+ ASSERT_NE(nullptr, bundle);
+
+ APersistableBundle_putString(bundle, "key", "");
+ char* outString = nullptr;
+ EXPECT_EQ(APersistableBundle_getString(bundle, "key", &outString, &stringAllocator, nullptr), 0);
+}
+
+TEST_F(NdkBinderTest_APersistableBundle, EmptyVectorVal) {
+ APersistableBundle* bundle = APersistableBundle_new();
+ ASSERT_NE(nullptr, bundle);
+
+ // empty vector is size 0
+ const bool inEmptyBools[] = {};
+ APersistableBundle_putBooleanVector(bundle, "key", inEmptyBools, 0);
+ bool* outBools = nullptr;
+ EXPECT_EQ(APersistableBundle_getBooleanVector(bundle, "key", outBools, 0), 0);
+}
+
+TEST_F(NdkBinderTest_APersistableBundle, EmptyStringKeys) {
+ int32_t sizeBytes = sizeof(char*);
+ char** outKeys = (char**)malloc(sizeBytes);
+ APersistableBundle* bundle = APersistableBundle_new();
+ ASSERT_NE(nullptr, bundle);
+
+ // No keys yet, should be size 0
+ int32_t outSizeBytes =
+ APersistableBundle_getBooleanKeys(bundle, outKeys, sizeBytes, &stringAllocator, nullptr);
+ ASSERT_EQ(outSizeBytes, 0);
+
+ // Empty string as a key needs an entry like any other key
+ APersistableBundle_putBoolean(bundle, "", kBoolVal);
+ outSizeBytes =
+ APersistableBundle_getBooleanKeys(bundle, outKeys, sizeBytes, &stringAllocator, nullptr);
+ ASSERT_EQ(outSizeBytes, sizeof(char*));
+ EXPECT_EQ(0, std::strcmp("", outKeys[0]));
+}
+
+static char* failAllocator(int32_t, void*) {
+ return nullptr;
+}
+
+TEST_F(NdkBinderTest_APersistableBundle, FailAllocatorKeys) {
+ int32_t sizeBytes = sizeof(char*);
+ char** outKeys = (char**)malloc(sizeBytes);
+ APersistableBundle* bundle = APersistableBundle_new();
+ ASSERT_NE(nullptr, bundle);
+
+ APersistableBundle_putBoolean(bundle, "This will fail to allocate", kBoolVal);
+ int32_t outSizeBytes =
+ APersistableBundle_getBooleanKeys(bundle, outKeys, sizeBytes, &failAllocator, nullptr);
+ EXPECT_EQ(outSizeBytes, APERSISTABLEBUNDLE_ALLOCATOR_FAILED);
+}
+
// Check bytes and string arrays for equality and free all of the outKeys
inline void checkAndFree(int32_t inBytes, int32_t outBytes, const char** inKeys, char** outKeys,
int numKeys) {
diff --git a/tests/tests/bionic/Android.bp b/tests/tests/bionic/Android.bp
index 094ff81..992144c 100644
--- a/tests/tests/bionic/Android.bp
+++ b/tests/tests/bionic/Android.bp
@@ -5,6 +5,17 @@
cc_test {
name: "CtsBionicTestCases",
+ defaults: ["cts_bionic_defaults"],
+
+ test_suites: [
+ "cts",
+ ],
+
+}
+
+cc_defaults {
+ name: "cts_bionic_defaults",
+
defaults: ["bionic_unit_tests_data"],
compile_multilib: "both",
@@ -56,7 +67,6 @@
stl: "libc++_static",
test_suites: [
- "cts",
"general-tests",
"mts-mainline-infra",
],
@@ -66,11 +76,5 @@
":libdlext_test_zip_zipaligned",
],
- test_config: "AndroidTest.xml",
-
- test_options: {
- extra_test_configs: ["BionicRootTest.xml"],
- },
-
per_testcase_directory: true,
}
diff --git a/tests/tests/bionic/BionicRootTest.xml b/tests/tests/bionic/BionicRootTest.xml
deleted file mode 100644
index 5f180a3..0000000
--- a/tests/tests/bionic/BionicRootTest.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2023 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.
--->
-<configuration description="Config for CTS Bionic test cases">
- <option name="test-suite-tag" value="cts" />
- <option name="config-descriptor:metadata" key="component" value="bionic" />
- <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
- <option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
- <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
-
- <!-- TODO(b/126376458): Remove this when sharding is supported by libgtest_isolated -->
- <option name="not-shardable" value="true" />
-
- <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
-
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
- <option name="cleanup" value="true" />
- <option name="push" value="CtsBionicTestCases->/data/local/tests/unrestricted/CtsBionicTestCases" />
- </target_preparer>
- <test class="com.android.tradefed.testtype.GTest" >
- <option name="native-test-device-path" value="/data/local/tests/unrestricted" />
- <option name="module-name" value="CtsBionicTestCases" />
- <option name="native-test-timeout" value="4m30s" />
- <option name="test-case-timeout" value="4m30s" />
- <option name="runtime-hint" value="12m10s" />
- </test>
-</configuration>
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothA2dpSinkTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothA2dpSinkTest.java
index 4c06fb9..ff47c73 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothA2dpSinkTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothA2dpSinkTest.java
@@ -227,7 +227,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -247,7 +247,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothA2dpTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothA2dpTest.java
index fa8f0d5..baab456 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothA2dpTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothA2dpTest.java
@@ -411,7 +411,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -431,7 +431,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothAdapterTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothAdapterTest.java
index 2adf1da..d274cbe 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothAdapterTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothAdapterTest.java
@@ -46,23 +46,27 @@
import android.os.Build;
import android.os.Bundle;
import android.os.SystemProperties;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.util.Log;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
+import com.android.bluetooth.flags.Flags;
import com.android.compatibility.common.util.ApiLevelUtil;
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.IOException;
import java.time.Duration;
import java.util.List;
-import java.util.Locale;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Executor;
@@ -77,16 +81,14 @@
@MediumTest
public class BluetoothAdapterTest {
private static final String TAG = "BluetoothAdapterTest";
- private static final String[] FORBIDDEN_DEVICE_NAMES = new String[] {
- // these should all be the same, but, just in case...
- Build.DEVICE,
- Build.PRODUCT,
- Build.HARDWARE
- };
private static final int SET_NAME_TIMEOUT = 5000; // ms timeout for setting adapter name
private static final String ENABLE_DUAL_MODE_AUDIO =
"persist.bluetooth.enable_dual_mode_audio";
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule =
+ DeviceFlagsValueProvider.createCheckFlagsRule();
+
private Context mContext;
private boolean mHasBluetooth;
private ReentrantLock mAdapterNameChangedlock;
@@ -200,18 +202,6 @@
}
@Test
- public void getName_notForbidden() {
- String name = mAdapter.getName();
- for (String forbiddenDeviceName : FORBIDDEN_DEVICE_NAMES) {
- assertFalse(
- "Bad bluetooth name, \"" + forbiddenDeviceName
- + "\" was found in \"" + name + '"',
- name.toLowerCase(Locale.getDefault()).contains(
- forbiddenDeviceName.toLowerCase(Locale.getDefault())));
- }
- }
-
- @Test
public void setName_getName() {
assumeTrue(mHasBluetooth);
@@ -653,6 +643,27 @@
}
@Test
+ @RequiresFlagsEnabled(Flags.FLAG_AUTO_ON_FEATURE)
+ public void autoOnApi() {
+ assumeTrue(mHasBluetooth);
+
+ assertThrows(SecurityException.class, () -> mAdapter.isAutoOnSupported());
+ assertThrows(SecurityException.class, () -> mAdapter.isAutoOnEnabled());
+ assertThrows(SecurityException.class, () -> mAdapter.setAutoOnEnabled(false));
+
+ TestUtils.adoptPermissionAsShellUid(BLUETOOTH_PRIVILEGED);
+
+ // Not all devices support the auto on feature
+ assumeTrue(mAdapter.isAutoOnSupported());
+
+ mAdapter.setAutoOnEnabled(false);
+ assertEquals(false, mAdapter.isAutoOnEnabled());
+
+ mAdapter.setAutoOnEnabled(true);
+ assertEquals(true, mAdapter.isAutoOnEnabled());
+ }
+
+ @Test
public void getSetBluetoothHciSnoopLoggingMode() {
assumeTrue(mHasBluetooth);
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothCddTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothCddTest.java
index 5e1467d..f933b4d 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothCddTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothCddTest.java
@@ -59,12 +59,8 @@
TestUtils.adoptPermissionAsShellUid(BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED,
BLUETOOTH_SCAN);
mAdapter = TestUtils.getBluetoothAdapterOrDie();
- if (mAdapter.isEnabled()) {
- assertThat(BTAdapterUtils.disableAdapter(mAdapter, mContext)).isTrue();
- try {
- Thread.sleep(BLUETOOTH_TOGGLE_DELAY_MS);
- } catch (InterruptedException ignored) { }
- }
+
+ assertThat(BTAdapterUtils.enableAdapter(mAdapter, mContext)).isTrue();
}
@After
@@ -88,17 +84,13 @@
@CddTest(requirements = {"7.4.3/C-3-1", "7.4.3/C-3-2"})
@Test
public void C_3_BleRequirements() {
- Assume.assumeTrue(mHasBluetooth);
Assume.assumeTrue(TestUtils.isBleSupported(mContext));
- assertThat(BTAdapterUtils.enableAdapter(mAdapter, mContext)).isTrue();
assertThat(mAdapter.getSupportedProfiles()).contains(BluetoothProfile.GATT);
}
@CddTest(requirements = {"7.4.3/C-7-3", "7.4.3/C-7-5"})
@Test
public void C_7_LeAudioUnicastRequirements() {
- Assume.assumeTrue(mHasBluetooth);
- assertThat(BTAdapterUtils.enableAdapter(mAdapter, mContext)).isTrue();
// Assert that BluetoothAdapter#isLeAudioSupported() and
// BluetoothAdapter#getSupportedProfiles() return the same information
if (mAdapter.isLeAudioSupported() != BluetoothStatusCodes.FEATURE_SUPPORTED) {
@@ -118,8 +110,6 @@
@CddTest(requirements = {"7.4.3/C-8-2", "7.4.3/C-8-3"})
@Test
public void C_8_LeAudioBroadcastSourceRequirements() {
- Assume.assumeTrue(mHasBluetooth);
- assertThat(BTAdapterUtils.enableAdapter(mAdapter, mContext)).isTrue();
// Assert that BluetoothAdapter#isLeAudioBroadcastSourceSupported() and
// BluetoothAdapter#getSupportedProfiles() return the same information
if (mAdapter.isLeAudioBroadcastSourceSupported()
@@ -139,8 +129,6 @@
@CddTest(requirements = {"7.4.3/C-9-2"})
@Test
public void C_9_LeAudioBroadcastAssistantRequirements() {
- Assume.assumeTrue(mHasBluetooth);
- assertThat(BTAdapterUtils.enableAdapter(mAdapter, mContext)).isTrue();
// Assert that BluetoothAdapter#isLeAudioBroadcastAssistantSupported() and
// BluetoothAdapter#getSupportedProfiles() return the same information
if (mAdapter.isLeAudioBroadcastAssistantSupported()
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothCsipSetCoordinatorTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothCsipSetCoordinatorTest.java
index f9d8d6c..9963fb4 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothCsipSetCoordinatorTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothCsipSetCoordinatorTest.java
@@ -63,6 +63,7 @@
private static final String TAG = BluetoothCsipSetCoordinatorTest.class.getSimpleName();
private static final int PROXY_CONNECTION_TIMEOUT_MS = 500; // ms timeout for Proxy Connect
+ private static final int TEST_CALLBACK_TIMEOUT_MS = 500; // ms timeout for test callback
private Context mContext;
private BluetoothAdapter mAdapter;
@@ -73,6 +74,8 @@
private Condition mConditionProfileConnection;
private ReentrantLock mProfileConnectionlock;
private boolean mGroupLockCallbackCalled;
+ private Condition mConditionTestCallback;
+ private ReentrantLock mTestCallbackLock;
private TestCallback mTestCallback;
private Executor mTestExecutor;
private BluetoothDevice mTestDevice;
@@ -83,13 +86,39 @@
class TestCallback implements BluetoothCsipSetCoordinator.ClientLockCallback {
@Override
public void onGroupLockSet(int groupId, int opStatus, boolean isLocked) {
- mGroupLockCallbackCalled = true;
+ mTestCallbackLock.lock();
assertTrue(groupId == mTestGroupId);
assertTrue(opStatus == mTestOperationStatus);
assertTrue(isLocked == mIsLocked);
+ mGroupLockCallbackCalled = true;
+ try {
+ mConditionTestCallback.signal();
+ } finally {
+ mTestCallbackLock.unlock();
+ }
}
};
+ private boolean waitForGroupLockCallback() {
+ mTestCallbackLock.lock();
+ try {
+ // Wait for call of group lock callback
+ while (!mGroupLockCallbackCalled) {
+ if (!mConditionTestCallback.await(
+ TEST_CALLBACK_TIMEOUT_MS, TimeUnit.MILLISECONDS)) {
+ // Timeout
+ Log.e(TAG, "Timeout while waiting for Group Lock Callback");
+ break;
+ } // else spurious wakeups
+ }
+ } catch (InterruptedException e) {
+ Log.e(TAG, "waitForGroupLockCallback: interrupted");
+ } finally {
+ mTestCallbackLock.unlock();
+ }
+ return mGroupLockCallbackCalled;
+ }
+
@Before
public void setUp() throws Exception {
mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
@@ -118,6 +147,10 @@
Assume.assumeTrue(mAdapter.getProfileProxy(mContext,
new BluetoothCsipServiceListener(), BluetoothProfile.CSIP_SET_COORDINATOR));
+ mTestCallbackLock = new ReentrantLock();
+ mConditionTestCallback = mTestCallbackLock.newCondition();
+ mGroupLockCallbackCalled = false;
+
mTestCallback = new TestCallback();
mTestExecutor = mContext.getMainExecutor();
}
@@ -131,6 +164,7 @@
mTestDevice = null;
mIsLocked = false;
mTestOperationStatus = 0;
+ mGroupLockCallbackCalled = false;
mTestCallback = null;
mTestExecutor = null;
}
@@ -243,6 +277,8 @@
fail("Exception caught from register(): " + e.toString());
}
+ assertTrue(waitForGroupLockCallback());
+
long uuidLsb = 0x01;
long uuidMsb = 0x01;
UUID uuid = new UUID(uuidMsb, uuidLsb);
@@ -265,7 +301,7 @@
mIsLocked = true;
mTestCallback.onGroupLockSet(mTestGroupId, mTestOperationStatus, mIsLocked);
- assertTrue(mGroupLockCallbackCalled);
+ assertTrue(waitForGroupLockCallback());
}
@CddTest(requirements = {"7.4.3/C-2-1", "7.4.3/C-3-2"})
@@ -298,7 +334,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -318,7 +354,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothDeviceTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothDeviceTest.java
index ffc93a2..067315e 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothDeviceTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothDeviceTest.java
@@ -45,13 +45,19 @@
import android.content.AttributionSource;
import android.content.Context;
import android.content.pm.PackageManager;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.platform.app.InstrumentationRegistry;
+import com.android.bluetooth.flags.Flags;
+
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -70,6 +76,10 @@
private final String mFakeDeviceAddress = "00:11:22:AA:BB:CC";
private BluetoothDevice mFakeDevice;
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule =
+ DeviceFlagsValueProvider.createCheckFlagsRule();
+
@Before
public void setUp() throws Exception {
mContext = InstrumentationRegistry.getInstrumentation().getContext();
@@ -151,6 +161,14 @@
}
@Test
+ public void getAddressType() {
+ // Skip the test if bluetooth or companion device are not present.
+ assumeTrue(mHasBluetooth && mHasCompanionDevice);
+
+ assertEquals(BluetoothDevice.ADDRESS_TYPE_PUBLIC, mFakeDevice.getAddressType());
+ }
+
+ @Test
public void getIdentityAddress() {
// Skip the test if bluetooth or companion device are not present.
assumeTrue(mHasBluetooth && mHasCompanionDevice);
@@ -552,4 +570,46 @@
mFakeDevice.cancelBondProcess();
mFakeDevice.removeBond();
}
+
+ @RequiresFlagsEnabled(Flags.FLAG_METADATA_API_INACTIVE_AUDIO_DEVICE_UPON_CONNECTION)
+ @Test
+ public void setActiveAudioDevicePolicy_getActiveAudioDevicePolicy() {
+ if (!mHasBluetooth || !mHasCompanionDevice) {
+ // Skip the test if bluetooth or companion device are not present.
+ return;
+ }
+ String deviceAddress = "00:11:22:AA:BB:CC";
+ BluetoothDevice device = mAdapter.getRemoteDevice(deviceAddress);
+
+ // This should throw a SecurityException because no BLUETOOTH_CONNECT permission
+ mUiAutomation.adoptShellPermissionIdentity(BLUETOOTH_PRIVILEGED);
+ assertThrows(
+ SecurityException.class,
+ () ->
+ device.setActiveAudioDevicePolicy(
+ BluetoothDevice
+ .ACTIVE_AUDIO_DEVICE_POLICY_ALL_PROFILES_INACTIVE_UPON_CONNECTION));
+ assertThrows(SecurityException.class, () -> device.getActiveAudioDevicePolicy());
+
+ // This should throw a SecurityException because no BLUETOOTH_PRIVILEGED permission
+ mUiAutomation.adoptShellPermissionIdentity(BLUETOOTH_CONNECT);
+ assertThrows(
+ SecurityException.class,
+ () ->
+ device.setActiveAudioDevicePolicy(
+ BluetoothDevice
+ .ACTIVE_AUDIO_DEVICE_POLICY_ALL_PROFILES_INACTIVE_UPON_CONNECTION));
+ assertThrows(SecurityException.class, () -> device.getActiveAudioDevicePolicy());
+
+ mUiAutomation.adoptShellPermissionIdentity(BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED);
+
+ assertEquals(
+ BluetoothDevice.ACTIVE_AUDIO_DEVICE_POLICY_DEFAULT,
+ device.getActiveAudioDevicePolicy());
+ assertEquals(
+ BluetoothStatusCodes.ERROR_DEVICE_NOT_BONDED,
+ device.setActiveAudioDevicePolicy(
+ BluetoothDevice
+ .ACTIVE_AUDIO_DEVICE_POLICY_ALL_PROFILES_INACTIVE_UPON_CONNECTION));
+ }
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHapClientTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHapClientTest.java
index 38624af..efadba4 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHapClientTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHapClientTest.java
@@ -646,7 +646,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHeadsetClientTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHeadsetClientTest.java
index 99827ab..8c95c6e 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHeadsetClientTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHeadsetClientTest.java
@@ -257,7 +257,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -277,7 +277,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHeadsetTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHeadsetTest.java
index a13257b..38f5ad1 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHeadsetTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHeadsetTest.java
@@ -414,7 +414,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -434,7 +434,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHidDeviceTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHidDeviceTest.java
index cb1f537..f598806 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHidDeviceTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHidDeviceTest.java
@@ -242,7 +242,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -262,7 +262,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHidHostTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHidHostTest.java
index cdd7bf5..c82b03c 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHidHostTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothHidHostTest.java
@@ -17,10 +17,12 @@
package android.bluetooth.cts;
import static android.Manifest.permission.BLUETOOTH_CONNECT;
+import static android.Manifest.permission.BLUETOOTH_PRIVILEGED;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
@@ -33,6 +35,9 @@
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.sysprop.BluetoothProperties;
import android.util.Log;
@@ -40,10 +45,12 @@
import androidx.test.filters.LargeTest;
import androidx.test.platform.app.InstrumentationRegistry;
+import com.android.bluetooth.flags.Flags;
import com.android.compatibility.common.util.ApiLevelUtil;
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -57,15 +64,17 @@
@LargeTest
public class BluetoothHidHostTest {
private static final String TAG = BluetoothHidHostTest.class.getSimpleName();
- private static final int PROXY_CONNECTION_TIMEOUT_MS = 500; // ms timeout for Proxy Connect
+ private static final String[] DEFAULT_PERMISSIONS = {BLUETOOTH_CONNECT};
+ private static final int PROXY_CONNECTION_TIMEOUT_MS = 500; // ms timeout for Proxy Connect
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
private Context mContext;
private boolean mHasBluetooth;
private boolean mIsHidHostSupported;
private BluetoothAdapter mAdapter;
private BluetoothHidHost mHidHost;
private UiAutomation mUiAutomation;
-
private boolean mIsProfileReady;
private Condition mConditionProfileConnection;
private ReentrantLock mProfileConnectionlock;
@@ -84,7 +93,7 @@
if (!mIsHidHostSupported) return;
mUiAutomation = InstrumentationRegistry.getInstrumentation().getUiAutomation();
- mUiAutomation.adoptShellPermissionIdentity(BLUETOOTH_CONNECT);
+ mUiAutomation.adoptShellPermissionIdentity(DEFAULT_PERMISSIONS);
BluetoothManager manager = mContext.getSystemService(BluetoothManager.class);
mAdapter = manager.getAdapter();
@@ -109,6 +118,10 @@
mHidHost = null;
mIsProfileReady = false;
}
+
+ if (mUiAutomation != null) {
+ mUiAutomation.dropShellPermissionIdentity();
+ }
mAdapter = null;
}
@@ -219,14 +232,73 @@
testDevice, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN));
}
- private static <T extends Exception> void assertThrows(Class<T> clazz, Runnable r) {
- try {
- r.run();
- } catch (Exception e) {
- if (!clazz.isAssignableFrom(e.getClass())) {
- throw e;
- }
- }
+ @RequiresFlagsEnabled(Flags.FLAG_ALLOW_SWITCHING_HID_AND_HOGP)
+ @Test
+ public void getPreferredTransportTest() {
+ assumeTrue(mHasBluetooth && mIsHidHostSupported);
+ assertTrue(waitForProfileConnect());
+ assertNotNull(mHidHost);
+
+ BluetoothDevice testDevice = mAdapter.getRemoteDevice("00:11:22:AA:BB:CC");
+
+ // Verify returns IllegalArgumentException when invalid input is given
+ assertThrows(
+ IllegalArgumentException.class,
+ () -> {
+ mHidHost.getPreferredTransport(null);
+ });
+ assertTrue(BTAdapterUtils.disableAdapter(mAdapter, mContext));
+
+ // Verify returns false if bluetooth is not enabled
+ assertEquals(
+ BluetoothDevice.TRANSPORT_AUTO,
+ mHidHost.getPreferredTransport(testDevice));
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_ALLOW_SWITCHING_HID_AND_HOGP)
+ @Test
+ public void setPreferredTransportTest() {
+ assumeTrue(mHasBluetooth && mIsHidHostSupported);
+ assertTrue(waitForProfileConnect());
+ assertNotNull(mHidHost);
+
+ BluetoothDevice testDevice = mAdapter.getRemoteDevice("00:11:22:AA:BB:CC");
+
+ // Verify that BLUETOOTH_PRIVILEGED permission is enforced
+ mUiAutomation.adoptShellPermissionIdentity(BLUETOOTH_CONNECT);
+ assertThrows("BLUETOOTH_PRIVILEGED permission not enforced",
+ SecurityException.class,
+ () -> {
+ mHidHost.setPreferredTransport(testDevice, BluetoothDevice.TRANSPORT_AUTO);
+ });
+
+ // Verify that BLUETOOTH_CONNECT permission is enforced
+ mUiAutomation.adoptShellPermissionIdentity(BLUETOOTH_PRIVILEGED);
+ assertThrows("BLUETOOTH_CONNECT permission not enforced", SecurityException.class,
+ () -> {
+ mHidHost.setPreferredTransport(testDevice, BluetoothDevice.TRANSPORT_AUTO);
+ });
+
+ // Get required permissions
+ mUiAutomation.adoptShellPermissionIdentity(BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED);
+
+ // Verify returns false when invalid input is given
+ assertFalse(
+ mHidHost.setPreferredTransport(
+ testDevice, BluetoothDevice.TRANSPORT_AUTO));
+ // Verify returns IllegalArgumentException when invalid input is given
+ assertThrows(
+ IllegalArgumentException.class,
+ () -> {
+ mHidHost.setPreferredTransport(null, BluetoothDevice.TRANSPORT_AUTO);
+ });
+
+ assertTrue(BTAdapterUtils.disableAdapter(mAdapter, mContext));
+
+ // Verify returns false if bluetooth is not enabled
+ assertFalse(
+ mHidHost.setPreferredTransport(
+ testDevice, BluetoothDevice.TRANSPORT_AUTO));
}
private boolean waitForProfileConnect() {
@@ -262,7 +334,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeAudioTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeAudioTest.java
index 1d0032c..c90128e 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeAudioTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeAudioTest.java
@@ -37,11 +37,13 @@
import android.bluetooth.BluetoothStatusCodes;
import android.content.Context;
import android.os.Build;
+import android.platform.test.annotations.RequiresFlagsEnabled;
import android.util.Log;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
+import com.android.bluetooth.flags.Flags;
import com.android.compatibility.common.util.ApiLevelUtil;
import com.android.compatibility.common.util.CddTest;
@@ -76,9 +78,11 @@
private boolean mGroupNodeAddedCalled;
private boolean mGroupNodeRemovedCalled;
private boolean mGroupStatusChangedCalled;
+ private boolean mGroupStreamStatusChangedCalled;
private BluetoothDevice mTestDevice;
private int mTestGroupId;
private int mTestGroupStatus;
+ private int mTestGroupStreamStatus;
private static final BluetoothLeAudioCodecConfig LC3_16KHZ_CONFIG =
new BluetoothLeAudioCodecConfig.Builder()
@@ -120,6 +124,12 @@
assertTrue(groupId == mTestGroupId);
assertTrue(groupStatus == mTestGroupStatus);
}
+ @Override
+ public void onGroupStreamStatusChanged(int groupId, int groupStreamStatus) {
+ mGroupStreamStatusChangedCalled = true;
+ assertTrue(groupId == mTestGroupId);
+ assertTrue(groupStreamStatus == mTestGroupStreamStatus);
+ }
};
@Before
@@ -328,6 +338,24 @@
}
@CddTest(requirements = {"7.4.3/C-2-1"})
+ @RequiresFlagsEnabled(Flags.FLAG_LEAUDIO_CALLBACK_ON_GROUP_STREAM_STATUS)
+ @Test
+ public void streamStatusCallback() {
+ assertTrue(waitForProfileConnect());
+ assertNotNull(mBluetoothLeAudio);
+
+ mTestGroupId = 1;
+ mTestDevice = mAdapter.getRemoteDevice("00:11:22:AA:BB:CC");
+ mTestGroupStreamStatus = 1;
+
+ mGroupStreamStatusChangedCalled = false;
+
+ mTestCallback.onGroupStreamStatusChanged(mTestGroupId, mTestGroupStreamStatus);
+
+ assertTrue(mGroupStreamStatusChangedCalled);
+ }
+
+ @CddTest(requirements = {"7.4.3/C-2-1"})
@Test
public void getConnectedGroupLeadDevice() {
assertTrue(waitForProfileConnect());
@@ -419,7 +447,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -439,7 +467,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeBroadcastAssistantTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeBroadcastAssistantTest.java
index de96bb1..2394516c 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeBroadcastAssistantTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeBroadcastAssistantTest.java
@@ -591,7 +591,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -611,7 +611,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeBroadcastTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeBroadcastTest.java
index 5756222..217698a 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeBroadcastTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothLeBroadcastTest.java
@@ -842,7 +842,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -862,7 +862,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothMapClientTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothMapClientTest.java
index 6a2ce26..25d8aaa 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothMapClientTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothMapClientTest.java
@@ -262,7 +262,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -282,7 +282,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothMapTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothMapTest.java
index 6264b3f..d7cc056 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothMapTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothMapTest.java
@@ -243,7 +243,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPanTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPanTest.java
index 57d206f..dfc03d8 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPanTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPanTest.java
@@ -215,7 +215,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -235,7 +235,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPbapClientTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPbapClientTest.java
index 2c7a5b4..9ca8f1b 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPbapClientTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPbapClientTest.java
@@ -220,7 +220,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -240,7 +240,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPbapTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPbapTest.java
index 0475ec5..30df091 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPbapTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothPbapTest.java
@@ -224,7 +224,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothSapTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothSapTest.java
index a35e9f5..359c894 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothSapTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothSapTest.java
@@ -200,7 +200,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -220,7 +220,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothVolumeControlTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothVolumeControlTest.java
index a4bf0f1..53a94ac 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothVolumeControlTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/BluetoothVolumeControlTest.java
@@ -26,7 +26,6 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
import android.bluetooth.BluetoothAdapter;
@@ -50,6 +49,7 @@
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
+import org.junit.function.ThrowingRunnable;
import org.junit.runner.RunWith;
import java.util.List;
@@ -74,11 +74,16 @@
private Condition mConditionProfileConnection;
private ReentrantLock mProfileConnectionlock;
private boolean mVolumeOffsetChangedCallbackCalled;
+ private boolean mAudioLocationChangedCallbackCalled;
+ private boolean mAudioDescriptionChangedCallbackCalled;
private boolean mDeviceVolumeChangedCallbackCalled;
private TestCallback mTestCallback;
private Executor mTestExecutor;
private BluetoothDevice mTestDevice;
+ private int mTestVocsInstanceId;
private int mTestVolumeOffset;
+ private int mTestAudioLocation;
+ private String mTestAudioDescription;
private int mTestVolume;
@Rule
@@ -87,6 +92,17 @@
class TestCallback implements BluetoothVolumeControl.Callback {
@Override
+ public void onVolumeOffsetChanged(
+ BluetoothDevice device,
+ int instanceId,
+ int volumeOffset) {
+ mVolumeOffsetChangedCallbackCalled = true;
+ assertTrue(device == mTestDevice);
+ assertTrue(instanceId == mTestVocsInstanceId);
+ assertTrue(volumeOffset == mTestVolumeOffset);
+ }
+
+ @Override
public void onVolumeOffsetChanged(BluetoothDevice device, int volumeOffset) {
mVolumeOffsetChangedCallbackCalled = true;
assertTrue(device == mTestDevice);
@@ -94,6 +110,28 @@
}
@Override
+ public void onVolumeOffsetAudioLocationChanged(
+ BluetoothDevice device,
+ int instanceId,
+ int audioLocation) {
+ mAudioLocationChangedCallbackCalled = true;
+ assertTrue(device == mTestDevice);
+ assertTrue(instanceId == mTestVocsInstanceId);
+ assertTrue(audioLocation == mTestAudioLocation);
+ }
+
+ @Override
+ public void onVolumeOffsetAudioDescriptionChanged(
+ BluetoothDevice device,
+ int instanceId,
+ String audioDescription) {
+ mAudioDescriptionChangedCallbackCalled = true;
+ assertTrue(device == mTestDevice);
+ assertTrue(instanceId == mTestVocsInstanceId);
+ assertTrue(audioDescription == mTestAudioDescription);
+ }
+
+ @Override
public void onDeviceVolumeChanged(BluetoothDevice device, int volume) {
mDeviceVolumeChangedCallbackCalled = true;
assertThat(device).isEqualTo(mTestDevice);
@@ -149,7 +187,10 @@
mBluetoothVolumeControl = null;
mIsProfileReady = false;
mTestDevice = null;
+ mTestVocsInstanceId = 0;
mTestVolumeOffset = 0;
+ mTestAudioLocation = 0;
+ mTestAudioDescription = null;
mTestCallback = null;
mTestExecutor = null;
}
@@ -212,17 +253,8 @@
mBluetoothVolumeControl.unregisterCallback(null));
// Test success register unregister
- try {
- mBluetoothVolumeControl.registerCallback(mTestExecutor, mTestCallback);
- } catch (Exception e) {
- fail("Exception caught from register(): " + e.toString());
- }
-
- try {
- mBluetoothVolumeControl.unregisterCallback(mTestCallback);
- } catch (Exception e) {
- fail("Exception caught from unregister(): " + e.toString());
- }
+ mBluetoothVolumeControl.registerCallback(mTestExecutor, mTestCallback);
+ mBluetoothVolumeControl.unregisterCallback(mTestCallback);
TestUtils.dropPermissionAsShellUid();
// Verify throws SecurityException without permission.BLUETOOTH_PRIVILEGED
@@ -240,11 +272,9 @@
mTestDevice = mAdapter.getRemoteDevice("00:11:22:AA:BB:CC");
- try {
- mBluetoothVolumeControl.setVolumeOffset(mTestDevice, 0);
- } catch (Exception e) {
- fail("Exception caught from connect(): " + e.toString());
- }
+ mBluetoothVolumeControl.setVolumeOffset(mTestDevice, 0);
+
+ enforceConnectAndPrivileged(() -> mBluetoothVolumeControl.setVolumeOffset(mTestDevice, 0));
}
@RequiresFlagsEnabled(Flags.FLAG_LEAUDIO_BROADCAST_VOLUME_CONTROL_FOR_CONNECTED_DEVICES)
@@ -256,23 +286,17 @@
mTestDevice = mAdapter.getRemoteDevice("00:11:22:AA:BB:CC");
- try {
- mBluetoothVolumeControl.setDeviceVolume(mTestDevice, mTestVolume, true);
- } catch (Exception e) {
- fail("Exception caught from connect(): " + e.toString());
- }
-
- try {
- mBluetoothVolumeControl.setDeviceVolume(mTestDevice, mTestVolume, false);
- } catch (Exception e) {
- fail("Exception caught from connect(): " + e.toString());
- }
+ mBluetoothVolumeControl.setDeviceVolume(mTestDevice, mTestVolume, true);
+ mBluetoothVolumeControl.setDeviceVolume(mTestDevice, mTestVolume, false);
// volume expect in range [0, 255]
assertThrows(IllegalArgumentException.class, () ->
mBluetoothVolumeControl.setDeviceVolume(mTestDevice, -1, true));
assertThrows(IllegalArgumentException.class, () ->
mBluetoothVolumeControl.setDeviceVolume(mTestDevice, 256, true));
+
+ enforceConnectAndPrivileged(() -> mBluetoothVolumeControl
+ .setDeviceVolume(mTestDevice, mTestVolume, true));
}
@Test
@@ -282,12 +306,34 @@
assertNotNull(mBluetoothVolumeControl);
mTestDevice = mAdapter.getRemoteDevice("00:11:22:AA:BB:CC");
+
+ enforceConnectAndPrivileged(() -> mBluetoothVolumeControl
+ .isVolumeOffsetAvailable(mTestDevice));
+
assertTrue(BTAdapterUtils.disableAdapter(mAdapter, mContext));
// Verify returns false if bluetooth is not enabled
assertTrue(!mBluetoothVolumeControl.isVolumeOffsetAvailable(mTestDevice));
}
+ @RequiresFlagsEnabled(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API)
+ @Test
+ public void getNumberOfVolumeOffsetInstances() {
+ assumeTrue(mHasBluetooth && mIsVolumeControlSupported);
+ assertTrue(waitForProfileConnect());
+ assertNotNull(mBluetoothVolumeControl);
+
+ mTestDevice = mAdapter.getRemoteDevice("00:11:22:AA:BB:CC");
+
+ enforceConnectAndPrivileged(() -> mBluetoothVolumeControl
+ .getNumberOfVolumeOffsetInstances(mTestDevice));
+
+ assertTrue(BTAdapterUtils.disableAdapter(mAdapter, mContext));
+
+ // Verify returns 0 if bluetooth is not enabled
+ assertEquals(0, mBluetoothVolumeControl.getNumberOfVolumeOffsetInstances(mTestDevice));
+ }
+
@Test
public void volumeOffsetCallback() {
assumeTrue(mHasBluetooth && mIsVolumeControlSupported);
@@ -303,6 +349,63 @@
assertTrue(mVolumeOffsetChangedCallbackCalled);
}
+ @RequiresFlagsEnabled(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API)
+ @Test
+ public void volumeOffsetWithInstanceIdCallback() {
+ assumeTrue(mHasBluetooth && mIsVolumeControlSupported);
+ assertTrue(waitForProfileConnect());
+ assertNotNull(mBluetoothVolumeControl);
+
+ mTestDevice = mAdapter.getRemoteDevice("00:11:22:AA:BB:CC");
+ mVolumeOffsetChangedCallbackCalled = false;
+
+ /* Note. This is just for api coverage until proper testing tools are set up */
+ mTestVocsInstanceId = 1;
+ mTestVolumeOffset = 1;
+ mTestCallback.onVolumeOffsetChanged(mTestDevice, mTestVocsInstanceId, mTestVolumeOffset);
+ assertTrue(mVolumeOffsetChangedCallbackCalled);
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API)
+ @Test
+ public void volumeOffsetAudioLocationCallback() {
+ assumeTrue(mHasBluetooth && mIsVolumeControlSupported);
+ assertTrue(waitForProfileConnect());
+ assertNotNull(mBluetoothVolumeControl);
+
+ mTestDevice = mAdapter.getRemoteDevice("00:11:22:AA:BB:CC");
+ mAudioLocationChangedCallbackCalled = false;
+
+ /* Note. This is just for api coverage until proper testing tools are set up */
+ mTestVocsInstanceId = 1;
+ mTestAudioLocation = 1;
+ mTestCallback.onVolumeOffsetAudioLocationChanged(
+ mTestDevice,
+ mTestVocsInstanceId,
+ mTestAudioLocation);
+ assertTrue(mAudioLocationChangedCallbackCalled);
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API)
+ @Test
+ public void volumeOffsetAudioDescriptionCallback() {
+ assumeTrue(mHasBluetooth && mIsVolumeControlSupported);
+ assertTrue(waitForProfileConnect());
+ assertNotNull(mBluetoothVolumeControl);
+
+ mTestDevice = mAdapter.getRemoteDevice("00:11:22:AA:BB:CC");
+ mAudioDescriptionChangedCallbackCalled = false;
+
+ /* Note. This is just for api coverage until proper testing tools are set up */
+ mTestVocsInstanceId = 1;
+ mTestAudioDescription = "test";
+ mTestCallback.onVolumeOffsetAudioDescriptionChanged(
+ mTestDevice,
+ mTestVocsInstanceId,
+ mTestAudioDescription);
+ assertTrue(mAudioDescriptionChangedCallbackCalled);
+ }
+
@RequiresFlagsEnabled(Flags.FLAG_LEAUDIO_BROADCAST_VOLUME_CONTROL_FOR_CONNECTED_DEVICES)
@Test
public void deviceVolumeChangedCallback() {
@@ -349,6 +452,8 @@
assertEquals(BluetoothProfile.CONNECTION_POLICY_FORBIDDEN,
mBluetoothVolumeControl.getConnectionPolicy(null));
+ enforceConnectAndPrivileged(() -> mBluetoothVolumeControl.getConnectionPolicy(testDevice));
+
assertTrue(BTAdapterUtils.disableAdapter(mAdapter, mContext));
// Verify returns false if bluetooth is not enabled
@@ -370,6 +475,8 @@
assertFalse(mBluetoothVolumeControl.setConnectionPolicy(
null, BluetoothProfile.CONNECTION_POLICY_ALLOWED));
+ enforceConnectAndPrivileged(() -> mBluetoothVolumeControl
+ .setConnectionPolicy(testDevice, BluetoothProfile.CONNECTION_POLICY_ALLOWED));
assertTrue(BTAdapterUtils.disableAdapter(mAdapter, mContext));
// Verify returns false if bluetooth is not enabled
@@ -390,7 +497,7 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileConnect: interrrupted");
+ Log.e(TAG, "waitForProfileConnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
@@ -410,13 +517,23 @@
} // else spurious wakeups
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForProfileDisconnect: interrrupted");
+ Log.e(TAG, "waitForProfileDisconnect: interrupted");
} finally {
mProfileConnectionlock.unlock();
}
return !mIsProfileReady;
}
+ private void enforceConnectAndPrivileged(ThrowingRunnable runnable) {
+ // Verify throws SecurityException without permission.BLUETOOTH_PRIVILEGED
+ TestUtils.adoptPermissionAsShellUid(BLUETOOTH_CONNECT);
+ assertThrows(SecurityException.class, runnable);
+
+ // Verify throws SecurityException without permission.BLUETOOTH_CONNECT
+ TestUtils.adoptPermissionAsShellUid(BLUETOOTH_PRIVILEGED);
+ assertThrows(SecurityException.class, runnable);
+ }
+
private final class BluetoothVolumeControlServiceListener implements
BluetoothProfile.ServiceListener {
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/ChannelSoundingParamsTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/ChannelSoundingParamsTest.java
new file mode 100644
index 0000000..adc821a
--- /dev/null
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/ChannelSoundingParamsTest.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright (C) 2024 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.bluetooth.cts;
+
+import static android.Manifest.permission.BLUETOOTH_CONNECT;
+import static android.Manifest.permission.BLUETOOTH_PRIVILEGED;
+import static android.bluetooth.BluetoothStatusCodes.FEATURE_SUPPORTED;
+import static android.bluetooth.le.ChannelSoundingParams.CS_SECURITY_LEVEL_ONE;
+import static android.bluetooth.le.ChannelSoundingParams.CS_SECURITY_LEVEL_TWO;
+import static android.bluetooth.le.ChannelSoundingParams.LOCATION_TYPE_UNKNOWN;
+import static android.bluetooth.le.ChannelSoundingParams.LOCATION_TYPE_OUTDOOR;
+import static android.bluetooth.le.ChannelSoundingParams.SIGHT_TYPE_UNKNOWN;
+import static android.bluetooth.le.ChannelSoundingParams.SIGHT_TYPE_LINE_OF_SIGHT;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.le.ChannelSoundingParams;
+import android.content.Context;
+import android.os.Parcel;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import com.android.bluetooth.flags.Flags;
+import com.android.compatibility.common.util.CddTest;
+import com.android.modules.utils.build.SdkLevel;
+
+import org.junit.After;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.function.ThrowingRunnable;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+public class ChannelSoundingParamsTest {
+ private Context mContext;
+ private BluetoothAdapter mAdapter;
+
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule =
+ DeviceFlagsValueProvider.createCheckFlagsRule();
+
+ @Before
+ public void setUp() {
+ mContext = InstrumentationRegistry.getInstrumentation().getContext();
+ Assume.assumeTrue(SdkLevel.isAtLeastV());
+ Assume.assumeTrue(TestUtils.isBleSupported(mContext));
+
+ mAdapter = TestUtils.getBluetoothAdapterOrDie();
+ assertTrue(BTAdapterUtils.enableAdapter(mAdapter, mContext));
+ enforceConnectAndPrivileged(() -> mAdapter.isDistanceMeasurementSupported());
+ TestUtils.adoptPermissionAsShellUid(BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED);
+ Assume.assumeTrue(mAdapter.isDistanceMeasurementSupported() == FEATURE_SUPPORTED);
+ }
+
+ @After
+ public void tearDown() {
+ TestUtils.dropPermissionAsShellUid();
+ mAdapter = null;
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void createFromParcel() {
+ final Parcel parcel = Parcel.obtain();
+ try {
+ ChannelSoundingParams params = new ChannelSoundingParams.Builder()
+ .setSightType(SIGHT_TYPE_LINE_OF_SIGHT)
+ .setLocationType(LOCATION_TYPE_OUTDOOR)
+ .setCsSecurityLevel(CS_SECURITY_LEVEL_TWO)
+ .build();
+ params.writeToParcel(parcel, 0);
+ parcel.setDataPosition(0);
+ ChannelSoundingParams paramsFromParcel =
+ ChannelSoundingParams.CREATOR.createFromParcel(parcel);
+ assertParamsEquals(params, paramsFromParcel);
+ } finally {
+ parcel.recycle();
+ }
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void defaultParameters() {
+ ChannelSoundingParams params = new ChannelSoundingParams.Builder().build();
+ assertEquals(SIGHT_TYPE_UNKNOWN, params.getSightType());
+ assertEquals(LOCATION_TYPE_UNKNOWN, params.getLocationType());
+ assertEquals(CS_SECURITY_LEVEL_ONE, params.getCsSecurityLevel());
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void setGetSightType() {
+ ChannelSoundingParams.Builder builder = new ChannelSoundingParams.Builder();
+ assertThrows(IllegalArgumentException.class, () -> builder.setSightType(-1));
+ ChannelSoundingParams params = builder.setSightType(SIGHT_TYPE_LINE_OF_SIGHT).build();
+ assertEquals(SIGHT_TYPE_LINE_OF_SIGHT, params.getSightType());
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void setGetLocationType() {
+ ChannelSoundingParams.Builder builder = new ChannelSoundingParams.Builder();
+ assertThrows(IllegalArgumentException.class, () -> builder.setLocationType(-1));
+ ChannelSoundingParams params = builder.setLocationType(LOCATION_TYPE_OUTDOOR).build();
+ assertEquals(LOCATION_TYPE_OUTDOOR, params.getLocationType());
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void setGetCsSecurityLevel() {
+ ChannelSoundingParams.Builder builder = new ChannelSoundingParams.Builder();
+ assertThrows(IllegalArgumentException.class, () -> builder.setCsSecurityLevel(-1));
+ ChannelSoundingParams params = builder.setCsSecurityLevel(CS_SECURITY_LEVEL_TWO).build();
+ assertEquals(CS_SECURITY_LEVEL_TWO, params.getCsSecurityLevel());
+ }
+
+ private void assertParamsEquals(ChannelSoundingParams p, ChannelSoundingParams other) {
+ if (p == null && other == null) {
+ return;
+ }
+
+ if (p == null || other == null) {
+ fail("Cannot compare null with non-null value: p=" + p + ", other=" + other);
+ }
+
+ assertEquals(p.getSightType(), other.getSightType());
+ assertEquals(p.getLocationType(), other.getLocationType());
+ assertEquals(p.getCsSecurityLevel(), other.getCsSecurityLevel());
+ }
+
+ private void enforceConnectAndPrivileged(ThrowingRunnable runnable) {
+ // Verify throws SecurityException without permission.BLUETOOTH_PRIVILEGED
+ TestUtils.adoptPermissionAsShellUid(BLUETOOTH_CONNECT);
+ assertThrows(SecurityException.class, runnable);
+
+ // Verify throws SecurityException without permission.BLUETOOTH_CONNECT
+ TestUtils.adoptPermissionAsShellUid(BLUETOOTH_PRIVILEGED);
+ assertThrows(SecurityException.class, runnable);
+ }
+}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementManagerTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementManagerTest.java
index c7b6cd3..88b6536 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementManagerTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementManagerTest.java
@@ -25,6 +25,7 @@
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
+import android.bluetooth.le.ChannelSoundingParams;
import android.bluetooth.le.DistanceMeasurementManager;
import android.bluetooth.le.DistanceMeasurementMethod;
import android.bluetooth.le.DistanceMeasurementParams;
@@ -33,16 +34,21 @@
import android.content.Context;
import android.os.Build;
import android.os.CancellationSignal;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
+import com.android.bluetooth.flags.Flags;
import com.android.compatibility.common.util.ApiLevelUtil;
import com.android.compatibility.common.util.CddTest;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -66,6 +72,10 @@
public void onResult(BluetoothDevice device, DistanceMeasurementResult result) {}
};
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule =
+ DeviceFlagsValueProvider.createCheckFlagsRule();
+
@Before
public void setUp() {
mContext = InstrumentationRegistry.getInstrumentation().getContext();
@@ -107,4 +117,27 @@
List<DistanceMeasurementMethod> list = mDistanceMeasurementManager.getSupportedMethods();
assertNotNull(list);
}
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void getChannelSoundingMaxSupportedSecurityLevel() {
+ int securityLevel =
+ mDistanceMeasurementManager.getChannelSoundingMaxSupportedSecurityLevel(mDevice);
+ assertTrue(isValidSecurityLevel(securityLevel));
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void getLocalChannelSoundingMaxSupportedSecurityLevel() {
+ int securityLevel =
+ mDistanceMeasurementManager.getLocalChannelSoundingMaxSupportedSecurityLevel();
+ assertTrue(isValidSecurityLevel(securityLevel));
+ }
+
+ private boolean isValidSecurityLevel(int securityLevel) {
+ return (securityLevel >= ChannelSoundingParams.CS_SECURITY_LEVEL_UNKNOWN
+ && securityLevel <= ChannelSoundingParams.CS_SECURITY_LEVEL_FOUR);
+ }
}
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementParamsTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementParamsTest.java
index e22d46a..34b3034 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementParamsTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementParamsTest.java
@@ -19,6 +19,9 @@
import static android.Manifest.permission.BLUETOOTH_CONNECT;
import static android.Manifest.permission.BLUETOOTH_PRIVILEGED;
import static android.bluetooth.BluetoothStatusCodes.FEATURE_SUPPORTED;
+import static android.bluetooth.le.ChannelSoundingParams.CS_SECURITY_LEVEL_TWO;
+import static android.bluetooth.le.ChannelSoundingParams.LOCATION_TYPE_OUTDOOR;
+import static android.bluetooth.le.ChannelSoundingParams.SIGHT_TYPE_LINE_OF_SIGHT;
import static android.bluetooth.le.DistanceMeasurementMethod.DISTANCE_MEASUREMENT_METHOD_RSSI;
import static android.bluetooth.le.DistanceMeasurementParams.REPORT_FREQUENCY_HIGH;
import static android.bluetooth.le.DistanceMeasurementParams.REPORT_FREQUENCY_LOW;
@@ -29,20 +32,26 @@
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
+import android.bluetooth.le.ChannelSoundingParams;
import android.bluetooth.le.DistanceMeasurementParams;
import android.content.Context;
import android.os.Build;
import android.os.Parcel;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
+import com.android.bluetooth.flags.Flags;
import com.android.compatibility.common.util.ApiLevelUtil;
import com.android.compatibility.common.util.CddTest;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -52,6 +61,10 @@
private BluetoothAdapter mAdapter;
private BluetoothDevice mDevice;
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule =
+ DeviceFlagsValueProvider.createCheckFlagsRule();
+
@Before
public void setUp() {
mContext = InstrumentationRegistry.getInstrumentation().getContext();
@@ -130,6 +143,40 @@
assertEquals(DISTANCE_MEASUREMENT_METHOD_RSSI, params.getMethodId());
}
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void setGetChannelSoundingParams() {
+ ChannelSoundingParams csParams =
+ new ChannelSoundingParams.Builder().setSightType(SIGHT_TYPE_LINE_OF_SIGHT).build();
+ DistanceMeasurementParams params = new DistanceMeasurementParams.Builder(mDevice)
+ .setChannelSoundingParams(csParams).build();
+ assertEquals(csParams, params.getChannelSoundingParams());
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void readWriteParcelForCs() {
+ Parcel parcel = Parcel.obtain();
+ ChannelSoundingParams csParams = new ChannelSoundingParams.Builder()
+ .setSightType(SIGHT_TYPE_LINE_OF_SIGHT)
+ .setLocationType(LOCATION_TYPE_OUTDOOR)
+ .setCsSecurityLevel(CS_SECURITY_LEVEL_TWO)
+ .build();
+ DistanceMeasurementParams params = new DistanceMeasurementParams.Builder(mDevice)
+ .setChannelSoundingParams(csParams)
+ .build();
+ params.writeToParcel(parcel, 0);
+ parcel.setDataPosition(0);
+ DistanceMeasurementParams paramsFromParcel =
+ DistanceMeasurementParams.CREATOR.createFromParcel(parcel);
+ ChannelSoundingParams csParamsFromParcel = paramsFromParcel.getChannelSoundingParams();
+ assertEquals(csParams.getSightType(), csParamsFromParcel.getSightType());
+ assertEquals(csParams.getLocationType(), csParamsFromParcel.getLocationType());
+ assertEquals(csParams.getCsSecurityLevel(), csParamsFromParcel.getCsSecurityLevel());
+ }
+
private void assertParamsEquals(DistanceMeasurementParams p, DistanceMeasurementParams other) {
if (p == null && other == null) {
return;
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementResultTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementResultTest.java
index 5cdc138..fd80fe2 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementResultTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/DistanceMeasurementResultTest.java
@@ -19,6 +19,7 @@
import static android.Manifest.permission.BLUETOOTH_CONNECT;
import static android.Manifest.permission.BLUETOOTH_PRIVILEGED;
import static android.bluetooth.BluetoothStatusCodes.FEATURE_SUPPORTED;
+import static android.bluetooth.le.DistanceMeasurementResult.NADM_ATTACK_IS_VERY_UNLIKELY;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
@@ -30,16 +31,21 @@
import android.content.Context;
import android.os.Build;
import android.os.Parcel;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
+import com.android.bluetooth.flags.Flags;
import com.android.compatibility.common.util.ApiLevelUtil;
import com.android.compatibility.common.util.CddTest;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -48,6 +54,10 @@
private Context mContext;
private BluetoothAdapter mAdapter;
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule =
+ DeviceFlagsValueProvider.createCheckFlagsRule();
+
@Before
public void setUp() {
mContext = InstrumentationRegistry.getInstrumentation().getContext();
@@ -133,6 +143,71 @@
assertEquals(60.0, result.getErrorAltitudeAngle(), 0.0);
}
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void setGetDelaySpreadMeters() {
+ DistanceMeasurementResult.Builder builder =
+ new DistanceMeasurementResult.Builder(121.0, 120.0);
+ assertThrows(IllegalArgumentException.class, () -> builder.setDelaySpreadMeters(-1));
+ DistanceMeasurementResult result = builder.setDelaySpreadMeters(60).build();
+ assertEquals(60.0, result.getDelaySpreadMeters(), 0.0);
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void setGetConfidenceLevel() {
+ DistanceMeasurementResult.Builder builder =
+ new DistanceMeasurementResult.Builder(121.0, 120.0);
+ assertThrows(IllegalArgumentException.class, () -> builder.setConfidenceLevel(101));
+ DistanceMeasurementResult result = builder.setConfidenceLevel(0.5).build();
+ assertEquals(0.5, result.getConfidenceLevel(), 0.0);
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void setGetDetectedAttackLevel() {
+ DistanceMeasurementResult.Builder builder =
+ new DistanceMeasurementResult.Builder(121.0, 120.0);
+ assertThrows(IllegalArgumentException.class, () -> builder.setDetectedAttackLevel(60));
+ DistanceMeasurementResult result =
+ builder.setDetectedAttackLevel(NADM_ATTACK_IS_VERY_UNLIKELY).build();
+ assertEquals(NADM_ATTACK_IS_VERY_UNLIKELY, result.getDetectedAttackLevel());
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void setGetVelocityMetersPerSecond() {
+ DistanceMeasurementResult result = new DistanceMeasurementResult.Builder(121.0, 120.0)
+ .setVelocityMetersPerSecond(60).build();
+ assertEquals(60.0, result.getVelocityMetersPerSecond(), 0.0);
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_CHANNEL_SOUNDING)
+ @CddTest(requirements = {"7.4.3/C-2-1"})
+ @Test
+ public void readWriteParcelForCs() {
+ Parcel parcel = Parcel.obtain();
+ DistanceMeasurementResult result = new DistanceMeasurementResult.Builder(10.0, 5.0)
+ .setDelaySpreadMeters(20)
+ .setConfidenceLevel(0.5)
+ .setDetectedAttackLevel(NADM_ATTACK_IS_VERY_UNLIKELY)
+ .setVelocityMetersPerSecond(30)
+ .build();
+ result.writeToParcel(parcel, 0);
+ parcel.setDataPosition(0);
+ DistanceMeasurementResult resultFromParcel =
+ DistanceMeasurementResult.CREATOR.createFromParcel(parcel);
+ assertEquals(result.getDelaySpreadMeters(), resultFromParcel.getDelaySpreadMeters(), 0.0);
+ assertEquals(result.getConfidenceLevel(), resultFromParcel.getConfidenceLevel(), 0.0);
+ assertEquals(result.getDetectedAttackLevel(), resultFromParcel.getDetectedAttackLevel());
+ assertEquals(result.getVelocityMetersPerSecond(),
+ resultFromParcel.getVelocityMetersPerSecond(), 0.0);
+ }
+
@CddTest(requirements = {"7.4.3/C-2-1"})
@Test
public void illegalArgument() {
diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/SystemBluetoothTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/SystemBluetoothTest.java
index e2bad42..6f2e37b 100644
--- a/tests/tests/bluetooth/src/android/bluetooth/cts/SystemBluetoothTest.java
+++ b/tests/tests/bluetooth/src/android/bluetooth/cts/SystemBluetoothTest.java
@@ -156,8 +156,11 @@
assertTrue(BTAdapterUtils.enableAdapter(mAdapter, mContext));
if (!TestUtils.isLocationOn(mContext)) {
- TestUtils.enableLocation(mContext);
recoverOffState = true;
+ TestUtils.enableLocation(mContext);
+ mUiAutomation.grantRuntimePermission(
+ "android.bluetooth.cts",
+ android.Manifest.permission.ACCESS_FINE_LOCATION);
}
mDiscoveryStartedLock = new ReentrantLock();
@@ -178,6 +181,9 @@
} finally {
if (recoverOffState) {
TestUtils.disableLocation(mContext);
+ mUiAutomation.revokeRuntimePermission(
+ "android.bluetooth.cts",
+ android.Manifest.permission.ACCESS_FINE_LOCATION);
}
}
}
@@ -439,7 +445,7 @@
}
}
} catch (InterruptedException e) {
- Log.e(TAG, "waitForDiscoveryStart: interrrupted");
+ Log.e(TAG, "waitForDiscoveryStart: interrupted");
} finally {
mDiscoveryStartedLock.unlock();
}
diff --git a/tests/tests/car/src/android/car/app/cts/CarTaskViewControllerTest.java b/tests/tests/car/src/android/car/app/cts/CarTaskViewControllerTest.java
index 73e9557..2cd0c97 100644
--- a/tests/tests/car/src/android/car/app/cts/CarTaskViewControllerTest.java
+++ b/tests/tests/car/src/android/car/app/cts/CarTaskViewControllerTest.java
@@ -51,6 +51,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.test.InstrumentationRegistry;
+import androidx.test.uiautomator.UiDevice;
import com.android.compatibility.common.util.ApiTest;
import com.android.compatibility.common.util.NonApiTest;
@@ -81,6 +82,7 @@
private final ComponentName mTestActivity =
new ComponentName(mTargetContext, TestActivity.class);
private final UiAutomation mUiAutomation = mInstrumentation.getUiAutomation();
+ private final UiDevice mUiDevice = UiDevice.getInstance(mInstrumentation);
@Rule
public final ApiCheckerRule mApiCheckerRule = new ApiCheckerRule.Builder().build();
@@ -103,6 +105,8 @@
assertThat(mCarActivityManager).isNotNull();
assumeTrue(mCarActivityManager.isCarSystemUIProxyRegistered());
+ mUiDevice.pressHome();
+
Intent startIntent = Intent.makeMainActivity(mTestActivity)
.addFlags(FLAG_ACTIVITY_NEW_TASK);
mHostActivity = (TestActivity) mInstrumentation.startActivitySync(
@@ -381,6 +385,7 @@
PollingCheck.waitFor(() -> EmbeddedTestActivity1.sInstance != null
&& EmbeddedTestActivity1.sInstance.mIsResumed,
"EmbeddedTestActivity1 is not running.");
+ mUiDevice.waitForIdle(QUIET_TIME_TO_BE_CONSIDERED_IDLE_STATE);
// EmbeddedTestActivity is on the upper part of the screen.
Point p = getTaskViewCenterOnScreen(carTaskViewHolder.mTaskView);
diff --git a/tests/tests/car/src/android/car/cts/CarOccupantConnectionManagerTest.java b/tests/tests/car/src/android/car/cts/CarOccupantConnectionManagerTest.java
index ea49be4..2c729b4 100644
--- a/tests/tests/car/src/android/car/cts/CarOccupantConnectionManagerTest.java
+++ b/tests/tests/car/src/android/car/cts/CarOccupantConnectionManagerTest.java
@@ -72,6 +72,7 @@
private static final long WAIT_BEFORE_RESPOND_TO_REQUEST_MS = 2_000;
private static final long CALLBACK_TIMEOUT_MS = WAIT_BEFORE_RESPOND_TO_REQUEST_MS + 2_000;
private static final long EXCHANGE_PAYLOAD_TIMEOUT_MS = 10_000;
+ private static final long POLLING_CHECK_TIMEOUT_MS = 3_000;
private static final Payload PAYLOAD1 = new Payload(HexFormat.of().parseHex("1234"));
private static final Payload PAYLOAD2 = new Payload(HexFormat.of().parseHex("5678"));
@@ -114,19 +115,19 @@
"android.car.occupantconnection.CarOccupantConnectionManager#unregisterReceiver",
"android.car.occupantconnection.AbstractReceiverService#getAllReceiverEndpoints",
"android.car.occupantconnection.AbstractReceiverService#onLocalServiceBind"})
- public void testRegisterAndUnregisterReceiver() {
+ public void testRegisterAndUnregisterReceiver() throws Exception {
mOccupantConnectionManager.registerReceiver(RECEIVER_ID, mExecutor,
(senderZone, payload) -> {
});
TestReceiverService receiverService = bindToLocalReceiverServiceAndWait();
- assertWithMessage("Failed to register the receiver").that(
- receiverService.getAllReceiverEndpoints().contains(RECEIVER_ID)).isTrue();
+ PollingCheck.check("Failed to register the receiver", POLLING_CHECK_TIMEOUT_MS,
+ () -> receiverService.getAllReceiverEndpoints().contains(RECEIVER_ID));
mOccupantConnectionManager.unregisterReceiver(RECEIVER_ID);
- assertWithMessage("Failed to unregister the receiver").that(
- receiverService.getAllReceiverEndpoints().isEmpty()).isTrue();
+ PollingCheck.check("Failed to unregister the receiver", POLLING_CHECK_TIMEOUT_MS,
+ () -> receiverService.getAllReceiverEndpoints().isEmpty());
}
@Test
@@ -388,6 +389,7 @@
@Override
public void onReceiverRegistered(String receiverEndpointId) {
+ Log.v(TAG, "onReceiverRegistered:" + receiverEndpointId);
}
@Override
diff --git a/tests/tests/car/src/android/car/cts/CarPropertyManagerTest.java b/tests/tests/car/src/android/car/cts/CarPropertyManagerTest.java
index 292091b..e18ed84 100644
--- a/tests/tests/car/src/android/car/cts/CarPropertyManagerTest.java
+++ b/tests/tests/car/src/android/car/cts/CarPropertyManagerTest.java
@@ -5335,6 +5335,9 @@
.setCarPropertyConfigVerifier(
carPropertyConfig -> {
List<Integer> configArray = carPropertyConfig.getConfigArray();
+ if (configArray.isEmpty()) {
+ return;
+ }
assertWithMessage("HVAC_TEMPERATURE_SET config array must be size 6")
.that(configArray.size())
.isEqualTo(6);
diff --git a/tests/tests/car/src/android/car/cts/utils/VehiclePropertyVerifier.java b/tests/tests/car/src/android/car/cts/utils/VehiclePropertyVerifier.java
index 5bea216..b712c0e 100644
--- a/tests/tests/car/src/android/car/cts/utils/VehiclePropertyVerifier.java
+++ b/tests/tests/car/src/android/car/cts/utils/VehiclePropertyVerifier.java
@@ -942,6 +942,9 @@
}
List<Integer> hvacTemperatureSetConfigArray =
hvacTemperatureSetCarPropertyConfig.getConfigArray();
+ if (hvacTemperatureSetConfigArray.isEmpty()) {
+ return;
+ }
float minTempInCelsius = hvacTemperatureSetConfigArray.get(0).floatValue() / 10f;
float minTempInFahrenheit = hvacTemperatureSetConfigArray.get(3).floatValue() / 10f;
@@ -1659,7 +1662,9 @@
}
List<Integer> hvacTemperatureSetConfigArray =
hvacTemperatureSetCarPropertyConfig.getConfigArray();
-
+ if (hvacTemperatureSetConfigArray.isEmpty()) {
+ return;
+ }
Integer minTempInCelsiusTimesTen =
hvacTemperatureSetConfigArray.get(0);
Integer maxTempInCelsiusTimesTen =
diff --git a/tests/tests/car_builtin/Android.bp b/tests/tests/car_builtin/Android.bp
index 630dd5d..7698e35 100644
--- a/tests/tests/car_builtin/Android.bp
+++ b/tests/tests/car_builtin/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/carrierapi/Android.bp b/tests/tests/carrierapi/Android.bp
index 326df3f..5e19342 100644
--- a/tests/tests/carrierapi/Android.bp
+++ b/tests/tests/carrierapi/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/carrierapi/targetprep/device/Android.bp b/tests/tests/carrierapi/targetprep/device/Android.bp
index 2928903..64fe439 100644
--- a/tests/tests/carrierapi/targetprep/device/Android.bp
+++ b/tests/tests/carrierapi/targetprep/device/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/carrierapi/targetprep/host/Android.bp b/tests/tests/carrierapi/targetprep/host/Android.bp
index a68a459..3c7720b 100644
--- a/tests/tests/carrierapi/targetprep/host/Android.bp
+++ b/tests/tests/carrierapi/targetprep/host/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/colormode/Android.bp b/tests/tests/colormode/Android.bp
index 2a07d99..bfdcc43 100644
--- a/tests/tests/colormode/Android.bp
+++ b/tests/tests/colormode/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_gpu",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/companion/core/src/android/companion/cts/core/AssociateTest.kt b/tests/tests/companion/core/src/android/companion/cts/core/AssociateTest.kt
index 839403e..3bd4e84 100644
--- a/tests/tests/companion/core/src/android/companion/cts/core/AssociateTest.kt
+++ b/tests/tests/companion/core/src/android/companion/cts/core/AssociateTest.kt
@@ -24,8 +24,10 @@
import android.companion.cts.common.SIMPLE_EXECUTOR
import android.platform.test.annotations.AppModeFull
import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.compatibility.common.util.FeatureUtil
import kotlin.test.assertEquals
import kotlin.test.assertIs
+import org.junit.Assume.assumeFalse
import org.junit.Test
import org.junit.runner.RunWith
@@ -42,6 +44,8 @@
@Test
fun test_associate() {
+ assumeFalse(FeatureUtil.isWatch())
+
val request: AssociationRequest = AssociationRequest.Builder()
.build()
val callback = RecordingCallback()
diff --git a/tests/tests/companion/core/src/android/companion/cts/core/DeviceProfilesTest.kt b/tests/tests/companion/core/src/android/companion/cts/core/DeviceProfilesTest.kt
index dff8565..c11cb23 100644
--- a/tests/tests/companion/core/src/android/companion/cts/core/DeviceProfilesTest.kt
+++ b/tests/tests/companion/core/src/android/companion/cts/core/DeviceProfilesTest.kt
@@ -1,5 +1,6 @@
package android.companion.cts.core
+import android.annotation.CallSuper
import android.app.role.RoleManager.ROLE_ASSISTANT
import android.app.role.RoleManager.ROLE_BROWSER
import android.app.role.RoleManager.ROLE_CALL_REDIRECTION
@@ -18,12 +19,14 @@
import android.companion.cts.common.assertEmpty
import android.platform.test.annotations.AppModeFull
import androidx.test.ext.junit.runners.AndroidJUnit4
-import org.junit.Test
-import org.junit.runner.RunWith
+import com.android.compatibility.common.util.FeatureUtil
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertIs
import kotlin.test.assertNotNull
+import org.junit.Assume.assumeFalse
+import org.junit.Test
+import org.junit.runner.RunWith
/**
* Test CDM device profiles.
@@ -38,6 +41,14 @@
@AppModeFull(reason = "CompanionDeviceManager APIs are not available to the instant apps.")
@RunWith(AndroidJUnit4::class)
class DeviceProfilesTest : CoreTestBase() {
+
+ @CallSuper
+ override fun setUp() {
+ super.setUp()
+
+ assumeFalse(FeatureUtil.isWatch())
+ }
+
/** Test that all supported device profiles require a permission. */
@Test
fun test_supportedProfiles() {
@@ -123,4 +134,4 @@
""
)
}
-}
\ No newline at end of file
+}
diff --git a/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/AssociationRevokedTest.kt b/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/AssociationRevokedTest.kt
index b37014a..27bb489 100644
--- a/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/AssociationRevokedTest.kt
+++ b/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/AssociationRevokedTest.kt
@@ -20,6 +20,7 @@
import android.companion.AssociationRequest.DEVICE_PROFILE_WATCH
import android.companion.cts.common.sleepFor
import android.platform.test.annotations.AppModeFull
+import com.android.compatibility.common.util.FeatureUtil
import kotlin.test.assertContains
import kotlin.test.assertFalse
import kotlin.test.fail
@@ -36,6 +37,21 @@
@AppModeFull(reason = "CompanionDeviceManager APIs are not available to the instant apps.")
class AssociationRevokedTest : AssociationRevokedTestBase() {
+ override fun setUp() {
+ // The CompanionDeviceManager app is not available on Wear.
+ assumeFalse("Skipping test for wear devices", FeatureUtil.isWatch())
+
+ super.setUp()
+ }
+
+ override fun tearDown() {
+ if (FeatureUtil.isWatch()) {
+ return
+ }
+
+ super.tearDown()
+ }
+
@Test
fun test_disassociate_app_should_not_crash() = with(associationApp) {
// Launch the test app with the user consent dialog.
diff --git a/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/ForceCancelConfirmationTest.kt b/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/ForceCancelConfirmationTest.kt
index 900f519..d0ff4c7 100644
--- a/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/ForceCancelConfirmationTest.kt
+++ b/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/ForceCancelConfirmationTest.kt
@@ -22,9 +22,11 @@
import android.os.SystemClock
import android.platform.test.annotations.AppModeFull
import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.compatibility.common.util.FeatureUtil
import kotlin.test.assertContentEquals
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
+import org.junit.Assume.assumeFalse
import org.junit.Test
import org.junit.runner.RunWith
@@ -38,6 +40,21 @@
@RunWith(AndroidJUnit4::class)
class ForceCancelConfirmationTest : UiAutomationTestBase(null, null) {
+ override fun setUp() {
+ // The CompanionDeviceManager app is not available on Wear.
+ assumeFalse("Skipping test for wear devices", FeatureUtil.isWatch())
+
+ super.setUp()
+ }
+
+ override fun tearDown() {
+ if (FeatureUtil.isWatch()) {
+ return
+ }
+
+ super.tearDown()
+ }
+
@Test
fun test_cancel_confirmation() {
sendRequestAndLaunchConfirmation(singleDevice = true)
diff --git a/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/RequestNotificationsTest.kt b/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/RequestNotificationsTest.kt
index b728a40..94c8ef5 100644
--- a/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/RequestNotificationsTest.kt
+++ b/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/RequestNotificationsTest.kt
@@ -18,10 +18,11 @@
import android.companion.cts.common.MAC_ADDRESS_A
import android.content.ComponentName
-import android.content.pm.PackageManager.FEATURE_AUTOMOTIVE
import android.platform.test.annotations.AppModeFull
import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.compatibility.common.util.FeatureUtil
import kotlin.test.assertFailsWith
+import org.junit.Assume.assumeFalse
import org.junit.Test
import org.junit.runner.RunWith
@@ -34,7 +35,6 @@
@AppModeFull(reason = "CompanionDeviceManager APIs are not available to the instant apps.")
@RunWith(AndroidJUnit4::class)
class RequestNotificationsTest : UiAutomationTestBase(null, null) {
- private val isAuto: Boolean by lazy { pm.hasSystemFeature(FEATURE_AUTOMOTIVE) }
@Test
fun test_requestNotifications() {
@@ -48,14 +48,25 @@
cdm.requestNotificationAccess(
ComponentName(instrumentation.targetContext, NotificationListener::class.java))
- if (isAuto) {
+ if (FeatureUtil.isAutomotive()) {
confirmationUi.waitUntilNotificationVisible(isAuto = true)
} else {
confirmationUi.waitUntilNotificationVisible()
}
}
+ override fun setUp() {
+ // The CompanionDeviceManager app is not available on Wear.
+ assumeFalse("Skipping test for wear devices", FeatureUtil.isWatch())
+
+ super.setUp()
+ }
+
override fun tearDown() {
+ if (FeatureUtil.isWatch()) {
+ return
+ }
+
uiDevice.pressBack()
super.tearDown()
}
diff --git a/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/SystemDataTransferTest.kt b/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/SystemDataTransferTest.kt
index a540bf3..2a9f043 100644
--- a/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/SystemDataTransferTest.kt
+++ b/tests/tests/companion/uiautomation/src/android/companion/cts/uiautomation/SystemDataTransferTest.kt
@@ -28,10 +28,12 @@
import android.os.OutcomeReceiver
import android.platform.test.annotations.AppModeFull
import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.compatibility.common.util.FeatureUtil
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.PipedInputStream
import java.io.PipedOutputStream
+import java.lang.IllegalStateException
import java.nio.ByteBuffer
import java.nio.charset.StandardCharsets
import java.util.concurrent.CountDownLatch
@@ -40,9 +42,13 @@
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.atomic.AtomicReference
import kotlin.test.assertEquals
+import kotlin.test.assertFalse
import kotlin.test.assertNotNull
import kotlin.test.assertTrue
import libcore.util.EmptyArray
+import org.junit.Assume.assumeFalse
+import org.junit.Assume.assumeTrue
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
@@ -56,11 +62,27 @@
class SystemDataTransferTest : UiAutomationTestBase(null, null) {
companion object {
private const val SYSTEM_DATA_TRANSFER_TIMEOUT = 10L // 10 seconds
+
+ private const val ACTION_CLICK_ALLOW = 1
+ private const val ACTION_CLICK_DISALLOW = 2
+ private const val ACTION_PRESS_BACK = 3
}
@CallSuper
override fun setUp() {
super.setUp()
+
+ assumeFalse(FeatureUtil.isWatch())
+
+ // Assume Permission Transfer is enabled, otherwise skip the test.
+ try {
+ val association = associate()
+ cdm.buildPermissionTransferUserConsentIntent(association.id)
+ true
+ } catch (e: UnsupportedOperationException) {
+ false
+ }.apply { assumeTrue("This test requires Permission Transfer to be enabled.", this) }
+
withShellPermissionIdentity(MANAGE_COMPANION_DEVICES) {
cdm.enableSecureTransport(false)
}
@@ -75,92 +97,58 @@
}
@Test
- fun test_userConsentDialogAllowed() {
- val association1 = associate()
+ fun test_userConsent_allow() {
+ val association = associate()
- // First time request permission transfer should prompt a dialog
- val pendingUserConsent = cdm.buildPermissionTransferUserConsentIntent(association1.id)
- assertNotNull(pendingUserConsent)
- CompanionActivity.startIntentSender(pendingUserConsent)
- confirmationUi.waitUntilSystemDataTransferConfirmationVisible()
- confirmationUi.clickPositiveButton()
- val (resultCode: Int, _: Intent?) = CompanionActivity.waitForActivityResult()
+ val resultCode = requestPermissionTransferUserConsent(association.id, ACTION_CLICK_ALLOW)
+
assertEquals(expected = RESULT_OK, actual = resultCode)
-
- // Second time request permission transfer should get non null IntentSender
- val pendingUserConsent2 = cdm.buildPermissionTransferUserConsentIntent(association1.id)
- assertNotNull(pendingUserConsent2)
-
- // disassociate() should clean up the requests
- cdm.disassociate(association1.id)
- Thread.sleep(2_100)
- val association2 = associate()
- val pendingUserConsent3 = cdm.buildPermissionTransferUserConsentIntent(association2.id)
- assertNotNull(pendingUserConsent3)
}
@Test
- fun test_userConsentDialogDisallowed() {
- val association1 = associate()
+ fun test_userConsent_disallow() {
+ val association = associate()
- // First time request permission transfer should prompt a dialog
- val pendingUserConsent = cdm.buildPermissionTransferUserConsentIntent(association1.id)
- assertNotNull(pendingUserConsent)
- CompanionActivity.startIntentSender(pendingUserConsent)
- confirmationUi.waitUntilSystemDataTransferConfirmationVisible()
- confirmationUi.clickNegativeButton()
- val (resultCode: Int, _: Intent?) = CompanionActivity.waitForActivityResult()
+ val resultCode = requestPermissionTransferUserConsent(
+ association.id,
+ ACTION_CLICK_DISALLOW
+ )
+
+ assertEquals(expected = RESULT_CANCELED, actual = resultCode)
+ }
+
+ @Test
+ fun test_userConsent_cancel() {
+ val association = associate()
+
+ requestPermissionTransferUserConsent(association.id, ACTION_PRESS_BACK)
+ }
+
+ @Test
+ fun test_userConsent_allowThenDisallow() {
+ val association = associate()
+
+ val resultCode = requestPermissionTransferUserConsent(association.id, ACTION_CLICK_ALLOW)
+
+ assertEquals(expected = RESULT_OK, actual = resultCode)
+
+ val resultCode2 = requestPermissionTransferUserConsent(
+ association.id,
+ ACTION_CLICK_DISALLOW
+ )
+ assertEquals(expected = RESULT_CANCELED, actual = resultCode2)
+ }
+
+ @Test
+ fun test_userConsent_disallowThenAllow() {
+ val association = associate()
+
+ val resultCode = requestPermissionTransferUserConsent(association.id, ACTION_CLICK_DISALLOW)
+
assertEquals(expected = RESULT_CANCELED, actual = resultCode)
- // Second time request permission transfer should get non null IntentSender
- val pendingUserConsent2 = cdm.buildPermissionTransferUserConsentIntent(association1.id)
- assertNotNull(pendingUserConsent2)
-
- // disassociate() should clean up the requests
- cdm.disassociate(association1.id)
- Thread.sleep(2_100)
- val association2 = associate()
- val pendingUserConsent3 = cdm.buildPermissionTransferUserConsentIntent(association2.id)
- assertNotNull(pendingUserConsent3)
- }
-
- @Test
- fun test_userConsentDialogCanceled() {
- val association1 = associate()
-
- // First time request permission transfer should prompt a dialog
- val pendingUserConsent = cdm.buildPermissionTransferUserConsentIntent(association1.id)
- assertNotNull(pendingUserConsent)
- CompanionActivity.startIntentSender(pendingUserConsent)
- confirmationUi.waitUntilSystemDataTransferConfirmationVisible()
- uiDevice.pressBack()
-
- // Second time request permission transfer should prompt a dialog
- val pendingUserConsent2 = cdm.buildPermissionTransferUserConsentIntent(association1.id)
- assertNotNull(pendingUserConsent2)
- }
-
- @Test
- fun test_userConsentDialogAllowedAndThenDisallowed() {
- val association1 = associate()
-
- // First time request permission transfer should prompt a dialog
- val pendingUserConsent = cdm.buildPermissionTransferUserConsentIntent(association1.id)
- assertNotNull(pendingUserConsent)
- CompanionActivity.startIntentSender(pendingUserConsent)
- confirmationUi.waitUntilSystemDataTransferConfirmationVisible()
- confirmationUi.clickPositiveButton()
- val (resultCode: Int, _: Intent?) = CompanionActivity.waitForActivityResult()
- assertEquals(expected = RESULT_OK, actual = resultCode)
-
- // Second time request permission transfer should prompt a dialog
- val pendingUserConsent2 = cdm.buildPermissionTransferUserConsentIntent(association1.id)
- assertNotNull(pendingUserConsent2)
- CompanionActivity.startIntentSender(pendingUserConsent2)
- confirmationUi.waitUntilSystemDataTransferConfirmationVisible()
- confirmationUi.clickNegativeButton()
- val (resultCode2: Int, _: Intent?) = CompanionActivity.waitForActivityResult()
- assertEquals(expected = RESULT_CANCELED, actual = resultCode2)
+ val resultCode2 = requestPermissionTransferUserConsent(association.id, ACTION_CLICK_ALLOW)
+ assertEquals(expected = RESULT_OK, actual = resultCode2)
}
/**
@@ -183,9 +171,10 @@
* response from the device whose permissions are being restored.
*/
@Test
+ @Ignore("b/324260135")
fun test_startSystemDataTransfer_success() {
val association = associate()
- requestPermissionTransferUserConsent(association.id)
+ requestPermissionTransferUserConsent(association.id, ACTION_CLICK_ALLOW)
// Generate data packet with successful response
val response = generatePacket(MESSAGE_RESPONSE_SUCCESS, "SUCCESS")
@@ -197,9 +186,10 @@
* from the device whose permissions are being restored.
*/
@Test(expected = CompanionException::class)
+ @Ignore("b/324260135")
fun test_startSystemDataTransfer_failure() {
val association = associate()
- requestPermissionTransferUserConsent(association.id)
+ requestPermissionTransferUserConsent(association.id, ACTION_CLICK_ALLOW)
// Generate data packet with failure as response
val response = generatePacket(MESSAGE_RESPONSE_FAILURE, "FAILURE")
@@ -213,6 +203,8 @@
*/
@Test
fun test_receivePermissionRestore() {
+ assumeTrue(FeatureUtil.isWatch())
+
val association = associate()
// Generate data packet with permission restore request
@@ -265,12 +257,21 @@
* Execute UI flow to request user consent for permission transfer for a given association
* and grant permission.
*/
- private fun requestPermissionTransferUserConsent(associationId: Int) {
+ private fun requestPermissionTransferUserConsent(associationId: Int, action: Int): Int {
val pendingUserConsent = cdm.buildPermissionTransferUserConsentIntent(associationId)
CompanionActivity.startIntentSender(pendingUserConsent!!)
confirmationUi.waitUntilSystemDataTransferConfirmationVisible()
- confirmationUi.clickPositiveButton()
- CompanionActivity.waitForActivityResult()
+ when (action) {
+ ACTION_CLICK_ALLOW -> confirmationUi.clickPositiveButton()
+ ACTION_CLICK_DISALLOW -> confirmationUi.clickNegativeButton()
+ ACTION_PRESS_BACK -> {
+ uiDevice.pressBack()
+ return -100 // an invalid result code which shouldn't be checked against
+ }
+ else -> throw IllegalStateException("Unknown action.")
+ }
+ val (resultCode: Int, _: Intent?) = CompanionActivity.waitForActivityResult()
+ return resultCode
}
/**
diff --git a/tests/tests/contactkeysprovider/OWNERS b/tests/tests/contactkeysprovider/OWNERS
new file mode 100644
index 0000000..a35490d
--- /dev/null
+++ b/tests/tests/contactkeysprovider/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 1487500
+
+smakarov@google.com
+anhph@google.com
diff --git a/tests/tests/content/Android.bp b/tests/tests/content/Android.bp
index 4477388..b4af033 100644
--- a/tests/tests/content/Android.bp
+++ b/tests/tests/content/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/BinderPermissionTestService/Android.bp b/tests/tests/content/BinderPermissionTestService/Android.bp
index 8ba2432..18790a9 100644
--- a/tests/tests/content/BinderPermissionTestService/Android.bp
+++ b/tests/tests/content/BinderPermissionTestService/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -37,5 +38,5 @@
dex_preopt: {
enabled: false,
},
- min_sdk_version: "29"
+ min_sdk_version: "29",
}
diff --git a/tests/tests/content/CtsSyncAccountAccessOtherCertTests/Android.bp b/tests/tests/content/CtsSyncAccountAccessOtherCertTests/Android.bp
index cc9fb0f..c24d876 100644
--- a/tests/tests/content/CtsSyncAccountAccessOtherCertTests/Android.bp
+++ b/tests/tests/content/CtsSyncAccountAccessOtherCertTests/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/CtsSyncAccountAccessOtherCertTests/src/com/android/cts/content/CtsSyncAccountAccessOtherCertTestCases.java b/tests/tests/content/CtsSyncAccountAccessOtherCertTests/src/com/android/cts/content/CtsSyncAccountAccessOtherCertTestCases.java
index e5c9ac0..721c0b6 100644
--- a/tests/tests/content/CtsSyncAccountAccessOtherCertTests/src/com/android/cts/content/CtsSyncAccountAccessOtherCertTestCases.java
+++ b/tests/tests/content/CtsSyncAccountAccessOtherCertTests/src/com/android/cts/content/CtsSyncAccountAccessOtherCertTestCases.java
@@ -28,6 +28,7 @@
import static com.android.cts.content.Utils.withAccount;
import static org.junit.Assume.assumeFalse;
+import static org.junit.Assume.assumeNotNull;
import static org.junit.Assume.assumeTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.never;
@@ -46,6 +47,7 @@
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import androidx.test.uiautomator.By;
+import androidx.test.uiautomator.Direction;
import androidx.test.uiautomator.UiDevice;
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.UiObjectNotFoundException;
@@ -113,15 +115,11 @@
UiDevice uiDevice = getUiDevice();
if (uiDevice.openNotification()) {
Thread.sleep(1000);
- for (int i = 0; i < 5; i++) {
- final UiObject2 clear = uiDevice
- .wait(Until.findObject(By.text("Clear all")), 2000);
- if (clear != null) {
- clear.click();
- break;
- }
- scrollNotifications();
- }
+ UiObject2 scrollable = uiDevice.findObject(By.scrollable(true));
+ UiObject2 clear =
+ scrollable.scrollUntil(Direction.DOWN, Until.findObject(By.text("Clear all")));
+ assumeNotNull(clear);
+ clear.click();
}
try (AutoCloseable ignored = withAccount(activity.getActivity())) {
diff --git a/tests/tests/content/DirectBootUnawareTestApp/Android.bp b/tests/tests/content/DirectBootUnawareTestApp/Android.bp
index 8c35eb4..b68647b 100644
--- a/tests/tests/content/DirectBootUnawareTestApp/Android.bp
+++ b/tests/tests/content/DirectBootUnawareTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/HelloWorldApp/Android.bp b/tests/tests/content/HelloWorldApp/Android.bp
index 5b0c557..b70eade 100644
--- a/tests/tests/content/HelloWorldApp/Android.bp
+++ b/tests/tests/content/HelloWorldApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/HelloWorldApp/src_verifier/com/example/helloverifier/DelayedRejectReceiver.java b/tests/tests/content/HelloWorldApp/src_verifier/com/example/helloverifier/DelayedRejectReceiver.java
index 51fb2ab..0086cef 100644
--- a/tests/tests/content/HelloWorldApp/src_verifier/com/example/helloverifier/DelayedRejectReceiver.java
+++ b/tests/tests/content/HelloWorldApp/src_verifier/com/example/helloverifier/DelayedRejectReceiver.java
@@ -38,10 +38,12 @@
// Allow after 30secs.
context.getPackageManager().extendVerificationTimeout(id, PackageManager.VERIFICATION_ALLOW,
30000);
+ final PendingResult pendingResult = goAsync();
// Reject after 15secs.
(new Handler(context.getMainLooper())).postDelayed(() -> {
context.getPackageManager().verifyPendingInstall(id,
PackageManager.VERIFICATION_REJECT);
+ pendingResult.finish();
}, 15000);
}
}
diff --git a/tests/tests/content/IntentResolutionTestApp/Android.bp b/tests/tests/content/IntentResolutionTestApp/Android.bp
index 79c7538..6353ce9 100644
--- a/tests/tests/content/IntentResolutionTestApp/Android.bp
+++ b/tests/tests/content/IntentResolutionTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/MockLauncherApp/Android.bp b/tests/tests/content/MockLauncherApp/Android.bp
index 050dab1..6ef804c 100644
--- a/tests/tests/content/MockLauncherApp/Android.bp
+++ b/tests/tests/content/MockLauncherApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/MockRestrictedApp/Android.bp b/tests/tests/content/MockRestrictedApp/Android.bp
index 2e8e331..52acd37 100644
--- a/tests/tests/content/MockRestrictedApp/Android.bp
+++ b/tests/tests/content/MockRestrictedApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/NonExportedComponentsTest/Android.bp b/tests/tests/content/NonExportedComponentsTest/Android.bp
index 75d536b..406e65f 100644
--- a/tests/tests/content/NonExportedComponentsTest/Android.bp
+++ b/tests/tests/content/NonExportedComponentsTest/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/OWNERS b/tests/tests/content/OWNERS
index f19e457..fa0777e 100644
--- a/tests/tests/content/OWNERS
+++ b/tests/tests/content/OWNERS
@@ -1,11 +1,12 @@
# Bug component: 36137
include platform/frameworks/base:/OWNERS
include platform/frameworks/base:/core/java/android/content/OWNERS
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
alexbuy@google.com
-chiuwinson@google.com
patb@google.com
schfan@google.com
zyy@google.com
per-file ContextTest.java = jacobhobbie@google.com,mpgroover@google.com
per-file ClipboardAutoClearTest.java = olekarg@google.com,ashfall@google.com
+per-file ActivityRequireContentUriPermissionFromCallerTest.java = mpgroover@google.com,azharaa@google.com
diff --git a/tests/tests/content/PackagePropertyTestApp/Android.bp b/tests/tests/content/PackagePropertyTestApp/Android.bp
index ae60f01..9f6748e 100644
--- a/tests/tests/content/PackagePropertyTestApp/Android.bp
+++ b/tests/tests/content/PackagePropertyTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/PartiallyDirectBootAwareTestApp/Android.bp b/tests/tests/content/PartiallyDirectBootAwareTestApp/Android.bp
index c211c0c..262fade 100644
--- a/tests/tests/content/PartiallyDirectBootAwareTestApp/Android.bp
+++ b/tests/tests/content/PartiallyDirectBootAwareTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -26,5 +27,5 @@
"cts",
"general-tests",
],
- min_sdk_version : "29"
+ min_sdk_version: "29",
}
diff --git a/tests/tests/content/SyncAccountAccessStubs/Android.bp b/tests/tests/content/SyncAccountAccessStubs/Android.bp
index 5bfd89c..b449849 100644
--- a/tests/tests/content/SyncAccountAccessStubs/Android.bp
+++ b/tests/tests/content/SyncAccountAccessStubs/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/TestInstallerApp/Android.bp b/tests/tests/content/TestInstallerApp/Android.bp
index 65b65c7..17a20d5 100644
--- a/tests/tests/content/TestInstallerApp/Android.bp
+++ b/tests/tests/content/TestInstallerApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/emptytestapp/Android.bp b/tests/tests/content/emptytestapp/Android.bp
index 144248d..71868f4 100644
--- a/tests/tests/content/emptytestapp/Android.bp
+++ b/tests/tests/content/emptytestapp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/emptytestapp/AndroidManifestLongUsesPermissionName.xml b/tests/tests/content/emptytestapp/AndroidManifestLongUsesPermissionName.xml
index 25071b8..be38b74 100644
--- a/tests/tests/content/emptytestapp/AndroidManifestLongUsesPermissionName.xml
+++ b/tests/tests/content/emptytestapp/AndroidManifestLongUsesPermissionName.xml
@@ -18,6 +18,6 @@
package="android.content.cts.emptytestapp.longusespermission">
<!-- Test that apks with a long name in <uses-permission> could not be installed successfully.
The maximum size of the name is 512. -->
- <uses-permission android:name="p05Ok3DDwKRRaaJTglSJ1b8CApMKVpqhs8MJioRQcDEslzBIFS8ArsT8IwByiTC1ArGiA3bi49pGwKDVzYJEluxHNJukCM7xamCByVrtGo0r93eVa3tPriVkCYe01Vxrmg9tkWThStdLAbgBOT4tNI3pP6NHAsiSie4CfrCWkc5IloeCYKBp05Ok3DDwKRRaaJTglSJ1b8CApMKVpqhs8MJioRQcDEslzBIFS8ArsT8IwByiTC1ArGiA3bi49pGwKDVzYJEluxHNJukCM7xamCByVrtGo0r93eVa3tPriVkCYe01Vxrmg9tkWThStdLAbgBOT4tNI3pP6NHAsiSie4CfrCWkc5IloeCY27jEBRNRG3ozwBsGr1sVIM9U0bVTI2TdyIyeRkZgW4JrJefwNIBAmCg4AzqXiCvG6JjqA0uTCWSFu2YqAVxVdiRKAay19k5VFlSaM7QW9uhvlrLQqsTW01ofFzxNDbp2QfIFHZR6rebKzKBz6byQFM0DYQnYMwFWXjWkMPNdqkRLykoFLyBup53G68k2n8w" />
+ <uses-permission android:name="p05Ok3DDwKRRaaJTglSJ1b8CApMKVpqhs8MJioRQcDEslzBIFS8ArsT8IwByiTC1ArGiA3bi49pGwKDVzYJEluxHNJukCM7xamCByVrtGo0r93eVa3tPriVkCYe01Vxrmg9tkWThStdLAbgBOT4tNI3pP6NHAsiSie4CfrCWkc5IloeCYKBp05Ok3DDwKRRaaJTglSJ1b8CApMKVpqhs8MJioRQcDEslzBIFS8ArsT8IwByiTC1ArGiA3bi49pGwKDVzYJEluxHNJukCM7xamCByVrtGo0r93eVa3tPriVkCYe01Vxrmg9tkWThStdLAbgBOT4tNI3pP6NHAsiSie4CfrCWkc5IloeCY27jEBRNRG3ozwBsGr1sVIM9U0bVTI2TdyIyeRkZgW4JrJefwNIBAmCg4AzqXiCvG6JjqA0uTCWSFu2YqAVxVdiRKAay19k5VFlSaM7QW9uhvlrLQqsTW01ofFzxNDbp2QfIFHZR6rebKzKBz6byQFM0DYQnYMwFWXjWkMPNdqkRLykoFLyBup53G68k2n8wp05Ok3DDwKRRaaJTglSJ1b8CApMKVpqhs8MJioRQcDEslzBIFS8ArsT8IwByiTC1ArGiA3bi49pGwKDVzYJEluxHNJukCM7xamCByVrtGo0r93eVa3tPriVkCYe01Vxrmg9tkWThStdLAbgBOT4tNI3pP6NHAsiSie4CfrCWkc5IloeCYKBp05Ok3DDwKRRaaJTglSJ1b8CApMKVpqhs8MJioRQcDEslzBIFS8ArsT8IwByiTC1ArGiA3bi49pGwKDVzYJEluxHNJukCM7xamCByVrtGo0r93eVa3tPriVkCYe01Vxrmg9tkWThStdLAbgBOT4tNI3pP6NHAsiSie4CfrCWkc5IloeCY27jEBRNRG3ozwBsGr1sVIM9U0bVTI2TdyIyeRkZgW4JrJefwNIBAmCg4AzqXiCvG6JjqA0uTCWSFu2YqAVxVdiRKAay19k5VFlSaM7QW9uhvlrLQqsTW01ofFd" />
<application android:hasCode="false" android:label="Empty Test App" />
</manifest>
\ No newline at end of file
diff --git a/tests/tests/content/jni/Android.bp b/tests/tests/content/jni/Android.bp
index 3e8aeb8..045d78e 100644
--- a/tests/tests/content/jni/Android.bp
+++ b/tests/tests/content/jni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/lib/accountaccess/Android.bp b/tests/tests/content/lib/accountaccess/Android.bp
index 8950add..794bd33 100644
--- a/tests/tests/content/lib/accountaccess/Android.bp
+++ b/tests/tests/content/lib/accountaccess/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/content/pm/OWNERS b/tests/tests/content/pm/OWNERS
index 941653d..3a6f03b 100644
--- a/tests/tests/content/pm/OWNERS
+++ b/tests/tests/content/pm/OWNERS
@@ -1,4 +1,4 @@
# Bug component: 36137
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
-toddke@google.com
-narayan@google.com
diff --git a/tests/tests/content/pm/SecureFrp/Android.bp b/tests/tests/content/pm/SecureFrp/Android.bp
index 8117dab..4ae7e31 100644
--- a/tests/tests/content/pm/SecureFrp/Android.bp
+++ b/tests/tests/content/pm/SecureFrp/Android.bp
@@ -13,13 +13,14 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
android_test {
name: "CtsSecureFrpInstallTestCases",
- srcs: ["src/**/*.java"],
+ srcs: ["src/**/*.java"],
static_libs: [
"androidx.test.rules",
diff --git a/tests/tests/content/src/android/content/pm/cts/PackageManagerTest.java b/tests/tests/content/src/android/content/pm/cts/PackageManagerTest.java
index 97c9237..eec9ba0 100644
--- a/tests/tests/content/src/android/content/pm/cts/PackageManagerTest.java
+++ b/tests/tests/content/src/android/content/pm/cts/PackageManagerTest.java
@@ -2011,13 +2011,9 @@
@Test
public void testInstall_withLongUsesPermissionName_fail() {
- String expectedErrorCode = "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED";
- String expectedErrorMessage = "The name in the <uses-permission> is greater than 512";
-
+ String expectedErrorCode = "INSTALL_PARSE_FAILED";
String installResult = installPackageWithResult(LONG_USES_PERMISSION_NAME_APK);
-
- assertThat(installResult.contains(expectedErrorCode)).isTrue();
- assertThat(installResult.contains(expectedErrorMessage)).isTrue();
+ assertThat(installResult).contains(expectedErrorCode);
}
private String installPackageWithResult(String apkPath) {
diff --git a/tests/tests/debuggerd/Android.bp b/tests/tests/debuggerd/Android.bp
new file mode 100644
index 0000000..8e80f73
--- /dev/null
+++ b/tests/tests/debuggerd/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2024 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 {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_binary {
+ name: "debuggerd_cts_crasher",
+ srcs: ["debuggerd_cts_crasher.cpp"],
+ compile_multilib: "both",
+ multilib: {
+ lib32: {
+ suffix: "32",
+ },
+ lib64: {
+ suffix: "64",
+ },
+ },
+}
diff --git a/tests/tests/debuggerd/OWNERS b/tests/tests/debuggerd/OWNERS
new file mode 100644
index 0000000..3b2b536
--- /dev/null
+++ b/tests/tests/debuggerd/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 119452
+include platform/system/core:/OWNERS
+include platform/system/core:/debuggerd/OWNERS
diff --git a/tests/tests/debuggerd/TEST_MAPPING b/tests/tests/debuggerd/TEST_MAPPING
new file mode 100644
index 0000000..cadc6cd
--- /dev/null
+++ b/tests/tests/debuggerd/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+ "postsubmit": [
+ {
+ "name": "CtsCrashDetailHostTestCases"
+ }
+ ]
+}
diff --git a/tests/tests/debuggerd/debuggerd_cts_crasher.cpp b/tests/tests/debuggerd/debuggerd_cts_crasher.cpp
new file mode 100644
index 0000000..72901d4
--- /dev/null
+++ b/tests/tests/debuggerd/debuggerd_cts_crasher.cpp
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2024 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 <android/crash_detail.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <string>
+
+inline crash_detail_t* _Nullable android_crash_detail_register_strs(const char* _Nonnull name,
+ const char* _Nonnull data) {
+ return android_crash_detail_register(name, strlen(name), data, strlen(data));
+}
+
+int main(int argc, char** argv) {
+ if (argc < 2) {
+ return 1;
+ }
+ if (strcmp(argv[1], "crash_without_crash_detail") == 0) {
+ abort();
+ }
+ if (strcmp(argv[1], "crash_with_single_crash_detail") == 0) {
+ android_crash_detail_register_strs("crash_detail_name", "crash_detail_data");
+ abort();
+ }
+ if (strcmp(argv[1], "crash_with_multiple_crash_details") == 0) {
+ android_crash_detail_register_strs("crash_detail_name1", "crash_detail_data1");
+ android_crash_detail_register_strs("crash_detail_name2", "crash_detail_data2");
+ abort();
+ }
+ if (strcmp(argv[1], "crash_with_unregistered_crash_details") == 0) {
+ android_crash_detail_register_strs("crash_detail_name1", "crash_detail_data1");
+ android_crash_detail_unregister(
+ android_crash_detail_register_strs("crash_detail_name2", "crash_detail_data2"));
+ abort();
+ }
+ if (strcmp(argv[1], "crash_with_binary_crash_detail") == 0) {
+ android_crash_detail_register("\254\0", 2, "\255\0", 2);
+ abort();
+ }
+ if (strcmp(argv[1], "crash_with_single_crash_detail_many_used") == 0) {
+ for (int i = 0; i < 1000; ++i) {
+ std::string name = "CRASH_DETAIL_NAME" + std::to_string(i);
+ std::string value = "CRASH_DETAIL_VALUE" + std::to_string(i);
+ auto* h = android_crash_detail_register_strs(name.data(), value.data());
+ android_crash_detail_unregister(h);
+ }
+
+ android_crash_detail_register_strs("crash_detail_name", "crash_detail_data");
+ abort();
+ }
+ if (strcmp(argv[1], "crash_with_changing_crash_detail") == 0) {
+ char name[] = "crash_detail_name";
+ char data[] = "crash_detail_data";
+ android_crash_detail_register_strs(name, data);
+ name[0] = 'C';
+ data[0] = 'C';
+ abort();
+ }
+ return 0;
+}
diff --git a/tests/tests/debuggerd/test_crash_detail/Android.bp b/tests/tests/debuggerd/test_crash_detail/Android.bp
new file mode 100644
index 0000000..f984457
--- /dev/null
+++ b/tests/tests/debuggerd/test_crash_detail/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2024 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 {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+java_test_host {
+ name: "CtsCrashDetailHostTestCases",
+ libs: ["tradefed"],
+ static_libs: [
+ "frameworks-base-hostutils",
+ "cts-install-lib-host",
+ "compatibility-host-util",
+ ],
+ srcs: [
+ "src/**/TestCrashDetail.java",
+ ":libtombstone_proto-src",
+ ],
+ data_device_bins_both: ["debuggerd_cts_crasher"],
+ test_config: "AndroidTest.xml",
+ test_suites: [
+ "cts",
+ "general-tests",
+ ],
+}
diff --git a/tests/tests/debuggerd/test_crash_detail/AndroidTest.xml b/tests/tests/debuggerd/test_crash_detail/AndroidTest.xml
new file mode 100644
index 0000000..48c0071
--- /dev/null
+++ b/tests/tests/debuggerd/test_crash_detail/AndroidTest.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2024 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.
+-->
+<configuration description="Runs the crash detail CTS test">
+ <option name="test-suite-tag" value="cts" />
+ <option name="config-descriptor:metadata" key="component" value="systems" />
+ <option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
+ <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
+ <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+
+ <!-- For tombstone inspection. -->
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
+ <option name="cleanup" value="true" />
+ <option name="push" value="debuggerd_cts_crasher->/data/local/tmp/debuggerd_cts_crasher" />
+ <option name="append-bitness" value="true" />
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.HostTest" >
+ <option name="jar" value="CtsCrashDetailHostTestCases.jar" />
+ <!-- 1 minute; on Pixel 8 Pro each test takes around 10 s, adding some margin for
+ slower devices. -->
+ <option name="test-case-timeout" value="60000" />
+ </test>
+</configuration>
diff --git a/tests/tests/debuggerd/test_crash_detail/src/com/android/tests/debuggerd/TestCrashDetail.java b/tests/tests/debuggerd/test_crash_detail/src/com/android/tests/debuggerd/TestCrashDetail.java
new file mode 100644
index 0000000..87ca104
--- /dev/null
+++ b/tests/tests/debuggerd/test_crash_detail/src/com/android/tests/debuggerd/TestCrashDetail.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright (C) 2024 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.tests.init;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import com.android.compatibility.common.util.ApiTest;
+import com.android.server.os.TombstoneProtos.CrashDetail;
+import com.android.server.os.TombstoneProtos.Tombstone;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
+import com.android.tradefed.util.CommandResult;
+
+import com.google.protobuf.ByteString;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
+@ApiTest(apis = {"android_register_crash_detail", "android_unregister_crash_detail"})
+public class TestCrashDetail extends BaseHostJUnit4Test {
+ String mUUID;
+
+ @Before
+ public void setUp() throws Exception {
+ mUUID = java.util.UUID.randomUUID().toString();
+ }
+
+ Tombstone parseTombstone(String tombstonePath) throws Exception {
+ File tombstoneFile = getDevice().pullFile(tombstonePath);
+ InputStream is = new FileInputStream(tombstoneFile);
+ Tombstone tombstoneProto;
+ try {
+ tombstoneProto = Tombstone.parseFrom(is);
+ } finally {
+ is.close();
+ }
+ return tombstoneProto;
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ String[] tombstones = getDevice().getChildren("/data/tombstones");
+ for (String tombstone : tombstones) {
+ if (!tombstone.endsWith(".pb")) {
+ continue;
+ }
+ String tombstonePath = "/data/tombstones/" + tombstone;
+ Tombstone tombstoneProto = parseTombstone(tombstonePath);
+ if (!tombstoneProto.getCommandLineList().stream().anyMatch(x -> x.contains(mUUID))) {
+ continue;
+ }
+ getDevice().deleteFile(tombstonePath);
+ // remove the non .pb file as well.
+ getDevice().deleteFile(tombstonePath.substring(0, tombstonePath.length() - 3));
+ }
+ }
+
+ private Tombstone findTombstone() throws Exception {
+ String[] tombstones = getDevice().getChildren("/data/tombstones");
+ for (String tombstone : tombstones) {
+ if (!tombstone.endsWith(".pb")) {
+ continue;
+ }
+ String tombstonePath = "/data/tombstones/" + tombstone;
+ Tombstone tombstoneProto = parseTombstone(tombstonePath);
+ if (!tombstoneProto.getCommandLineList().stream().anyMatch(x -> x.contains(mUUID))) {
+ continue;
+ }
+ return tombstoneProto;
+ }
+ return null;
+ }
+
+ private Tombstone waitForTombstone() throws Exception {
+ // Tombstoned might take some time to write the tombstone.
+ // Retry until we reach the test case timeout.
+ while (true) {
+ Tombstone tombstoneProto = findTombstone();
+ if (tombstoneProto != null) {
+ return tombstoneProto;
+ }
+ Thread.sleep(2000);
+ }
+ }
+
+ private Tombstone runCrasher(String cmd) throws Exception {
+ // See cts/tests/tests/debuggerd/debuggerd_cts_crasher.cpp
+ CommandResult result =
+ getDevice()
+ .executeShellV2Command(
+ "/data/local/tmp/debuggerd_cts_crasher " + cmd + " " + mUUID);
+ assertThat(result.getExitCode()).isNotEqualTo(0);
+ Tombstone tombstoneProto = waitForTombstone();
+ assertThat(tombstoneProto).isNotNull();
+ return tombstoneProto;
+ }
+
+ private CrashDetail crashDetail(String name, String data) {
+ return CrashDetail.newBuilder()
+ .setName(ByteString.copyFromUtf8(name))
+ .setData(ByteString.copyFromUtf8(data))
+ .build();
+ }
+
+ @Test
+ public void testCrashWithoutCrashDetail() throws Exception {
+ Tombstone tombstoneProto = runCrasher("crash_without_crash_detail");
+
+ assertThat(tombstoneProto.getCrashDetailsList()).isEmpty();
+ }
+
+ @Test
+ public void testCrashWithSingleCrashDetail() throws Exception {
+ Tombstone tombstoneProto = runCrasher("crash_with_single_crash_detail");
+
+ assertThat(tombstoneProto.getCrashDetailsList())
+ .containsExactly(crashDetail("crash_detail_name", "crash_detail_data"));
+ }
+
+ @Test
+ public void testCrashWithMultipleCrashDetails() throws Exception {
+ Tombstone tombstoneProto = runCrasher("crash_with_multiple_crash_details");
+
+ assertThat(tombstoneProto.getCrashDetailsList())
+ .containsExactly(
+ crashDetail("crash_detail_name1", "crash_detail_data1"),
+ crashDetail("crash_detail_name2", "crash_detail_data2"));
+ }
+
+ @Test
+ public void testCrashWithUnregisteredCrashDetails() throws Exception {
+ Tombstone tombstoneProto = runCrasher("crash_with_unregistered_crash_details");
+
+ assertThat(tombstoneProto.getCrashDetailsList())
+ .containsExactly(crashDetail("crash_detail_name1", "crash_detail_data1"));
+ }
+
+ @Test
+ public void testCrashWithBinaryCrashDetail() throws Exception {
+ Tombstone tombstoneProto = runCrasher("crash_with_binary_crash_detail");
+
+ CrashDetail detail =
+ CrashDetail.newBuilder()
+ .setName(ByteString.copyFrom(new byte[] {(byte) 0254, 0}))
+ .setData(ByteString.copyFrom(new byte[] {(byte) 0255, 0}))
+ .build();
+ assertThat(tombstoneProto.getCrashDetailsList()).containsExactly(detail);
+ }
+
+ @Test
+ public void testCrashWithSingleCrashDetailManyUsed() throws Exception {
+ Tombstone tombstoneProto = runCrasher("crash_with_single_crash_detail_many_used");
+
+ assertThat(tombstoneProto.getCrashDetailsList())
+ .containsExactly(crashDetail("crash_detail_name", "crash_detail_data"));
+ }
+
+ @Test
+ public void testCrashWithChangingCrashDetail() throws Exception {
+ Tombstone tombstoneProto = runCrasher("crash_with_changing_crash_detail");
+
+ assertThat(tombstoneProto.getCrashDetailsList())
+ .containsExactly(crashDetail("Crash_detail_name", "Crash_detail_data"));
+ }
+}
diff --git a/tests/tests/deviceconfig/OWNERS b/tests/tests/deviceconfig/OWNERS
index 272b5c4..bc571d4 100644
--- a/tests/tests/deviceconfig/OWNERS
+++ b/tests/tests/deviceconfig/OWNERS
@@ -1,5 +1,4 @@
# Bug component: 326016
-svetoslavganov@google.com
tedbauer@google.com
tejaswiy@google.com
opg@google.com
diff --git a/tests/tests/display/Android.bp b/tests/tests/display/Android.bp
index db8bf6c..05d8244 100644
--- a/tests/tests/display/Android.bp
+++ b/tests/tests/display/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_display_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/display/AndroidManifest.xml b/tests/tests/display/AndroidManifest.xml
index e0f2481..9b895c5 100644
--- a/tests/tests/display/AndroidManifest.xml
+++ b/tests/tests/display/AndroidManifest.xml
@@ -45,6 +45,7 @@
android:exported="true"/>
<activity android:name=".HdrConversionTestActivity" />
<activity android:name=".SimpleActivity" />
+ <activity android:name=".SimpleActivity2" />
</application>
<!-- self-instrumenting test package. -->
diff --git a/tests/tests/display/TEST_MAPPING b/tests/tests/display/TEST_MAPPING
index 86feee2..e13dbcc 100644
--- a/tests/tests/display/TEST_MAPPING
+++ b/tests/tests/display/TEST_MAPPING
@@ -8,10 +8,6 @@
"exclude-filter": "android.display.cts.DisplayManagerTest#testCreateVirtualDisplayFromShell"
},
{
- // TODO(b/184685560)
- "exclude-filter": "android.display.cts.DisplayTest#testRefreshRateSwitchOnSecondaryDisplay"
- },
- {
// TODO(b/270222666)
"exclude-filter": "android.display.cts.VirtualDisplayTest#testVirtualDisplayWithRequestedRefreshRate"
},
diff --git a/tests/tests/display/src/android/display/cts/DisplayEventTest.java b/tests/tests/display/src/android/display/cts/DisplayEventTest.java
index 36339e5..7aeb777 100644
--- a/tests/tests/display/src/android/display/cts/DisplayEventTest.java
+++ b/tests/tests/display/src/android/display/cts/DisplayEventTest.java
@@ -379,11 +379,12 @@
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
mInstrumentation.startActivitySync(intent);
- // Launch Home to bring the test activity into cached mode
- Intent home = new Intent(Intent.ACTION_MAIN);
- home.addCategory(Intent.CATEGORY_HOME);
- home.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- mContext.startActivity(home);
+ // Launch another activity to bring the test activity into cached mode
+ Intent intent2 = new Intent(Intent.ACTION_MAIN);
+ intent2.setClass(mContext, SimpleActivity2.class);
+ intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ mInstrumentation.startActivitySync(intent2);
+
waitLatch(mLatchActivityCached);
}
diff --git a/tests/tests/display/src/android/display/cts/DisplayManagerTest.java b/tests/tests/display/src/android/display/cts/DisplayManagerTest.java
index b85d5bb..555fa782 100644
--- a/tests/tests/display/src/android/display/cts/DisplayManagerTest.java
+++ b/tests/tests/display/src/android/display/cts/DisplayManagerTest.java
@@ -20,6 +20,7 @@
import static android.view.WindowInsets.Type.systemBars;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
import android.app.Activity;
import android.app.Instrumentation;
@@ -97,6 +98,9 @@
@Test
public void testCreateVirtualDisplayFromShell() throws InterruptedException {
+ // b/317812433: Disable test until test can be fixed for specific devices
+ assumeTrue(false);
+
mInstrumentation.getUiAutomation().adoptShellPermissionIdentity();
mActivity.waitForReady();
mInstrumentation.waitForIdleSync();
diff --git a/tests/tests/display/src/android/display/cts/SimpleActivity2.java b/tests/tests/display/src/android/display/cts/SimpleActivity2.java
new file mode 100644
index 0000000..663c1b8
--- /dev/null
+++ b/tests/tests/display/src/android/display/cts/SimpleActivity2.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2023 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.display.cts;
+
+import android.app.Activity;
+
+/**
+ * An activity doing nothing
+ */
+public final class SimpleActivity2 extends Activity { }
diff --git a/tests/tests/dpi/Android.bp b/tests/tests/dpi/Android.bp
index 9b69cb2..179fda3 100644
--- a/tests/tests/dpi/Android.bp
+++ b/tests/tests/dpi/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/dreams/Android.bp b/tests/tests/dreams/Android.bp
index b3b7810..1115207 100644
--- a/tests/tests/dreams/Android.bp
+++ b/tests/tests/dreams/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_display_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/dreams/CtsDreamOverlayTestApp/Android.bp b/tests/tests/dreams/CtsDreamOverlayTestApp/Android.bp
index 95f091e..81c49fc 100644
--- a/tests/tests/dreams/CtsDreamOverlayTestApp/Android.bp
+++ b/tests/tests/dreams/CtsDreamOverlayTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_display_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gamemanager/Android.bp b/tests/tests/gamemanager/Android.bp
index 4c34af9..4295c23 100644
--- a/tests/tests/gamemanager/Android.bp
+++ b/tests/tests/gamemanager/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gamemanager/GameTestApp/Android.bp b/tests/tests/gamemanager/GameTestApp/Android.bp
index 204cfe0..cd90b0e 100644
--- a/tests/tests/gamemanager/GameTestApp/Android.bp
+++ b/tests/tests/gamemanager/GameTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gamemanager/GameTestAppWithBatteryMode/Android.bp b/tests/tests/gamemanager/GameTestAppWithBatteryMode/Android.bp
index b428860..ec74618 100644
--- a/tests/tests/gamemanager/GameTestAppWithBatteryMode/Android.bp
+++ b/tests/tests/gamemanager/GameTestAppWithBatteryMode/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gamemanager/GameTestAppWithPerformanceMode/Android.bp b/tests/tests/gamemanager/GameTestAppWithPerformanceMode/Android.bp
index b783a75..a3be7c5 100644
--- a/tests/tests/gamemanager/GameTestAppWithPerformanceMode/Android.bp
+++ b/tests/tests/gamemanager/GameTestAppWithPerformanceMode/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gamemanager/GameTestAppWithTiramisuTarget/Android.bp b/tests/tests/gamemanager/GameTestAppWithTiramisuTarget/Android.bp
index 7303b70..08a6e6b 100644
--- a/tests/tests/gamemanager/GameTestAppWithTiramisuTarget/Android.bp
+++ b/tests/tests/gamemanager/GameTestAppWithTiramisuTarget/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gamemanager/LegacyGameTestApp/Android.bp b/tests/tests/gamemanager/LegacyGameTestApp/Android.bp
index 5cc3b71..d1868ff 100644
--- a/tests/tests/gamemanager/LegacyGameTestApp/Android.bp
+++ b/tests/tests/gamemanager/LegacyGameTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gamemanager/NotGameTestApp/Android.bp b/tests/tests/gamemanager/NotGameTestApp/Android.bp
index 4d1fd28..a8e8443 100644
--- a/tests/tests/gamemanager/NotGameTestApp/Android.bp
+++ b/tests/tests/gamemanager/NotGameTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gameservice/Android.bp b/tests/tests/gameservice/Android.bp
index 3e62ac5..85d534a 100644
--- a/tests/tests/gameservice/Android.bp
+++ b/tests/tests/gameservice/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gameservice/CtsGameServiceFalsePositiveGame/Android.bp b/tests/tests/gameservice/CtsGameServiceFalsePositiveGame/Android.bp
index 58eae22..b844a2e 100644
--- a/tests/tests/gameservice/CtsGameServiceFalsePositiveGame/Android.bp
+++ b/tests/tests/gameservice/CtsGameServiceFalsePositiveGame/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gameservice/CtsGameServiceFinishOnBackGame/Android.bp b/tests/tests/gameservice/CtsGameServiceFinishOnBackGame/Android.bp
index a003dca..b0af488 100644
--- a/tests/tests/gameservice/CtsGameServiceFinishOnBackGame/Android.bp
+++ b/tests/tests/gameservice/CtsGameServiceFinishOnBackGame/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gameservice/CtsGameServiceGame/Android.bp b/tests/tests/gameservice/CtsGameServiceGame/Android.bp
index f4a321a..1ccd5bf 100644
--- a/tests/tests/gameservice/CtsGameServiceGame/Android.bp
+++ b/tests/tests/gameservice/CtsGameServiceGame/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gameservice/CtsGameServiceNotGame/Android.bp b/tests/tests/gameservice/CtsGameServiceNotGame/Android.bp
index 849097c..ceb2974 100644
--- a/tests/tests/gameservice/CtsGameServiceNotGame/Android.bp
+++ b/tests/tests/gameservice/CtsGameServiceNotGame/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gameservice/CtsGameServiceRestartGameVerifier/Android.bp b/tests/tests/gameservice/CtsGameServiceRestartGameVerifier/Android.bp
index 8416baa..7d683aa 100644
--- a/tests/tests/gameservice/CtsGameServiceRestartGameVerifier/Android.bp
+++ b/tests/tests/gameservice/CtsGameServiceRestartGameVerifier/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gameservice/CtsGameServiceStartActivityVerifier/Android.bp b/tests/tests/gameservice/CtsGameServiceStartActivityVerifier/Android.bp
index c88cb866..be8e56f 100644
--- a/tests/tests/gameservice/CtsGameServiceStartActivityVerifier/Android.bp
+++ b/tests/tests/gameservice/CtsGameServiceStartActivityVerifier/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gameservice/CtsGameServiceSystemBarVerifier/Android.bp b/tests/tests/gameservice/CtsGameServiceSystemBarVerifier/Android.bp
index 5c303c4..526137b 100644
--- a/tests/tests/gameservice/CtsGameServiceSystemBarVerifier/Android.bp
+++ b/tests/tests/gameservice/CtsGameServiceSystemBarVerifier/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gameservice/CtsGameServiceTakeScreenshotVerifier/Android.bp b/tests/tests/gameservice/CtsGameServiceTakeScreenshotVerifier/Android.bp
index 3f9fc4d..aaeb076 100644
--- a/tests/tests/gameservice/CtsGameServiceTakeScreenshotVerifier/Android.bp
+++ b/tests/tests/gameservice/CtsGameServiceTakeScreenshotVerifier/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gameservice/CtsGameServiceTouchVerifier/Android.bp b/tests/tests/gameservice/CtsGameServiceTouchVerifier/Android.bp
index fe6c5d5..46839b8 100644
--- a/tests/tests/gameservice/CtsGameServiceTouchVerifier/Android.bp
+++ b/tests/tests/gameservice/CtsGameServiceTouchVerifier/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/gesture/Android.bp b/tests/tests/gesture/Android.bp
index 318d4a0..3dd9c51 100644
--- a/tests/tests/gesture/Android.bp
+++ b/tests/tests/gesture/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/graphics/Android.bp b/tests/tests/graphics/Android.bp
index bcf0994..6fbdf7d 100644
--- a/tests/tests/graphics/Android.bp
+++ b/tests/tests/graphics/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/graphics/jni/Android.bp b/tests/tests/graphics/jni/Android.bp
index 3f6d40d..4328956 100644
--- a/tests/tests/graphics/jni/Android.bp
+++ b/tests/tests/graphics/jni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/graphics/jni/android_graphics_cts_FrameRateCtsActivity.cpp b/tests/tests/graphics/jni/android_graphics_cts_FrameRateCtsActivity.cpp
index 0c5c633..b33bd28 100644
--- a/tests/tests/graphics/jni/android_graphics_cts_FrameRateCtsActivity.cpp
+++ b/tests/tests/graphics/jni/android_graphics_cts_FrameRateCtsActivity.cpp
@@ -273,7 +273,7 @@
}
ASurfaceTransaction* transaction = ASurfaceTransaction_create();
- ASurfaceTransaction_setBuffer(transaction, surfaceControl, buffer.getBuffer());
+ ASurfaceTransaction_setBuffer(transaction, surfaceControl, buffer.getBuffer(), -1);
ASurfaceTransaction_apply(transaction);
ASurfaceTransaction_delete(transaction);
return JNI_TRUE;
diff --git a/tests/tests/graphics/src/android/graphics/cts/FrameRateCtsActivity.java b/tests/tests/graphics/src/android/graphics/cts/FrameRateCtsActivity.java
index 0794716..495a55b 100644
--- a/tests/tests/graphics/src/android/graphics/cts/FrameRateCtsActivity.java
+++ b/tests/tests/graphics/src/android/graphics/cts/FrameRateCtsActivity.java
@@ -58,7 +58,7 @@
}
private static final String TAG = "FrameRateCtsActivity";
- private static final long FRAME_RATE_SWITCH_GRACE_PERIOD_SECONDS = 2;
+ private static final long FRAME_RATE_SWITCH_GRACE_PERIOD_SECONDS = 4;
private static final long STABLE_FRAME_RATE_WAIT_SECONDS = 1;
private static final long POST_BUFFER_INTERVAL_MILLIS = 500;
private static final int PRECONDITION_WAIT_MAX_ATTEMPTS = 5;
diff --git a/tests/tests/graphics/src/android/graphics/drawable/cts/DrawableTestUtils.java b/tests/tests/graphics/src/android/graphics/drawable/cts/DrawableTestUtils.java
index 950237f..68aea69 100644
--- a/tests/tests/graphics/src/android/graphics/drawable/cts/DrawableTestUtils.java
+++ b/tests/tests/graphics/src/android/graphics/drawable/cts/DrawableTestUtils.java
@@ -46,13 +46,17 @@
*/
public class DrawableTestUtils {
private static final String LOGTAG = "DrawableTestUtils";
- // A small value is actually making sure that the values are matching
- // exactly with the golden image.
- // We can increase the threshold if the Skia is drawing with some variance
- // on different devices. So far, the tests show they are matching correctly.
- static final float PIXEL_ERROR_THRESHOLD = 0.03f;
- static final float PIXEL_ERROR_COUNT_THRESHOLD = 0.011f;
- static final float PIXEL_ERROR_TOLERANCE = 3.0f;
+
+ // All of these constants range 0..1, with higher values being more lenient to differences
+ // between images. Values of zero mean no differences will be tolerated.
+
+ // Fail immediately if any *single* pixel diff exceeds this threshold
+ static final float FATAL_PIXEL_ERROR_THRESHOLD = 0.2f;
+ // Fail if the count of pixels with diffs above REGULAR_PIXEL_ERROR_THRESHOLD exceeds this ratio
+ static final float MAX_REGULAR_ERROR_RATIO = 0.05f;
+ // Threshold to count this pixel as a non-fatal error, the sum of which will be compared
+ // against MAX_REGULAR_ERROR_RATIO
+ static final float REGULAR_PIXEL_ERROR_THRESHOLD = 0.02f;
public static void skipCurrentTag(XmlPullParser parser)
throws XmlPullParserException, IOException {
@@ -153,13 +157,20 @@
* @param message Error message
* @param expected Expected bitmap
* @param actual Actual bitmap
- * @param pixelThreshold The total difference threshold for a single pixel
- * @param pixelCountThreshold The total different pixel count threshold
- * @param pixelDiffTolerance The pixel value difference tolerance
- *
+ * @param fatalPixelErrorThreshold 0..1 - Fails immediately if any *single* pixel diff exceeds
+ * this threshold
+ * @param maxRegularErrorRatio 0..1 - Fails if the count of pixels with diffs above
+ * regularPixelErrorThreshold exceeds this ratio
+ * @param regularPixelErrorThreshold 0..1 - Threshold to count this pixel as a non-fatal error,
+ * the sum of which will be compared against MAX_REGULAR_ERROR_RATIO
*/
- public static void compareImages(String message, Bitmap expected, Bitmap actual,
- float pixelThreshold, float pixelCountThreshold, float pixelDiffTolerance) {
+ public static void compareImages(
+ String message,
+ Bitmap expected,
+ Bitmap actual,
+ float fatalPixelErrorThreshold,
+ float maxRegularErrorRatio,
+ float regularPixelErrorThreshold) {
int idealWidth = expected.getWidth();
int idealHeight = expected.getHeight();
@@ -182,26 +193,44 @@
float givenAlpha = Color.alpha(givenColor) / 255.0f;
// compare premultiplied color values
- float totalError = 0;
- totalError += Math.abs((idealAlpha * Color.red(idealColor))
+ float pixelError = 0;
+ pixelError += Math.abs((idealAlpha * Color.red(idealColor))
- (givenAlpha * Color.red(givenColor)));
- totalError += Math.abs((idealAlpha * Color.green(idealColor))
+ pixelError += Math.abs((idealAlpha * Color.green(idealColor))
- (givenAlpha * Color.green(givenColor)));
- totalError += Math.abs((idealAlpha * Color.blue(idealColor))
+ pixelError += Math.abs((idealAlpha * Color.blue(idealColor))
- (givenAlpha * Color.blue(givenColor)));
- totalError += Math.abs(Color.alpha(idealColor) - Color.alpha(givenColor));
+ pixelError += Math.abs(Color.alpha(idealColor) - Color.alpha(givenColor));
+ pixelError /= 1024.0f;
- if ((totalError / 1024.0f) >= pixelThreshold) {
- Assert.fail((message + ": totalError is " + totalError));
+ if (pixelError > fatalPixelErrorThreshold) {
+ Assert.fail(
+ String.format(
+ "%s: pixelError of %f exceeds fatalPixelErrorThreshold of %f"
+ + " for pixel (%d, %d)",
+ message,
+ pixelError,
+ fatalPixelErrorThreshold,
+ x,
+ y));
}
- if (totalError > pixelDiffTolerance) {
+ if (pixelError > regularPixelErrorThreshold) {
totalDiffPixelCount++;
}
}
}
- if ((totalDiffPixelCount / totalPixelCount) >= pixelCountThreshold) {
- Assert.fail((message +": totalDiffPixelCount is " + totalDiffPixelCount));
+ float countedErrorRatio = totalDiffPixelCount / totalPixelCount;
+ if (countedErrorRatio > maxRegularErrorRatio) {
+ Assert.fail(
+ String.format(
+ "%s: countedErrorRatio of %f exceeds maxRegularErrorRatio of %f for"
+ + " %dx%d image",
+ message,
+ countedErrorRatio,
+ maxRegularErrorRatio,
+ idealWidth,
+ idealHeight));
}
}
diff --git a/tests/tests/graphics/src/android/graphics/drawable/cts/VectorDrawableTest.java b/tests/tests/graphics/src/android/graphics/drawable/cts/VectorDrawableTest.java
index 69bff3b..dd8ca8f 100644
--- a/tests/tests/graphics/src/android/graphics/drawable/cts/VectorDrawableTest.java
+++ b/tests/tests/graphics/src/android/graphics/drawable/cts/VectorDrawableTest.java
@@ -222,9 +222,9 @@
@Test
public void testVectorDrawableGradient() throws XmlPullParserException, IOException {
verifyVectorDrawables(GRADIENT_ICON_RES_IDS, GRADIENT_GOLDEN_IMAGES, null,
- DrawableTestUtils.PIXEL_ERROR_THRESHOLD,
- DrawableTestUtils.PIXEL_ERROR_COUNT_THRESHOLD,
- DrawableTestUtils.PIXEL_ERROR_TOLERANCE + 0.5f);
+ DrawableTestUtils.FATAL_PIXEL_ERROR_THRESHOLD,
+ DrawableTestUtils.MAX_REGULAR_ERROR_RATIO,
+ DrawableTestUtils.REGULAR_PIXEL_ERROR_THRESHOLD);
}
@Test
@@ -238,9 +238,9 @@
private void verifyVectorDrawables(int[] resIds, int[] goldenImages, int[] stateSet)
throws XmlPullParserException, IOException {
verifyVectorDrawables(resIds, goldenImages, stateSet,
- DrawableTestUtils.PIXEL_ERROR_THRESHOLD,
- DrawableTestUtils.PIXEL_ERROR_COUNT_THRESHOLD,
- DrawableTestUtils.PIXEL_ERROR_TOLERANCE);
+ DrawableTestUtils.FATAL_PIXEL_ERROR_THRESHOLD,
+ DrawableTestUtils.MAX_REGULAR_ERROR_RATIO,
+ DrawableTestUtils.REGULAR_PIXEL_ERROR_THRESHOLD);
}
private void verifyVectorDrawables(int[] resIds, int[] goldenImages, int[] stateSet,
diff --git a/tests/tests/graphics/src/android/graphics/fonts/SystemEmojiTest.java b/tests/tests/graphics/src/android/graphics/fonts/SystemEmojiTest.java
index a4d0ab4..06c12242 100644
--- a/tests/tests/graphics/src/android/graphics/fonts/SystemEmojiTest.java
+++ b/tests/tests/graphics/src/android/graphics/fonts/SystemEmojiTest.java
@@ -22,7 +22,6 @@
import android.graphics.text.PositionedGlyphs;
import android.graphics.text.TextRunShaper;
import android.test.suitebuilder.annotation.SmallTest;
-import com.android.compatibility.common.util.FeatureUtil;
import androidx.test.runner.AndroidJUnit4;
@@ -66,16 +65,4 @@
public void doNotDrawLegacy() {
assertThat(getFontName("\u263A")).isNotEqualTo("NotoColorEmojiLegacy.ttf");
}
-
- @Test
- public void doNotRemoveLegacyFont() {
- // Due to size limitations NotoColorEmojiLegacy.ttf is excluded from Wear OS
- if (FeatureUtil.isWatch()) {
- return;
- }
- File legacyFile = new File("/system/fonts", "NotoColorEmojiLegacy.ttf");
- assertThat(legacyFile.exists()).isTrue();
- assertThat(legacyFile.isFile()).isTrue();
- assertThat(legacyFile.canRead()).isTrue();
- }
}
diff --git a/tests/tests/hardware/Android.bp b/tests/tests/hardware/Android.bp
index 1242991..f7fda75 100644
--- a/tests/tests/hardware/Android.bp
+++ b/tests/tests/hardware/Android.bp
@@ -33,6 +33,9 @@
cpp: {
enabled: false,
},
+ rust: {
+ enabled: false,
+ },
ndk: {
enabled: true,
additional_shared_libraries: [
diff --git a/tests/tests/hardware/AndroidManifest.xml b/tests/tests/hardware/AndroidManifest.xml
index 9660e87..dc734c4 100644
--- a/tests/tests/hardware/AndroidManifest.xml
+++ b/tests/tests/hardware/AndroidManifest.xml
@@ -77,11 +77,14 @@
android:process=":camera2ActivityProcess">
</activity>
+ <!-- Disable onBackInvokedCallback to allow us to make assertions about
+ the app receiving KEYCODE_BACK. -->
<activity android:name="android.hardware.input.cts.InputCtsActivity"
android:label="InputCtsActivity"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation
|screenLayout|fontScale|uiMode|orientation|density|screenSize
- |smallestScreenSize|layoutDirection">
+ |smallestScreenSize|layoutDirection"
+ android:enableOnBackInvokedCallback="false">
</activity>
<activity android:name="android.hardware.input.cts.InputAssistantActivity"
diff --git a/tests/tests/hardware/TEST_MAPPING b/tests/tests/hardware/TEST_MAPPING
index 1e1e56f..99b8d34 100644
--- a/tests/tests/hardware/TEST_MAPPING
+++ b/tests/tests/hardware/TEST_MAPPING
@@ -19,93 +19,10 @@
"exclude-filter": "android.hardware.input.cts.tests.VirtualTouchscreenTest#sendTouchEvent"
},
{
- // TODO(b/220094725):
- "exclude-filter": "android.hardware.input.cts.tests.NintendoSwitchProTest#testAllMotions"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.NintendoSwitchProTest#testAllKeys"
- },
- {
// TODO(b/214223833):
"exclude-filter": "android.hardware.cts.LowRamDeviceTest#testMinSharedDataPartitionSize"
},
{
- // TODO(b/206945621):
- "exclude-filter": "android.hardware.input.cts.tests.SonyDualSenseUsbTest#testAllMotions"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4BluetoothTest#testAllTouch"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4BluetoothTest#testBattery"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4BluetoothTest#testLights"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4BluetoothTest#testVibrator"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4ProBluetoothTest#testAllMotions"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4UsbTest#testBattery"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4UsbTest#testVibrator"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.UsbVoiceCommandTest#testVoiceAssistantKey"
- },
- {
- "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testClearLight"
- },
- {
- "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testControlLightsPermissionIsRequiredToUseLights"
- },
- {
- "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testControlLights_firstCallerWinsContention"
- },
- {
- "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testControlLights_onlyEffectiveForLifetimeOfClient"
- },
- {
- "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testControlMultipleLights"
- },
- {
- "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testControlSingleLight"
- },
- {
- // TODO(b/186200527):
- "exclude-filter": "android.hardware.input.cts.tests.AsusGamepadTest#testAllMotions"
- },
- {
- // TODO(b/186200608):
- "exclude-filter": "android.hardware.input.cts.tests.RazerRaijuMobileBluetoothTest#testAllKeys"
- },
- {
- // TODO(b/186414778):
- "exclude-filter": "android.hardware.input.cts.tests.RazerRaijuMobileBluetoothTest#testHomeKey"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.RazerKishiTest#testAllKeys"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.RazerJunglecatBluetoothTest#testAllKeys"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.RazerJunglecatBluetoothTest#testAllMotions"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4BluetoothTest#testAllKeys"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.RazerServalTest#testAllKeys"
- },
- {
- "exclude-filter": "android.hardware.input.cts.tests.RazerServalTest#testAllMotions"
- },
- {
// TODO(b/266108817): android.hardware.input.cts.tests unexpected timeouts
"exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4BluetoothTest#testAllMotions"
},
@@ -152,6 +69,84 @@
"exclude-filter": "android.hardware.input.cts.tests.MicrosoftDesignerKeyboardTest#testAllKeys"
},
{
+ "exclude-filter": "android.hardware.input.cts.tests.RazerRaijuMobileBluetoothTest#testHomeKey"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.RazerKishiTest#testAllKeys"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.RazerJunglecatBluetoothTest#testAllKeys"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.RazerJunglecatBluetoothTest#testAllMotions"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4BluetoothTest#testAllKeys"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.RazerServalTest#testAllKeys"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.RazerServalTest#testAllMotions"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.NintendoSwitchProTest#testAllMotions"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.NintendoSwitchProTest#testAllKeys"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.SonyDualSenseUsbTest#testAllMotions"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4BluetoothTest#testAllTouch"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4BluetoothTest#testBattery"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4BluetoothTest#testLights"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4BluetoothTest#testVibrator"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4ProBluetoothTest#testAllMotions"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4UsbTest#testBattery"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4UsbTest#testVibrator"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.UsbVoiceCommandTest#testVoiceAssistantKey"
+ },
+ {
+ "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testClearLight"
+ },
+ {
+ "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testControlLightsPermissionIsRequiredToUseLights"
+ },
+ {
+ "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testControlLights_firstCallerWinsContention"
+ },
+ {
+ "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testControlLights_onlyEffectiveForLifetimeOfClient"
+ },
+ {
+ "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testControlMultipleLights"
+ },
+ {
+ "exclude-filter": "android.hardware.lights.cts.tests.LightsManagerTest#testControlSingleLight"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.RazerRaijuMobileBluetoothTest#testAllKeys"
+ },
+ {
+ "exclude-filter": "android.hardware.input.cts.tests.AsusGamepadTest#testAllMotions"
+ },
+ {
// TODO(b/190487022):
"exclude-filter": "android.hardware.input.cts.tests.SonyDualshock4ProBluetoothTest#testVibrator"
},
diff --git a/tests/tests/hardware/res/raw/gravis_gamepadprousb_keyeventtests.json b/tests/tests/hardware/res/raw/gravis_gamepadprousb_keyeventtests.json
new file mode 100644
index 0000000..ab08342
--- /dev/null
+++ b/tests/tests/hardware/res/raw/gravis_gamepadprousb_keyeventtests.json
@@ -0,0 +1,122 @@
+[
+ {
+ "name": "Press Yellow",
+ "reports": [
+ [0x7f, 0x7f, 0x02, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "KEYBOARD | GAMEPAD",
+ "events": [
+ {"action": "DOWN", "keycode": "BUTTON_A"},
+ {"action": "UP", "keycode": "BUTTON_A"}
+ ]
+ },
+ {
+ "name": "Press Green",
+ "reports": [
+ [0x7f, 0x7f, 0x04, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "KEYBOARD | GAMEPAD",
+ "events": [
+ {"action": "DOWN", "keycode": "BUTTON_B"},
+ {"action": "UP", "keycode": "BUTTON_B"}
+ ]
+ },
+ {
+ "name": "Press Red",
+ "reports": [
+ [0x7f, 0x7f, 0x01, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "KEYBOARD | GAMEPAD",
+ "events": [
+ {"action": "DOWN", "keycode": "BUTTON_X"},
+ {"action": "UP", "keycode": "BUTTON_X"}
+ ]
+ },
+ {
+ "name": "Press Blue",
+ "reports": [
+ [0x7f, 0x7f, 0x08, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "KEYBOARD | GAMEPAD",
+ "events": [
+ {"action": "DOWN", "keycode": "BUTTON_Y"},
+ {"action": "UP", "keycode": "BUTTON_Y"}
+ ]
+ },
+ {
+ "name": "Press Left Shoulder \"1\"",
+ "reports": [
+ [0x7f, 0x7f, 0x10, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "KEYBOARD | GAMEPAD",
+ "events": [
+ {"action": "DOWN", "keycode": "BUTTON_L1"},
+ {"action": "UP", "keycode": "BUTTON_L1"}
+ ]
+ },
+ {
+ "name": "Press Right Shoulder \"1\"",
+ "reports": [
+ [0x7f, 0x7f, 0x20, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "KEYBOARD | GAMEPAD",
+ "events": [
+ {"action": "DOWN", "keycode": "BUTTON_R1"},
+ {"action": "UP", "keycode": "BUTTON_R1"}
+ ]
+ },
+ {
+ "name": "Press Left Shoulder \"2\"",
+ "reports": [
+ [0x7f, 0x7f, 0x40, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "KEYBOARD | GAMEPAD",
+ "events": [
+ {"action": "DOWN", "keycode": "BUTTON_L2"},
+ {"action": "UP", "keycode": "BUTTON_L2"}
+ ]
+ },
+ {
+ "name": "Press Right Shoulder \"2\"",
+ "reports": [
+ [0x7f, 0x7f, 0x80, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "KEYBOARD | GAMEPAD",
+ "events": [
+ {"action": "DOWN", "keycode": "BUTTON_R2"},
+ {"action": "UP", "keycode": "BUTTON_R2"}
+ ]
+ },
+ {
+ "name": "Press Select",
+ "reports": [
+ [0x7f, 0x7f, 0x00, 0x01],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "KEYBOARD | GAMEPAD",
+ "events": [
+ {"action": "DOWN", "keycode": "BUTTON_SELECT"},
+ {"action": "UP", "keycode": "BUTTON_SELECT"}
+ ]
+ },
+ {
+ "name": "Press Start",
+ "reports": [
+ [0x7f, 0x7f, 0x00, 0x02],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "KEYBOARD | GAMEPAD",
+ "events": [
+ {"action": "DOWN", "keycode": "BUTTON_START"},
+ {"action": "UP", "keycode": "BUTTON_START"}
+ ]
+ }
+]
diff --git a/tests/tests/hardware/res/raw/gravis_gamepadprousb_motioneventtests.json b/tests/tests/hardware/res/raw/gravis_gamepadprousb_motioneventtests.json
new file mode 100644
index 0000000..186fed6
--- /dev/null
+++ b/tests/tests/hardware/res/raw/gravis_gamepadprousb_motioneventtests.json
@@ -0,0 +1,59 @@
+[
+ {
+ "name": "Neutrality check - ought not produce any events",
+ "reports": [
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "JOYSTICK",
+ "events": [
+ ]
+ },
+ {
+ "name": "Press D-Pad Left",
+ "reports": [
+ [0x00, 0x7f, 0x00, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "JOYSTICK",
+ "events": [
+ {"action": "MOVE", "axes": {"AXIS_HAT_X": -1}},
+ {"action": "MOVE", "axes": {"AXIS_HAT_X": 0}}
+ ]
+ },
+ {
+ "name": "Press D-Pad Right",
+ "reports": [
+ [0xff, 0x7f, 0x00, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "JOYSTICK",
+ "events": [
+ {"action": "MOVE", "axes": {"AXIS_HAT_X": 1}},
+ {"action": "MOVE", "axes": {"AXIS_HAT_X": 0}}
+ ]
+ },
+ {
+ "name": "Press D-Pad Up",
+ "reports": [
+ [0x7f, 0x00, 0x00, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "JOYSTICK",
+ "events": [
+ {"action": "MOVE", "axes": {"AXIS_HAT_Y": -1}},
+ {"action": "MOVE", "axes": {"AXIS_HAT_Y": 0}}
+ ]
+ },
+ {
+ "name": "Press D-Pad Down",
+ "reports": [
+ [0x7f, 0xff, 0x00, 0x00],
+ [0x7f, 0x7f, 0x00, 0x00]
+ ],
+ "source": "JOYSTICK",
+ "events": [
+ {"action": "MOVE", "axes": {"AXIS_HAT_Y": 1}},
+ {"action": "MOVE", "axes": {"AXIS_HAT_Y": 0}}
+ ]
+ }
+]
diff --git a/tests/tests/hardware/res/raw/gravis_gamepadprousb_register.json b/tests/tests/hardware/res/raw/gravis_gamepadprousb_register.json
new file mode 100644
index 0000000..9f87348
--- /dev/null
+++ b/tests/tests/hardware/res/raw/gravis_gamepadprousb_register.json
@@ -0,0 +1,13 @@
+{
+ "id": 1,
+ "command": "register",
+ "name": "Gravis GamePad Pro USB (Test)",
+ "vid": 0x0428,
+ "pid": 0x4001,
+ "bus": "usb",
+ "source": "KEYBOARD | GAMEPAD | JOYSTICK",
+ "descriptor": [0x05, 0x01, 0x09, 0x05, 0xa1, 0x01, 0x05, 0x01, 0x09, 0x01, 0xa1, 0x00, 0x09,
+ 0x30, 0x09, 0x31, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x02, 0x81, 0x02, 0xc0,
+ 0x05, 0x09, 0x19, 0x01, 0x29, 0x0a, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x0a, 0x81,
+ 0x02, 0x95, 0x01, 0x75, 0x06, 0x81, 0x01, 0xc0]
+}
diff --git a/tests/tests/hardware/res/raw/sony_dualshock4_usb_register.json b/tests/tests/hardware/res/raw/sony_dualshock4_usb_register.json
index db322d6..67f0f92 100644
--- a/tests/tests/hardware/res/raw/sony_dualshock4_usb_register.json
+++ b/tests/tests/hardware/res/raw/sony_dualshock4_usb_register.json
@@ -54,6 +54,11 @@
{
"id": 0x81,
"data": [0x81, 0x62, 0x97, 0xc9, 0x00, 0x00, 0x00]
+ },
+ {
+ "id": 0x12,
+ "data": [0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00]
}
]
}
diff --git a/tests/tests/hardware/src/android/hardware/input/cts/DefaultPointerSpeedRule.kt b/tests/tests/hardware/src/android/hardware/input/cts/DefaultPointerSpeedRule.kt
new file mode 100644
index 0000000..e85eb3b
--- /dev/null
+++ b/tests/tests/hardware/src/android/hardware/input/cts/DefaultPointerSpeedRule.kt
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2024 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.hardware.input.cts
+
+import android.content.Context
+import android.hardware.input.InputManager
+import android.hardware.input.InputSettings
+import android.provider.Settings
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.compatibility.common.util.PollingCheck
+import com.android.compatibility.common.util.SettingsStateManager
+import com.android.compatibility.common.util.StateChangerRule
+import com.android.compatibility.common.util.UserSettings
+
+class DefaultPointerSpeedRule : StateChangerRule<String?>(
+ PointerSpeedSettingsStateManager(
+ InstrumentationRegistry
+ .getInstrumentation()
+ .targetContext
+ ),
+ InputSettings.DEFAULT_POINTER_SPEED.toString()
+) {
+ private class PointerSpeedSettingsStateManager(context: Context) :
+ SettingsStateManager(
+ context,
+ UserSettings.Namespace.SYSTEM,
+ Settings.System.POINTER_SPEED
+ ) {
+ private val mInputManager: InputManager
+
+ init {
+ mInputManager = context.getSystemService(InputManager::class.java)!!
+ }
+
+ override fun set(value: String?) {
+ super.set(value)
+ val speed = value!!.toInt()
+ // This doesn't ensure that the input reader is configured yet with this mouse
+ // pointer speed. So, this rule should be used only in tests which add input device(s),
+ // as that would ensure that this configuration change is complete by the time a device
+ // gets added.
+ PollingCheck.waitFor { mInputManager.mousePointerSpeed == speed }
+ }
+ }
+}
diff --git a/tests/tests/hardware/src/android/hardware/input/cts/tests/GravisGamePadProUsbTest.java b/tests/tests/hardware/src/android/hardware/input/cts/tests/GravisGamePadProUsbTest.java
new file mode 100644
index 0000000..d2d944c
--- /dev/null
+++ b/tests/tests/hardware/src/android/hardware/input/cts/tests/GravisGamePadProUsbTest.java
@@ -0,0 +1,33 @@
+package android.hardware.input.cts.tests;
+
+import static org.junit.Assume.assumeTrue;
+
+import android.hardware.cts.R;
+import android.view.InputDevice;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
+import com.android.cts.kernelinfo.KernelInfo;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class GravisGamePadProUsbTest extends InputHidTestCase {
+
+ public GravisGamePadProUsbTest() {
+ super(R.raw.gravis_gamepadprousb_register);
+ }
+
+ @Test
+ public void testAllKeys() {
+ testInputEvents(R.raw.gravis_gamepadprousb_keyeventtests);
+ }
+
+ @Test
+ public void testAllMotions() {
+ testInputEvents(R.raw.gravis_gamepadprousb_motioneventtests);
+ }
+}
diff --git a/tests/tests/hardware/src/android/hardware/input/cts/tests/VirtualMouseTest.java b/tests/tests/hardware/src/android/hardware/input/cts/tests/VirtualMouseTest.java
index 882b572..6120a85 100644
--- a/tests/tests/hardware/src/android/hardware/input/cts/tests/VirtualMouseTest.java
+++ b/tests/tests/hardware/src/android/hardware/input/cts/tests/VirtualMouseTest.java
@@ -28,12 +28,14 @@
import android.hardware.input.VirtualMouseConfig;
import android.hardware.input.VirtualMouseRelativeEvent;
import android.hardware.input.VirtualMouseScrollEvent;
+import android.hardware.input.cts.DefaultPointerSpeedRule;
import android.view.InputDevice;
import android.view.MotionEvent;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -47,6 +49,9 @@
private static final float EPSILON = 0.001f;
+ @Rule
+ public final DefaultPointerSpeedRule mDefaultPointerSpeedRule = new DefaultPointerSpeedRule();
+
private VirtualMouse mVirtualMouse;
@Override
diff --git a/tests/tests/hibernation/src/android/hibernation/cts/AutoRevokeTest.kt b/tests/tests/hibernation/src/android/hibernation/cts/AutoRevokeTest.kt
index f452ced..4f37748 100644
--- a/tests/tests/hibernation/src/android/hibernation/cts/AutoRevokeTest.kt
+++ b/tests/tests/hibernation/src/android/hibernation/cts/AutoRevokeTest.kt
@@ -603,21 +603,34 @@
.res(Pattern.compile(".*id/car_ui_first_action_container"))
.hasDescendant(rowSelector)
waitFindObject(rowItemSelector).parent
+ } else if (hasFeatureWatch()) {
+ waitFindObject(rowSelector)
} else {
waitFindObject(rowSelector).parent.parent
}
- val uninstallSelector = if (isAutomotiveDevice()) {
- By.res(Pattern.compile(".*id/car_ui_secondary_action"))
- } else {
- By.desc("Uninstall or disable")
- }
+ if (!hasFeatureWatch()) {
+ val uninstallSelector = if (isAutomotiveDevice()) {
+ By.res(Pattern.compile(".*id/car_ui_secondary_action"))
+ } else {
+ By.desc("Uninstall or disable")
+ }
- rowItem.findObject(uninstallSelector).click()
+ rowItem.findObject(uninstallSelector).click()
+ } else {
+ rowItem.click()
+ waitFindObject(By.text("Uninstall")).click()
+ }
}
private fun clickUninstallOk() {
- waitFindObject(By.text("OK")).click()
+ val uninstallSelector = if (hasFeatureWatch()) {
+ By.desc("OK")
+ } else {
+ By.text("OK")
+ }
+
+ waitFindObject(uninstallSelector).click()
}
private inline fun withDummyApp(
diff --git a/tests/tests/icu/Android.bp b/tests/tests/icu/Android.bp
index 583180c..269b741 100644
--- a/tests/tests/icu/Android.bp
+++ b/tests/tests/icu/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/icu/AndroidManifest.xml b/tests/tests/icu/AndroidManifest.xml
index 418c215..5e9fcd6 100644
--- a/tests/tests/icu/AndroidManifest.xml
+++ b/tests/tests/icu/AndroidManifest.xml
@@ -18,7 +18,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.icu.cts">
- <application>
+ <!-- b/323694623 RBBIMonkeyTest needs a larger heap. -->
+ <application android:largeHeap="true">
<uses-library android:name="android.test.runner" />
</application>
diff --git a/tests/tests/icu/icu4c_testapp/Android.bp b/tests/tests/icu/icu4c_testapp/Android.bp
index f272940..fb76d12 100644
--- a/tests/tests/icu/icu4c_testapp/Android.bp
+++ b/tests/tests/icu/icu4c_testapp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -47,7 +48,7 @@
stl: "c++_static",
whole_static_libs: [
"libicutest_static",
- "libnativetesthelper_jni"
+ "libnativetesthelper_jni",
],
shared_libs: [
"libicu",
diff --git a/tests/tests/identity/src/android/security/identity/cts/UserAuthTest.java b/tests/tests/identity/src/android/security/identity/cts/UserAuthTest.java
index 1656190..d7659fd 100644
--- a/tests/tests/identity/src/android/security/identity/cts/UserAuthTest.java
+++ b/tests/tests/identity/src/android/security/identity/cts/UserAuthTest.java
@@ -20,10 +20,8 @@
import android.security.identity.AccessControlProfile;
import android.security.identity.AccessControlProfileId;
-import android.security.identity.AlreadyPersonalizedException;
import android.security.identity.PersonalizationData;
import android.security.identity.IdentityCredential;
-import android.security.identity.IdentityCredentialException;
import android.security.identity.IdentityCredentialStore;
import android.security.identity.WritableIdentityCredential;
import android.security.identity.ResultData;
@@ -45,54 +43,13 @@
import org.junit.Test;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.KeyPair;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Signature;
-import java.security.SignatureException;
-import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
-import java.util.LinkedList;
import java.util.Map;
-import co.nstant.in.cbor.CborBuilder;
-import co.nstant.in.cbor.CborEncoder;
-import co.nstant.in.cbor.CborException;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.PrivateKey;
-import java.security.UnrecoverableEntryException;
-
-import javax.crypto.BadPaddingException;
-import javax.crypto.Cipher;
-import javax.crypto.IllegalBlockSizeException;
-import javax.crypto.KeyGenerator;
-import javax.crypto.NoSuchPaddingException;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.GCMParameterSpec;
-
-import android.security.keystore.KeyGenParameterSpec;
-import android.security.keystore.KeyProperties;
-import android.security.keystore.UserNotAuthenticatedException;
-
-
public class UserAuthTest {
private static final String TAG = "UserAuthTest";
@@ -139,49 +96,6 @@
}
}
- private boolean checkAuthBoundKey(String alias) {
- // Unfortunately there are no APIs to tell if a key needs user authentication to work so
- // we check if the key is available by simply trying to encrypt some data.
- try {
- KeyStore ks = KeyStore.getInstance("AndroidKeyStore");
- ks.load(null);
- KeyStore.Entry entry = ks.getEntry(alias, null);
- SecretKey secretKey = ((KeyStore.SecretKeyEntry) entry).getSecretKey();
-
- Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
- cipher.init(Cipher.ENCRYPT_MODE, secretKey);
- byte[] clearText = {0x01, 0x02};
- byte[] cipherText = cipher.doFinal(clearText);
- return true;
- } catch (UserNotAuthenticatedException e) {
- return false;
- } catch (Exception e) {
- throw new RuntimeException("Failed!", e);
- }
- }
-
- void createAuthBoundKey(String alias, int timeoutSeconds) {
- try {
- KeyGenerator kg = KeyGenerator.getInstance(
- KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore");
- KeyGenParameterSpec.Builder builder =
- new KeyGenParameterSpec.Builder(
- alias,
- KeyProperties.PURPOSE_ENCRYPT| KeyProperties.PURPOSE_DECRYPT)
- .setBlockModes(KeyProperties.BLOCK_MODE_GCM)
- .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE)
- .setUserAuthenticationRequired(true)
- .setUserAuthenticationValidityDurationSeconds(timeoutSeconds)
- .setKeySize(128);
- kg.init(builder.build());
- kg.generateKey();
- } catch (InvalidAlgorithmParameterException
- | NoSuchAlgorithmException
- | NoSuchProviderException e) {
- throw new RuntimeException("Error creating auth-bound key", e);
- }
- }
-
@Test
public void testUserAuth() throws Exception {
assumeTrue("Device doesn't support lock screen", TestUtil.isLockScreenSupported());
diff --git a/tests/tests/instantapp/Android.bp b/tests/tests/instantapp/Android.bp
index 1b17df1..ae815c5 100644
--- a/tests/tests/instantapp/Android.bp
+++ b/tests/tests/instantapp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/instantapp/OWNERS b/tests/tests/instantapp/OWNERS
index dd85fa9..3a6f03b 100644
--- a/tests/tests/instantapp/OWNERS
+++ b/tests/tests/instantapp/OWNERS
@@ -1,4 +1,4 @@
# Bug component: 36137
-chiuwinson@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
-toddke@google.com
diff --git a/tests/tests/jni/.clang-format b/tests/tests/jni/.clang-format
new file mode 120000
index 0000000..52b0a87
--- /dev/null
+++ b/tests/tests/jni/.clang-format
@@ -0,0 +1 @@
+../../../../art/.clang-format
\ No newline at end of file
diff --git a/tests/tests/jni/libjnitest/android_jni_cts_BasicLoaderTest.cpp b/tests/tests/jni/libjnitest/android_jni_cts_BasicLoaderTest.cpp
index d6c5710..f76f134 100644
--- a/tests/tests/jni/libjnitest/android_jni_cts_BasicLoaderTest.cpp
+++ b/tests/tests/jni/libjnitest/android_jni_cts_BasicLoaderTest.cpp
@@ -27,6 +27,7 @@
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/user.h>
#include <unistd.h>
#include <string>
@@ -52,8 +53,9 @@
dlclose(handle);
- uintptr_t page_start = reinterpret_cast<uintptr_t>(taxicab_number) & ~(PAGE_SIZE - 1);
- if (mprotect(reinterpret_cast<void*>(page_start), PAGE_SIZE, PROT_NONE) == 0) {
+ static const size_t kPageSize = getpagesize();
+ uintptr_t page_start = reinterpret_cast<uintptr_t>(taxicab_number) & ~(kPageSize - 1);
+ if (mprotect(reinterpret_cast<void*>(page_start), kPageSize, PROT_NONE) == 0) {
*error_msg = std::string("The library \"") +
kTestLibName +
"\" has not been unloaded on dlclose()";
diff --git a/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp b/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp
index 6c40afc..601d9b0 100644
--- a/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp
+++ b/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp
@@ -26,8 +26,9 @@
#include <libgen.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/system_properties.h>
+#include <sys/types.h>
#include <unistd.h>
#include <queue>
@@ -36,11 +37,12 @@
#include <unordered_set>
#include <vector>
-#include <android-base/file.h>
-#include <android-base/properties.h>
-#include <android-base/strings.h>
-#include <nativehelper/scoped_local_ref.h>
-#include <nativehelper/scoped_utf_chars.h>
+#include "android-base/file.h"
+#include "android-base/macros.h"
+#include "android-base/properties.h"
+#include "android-base/strings.h"
+#include "nativehelper/scoped_local_ref.h"
+#include "nativehelper/scoped_utf_chars.h"
#if defined(__LP64__)
#define LIB_DIR "lib64"
@@ -80,6 +82,11 @@
static const std::string kWebViewPlatSupportLib = "libwebviewchromium_plat_support.so";
+static inline bool running_with_native_bridge() {
+ static const prop_info* pi = __system_property_find("ro.dalvik.vm.isa." ABI_STRING);
+ return pi != nullptr;
+}
+
static bool not_accessible(const std::string& err) {
return err.find("dlopen failed: library \"") == 0 &&
err.find("is not accessible for the namespace \"") != std::string::npos;
@@ -154,11 +161,14 @@
java_load_lib_ok = env->GetStringLength(java_load_lib_errmsg) == 0;
}
- if (loaded_in_native != java_load_ok || java_load_ok != java_load_lib_ok) {
+ // When running with native bridge it is allowed to be able to open both device host and guest
+ // libraries from java, while native dlopen doesn't allow opening device host libraries from
+ // the device guest code.
+ if ((!running_with_native_bridge() && loaded_in_native != java_load_ok) ||
+ java_load_ok != java_load_lib_ok) {
const std::string java_load_error(ScopedUtfChars(env, java_load_errmsg).c_str());
error = "Inconsistent result for library \"" + path + "\": dlopen() " +
- (loaded_in_native ? "succeeded" : "failed (" + error + ")") +
- ", System.load() " +
+ (loaded_in_native ? "succeeded" : "failed (" + error + ")") + ", System.load() " +
(java_load_ok ? "succeeded" : "failed (" + java_load_error + ")");
if (test_system_load_library) {
const std::string java_load_lib_error(ScopedUtfChars(env, java_load_lib_errmsg).c_str());
diff --git a/tests/tests/keystore/src/android/keystore/cts/Curve25519Test.java b/tests/tests/keystore/src/android/keystore/cts/Curve25519Test.java
index c154200..d4fda26 100644
--- a/tests/tests/keystore/src/android/keystore/cts/Curve25519Test.java
+++ b/tests/tests/keystore/src/android/keystore/cts/Curve25519Test.java
@@ -240,4 +240,36 @@
assertThat(e.getMessage()).contains("cannot be initialized using NamedParameterSpec");
}
}
+
+ @Test
+ public void x25519KeyPairGenWithInvalidCurve() throws NoSuchAlgorithmException,
+ NoSuchProviderException {
+ // Create KeyPairGenerator using XDH algorithm.
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance("XDH", "AndroidKeyStore");
+ final String firstKeyAlias = "x25519-alias";
+ deleteEntry(firstKeyAlias);
+
+ // Generate x25519 key pair.
+ KeyGenParameterSpec keyGenSpec = new KeyGenParameterSpec.Builder(firstKeyAlias,
+ KeyProperties.PURPOSE_AGREE_KEY)
+ .setAlgorithmParameterSpec(new ECGenParameterSpec("secp256r1")).build();
+ assertThrows("XDH Key generation should accept only X25519 curves.",
+ InvalidAlgorithmParameterException.class, () -> kpg.initialize(keyGenSpec));
+ }
+
+ @Test
+ public void ed25519KeyPairGenWithInvalidCurve() throws NoSuchAlgorithmException,
+ NoSuchProviderException {
+ // Create KeyPairGenerator using Ed25519 algorithm.
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance("Ed25519", "AndroidKeyStore");
+ final String secondKeyAlias = "ed25519-alias";
+ deleteEntry(secondKeyAlias);
+
+ // Generate ed25519 key pair.
+ KeyGenParameterSpec keyGenSpec = new KeyGenParameterSpec.Builder(secondKeyAlias,
+ KeyProperties.PURPOSE_SIGN | KeyProperties.PURPOSE_VERIFY)
+ .setAlgorithmParameterSpec(new ECGenParameterSpec("secp256r1")).build();
+ assertThrows("Ed25519 Key generation should accept only Ed25519 curves.",
+ InvalidAlgorithmParameterException.class, () -> kpg.initialize(keyGenSpec));
+ }
}
diff --git a/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java b/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java
index a6694c8..f27b445 100644
--- a/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java
@@ -115,6 +115,7 @@
import java.security.spec.ECGenParameterSpec;
import java.util.Arrays;
import java.util.Date;
+import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -184,6 +185,19 @@
@RequiresDevice
@Test
public void testEcAttestation() throws Exception {
+ testEcAttestation(false);
+ }
+
+ @RequiresDevice
+ @Test
+ public void testEcAttestation_StrongBox() throws Exception {
+ assumeTrue("This test is only applicable to devices with StrongBox",
+ TestUtils.hasStrongBox(getContext()));
+
+ testEcAttestation(true);
+ }
+
+ private void testEcAttestation(boolean isStrongBox) throws Exception {
if (!TestUtils.isAttestationSupported()) {
return;
}
@@ -191,23 +205,37 @@
if (getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_PC))
return;
- // Note: Curve and key sizes arrays must correspond.
- String[] curves = {
- "secp224r1", "secp256r1", "secp384r1", "secp521r1"
- };
- int[] keySizes = {
- 224, 256, 384, 521
- };
- byte[][] challenges = {
- new byte[0], // empty challenge
- "challenge".getBytes(), // short challenge
- new byte[128], // long challenge
- };
- int[] purposes = {
+ final int[] purposes = {
KM_PURPOSE_SIGN, KM_PURPOSE_VERIFY, KM_PURPOSE_SIGN | KM_PURPOSE_VERIFY
};
- boolean[] devicePropertiesAttestationValues = {true, false};
- boolean[] includeValidityDatesValues = {true, false};
+ final boolean[] devicePropertiesAttestationValues = {true, false};
+ final boolean[] includeValidityDatesValues = {true, false};
+ final String[] curves;
+ final int[] keySizes;
+ final byte[][] challenges;
+
+ if (isStrongBox) {
+ // StrongBox only supports secp256r1 keys.
+ curves = new String[] {"secp256r1"};
+ keySizes = new int[] {256};
+ challenges = new byte[][] {
+ // Empty challange is not accepted by StrongBox.
+ "challenge".getBytes(), // short challenge
+ new byte[128], // long challenge
+ };
+ } else {
+ curves = new String[] {
+ "secp224r1", "secp256r1", "secp384r1", "secp521r1"
+ };
+ keySizes = new int[]{
+ 224, 256, 384, 521
+ };
+ challenges = new byte[][]{
+ new byte[0], // empty challenge
+ "challenge".getBytes(), // short challenge
+ new byte[128], // long challenge
+ };
+ }
for (int curveIndex = 0; curveIndex < curves.length; ++curveIndex) {
for (int challengeIndex = 0; challengeIndex < challenges.length; ++challengeIndex) {
@@ -217,7 +245,8 @@
try {
testEcAttestation(challenges[challengeIndex], includeValidityDates,
curves[curveIndex], keySizes[curveIndex],
- purposes[purposeIndex], devicePropertiesAttestation);
+ purposes[purposeIndex], devicePropertiesAttestation,
+ isStrongBox);
} catch (Throwable e) {
boolean isIdAttestationFailure =
(e.getCause() instanceof KeyStoreException)
@@ -267,6 +296,17 @@
@Test
public void testEcAttestation_TooLargeChallenge() throws Exception {
+ testEcAttestation_TooLargeChallenge(false);
+ }
+
+ @Test
+ public void testEcAttestation_TooLargeChallenge_StrongBox() throws Exception {
+ assumeTrue("This test is only applicable to devices with StrongBox",
+ TestUtils.hasStrongBox(getContext()));
+ testEcAttestation_TooLargeChallenge(true);
+ }
+
+ private void testEcAttestation_TooLargeChallenge(boolean isStrongBox) throws Exception {
if (!TestUtils.isAttestationSupported()) {
return;
}
@@ -275,7 +315,7 @@
for (boolean devicePropertiesAttestation : devicePropertiesAttestationValues) {
try {
testEcAttestation(new byte[129], true /* includeValidityDates */, "secp256r1", 256,
- KM_PURPOSE_SIGN, devicePropertiesAttestation);
+ KM_PURPOSE_SIGN, devicePropertiesAttestation, isStrongBox);
fail("Attestation challenges larger than 128 bytes should be rejected");
} catch (ProviderException e) {
KeyStoreException cause = (KeyStoreException) e.getCause();
@@ -296,6 +336,17 @@
@Test
public void testEcAttestation_NoChallenge() throws Exception {
+ testEcAttestation_NoChallenge(false);
+ }
+
+ @Test
+ public void testEcAttestation_NoChallenge_StrongBox() throws Exception {
+ assumeTrue("This test is only applicable to devices with StrongBox",
+ TestUtils.hasStrongBox(getContext()));
+ testEcAttestation_NoChallenge(true);
+ }
+
+ public void testEcAttestation_NoChallenge(boolean isStrongBox) throws Exception {
boolean[] devicePropertiesAttestationValues = {true, false};
for (boolean devicePropertiesAttestation : devicePropertiesAttestationValues) {
String keystoreAlias = "test_key";
@@ -310,6 +361,7 @@
.setKeyValidityForOriginationEnd(originationEnd)
.setKeyValidityForConsumptionEnd(consumptionEnd)
.setDevicePropertiesAttestationIncluded(devicePropertiesAttestation)
+ .setIsStrongBoxBacked(isStrongBox)
.build();
generateKeyPair(KEY_ALGORITHM_EC, spec);
@@ -386,7 +438,6 @@
public void testEcAttestation_DeviceLockedStrongbox() throws Exception {
if (!TestUtils.hasStrongBox(getContext()))
return;
-
testEcAttestation_DeviceLocked(true /* expectStrongBox */);
}
@@ -395,43 +446,7 @@
if (getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_PC))
return;
- String keystoreAlias = "test_key";
- Date now = new Date();
- Date originationEnd = new Date(now.getTime() + ORIGINATION_TIME_OFFSET);
- Date consumptionEnd = new Date(now.getTime() + CONSUMPTION_TIME_OFFSET);
- KeyGenParameterSpec.Builder builder =
- new KeyGenParameterSpec.Builder(keystoreAlias, PURPOSE_SIGN)
- .setAlgorithmParameterSpec(new ECGenParameterSpec("secp256r1"))
- .setAttestationChallenge(new byte[128])
- .setKeyValidityStart(now)
- .setKeyValidityForOriginationEnd(originationEnd)
- .setKeyValidityForConsumptionEnd(consumptionEnd);
-
- generateKeyPair(KEY_ALGORITHM_EC, builder.build());
-
- KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");
- keyStore.load(null);
-
- try {
- Certificate certificates[] = keyStore.getCertificateChain(keystoreAlias);
- verifyCertificateChain(certificates, false /* expectStrongBox */);
- X509Certificate attestationCert = (X509Certificate) certificates[0];
- Attestation attestation = Attestation.loadFromCertificate(attestationCert);
- int kmVersionFromAttestation = attestation.keymasterVersion;
- int keyStoreFeatureVersion = TestUtils.getFeatureVersionKeystore(getContext());
-
- // Feature Version is required on devices launching with Android 12 (API Level
- // 31) but may be reported on devices launching with an earlier version. If it's
- // present, it must match what is reported in attestation.
- if (PropertyUtil.getFirstApiLevel() >= 31) {
- assertNotEquals(0, keyStoreFeatureVersion);
- }
- if (keyStoreFeatureVersion != 0) {
- assertEquals(kmVersionFromAttestation, keyStoreFeatureVersion);
- }
- } finally {
- keyStore.deleteEntry(keystoreAlias);
- }
+ testAttestationKmVersionMatchesFeatureVersion(false);
}
@Test
@@ -448,18 +463,24 @@
return;
}
+ testAttestationKmVersionMatchesFeatureVersion(true);
+ }
+
+ private void testAttestationKmVersionMatchesFeatureVersion(boolean isStrongBox)
+ throws Exception {
+
String keystoreAlias = "test_key";
Date now = new Date();
Date originationEnd = new Date(now.getTime() + ORIGINATION_TIME_OFFSET);
Date consumptionEnd = new Date(now.getTime() + CONSUMPTION_TIME_OFFSET);
KeyGenParameterSpec.Builder builder =
- new KeyGenParameterSpec.Builder(keystoreAlias, PURPOSE_SIGN)
- .setAlgorithmParameterSpec(new ECGenParameterSpec("secp256r1"))
- .setAttestationChallenge(new byte[128])
- .setKeyValidityStart(now)
- .setKeyValidityForOriginationEnd(originationEnd)
- .setKeyValidityForConsumptionEnd(consumptionEnd)
- .setIsStrongBoxBacked(true);
+ new KeyGenParameterSpec.Builder(keystoreAlias, PURPOSE_SIGN)
+ .setAlgorithmParameterSpec(new ECGenParameterSpec("secp256r1"))
+ .setAttestationChallenge(new byte[128])
+ .setKeyValidityStart(now)
+ .setKeyValidityForOriginationEnd(originationEnd)
+ .setKeyValidityForConsumptionEnd(consumptionEnd)
+ .setIsStrongBoxBacked(isStrongBox);
generateKeyPair(KEY_ALGORITHM_EC, builder.build());
@@ -468,19 +489,27 @@
try {
Certificate certificates[] = keyStore.getCertificateChain(keystoreAlias);
- verifyCertificateChain(certificates, true /* expectStrongBox */);
+ verifyCertificateChain(certificates, isStrongBox /* expectStrongBox */);
X509Certificate attestationCert = (X509Certificate) certificates[0];
Attestation attestation = Attestation.loadFromCertificate(attestationCert);
int kmVersionFromAttestation = attestation.keymasterVersion;
+ int keyStoreFeatureVersion;
+ if (isStrongBox) {
+ keyStoreFeatureVersion =
+ TestUtils.getFeatureVersionKeystoreStrongBox(getContext());
+ } else {
+ keyStoreFeatureVersion =
+ TestUtils.getFeatureVersionKeystore(getContext());
+ }
// Feature Version is required on devices launching with Android 12 (API Level
// 31) but may be reported on devices launching with an earlier version. If it's
// present, it must match what is reported in attestation.
if (PropertyUtil.getFirstApiLevel() >= 31) {
- assertNotEquals(0, keyStoreFeatureVersionStrongBox);
+ assertNotEquals(0, keyStoreFeatureVersion);
}
- if (keyStoreFeatureVersionStrongBox != 0) {
- assertEquals(kmVersionFromAttestation, keyStoreFeatureVersionStrongBox);
+ if (keyStoreFeatureVersion != 0) {
+ assertEquals(kmVersionFromAttestation, keyStoreFeatureVersion);
}
} finally {
keyStore.deleteEntry(keystoreAlias);
@@ -489,12 +518,26 @@
@Test
public void testEcAttestation_KeyStoreExceptionWhenRequestingUniqueId() throws Exception {
+ testEcAttestation_KeyStoreExceptionWhenRequestingUniqueId(false);
+ }
+
+ @Test
+ public void testEcAttestation_KeyStoreExceptionWhenRequestingUniqueId_StrongBox()
+ throws Exception {
+ assumeTrue("This test is only applicable to devices with StrongBox",
+ TestUtils.hasStrongBox(getContext()));
+ testEcAttestation_KeyStoreExceptionWhenRequestingUniqueId(true);
+ }
+
+ private void testEcAttestation_KeyStoreExceptionWhenRequestingUniqueId(
+ boolean isStrongBox) throws Exception {
String keystoreAlias = "test_key";
KeyGenParameterSpec spec = new KeyGenParameterSpec.Builder(keystoreAlias, PURPOSE_SIGN)
.setAlgorithmParameterSpec(new ECGenParameterSpec("secp256r1"))
.setDigests(DIGEST_NONE, DIGEST_SHA256, DIGEST_SHA512)
.setAttestationChallenge(new byte[128])
.setUniqueIdIncluded(true)
+ .setIsStrongBoxBacked(isStrongBox)
.build();
try {
@@ -517,8 +560,21 @@
@Test
public void testEcAttestation_UniqueIdWorksWithCorrectPermission() throws Exception {
+ testEcAttestation_UniqueIdWorksWithCorrectPermission(false);
+ }
+ @Test
+ public void testEcAttestation_UniqueIdWorksWithCorrectPermission_StrongBox()
+ throws Exception {
+ assumeTrue("This test is only applicable to devices with StrongBox",
+ TestUtils.hasStrongBox(getContext()));
+ testEcAttestation_UniqueIdWorksWithCorrectPermission(true);
+ }
+
+ private void testEcAttestation_UniqueIdWorksWithCorrectPermission(boolean isStrongBox)
+ throws Exception {
assumeTrue("Device doesn't have secure lock screen",
TestUtils.hasSecureLockScreen(getContext()));
+ assumeTrue("Device does not support attestation", TestUtils.isAttestationSupported());
String keystoreAlias = "test_key";
KeyGenParameterSpec spec = new KeyGenParameterSpec.Builder(keystoreAlias, PURPOSE_SIGN)
@@ -526,6 +582,7 @@
.setDigests(DIGEST_NONE, DIGEST_SHA256, DIGEST_SHA512)
.setAttestationChallenge(new byte[128])
.setUniqueIdIncluded(true)
+ .setIsStrongBoxBacked(isStrongBox)
.build();
KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");
@@ -569,6 +626,18 @@
@RequiresDevice
@Test
public void testRsaAttestation() throws Exception {
+ testRsaAttestation(false);
+ }
+
+ @RequiresDevice
+ @Test
+ public void testRsaAttestation_StrongBox() throws Exception {
+ assumeTrue("This test is only applicable to devices with StrongBox",
+ TestUtils.hasStrongBox(getContext()));
+ testRsaAttestation(true);
+ }
+
+ private void testRsaAttestation(boolean isStrongBox) throws Exception {
if (!TestUtils.isAttestationSupported()) {
return;
}
@@ -576,34 +645,11 @@
if (getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_PC))
return;
- int[] keySizes = { // Smallish sizes to keep test runtimes down.
- 512, 768, 1024
- };
- byte[][] challenges = {
- new byte[0], // empty challenge
- "challenge".getBytes(), // short challenge
- new byte[128] // long challenge
- };
- int[] purposes = {
+ final int[] purposes = {
PURPOSE_SIGN | PURPOSE_VERIFY,
PURPOSE_ENCRYPT | PURPOSE_DECRYPT,
};
- String[][] encryptionPaddingModes = {
- {
- ENCRYPTION_PADDING_NONE
- },
- {
- ENCRYPTION_PADDING_RSA_OAEP,
- },
- {
- ENCRYPTION_PADDING_RSA_PKCS1,
- },
- {
- ENCRYPTION_PADDING_RSA_OAEP,
- ENCRYPTION_PADDING_RSA_PKCS1,
- },
- };
- String[][] signaturePaddingModes = {
+ final String[][] signaturePaddingModes = {
{
SIGNATURE_PADDING_RSA_PKCS1,
},
@@ -615,7 +661,55 @@
SIGNATURE_PADDING_RSA_PSS,
},
};
- boolean[] devicePropertiesAttestationValues = {true, false};
+ final boolean[] devicePropertiesAttestationValues = {true, false};
+ final int[] keySizes;
+ final byte[][] challenges;
+ final String[][] encryptionPaddingModes;
+
+ if (isStrongBox) {
+ // StrongBox has to support 2048 bit key.
+ keySizes = new int[] {2048};
+ challenges = new byte[][] {
+ "challenge".getBytes(), // short challenge
+ new byte[128] // long challenge
+ };
+ encryptionPaddingModes = new String [][] {
+ {
+ ENCRYPTION_PADDING_RSA_OAEP,
+ },
+ {
+ ENCRYPTION_PADDING_RSA_PKCS1,
+ },
+ {
+ ENCRYPTION_PADDING_RSA_OAEP,
+ ENCRYPTION_PADDING_RSA_PKCS1,
+ },
+ };
+ } else {
+ keySizes = new int[]{ // Smallish sizes to keep test runtimes down.
+ 512, 768, 1024
+ };
+ challenges = new byte[][]{
+ new byte[0], // empty challenge
+ "challenge".getBytes(), // short challenge
+ new byte[128] // long challenge
+ };
+ encryptionPaddingModes = new String[][]{
+ {
+ ENCRYPTION_PADDING_NONE
+ },
+ {
+ ENCRYPTION_PADDING_RSA_OAEP,
+ },
+ {
+ ENCRYPTION_PADDING_RSA_PKCS1,
+ },
+ {
+ ENCRYPTION_PADDING_RSA_OAEP,
+ ENCRYPTION_PADDING_RSA_PKCS1,
+ },
+ };
+ }
for (boolean devicePropertiesAttestation : devicePropertiesAttestationValues) {
for (int keySize : keySizes) {
@@ -623,10 +717,10 @@
for (int purpose : purposes) {
if (isEncryptionPurpose(purpose)) {
testRsaAttestations(keySize, challenge, purpose, encryptionPaddingModes,
- devicePropertiesAttestation);
+ devicePropertiesAttestation, isStrongBox);
} else {
testRsaAttestations(keySize, challenge, purpose, signaturePaddingModes,
- devicePropertiesAttestation);
+ devicePropertiesAttestation, isStrongBox);
}
}
}
@@ -636,6 +730,18 @@
@Test
public void testRsaAttestation_TooLargeChallenge() throws Exception {
+ testRsaAttestation_TooLargeChallenge(512, false);
+ }
+
+ @Test
+ public void testRsaAttestation_TooLargeChallenge_StrongBox() throws Exception {
+ assumeTrue("This test is only applicable to devices with StrongBox",
+ TestUtils.hasStrongBox(getContext()));
+ testRsaAttestation_TooLargeChallenge(2048, true);
+ }
+
+ private void testRsaAttestation_TooLargeChallenge(int keySize, boolean isStrongBox)
+ throws Exception {
if (!TestUtils.isAttestationSupported()) {
return;
}
@@ -643,10 +749,10 @@
boolean[] devicePropertiesAttestationValues = {true, false};
for (boolean devicePropertiesAttestation : devicePropertiesAttestationValues) {
try {
- testRsaAttestation(new byte[129], true /* includeValidityDates */, 512,
+ testRsaAttestation(new byte[129], true /* includeValidityDates */, keySize,
PURPOSE_SIGN,
null /* paddingModes; may be empty because we'll never test them */,
- devicePropertiesAttestation);
+ devicePropertiesAttestation, isStrongBox);
fail("Attestation challenges larger than 128 bytes should be rejected");
} catch(ProviderException e){
KeyStoreException cause = (KeyStoreException) e.getCause();
@@ -667,6 +773,17 @@
@Test
public void testRsaAttestation_NoChallenge() throws Exception {
+ testRsaAttestation_NoChallenge(false);
+ }
+
+ @Test
+ public void testRsaAttestation_NoChallenge_StrongBox() throws Exception {
+ assumeTrue("This test is only applicable to devices with StrongBox",
+ TestUtils.hasStrongBox(getContext()));
+ testRsaAttestation_NoChallenge(true);
+ }
+
+ private void testRsaAttestation_NoChallenge(boolean isStrongBox) throws Exception {
boolean[] devicePropertiesAttestationValues = {true, false};
for (boolean devicePropertiesAttestation : devicePropertiesAttestationValues) {
String keystoreAlias = "test_key";
@@ -680,6 +797,7 @@
.setKeyValidityForOriginationEnd(originationEnd)
.setKeyValidityForConsumptionEnd(consumptionEnd)
.setDevicePropertiesAttestationIncluded(devicePropertiesAttestation)
+ .setIsStrongBoxBacked(isStrongBox)
.build();
generateKeyPair(KEY_ALGORITHM_RSA, spec);
@@ -761,6 +879,17 @@
@Test
public void testAesAttestation() throws Exception {
+ testAesAttestation(false);
+ }
+
+ @Test
+ public void testAesAttestation_StrongBox() throws Exception {
+ assumeTrue("This test is only applicable to devices with StrongBox",
+ TestUtils.hasStrongBox(getContext()));
+ testAesAttestation(true);
+ }
+
+ private void testAesAttestation(boolean isStrongBox) throws Exception {
boolean[] devicePropertiesAttestationValues = {true, false};
for (boolean devicePropertiesAttestation : devicePropertiesAttestationValues) {
String keystoreAlias = "test_key";
@@ -770,6 +899,7 @@
.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE)
.setAttestationChallenge(new byte[0])
.setDevicePropertiesAttestationIncluded(devicePropertiesAttestation)
+ .setIsStrongBoxBacked(isStrongBox)
.build();
generateKey(spec, KeyProperties.KEY_ALGORITHM_AES);
@@ -785,11 +915,23 @@
@Test
public void testHmacAttestation() throws Exception {
+ testHmacAttestation(false);
+ }
+
+ @Test
+ public void testHmacAttestation_StrongBox() throws Exception {
+ assumeTrue("This test is only applicable to devices with StrongBox",
+ TestUtils.hasStrongBox(getContext()));
+ testHmacAttestation(true);
+ }
+
+ private void testHmacAttestation(boolean isStrongBox) throws Exception {
boolean[] devicePropertiesAttestationValues = {true, false};
for (boolean devicePropertiesAttestation : devicePropertiesAttestationValues) {
String keystoreAlias = "test_key";
KeyGenParameterSpec spec = new KeyGenParameterSpec.Builder(keystoreAlias, PURPOSE_SIGN)
.setDevicePropertiesAttestationIncluded(devicePropertiesAttestation)
+ .setIsStrongBoxBacked(isStrongBox)
.build();
generateKey(spec, KeyProperties.KEY_ALGORITHM_HMAC_SHA256);
@@ -805,13 +947,14 @@
}
private void testRsaAttestations(int keySize, byte[] challenge, int purpose,
- String[][] paddingModes, boolean devicePropertiesAttestation) throws Exception {
+ String[][] paddingModes, boolean devicePropertiesAttestation,
+ boolean isStrongBox) throws Exception {
for (String[] paddings : paddingModes) {
try {
testRsaAttestation(challenge, true /* includeValidityDates */, keySize, purpose,
- paddings, devicePropertiesAttestation);
+ paddings, devicePropertiesAttestation, isStrongBox);
testRsaAttestation(challenge, false /* includeValidityDates */, keySize, purpose,
- paddings, devicePropertiesAttestation);
+ paddings, devicePropertiesAttestation, isStrongBox);
} catch (Throwable e) {
boolean isIdAttestationFailure =
(e.getCause() instanceof KeyStoreException)
@@ -901,6 +1044,10 @@
if (!TestUtils.isAttestationSupported()) {
return;
}
+ assumeTrue("Curve25519 Key attestation supported from KeyMint v2 and above.",
+ getContext().getPackageManager()
+ .hasSystemFeature(PackageManager.FEATURE_HARDWARE_KEYSTORE,
+ Attestation.KM_VERSION_KEYMINT_2));
if (getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_PC)) {
return;
@@ -965,8 +1112,8 @@
@SuppressWarnings("deprecation")
private void testRsaAttestation(byte[] challenge, boolean includeValidityDates, int keySize,
- int purposes, String[] paddingModes, boolean devicePropertiesAttestation)
- throws Exception {
+ int purposes, String[] paddingModes, boolean devicePropertiesAttestation,
+ boolean isStrongBox) throws Exception {
Log.i(TAG, "RSA key attestation with: challenge " + Arrays.toString(challenge) +
" / includeValidityDates " + includeValidityDates + " / keySize " + keySize +
" / purposes " + purposes + " / paddingModes " + Arrays.toString(paddingModes) +
@@ -981,7 +1128,8 @@
.setKeySize(keySize)
.setDigests(DIGEST_NONE, DIGEST_SHA256, DIGEST_SHA512)
.setAttestationChallenge(challenge)
- .setDevicePropertiesAttestationIncluded(devicePropertiesAttestation);
+ .setDevicePropertiesAttestationIncluded(devicePropertiesAttestation)
+ .setIsStrongBoxBacked(isStrongBox);
if (includeValidityDates) {
builder.setKeyValidityStart(startTime)
@@ -1004,13 +1152,14 @@
try {
Certificate certificates[] = keyStore.getCertificateChain(keystoreAlias);
- verifyCertificateChain(certificates, false /* expectStrongBox */);
+ verifyCertificateChain(certificates, isStrongBox /* expectStrongBox */);
X509Certificate attestationCert = (X509Certificate) certificates[0];
Attestation attestation = Attestation.loadFromCertificate(attestationCert);
checkRsaKeyDetails(attestation, keySize, purposes,
- ImmutableSet.copyOf(paddingModes));
+ (paddingModes == null)
+ ? new HashSet<String>() : ImmutableSet.copyOf(paddingModes));
checkKeyUsage(attestationCert, purposes);
checkKeyIndependentAttestationInfo(challenge, purposes, startTime,
includeValidityDates, devicePropertiesAttestation, attestation);
@@ -1038,7 +1187,8 @@
@SuppressWarnings("deprecation")
private void testEcAttestation(byte[] challenge, boolean includeValidityDates, String ecCurve,
- int keySize, int purposes, boolean devicePropertiesAttestation) throws Exception {
+ int keySize, int purposes, boolean devicePropertiesAttestation,
+ boolean isStrongBox) throws Exception {
Log.i(TAG, "EC key attestation with: challenge " + Arrays.toString(challenge) +
" / includeValidityDates " + includeValidityDates + " / ecCurve " + ecCurve +
" / keySize " + keySize + " / purposes " + purposes +
@@ -1053,7 +1203,8 @@
.setAlgorithmParameterSpec(new ECGenParameterSpec(ecCurve))
.setDigests(DIGEST_NONE, DIGEST_SHA256, DIGEST_SHA512)
.setAttestationChallenge(challenge)
- .setDevicePropertiesAttestationIncluded(devicePropertiesAttestation);
+ .setDevicePropertiesAttestationIncluded(devicePropertiesAttestation)
+ .setIsStrongBoxBacked(isStrongBox);
if (includeValidityDates) {
builder.setKeyValidityStart(startTime)
@@ -1068,7 +1219,7 @@
try {
Certificate certificates[] = keyStore.getCertificateChain(keystoreAlias);
- verifyCertificateChain(certificates, false /* expectStrongBox */);
+ verifyCertificateChain(certificates, isStrongBox /* expectStrongBox */);
X509Certificate attestationCert = (X509Certificate) certificates[0];
Attestation attestation = Attestation.loadFromCertificate(attestationCert);
@@ -1106,7 +1257,8 @@
Attestation attestation) {
final AuthorizationList keyDetailsList;
final AuthorizationList nonKeyDetailsList;
- if (attestation.getKeymasterSecurityLevel() == KM_SECURITY_LEVEL_TRUSTED_ENVIRONMENT) {
+ if (attestation.getKeymasterSecurityLevel() == KM_SECURITY_LEVEL_TRUSTED_ENVIRONMENT
+ || attestation.getKeymasterSecurityLevel() == KM_SECURITY_LEVEL_STRONG_BOX) {
keyDetailsList = attestation.getTeeEnforced();
nonKeyDetailsList = attestation.getSoftwareEnforced();
} else {
@@ -1445,6 +1597,20 @@
checkSystemPatchLevel(teeEnforced.getOsPatchLevel(), systemPatchLevel);
break;
+ case KM_SECURITY_LEVEL_STRONG_BOX:
+ assertThat("StrongBox attestation can only come from StrongBox keymaster",
+ attestation.getKeymasterSecurityLevel(),
+ is(KM_SECURITY_LEVEL_STRONG_BOX));
+ assertThat("KeyMaster version is not valid.", attestation.getKeymasterVersion(),
+ either(is(2)).or(is(3)).or(is(4)).or(is(41))
+ .or(is(100)).or(is(200)).or(is(300)));
+
+ checkRootOfTrust(attestation, false /* requireLocked */);
+ assertThat("StrongBox enforced OS version and system OS version must be same.",
+ teeEnforced.getOsVersion(), is(systemOsVersion));
+ checkSystemPatchLevel(teeEnforced.getOsPatchLevel(), systemPatchLevel);
+ break;
+
case KM_SECURITY_LEVEL_SOFTWARE:
if (attestation
.getKeymasterSecurityLevel() == KM_SECURITY_LEVEL_TRUSTED_ENVIRONMENT) {
@@ -1616,7 +1782,8 @@
Set<String> expectedPaddingModes) throws CertificateParsingException {
AuthorizationList keyDetailsList;
AuthorizationList nonKeyDetailsList;
- if (attestation.getKeymasterSecurityLevel() == KM_SECURITY_LEVEL_TRUSTED_ENVIRONMENT) {
+ if (attestation.getKeymasterSecurityLevel() == KM_SECURITY_LEVEL_TRUSTED_ENVIRONMENT
+ || attestation.getKeymasterSecurityLevel() == KM_SECURITY_LEVEL_STRONG_BOX) {
keyDetailsList = attestation.getTeeEnforced();
nonKeyDetailsList = attestation.getSoftwareEnforced();
} else {
@@ -1663,7 +1830,8 @@
private void checkEcKeyDetails(Attestation attestation, String ecCurve, int keySize) {
AuthorizationList keyDetailsList;
AuthorizationList nonKeyDetailsList;
- if (attestation.getKeymasterSecurityLevel() == KM_SECURITY_LEVEL_TRUSTED_ENVIRONMENT) {
+ if (attestation.getKeymasterSecurityLevel() == KM_SECURITY_LEVEL_TRUSTED_ENVIRONMENT
+ || attestation.getKeymasterSecurityLevel() == KM_SECURITY_LEVEL_STRONG_BOX) {
keyDetailsList = attestation.getTeeEnforced();
nonKeyDetailsList = attestation.getSoftwareEnforced();
} else {
diff --git a/tests/tests/keystore/src/android/keystore/cts/KeyFactoryTest.java b/tests/tests/keystore/src/android/keystore/cts/KeyFactoryTest.java
index 8c6759d..c73cc1b 100644
--- a/tests/tests/keystore/src/android/keystore/cts/KeyFactoryTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/KeyFactoryTest.java
@@ -97,6 +97,8 @@
// XDH is also a supported algorithm, but not available for other tests as the keys
// generated with it have more limited set of uses.
expectedAlgsLowerCase.add("xdh");
+ // AndroidKeyStore supports key generation of curve 25519
+ expectedAlgsLowerCase.add("ed25519");
for (Service service : services) {
if ("KeyFactory".equalsIgnoreCase(service.getType())) {
String algLowerCase = service.getAlgorithm().toLowerCase(Locale.US);
diff --git a/tests/tests/keystore/src/android/keystore/cts/KeyGenParameterSpecTest.java b/tests/tests/keystore/src/android/keystore/cts/KeyGenParameterSpecTest.java
index b05780f..0350987 100644
--- a/tests/tests/keystore/src/android/keystore/cts/KeyGenParameterSpecTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/KeyGenParameterSpecTest.java
@@ -72,7 +72,7 @@
spec.getDigests();
fail();
} catch (IllegalStateException expected) {}
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
assertFalse(spec.isMgf1DigestsSpecified());
assertThrows(IllegalStateException.class, spec::getMgf1Digests);
}
@@ -141,7 +141,7 @@
.setUnlockedDeviceRequired(true)
.setMaxUsageCount(maxUsageCount);
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
specBuilder.setMgf1Digests(KeyProperties.DIGEST_SHA256, KeyProperties.DIGEST_SHA384);
}
KeyGenParameterSpec spec = specBuilder.build();
@@ -159,7 +159,7 @@
assertTrue(spec.isDigestsSpecified());
MoreAsserts.assertContentsInOrder(Arrays.asList(spec.getDigests()),
KeyProperties.DIGEST_SHA256, KeyProperties.DIGEST_SHA384);
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
assertTrue(spec.isMgf1DigestsSpecified());
/* Since getMgf1Digest return type is Set, objects could be in any order. */
MoreAsserts.assertContentsInAnyOrder(spec.getMgf1Digests(),
@@ -284,7 +284,7 @@
.setKeyValidityForConsumptionEnd(keyValidityEndDateForConsumption)
.setSignaturePaddings(signaturePaddings);
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
specBuilder.setMgf1Digests(mgfDigests);
}
KeyGenParameterSpec spec = specBuilder.build();
@@ -305,7 +305,7 @@
digests[1] = null;
assertEquals(Arrays.asList(originalDigests), Arrays.asList(spec.getDigests()));
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
assertTrue(Arrays.asList(originalMgfDigests).containsAll(spec.getMgf1Digests()));
mgfDigests[1] = null;
assertTrue(Arrays.asList(originalMgfDigests).containsAll(spec.getMgf1Digests()));
@@ -360,7 +360,7 @@
KeyProperties.SIGNATURE_PADDING_RSA_PSS,
KeyProperties.SIGNATURE_PADDING_RSA_PKCS1);
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
specBuilder.setMgf1Digests(KeyProperties.DIGEST_SHA256, KeyProperties.DIGEST_SHA512);
}
KeyGenParameterSpec spec = specBuilder.build();
diff --git a/tests/tests/keystore/src/android/keystore/cts/KeyInfoTest.java b/tests/tests/keystore/src/android/keystore/cts/KeyInfoTest.java
index cc6e03a..2864483 100644
--- a/tests/tests/keystore/src/android/keystore/cts/KeyInfoTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/KeyInfoTest.java
@@ -18,12 +18,23 @@
import static org.junit.Assert.assertEquals;
+import android.keystore.cts.util.ImportedKey;
+import android.keystore.cts.util.TestUtils;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.security.keystore.KeyGenParameterSpec;
import android.security.keystore.KeyInfo;
import android.security.keystore.KeyProperties;
+import android.security.keystore.KeyProtection;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
@@ -32,15 +43,17 @@
import java.util.Arrays;
import java.util.Date;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
@RunWith(AndroidJUnit4.class)
public class KeyInfoTest {
private static final String KEY_ALIAS = KeyInfoTest.class.getSimpleName();
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
+
@Test
public void testImmutabilityViaGetterReturnValues() throws Exception {
// Assert that none of the mutable return values from getters modify the state of the
@@ -144,6 +157,32 @@
assertEquals(maxUsageCount, remainingUsageCount);
}
+ @RequiresFlagsEnabled(android.security.Flags.FLAG_KEYINFO_UNLOCKED_DEVICE_REQUIRED)
+ @Test
+ public void testUnlockedDeviceRequiredKey() throws Exception {
+ for (boolean required : new boolean[]{false, true}) {
+ // Test KeyInfo#isUnlockedDeviceRequired() for a generated key.
+ KeyGenerator keyGenerator = KeyGenerator.getInstance("AES", "AndroidKeyStore");
+ keyGenerator.init(new KeyGenParameterSpec.Builder(
+ KEY_ALIAS,
+ KeyProperties.PURPOSE_ENCRYPT)
+ .setUnlockedDeviceRequired(required)
+ .build());
+ SecretKey key = keyGenerator.generateKey();
+ assertEquals(required, TestUtils.getKeyInfo(key).isUnlockedDeviceRequired());
+
+ // Test KeyInfo#isUnlockedDeviceRequired() for an imported key.
+ ImportedKey importedKey = TestUtils.importIntoAndroidKeyStore(KEY_ALIAS,
+ KeyGenerator.getInstance("AES").generateKey(),
+ new KeyProtection.Builder(KeyProperties.PURPOSE_ENCRYPT)
+ .setUnlockedDeviceRequired(required)
+ .build());
+ assertEquals(required,
+ TestUtils.getKeyInfo(importedKey.getKeystoreBackedEncryptionKey())
+ .isUnlockedDeviceRequired());
+ }
+ }
+
@After
public void tearDown() {
try {
diff --git a/tests/tests/keystore/src/android/keystore/cts/KeyPairGeneratorTest.java b/tests/tests/keystore/src/android/keystore/cts/KeyPairGeneratorTest.java
index a4466af..cfb635a 100644
--- a/tests/tests/keystore/src/android/keystore/cts/KeyPairGeneratorTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/KeyPairGeneratorTest.java
@@ -178,6 +178,8 @@
// XDH is also a supported algorithm, but not available for other tests as the keys
// generated with it have more limited set of uses.
expectedAlgsLowerCase.add("xdh");
+ // AndroidKeyStore supports key generation of curve 25519
+ expectedAlgsLowerCase.add("ed25519");
for (Service service : services) {
if ("KeyPairGenerator".equalsIgnoreCase(service.getType())) {
diff --git a/tests/tests/keystore/src/android/keystore/cts/KeyProtectionTest.java b/tests/tests/keystore/src/android/keystore/cts/KeyProtectionTest.java
index eb6f21d..0655b6b 100644
--- a/tests/tests/keystore/src/android/keystore/cts/KeyProtectionTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/KeyProtectionTest.java
@@ -53,7 +53,7 @@
spec.getDigests();
fail();
} catch (IllegalStateException expected) {}
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
assertFalse(spec.isMgf1DigestsSpecified());
assertThrows(IllegalStateException.class, spec::getMgf1Digests);
}
@@ -101,7 +101,7 @@
.setMaxUsageCount(maxUsageCount)
.setIsStrongBoxBacked(true);
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
specBuilder.setMgf1Digests(KeyProperties.DIGEST_SHA256, KeyProperties.DIGEST_SHA512);
}
KeyProtection spec = specBuilder.build();
@@ -113,7 +113,7 @@
assertTrue(spec.isDigestsSpecified());
MoreAsserts.assertContentsInOrder(Arrays.asList(spec.getDigests()),
KeyProperties.DIGEST_SHA256, KeyProperties.DIGEST_SHA512);
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
assertTrue(spec.isMgf1DigestsSpecified());
/* Since getMgf1Digest return type is Set, objects could be in any order. */
MoreAsserts.assertContentsInAnyOrder(spec.getMgf1Digests(),
@@ -214,7 +214,7 @@
.setKeyValidityForConsumptionEnd(keyValidityEndDateForConsumption)
.setSignaturePaddings(signaturePaddings);
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
specBuilder.setMgf1Digests(mgfDigests);
}
KeyProtection spec = specBuilder.build();
@@ -227,7 +227,7 @@
digests[1] = null;
assertEquals(Arrays.asList(originalDigests), Arrays.asList(spec.getDigests()));
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
assertTrue(Arrays.asList(originalMgfDigests).containsAll(spec.getMgf1Digests()));
mgfDigests[1] = null;
assertTrue(Arrays.asList(originalMgfDigests).containsAll(spec.getMgf1Digests()));
@@ -280,7 +280,7 @@
KeyProperties.SIGNATURE_PADDING_RSA_PSS,
KeyProperties.SIGNATURE_PADDING_RSA_PKCS1);
- if (Flags.mgf1DigestSetter()) {
+ if (Flags.mgf1DigestSetterV2()) {
specBuilder.setMgf1Digests(KeyProperties.DIGEST_SHA256, KeyProperties.DIGEST_SHA512);
}
KeyProtection spec = specBuilder.build();
diff --git a/tests/tests/keystore/src/android/keystore/cts/RSACipherTest.java b/tests/tests/keystore/src/android/keystore/cts/RSACipherTest.java
index 6c2658d..2a758d4 100644
--- a/tests/tests/keystore/src/android/keystore/cts/RSACipherTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/RSACipherTest.java
@@ -289,7 +289,7 @@
}
@Test
- @RequiresFlagsEnabled(android.security.Flags.FLAG_MGF1_DIGEST_SETTER)
+ @RequiresFlagsEnabled(android.security.Flags.FLAG_MGF1_DIGEST_SETTER_V2)
public void testRsaOaepDecryptWithWrongMGF1DigestFails() throws Exception {
Provider provider = Security.getProvider(EXPECTED_PROVIDER_NAME);
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA", "AndroidKeyStore");
diff --git a/tests/tests/keystore/src/android/keystore/cts/util/TestUtils.java b/tests/tests/keystore/src/android/keystore/cts/util/TestUtils.java
index 4b44c0d..2bf711f 100644
--- a/tests/tests/keystore/src/android/keystore/cts/util/TestUtils.java
+++ b/tests/tests/keystore/src/android/keystore/cts/util/TestUtils.java
@@ -1186,7 +1186,7 @@
.setUserAuthenticationRequired(isUserAuthRequired)
.setUserAuthenticationValidityDurationSeconds(3600)
.setUnlockedDeviceRequired(isUnlockedDeviceRequired);
- if (mgf1DigestList != null && android.security.Flags.mgf1DigestSetter()) {
+ if (mgf1DigestList != null && android.security.Flags.mgf1DigestSetterV2()) {
keyProtectionBuilder.setMgf1Digests(mgf1DigestList);
}
return keyProtectionBuilder.build();
diff --git a/tests/tests/libcoreapievolution/Android.bp b/tests/tests/libcoreapievolution/Android.bp
index 954f3a2..e21bfb5 100644
--- a/tests/tests/libcoreapievolution/Android.bp
+++ b/tests/tests/libcoreapievolution/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/libcorefileio/Android.bp b/tests/tests/libcorefileio/Android.bp
index b9db7d2..161eba4 100644
--- a/tests/tests/libcorefileio/Android.bp
+++ b/tests/tests/libcorefileio/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/libcorelegacy22/Android.bp b/tests/tests/libcorelegacy22/Android.bp
index 98684b2..d4b93cc 100644
--- a/tests/tests/libcorelegacy22/Android.bp
+++ b/tests/tests/libcorelegacy22/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/libnativehelper/OWNERS b/tests/tests/libnativehelper/OWNERS
index 8d9029d..1f28e02 100644
--- a/tests/tests/libnativehelper/OWNERS
+++ b/tests/tests/libnativehelper/OWNERS
@@ -1,4 +1,3 @@
# Bug component: 86431
mast@google.com
ngeoffray@google.com
-oth@google.com
diff --git a/tests/tests/libthermalndk/Android.bp b/tests/tests/libthermalndk/Android.bp
index c014942..88c3129 100644
--- a/tests/tests/libthermalndk/Android.bp
+++ b/tests/tests/libthermalndk/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_powermanager_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/libthermalndk/jni/Android.bp b/tests/tests/libthermalndk/jni/Android.bp
index 20e4d2c..eead979 100644
--- a/tests/tests/libthermalndk/jni/Android.bp
+++ b/tests/tests/libthermalndk/jni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_powermanager_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/match_flags/Android.bp b/tests/tests/match_flags/Android.bp
index 7efef0be..82e3bea 100644
--- a/tests/tests/match_flags/Android.bp
+++ b/tests/tests/match_flags/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -27,7 +28,7 @@
static_libs: [
"ctstestrunner-axt",
"compatibility-device-util-axt",
- "androidx.test.ext.junit",
+ "androidx.test.ext.junit",
],
srcs: ["src/**/*.java"],
diff --git a/tests/tests/match_flags/OWNERS b/tests/tests/match_flags/OWNERS
index d1eff73..a2f84ba 100644
--- a/tests/tests/match_flags/OWNERS
+++ b/tests/tests/match_flags/OWNERS
@@ -1,5 +1,5 @@
# Bug component: 36137
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
patb@google.com
-toddke@google.com
-chiuwinson@google.com
zyy@google.com
diff --git a/tests/tests/match_flags/app/a/Android.bp b/tests/tests/match_flags/app/a/Android.bp
index 1f084cb..1ee9251 100644
--- a/tests/tests/match_flags/app/a/Android.bp
+++ b/tests/tests/match_flags/app/a/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/match_flags/app/b/Android.bp b/tests/tests/match_flags/app/b/Android.bp
index 6124641..d143815 100644
--- a/tests/tests/match_flags/app/b/Android.bp
+++ b/tests/tests/match_flags/app/b/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/media/audio/Android.bp b/tests/tests/media/audio/Android.bp
index cf27b84..c022dfd 100644
--- a/tests/tests/media/audio/Android.bp
+++ b/tests/tests/media/audio/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// See: http://go/android-license-faq
default_applicable_licenses: [
"Android-Apache-2.0",
diff --git a/tests/tests/media/audio/jni/AudioPlayer.cpp b/tests/tests/media/audio/jni/AudioPlayer.cpp
index 9eb9b54..78f1538 100644
--- a/tests/tests/media/audio/jni/AudioPlayer.cpp
+++ b/tests/tests/media/audio/jni/AudioPlayer.cpp
@@ -47,7 +47,7 @@
static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf /*bq*/, void *context)
{
// __android_log_print(ANDROID_LOG_INFO, TAG, "bqPlayerCallback()");
- ((ndkaudio::AudioPlayer*)context)->enqueBuffer();
+ ((ndkaudio::AudioPlayer*)context)->enqueueBuffer();
}
static void OpenSLEngine() {
@@ -257,7 +257,7 @@
// __android_log_print(ANDROID_LOG_INFO, TAG, "SetPlayState() result:%s", getSLErrStr(result));
assert(SL_RESULT_SUCCESS == result);
- enqueBuffer();
+ enqueueBuffer();
return result;
}
@@ -267,8 +267,8 @@
playing_ = false;
}
-SLresult AudioPlayer::enqueBuffer() {
- // __android_log_print(ANDROID_LOG_INFO, TAG, "AudioPlayer::enqueBuffer()");
+SLresult AudioPlayer::enqueueBuffer() {
+ // __android_log_print(ANDROID_LOG_INFO, TAG, "AudioPlayer::enqueueBuffer()");
if (playing_) {
//long dataSizeInSamples = source_->getData(time_++, playBuff_,
// numPlayBuffFrames_,
diff --git a/tests/tests/media/audio/jni/AudioPlayer.h b/tests/tests/media/audio/jni/AudioPlayer.h
index 57d48c7..70dcd66 100644
--- a/tests/tests/media/audio/jni/AudioPlayer.h
+++ b/tests/tests/media/audio/jni/AudioPlayer.h
@@ -47,7 +47,7 @@
// This is public because it needs to be called by the OpenSL ES callback, but it should not
// be called by anyone else.
- SLresult enqueBuffer();
+ SLresult enqueueBuffer();
SLPlayItf getPlayerObject() {
return bqPlayerPlay_;
diff --git a/tests/tests/media/audio/jni/AudioRecorder.cpp b/tests/tests/media/audio/jni/AudioRecorder.cpp
index 050c29d..f61f1b7 100644
--- a/tests/tests/media/audio/jni/AudioRecorder.cpp
+++ b/tests/tests/media/audio/jni/AudioRecorder.cpp
@@ -61,7 +61,7 @@
{
AudioRecorder* recorder = (AudioRecorder*)context;
// __android_log_print(ANDROID_LOG_INFO, TAG, "RecBufferQueueCallback()");
- recorder->enqueBuffer();
+ recorder->enqueueBuffer();
}
/*
@@ -213,7 +213,7 @@
// __android_log_print(ANDROID_LOG_INFO, TAG, "Enqueueing buffer");
//int bufferSizeInBytes = BUFFER_SIZE_IN_FRAMES * numChannels_ * sizeof(float);
- enqueBuffer();
+ enqueueBuffer();
/* ------------------------------------------------------ */
/* Start recording */
@@ -230,10 +230,10 @@
result = (*recorderItf_)->SetRecordState(recorderItf_, SL_RECORDSTATE_STOPPED);
}
-SLresult AudioRecorder::enqueBuffer() {
+SLresult AudioRecorder::enqueueBuffer() {
SLresult result;
int bufferSizeInBytes = numBufferSamples_ * sizeof(float);
- // __android_log_print(ANDROID_LOG_INFO, TAG, "Enque %d bytes", bufferSizeInBytes);
+ // __android_log_print(ANDROID_LOG_INFO, TAG, "Enqueue %d bytes", bufferSizeInBytes);
result = (*recBuffQueueItf_)->Enqueue(recBuffQueueItf_, recBuffer, bufferSizeInBytes);
assert(SL_RESULT_SUCCESS == result);
diff --git a/tests/tests/media/audio/jni/AudioRecorder.h b/tests/tests/media/audio/jni/AudioRecorder.h
index 93a03c3..486c493 100644
--- a/tests/tests/media/audio/jni/AudioRecorder.h
+++ b/tests/tests/media/audio/jni/AudioRecorder.h
@@ -50,7 +50,7 @@
}
// public, but don't call directly (called by the OSLES callback)
- SLresult enqueBuffer();
+ SLresult enqueueBuffer();
int GetNumBufferSamples() {
return numBufferSamples_;
diff --git a/tests/tests/media/audio/jni/audio-metadata-native.cpp b/tests/tests/media/audio/jni/audio-metadata-native.cpp
index 649bc89..8681cbe1 100644
--- a/tests/tests/media/audio/jni/audio-metadata-native.cpp
+++ b/tests/tests/media/audio/jni/audio-metadata-native.cpp
@@ -59,7 +59,7 @@
return nullptr;
}
audio_utils::metadata::Data d = audio_utils::metadata::dataFromByteString(
- audio_utils::metadata::ByteString(bytes, sizeInBytes));
+ audio_utils::metadata::ByteString(bytes, bytes + sizeInBytes));
audio_utils::metadata::ByteString bs = byteStringFromData(d);
diff --git a/tests/tests/media/audio/modules/audiorecordpermissiontests/Android.bp b/tests/tests/media/audio/modules/audiorecordpermissiontests/Android.bp
index bfd55c8..c6ce220 100644
--- a/tests/tests/media/audio/modules/audiorecordpermissiontests/Android.bp
+++ b/tests/tests/media/audio/modules/audiorecordpermissiontests/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// See: http://go/android-license-faq
default_applicable_licenses: [
"Android-Apache-2.0",
diff --git a/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi33/Android.bp b/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi33/Android.bp
index 5e28c16..ffb7832 100644
--- a/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi33/Android.bp
+++ b/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi33/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_audio_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi34/Android.bp b/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi34/Android.bp
index a25a4ed..0348e22 100644
--- a/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi34/Android.bp
+++ b/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi34/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_audio_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi34NoCap/Android.bp b/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi34NoCap/Android.bp
index 76a429b..7c62675 100644
--- a/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi34NoCap/Android.bp
+++ b/tests/tests/media/audio/modules/audiorecordpermissiontests/app/CtsRecordServiceApi34NoCap/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_audio_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/media/audio/modules/audiorecordpermissiontests/lib/Android.bp b/tests/tests/media/audio/modules/audiorecordpermissiontests/lib/Android.bp
index dc8d2cb..13a6f20 100644
--- a/tests/tests/media/audio/modules/audiorecordpermissiontests/lib/Android.bp
+++ b/tests/tests/media/audio/modules/audiorecordpermissiontests/lib/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// See: http://go/android-license-faq
default_applicable_licenses: [
"Android-Apache-2.0",
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/AudioEffectTest.java b/tests/tests/media/audio/src/android/media/audio/cts/AudioEffectTest.java
index bf12cd8..85c7baf 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/AudioEffectTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/AudioEffectTest.java
@@ -16,6 +16,12 @@
package android.media.audio.cts;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.content.res.AssetFileDescriptor;
import android.media.AudioFormat;
import android.media.AudioManager;
@@ -26,17 +32,23 @@
import android.media.audiofx.AudioEffect;
import android.media.audiofx.EnvironmentalReverb;
import android.media.audiofx.PresetReverb;
-import android.media.cts.PostProcTestBase;
import android.os.Looper;
import android.platform.test.annotations.AppModeFull;
import android.util.Log;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.compatibility.common.util.NonMainlineTest;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.util.UUID;
@AppModeFull(reason = "Dynamic congic not supported")
@NonMainlineTest
+@RunWith(AndroidJUnit4.class)
public class AudioEffectTest extends PostProcTestBase {
private String TAG = "AudioEffectTest";
@@ -61,8 +73,8 @@
// AUDIOEFFECT TESTS:
//----------------------------------
- @Override
- protected void tearDown() throws Exception {
+ @After
+ public void tearDown() throws Exception {
releaseEffect();
terminateMediaPlayerLooper();
terminateListenerLooper();
@@ -73,6 +85,7 @@
//----------------------------------
//Test case 0.0: test queryEffects() and platfrom at least provides an Equalizer
+ @Test
public void test0_0QueryEffects() throws Exception {
AudioEffect.Descriptor[] desc = AudioEffect.queryEffects();
@@ -130,6 +143,7 @@
// Note: This test was removed because it used hidden api's.
//Test case 1.3: test getEnabled() failure when called on released effect
+ @Test
public void test1_3GetEnabledAfterRelease() throws Exception {
try {
AudioEffect effect = new AudioEffect(AudioEffect.EFFECT_TYPE_EQUALIZER,
@@ -152,10 +166,11 @@
}
//Test case 1.4: test contructor on mediaPlayer audio session
+ @Test
public void test1_4InsertOnMediaPlayer() throws Exception {
MediaPlayer mp = new MediaPlayer();
assertNotNull("could not create mediaplayer", mp);
- AssetFileDescriptor afd = mContext.getResources().openRawResourceFd(R.raw.testmp3);
+ AssetFileDescriptor afd = getContext().getResources().openRawResourceFd(R.raw.testmp3);
try {
mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
} finally {
@@ -174,6 +189,7 @@
}
//Test case 1.5: test auxiliary effect attachement on MediaPlayer
+ @Test
public void test1_5AuxiliaryOnMediaPlayer() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -184,7 +200,7 @@
waitForLooperInitialization_l();
mError = 0;
- AssetFileDescriptor afd = mContext.getResources().openRawResourceFd(R.raw.testmp3);
+ AssetFileDescriptor afd = getContext().getResources().openRawResourceFd(R.raw.testmp3);
try {
mMediaPlayer.setDataSource(afd.getFileDescriptor(),
afd.getStartOffset(),
@@ -212,6 +228,7 @@
}
//Test case 1.6: test auxiliary effect attachement failure before setDatasource
+ @Test
public void test1_6AuxiliaryOnMediaPlayerFailure() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -246,6 +263,7 @@
//Test case 1.7: test auxiliary effect attachement on AudioTrack
+ @Test
public void test1_7AuxiliaryOnAudioTrack() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -290,6 +308,7 @@
//Test case 2.0: test setEnabled() and getEnabled() in valid state
+ @Test
public void test2_0SetEnabledGetEnabled() throws Exception {
try {
AudioEffect effect = new AudioEffect(AudioEffect.EFFECT_TYPE_EQUALIZER,
@@ -317,6 +336,7 @@
}
//Test case 2.1: test setEnabled() throws exception after release
+ @Test
public void test2_1SetEnabledAfterRelease() throws Exception {
try {
AudioEffect effect = new AudioEffect(AudioEffect.EFFECT_TYPE_EQUALIZER,
@@ -343,6 +363,7 @@
//----------------------------------
//Test case 3.0: test setParameter(byte[], byte[]) / getParameter(byte[], byte[])
+ @Test
public void test3_0SetParameterByteArrayByteArray() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -377,6 +398,7 @@
}
//Test case 3.1: test setParameter(int, int) / getParameter(int, int[])
+ @Test
public void test3_1SetParameterIntInt() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -411,6 +433,7 @@
}
//Test case 3.2: test setParameter(int, short) / getParameter(int, short[])
+ @Test
public void test3_2SetParameterIntShort() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -443,6 +466,7 @@
}
//Test case 3.3: test setParameter(int, byte[]) / getParameter(int, byte[])
+ @Test
public void test3_3SetParameterIntByteArray() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -479,6 +503,7 @@
}
//Test case 3.4: test setParameter(int[], int[]) / getParameter(int[], int[])
+ @Test
public void test3_4SetParameterIntArrayIntArray() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -516,6 +541,7 @@
//Test case 3.5: test setParameter(int[], short[]) / getParameter(int[], short[])
+ @Test
public void test3_5SetParameterIntArrayShortArray() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -550,6 +576,7 @@
}
//Test case 3.6: test setParameter(int[], byte[]) / getParameter(int[], byte[])
+ @Test
public void test3_6SetParameterIntArrayByteArray() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -587,6 +614,7 @@
}
//Test case 3.7: test setParameter() throws exception after release()
+ @Test
public void test3_7SetParameterAfterRelease() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -615,6 +643,7 @@
}
//Test case 3.8: test getParameter() throws exception after release()
+ @Test
public void test3_8GetParameterAfterRelease() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -648,6 +677,7 @@
//----------------------------------
//Test case 4.0: test control passed to higher priority client
+ @Test
public void test4_0setEnabledLowerPriority() throws Exception {
AudioEffect effect1 = null;
AudioEffect effect2 = null;
@@ -668,6 +698,7 @@
assertFalse("Effect1 has control", effect1.hasControl());
assertTrue("Effect1 can enable",
effect1.setEnabled(true) == AudioEffect.ERROR_INVALID_OPERATION);
+ // Note: all effects under test are disabled at setup
assertFalse("Effect1 has enabled", effect2.getEnabled());
} catch (IllegalArgumentException e) {
@@ -685,6 +716,7 @@
}
//Test case 4.1: test control passed to higher priority client
+ @Test
public void test4_1setParameterLowerPriority() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -737,6 +769,7 @@
}
//Test case 4.2: test control status listener
+ @Test
public void test4_2ControlStatusListener() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -762,6 +795,7 @@
}
//Test case 4.3: test enable status listener
+ @Test
public void test4_3EnableStatusListener() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -791,6 +825,7 @@
}
//Test case 4.4: test parameter changed listener
+ @Test
public void test4_4ParameterChangedListener() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -827,6 +862,7 @@
//Test case 5.0: test command method
+ @Test
public void test5_0Command() throws Exception {
if (!isPresetReverbAvailable()) {
return;
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/AudioHalVersionInfoTest.java b/tests/tests/media/audio/src/android/media/audio/cts/AudioHalVersionInfoTest.java
index d2c0599..c6b4629 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/AudioHalVersionInfoTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/AudioHalVersionInfoTest.java
@@ -123,11 +123,14 @@
*/
@Test
public void test_VERSIONS_contains() throws Exception {
+ // supported AIDL versions
+ assertTrue(AudioHalVersionInfo.VERSIONS.contains(AudioHalVersionInfo.AIDL_1_0));
+
+ // supported HIDL versions
assertTrue(AudioHalVersionInfo.VERSIONS.contains(AudioHalVersionInfo.HIDL_7_1));
assertTrue(AudioHalVersionInfo.VERSIONS.contains(AudioHalVersionInfo.HIDL_7_0));
assertTrue(AudioHalVersionInfo.VERSIONS.contains(AudioHalVersionInfo.HIDL_6_0));
assertTrue(AudioHalVersionInfo.VERSIONS.contains(AudioHalVersionInfo.HIDL_5_0));
- assertTrue(AudioHalVersionInfo.VERSIONS.contains(AudioHalVersionInfo.HIDL_4_0));
}
/**
@@ -136,9 +139,7 @@
*/
@Test
public void test_VERSIONS_not_contains() throws Exception {
- // TODO: move AIDL to test_VERSIONS_contains() once we support AIDL.
- assertFalse(AudioHalVersionInfo.VERSIONS.contains(AudioHalVersionInfo.AIDL_1_0));
-
assertFalse(AudioHalVersionInfo.VERSIONS.contains(AudioHalVersionInfo.HIDL_2_0));
+ assertFalse(AudioHalVersionInfo.VERSIONS.contains(AudioHalVersionInfo.HIDL_4_0));
}
}
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/AudioPlaybackConfigurationTest.java b/tests/tests/media/audio/src/android/media/audio/cts/AudioPlaybackConfigurationTest.java
index 5cd9c8d..0c5e089 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/AudioPlaybackConfigurationTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/AudioPlaybackConfigurationTest.java
@@ -682,6 +682,12 @@
AudioManager am = new AudioManager(getContext());
assertNotNull("Could not create AudioManager", am);
+ boolean isMuted = am.isStreamMute(TEST_STREAM_FOR_USAGE);
+ if (isMuted) {
+ am.adjustStreamVolume(TEST_STREAM_FOR_USAGE, ADJUST_UNMUTE, 0);
+ }
+ Thread.sleep(TEST_TIMING_TOLERANCE_MS + PLAY_ROUTING_TIMING_TOLERANCE_MS);
+
MyAudioPlaybackCallback callback = new MyAudioPlaybackCallback();
try {
@@ -726,6 +732,10 @@
} finally {
am.unregisterAudioPlaybackCallback(callback);
unmute.run();
+
+ if (isMuted) {
+ am.adjustStreamVolume(TEST_STREAM_FOR_USAGE, ADJUST_MUTE, 0);
+ }
}
}
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/AudioTrackSurroundTest.java b/tests/tests/media/audio/src/android/media/audio/cts/AudioTrackSurroundTest.java
index 6489843..c4ba5f5 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/AudioTrackSurroundTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/AudioTrackSurroundTest.java
@@ -18,9 +18,13 @@
import android.annotation.RawRes;
import android.content.Context;
-import android.media.AudioDeviceInfo;
+import android.content.pm.PackageManager;
+import android.content.res.AssetFileDescriptor;
+import android.content.res.Resources;
+import android.media.AudioAttributes;
import android.media.AudioFormat;
import android.media.AudioManager;
+import android.media.AudioProfile;
import android.media.AudioTimestamp;
import android.media.AudioTrack;
import android.media.audio.cts.R;
@@ -36,6 +40,7 @@
import java.nio.ByteOrder;
import java.nio.ShortBuffer;
import java.util.ArrayList;
+import java.util.List;
import java.util.Random;
// Test the Java AudioTrack surround sound and HDMI passthrough.
@@ -54,14 +59,9 @@
// AC3 and IEC61937 tracks require more time
private static final long SAMPLE_RATE_LONG_TEST_DURATION_MILLIS = 12000;
- // Set this true to prefer the device that supports the particular encoding.
- // But note that as of 3/25/2016, a bug causes Direct tracks to fail.
- // So only set true when debugging that problem.
- private static final boolean USE_PREFERRED_DEVICE = false;
-
- // Should we fail if there is no PCM16 device reported by device enumeration?
+ // Should we fail if there is no PCM16 profile reported?
// This can happen if, for example, an ATV set top box does not have its HDMI cable plugged in.
- private static final boolean REQUIRE_PCM_DEVICE = false;
+ private static final boolean REQUIRE_PCM_PROFILE = false;
private final static long NANOS_PER_MILLISECOND = 1000000L;
private final static int MILLIS_PER_SECOND = 1000;
@@ -74,14 +74,15 @@
private static int mLastPlayedEncoding = AudioFormat.ENCODING_INVALID;
- // Devices that support various encodings.
- private static boolean mDeviceScanComplete = false;
- private static AudioDeviceInfo mInfoPCM16 = null;
- private static AudioDeviceInfo mInfoAC3 = null;
- private static AudioDeviceInfo mInfoE_AC3 = null;
- private static AudioDeviceInfo mInfoDTS = null;
- private static AudioDeviceInfo mInfoDTS_HD = null;
- private static AudioDeviceInfo mInfoIEC61937 = null;
+ // Profiles that support various encodings.
+ private static AudioProfile mProfilePCM16 = null;
+ private static AudioProfile mProfileAC3 = null;
+ private static AudioProfile mProfileE_AC3 = null;
+ private static AudioProfile mProfileDTS = null;
+ private static AudioProfile mProfileDTS_HD = null;
+ private static AudioProfile mProfileIEC61937 = null;
+
+ private static AudioAttributes mAudioAttributes = null;
private static void log(String testName, String message) {
Log.i(TAG, "[" + testName + "] " + message);
@@ -101,66 +102,56 @@
// Note that I tried to only scan for encodings once but the static
// data did not persist properly. That may be a bug.
// For now, just scan before every test.
- scanDevicesForEncodings();
+ scanProfilesForEncodings();
}
- private void scanDevicesForEncodings() throws Exception {
- final String MTAG = "scanDevicesForEncodings";
- // Scan devices to see which encodings are supported.
+ private void scanProfilesForEncodings() throws Exception {
+ final String MTAG = "scanProfilesForEncodings";
+ // Scan profiles to see which encodings are supported.
AudioManager audioManager = (AudioManager) getContext()
.getSystemService(Context.AUDIO_SERVICE);
- AudioDeviceInfo[] infos = audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS);
- for (AudioDeviceInfo info : infos) {
- log(MTAG, "scanning devices, name = " + info.getProductName()
- + ", id = " + info.getId()
- + ", " + (info.isSink() ? "sink" : "source")
- + ", type = " + info.getType()
- + " ------");
- String text = "{";
- for (int encoding : info.getEncodings()) {
- text += String.format("0x%08X, ", encoding);
- }
- text += "}";
- log(MTAG, " encodings = " + text);
- text = "{";
- for (int rate : info.getSampleRates()) {
- text += rate + ", ";
- }
- text += "}";
- log(MTAG, " sample rates = " + text);
- if (info.isSink()) {
- for (int encoding : info.getEncodings()) {
- switch (encoding) {
- case AudioFormat.ENCODING_PCM_16BIT:
- mInfoPCM16 = info;
- log(MTAG, "mInfoPCM16 set to " + info);
- break;
- case AudioFormat.ENCODING_AC3:
- mInfoAC3 = info;
- log(MTAG, "mInfoAC3 set to " + info);
- break;
- case AudioFormat.ENCODING_E_AC3:
- mInfoE_AC3 = info;
- log(MTAG, "mInfoE_AC3 set to " + info);
- break;
- case AudioFormat.ENCODING_DTS:
- mInfoDTS = info;
- log(MTAG, "mInfoDTS set to " + info);
- break;
- case AudioFormat.ENCODING_DTS_HD:
- mInfoDTS_HD = info;
- log(MTAG, "mInfoDTS_HD set to " + info);
- break;
- case AudioFormat.ENCODING_IEC61937:
- mInfoIEC61937 = info;
- log(MTAG, "mInfoIEC61937 set to " + info);
- break;
- default:
- // This is OK. It is just an encoding that we don't care about.
- break;
- }
+ mAudioAttributes = new AudioAttributes.Builder()
+ .setUsage(AudioAttributes.USAGE_MEDIA)
+ .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
+ .build();
+ List<AudioProfile> profiles = audioManager.getDirectProfilesForAttributes(mAudioAttributes);
+ if (profiles.size() == 0) {
+ log(MTAG, "no direct profiles for media + music found");
+ }
+ for (AudioProfile profile : profiles) {
+ log(MTAG, "scanning profiles, profile = " + profile.toString());
+ if (profile.getEncapsulationType() == AudioProfile.AUDIO_ENCAPSULATION_TYPE_IEC61937) {
+ mProfileIEC61937 = profile;
+ log(MTAG, "mProfileIEC61937 set to " + profile);
+ break;
+ } else { // AudioProfile.AUDIO_ENCAPSULATION_TYPE_NONE
+ switch (profile.getFormat()) {
+ case AudioFormat.ENCODING_PCM_16BIT:
+ mProfilePCM16 = profile;
+ log(MTAG, "mProfilePCM16 set to " + profile);
+ break;
+ case AudioFormat.ENCODING_AC3:
+ mProfileAC3 = profile;
+ log(MTAG, "mProfileAC3 set to " + profile);
+ break;
+ case AudioFormat.ENCODING_E_AC3:
+ mProfileE_AC3 = profile;
+ log(MTAG, "mProfileE_AC3 set to " + profile);
+ break;
+ case AudioFormat.ENCODING_DTS:
+ mProfileDTS = profile;
+ log(MTAG, "mProfileDTS set to " + profile);
+ break;
+ case AudioFormat.ENCODING_DTS_HD:
+ mProfileDTS_HD = profile;
+ log(MTAG, "mProfileDTS_HD set to " + profile);
+ break;
+ default:
+ // This is OK. It is just an encoding that we don't care about.
+ break;
}
}
+
}
}
@@ -347,42 +338,8 @@
// Add a warning to the assert message that might help folks figure out why their
// PCM test is failing.
private String getPcmWarning() {
- return (mInfoPCM16 == null && AudioFormat.isEncodingLinearPcm(mEncoding))
- ? " (No PCM device!)" : "";
- }
-
- /**
- * Use a device that we know supports the current encoding.
- */
- private void usePreferredDevice() {
- AudioDeviceInfo info = null;
- switch (mEncoding) {
- case AudioFormat.ENCODING_PCM_16BIT:
- info = mInfoPCM16;
- break;
- case AudioFormat.ENCODING_AC3:
- info = mInfoAC3;
- break;
- case AudioFormat.ENCODING_E_AC3:
- info = mInfoE_AC3;
- break;
- case AudioFormat.ENCODING_DTS:
- info = mInfoDTS;
- break;
- case AudioFormat.ENCODING_DTS_HD:
- info = mInfoDTS_HD;
- break;
- case AudioFormat.ENCODING_IEC61937:
- info = mInfoIEC61937;
- break;
- default:
- break;
- }
-
- if (info != null) {
- log(TAG, "track.setPreferredDevice(" + info + ")");
- mTrack.setPreferredDevice(info);
- }
+ return (mProfilePCM16 == null && AudioFormat.isEncodingLinearPcm(mEncoding))
+ ? " (No PCM profile!)" : "";
}
public void playAndMeasureRate(long testDurationMillis) throws Exception {
@@ -410,10 +367,6 @@
AudioTrack.STATE_INITIALIZED,
mTrack.getState());
- if (USE_PREFERRED_DEVICE) {
- usePreferredDevice();
- }
-
int bytesWritten = 0;
mOffset = primeBuffer(); // prime the buffer
assertTrue(TEST_NAME + ": priming offset = " + mOffset + getPcmWarning(),
@@ -529,7 +482,7 @@
}
public void testPlayAC3Bytes() throws Exception {
- if (mInfoAC3 != null) {
+ if (mProfileAC3 != null) {
SamplePlayerBytes player = new SamplePlayerBytes(
48000, AudioFormat.ENCODING_AC3, AudioFormat.CHANNEL_OUT_STEREO,
RES_AC3_VOICE_48000);
@@ -538,7 +491,7 @@
}
public void testPlayAC3Shorts() throws Exception {
- if (mInfoAC3 != null) {
+ if (mProfileAC3 != null) {
SamplePlayerShorts player = new SamplePlayerShorts(
48000, AudioFormat.ENCODING_AC3, AudioFormat.CHANNEL_OUT_STEREO,
RES_AC3_VOICE_48000);
@@ -547,7 +500,7 @@
}
public void testPlayIEC61937_32000() throws Exception {
- if (mInfoIEC61937 != null) {
+ if (mProfileIEC61937 != null) {
SamplePlayerShorts player = new SamplePlayerShorts(
32000, AudioFormat.ENCODING_IEC61937, AudioFormat.CHANNEL_OUT_STEREO,
RES_AC3_SPDIF_VOICE_32000);
@@ -556,7 +509,7 @@
}
public void testPlayIEC61937_44100() throws Exception {
- if (mInfoIEC61937 != null) {
+ if (mProfileIEC61937 != null) {
SamplePlayerShorts player = new SamplePlayerShorts(
44100, AudioFormat.ENCODING_IEC61937, AudioFormat.CHANNEL_OUT_STEREO,
RES_AC3_SPDIF_VOICE_44100);
@@ -565,7 +518,7 @@
}
public void testPlayIEC61937_48000() throws Exception {
- if (mInfoIEC61937 != null) {
+ if (mProfileIEC61937 != null) {
SamplePlayerShorts player = new SamplePlayerShorts(
48000, AudioFormat.ENCODING_IEC61937, AudioFormat.CHANNEL_OUT_STEREO,
RES_AC3_SPDIF_VOICE_48000);
@@ -574,16 +527,16 @@
}
public void testPcmSupport() throws Exception {
- if (REQUIRE_PCM_DEVICE) {
- // There should always be a fake PCM device available.
+ if (REQUIRE_PCM_PROFILE) {
+ // There should always be a fake PCM profile available.
assertTrue("testPcmSupport: PCM should be supported."
+ " On ATV device please check HDMI connection.",
- mInfoPCM16 != null);
+ mProfilePCM16 != null);
}
}
private boolean isPcmTestingEnabled() {
- return (mInfoPCM16 != null || !REQUIRE_PCM_DEVICE);
+ return (mProfilePCM16 != null || !REQUIRE_PCM_PROFILE);
}
public void testPlaySineSweepShorts() throws Exception {
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/BassBoostTest.java b/tests/tests/media/audio/src/android/media/audio/cts/BassBoostTest.java
index 64a4022..c06aac8 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/BassBoostTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/BassBoostTest.java
@@ -16,15 +16,26 @@
package android.media.audio.cts;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.media.audiofx.AudioEffect;
import android.media.audiofx.BassBoost;
-import android.media.cts.PostProcTestBase;
import android.os.Looper;
import android.util.Log;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.compatibility.common.util.NonMainlineTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
@NonMainlineTest
+@RunWith(AndroidJUnit4.class)
public class BassBoostTest extends PostProcTestBase {
private String TAG = "BassBoostTest";
@@ -46,6 +57,7 @@
//----------------------------------
//Test case 0.0: test constructor and release
+ @Test
public void test0_0ConstructorAndRelease() throws Exception {
if (!isBassBoostAvailable()) {
return;
@@ -76,6 +88,7 @@
//----------------------------------
//Test case 1.0: test strength
+ @Test
public void test1_0Strength() throws Exception {
if (!isBassBoostAvailable()) {
return;
@@ -108,6 +121,7 @@
}
//Test case 1.1: test properties
+ @Test
public void test1_1Properties() throws Exception {
if (!isBassBoostAvailable()) {
return;
@@ -145,6 +159,7 @@
}
//Test case 1.2: test setStrength() throws exception after release
+ @Test
public void test1_2SetStrengthAfterRelease() throws Exception {
if (!isBassBoostAvailable()) {
return;
@@ -166,6 +181,7 @@
//----------------------------------
//Test case 2.0: test setEnabled() and getEnabled() in valid state
+ @Test
public void test2_0SetEnabledGetEnabled() throws Exception {
if (!isBassBoostAvailable()) {
return;
@@ -185,6 +201,7 @@
}
//Test case 2.1: test setEnabled() throws exception after release
+ @Test
public void test2_1SetEnabledAfterRelease() throws Exception {
if (!isBassBoostAvailable()) {
return;
@@ -206,6 +223,7 @@
//----------------------------------
//Test case 3.0: test control status listener
+ @Test
public void test3_0ControlStatusListener() throws Exception {
if (!isBassBoostAvailable()) {
return;
@@ -231,6 +249,7 @@
}
//Test case 3.1: test enable status listener
+ @Test
public void test3_1EnableStatusListener() throws Exception {
if (!isBassBoostAvailable()) {
return;
@@ -258,6 +277,7 @@
}
//Test case 3.2: test parameter changed listener
+ @Test
public void test3_2ParameterChangedListener() throws Exception {
if (!isBassBoostAvailable()) {
return;
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/DevicesForAttributesTest.java b/tests/tests/media/audio/src/android/media/audio/cts/DevicesForAttributesTest.java
index a352751..0cdadcf 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/DevicesForAttributesTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/DevicesForAttributesTest.java
@@ -36,6 +36,7 @@
import android.util.Log;
import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.FlakyTest;
import androidx.test.runner.AndroidJUnit4;
import com.android.compatibility.common.util.NonMainlineTest;
@@ -56,6 +57,7 @@
*/
@NonMainlineTest
@RunWith(AndroidJUnit4.class)
+@FlakyTest(bugId = 326206728)
public class DevicesForAttributesTest {
private static final String TAG = DevicesForAttributesTest.class.getSimpleName();
@@ -63,7 +65,7 @@
.setUsage(AudioAttributes.USAGE_MEDIA).build();
private static final AudioAttributes COMMUNICATION_ATTR = new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION).build();
- private static final int TEST_TIMING_TOLERANCE_MS = 100;
+ private static final int TEST_TIMING_TOLERANCE_MS = 300;
private AudioManager mAudioManager;
private AudioPolicy mAudioPolicy;
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/DynamicsProcessingTest.java b/tests/tests/media/audio/src/android/media/audio/cts/DynamicsProcessingTest.java
index 2abb715..7a36bf6 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/DynamicsProcessingTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/DynamicsProcessingTest.java
@@ -16,6 +16,10 @@
package android.media.audio.cts;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
import android.content.Context;
import android.media.AudioManager;
import android.media.audiofx.DynamicsProcessing;
@@ -27,10 +31,15 @@
import android.media.audiofx.DynamicsProcessing.Limiter;
import android.media.audiofx.DynamicsProcessing.Mbc;
import android.media.audiofx.DynamicsProcessing.MbcBand;
-import android.media.cts.PostProcTestBase;
import android.platform.test.annotations.AppModeFull;
import android.util.Log;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
public class DynamicsProcessingTest extends PostProcTestBase {
private static final String TAG = "DynamicsProcessingTest";
@@ -66,6 +75,7 @@
// Test case 0.0: test constructor and release
@AppModeFull(reason = "Fails for instant but not enough to block the release")
+ @Test
public void test0_0ConstructorAndRelease() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -84,6 +94,7 @@
}
}
+ @Test
public void test0_1ConstructorWithConfigAndRelease() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -99,6 +110,7 @@
// 1 - create with parameters
// ----------------------------------
+ @Test
public void test1_0ParametersEngine() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -126,6 +138,7 @@
}
}
+ @Test
public void test1_1ParametersChannel() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -146,6 +159,7 @@
}
}
+ @Test
public void test1_2ParametersPreEq() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -166,6 +180,7 @@
}
}
+ @Test
public void test1_3ParametersMbc() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -185,6 +200,7 @@
}
}
+ @Test
public void test1_4ParametersPostEq() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -204,6 +220,7 @@
}
}
+ @Test
public void test1_5ParametersLimiter() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -221,6 +238,7 @@
}
}
+ @Test
public void test1_6Channel_perStage() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -318,6 +336,7 @@
}
+ @Test
public void test1_7Channel_perBand() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -386,6 +405,7 @@
}
}
+ @Test
public void test1_8Channel_setAllChannelsTo() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -442,6 +462,7 @@
}
}
+ @Test
public void test1_9Channel_setChannelTo() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -515,6 +536,7 @@
// 2 - config builder tests
// ----------------------------------
+ @Test
public void test2_0ConfigBasic() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -538,9 +560,10 @@
assertEquals("isLimiterInUse is different", DEFAULT_LIMITER_IN_USE,
config.isLimiterInUse());
assertEquals("getPreferredFrameDuration is different", DEFAULT_FRAME_DURATION,
- config.getPreferredFrameDuration());
+ config.getPreferredFrameDuration(), EPSILON);
}
+ @Test
public void test2_1ConfigChannel() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -630,6 +653,7 @@
}
}
+ @Test
public void test2_2ConfigChannel_perStage() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -719,6 +743,7 @@
}
}
+ @Test
public void test2_3ConfigChannel_perBand() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -775,6 +800,7 @@
}
}
+ @Test
public void test2_4Channel_perStage() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -838,6 +864,7 @@
}
+ @Test
public void test2_5Channel_perBand() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -881,6 +908,7 @@
TEST_GAIN2, channel.getPostEqBand(TEST_BAND_INDEX).getGain(), EPSILON);
}
+ @Test
public void test2_6Eq() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -930,6 +958,7 @@
}
}
+ @Test
public void test2_7Mbc() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -1028,6 +1057,7 @@
}
}
+ @Test
public void test2_8Limiter() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -1091,6 +1121,7 @@
newPostGain, limiter.getPostGain(), EPSILON);
}
+ @Test
public void test2_9BandStage() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -1110,6 +1141,7 @@
assertEquals("bandStage enabled is different", !enabled, bandStage.isEnabled());
}
+ @Test
public void test2_10Stage() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -1128,6 +1160,7 @@
assertEquals("stage enabled is different", !enabled, stage.isEnabled());
}
+ @Test
public void test2_11BandBase() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -1151,6 +1184,7 @@
newFrequency, bandBase.getCutoffFrequency(), EPSILON);
}
+ @Test
public void test2_12Channel() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -1187,6 +1221,7 @@
// 3 - Builder
// ----------------------------------
+ @Test
public void test3_0Builder_stagesAllChannels() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -1240,6 +1275,7 @@
}
}
+ @Test
public void test3_1Builder_stagesByChannelIndex() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -1310,6 +1346,7 @@
}
}
+ @Test
public void test3_2Builder_setAllChannelsTo() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -1366,6 +1403,7 @@
}
}
+ @Test
public void test3_3Builder_setChannelTo() throws Exception {
if (!hasAudioOutput()) {
return;
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/EffectBeforeAfterRule.java b/tests/tests/media/audio/src/android/media/audio/cts/EffectBeforeAfterRule.java
new file mode 100644
index 0000000..093a019
--- /dev/null
+++ b/tests/tests/media/audio/src/android/media/audio/cts/EffectBeforeAfterRule.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2024 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.media.audio.cts;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeFalse;
+
+import android.media.audiofx.AudioEffect;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import org.junit.rules.ExternalResource;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * Simple before and after rule for audio effect tests
+ */
+final class EffectBeforeAfterRule extends ExternalResource {
+ private static final String TAG = EffectBeforeAfterRule.class.getSimpleName();
+
+ private static final int CONTROL_PRIORITY = 100;
+
+ private Map<UUID, Boolean> mOriginalEffectState = new HashMap<>();
+
+ /**
+ * All potential effects under test are disabled at setup.
+ * Initial state is backuped, restored in tearDown
+ * @throws Exception
+ */
+ @Override
+ protected void before() {
+
+ final UUID[] effectTypes = {
+ AudioEffect.EFFECT_TYPE_BASS_BOOST,
+ AudioEffect.EFFECT_TYPE_EQUALIZER,
+ AudioEffect.EFFECT_TYPE_VIRTUALIZER,
+ AudioEffect.EFFECT_TYPE_PRESET_REVERB,
+ AudioEffect.EFFECT_TYPE_ENV_REVERB,
+ };
+ for (UUID effectType : effectTypes) {
+ try {
+ if (AudioEffect.isEffectTypeAvailable(effectType)) {
+ AudioEffect effect = new AudioEffect(effectType,
+ AudioEffect.EFFECT_TYPE_NULL,
+ CONTROL_PRIORITY,
+ 0);
+ assertTrue("effect does not have control", effect.hasControl());
+ mOriginalEffectState.put(effectType, effect.getEnabled());
+
+ effect.setEnabled(false);
+ assertFalse("Could not disable effect", effect.getEnabled());
+ effect.release();
+ }
+ } catch (IllegalStateException e) {
+ } catch (IllegalArgumentException e) {
+ } catch (UnsupportedOperationException e) {
+ } catch (RuntimeException e) {
+ assumeFalse("skipping for instant",
+ InstrumentationRegistry.getInstrumentation()
+ .getContext().getPackageManager().isInstantApp());
+ }
+ }
+ }
+
+ @Override
+ protected void after() {
+ for (Map.Entry<UUID, Boolean> entry : mOriginalEffectState.entrySet()) {
+ try {
+ AudioEffect effect = new AudioEffect(entry.getKey(),
+ AudioEffect.EFFECT_TYPE_NULL,
+ CONTROL_PRIORITY,
+ 0);
+ assertTrue("effect does not have control", effect.hasControl());
+ effect.setEnabled(entry.getValue());
+ effect.release();
+ } catch (IllegalStateException e) {
+ } catch (IllegalArgumentException e) {
+ } catch (UnsupportedOperationException e) {
+ }
+ }
+ }
+}
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/EnvReverbTest.java b/tests/tests/media/audio/src/android/media/audio/cts/EnvReverbTest.java
index 506468a..12decb0 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/EnvReverbTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/EnvReverbTest.java
@@ -16,17 +16,28 @@
package android.media.audio.cts;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.media.audiofx.AudioEffect;
import android.media.audiofx.EnvironmentalReverb;
-import android.media.cts.PostProcTestBase;
import android.os.Looper;
import android.platform.test.annotations.AppModeFull;
import android.util.Log;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.compatibility.common.util.NonMainlineTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
@NonMainlineTest
@AppModeFull(reason = "Fails in instant mode")
+@RunWith(AndroidJUnit4.class)
public class EnvReverbTest extends PostProcTestBase {
private String TAG = "EnvReverbTest";
@@ -39,6 +50,7 @@
private EnvironmentalReverb mReverb2 = null;
private ListenerThread mEffectListenerLooper = null;
+
//-----------------------------------------------------------------
// ENVIRONMENTAL REVERB TESTS:
//----------------------------------
@@ -48,6 +60,7 @@
//----------------------------------
//Test case 0.0: test constructor and release
+ @Test
public void test0_0ConstructorAndRelease() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -77,6 +90,7 @@
//----------------------------------
//Test case 1.0: test room level and room HF level
+ @Test
public void test1_0Room() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -111,6 +125,7 @@
}
//Test case 1.1: test decay time and ratio
+ @Test
public void test1_1Decay() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -145,6 +160,7 @@
//Test case 1.2: test reverb level and delay
+ @Test
public void test1_2Reverb() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -181,6 +197,7 @@
}
//Test case 1.3: test early reflections level and delay
+ @Test
public void test1_3Reflections() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -222,6 +239,7 @@
}
//Test case 1.4: test diffusion and density
+ @Test
public void test1_4DiffusionAndDensity() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -256,6 +274,7 @@
}
//Test case 1.5: test properties
+ @Test
public void test1_5Properties() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -288,6 +307,7 @@
//----------------------------------
//Test case 2.0: test setEnabled() and getEnabled() in valid state
+ @Test
public void test2_0SetEnabledGetEnabled() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -306,6 +326,7 @@
}
//Test case 2.1: test setEnabled() throws exception after release
+ @Test
public void test2_1SetEnabledAfterRelease() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -327,6 +348,7 @@
//----------------------------------
//Test case 3.0: test control status listener
+ @Test
public void test3_0ControlStatusListener() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -352,6 +374,7 @@
}
//Test case 3.1: test enable status listener
+ @Test
public void test3_1EnableStatusListener() throws Exception {
if (!isEnvReverbAvailable()) {
return;
@@ -379,6 +402,7 @@
}
//Test case 3.2: test parameter changed listener
+ @Test
public void test3_2ParameterChangedListener() throws Exception {
if (!isEnvReverbAvailable()) {
return;
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/EqualizerTest.java b/tests/tests/media/audio/src/android/media/audio/cts/EqualizerTest.java
index b806d2c..b139eab 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/EqualizerTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/EqualizerTest.java
@@ -16,15 +16,26 @@
package android.media.audio.cts;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.media.audiofx.AudioEffect;
import android.media.audiofx.Equalizer;
-import android.media.cts.PostProcTestBase;
import android.os.Looper;
import android.util.Log;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.compatibility.common.util.NonMainlineTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
@NonMainlineTest
+@RunWith(AndroidJUnit4.class)
public class EqualizerTest extends PostProcTestBase {
private String TAG = "EqualizerTest";
@@ -49,6 +60,7 @@
//----------------------------------
//Test case 0.0: test constructor and release
+ @Test
public void test0_0ConstructorAndRelease() throws Exception {
Equalizer eq = null;
try {
@@ -75,6 +87,7 @@
//----------------------------------
//Test case 1.0: test setBandLevel() and getBandLevel()
+ @Test
public void test1_0BandLevel() throws Exception {
getEqualizer(getSessionId());
try {
@@ -104,6 +117,7 @@
}
//Test case 1.1: test band frequency
+ @Test
public void test1_1BandFrequency() throws Exception {
getEqualizer(getSessionId());
try {
@@ -129,6 +143,7 @@
}
//Test case 1.2: test presets
+ @Test
public void test1_2Presets() throws Exception {
getEqualizer(getSessionId());
try {
@@ -154,6 +169,7 @@
}
//Test case 1.3: test properties
+ @Test
public void test1_3Properties() throws Exception {
getEqualizer(getSessionId());
try {
@@ -185,6 +201,7 @@
}
//Test case 1.4: test setBandLevel() throws exception after release
+ @Test
public void test1_4SetBandLevelAfterRelease() throws Exception {
getEqualizer(getSessionId());
mEqualizer.release();
@@ -202,6 +219,7 @@
//----------------------------------
//Test case 2.0: test setEnabled() and getEnabled() in valid state
+ @Test
public void test2_0SetEnabledGetEnabled() throws Exception {
getEqualizer(getSessionId());
try {
@@ -218,6 +236,7 @@
}
//Test case 2.1: test setEnabled() throws exception after release
+ @Test
public void test2_1SetEnabledAfterRelease() throws Exception {
getEqualizer(getSessionId());
mEqualizer.release();
@@ -235,6 +254,7 @@
//----------------------------------
//Test case 3.0: test control status listener
+ @Test
public void test3_0ControlStatusListener() throws Exception {
synchronized(mLock) {
mHasControl = true;
@@ -257,6 +277,7 @@
}
//Test case 3.1: test enable status listener
+ @Test
public void test3_1EnableStatusListener() throws Exception {
synchronized(mLock) {
mInitialized = false;
@@ -281,6 +302,7 @@
}
//Test case 3.2: test parameter changed listener
+ @Test
public void test3_2ParameterChangedListener() throws Exception {
synchronized(mLock) {
mInitialized = false;
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/HapticGeneratorTest.java b/tests/tests/media/audio/src/android/media/audio/cts/HapticGeneratorTest.java
index 97ebc94..454eee2 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/HapticGeneratorTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/HapticGeneratorTest.java
@@ -16,12 +16,21 @@
package android.media.audio.cts;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.media.audiofx.HapticGenerator;
-import android.media.cts.PostProcTestBase;
+
+import androidx.test.runner.AndroidJUnit4;
import com.android.compatibility.common.util.NonMainlineTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
@NonMainlineTest
+@RunWith(AndroidJUnit4.class)
public class HapticGeneratorTest extends PostProcTestBase {
private String TAG = "HapticGeneratorTest";
@@ -35,6 +44,7 @@
//----------------------------------
//Test case 0.0: test constructor and release
+ @Test
public void test0_0ConstructorAndRelease() throws Exception {
if (!HapticGenerator.isAvailable()) {
// HapticGenerator will only be created on devices supporting haptic playback
@@ -46,6 +56,7 @@
}
// Test case 0.1: test constructor and close
+ @Test
public void test0_1ConstructorAndClose() throws Exception {
if (!HapticGenerator.isAvailable()) {
// HapticGenerator will only be created on devices supporting haptic playback
@@ -61,6 +72,7 @@
//----------------------------------
//Test case 1.0: test setEnabled() and getEnabled() in valid state
+ @Test
public void test1_0SetEnabledGetEnabled() throws Exception {
if (!HapticGenerator.isAvailable()) {
// HapticGenerator will only be created on devices supporting haptic playback
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/LoudnessEnhancerTest.java b/tests/tests/media/audio/src/android/media/audio/cts/LoudnessEnhancerTest.java
index 1edbafd..af8a512 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/LoudnessEnhancerTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/LoudnessEnhancerTest.java
@@ -16,6 +16,12 @@
package android.media.audio.cts;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
@@ -23,18 +29,25 @@
import android.media.audiofx.LoudnessEnhancer;
import android.media.audiofx.Visualizer;
import android.media.audiofx.Visualizer.MeasurementPeakRms;
-import android.media.cts.PostProcTestBase;
import android.platform.test.annotations.AppModeFull;
import android.util.Log;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.util.UUID;
@AppModeFull(reason = "Dynamic config disabled.")
+@RunWith(AndroidJUnit4.class)
public class LoudnessEnhancerTest extends PostProcTestBase {
private String TAG = "LoudnessEnhancerTest";
private LoudnessEnhancer mLE;
+ private static final float EPSILON = 0.0001f;
+
//-----------------------------------------------------------------
// LOUDNESS ENHANCER TESTS:
//----------------------------------
@@ -44,6 +57,7 @@
//----------------------------------
//Test case 0.0: test constructor and release
+ @Test
public void test0_0ConstructorAndRelease() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -64,6 +78,7 @@
//----------------------------------
//Test case 1.0: test set/get target gain
+ @Test
public void test1_0TargetGain() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -71,9 +86,11 @@
getLoudnessEnhancer(0);
try {
mLE.setTargetGain(0);
- assertEquals("target gain differs from value set", 0.0f, mLE.getTargetGain());
+ assertEquals("target gain differs from value set",
+ 0.0f, mLE.getTargetGain(), EPSILON);
mLE.setTargetGain(800);
- assertEquals("target gain differs from value set", 800.0f, mLE.getTargetGain());
+ assertEquals("target gain differs from value set",
+ 800.0f, mLE.getTargetGain(), EPSILON);
} catch (IllegalArgumentException e) {
fail("target gain illegal argument");
} catch (UnsupportedOperationException e) {
@@ -90,6 +107,7 @@
//----------------------------------
//Test case 2.0: test setEnabled() and getEnabled() in valid state
+ @Test
public void test2_0SetEnabledGetEnabled() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -109,6 +127,7 @@
}
//Test case 2.1: test setEnabled() throws exception after release
+ @Test
public void test2_1SetEnabledAfterRelease() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -130,6 +149,7 @@
//----------------------------------
//Test case 3.0: test loudness gain change in audio
+ @Test
public void test3_0MeasureGainChange() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -192,7 +212,7 @@
//run for a new set of 3 seconds, get new measurement
mLE.setTargetGain(LOUDNESS_GAIN);
assertEquals("target gain differs from value set", (float)LOUDNESS_GAIN,
- mLE.getTargetGain());
+ mLE.getTargetGain(), EPSILON);
mLE.setEnabled(true);
@@ -254,4 +274,4 @@
mLE = null;
}
}
-}
\ No newline at end of file
+}
diff --git a/tests/tests/media/common/src/android/media/cts/PostProcTestBase.java b/tests/tests/media/audio/src/android/media/audio/cts/PostProcTestBase.java
similarity index 83%
rename from tests/tests/media/common/src/android/media/cts/PostProcTestBase.java
rename to tests/tests/media/audio/src/android/media/audio/cts/PostProcTestBase.java
index cefbbf4..55bc401 100644
--- a/tests/tests/media/common/src/android/media/cts/PostProcTestBase.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/PostProcTestBase.java
@@ -14,16 +14,22 @@
* limitations under the License.
*/
-package android.media.cts;
+package android.media.audio.cts;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import android.content.Context;
import android.content.pm.PackageManager;
import android.media.AudioManager;
import android.media.audiofx.AudioEffect;
import android.os.Looper;
-import android.test.AndroidTestCase;
-public class PostProcTestBase extends AndroidTestCase {
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import org.junit.Rule;
+
+public class PostProcTestBase {
protected int mSession = -1;
protected boolean mHasControl = false;
protected boolean mIsEnabled = false;
@@ -34,6 +40,13 @@
protected final static String BUNDLE_VOLUME_EFFECT_UUID =
"119341a0-8469-11df-81f9-0002a5d5c51b";
+ @Rule
+ public EffectBeforeAfterRule mBeforeAfterRule = new EffectBeforeAfterRule();
+
+ protected static Context getContext() {
+ return InstrumentationRegistry.getInstrumentation().getContext();
+ }
+
protected boolean hasAudioOutput() {
return getContext().getPackageManager().hasSystemFeature(
PackageManager.FEATURE_AUDIO_OUTPUT);
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/PresetReverbTest.java b/tests/tests/media/audio/src/android/media/audio/cts/PresetReverbTest.java
index a3221ec..290839d 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/PresetReverbTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/PresetReverbTest.java
@@ -16,17 +16,28 @@
package android.media.audio.cts;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.media.audiofx.AudioEffect;
import android.media.audiofx.PresetReverb;
-import android.media.cts.PostProcTestBase;
import android.os.Looper;
import android.platform.test.annotations.AppModeFull;
import android.util.Log;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.compatibility.common.util.NonMainlineTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
@NonMainlineTest
@AppModeFull(reason = "TODO: evaluate and port to instant")
+@RunWith(AndroidJUnit4.class)
public class PresetReverbTest extends PostProcTestBase {
private String TAG = "PresetReverbTest";
@@ -38,6 +49,7 @@
private PresetReverb mReverb2 = null;
private ListenerThread mEffectListenerLooper = null;
+
//-----------------------------------------------------------------
// PRESET REVERB TESTS:
//----------------------------------
@@ -47,6 +59,7 @@
//----------------------------------
//Test case 0.0: test constructor and release
+ @Test
public void test0_0ConstructorAndRelease() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -75,6 +88,7 @@
//----------------------------------
//Test case 1.0: test presets
+ @Test
public void test1_0Presets() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -99,6 +113,7 @@
}
//Test case 1.1: test properties
+ @Test
public void test1_1Properties() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -130,6 +145,7 @@
//----------------------------------
//Test case 2.0: test setEnabled() and getEnabled() in valid state
+ @Test
public void test2_0SetEnabledGetEnabled() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -148,6 +164,7 @@
}
//Test case 2.1: test setEnabled() throws exception after release
+ @Test
public void test2_1SetEnabledAfterRelease() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -168,6 +185,7 @@
//----------------------------------
//Test case 3.0: test control status listener
+ @Test
public void test3_0ControlStatusListener() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -193,6 +211,7 @@
}
//Test case 3.1: test enable status listener
+ @Test
public void test3_1EnableStatusListener() throws Exception {
if (!isPresetReverbAvailable()) {
return;
@@ -220,6 +239,7 @@
}
//Test case 3.2: test parameter changed listener
+ @Test
public void test3_2ParameterChangedListener() throws Exception {
if (!isPresetReverbAvailable()) {
return;
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/VirtualizerTest.java b/tests/tests/media/audio/src/android/media/audio/cts/VirtualizerTest.java
index 43a47b2..2e6fdf8 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/VirtualizerTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/VirtualizerTest.java
@@ -16,20 +16,31 @@
package android.media.audio.cts;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.media.AudioFormat;
import android.media.audiofx.AudioEffect;
import android.media.audiofx.Virtualizer;
-import android.media.cts.PostProcTestBase;
import android.os.Looper;
import android.platform.test.annotations.AppModeFull;
import android.util.Log;
+import androidx.test.runner.AndroidJUnit4;
+
import com.android.compatibility.common.util.NonMainlineTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.util.Arrays;
@NonMainlineTest
@AppModeFull(reason = "TODO: evaluate and port to instant")
+@RunWith(AndroidJUnit4.class)
public class VirtualizerTest extends PostProcTestBase {
private String TAG = "VirtualizerTest";
@@ -51,6 +62,7 @@
//----------------------------------
//Test case 0.0: test constructor and release
+ @Test
public void test0_0ConstructorAndRelease() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -81,6 +93,7 @@
//----------------------------------
//Test case 1.0: test strength
+ @Test
public void test1_0Strength() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -113,6 +126,7 @@
}
//Test case 1.1: test properties
+ @Test
public void test1_1Properties() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -150,6 +164,7 @@
}
//Test case 1.2: test setStrength() throws exception after release
+ @Test
public void test1_2SetStrengthAfterRelease() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -171,6 +186,7 @@
//----------------------------------
//Test case 2.0: test setEnabled() and getEnabled() in valid state
+ @Test
public void test2_0SetEnabledGetEnabled() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -190,6 +206,7 @@
}
//Test case 2.1: test setEnabled() throws exception after release
+ @Test
public void test2_1SetEnabledAfterRelease() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -211,6 +228,7 @@
//----------------------------------
//Test case 3.0: test control status listener
+ @Test
public void test3_0ControlStatusListener() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -237,6 +255,7 @@
}
//Test case 3.1: test enable status listener
+ @Test
public void test3_1EnableStatusListener() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -265,6 +284,7 @@
}
//Test case 3.2: test parameter changed listener
+ @Test
public void test3_2ParameterChangedListener() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -301,6 +321,7 @@
// combinations must be supported, otherwise the effect doesn't really qualify as
// a virtualizer: AudioFormat.CHANNEL_OUT_STEREO or the quad and 5.1 side/back variants,
// in VIRTUALIZATION_MODE_BINAURAL or VIRTUALIZATION_MODE_TRANSAURAL
+ @Test
public void test4_0FormatModeQuery() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -341,6 +362,7 @@
//Test case 4.1: test that the capabilities reported by Virtualizer.canVirtualize(int,int)
// matches those returned by Virtualizer.getSpeakerAngles(int, int, int[])
+ @Test
public void test4_1SpeakerAnglesCapaMatchesFormatModeCapa() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -384,6 +406,7 @@
//Test case 4.2: test forcing virtualization mode: at least binaural or transaural must be
// supported
+ @Test
public void test4_2VirtualizationMode() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -413,6 +436,7 @@
}
//Test case 4.3: test disabling virtualization maps to VIRTUALIZATION_MODE_OFF
+ @Test
public void test4_3DisablingVirtualizationOff() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -436,6 +460,7 @@
}
//Test case 4.4: test forcing virtualization mode to AUTO
+ @Test
public void test4_4VirtualizationModeAuto() throws Exception {
if (!isVirtualizerAvailable()) {
return;
@@ -460,6 +485,7 @@
}
//Test case 4.5: test for consistent capabilities if virtualizer is enabled or disabled
+ @Test
public void test4_5ConsistentCapabilitiesWithEnabledDisabled() throws Exception {
if (!isVirtualizerAvailable()) {
return;
diff --git a/tests/tests/media/audio/src/android/media/audio/cts/VisualizerTest.java b/tests/tests/media/audio/src/android/media/audio/cts/VisualizerTest.java
index 47d7094..4c695c1 100644
--- a/tests/tests/media/audio/src/android/media/audio/cts/VisualizerTest.java
+++ b/tests/tests/media/audio/src/android/media/audio/cts/VisualizerTest.java
@@ -16,6 +16,12 @@
package android.media.audio.cts;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
@@ -23,14 +29,19 @@
import android.media.audiofx.AudioEffect;
import android.media.audiofx.Visualizer;
import android.media.audiofx.Visualizer.MeasurementPeakRms;
-import android.media.cts.PostProcTestBase;
import android.os.Looper;
import android.platform.test.annotations.AppModeFull;
import android.util.Log;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
import java.util.UUID;
@AppModeFull(reason = "TODO: evaluate and port to instant")
+@RunWith(AndroidJUnit4.class)
public class VisualizerTest extends PostProcTestBase {
private String TAG = "VisualizerTest";
@@ -55,6 +66,7 @@
//----------------------------------
//Test case 0.0: test constructor and release
+ @Test
public void test0_0ConstructorAndRelease() throws Exception {
Visualizer visualizer = null;
try {
@@ -76,6 +88,7 @@
//----------------------------------
//Test case 1.0: capture rates
+ @Test
public void test1_0CaptureRates() throws Exception {
getVisualizer(0);
try {
@@ -95,19 +108,25 @@
}
//Test case 1.1: test capture size
+ @Test
public void test1_1CaptureSize() throws Exception {
getVisualizer(0);
try {
int[] range = mVisualizer.getCaptureSizeRange();
assertTrue("insufficient min capture size",
range[0] <= MAX_CAPTURE_SIZE_MIN);
- assertTrue("insufficient min capture size",
+ assertTrue("insufficient max capture size",
range[1] >= MIN_CAPTURE_SIZE_MAX);
+ int size = mVisualizer.getCaptureSize();
+ assertTrue("capture size smaller than min",
+ size >= range[0]);
+ assertTrue("capture size larger than max",
+ size <= range[1]);
mVisualizer.setCaptureSize(range[0]);
assertEquals("insufficient min capture size",
range[0], mVisualizer.getCaptureSize());
mVisualizer.setCaptureSize(range[1]);
- assertEquals("insufficient min capture size",
+ assertEquals("insufficient max capture size",
range[1], mVisualizer.getCaptureSize());
} catch (IllegalArgumentException e) {
fail("Bad parameter value");
@@ -120,11 +139,28 @@
}
}
+ //Test case 1.2: test setting illegal capture size and expect IllegalArgumentException
+ @Test
+ public void test1_2SetIllegalCaptureSize() throws Exception {
+ getVisualizer(0);
+ int[] range = mVisualizer.getCaptureSizeRange();
+ assertTrue("insufficient min capture size",
+ range[0] <= MAX_CAPTURE_SIZE_MIN);
+ assertTrue("insufficient max capture size",
+ range[1] >= MIN_CAPTURE_SIZE_MAX);
+
+ assertThrows(IllegalArgumentException.class,
+ () -> mVisualizer.setCaptureSize(range[0] - 1));
+ assertThrows(IllegalArgumentException.class,
+ () -> mVisualizer.setCaptureSize(range[1] + 1));
+ }
+
//-----------------------------------------------------------------
// 2 - check capture
//----------------------------------
//Test case 2.0: test capture in polling mode
+ @Test
public void test2_0PollingCapture() throws Exception {
if (!hasAudioOutput()) {
Log.w(TAG,"AUDIO_OUTPUT feature not found. This system might not have a valid "
@@ -157,6 +193,7 @@
}
//Test case 2.1: test capture with listener
+ @Test
public void test2_1ListenerCapture() throws Exception {
if (!hasAudioOutput()) {
Log.w(TAG,"AUDIO_OUTPUT feature not found. This system might not have a valid "
@@ -219,6 +256,7 @@
}
//Test case 2.2: test capture with illegal size
+ @Test
public void test2_2IllegalCaptureSize() throws Exception {
if (!hasAudioOutput()) {
Log.w(TAG, "AUDIO_OUTPUT feature not found. This system might not have a valid "
@@ -247,6 +285,7 @@
//----------------------------------
//Test case 3.0: test setting NONE measurement mode
+ @Test
public void test3_0MeasurementModeNone() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -279,6 +318,7 @@
//----------------------------------
//Test case 4.0: test setting peak / RMS measurement mode
+ @Test
public void test4_0MeasurementModePeakRms() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -307,6 +347,7 @@
}
//Test case 4.1: test measurement of peak / RMS
+ @Test
public void test4_1MeasurePeakRms() throws Exception {
if (!hasAudioOutput()) {
return;
@@ -380,6 +421,7 @@
}
//Test case 4.2: test measurement of peak / RMS in Long MP3
+ @Test
public void test4_2MeasurePeakRmsLongMP3() throws Exception {
if (!hasAudioOutput()) {
return;
diff --git a/tests/tests/media/bettertogether/Android.bp b/tests/tests/media/bettertogether/Android.bp
index c87ca2b..73bf2aa 100644
--- a/tests/tests/media/bettertogether/Android.bp
+++ b/tests/tests/media/bettertogether/Android.bp
@@ -30,14 +30,6 @@
resource_dirs: ["res"],
aaptflags: [
"--auto-add-overlay",
-
- // Do not compress these files:
- "-0 .vp9",
- "-0 .ts",
- "-0 .heic",
- "-0 .trp",
- "-0 .ota",
- "-0 .mxmf",
],
srcs: [
"src/**/*.java",
@@ -45,11 +37,6 @@
],
// This test uses private APIs
platform_apis: true,
- libs: [
- "org.apache.http.legacy",
- "android.test.base",
- "android.test.runner",
- ],
// Tag this module as a cts test artifact
test_suites: [
"cts",
diff --git a/tests/tests/media/bettertogether/AndroidManifest.xml b/tests/tests/media/bettertogether/AndroidManifest.xml
index 99ad020..6da3a71 100644
--- a/tests/tests/media/bettertogether/AndroidManifest.xml
+++ b/tests/tests/media/bettertogether/AndroidManifest.xml
@@ -47,9 +47,6 @@
<application
android:requestLegacyExternalStorage="true"
android:largeHeap="true">
- <uses-library android:name="android.test.runner"/>
- <uses-library android:name="org.apache.http.legacy"
- android:required="false"/>
<activity android:name="android.media.bettertogether.cts.MediaSessionTestActivity"
android:label="MediaSessionTestActivity"
diff --git a/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaBrowserTest.java b/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaBrowserTest.java
index 57d7f1b..f4a5da7 100644
--- a/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaBrowserTest.java
+++ b/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaBrowserTest.java
@@ -35,6 +35,7 @@
import com.google.common.truth.Correspondence;
import org.junit.After;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -425,6 +426,7 @@
.isEqualTo(pageSize);
}
+ @Ignore // TODO(b/291800179): Diagnose flakiness and re-enable.
@Test
public void testSubscriptionCallbackNotCalledAfterDisconnect() throws Throwable {
createMediaBrowser(TEST_BROWSER_SERVICE);
diff --git a/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaRouter2Test.java b/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaRouter2Test.java
index 8cad3c8..b4909e6 100644
--- a/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaRouter2Test.java
+++ b/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaRouter2Test.java
@@ -74,6 +74,7 @@
import org.junit.Assert;
import org.junit.Before;
import org.junit.ClassRule;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -179,6 +180,7 @@
*
* <p>Runs on both the primary user and a work profile, as per {@link UserTest}.
*/
+ @Ignore // TODO(b/291800179): Diagnose flakiness and re-enable.
@UserTest({UserType.PRIMARY_USER, UserType.WORK_PROFILE})
@Test
public void testGetRoutes() throws Exception {
@@ -289,6 +291,7 @@
}
}
+ @Ignore // TODO(b/291800179): Diagnose flakiness and re-enable.
@Test
public void testTransferToFailure() throws Exception {
final List<String> sampleRouteType = new ArrayList<>();
@@ -614,6 +617,7 @@
}
// TODO: Add tests for illegal inputs if needed (e.g. selecting already selected route)
+ @Ignore // TODO(b/291800179): Diagnose flakiness and re-enable.
@Test
public void testRoutingControllerSelectAndDeselectRoute() throws Exception {
final List<String> sampleRouteType = new ArrayList<>();
@@ -740,21 +744,25 @@
}
};
- ControllerCallback controllerCallback = new ControllerCallback() {
- @Override
- public void onControllerUpdated(RoutingController controller) {
- if (onTransferLatch.getCount() != 0
- || !TextUtils.equals(controllers.get(0).getId(), controller.getId())) {
- return;
- }
- assertThat(controller.getSelectedRoutes()).hasSize(1);
- assertThat(getOriginalRouteIds(controller.getSelectedRoutes()))
- .doesNotContain(ROUTE_ID1);
- assertThat(getOriginalRouteIds(controller.getSelectedRoutes()))
- .contains(ROUTE_ID5_TO_TRANSFER_TO);
- onControllerUpdatedLatch.countDown();
- }
- };
+ ControllerCallback controllerCallback =
+ new ControllerCallback() {
+ @Override
+ public void onControllerUpdated(RoutingController controller) {
+ if (onTransferLatch.getCount() != 0
+ || !TextUtils.equals(
+ controllers.get(0).getId(), controller.getId())) {
+ return;
+ }
+
+ if (getOriginalRouteIds(controller.getSelectedRoutes())
+ .contains(ROUTE_ID5_TO_TRANSFER_TO)) {
+ assertThat(controller.getSelectedRoutes()).hasSize(1);
+ assertThat(getOriginalRouteIds(controller.getSelectedRoutes()))
+ .doesNotContain(ROUTE_ID1);
+ onControllerUpdatedLatch.countDown();
+ }
+ }
+ };
// TODO: Remove this once the MediaRouter2 becomes always connected to the service.
RouteCallback routeCallback = new RouteCallback() {};
@@ -808,21 +816,26 @@
onTransferLatch.countDown();
}
};
- ControllerCallback controllerCallback = new ControllerCallback() {
- @Override
- public void onControllerUpdated(RoutingController controller) {
- if (onTransferLatch.getCount() != 0
- || !TextUtils.equals(controllers.get(0).getId(), controller.getId())) {
- return;
- }
- assertThat(controller.getSelectedRoutes()).hasSize(1);
- assertThat(getOriginalRouteIds(controller.getSelectedRoutes()))
- .doesNotContain(ROUTE_ID1);
- assertThat(getOriginalRouteIds(controller.getSelectedRoutes()))
- .contains(ROUTE_ID5_TO_TRANSFER_TO);
- onControllerUpdatedLatch.countDown();
- }
- };
+ ControllerCallback controllerCallback =
+ new ControllerCallback() {
+ @Override
+ public void onControllerUpdated(RoutingController controller) {
+ if (onTransferLatch.getCount() != 0
+ || !TextUtils.equals(
+ mRouter2.getSystemController().getId(),
+ controller.getId())) {
+ return;
+ }
+
+ if (getOriginalRouteIds(controller.getSelectedRoutes())
+ .contains(ROUTE_ID5_TO_TRANSFER_TO)) {
+ assertThat(controller.getSelectedRoutes()).hasSize(1);
+ assertThat(getOriginalRouteIds(controller.getSelectedRoutes()))
+ .doesNotContain(ROUTE_ID1);
+ onControllerUpdatedLatch.countDown();
+ }
+ }
+ };
// TODO: Remove this once the MediaRouter2 becomes always connected to the service.
RouteCallback routeCallback = new RouteCallback() {};
@@ -830,12 +843,12 @@
try {
mRouter2.registerTransferCallback(mExecutor, transferCallback);
- mRouter2.registerControllerCallback(mExecutor, controllerCallback);
mRouter2.transferTo(routeToBegin);
assertThat(onTransferLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)).isTrue();
assertThat(controllers).hasSize(1);
+ mRouter2.registerControllerCallback(mExecutor, controllerCallback);
// Transfer to ROUTE_ID5_TO_TRANSFER_TO
MediaRoute2Info routeToTransferTo = routes.get(ROUTE_ID5_TO_TRANSFER_TO);
assertThat(routeToTransferTo).isNotNull();
@@ -904,13 +917,14 @@
try {
mRouter2.registerTransferCallback(mExecutor, transferCallback);
- mRouter2.registerControllerCallback(mExecutor, controllerCallback);
mRouter2.transferTo(routeTransferFrom);
assertThat(onTransferLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)).isTrue();
assertThat(controllers).hasSize(1);
RoutingController controller = controllers.get(0);
+ // Registering the callback here to avoid unrelated calls related to the transfer above.
+ mRouter2.registerControllerCallback(mExecutor, controllerCallback);
mRouter2.stop();
// Select ROUTE_ID5_TO_TRANSFER_TO
@@ -932,6 +946,7 @@
}
}
+ @Ignore // TODO(b/291800179): Diagnose flakiness and re-enable.
@Test
public void testRoutingControllerRelease() throws Exception {
final List<String> sampleRouteType = new ArrayList<>();
diff --git a/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaSessionManagerTest.java b/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaSessionManagerTest.java
index 409008d..c1a3583 100644
--- a/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaSessionManagerTest.java
+++ b/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaSessionManagerTest.java
@@ -58,6 +58,7 @@
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -158,6 +159,7 @@
.isFalse();
}
+ @Ignore // TODO(b/291800179): Diagnose flakiness and re-enable.
@Test
public void testOnMediaKeyEventSessionChangedListener_whenSessionIsReleased() throws Exception {
// The permission can be held only on S+
@@ -498,6 +500,7 @@
}
}
+ @Ignore // TODO(b/291800179): Diagnose flakiness and re-enable.
@Test
public void testGetSession2TokensWithTwoSessions() throws Exception {
final Context context = getInstrumentation().getTargetContext();
diff --git a/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaSessionTest.java b/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaSessionTest.java
index 1662d81..4e7e492 100644
--- a/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaSessionTest.java
+++ b/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/MediaSessionTest.java
@@ -69,6 +69,7 @@
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -439,6 +440,7 @@
* Test whether media button receiver can be a explicit broadcast receiver via
* MediaSession.setMediaButtonReceiver(PendingIntent).
*/
+ @Ignore // TODO(b/291800179): Diagnose flakiness and re-enable.
@Test
public void testSetMediaButtonReceiver_broadcastReceiver() throws Exception {
Intent intent = new Intent(mContext.getApplicationContext(),
diff --git a/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/SystemMediaRouter2Test.java b/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/SystemMediaRouter2Test.java
index 59cb361..5008a2e 100644
--- a/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/SystemMediaRouter2Test.java
+++ b/tests/tests/media/bettertogether/src/android/media/bettertogether/cts/SystemMediaRouter2Test.java
@@ -56,6 +56,7 @@
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -747,7 +748,11 @@
|| !TextUtils.equals(controllers.get(0).getId(), controller.getId())) {
return;
}
- onControllerUpdatedLatch.countDown();
+ if (!TextUtils.equals(
+ controller.getSelectedRoutes().get(0).getOriginalId(),
+ route.getOriginalId())) {
+ onControllerUpdatedLatch.countDown();
+ }
}
};
@@ -780,6 +785,7 @@
}
}
+ @Ignore // TODO(b/291800179): Diagnose flakiness and re-enable.
@Test
public void testRoutingControllerSelectAndDeselectRoute() throws Exception {
Map<String, MediaRoute2Info> routes = waitAndGetRoutes(FEATURE_SAMPLE);
@@ -898,21 +904,26 @@
}
};
- ControllerCallback controllerCallback = new ControllerCallback() {
- @Override
- public void onControllerUpdated(RoutingController controller) {
- if (onTransferLatch.getCount() != 0
- || !TextUtils.equals(controllers.get(0).getId(), controller.getId())) {
- return;
- }
- assertThat(controller.getSelectedRoutes()).hasSize(1);
- assertThat(createRouteMap(controller.getSelectedRoutes())
- .containsKey(ROUTE_ID1)).isFalse();
- assertThat(createRouteMap(controller.getSelectedRoutes())
- .containsKey(ROUTE_ID5_TO_TRANSFER_TO)).isTrue();
- onControllerUpdatedLatch.countDown();
- }
- };
+ ControllerCallback controllerCallback =
+ new ControllerCallback() {
+ @Override
+ public void onControllerUpdated(RoutingController controller) {
+ if (onTransferLatch.getCount() != 0
+ || !TextUtils.equals(
+ controllers.get(0).getId(), controller.getId())) {
+ return;
+ }
+ if (createRouteMap(controller.getSelectedRoutes())
+ .containsKey(ROUTE_ID5_TO_TRANSFER_TO)) {
+ assertThat(controller.getSelectedRoutes()).hasSize(1);
+ assertThat(
+ createRouteMap(controller.getSelectedRoutes())
+ .containsKey(ROUTE_ID1))
+ .isFalse();
+ onControllerUpdatedLatch.countDown();
+ }
+ }
+ };
try {
mSystemRouter2ForCts.registerTransferCallback(mExecutor, transferCallback);
@@ -997,6 +1008,7 @@
}
}
+ @Ignore // TODO(b/291800179): Diagnose flakiness and re-enable.
@Test
public void testRoutingControllerRelease() throws Exception {
Map<String, MediaRoute2Info> routes = waitAndGetRoutes(FEATURE_SAMPLE);
diff --git a/tests/tests/media/codec/src/android/media/codec/cts/DecodeEditEncodeTest.java b/tests/tests/media/codec/src/android/media/codec/cts/DecodeEditEncodeTest.java
index 8b37ca2..e243665 100644
--- a/tests/tests/media/codec/src/android/media/codec/cts/DecodeEditEncodeTest.java
+++ b/tests/tests/media/codec/src/android/media/codec/cts/DecodeEditEncodeTest.java
@@ -34,6 +34,7 @@
import android.media.cts.InputSurface;
import android.media.cts.OutputSurface;
import android.media.cts.TestArgs;
+import android.media.cts.TestUtils;
import android.opengl.GLES20;
import android.opengl.GLES30;
import android.os.Build;
@@ -230,6 +231,14 @@
assumeTrue("Color conversion related tests are not valid on cuttlefish releases "
+ "through android T for format: " + format, IS_AFTER_T);
}
+ // Pre Android U, this test only checked the 1st codec (which is usually a hardware codec)
+ // and software codecs exercised a problem in the underlying graphis code.
+ // So we will only run this for CTS mode or if we're on versions after Android T
+ // (where the graphics code is fixed)
+ if (TestUtils.isMtsMode()) {
+ assumeTrue("Color conversion related tests are skipped in MTS on releases "
+ + "through android T for format: " + format, IS_AFTER_T);
+ }
}
@Parameterized.Parameters(name = "{index}_{0}_{1}_{2}_{3}_{4}_{5}")
diff --git a/tests/tests/media/codec/src/android/media/codec/cts/EncodeDecodeTest.java b/tests/tests/media/codec/src/android/media/codec/cts/EncodeDecodeTest.java
index 4ee7455..94b3b65 100644
--- a/tests/tests/media/codec/src/android/media/codec/cts/EncodeDecodeTest.java
+++ b/tests/tests/media/codec/src/android/media/codec/cts/EncodeDecodeTest.java
@@ -34,6 +34,7 @@
import android.media.cts.OutputSurface;
import android.media.cts.SdkMediaCodec;
import android.media.cts.TestArgs;
+import android.media.cts.TestUtils;
import android.opengl.GLES20;
import android.os.Build;
import android.platform.test.annotations.PlatinumTest;
@@ -293,6 +294,15 @@
assumeTrue("Color conversion related tests are not valid on cuttlefish releases "
+ "through android T", IS_AFTER_T);
}
+ // Pre Android U, this test only checked the 1st codec (which is usually a hardware
+ // codec) and software codecs exercised a problem in the underlying graphis code.
+ // So we will only run this for CTS mode or if we're on versions after Android T
+ // (where the graphics code is fixed)
+ if (TestUtils.isMtsMode()) {
+ assumeTrue("Color conversion related tests are skipped in MTS on releases "
+ + "through android T", IS_AFTER_T);
+ }
+
SurfaceToSurfaceWrapper wrapper =
new SurfaceToSurfaceWrapper(obj, persisent, useNdk);
Thread th = new Thread(wrapper, "codec test");
diff --git a/tests/tests/media/common/src/android/media/cts/CodecState.java b/tests/tests/media/common/src/android/media/cts/CodecState.java
index d34e4f4..06a52ec 100644
--- a/tests/tests/media/common/src/android/media/cts/CodecState.java
+++ b/tests/tests/media/common/src/android/media/cts/CodecState.java
@@ -449,6 +449,9 @@
// yet, stopping the audio track now would result in getAudioTimeUs
// returning 0 and prevent video samples from being presented.
// We stop the audio track before the playback thread exits.
+ if (mAudioTrack != null) {
+ mAudioTrack.setEndOfStream();
+ }
return false;
}
diff --git a/tests/tests/media/common/src/android/media/cts/NonBlockingAudioTrack.java b/tests/tests/media/common/src/android/media/cts/NonBlockingAudioTrack.java
index 6589cc5..17e9254 100644
--- a/tests/tests/media/common/src/android/media/cts/NonBlockingAudioTrack.java
+++ b/tests/tests/media/common/src/android/media/cts/NonBlockingAudioTrack.java
@@ -36,7 +36,9 @@
public class NonBlockingAudioTrack {
private static final String TAG = NonBlockingAudioTrack.class.getSimpleName();
- class QueueElement {
+ private static final long END_OF_STREAM_PTS = Long.MAX_VALUE;
+
+ private static class QueueElement {
ByteBuffer data;
int size;
long pts;
@@ -130,6 +132,12 @@
mAudioTrack.play();
}
+ public void setEndOfStream() {
+ QueueElement element = new QueueElement();
+ element.pts = END_OF_STREAM_PTS;
+ mQueue.add(element);
+ }
+
public void stop() {
if (mQueue.isEmpty()) {
mAudioTrack.stop();
@@ -176,10 +184,30 @@
break;
}
+ if (element.pts == END_OF_STREAM_PTS) {
+ // For tunnel mode, when an audio PTS gap is encountered, silence is rendered
+ // during the gap. As such, it's necessary to fade down the audio to avoid a
+ // bad user experience. This necessitates that the Audio HAL holds onto the
+ // last audio frame and delays releasing it to the output device until the
+ // subsequent audio frame is seen so that it knows whether there's a PTS gap
+ // or not. When the end-of-stream is reached, this means that the last audio
+ // frame has not been rendered yet. So, in order to release the last audio
+ // frame, a signal must be sent to the Audio HAL so the last frame gets
+ // released.
+ int written = mAudioTrack.write(ByteBuffer.allocate(0), 0,
+ AudioTrack.WRITE_NON_BLOCKING,
+ END_OF_STREAM_PTS);
+ if (written < 0) {
+ throw new RuntimeException("AudioTrack.write failed (" + written + ")");
+ }
+ mQueue.removeFirst();
+ break;
+ }
+
int written = mAudioTrack.write(element.data, element.size,
AudioTrack.WRITE_NON_BLOCKING, element.pts + mAudioOffsetNs.get());
if (written < 0) {
- throw new RuntimeException("Audiotrack.write() failed.");
+ throw new RuntimeException("AudioTrack.write failed (" + written + ")");
}
mTotalBytesWritten.addAndGet(written);
diff --git a/tests/tests/media/common/src/android/media/cts/TestArgs.java b/tests/tests/media/common/src/android/media/cts/TestArgs.java
index 6c2ce2c..1d7eafd 100644
--- a/tests/tests/media/common/src/android/media/cts/TestArgs.java
+++ b/tests/tests/media/common/src/android/media/cts/TestArgs.java
@@ -54,7 +54,7 @@
public static boolean shouldSkipCodec(String name) {
if ((CODEC_PREFIX != null && !name.startsWith(CODEC_PREFIX))
- || (codecFilter != null && codecFilter.matcher(name).matches())) {
+ || (codecFilter != null && !codecFilter.matcher(name).matches())) {
Log.d(TAG, "Skipping tests for codec: " + name + " as codec prefix is " + CODEC_PREFIX);
return true;
}
diff --git a/tests/tests/media/decoder/Android.bp b/tests/tests/media/decoder/Android.bp
index 410fb5b..1f7c115 100644
--- a/tests/tests/media/decoder/Android.bp
+++ b/tests/tests/media/decoder/Android.bp
@@ -73,16 +73,10 @@
],
srcs: [
"src/**/*.java",
- "aidl/**/*.aidl",
],
// This test uses private APIs
platform_apis: true,
jni_uses_sdk_apis: true,
- libs: [
- "org.apache.http.legacy",
- "android.test.base",
- "android.test.runner",
- ],
test_suites: [
"cts",
"general-tests",
diff --git a/tests/tests/media/decoder/AndroidManifest.xml b/tests/tests/media/decoder/AndroidManifest.xml
index d25d904..db9a4dd 100644
--- a/tests/tests/media/decoder/AndroidManifest.xml
+++ b/tests/tests/media/decoder/AndroidManifest.xml
@@ -31,9 +31,6 @@
<application android:requestLegacyExternalStorage="true"
android:largeHeap="true">
- <uses-library android:name="android.test.runner"/>
- <uses-library android:name="org.apache.http.legacy"
- android:required="false"/>
<activity android:name="android.media.decoder.cts.DecodeAccuracyTestActivity"
android:label="DecodeAccuracyTestActivity"
diff --git a/tests/tests/media/decoder/jni/native-media-jni.cpp b/tests/tests/media/decoder/jni/native-media-jni.cpp
old mode 100755
new mode 100644
index 236a97a..bcb254e
--- a/tests/tests/media/decoder/jni/native-media-jni.cpp
+++ b/tests/tests/media/decoder/jni/native-media-jni.cpp
@@ -26,6 +26,7 @@
#include <queue>
#include <stdio.h>
#include <string.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <android/native_window_jni.h>
@@ -466,3 +467,185 @@
AMediaDataSource_delete(ndkSrc);
return ret;
}
+
+static bool arePtsListsIdentical(const std::vector<u_long>& refArray,
+ const std::vector<u_long>& testArray) {
+ bool isEqual = true;
+ u_long i;
+ if (refArray.size() != testArray.size()) {
+ ALOGE("Expected and received timestamps list sizes are not identical");
+ ALOGE("Expected pts list size is %zu", refArray.size());
+ ALOGE("Received pts list size is %zu", testArray.size());
+ isEqual = false;
+ } else {
+ for (i = 0; i < refArray.size(); i++) {
+ if (refArray[i] != testArray[i]) {
+ isEqual = false;
+ }
+ }
+ }
+
+ if (!isEqual) {
+ for (i = 0; i < std::min(refArray.size(), testArray.size()); i++) {
+ ALOGE("Frame idx %3lu, expected pts %9luus, received pts %9luus", i, refArray[i],
+ testArray[i]);
+ }
+ if (refArray.size() < testArray.size()) {
+ for (i = refArray.size(); i < testArray.size(); i++) {
+ ALOGE("Frame idx %3lu, expected pts %11s, received pts %9luus", i, "EMPTY",
+ testArray[i]);
+ }
+ } else if (refArray.size() > testArray.size()) {
+ for (i = testArray.size(); i < refArray.size(); i++) {
+ ALOGE("Frame idx %3lu, expected pts %9luus, received pts %11s", i, refArray[i],
+ "EMPTY");
+ }
+ }
+ }
+
+ return isEqual;
+}
+
+bool testNonTunneledTrickPlay(const char *fileName, ANativeWindow *pWindow, bool isAsync) {
+ FILE *fp = fopen(fileName, "rbe");
+ if (fp == nullptr) {
+ ALOGE("Unable to open input file: %s", fileName);
+ return false;
+ }
+
+ struct stat buf {};
+ AMediaExtractor *extractor = AMediaExtractor_new();
+ if (!fstat(fileno(fp), &buf)) {
+ media_status_t res = AMediaExtractor_setDataSourceFd(extractor, fileno(fp), 0, buf.st_size);
+ if (res != AMEDIA_OK) {
+ ALOGE("AMediaExtractor_setDataSourceFd failed with error %d", res);
+ AMediaExtractor_delete(extractor);
+ return false;
+ }
+ }
+
+ int trackIndex = -1;
+ for (size_t trackID = 0; trackID < AMediaExtractor_getTrackCount(extractor); trackID++) {
+ AMediaFormat *format = AMediaExtractor_getTrackFormat(extractor, trackID);
+ const char *mediaType = nullptr;
+ AMediaFormat_getString(format, AMEDIAFORMAT_KEY_MIME, &mediaType);
+ bool isVideo = strncmp(mediaType, "video/", strlen("video/")) == 0;
+ AMediaFormat_delete(format);
+ if (isVideo) {
+ trackIndex = trackID;
+ ALOGV("mediaType = %s, prefix = \"video/\", trackId = %zu", mediaType, trackID);
+ break;
+ }
+ }
+
+ if (trackIndex < 0) {
+ ALOGE("No video track found for track index: %d", trackIndex);
+ AMediaExtractor_delete(extractor);
+ return false;
+ }
+
+ AMediaExtractor_selectTrack(extractor, trackIndex);
+ AMediaFormat *format = AMediaExtractor_getTrackFormat(extractor, trackIndex);
+ const char *mediaType = nullptr;
+ AMediaFormat_getString(format, AMEDIAFORMAT_KEY_MIME, &mediaType);
+ AMediaCodec *codec = AMediaCodec_createDecoderByType(mediaType);
+ CallbackData *callbackData = new CallbackData();
+
+ if (isAsync) {
+ AMediaCodecOnAsyncNotifyCallback callBack = {OnInputAvailableCB, OnOutputAvailableCB,
+ OnFormatChangedCB, OnErrorCB};
+ auto status = AMediaCodec_setAsyncNotifyCallback(codec, callBack, callbackData);
+ if (status != AMEDIA_OK) {
+ ALOGE("failed to set async callback");
+ delete callbackData;
+ AMediaFormat_delete(format);
+ AMediaCodec_delete(codec);
+ AMediaExtractor_delete(extractor);
+ return false;
+ }
+ }
+ AMediaCodec_configure(codec, format, pWindow, nullptr, 0);
+ AMediaCodec_start(codec);
+
+ std::atomic<bool> done(false);
+ std::vector<u_long> expectedPresentationTimes;
+ std::vector<u_long> receivedPresentationTimes;
+ bool mEosQueued = false;
+ int mDecodeOnlyCounter = 0;
+ // keep looping until the codec receives the EOS frame
+ while (!done.load()) {
+ // enqueue
+ if (!mEosQueued) {
+ size_t inBufSize;
+ int32_t id;
+ if (isAsync) {
+ id = callbackData->getInputBufferId();
+ } else {
+ id = AMediaCodec_dequeueInputBuffer(codec, 5000);
+ }
+ if (id >= 0) {
+ uint8_t *inBuf = AMediaCodec_getInputBuffer(codec, id, &inBufSize);
+ if (inBuf == nullptr) {
+ ALOGE("AMediaCodec_getInputBuffer returned nullptr");
+ delete callbackData;
+ AMediaFormat_delete(format);
+ AMediaCodec_stop(codec);
+ AMediaCodec_delete(codec);
+ AMediaExtractor_delete(extractor);
+ return false;
+ }
+ ssize_t sampleSize = AMediaExtractor_readSampleData(extractor, inBuf, inBufSize);
+ int64_t presentationTime = AMediaExtractor_getSampleTime(extractor);
+ uint32_t flags = 0;
+ if (sampleSize < 0) {
+ flags = AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM;
+ sampleSize = 0;
+ mEosQueued = true;
+ } else if (mDecodeOnlyCounter % 2 == 0) {
+ flags = AMEDIACODEC_BUFFER_FLAG_DECODE_ONLY;
+ } else {
+ expectedPresentationTimes.push_back(presentationTime);
+ }
+ mDecodeOnlyCounter++;
+ AMediaCodec_queueInputBuffer(codec, id, 0, sampleSize, presentationTime, flags);
+ AMediaExtractor_advance(extractor);
+ }
+ }
+
+ // dequeue
+ AMediaCodecBufferInfo bufferInfo;
+ AMediaFormat *outputFormat;
+ int id;
+ if (isAsync) {
+ id = callbackData->getOutput(&bufferInfo, &outputFormat);
+ } else {
+ id = AMediaCodec_dequeueOutputBuffer(codec, &bufferInfo, 1);
+ }
+ if (id >= 0) {
+ AMediaCodec_releaseOutputBuffer(codec, id, false);
+ if ((bufferInfo.flags & AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM) != 0) {
+ done.store(true);
+ } else {
+ receivedPresentationTimes.push_back(bufferInfo.presentationTimeUs);
+ }
+ }
+ }
+
+ delete callbackData;
+ AMediaFormat_delete(format);
+ AMediaCodec_stop(codec);
+ AMediaCodec_delete(codec);
+ AMediaExtractor_delete(extractor);
+ std::sort(expectedPresentationTimes.begin(), expectedPresentationTimes.end());
+ return arePtsListsIdentical(expectedPresentationTimes, receivedPresentationTimes);
+}
+
+extern "C" jboolean Java_android_media_decoder_cts_DecodeOnlyTest_nativeTestNonTunneledTrickPlay(
+ JNIEnv *env, jclass /*clazz*/, jstring jFileName, jobject surface, jboolean isAsync) {
+ ALOGD("nativeTestNonTunneledTrickPlay");
+ const char *cFileName = env->GetStringUTFChars(jFileName, nullptr);
+ ANativeWindow *window = surface ? ANativeWindow_fromSurface(env, surface) : nullptr;
+ bool isPass = testNonTunneledTrickPlay(cFileName, window, isAsync);
+ env->ReleaseStringUTFChars(jFileName, cFileName);
+ return static_cast<jboolean>(isPass);
+}
diff --git a/tests/tests/media/decoder/src/android/media/decoder/cts/DecodeAccuracyTestBase.java b/tests/tests/media/decoder/src/android/media/decoder/cts/DecodeAccuracyTestBase.java
index 5743455..e30f56b 100644
--- a/tests/tests/media/decoder/src/android/media/decoder/cts/DecodeAccuracyTestBase.java
+++ b/tests/tests/media/decoder/src/android/media/decoder/cts/DecodeAccuracyTestBase.java
@@ -979,6 +979,10 @@
return glSurfaceViewThread.getByteBuffer();
}
+ public Object getSyncToken() {
+ return surfaceSyncToken;
+ }
+
/* Does all GL operations. */
private class GLSurfaceViewThread extends Thread
implements SurfaceTexture.OnFrameAvailableListener {
@@ -1219,11 +1223,13 @@
/* Reads the pixels to a ByteBuffer. */
public void saveFrame() {
- byteBufferIsReady = false;
- byteBuffer.clear();
- GLES20.glReadPixels(0, 0, VIEW_WIDTH, VIEW_HEIGHT, GLES20.GL_RGBA,
- GLES20.GL_UNSIGNED_BYTE, byteBuffer);
- byteBufferIsReady = true;
+ synchronized (surfaceSyncToken) {
+ byteBufferIsReady = false;
+ byteBuffer.clear();
+ GLES20.glReadPixels(0, 0, VIEW_WIDTH, VIEW_HEIGHT, GLES20.GL_RGBA,
+ GLES20.GL_UNSIGNED_BYTE, byteBuffer);
+ byteBufferIsReady = true;
+ }
}
public int getTextureId() {
@@ -1517,10 +1523,14 @@
try {
final ByteBuffer byteBuffer = glSurfaceViewFactory.getByteBuffer();
bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
- byteBuffer.rewind();
- bitmap.copyPixelsFromBuffer(byteBuffer);
- bitmapIsReady = true;
- byteBuffer.clear();
+
+ final Object syncToken = glSurfaceViewFactory.getSyncToken();
+ synchronized (syncToken) {
+ byteBuffer.rewind();
+ bitmap.copyPixelsFromBuffer(byteBuffer);
+ bitmapIsReady = true;
+ byteBuffer.clear();
+ }
} catch (NullPointerException exception) {
Log.e(TAG, "glSurfaceViewFactory or byteBuffer may have been released", exception);
bitmap = null;
diff --git a/tests/tests/media/decoder/src/android/media/decoder/cts/DecodeOnlyTest.java b/tests/tests/media/decoder/src/android/media/decoder/cts/DecodeOnlyTest.java
index f2abd9f..da64f11 100644
--- a/tests/tests/media/decoder/src/android/media/decoder/cts/DecodeOnlyTest.java
+++ b/tests/tests/media/decoder/src/android/media/decoder/cts/DecodeOnlyTest.java
@@ -39,6 +39,7 @@
import android.os.Looper;
import android.os.SystemProperties;
import android.platform.test.annotations.AppModeFull;
+import android.view.Surface;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SdkSuppress;
@@ -85,6 +86,10 @@
private static final String MIME_AUDIO_PREFIX = "audio/";
private static final long EOS_TIMESTAMP_TUNNEL_MODE = Long.MAX_VALUE;
+ static {
+ System.loadLibrary("ctsmediadecodertest_jni");
+ }
+
@Before
@Override
public void setUp() throws Throwable {
@@ -185,6 +190,19 @@
testTunneledTrickPlay(VP9_VIDEO);
}
+ private static native boolean nativeTestNonTunneledTrickPlay(String fileName, Surface surface,
+ boolean isAsync);
+
+ @Test
+ @ApiTest(apis = {"android.media.MediaCodec#BUFFER_FLAG_DECODE_ONLY"})
+ public void nativeTestNonTunneledTrickPlayHevc() {
+ boolean[] boolStates = {true, false};
+ for (boolean isAsync : boolStates) {
+ assertTrue(nativeTestNonTunneledTrickPlay(MEDIA_DIR_STRING + HEVC_VIDEO,
+ getActivity().getSurfaceHolder().getSurface(), isAsync));
+ }
+ }
+
@Test
@ApiTest(apis = {"android.media.MediaCodec#BUFFER_FLAG_DECODE_ONLY"})
public void testNonTunneledTrickPlayHevc() throws Exception {
@@ -479,7 +497,8 @@
// Frames at 2s of each file are not key frame
AtomicLong seekTime = new AtomicLong(2000 * 1000);
videoExtractor.seekTo(seekTime.get(), MediaExtractor.SEEK_TO_PREVIOUS_SYNC);
- audioExtractor.seekTo(seekTime.get(), MediaExtractor.SEEK_TO_PREVIOUS_SYNC);
+ long audioSeekTime = videoExtractor.getSampleTime();
+ audioExtractor.seekTo(audioSeekTime, MediaExtractor.SEEK_TO_PREVIOUS_SYNC);
List<Long> expectedPresentationTimes = new ArrayList<>();
AtomicBoolean done = new AtomicBoolean(false);
@@ -601,7 +620,8 @@
// Frames at 7s of each file are not key frame, and there is non-zero key frame before it
seekTime.set(7000 * 1000);
videoExtractor.seekTo(seekTime.get(), MediaExtractor.SEEK_TO_PREVIOUS_SYNC);
- audioExtractor.seekTo(seekTime.get(), MediaExtractor.SEEK_TO_PREVIOUS_SYNC);
+ audioSeekTime = videoExtractor.getSampleTime();
+ audioExtractor.seekTo(audioSeekTime, MediaExtractor.SEEK_TO_PREVIOUS_SYNC);
expectedPresentationTimes.clear();
renderedPresentationTimes.clear();
diff --git a/tests/tests/media/decoder/src/android/media/decoder/cts/DecoderTest.java b/tests/tests/media/decoder/src/android/media/decoder/cts/DecoderTest.java
index cb88f68..b29e416 100644
--- a/tests/tests/media/decoder/src/android/media/decoder/cts/DecoderTest.java
+++ b/tests/tests/media/decoder/src/android/media/decoder/cts/DecoderTest.java
@@ -3726,9 +3726,6 @@
// Allow the playback to advance past the PTS gap and back to normal operation
Thread.sleep(500);
- // Simulate the end of playback by pretending that we have no more audio data
- mMediaCodecPlayer.stopDrainingAudioOutputBuffers(true);
-
// Sleep till framePosition stabilizes, i.e. playback is complete
{
long endOfPlayackTimeoutMs = 20000;
@@ -3842,13 +3839,9 @@
Thread.sleep(200);
mMediaCodecPlayer.stopDrainingAudioOutputBuffers(false);
- // After 200 ms, simulate the end of playback by pretending that we have no more audio data
- Thread.sleep(200);
- mMediaCodecPlayer.stopDrainingAudioOutputBuffers(true);
-
// Sleep till framePosition stabilizes, i.e. playback is complete
{
- long endOfPlayackTimeoutMs = 3000;
+ long endOfPlayackTimeoutMs = 20000;
long startTimeMs = System.currentTimeMillis();
AudioTimestamp previousTimestamp;
do {
diff --git a/tests/tests/media/decoder/src/android/media/decoder/cts/HDRDecoderTest.java b/tests/tests/media/decoder/src/android/media/decoder/cts/HDRDecoderTest.java
index 631c496..6718a71 100644
--- a/tests/tests/media/decoder/src/android/media/decoder/cts/HDRDecoderTest.java
+++ b/tests/tests/media/decoder/src/android/media/decoder/cts/HDRDecoderTest.java
@@ -288,7 +288,7 @@
CountDownLatch latch = new CountDownLatch(1);
mExtractor.seekTo(0, MediaExtractor.SEEK_TO_PREVIOUS_SYNC);
- MediaCodec mDecoder = MediaCodec.createByCodecName(mCodecName);
+ mDecoder = MediaCodec.createByCodecName(mCodecName);
mDecoder.setCallback(new MediaCodec.Callback() {
boolean mInputEOS;
boolean mOutputReceived;
diff --git a/tests/tests/media/drmframework/src/android/media/drmframework/cts/MediaDrmClearkeyTest.java b/tests/tests/media/drmframework/src/android/media/drmframework/cts/MediaDrmClearkeyTest.java
index 9fd83c6..465a5ee 100644
--- a/tests/tests/media/drmframework/src/android/media/drmframework/cts/MediaDrmClearkeyTest.java
+++ b/tests/tests/media/drmframework/src/android/media/drmframework/cts/MediaDrmClearkeyTest.java
@@ -32,6 +32,7 @@
import android.net.Uri;
import android.os.Build;
import android.os.Looper;
+import android.os.SystemProperties;
import android.platform.test.annotations.AppModeFull;
import android.platform.test.annotations.Presubmit;
import android.util.Base64;
@@ -127,6 +128,9 @@
private boolean mLostStateReceived;
private static boolean sIsAtLeastS = ApiLevelUtil.isAtLeast(Build.VERSION_CODES.S);
+ private static final boolean VNDK_IS_AT_LEAST_U =
+ SystemProperties.getInt("ro.vndk.version", Build.VERSION_CODES.CUR_DEVELOPMENT)
+ >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
public MediaDrmClearkeyTest() {
super(MediaStubActivity.class);
@@ -1681,7 +1685,7 @@
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
public void testGetKeyRequestDefaultUrl()
throws UnsupportedSchemeException, NotProvisionedException {
- if (watchHasNoClearkeySupport()) {
+ if (watchHasNoClearkeySupport() || !VNDK_IS_AT_LEAST_U) {
return;
}
diff --git a/tests/tests/media/encoder/Android.bp b/tests/tests/media/encoder/Android.bp
index cd860cc..5c9cc9e 100644
--- a/tests/tests/media/encoder/Android.bp
+++ b/tests/tests/media/encoder/Android.bp
@@ -30,29 +30,14 @@
"cts-media-common",
],
jni_libs: [
- "libctscodecutils_jni"
- ],
- aaptflags: [
- // Do not compress these files:
- "-0 .vp9",
- "-0 .ts",
- "-0 .heic",
- "-0 .trp",
- "-0 .ota",
- "-0 .mxmf",
+ "libctscodecutils_jni",
],
srcs: [
"src/**/*.java",
- "aidl/**/*.aidl",
],
// This test uses private APIs
platform_apis: true,
jni_uses_sdk_apis: true,
- libs: [
- "org.apache.http.legacy",
- "android.test.base",
- "android.test.runner",
- ],
test_suites: [
"cts",
"general-tests",
diff --git a/tests/tests/media/encoder/AndroidManifest.xml b/tests/tests/media/encoder/AndroidManifest.xml
index b6d56f3..937722e 100644
--- a/tests/tests/media/encoder/AndroidManifest.xml
+++ b/tests/tests/media/encoder/AndroidManifest.xml
@@ -31,7 +31,6 @@
<application android:requestLegacyExternalStorage="true"
android:largeHeap="true">
- <uses-library android:name="android.test.runner"/>
</application>
diff --git a/tests/tests/media/extractor/Android.bp b/tests/tests/media/extractor/Android.bp
index fad256f..471233a 100644
--- a/tests/tests/media/extractor/Android.bp
+++ b/tests/tests/media/extractor/Android.bp
@@ -35,10 +35,6 @@
],
platform_apis: true,
jni_uses_sdk_apis: true,
- libs: [
- "android.test.base",
- "android.test.runner",
- ],
test_suites: [
"cts",
"general-tests",
diff --git a/tests/tests/media/extractor/AndroidManifest.xml b/tests/tests/media/extractor/AndroidManifest.xml
index 82f45b9..80d8759 100644
--- a/tests/tests/media/extractor/AndroidManifest.xml
+++ b/tests/tests/media/extractor/AndroidManifest.xml
@@ -25,7 +25,6 @@
<application android:requestLegacyExternalStorage="true"
android:largeHeap="true">
- <uses-library android:name="android.test.runner"/>
</application>
diff --git a/tests/tests/media/misc/Android.bp b/tests/tests/media/misc/Android.bp
index cc22363..b7ea89e 100644
--- a/tests/tests/media/misc/Android.bp
+++ b/tests/tests/media/misc/Android.bp
@@ -69,6 +69,7 @@
"mockito-target-minus-junit4",
"androidx.heifwriter_heifwriter",
"CtsCameraUtils",
+ "aconfig_mediacodec_flags_java_lib",
],
jni_libs: [
"libctscodecutils_jni",
diff --git a/tests/tests/media/misc/src/android/media/misc/cts/OWNERS b/tests/tests/media/misc/src/android/media/misc/cts/OWNERS
index 90d6b62..2cd2c8e 100644
--- a/tests/tests/media/misc/src/android/media/misc/cts/OWNERS
+++ b/tests/tests/media/misc/src/android/media/misc/cts/OWNERS
@@ -1,2 +1,3 @@
per-file ExifInterfaceTest.java,MediaMetadataRetrieverTest.java=set noparent
per-file ExifInterfaceTest.java,MediaMetadataRetrieverTest.java=file:platform/frameworks/av:/media/janitors/media_solutions_OWNERS
+per-file ResourceManager* = girishshetty@google.com
diff --git a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerMultiTest.java b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerMultiTest.java
index 1db8991..e2b10af 100644
--- a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerMultiTest.java
+++ b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerMultiTest.java
@@ -16,6 +16,8 @@
package android.media.misc.cts;
+import static com.android.media.codec.flags.Flags.codecImportance;
+
import static org.junit.Assume.assumeTrue;
import android.content.Intent;
@@ -27,12 +29,14 @@
import android.os.SystemProperties;
import android.platform.test.annotations.AppModeFull;
import android.platform.test.annotations.RequiresDevice;
+import android.platform.test.annotations.RequiresFlagsEnabled;
import android.util.Range;
import androidx.test.rule.ActivityTestRule;
import com.android.compatibility.common.util.ApiLevelUtil;
import com.android.compatibility.common.util.NonMainlineTest;
+import com.android.media.codec.flags.Flags;
import org.junit.Rule;
import org.junit.Test;
@@ -225,9 +229,39 @@
activity.finish();
}
+ private void doTestCodecImportanceReclaimResource(
+ String codecName, String mimeType, int width, int height) throws Exception {
+ ResourceManagerStubActivity activity = mActivityRule.launchActivity(new Intent());
+ activity.doTestCodecImportanceReclaimResource(
+ codecName, mimeType, width, height,
+ true, /*high resolution*/
+ true /*change importance during codec configuration*/);
+ activity.finish();
+ }
+
+ // Activity1 creates allowable number of codecs with given name (mCodecName)
+ // for the given mime type (mMimeType) and the resolution as a background task.
+ // Activity2 attempts to create at least one codec which should result it resource
+ // manager service reclaiming a codec from Activity1 (background activity - lower priority)
+ // Test verifies that the Activity1 has received a codec reclaim exception and
+ // the Activity2 could create at least one codec successfully.
@Test
public void testReclaimResource() throws Exception {
assumeTrue("The Device should be on at least VNDK U", VNDK_IS_AT_LEAST_U);
doTestReclaimResource(mCodecName, mMimeType, mWidth, mHeight);
}
+
+ // Activity creates allowable number of codecs with given name (mCodecName)
+ // for the given mime type (mMimeType) and the resolution.
+ // The first codec is configured at lower importance so that the test verifies
+ // that the first codec is reclaimed while starting a more important codec
+ // at the later stage (when all codec resources run out).
+ // Once the first (lower importance) is reclaimed, the test attempts to configure
+ // another lower importance codec, which it expects to fail.
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_CODEC_IMPORTANCE)
+ public void testCodecImportanceReclaimResource() throws Exception {
+ assumeTrue("Codec Importance Feature is OFF", codecImportance());
+ doTestCodecImportanceReclaimResource(mCodecName, mMimeType, mWidth, mHeight);
+ }
}
diff --git a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerRecorderActivity.java b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerRecorderActivity.java
index 07020d6..82fa16c 100644
--- a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerRecorderActivity.java
+++ b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerRecorderActivity.java
@@ -16,6 +16,8 @@
package android.media.misc.cts;
+import static org.junit.Assert.assertTrue;
+
import android.hardware.Camera;
import android.hardware.cts.helpers.CameraUtils;
import android.media.MediaCodecList;
@@ -30,8 +32,6 @@
import android.util.Log;
import android.view.Surface;
-import static org.junit.Assert.assertTrue;
-
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
@@ -44,8 +44,6 @@
// - record at lowest supported resolution or the highest resolution
public class ResourceManagerRecorderActivity extends MediaStubActivity {
private static final int RECORD_TIME_MS = 3000;
- private static final int VIDEO_WIDTH = 176;
- private static final int VIDEO_HEIGHT = 144;
private static final float LATITUDE = 0.0000f;
private static final float LONGITUDE = -180.0f;
private static final float TOLERANCE = 0.0002f;
@@ -54,8 +52,8 @@
private int mResult = RESULT_CANCELED;
private boolean mHighResolution = false;
- private int mVideoWidth = VIDEO_WIDTH;
- private int mVideoHeight = VIDEO_HEIGHT;
+ private int mVideoWidth = 0;
+ private int mVideoHeight = 0;
private int mVideoEncoderType = MediaRecorder.VideoEncoder.H264;
private String mMime = MediaFormat.MIMETYPE_VIDEO_AVC;
private Camera mCamera;
@@ -153,7 +151,7 @@
// Pick the max or min resolution (width * height) based
// on the requirement.
long curMaxResolution = 0;
- long curMinResolution = VIDEO_WIDTH * VIDEO_HEIGHT;
+ long curMinResolution = Long.MAX_VALUE;
for (Camera.Size size : videoSizes) {
long resolution = (long) size.width * size.height;
if (!mHighResolution && (resolution < curMinResolution)) {
diff --git a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerStubActivity.java b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerStubActivity.java
index d4779c8..d16a48d 100644
--- a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerStubActivity.java
+++ b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerStubActivity.java
@@ -42,6 +42,7 @@
private int mType1 = ResourceManagerTestActivityBase.TYPE_NONSECURE;
private int mType2 = ResourceManagerTestActivityBase.TYPE_NONSECURE;
private boolean mWaitForReclaim = true;
+ private boolean mStartedOnlyOneActivity = false;
private static final String ERROR_INSUFFICIENT_RESOURCES =
"* Please check if the omx component is returning OMX_ErrorInsufficientResources " +
@@ -70,14 +71,14 @@
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(TAG, "Activity " + requestCode + " finished with resultCode " + resultCode);
mResults[requestCode] = resultCode;
- if (++mNumResults == mResults.length) {
+ if (++mNumResults == mResults.length || mStartedOnlyOneActivity) {
synchronized (mFinishEvent) {
mFinishEvent.notify();
}
}
}
- private boolean processActivityResults() {
+ private void processActivityResults() {
boolean result = true;
for (int i = 0; result && i < mResults.length; ++i) {
switch (mResults[i]) {
@@ -103,7 +104,19 @@
}
}
- return result;
+ if (!result) {
+ String failMessage = "The potential reasons for the failure:\n";
+ StringBuilder reasons = new StringBuilder();
+ reasons.append(ERROR_INSUFFICIENT_RESOURCES);
+ if (mType1 != mType2) {
+ reasons.append(ERROR_SUPPORTS_SECURE_WITH_NON_SECURE_CODEC);
+ }
+ if (mType1 == ResourceManagerTestActivityBase.TYPE_MIX
+ && mType2 == ResourceManagerTestActivityBase.TYPE_SECURE) {
+ reasons.append(ERROR_SUPPORTS_MULTIPLE_SECURE_CODECS);
+ }
+ Assert.assertTrue(failMessage + reasons.toString(), result);
+ }
}
private void waitForActivitiesToComplete() throws InterruptedException {
@@ -115,6 +128,15 @@
}
}
+ private void waitForOneActivityToComplete() throws InterruptedException {
+ // Wait for one activity to complete.
+ synchronized (mFinishEvent) {
+ while (mNumResults != 1) {
+ mFinishEvent.wait();
+ }
+ }
+ }
+
public void testReclaimResource(int type1, int type2, boolean highResolutionForActivity1,
boolean highResolutionForActivity2) throws InterruptedException {
mType1 = type1;
@@ -153,20 +175,7 @@
thread.join();
Log.i(TAG, "Activities completed");
- boolean result = processActivityResults();
- if (!result) {
- String failMessage = "The potential reasons for the failure:\n";
- StringBuilder reasons = new StringBuilder();
- reasons.append(ERROR_INSUFFICIENT_RESOURCES);
- if (mType1 != mType2) {
- reasons.append(ERROR_SUPPORTS_SECURE_WITH_NON_SECURE_CODEC);
- }
- if (mType1 == ResourceManagerTestActivityBase.TYPE_MIX
- && mType2 == ResourceManagerTestActivityBase.TYPE_SECURE) {
- reasons.append(ERROR_SUPPORTS_MULTIPLE_SECURE_CODECS);
- }
- Assert.assertTrue(failMessage + reasons.toString(), result);
- }
+ processActivityResults();
}
public void testVideoCodecReclaim(boolean highResolution, String mimeType)
@@ -205,13 +214,7 @@
thread.join();
Log.i(TAG, "Activities completed");
- boolean result = processActivityResults();
- if (!result) {
- String failMessage = "The potential reasons for the failure:\n";
- StringBuilder reasons = new StringBuilder();
- reasons.append(ERROR_INSUFFICIENT_RESOURCES);
- Assert.assertTrue(failMessage + reasons.toString(), result);
- }
+ processActivityResults();
}
public void doTestReclaimResource(String codecName, String mimeType, int width, int height)
@@ -252,12 +255,59 @@
thread.join();
Log.i(TAG, "Activities completed");
- boolean result = processActivityResults();
- if (!result) {
- String failMessage = "The potential reasons for the failure:\n";
- StringBuilder reasons = new StringBuilder();
- reasons.append(ERROR_INSUFFICIENT_RESOURCES);
- Assert.assertTrue(failMessage + reasons.toString(), result);
- }
+ processActivityResults();
+ }
+
+ /**
+ * creates allowable number of decoders at given resolution.
+ * All the codecs are configured with the default importance (highest)
+ * But, when we get a INSUFFICIENT_RESOURCE, we lower the importance of the
+ * first codec so that we can create/start one more codec by reclaiming the
+ * first codec (that has lower importance now)
+ */
+ public void doTestCodecImportanceReclaimResource(
+ String codecName, String mimeType, int width, int height,
+ boolean highResolution, boolean changeImportanceAtConfig)
+ throws InterruptedException {
+ mWaitForReclaim = true;
+ Thread thread = new Thread() {
+ @Override
+ public void run() {
+ try {
+ Context context = getApplicationContext();
+ Intent intent = new Intent(context, ResourceManagerTestActivity2.class);
+ intent.putExtra("test-type", mType1);
+ intent.putExtra("wait-for-reclaim", mWaitForReclaim);
+ intent.putExtra("name", codecName);
+ intent.putExtra("mime", mimeType);
+ if (width == 0 || height == 0) {
+ intent.putExtra("high-resolution", highResolution);
+ } else {
+ intent.putExtra("width", width);
+ intent.putExtra("height", height);
+ }
+ if (changeImportanceAtConfig) {
+ intent.putExtra("codec-importance-at-config", true);
+ } else {
+ intent.putExtra("codec-importance-later", true);
+ }
+ mStartedOnlyOneActivity = true;
+ startActivityForResult(intent, mRequestCodes[0]);
+ waitForOneActivityToComplete();
+ } catch (Exception e) {
+ Log.d(TAG, "doTestCodecImportanceReclaimResource got exception "
+ + e.toString());
+ }
+ }
+ };
+
+ thread.start();
+ Log.i(TAG, "Started and waiting for Activities");
+ thread.join();
+ Log.i(TAG, "Activities completed");
+
+ // Since we have started one activity, set the other activity code to success.
+ mResults[1] = RESULT_OK;
+ processActivityResults();
}
}
diff --git a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTest.java b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTest.java
index 2a32829..75fc55e 100644
--- a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTest.java
+++ b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTest.java
@@ -16,6 +16,8 @@
package android.media.misc.cts;
+import static com.android.media.codec.flags.Flags.codecImportance;
+
import static org.junit.Assume.assumeTrue;
import android.content.Intent;
@@ -23,12 +25,14 @@
import android.os.Build;
import android.platform.test.annotations.AppModeFull;
import android.platform.test.annotations.RequiresDevice;
+import android.platform.test.annotations.RequiresFlagsEnabled;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;
import com.android.compatibility.common.util.ApiLevelUtil;
import com.android.compatibility.common.util.NonMainlineTest;
+import com.android.media.codec.flags.Flags;
import org.junit.Rule;
import org.junit.Test;
@@ -76,6 +80,24 @@
}
}
+ private void doTestCodecImportanceReclaim(boolean highResolution, String mimeType,
+ boolean changeImportanceAtConfig) throws Exception {
+ assumeTrue("Codec Importance Feature is OFF", codecImportance());
+ // Run high resolution test case only when the devices shipped on U.
+ if (SDK_IS_AT_LEAST_U || !highResolution) {
+ ResourceManagerStubActivity activity = mActivityRule.launchActivity(new Intent());
+ // Let the test pick the codec name, width, height.
+ String codecName = "none";
+ int width = 0;
+ int height = 0;
+ activity.doTestCodecImportanceReclaimResource(
+ codecName, mimeType, width, height, highResolution, changeImportanceAtConfig);
+ activity.finish();
+ } else {
+ assumeTrue("The Device should be on at least SDK U", false);
+ }
+ }
+
// Following 6 test cases verify the below usecase:
// Activity1 creates allowable number of secure and/or unsecure decoders at
// lowest resolution supported in the background.
@@ -169,19 +191,19 @@
@Test
public void testReclaimResourceNonsecureVsSecureLowHighResolution() throws Exception {
doTestReclaimResource(ResourceManagerTestActivityBase.TYPE_NONSECURE,
- ResourceManagerTestActivityBase.TYPE_NONSECURE, false, true);
+ ResourceManagerTestActivityBase.TYPE_SECURE, false, true);
}
@Test
public void testReclaimResourceSecureVsNonsecureLowHighResolution() throws Exception {
- doTestReclaimResource(ResourceManagerTestActivityBase.TYPE_NONSECURE,
+ doTestReclaimResource(ResourceManagerTestActivityBase.TYPE_SECURE,
ResourceManagerTestActivityBase.TYPE_NONSECURE, false, true);
}
@Test
public void testReclaimResourceSecureVsSecureLowHighResolution() throws Exception {
- doTestReclaimResource(ResourceManagerTestActivityBase.TYPE_NONSECURE,
- ResourceManagerTestActivityBase.TYPE_NONSECURE, false, true);
+ doTestReclaimResource(ResourceManagerTestActivityBase.TYPE_SECURE,
+ ResourceManagerTestActivityBase.TYPE_SECURE, false, true);
}
@Test
@@ -209,19 +231,19 @@
@Test
public void testReclaimResourceNonsecureVsSecureHighLowResolution() throws Exception {
doTestReclaimResource(ResourceManagerTestActivityBase.TYPE_NONSECURE,
- ResourceManagerTestActivityBase.TYPE_NONSECURE, true, false);
+ ResourceManagerTestActivityBase.TYPE_SECURE, true, false);
}
@Test
public void testReclaimResourceSecureVsNonsecureHighLowResolution() throws Exception {
- doTestReclaimResource(ResourceManagerTestActivityBase.TYPE_NONSECURE,
+ doTestReclaimResource(ResourceManagerTestActivityBase.TYPE_SECURE,
ResourceManagerTestActivityBase.TYPE_NONSECURE, true, false);
}
@Test
public void testReclaimResourceSecureVsSecureHighLowResolution() throws Exception {
- doTestReclaimResource(ResourceManagerTestActivityBase.TYPE_NONSECURE,
- ResourceManagerTestActivityBase.TYPE_NONSECURE, true, false);
+ doTestReclaimResource(ResourceManagerTestActivityBase.TYPE_SECURE,
+ ResourceManagerTestActivityBase.TYPE_SECURE, true, false);
}
@Test
@@ -271,4 +293,128 @@
public void testHEVCVideoCodecReclaimHighResolution() throws Exception {
doTestVideoCodecReclaim(true, MediaFormat.MIMETYPE_VIDEO_HEVC);
}
+
+ // Activity creates allowable number of AVC decoders at
+ // lowest resolution supported.
+ // The first codec is configured at lower importance so that the test verifies
+ // that the first codec is reclaimed while starting a more important codec
+ // at the later stage (when all codec resources run out).
+ // Once the first (lower importance) is reclaimed, the test attempts to configure
+ // another lower importance codec, which it expects to fail.
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_CODEC_IMPORTANCE)
+ public void testAVCVideoCodecImportanceReclaimLowResolution() throws Exception {
+ doTestCodecImportanceReclaim(false, /*low resolution*/
+ MediaFormat.MIMETYPE_VIDEO_AVC, /*use avc codec*/
+ true /*change importance during codec configuration*/);
+ }
+
+ // Activity creates allowable number of AVC decoders at
+ // highest resolution supported.
+ // The first codec is configured at lower importance so that the test verifies
+ // that the first codec is reclaimed while starting a more important codec
+ // at the later stage (when all codec resources run out).
+ // Once the first (lower importance) is reclaimed, the test attempts to configure
+ // another lower importance codec, which it expects to fail.
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_CODEC_IMPORTANCE)
+ public void testAVCVideoCodecImportanceReclaimHighResolution() throws Exception {
+ doTestCodecImportanceReclaim(true, /*high resolution */
+ MediaFormat.MIMETYPE_VIDEO_AVC, /*use avc codec*/
+ true /*change importance during codec configuration*/);
+ }
+
+ // Activity creates allowable number of HEVC decoders at
+ // lowest resolution supported.
+ // The first codec is configured at lower importance so that the test verifies
+ // that the first codec is reclaimed while starting a more important codec
+ // at the later stage (when all codec resources run out).
+ // Once the first (lower importance) is reclaimed, the test attempts to configure
+ // another lower importance codec, which it expects to fail.
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_CODEC_IMPORTANCE)
+ public void testHEVCVideoCodecImportanceReclaimLowResolution() throws Exception {
+ doTestCodecImportanceReclaim(false, /*low resolution*/
+ MediaFormat.MIMETYPE_VIDEO_HEVC, /*use hevc codec*/
+ true /*change importance during codec configuration*/);
+ }
+
+ // Activity creates allowable number of HEVC decoders at
+ // highest resolution supported.
+ // The first codec is configured at lower importance so that the test verifies
+ // that the first codec is reclaimed while starting a more important codec
+ // at the later stage (when all codec resources run out).
+ // Once the first (lower importance) is reclaimed, the test attempts to configure
+ // another lower importance codec, which it expects to fail.
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_CODEC_IMPORTANCE)
+ public void testHEVCVideoCodecImportanceReclaimHighResolution() throws Exception {
+ doTestCodecImportanceReclaim(true, /*high resolution */
+ MediaFormat.MIMETYPE_VIDEO_HEVC, /*use hevc codec*/
+ true /*change importance during codec configuration*/);
+ }
+
+ // Activity creates allowable number of AVC decoders at
+ // lowest resolution supported.
+ // All the codecs are configured with the default importance (highest)
+ // But, when we get a INSUFFICIENT_RESOURCE, we lower the importance of the
+ // first codec so that we can create/start one more codec by reclaiming the
+ // first codec (that has lower importance now)
+ // Once the first (lower importance) is reclaimed, the test attempts to configure
+ // another lower importance codec, which it expects to fail.
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_CODEC_IMPORTANCE)
+ public void testAVCVideoCodecImportanceReclaimWithSetParamLowResolution() throws Exception {
+ doTestCodecImportanceReclaim(false, /*low resolution*/
+ MediaFormat.MIMETYPE_VIDEO_AVC, /*use avc codec*/
+ false /*change importance after codec config with setParam*/);
+ }
+
+ // Activity creates allowable number of AVC decoders at
+ // highest resolution supported.
+ // All the codecs are configured with the default importance (highest)
+ // But, when we get a INSUFFICIENT_RESOURCE, we lower the importance of the
+ // first codec so that we can create/start one more codec by reclaiming the
+ // first codec (that has lower importance now)
+ // Once the first (lower importance) is reclaimed, the test attempts to configure
+ // another lower importance codec, which it expects to fail.
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_CODEC_IMPORTANCE)
+ public void testAVCVideoCodecImportanceReclaimWithSetParamHighResolution() throws Exception {
+ doTestCodecImportanceReclaim(true, /*high resolution*/
+ MediaFormat.MIMETYPE_VIDEO_AVC, /*use avc codec*/
+ false /*change importance after codec config with setParam*/);
+ }
+
+ // Activity creates allowable number of HEVC decoders at
+ // lowest resolution supported.
+ // All the codecs are configured with the default importance (highest)
+ // But, when we get a INSUFFICIENT_RESOURCE, we lower the importance of the
+ // first codec so that we can create/start one more codec by reclaiming the
+ // first codec (that has lower importance now)
+ // Once the first (lower importance) is reclaimed, the test attempts to configure
+ // another lower importance codec, which it expects to fail.
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_CODEC_IMPORTANCE)
+ public void testHEVCVideoCodecImportanceReclaimWithSetParamLowResolution() throws Exception {
+ doTestCodecImportanceReclaim(false, /*low resolution*/
+ MediaFormat.MIMETYPE_VIDEO_HEVC, /*use hevc codec*/
+ false /*change importance after codec config with setParam*/);
+ }
+
+ // Activity creates allowable number of HEVC decoders at
+ // highest resolution supported.
+ // All the codecs are configured with the default importance (highest)
+ // But, when we get a INSUFFICIENT_RESOURCE, we lower the importance of the
+ // first codec so that we can create/start one more codec by reclaiming the
+ // first codec (that has lower importance now)
+ // Once the first (lower importance) is reclaimed, the test attempts to configure
+ // another lower importance codec, which it expects to fail.
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_CODEC_IMPORTANCE)
+ public void testHEVCVideoCodecImportanceReclaimWithSetParamHighResolution() throws Exception {
+ doTestCodecImportanceReclaim(true, /*high resolution */
+ MediaFormat.MIMETYPE_VIDEO_HEVC, /*use hevc codec*/
+ false /*change importance after codec config with setParam*/);
+ }
}
diff --git a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTestActivity2.java b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTestActivity2.java
index a5cc801..4498a26 100644
--- a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTestActivity2.java
+++ b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTestActivity2.java
@@ -35,6 +35,13 @@
if (codecCount == 0) {
result = RESULT_CANCELED;
}
- finishWithResult(result);
+ // If we have set codec-importance, then we expect reclaim error, provided,
+ // the activity has already created MAX_INSTANCES of codecs.
+ // So wait for the codecs to be used and reclaim error to be thrown.
+ if (mChangingCodecImportance && result == RESULT_OK && codecCount < MAX_INSTANCES) {
+ useCodecs();
+ } else {
+ finishWithResult(result);
+ }
}
}
diff --git a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTestActivityBase.java b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTestActivityBase.java
index 808dc03..02ff2eb 100644
--- a/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTestActivityBase.java
+++ b/tests/tests/media/misc/src/android/media/misc/cts/ResourceManagerTestActivityBase.java
@@ -37,9 +37,14 @@
// 10 seconds between I-frames
private static final int IFRAME_INTERVAL = 10;
protected static final int MAX_INSTANCES = 32;
+ // Less important codec of value 100.
+ private static final int CODEC_IMPORTANCE_100 = 100;
private static final MediaCodecList sMCL = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
private boolean mIsEncoder = false;
+ protected boolean mChangingCodecImportance = false;
+ private boolean mUseCodecImportanceAtConfig = false;
+ private boolean mUseCodecImportanceLater = false;
private int mWidth = 0;
private int mHeight = 0;
protected String TAG;
@@ -47,6 +52,7 @@
private String mCodecName = "none";
private ArrayList<MediaCodec> mCodecs = new ArrayList<MediaCodec>();
+ private MediaCodec mFirstMediaCodec;
private class TestCodecCallback extends MediaCodec.Callback {
@Override
@@ -62,7 +68,15 @@
@Override
public void onError(MediaCodec codec, MediaCodec.CodecException e) {
- Log.e(TAG, "onError " + codec.toString() + " errorCode " + e.getErrorCode());
+ int error = e.getErrorCode();
+ Log.e(TAG, "onError " + codec.toString() + " errorCode " + error);
+ if (mChangingCodecImportance && error == MediaCodec.CodecException.ERROR_RECLAIMED) {
+ if (mFirstMediaCodec == codec) {
+ mGotReclaimedException = true;
+ Log.d(TAG, "Codec " + codec + " Was expected to be Reclaimed");
+ }
+ codec.release();
+ }
}
@Override
@@ -189,6 +203,15 @@
} else if (mHeight >= 1080) {
highResolution = true;
}
+
+ // See if we need to set codec-importance during config.
+ mUseCodecImportanceAtConfig = extras.getBoolean("codec-importance-at-config", false);
+ if (!mUseCodecImportanceAtConfig) {
+ // See if we need to set codec-importance later (using setParameters)
+ mUseCodecImportanceLater = extras.getBoolean("codec-importance-later", false);
+ }
+ // Setting this flag to track that we get an expected reclaim on expected codec.
+ mChangingCodecImportance = mUseCodecImportanceAtConfig || mUseCodecImportanceLater;
}
boolean shouldSkip = false;
@@ -231,6 +254,12 @@
return mCodecs.size();
}
+ private void changeCodecImportance(MediaCodec codec, int importance) {
+ final Bundle params = new Bundle();
+ params.putInt(MediaFormat.KEY_IMPORTANCE, importance);
+ codec.setParameters(params);
+ }
+
protected void allocateCodecs(int max, MediaCodecInfo info, boolean securePlayback,
boolean highResolution) {
mCodecName = info.getName();
@@ -238,13 +267,39 @@
CodecCapabilities caps = info.getCapabilitiesForType(mMime);
MediaFormat format = getTestFormat(caps, securePlayback, highResolution);
MediaCodec codec = null;
+ boolean firstCodec = true;
+ boolean loweredFirstCodecImportance = false;
+ boolean lastCodecAttemptWithImportance = false;
+ boolean loweredLastCodecImportance = false;
for (int i = mCodecs.size(); i < max; ++i) {
try {
Log.d(TAG, "Create codec " + mCodecName + " #" + i);
codec = MediaCodec.createByCodecName(mCodecName);
codec.setCallback(mCallback);
Log.d(TAG, "Configure codec " + format);
+
+ // if it's the first codec and if we are to set the importance while configuring,
+ // then set the same through MediaFormat with codec-importance as a lesser value.
+ if (firstCodec && mUseCodecImportanceAtConfig) {
+ format.setInteger(MediaFormat.KEY_IMPORTANCE, CODEC_IMPORTANCE_100);
+ mFirstMediaCodec = codec;
+ }
+ // The last codec creation failed because of insufficient resources.
+ // So, lets attempt to create one last codec with lesser importance (100)
+ // and expect it to fail as well.
+ if (lastCodecAttemptWithImportance) {
+ format.setInteger(MediaFormat.KEY_IMPORTANCE, CODEC_IMPORTANCE_100);
+ loweredLastCodecImportance = true;
+ }
codec.configure(format, null, null, flag);
+
+ // We don't want to lower the importance for other codecs.
+ // So, remove it from the format, if it were set above.
+ // The remaining codecs will have the default codec-importance as highest (0).
+ if (firstCodec && mUseCodecImportanceAtConfig) {
+ format.removeKey(MediaFormat.KEY_IMPORTANCE);
+ firstCodec = false;
+ }
Log.d(TAG, "Start codec " + format);
codec.start();
mCodecs.add(codec);
@@ -256,8 +311,32 @@
Log.d(TAG, "IOException " + e.getMessage());
break;
} catch (MediaCodec.CodecException e) {
- Log.d(TAG, "CodecException 0x" + Integer.toHexString(e.getErrorCode()));
- break;
+ int error = e.getErrorCode();
+ Log.d(TAG, "CodecException 0x" + Integer.toHexString(error));
+ if (mUseCodecImportanceLater && !loweredFirstCodecImportance
+ && error == MediaCodec.CodecException.ERROR_INSUFFICIENT_RESOURCE) {
+ // Making sure we have at least one codec started.
+ Log.d(TAG, "Make Codec 0 less important so that it will be reclaimed");
+ if (i > 0) {
+ mFirstMediaCodec = mCodecs.get(0);
+ changeCodecImportance(mFirstMediaCodec, CODEC_IMPORTANCE_100);
+ // We are doing it only once.
+ loweredFirstCodecImportance = true;
+ continue;
+ } else {
+ // We don't have any codecs to lower the importance.
+ break;
+ }
+ } else if (!loweredLastCodecImportance && mChangingCodecImportance) {
+ // The last codec start failed because of insufficient resources.
+ // So, lets attempt to create one last codec with lesser importance (100)
+ // and expect it to fail as well.
+ Log.d(TAG, "Attempt creating less important codec and expect it to fail");
+ lastCodecAttemptWithImportance = true;
+ continue;
+ } else {
+ break;
+ }
} finally {
if (codec != null) {
Log.d(TAG, "release codec");
@@ -270,7 +349,7 @@
protected void finishWithResult(int result) {
for (int i = 0; i < mCodecs.size(); ++i) {
- Log.d(TAG, "release codec #" + i);
+ Log.d(TAG, "release codec #" + i + " : " + mCodecs.get(i).toString());
mCodecs.get(i).release();
}
mCodecs.clear();
diff --git a/tests/tests/media/muxer/Android.bp b/tests/tests/media/muxer/Android.bp
index 85eab12..8575ccb 100644
--- a/tests/tests/media/muxer/Android.bp
+++ b/tests/tests/media/muxer/Android.bp
@@ -51,24 +51,11 @@
jni_libs: [
"libctsmediamuxertest_jni",
],
- // do not compress media files
- aaptflags: [
- "-0 .vp9",
- "-0 .ts",
- "-0 .heic",
- "-0 .trp",
- "-0 .ota",
- "-0 .mxmf",
- ],
srcs: [
"src/**/*.java",
],
platform_apis: true,
jni_uses_sdk_apis: true,
- libs: [
- "android.test.base",
- "android.test.runner",
- ],
test_suites: [
"cts",
"general-tests",
diff --git a/tests/tests/media/muxer/AndroidManifest.xml b/tests/tests/media/muxer/AndroidManifest.xml
index f914229..87b428a 100644
--- a/tests/tests/media/muxer/AndroidManifest.xml
+++ b/tests/tests/media/muxer/AndroidManifest.xml
@@ -25,7 +25,6 @@
<application android:requestLegacyExternalStorage="true"
android:largeHeap="true">
- <uses-library android:name="android.test.runner"/>
</application>
diff --git a/tests/tests/media/player/res/raw/segment000001.ts b/tests/tests/media/player/res/raw/segment000001.ts
deleted file mode 100644
index fb112ec..0000000
--- a/tests/tests/media/player/res/raw/segment000001.ts
+++ /dev/null
Binary files differ
diff --git a/tests/tests/media/player/src/android/media/player/cts/MediaPlayerTest.java b/tests/tests/media/player/src/android/media/player/cts/MediaPlayerTest.java
index 52ec47c..a113c7d 100644
--- a/tests/tests/media/player/src/android/media/player/cts/MediaPlayerTest.java
+++ b/tests/tests/media/player/src/android/media/player/cts/MediaPlayerTest.java
@@ -102,9 +102,6 @@
/**
* Tests for the MediaPlayer API and local video/audio playback.
*
- * The files in res/raw used by testLocalVideo* are (c) copyright 2008,
- * Blender Foundation / www.bigbuckbunny.org, and are licensed under the Creative Commons
- * Attribution 3.0 License at http://creativecommons.org/licenses/by/3.0/us/.
*/
@SmallTest
@RequiresDevice
@@ -325,7 +322,7 @@
final int tolerance = 70;
final int seekDuration = 100;
- // This is "R.raw.testmp3_2", base64-encoded.
+ // This is "testmp3_2.raw", base64-encoded.
final String res = "testmp3_3.raw";
Preconditions.assertTestFileExists(mInpPrefix + res);
diff --git a/tests/tests/media/projection/Android.bp b/tests/tests/media/projection/Android.bp
index bca976e..6d35139e 100644
--- a/tests/tests/media/projection/Android.bp
+++ b/tests/tests/media/projection/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_lse_app_compat",
// See: http://go/android-license-faq
default_applicable_licenses: [
"Android-Apache-2.0",
@@ -34,29 +35,12 @@
"testng",
"truth",
],
- aaptflags: [
- "--auto-add-overlay",
-
- // Do not compress these files:
- "-0 .vp9",
- "-0 .ts",
- "-0 .heic",
- "-0 .trp",
- "-0 .ota",
- "-0 .mxmf",
- ],
srcs: [
"src/**/*.java",
- "aidl/**/*.aidl",
],
// This test uses private APIs
platform_apis: true,
jni_uses_sdk_apis: true,
- libs: [
- "org.apache.http.legacy",
- "android.test.base",
- "android.test.runner",
- ],
// Tag this module as a cts test artifact
test_suites: [
"cts",
diff --git a/tests/tests/media/projection/AndroidManifest.xml b/tests/tests/media/projection/AndroidManifest.xml
index f5a9ee0..0280ca6 100644
--- a/tests/tests/media/projection/AndroidManifest.xml
+++ b/tests/tests/media/projection/AndroidManifest.xml
@@ -32,9 +32,6 @@
<application
android:requestLegacyExternalStorage="true"
android:largeHeap="true">
- <uses-library android:name="android.test.runner"/>
- <uses-library android:name="org.apache.http.legacy"
- android:required="false"/>
<activity android:name="android.media.projection.cts.MediaProjectionCustomIntentActivity"
android:label="MediaProjectionActivity"
android:screenOrientation="locked"/>
diff --git a/tests/tests/media/recorder/Android.bp b/tests/tests/media/recorder/Android.bp
index 9e17567..313982a 100644
--- a/tests/tests/media/recorder/Android.bp
+++ b/tests/tests/media/recorder/Android.bp
@@ -29,25 +29,11 @@
"ctstestrunner-axt",
"cts-media-common",
],
- // do not compress media files
- aaptflags: [
- "-0 .vp9",
- "-0 .ts",
- "-0 .heic",
- "-0 .trp",
- "-0 .ota",
- "-0 .mxmf",
- ],
srcs: [
"src/**/*.java",
- "aidl/**/*.aidl",
],
platform_apis: true,
jni_uses_sdk_apis: true,
- libs: [
- "android.test.base",
- "android.test.runner",
- ],
test_suites: [
"cts",
"general-tests",
diff --git a/tests/tests/media/recorder/AndroidManifest.xml b/tests/tests/media/recorder/AndroidManifest.xml
index 28ddf67..b481bb6 100644
--- a/tests/tests/media/recorder/AndroidManifest.xml
+++ b/tests/tests/media/recorder/AndroidManifest.xml
@@ -29,7 +29,6 @@
<application android:requestLegacyExternalStorage="true"
android:largeHeap="true">
- <uses-library android:name="android.test.runner"/>
</application>
diff --git a/tests/tests/mediacujtest/common/Android.bp b/tests/tests/mediacujtest/common/Android.bp
index 582c033..5f95f92 100644
--- a/tests/tests/mediacujtest/common/Android.bp
+++ b/tests/tests/mediacujtest/common/Android.bp
@@ -29,6 +29,7 @@
"androidx.media3.media3-common",
"androidx.media3.media3-exoplayer",
"androidx.media3.media3-ui",
+ "permission-test-util-lib",
],
libs: [
"auto_value_annotations",
diff --git a/tests/tests/mediacujtest/common/AndroidManifest.xml b/tests/tests/mediacujtest/common/AndroidManifest.xml
index 554b055..520d7c1 100644
--- a/tests/tests/mediacujtest/common/AndroidManifest.xml
+++ b/tests/tests/mediacujtest/common/AndroidManifest.xml
@@ -18,6 +18,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="android.media.cujcommon.cts">
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
+
<application
android:allowBackup="true"
android:usesCleartextTraffic="true">
@@ -25,7 +27,8 @@
android:exported="true"
android:name="android.media.cujcommon.cts.MainActivity"
android:theme="@style/Theme.AppCompat"
- android:configChanges="orientation|screenSize">
+ android:supportsPictureInPicture="true"
+ android:configChanges="orientation|screenLayout|screenSize|smallestScreenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/AdaptivePlaybackTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/AdaptivePlaybackTestPlayerListener.java
new file mode 100644
index 0000000..5475537
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/AdaptivePlaybackTestPlayerListener.java
@@ -0,0 +1,158 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import static org.junit.Assert.assertEquals;
+
+import android.os.Looper;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.C;
+import androidx.media3.common.Format;
+import androidx.media3.common.Player;
+import androidx.media3.common.TrackSelectionOverride;
+import androidx.media3.common.TrackSelectionParameters;
+import androidx.media3.common.Tracks;
+import androidx.media3.common.VideoSize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AdaptivePlaybackTestPlayerListener extends PlayerListener {
+
+ private boolean mResolutionChangeRequested;
+ private int mCurrentResolutionWidth;
+ private int mCurrentResolutionHeight;
+ private final int mNumOfVideoTrack;
+ private int mIndexIncrement;
+ private int mCurrentTrackIndex = C.INDEX_UNSET;
+ private Tracks.Group mVideoTrackGroup;
+ private List<Format> mVideoFormatList;
+
+ public AdaptivePlaybackTestPlayerListener(int numOfVideoTrack, long sendMessagePosition) {
+ super();
+ this.mSendMessagePosition = sendMessagePosition;
+ this.mNumOfVideoTrack = numOfVideoTrack;
+ this.mIndexIncrement = 1;
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.ADAPTIVE_PLAYBACK_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ if (mResolutionChangeRequested) {
+ int configuredResolutionWidth = mVideoFormatList.get(mCurrentTrackIndex).width;
+ int configuredResolutionHeight = mVideoFormatList.get(mCurrentTrackIndex).height;
+ assertEquals(configuredResolutionWidth, mCurrentResolutionWidth);
+ assertEquals(configuredResolutionHeight, mCurrentResolutionHeight);
+ // Reversing the track iteration order
+ if (mCurrentTrackIndex == mVideoFormatList.size() - 1) {
+ mIndexIncrement *= -1;
+ }
+ mCurrentTrackIndex += mIndexIncrement;
+ mResolutionChangeRequested = false;
+ } else {
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ // When player is ready, get the list of supported video Format(s) in the DASH mediaItem
+ mVideoFormatList = getVideoFormatList();
+ mCurrentTrackIndex = 0;
+ }
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ // Iterating forwards and then backwards for all the available video tracks
+ final int totalNumOfVideoTrackChange = mNumOfVideoTrack * 2;
+ // Create messages to be executed at different positions
+ for (int count = 1; count < totalNumOfVideoTrackChange; count++) {
+ createAdaptivePlaybackMessage(mSendMessagePosition * (count));
+ }
+ }
+
+ /**
+ * Called each time when getVideoSize() changes. onEvents(Player, Player.Events) will also be
+ * called to report this event along with other events that happen in the same Looper message
+ * queue iteration.
+ *
+ * @param videoSize The new size of the video.
+ */
+ public void onVideoSizeChanged(VideoSize videoSize) {
+ mCurrentResolutionWidth = videoSize.width;
+ mCurrentResolutionHeight = videoSize.height;
+ }
+
+ /**
+ * Create a message at given position to change the resolution
+ *
+ * @param sendMessagePosition Position at which message needs to be executed
+ */
+ private void createAdaptivePlaybackMessage(long sendMessagePosition) {
+ mActivity.mPlayer.createMessage((messageType, payload) -> {
+ TrackSelectionParameters currentParameters =
+ mActivity.mPlayer.getTrackSelectionParameters();
+ TrackSelectionParameters newParameters = currentParameters
+ .buildUpon()
+ .setOverrideForType(
+ new TrackSelectionOverride(mVideoTrackGroup.getMediaTrackGroup(),
+ mCurrentTrackIndex))
+ .build();
+ mActivity.mPlayer.setTrackSelectionParameters(newParameters);
+ mResolutionChangeRequested = true;
+ }).setLooper(Looper.getMainLooper()).setPosition(sendMessagePosition)
+ .setDeleteAfterDelivery(true).send();
+ }
+
+ /**
+ * Fetch only video tracks group from the given clip
+ *
+ * @param currentTracks Current tracks in the clip
+ * @return Video tracks group
+ */
+ private Tracks.Group getVideoTrackGroup(Tracks currentTracks) {
+ Tracks.Group videoTrackGroup = null;
+ for (Tracks.Group currentTrackGroup : currentTracks.getGroups()) {
+ if (currentTrackGroup.getType() == C.TRACK_TYPE_VIDEO) {
+ videoTrackGroup = currentTrackGroup;
+ break;
+ }
+ }
+ return videoTrackGroup;
+ }
+
+ /**
+ * Get all available formats from videoTrackGroup.
+ */
+ private List<Format> getVideoFormatList() {
+ Tracks currentTracks = mActivity.mPlayer.getCurrentTracks();
+ mVideoTrackGroup = getVideoTrackGroup(currentTracks);
+ List<Format> videoFormatList = new ArrayList<>();
+ // Populate the videoFormatList with video tracks
+ for (int trackIndex = 0; trackIndex < mVideoTrackGroup.length; trackIndex++) {
+ Format trackFormat = mVideoTrackGroup.getTrackFormat(trackIndex);
+ videoFormatList.add(trackFormat);
+ }
+ assertEquals(mNumOfVideoTrack, videoFormatList.size());
+ return videoFormatList;
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/CallNotificationTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/CallNotificationTestPlayerListener.java
new file mode 100644
index 0000000..b631e76
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/CallNotificationTestPlayerListener.java
@@ -0,0 +1,125 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import static org.junit.Assert.assertEquals;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.os.Looper;
+import android.os.Process;
+import android.os.UserManager;
+import android.telecom.PhoneAccount;
+import android.telecom.PhoneAccountHandle;
+import android.telecom.TelecomManager;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.Player;
+import androidx.media3.common.Player.PlaybackSuppressionReason;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+public class CallNotificationTestPlayerListener extends PlayerListener {
+
+ private static final String COMMAND_ENABLE = "telecom set-phone-account-enabled";
+
+ private TelecomManager mTelecomManager;
+ private PhoneAccountHandle mPhoneAccountHandle;
+
+ public CallNotificationTestPlayerListener(long sendMessagePosition) {
+ super();
+ this.mSendMessagePosition = sendMessagePosition;
+ }
+
+ /**
+ * Create a phone account using a unique handle and return it.
+ */
+ private PhoneAccount getSamplePhoneAccount() {
+ mPhoneAccountHandle = new PhoneAccountHandle(
+ new ComponentName(mActivity, CallNotificationService.class), "SampleID");
+ return PhoneAccount.builder(mPhoneAccountHandle, "SamplePhoneAccount")
+ .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER)
+ .build();
+ }
+
+ /**
+ * Enable the registered phone account by running adb command.
+ */
+ private void enablePhoneAccount() {
+ final ComponentName component = mPhoneAccountHandle.getComponentName();
+ final UserManager userManager = mActivity.getSystemService(UserManager.class);
+ try {
+ String command =
+ COMMAND_ENABLE + " " + component.getPackageName() + "/" + component.getClassName() + " "
+ + mPhoneAccountHandle.getId() + " " + userManager.getSerialNumberForUser(
+ Process.myUserHandle());
+ InstrumentationRegistry.getInstrumentation().getUiAutomation().executeShellCommand(command);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.CALL_NOTIFICATION_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ mStartTime = System.currentTimeMillis();
+ // Add the duration of the incoming call
+ mExpectedTotalTime += CallNotificationService.DURATION_MS;
+ // Let the ExoPlayer handle audio focus internally
+ mActivity.mPlayer.setAudioAttributes(mActivity.mPlayer.getAudioAttributes(), true);
+ mTelecomManager = (TelecomManager) mActivity.getApplicationContext().getSystemService(
+ Context.TELECOM_SERVICE);
+ mTelecomManager.registerPhoneAccount(getSamplePhoneAccount());
+ enablePhoneAccount();
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ mActivity.mPlayer.createMessage((messageType, payload) -> {
+ // Place a sample incoming call
+ mTelecomManager.addNewIncomingCall(mPhoneAccountHandle, null);
+ }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition)
+ .setDeleteAfterDelivery(true)
+ .send();
+ }
+
+ /**
+ * Called when the value returned from getPlaybackSuppressionReason() changes. onEvents(Player,
+ * Player.Events) will also be called to report this event along with other events that happen in
+ * the same Looper message queue iteration.
+ *
+ * @param playbackSuppressionReason The current {@link PlaybackSuppressionReason}.
+ */
+ @Override
+ public void onPlaybackSuppressionReasonChanged(int playbackSuppressionReason) {
+ // Verify suppression reason change caused by call notification test
+ if (!mActivity.mPlayer.isPlaying()) {
+ assertEquals(Player.PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS,
+ playbackSuppressionReason);
+ } else {
+ assertEquals(Player.PLAYBACK_SUPPRESSION_REASON_NONE, playbackSuppressionReason);
+ }
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/CujTestBase.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/CujTestBase.java
index ea4dc27..28ab44b 100644
--- a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/CujTestBase.java
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/CujTestBase.java
@@ -19,8 +19,10 @@
import static org.junit.Assert.assertEquals;
import android.app.Activity;
+import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
+import android.telephony.TelephonyManager;
import androidx.test.core.app.ActivityScenario;
@@ -32,6 +34,8 @@
*/
public class CujTestBase {
+ static final String SHORTFORM_PLAYBAK_TEST_APP = "android.media.cujsmalltest.cts";
+
static final int[] ORIENTATIONS = {
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT,
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE,
@@ -73,6 +77,22 @@
}
/**
+ * Whether the device supports phone call feature.
+ */
+ public static boolean deviceSupportPhoneCall(final Activity activity) {
+ return (((TelephonyManager) activity.getApplicationContext()
+ .getSystemService(Context.TELEPHONY_SERVICE)).getPhoneType()
+ != TelephonyManager.PHONE_TYPE_NONE);
+ }
+
+ /**
+ * Whether the device is a watch.
+ */
+ public static boolean isWatchDevice(final Activity activity) {
+ return activity.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH);
+ }
+
+ /**
* Prepare the player, input list and add input list to player's playlist. After that, play for
* the provided playlist and validate playback time.
*
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/MainActivity.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/MainActivity.java
index 022042b..838c1aa 100644
--- a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/MainActivity.java
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/MainActivity.java
@@ -16,13 +16,18 @@
package android.media.cujcommon.cts;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
+import android.view.MotionEvent;
+import android.view.ScaleGestureDetector;
import android.view.WindowManager;
import androidx.appcompat.app.AppCompatActivity;
import androidx.media3.common.MediaItem;
-import androidx.media3.common.Player;
import androidx.media3.exoplayer.ExoPlayer;
import androidx.media3.ui.PlayerView;
@@ -35,7 +40,10 @@
protected PlayerView mExoplayerView;
protected ExoPlayer mPlayer;
protected static List<String> sVideoUrls = new ArrayList<>();
- protected Player.Listener mPlayerListener;
+ protected PlayerListener mPlayerListener;
+ protected ScaleGestureDetector mScaleGestureDetector = null;
+ protected boolean mConfiguredPipMode;
+ protected boolean mIsInPipMode;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -105,13 +113,52 @@
}
/**
+ * Called to process touch screen events. You can override this to intercept all touch screen
+ * events before they are dispatched to the window. Be sure to call this implementation for touch
+ * screen events that should be handled normally.
+ *
+ * @param event The touch screen event.
+ * @return Return true if this event was consumed.
+ */
+ @Override
+ public boolean dispatchTouchEvent(MotionEvent event) {
+ if (mScaleGestureDetector != null) {
+ mScaleGestureDetector.onTouchEvent(event);
+ }
+ return true;
+ }
+
+ /**
+ * Called by the system when the activity changes to and from picture-in-picture mode. This
+ * method provides the same configuration that will be sent in the following
+ * {@link #onConfigurationChanged(Configuration)} call after the activity enters this mode.
+ *
+ * @param isInPictureInPictureMode True if the activity is in picture-in-picture mode.
+ * @param newConfig The new configuration of the activity with the state
+ * {@code isInPictureInPictureMode}.
+ */
+ @Override
+ public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode,
+ Configuration newConfig) {
+ super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig);
+ if (mPlayerListener.isPipTest()) {
+ mIsInPipMode = isInPictureInPictureMode;
+ assertEquals(mConfiguredPipMode, isInPictureInPictureMode);
+ // Verify that the player is playing in PIP mode
+ if (isInPictureInPictureMode) {
+ assertTrue(mPlayer.isPlaying());
+ }
+ }
+ }
+
+ /**
* Register a listener to receive events from the player.
*
* <p>This method can be called from any thread.
*
* @param listener The listener to register.
*/
- public void addPlayerListener(Player.Listener listener) {
+ public void addPlayerListener(PlayerListener listener) {
mPlayer.addListener(listener);
this.mPlayerListener = listener;
}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/MessageNotificationTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/MessageNotificationTestPlayerListener.java
new file mode 100644
index 0000000..7aa5ab5
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/MessageNotificationTestPlayerListener.java
@@ -0,0 +1,65 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import android.os.Looper;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.Player;
+
+public class MessageNotificationTestPlayerListener extends PlayerListener {
+
+ private static final int NUM_OF_MESSAGE_NOTIFICATIONS = 2;
+
+ public MessageNotificationTestPlayerListener(long sendMessagePosition) {
+ super();
+ this.mSendMessagePosition = sendMessagePosition;
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.MESSAGE_NOTIFICATION_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ mStartTime = System.currentTimeMillis();
+ // Let the ExoPlayer handle audio focus internally
+ mActivity.mPlayer.setAudioAttributes(mActivity.mPlayer.getAudioAttributes(), true);
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ for (int i = 0; i < NUM_OF_MESSAGE_NOTIFICATIONS; i++) {
+ mActivity.mPlayer.createMessage((messageType, payload) -> {
+ // Place a sample message notification
+ try {
+ NotificationGenerator.createNotification(mActivity);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition * (i + 1))
+ .setDeleteAfterDelivery(true)
+ .send();
+ }
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/NotificationGenerator.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/NotificationGenerator.java
new file mode 100644
index 0000000..af1b6b6
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/NotificationGenerator.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2023 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.media.cujcommon.cts;
+
+import static android.media.cujcommon.cts.CujTestBase.SHORTFORM_PLAYBAK_TEST_APP;
+import static android.Manifest.permission.POST_NOTIFICATIONS;
+
+import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.content.Context;
+import android.media.AudioAttributes;
+import android.media.RingtoneManager;
+import android.permission.cts.PermissionUtils;
+
+public class NotificationGenerator {
+
+ private static final String CHANNEL_ID = "NotificationChannelID";
+ private static final int NOTIFICATION_ID = 1;
+
+ /**
+ * Create and send a sample notification
+ */
+ public static void createNotification(Context context) throws Exception {
+ PermissionUtils.grantPermission(SHORTFORM_PLAYBAK_TEST_APP, POST_NOTIFICATIONS);
+ NotificationChannel notificationChannel = new NotificationChannel(
+ CHANNEL_ID,
+ "Channel 1",
+ NotificationManager.IMPORTANCE_HIGH
+ );
+ AudioAttributes audioAttributes = new AudioAttributes.Builder()
+ .setUsage(AudioAttributes.USAGE_NOTIFICATION)
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
+ .build();
+ notificationChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION),
+ audioAttributes);
+ NotificationManager notificationManager = context.getSystemService(NotificationManager.class);
+ notificationManager.createNotificationChannel(notificationChannel);
+ Notification.Builder builder = new Notification.Builder(context, CHANNEL_ID)
+ .setSmallIcon(android.R.drawable.ic_notification_overlay)
+ .setContentTitle("Sample Message Notification")
+ .setContentText("This is a sample notification for E2E CUJ")
+ .setCategory(Notification.CATEGORY_MESSAGE)
+ .setTimeoutAfter(3000)
+ .setAutoCancel(true);
+ notificationManager.notify(NOTIFICATION_ID, builder.build());
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/OrientationTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/OrientationTestPlayerListener.java
new file mode 100644
index 0000000..22ccd28
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/OrientationTestPlayerListener.java
@@ -0,0 +1,87 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import static android.media.cujcommon.cts.CujTestBase.ORIENTATIONS;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+
+import android.os.Looper;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.Player;
+
+public class OrientationTestPlayerListener extends PlayerListener {
+
+ private boolean mOrientationChangeRequested;
+
+ public OrientationTestPlayerListener(long sendMessagePosition) {
+ super();
+ this.mSendMessagePosition = sendMessagePosition;
+ }
+
+ /**
+ * Change the Orientation of the device.
+ */
+ private void changeOrientation() {
+ mPreviousOrientation = ORIENTATIONS[mOrientationIndex];
+ mOrientationIndex = (mOrientationIndex + 1) % ORIENTATIONS.length;
+ mActivity.setRequestedOrientation(ORIENTATIONS[mOrientationIndex]);
+ mOrientationChangeRequested = true;
+ }
+
+ /**
+ * Verify Orientation change.
+ */
+ private void verifyOrientationChange() {
+ int configuredOrientation = ORIENTATIONS[mOrientationIndex];
+ int currentDeviceOrientation = getDeviceOrientation(mActivity);
+ assertEquals(configuredOrientation, currentDeviceOrientation);
+ assertNotEquals(mPreviousOrientation, currentDeviceOrientation);
+ mOrientationChangeRequested = false;
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.ORIENTATION_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ // update to latest cl which fixes orientation bug
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ } else if (mOrientationChangeRequested && player.getPlaybackState() == Player.STATE_ENDED) {
+ verifyOrientationChange();
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ if (mOrientationChangeRequested) {
+ verifyOrientationChange();
+ }
+ mActivity.mPlayer.createMessage((messageType, payload) -> {
+ changeOrientation();
+ }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition)
+ .setDeleteAfterDelivery(true)
+ .send();
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PinchToZoomTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PinchToZoomTestPlayerListener.java
new file mode 100644
index 0000000..df39e93
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PinchToZoomTestPlayerListener.java
@@ -0,0 +1,199 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import android.app.Instrumentation;
+import android.content.res.Resources;
+import android.os.Looper;
+import android.os.SystemClock;
+import android.view.MotionEvent;
+import android.view.MotionEvent.PointerCoords;
+import android.view.MotionEvent.PointerProperties;
+import android.view.ScaleGestureDetector;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.Player;
+
+public class PinchToZoomTestPlayerListener extends PlayerListener {
+
+ private static final int ZOOM_IN_DURATION_MS = 4000;
+ private static final int PINCH_STEP_COUNT = 10;
+ private static final float SPAN_GAP = 50.0f;
+ private static final int SCREEN_WIDTH = Resources.getSystem().getDisplayMetrics().widthPixels;
+ private static final int SCREEN_HEIGHT = Resources.getSystem().getDisplayMetrics().heightPixels;
+ private static final float LEFT_MARGIN_WIDTH_FACTOR = 0.1f;
+ private static final float RIGHT_MARGIN_WIDTH_FACTOR = 0.9f;
+ private static final float STEP_SIZE =
+ (RIGHT_MARGIN_WIDTH_FACTOR * SCREEN_WIDTH - LEFT_MARGIN_WIDTH_FACTOR * SCREEN_WIDTH
+ - 2 * SPAN_GAP) / (2 * PINCH_STEP_COUNT);
+
+ public PinchToZoomTestPlayerListener(long sendMessagePosition) {
+ super();
+ this.mSendMessagePosition = sendMessagePosition;
+ }
+
+ /**
+ * Return a new pointer of the display.
+ *
+ * @param x x coordinate of the pointer
+ * @param y y coordinate of the pointer
+ */
+ PointerCoords getDisplayPointer(float x, float y) {
+ PointerCoords pointerCoords = new PointerCoords();
+ pointerCoords.x = x;
+ pointerCoords.y = y;
+ pointerCoords.pressure = 1;
+ pointerCoords.size = 1;
+ return pointerCoords;
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.PINCH_TO_ZOOM_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ // Register scale gesture detector
+ mActivity.mScaleGestureDetector = new ScaleGestureDetector(mActivity,
+ new ScaleGestureListener(mActivity.mExoplayerView));
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ mActivity.mPlayer.createMessage((messageType, payload) -> {
+ // Programmatically pinch and zoom in
+ pinchAndZoom(true /* zoomIn */);
+ }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition)
+ .setDeleteAfterDelivery(true)
+ .send();
+ mActivity.mPlayer.createMessage((messageType, payload) -> {
+ // Programmatically pinch and zoom out
+ pinchAndZoom(false /* zoomOut */);
+ }).setLooper(Looper.getMainLooper())
+ .setPosition(mSendMessagePosition + ZOOM_IN_DURATION_MS)
+ .setDeleteAfterDelivery(true)
+ .send();
+ }
+
+ /**
+ * Create a new MotionEvent, filling in all of the basic values that define the motion. Then,
+ * dispatch a pointer event into a window owned by the instrumented application.
+ *
+ * @param inst An instance of {@link Instrumentation} for sending pointer event.
+ * @param action The kind of action being performed.
+ * @param pointerCount The number of pointers that will be in this event.
+ * @param pointerProperties An array of <em>pointerCount</em> values providing a
+ * {@link PointerProperties} property object for each pointer, which must
+ * include the pointer identifier.
+ * @param pointerCoords An array of <em>pointerCount</em> values providing a
+ * {@link PointerCoords} coordinate object for each pointer.
+ */
+ void obtainAndSendPointerEvent(Instrumentation inst, int action, int pointerCount,
+ PointerProperties[] pointerProperties, PointerCoords[] pointerCoords) {
+ MotionEvent pointerMotionEvent = MotionEvent.obtain(SystemClock.uptimeMillis() /* downTime */,
+ SystemClock.uptimeMillis() /* eventTime */, action, pointerCount, pointerProperties,
+ pointerCoords, 0 /* metaState */, 0 /* buttonState */, 1 /* xPrecision */,
+ 1 /* yPrecision */, 0 /* deviceId */, 0 /* edgeFlags */, 0 /* source */, 0 /* flags */);
+ inst.sendPointerSync(pointerMotionEvent);
+ }
+
+ /**
+ * Return array of two PointerCoords.
+ *
+ * @param isZoomIn True for zoom in.
+ */
+ PointerCoords[] getPointerCoords(boolean isZoomIn) {
+ PointerCoords leftPointerStartCoords;
+ PointerCoords rightPointerStartCoords;
+ float midDisplayHeight = SCREEN_HEIGHT / 2.0f;
+ if (isZoomIn) {
+ float midDisplayWidth = SCREEN_WIDTH / 2.0f;
+ // During zoom in, start pinching from middle of the display towards the end.
+ leftPointerStartCoords = getDisplayPointer(midDisplayWidth - SPAN_GAP, midDisplayHeight);
+ rightPointerStartCoords = getDisplayPointer(midDisplayWidth + SPAN_GAP, midDisplayHeight);
+ } else {
+ // During zoom out, start pinching from end of the display towards the middle.
+ leftPointerStartCoords = getDisplayPointer(LEFT_MARGIN_WIDTH_FACTOR * SCREEN_WIDTH,
+ midDisplayHeight);
+ rightPointerStartCoords = getDisplayPointer(RIGHT_MARGIN_WIDTH_FACTOR * SCREEN_WIDTH,
+ midDisplayHeight);
+ }
+ return new PointerCoords[]{leftPointerStartCoords, rightPointerStartCoords};
+ }
+
+ /**
+ * Return array of two PointerProperties.
+ */
+ PointerProperties[] getPointerProperties() {
+ PointerProperties defaultPointerProperties = new PointerProperties();
+ defaultPointerProperties.toolType = MotionEvent.TOOL_TYPE_FINGER;
+ PointerProperties leftPointerProperties = new PointerProperties(defaultPointerProperties);
+ leftPointerProperties.id = 0;
+ PointerProperties rightPointerProperties = new PointerProperties(defaultPointerProperties);
+ rightPointerProperties.id = 1;
+ return new PointerProperties[]{leftPointerProperties, rightPointerProperties};
+ }
+
+ /**
+ * Simulate pinch gesture to zoom in and zoom out.
+ *
+ * @param isZoomIn True for zoom in.
+ */
+ private void pinchAndZoom(boolean isZoomIn) {
+ new Thread(() -> {
+ try {
+ PointerCoords[] pointerCoords = getPointerCoords(isZoomIn);
+ PointerProperties[] pointerProperties = getPointerProperties();
+
+ Instrumentation inst = new Instrumentation();
+ // Pinch In
+ obtainAndSendPointerEvent(inst, MotionEvent.ACTION_DOWN, 1 /* pointerCount*/,
+ pointerProperties, pointerCoords);
+ obtainAndSendPointerEvent(inst, MotionEvent.ACTION_POINTER_DOWN + (pointerProperties[1].id
+ << MotionEvent.ACTION_POINTER_INDEX_SHIFT), 2 /* pointerCount */, pointerProperties,
+ pointerCoords);
+
+ for (int i = 0; i < PINCH_STEP_COUNT; i++) {
+ if (isZoomIn) {
+ pointerCoords[0].x -= STEP_SIZE;
+ pointerCoords[1].x += STEP_SIZE;
+ } else {
+ pointerCoords[0].x += STEP_SIZE;
+ pointerCoords[1].x -= STEP_SIZE;
+ }
+ obtainAndSendPointerEvent(inst, MotionEvent.ACTION_MOVE, 2 /* pointerCount */,
+ pointerProperties, pointerCoords);
+ }
+
+ // Pinch Out
+ obtainAndSendPointerEvent(inst, MotionEvent.ACTION_POINTER_UP + (pointerProperties[1].id
+ << MotionEvent.ACTION_POINTER_INDEX_SHIFT), 2 /* pointerCount */, pointerProperties,
+ pointerCoords);
+ obtainAndSendPointerEvent(inst, MotionEvent.ACTION_UP, 1 /* pointerCount */,
+ pointerProperties, pointerCoords);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }).start();
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PipModeTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PipModeTestPlayerListener.java
new file mode 100644
index 0000000..3d1fb96
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PipModeTestPlayerListener.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import static org.junit.Assert.assertTrue;
+
+import android.app.PictureInPictureParams;
+import android.content.Intent;
+import android.os.Looper;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.Player;
+
+public class PipModeTestPlayerListener extends PlayerListener {
+
+ private static final int PIP_DURATION_MS = 5000;
+
+ public PipModeTestPlayerListener(long sendMessagePosition) {
+ super();
+ this.mSendMessagePosition = sendMessagePosition;
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.PIP_MODE_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ mActivity.mPlayer.createMessage((messageType, payload) -> {
+ // Switch to picture in picture minimized playback mode
+ mActivity.enterPictureInPictureMode(new PictureInPictureParams.Builder().build());
+ mActivity.mConfiguredPipMode = true;
+ }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition)
+ .setDeleteAfterDelivery(true)
+ .send();
+ mActivity.mPlayer.createMessage((messageType, payload) -> {
+ // Verify that the activity is in PIP mode before switching back to normal mode
+ assertTrue(mActivity.mIsInPipMode);
+ // Switch to normal playback mode
+ mActivity.moveTaskToBack(false);
+ Intent startIntent = new Intent(mActivity, MainActivity.class);
+ startIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+ mActivity.startActivity(startIntent);
+ mActivity.mConfiguredPipMode = false;
+ }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition + PIP_DURATION_MS)
+ .setDeleteAfterDelivery(true)
+ .send();
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PlaybackTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PlaybackTestPlayerListener.java
new file mode 100644
index 0000000..56cd080
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PlaybackTestPlayerListener.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.Player;
+
+public class PlaybackTestPlayerListener extends PlayerListener {
+
+ public PlaybackTestPlayerListener() {
+ super();
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.PLAYBACK_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PlayerListener.java
index 62b2ab1..29f575a 100644
--- a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PlayerListener.java
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/PlayerListener.java
@@ -19,51 +19,32 @@
import static android.media.cujcommon.cts.CujTestBase.ORIENTATIONS;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import android.app.Activity;
-import android.content.ComponentName;
-import android.content.Context;
import android.content.pm.ActivityInfo;
import android.os.Looper;
-import android.os.Process;
-import android.os.UserManager;
-import android.telecom.PhoneAccount;
-import android.telecom.PhoneAccountHandle;
-import android.telecom.TelecomManager;
import android.util.DisplayMetrics;
-import android.util.Log;
import androidx.annotation.NonNull;
import androidx.media3.common.C;
import androidx.media3.common.Format;
import androidx.media3.common.Player;
import androidx.media3.common.Player.Events;
-import androidx.media3.common.Player.PlaybackSuppressionReason;
import androidx.media3.common.TrackSelectionOverride;
import androidx.media3.common.TrackSelectionParameters;
import androidx.media3.common.Tracks;
-import androidx.media3.common.VideoSize;
-import androidx.media3.exoplayer.ExoPlayer;
-import androidx.test.platform.app.InstrumentationRegistry;
-import java.time.Clock;
-import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
-import java.util.Random;
-public class PlayerListener implements Player.Listener {
+public abstract class PlayerListener implements Player.Listener {
- private static final String LOG_TAG = PlayerListener.class.getSimpleName();
public static final Object LISTENER_LOCK = new Object();
- private static final String COMMAND_ENABLE = "telecom set-phone-account-enabled";
public static int CURRENT_MEDIA_INDEX = 0;
// Enum Declared for Test Type
- private enum TestType {
+ protected enum TestType {
PLAYBACK_TEST,
SEEK_TEST,
ORIENTATION_TEST,
@@ -71,256 +52,95 @@
SCROLL_TEST,
SWITCH_AUDIO_TRACK_TEST,
SWITCH_SUBTITLE_TRACK_TEST,
- NOTIFICATION_TEST;
+ CALL_NOTIFICATION_TEST,
+ MESSAGE_NOTIFICATION_TEST,
+ PINCH_TO_ZOOM_TEST,
+ SPEED_CHANGE_TEST,
+ PIP_MODE_TEST
}
public static boolean mPlaybackEnded;
- private long mExpectedTotalTime;
- private MainActivity mActivity;
- private ScrollTestActivity mScrollActivity;
- private final TestType mTestType;
- private int mNumOfSeekIteration;
- private long mSeekTimeUs;
- private long mSeed;
- private boolean mSeekDone;
- private long mSendMessagePosition;
- private boolean mOrientationChangeRequested;
- private int mStartOrientation;
- private int mCurrentOrientation;
- private boolean mResolutionChangeRequested;
- private int mCurrentResolutionWidth;
- private int mCurrentResolutionHeight;
- private int mNumOfVideoTrack;
- private int mIndexIncrement = C.INDEX_UNSET;
- private int mCurrentTrackIndex = C.INDEX_UNSET;
- private Tracks.Group mVideoTrackGroup;
- private List<Format> mVideoFormatList;
- private int mNumOfScrollIteration;
- private boolean mScrollRequested;
- private boolean mTrackChangeRequested;
- private List<Tracks.Group> mTrackGroups;
- private Format mStartTrackFormat;
- private Format mCurrentTrackFormat;
- private Format mConfiguredTrackFormat;
- private int mNumOfAudioTrack;
- private int mNumOfSubtitleTrack;
- private boolean mIsCallNotification;
- private TelecomManager mTelecomManager;
- private PhoneAccountHandle mPhoneAccountHandle;
- private long mStartTime;
+ protected long mExpectedTotalTime;
+ protected MainActivity mActivity;
+ protected ScrollTestActivity mScrollActivity;
+ protected long mSendMessagePosition;
+ protected int mPreviousOrientation;
+ protected int mOrientationIndex;
+ protected boolean mScrollRequested;
+ protected boolean mTrackChangeRequested;
+ protected List<Tracks.Group> mTrackGroups;
+ protected Format mStartTrackFormat;
+ protected Format mCurrentTrackFormat;
+ protected Format mConfiguredTrackFormat;
+ protected long mStartTime;
- public PlayerListener(TestType testType) {
- mTestType = testType;
+ public PlayerListener() {
+ this.mSendMessagePosition = 0;
}
/**
- * Create default player listener.
+ * Returns the type of test.
*/
- public static PlayerListener createDefaultListener(TestType testType) {
- PlayerListener playerListener = new PlayerListener(testType);
- playerListener.mNumOfSeekIteration = 0;
- playerListener.mSeekTimeUs = 0;
- playerListener.mSeed = 0;
- playerListener.mSendMessagePosition = 0;
- playerListener.mNumOfScrollIteration = 0;
- playerListener.mNumOfAudioTrack = 0;
- playerListener.mNumOfSubtitleTrack = 0;
- return playerListener;
- }
-
- /**
- * Create player listener for playback test.
- */
- public static PlayerListener createListenerForPlaybackTest() {
- PlayerListener playerListener = createDefaultListener(TestType.PLAYBACK_TEST);
- return playerListener;
- }
-
- /**
- * Create player listener for seek test.
- *
- * @param numOfSeekIteration Number of seek operations to be performed in seek test
- * @param seekTimeUs Number of milliseconds to seek
- * @param sendMessagePosition The position at which message will be sent
- */
- public static PlayerListener createListenerForSeekTest(int numOfSeekIteration, long seekTimeUs,
- long sendMessagePosition) {
- PlayerListener playerListener = createDefaultListener(TestType.SEEK_TEST);
- playerListener.mNumOfSeekIteration = numOfSeekIteration;
- playerListener.mSeekTimeUs = seekTimeUs;
- playerListener.mSeed = playerListener.getSeed();
- playerListener.mSendMessagePosition = sendMessagePosition;
- return playerListener;
- }
-
- /**
- * Create player listener for orientation test.
- *
- * @param sendMessagePosition The position at which message will be send
- */
- public static PlayerListener createListenerForOrientationTest(long sendMessagePosition) {
- PlayerListener playerListener = createDefaultListener(TestType.ORIENTATION_TEST);
- playerListener.mSendMessagePosition = sendMessagePosition;
- return playerListener;
- }
-
- /**
- * Create player listener for adaptive playback test.
- *
- * @param numOfVideoTrack Number of video tracks in the input clip
- * @param sendMessagePosition The position at which message will be send
- */
- public static PlayerListener createListenerForAdaptivePlaybackTest(int numOfVideoTrack,
- long sendMessagePosition) {
- PlayerListener playerListener = createDefaultListener(TestType.ADAPTIVE_PLAYBACK_TEST);
- playerListener.mSendMessagePosition = sendMessagePosition;
- playerListener.mNumOfVideoTrack = numOfVideoTrack;
- playerListener.mIndexIncrement = 1;
- return playerListener;
- }
-
- /**
- * Create player listener for scroll test.
- *
- * @param sendMessagePosition The position at which message will be send
- */
- public static PlayerListener createListenerForScrollTest(int numOfScrollIteration,
- long sendMessagePosition) {
- PlayerListener playerListener = createDefaultListener(TestType.SCROLL_TEST);
- playerListener.mNumOfScrollIteration = numOfScrollIteration;
- playerListener.mSendMessagePosition = sendMessagePosition;
- return playerListener;
- }
-
- /**
- * Create player listener for Switching Audio Tracks test.
- *
- * @param numOfAudioTrack Number of audio track in input clip
- * @param sendMessagePosition The position at which message will be send
- */
- public static PlayerListener createListenerForSwitchAudioTracksTest(int numOfAudioTrack,
- long sendMessagePosition) {
- PlayerListener playerListener = createDefaultListener(TestType.SWITCH_AUDIO_TRACK_TEST);
- playerListener.mNumOfAudioTrack = numOfAudioTrack;
- playerListener.mSendMessagePosition = sendMessagePosition;
- return playerListener;
- }
-
- /**
- * Create player listener for Switching Subtitle Tracks test.
- *
- * @param numOfSubtitleTrack Number of subtitle tracks in input clip
- * @param sendMessagePosition The position at which message will be send
- */
- public static PlayerListener createListenerForSwitchSubtitleTracksTest(int numOfSubtitleTrack,
- long sendMessagePosition) {
- PlayerListener playerListener = createDefaultListener(TestType.SWITCH_SUBTITLE_TRACK_TEST);
- playerListener.mNumOfSubtitleTrack = numOfSubtitleTrack;
- playerListener.mSendMessagePosition = sendMessagePosition;
- return playerListener;
- }
-
- /**
- * Create player listener for Notification test.
- *
- * @param sendMessagePosition The position at which message will be sent
- */
- public static PlayerListener createListenerForNotificationTest(boolean isCallNotification,
- long sendMessagePosition) {
- PlayerListener playerListener = createDefaultListener(TestType.NOTIFICATION_TEST);
- playerListener.mIsCallNotification = isCallNotification;
- playerListener.mSendMessagePosition = sendMessagePosition;
- return playerListener;
- }
-
- /**
- * Returns seed for Seek test.
- */
- private long getSeed() {
- // Truncate time to the nearest day.
- long seed = Clock.tick(Clock.systemUTC(), Duration.ofDays(1)).instant().toEpochMilli();
- Log.d(LOG_TAG, "Random seed = " + seed);
- return seed;
- }
-
- /**
- * Returns True for Seek test.
- */
- public boolean isSeekTest() {
- return mTestType.equals(TestType.SEEK_TEST);
- }
+ public abstract TestType getTestType();
/**
* Returns True for Orientation test.
*/
- public boolean isOrientationTest() {
- return mTestType.equals(TestType.ORIENTATION_TEST);
- }
-
- /**
- * Returns True for Adaptive playback test.
- */
- public boolean isAdaptivePlaybackTest() {
- return mTestType.equals(TestType.ADAPTIVE_PLAYBACK_TEST);
+ public final boolean isOrientationTest() {
+ return getTestType().equals(TestType.ORIENTATION_TEST);
}
/**
* Returns True for Scroll test.
*/
- public boolean isScrollTest() {
- return mTestType.equals(TestType.SCROLL_TEST);
+ public final boolean isScrollTest() {
+ return getTestType().equals(TestType.SCROLL_TEST);
}
/**
- * Returns True for Switch audio track test.
+ * Returns True for Call Notification test.
*/
- public boolean isSwitchAudioTrackTest() {
- return mTestType.equals(TestType.SWITCH_AUDIO_TRACK_TEST);
+ public final boolean isCallNotificationTest() {
+ return getTestType().equals(TestType.CALL_NOTIFICATION_TEST);
}
/**
- * Returns True for Switch subtitle track test.
+ * Returns True for PinchToZoom test.
*/
- public boolean isSwitchSubtitleTrackTest() {
- return mTestType.equals(TestType.SWITCH_SUBTITLE_TRACK_TEST);
+ public final boolean isPinchToZoomTest() {
+ return getTestType().equals(TestType.PINCH_TO_ZOOM_TEST);
}
/**
- * Returns True for Notification test.
+ * Returns True for PIP Minimized Playback Mode test.
*/
- public boolean isNotificationTest() {
- return mTestType.equals(TestType.NOTIFICATION_TEST);
- }
-
- /**
- * Sets activity for test.
- */
- public void setActivity(MainActivity activity) {
- this.mActivity = activity;
- if (isOrientationTest()) {
- mActivity.setRequestedOrientation(ORIENTATIONS[0] /* SCREEN_ORIENTATION_PORTRAIT */);
- mStartOrientation = getDeviceOrientation(mActivity);
- }
- }
-
- /**
- * Sets activity for scroll test.
- */
- public void setScrollActivity(ScrollTestActivity activity) {
- this.mScrollActivity = activity;
+ public final boolean isPipTest() {
+ return getTestType().equals(TestType.PIP_MODE_TEST);
}
/**
* Returns expected playback time for the playlist.
*/
- public long getExpectedTotalTime() {
+ public final long getExpectedTotalTime() {
return mExpectedTotalTime;
}
/**
+ * Sets activity for test.
+ */
+ public final void setActivity(MainActivity activity) {
+ this.mActivity = activity;
+ if (isOrientationTest()) {
+ mOrientationIndex = 0;
+ mActivity.setRequestedOrientation(
+ ORIENTATIONS[mOrientationIndex] /* SCREEN_ORIENTATION_PORTRAIT */);
+ }
+ }
+
+ /**
* Get Orientation of the device.
*/
- private static int getDeviceOrientation(final Activity activity) {
+ protected static int getDeviceOrientation(final Activity activity) {
final DisplayMetrics displayMetrics = new DisplayMetrics();
activity.getDisplay().getRealMetrics(displayMetrics);
if (displayMetrics.widthPixels < displayMetrics.heightPixels) {
@@ -331,45 +151,10 @@
}
/**
- * Seek the player.
+ * Sets activity for scroll test.
*/
- private void seek() {
- Random random = new Random(mSeed);
- // If number of seek requested is one then seek forward or backward alternatively for
- // mSeekTimeUs on given media list.
- // If number of seek requested is 30 then seek for mSeekTimeUs- forward 10 times,
- // backward 10 times and then randomly backwards or forwards 10 times on each
- // media item.
- for (int i = 0; i < mNumOfSeekIteration; i++) {
- mActivity.mPlayer.seekTo(mActivity.mPlayer.getCurrentPosition() + mSeekTimeUs);
- if (mNumOfSeekIteration == 1 || i == 10) {
- mSeekTimeUs *= -1;
- } else if (i >= 20) {
- mSeekTimeUs *= random.nextBoolean() ? -1 : 1;
- }
- }
- mSeekDone = true;
- }
-
- /**
- * Change the Orientation of the device.
- */
- private void changeOrientation() {
- mCurrentOrientation = (mCurrentOrientation + 1) % ORIENTATIONS.length;
- mActivity.setRequestedOrientation(ORIENTATIONS[mCurrentOrientation]);
- mOrientationChangeRequested = true;
- }
-
- /**
- * Scroll the View vertically.
- *
- * @param yIndex The yIndex to scroll the view vertically.
- */
- private void scrollView(int yIndex) {
- mScrollActivity.mScrollView.scrollTo(0, yIndex);
- if (CURRENT_MEDIA_INDEX == mNumOfScrollIteration) {
- mScrollRequested = true;
- }
+ public final void setScrollActivity(ScrollTestActivity activity) {
+ this.mScrollActivity = activity;
}
/**
@@ -379,16 +164,16 @@
* @param testFormat Test format
* @return True, if two formats are similar, false otherwise
*/
- private boolean isFormatSimilar(Format refFormat, Format testFormat) {
+ protected final boolean isFormatSimilar(Format refFormat, Format testFormat) {
String refMediaType = refFormat.sampleMimeType;
String testMediaType = testFormat.sampleMimeType;
- if (isSwitchAudioTrackTest()) {
+ if (getTestType().equals(TestType.SWITCH_AUDIO_TRACK_TEST)) {
assertTrue(refMediaType.startsWith("audio/") && testMediaType.startsWith("audio/"));
if ((refFormat.channelCount != testFormat.channelCount) || (refFormat.sampleRate
!= testFormat.sampleRate)) {
return false;
}
- } else if (isSwitchSubtitleTrackTest()) {
+ } else if (getTestType().equals(TestType.SWITCH_SUBTITLE_TRACK_TEST)) {
assertTrue((refMediaType.startsWith("text/") && testMediaType.startsWith("text/")) || (
refMediaType.startsWith("application/") && testMediaType.startsWith("application/")));
}
@@ -402,48 +187,6 @@
}
/**
- * Select the first subtitle track explicitly.
- */
- private void selectFirstSubtitleTrack() {
- TrackSelectionParameters currentParameters =
- mActivity.mPlayer.getTrackSelectionParameters();
- TrackSelectionParameters newParameters = currentParameters
- .buildUpon()
- .setOverrideForType(
- new TrackSelectionOverride(mTrackGroups.get(0).getMediaTrackGroup(), 0))
- .build();
- mActivity.mPlayer.setTrackSelectionParameters(newParameters);
- }
-
- /**
- * Create a phone account using a unique handle and return it.
- */
- private PhoneAccount getSamplePhoneAccount() {
- mPhoneAccountHandle = new PhoneAccountHandle(
- new ComponentName(mActivity, CallNotificationService.class), "SampleID");
- return PhoneAccount.builder(mPhoneAccountHandle, "SamplePhoneAccount")
- .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER)
- .build();
- }
-
- /**
- * Enable the registered phone account by running adb command.
- */
- private void enablePhoneAccount() {
- final ComponentName component = mPhoneAccountHandle.getComponentName();
- final UserManager userManager = mActivity.getSystemService(UserManager.class);
- try {
- String command =
- COMMAND_ENABLE + " " + component.getPackageName() + "/" + component.getClassName() + " "
- + mPhoneAccountHandle.getId() + " " + userManager.getSerialNumberForUser(
- Process.myUserHandle());
- InstrumentationRegistry.getInstrumentation().getUiAutomation().executeShellCommand(command);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
* Called when player states changed.
*
* @param player The {@link Player} whose state changed. Use the getters to obtain the latest
@@ -451,69 +194,9 @@
* @param events The {@link Events} that happened in this iteration, indicating which player
* states changed.
*/
- public void onEvents(@NonNull Player player, Events events) {
+ public final void onEvents(@NonNull Player player, Events events) {
if (events.contains(Player.EVENT_PLAYBACK_STATE_CHANGED)) {
- if (player.getPlaybackState() == Player.STATE_READY) {
- // Add change in duration due to seek
- if (mSeekDone) {
- mExpectedTotalTime += (mSendMessagePosition - player.getCurrentPosition());
- mSeekDone = false;
- } else if (mOrientationChangeRequested) {
- int configuredOrientation = ORIENTATIONS[mCurrentOrientation];
- int currentDeviceOrientation = getDeviceOrientation(mActivity);
- assertEquals(configuredOrientation, currentDeviceOrientation);
- assertNotEquals(mStartOrientation, currentDeviceOrientation);
- mOrientationChangeRequested = false;
- mStartOrientation = currentDeviceOrientation;
- } else if (mResolutionChangeRequested) {
- int configuredResolutionWidth = mVideoFormatList.get(mCurrentTrackIndex).width;
- int configuredResolutionHeight = mVideoFormatList.get(mCurrentTrackIndex).height;
- assertEquals(configuredResolutionWidth, mCurrentResolutionWidth);
- assertEquals(configuredResolutionHeight, mCurrentResolutionHeight);
- // Reversing the track iteration order
- if (mCurrentTrackIndex == mVideoFormatList.size() - 1) {
- mIndexIncrement *= -1;
- }
- mCurrentTrackIndex += mIndexIncrement;
- mResolutionChangeRequested = false;
- } else {
- // At the first media transition player is not ready. So, add duration of
- // first clip when player is ready
- mExpectedTotalTime += player.getDuration();
- // When player is ready, get the list of supported video Format(s) in the DASH mediaItem
- if (isAdaptivePlaybackTest()) {
- mVideoFormatList = getVideoFormatList();
- mCurrentTrackIndex = 0;
- }
- if (isSwitchAudioTrackTest() || isSwitchSubtitleTrackTest()) {
- // When player is ready, get the list of audio/subtitle track groups in the mediaItem
- mTrackGroups = getTrackGroups();
- // For a subtitle track switching test, we need to explicitly select the first
- // subtitle track
- if (isSwitchSubtitleTrackTest()) {
- selectFirstSubtitleTrack();
- }
- }
- if (isNotificationTest()) {
- mStartTime = System.currentTimeMillis();
- // Add the duration of the incoming call
- if (mIsCallNotification) {
- mExpectedTotalTime += CallNotificationService.DURATION_MS;
- }
- // Let the ExoPlayer handle audio focus internally
- mActivity.mPlayer.setAudioAttributes(mActivity.mPlayer.getAudioAttributes(), true);
- mTelecomManager = (TelecomManager) mActivity.getApplicationContext().getSystemService(
- Context.TELECOM_SERVICE);
- mTelecomManager.registerPhoneAccount(getSamplePhoneAccount());
- enablePhoneAccount();
- }
- }
- } else if (mTrackChangeRequested && player.getPlaybackState() == Player.STATE_ENDED) {
- assertEquals(mConfiguredTrackFormat, mCurrentTrackFormat);
- assertFalse(isFormatSimilar(mStartTrackFormat, mCurrentTrackFormat));
- mTrackChangeRequested = false;
- mStartTrackFormat = mCurrentTrackFormat;
- }
+ onEventsPlaybackStateChanged(player);
synchronized (LISTENER_LOCK) {
if (player.getPlaybackState() == Player.STATE_ENDED) {
if (mPlaybackEnded) {
@@ -526,7 +209,8 @@
mScrollActivity.removePlayerListener();
}
// Verify the total time taken by the notification test
- if (isNotificationTest()) {
+ if (getTestType().equals(TestType.CALL_NOTIFICATION_TEST) || getTestType().equals(
+ TestType.MESSAGE_NOTIFICATION_TEST)) {
long actualTime = System.currentTimeMillis() - mStartTime;
assertEquals((float) mExpectedTotalTime, (float) actualTime, 3000);
}
@@ -536,63 +220,7 @@
}
}
if (events.contains(Player.EVENT_MEDIA_ITEM_TRANSITION)) {
- if (isSeekTest() || isOrientationTest()) {
- mActivity.mPlayer.createMessage((messageType, payload) -> {
- if (isSeekTest()) {
- seek();
- } else {
- changeOrientation();
- }
- }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition)
- .setDeleteAfterDelivery(true)
- .send();
- } else if (isAdaptivePlaybackTest()) {
- // Iterating forwards and then backwards for all the available video tracks
- final int totalNumOfVideoTrackChange = mNumOfVideoTrack * 2;
- // Create messages to be executed at different positions
- for (int count = 1; count < totalNumOfVideoTrackChange; count++) {
- createAdaptivePlaybackMessage(mSendMessagePosition * (count));
- }
- } else if (isSwitchAudioTrackTest() || isSwitchSubtitleTrackTest()) {
- // Create messages to be executed at different positions
- final int numOfTrackGroup =
- isSwitchAudioTrackTest() ? mNumOfAudioTrack : mNumOfSubtitleTrack;
- // First trackGroupIndex is selected at the time of playback start, so changing
- // track from second track group Index onwards.
- for (int trackGroupIndex = 1; trackGroupIndex < numOfTrackGroup; trackGroupIndex++) {
- createSwitchTrackMessage(mSendMessagePosition * trackGroupIndex, trackGroupIndex,
- 0 /* TrackIndex */);
- }
- }
- // In case of scroll test, send the message to scroll the view to change the surface
- // positions. Scroll has two surfaceView (top and bottom), playback start on top view and
- // after each mSendMessagePosition sec playback is switched to other view alternatively.
- if (isScrollTest()) {
- int yIndex;
- ExoPlayer currentPlayer;
- if ((CURRENT_MEDIA_INDEX % 2) == 0) {
- currentPlayer = mScrollActivity.mFirstPlayer;
- yIndex = mScrollActivity.SURFACE_HEIGHT * 2;
- } else {
- currentPlayer = mScrollActivity.mSecondPlayer;
- yIndex = 0;
- }
- CURRENT_MEDIA_INDEX++;
- for (int i = 0; i < mNumOfScrollIteration; i++) {
- currentPlayer.createMessage((messageType, payload) -> {
- scrollView(yIndex);
- }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition * (i + 1))
- .setDeleteAfterDelivery(true)
- .send();
- }
- } else if (isNotificationTest()) {
- mActivity.mPlayer.createMessage((messageType, payload) -> {
- // Place a sample incoming call
- mTelecomManager.addNewIncomingCall(mPhoneAccountHandle, null);
- }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition)
- .setDeleteAfterDelivery(true)
- .send();
- }
+ onEventsMediaItemTransition(player);
// Add duration on media transition.
long duration = player.getDuration();
if (duration != C.TIME_UNSET) {
@@ -602,70 +230,21 @@
}
/**
- * Called each time when getVideoSize() changes. onEvents(Player, Player.Events) will also be
- * called to report this event along with other events that happen in the same Looper message
- * queue iteration.
+ * Called when the value returned from {@link Player#getPlaybackState()} changes.
*
- * @param videoSize The new size of the video.
+ * @param player The {@link Player} whose state changed. Use the getters to obtain the latest
+ * states.
*/
- public void onVideoSizeChanged(VideoSize videoSize) {
- mCurrentResolutionWidth = videoSize.width;
- mCurrentResolutionHeight = videoSize.height;
- }
+ public abstract void onEventsPlaybackStateChanged(@NonNull Player player);
/**
- * Create a message at given position to change the resolution
+ * Called when the value returned from {@link Player#getCurrentMediaItem()} changes or the player
+ * starts repeating the current item.
*
- * @param sendMessagePosition Position at which message needs to be executed
+ * @param player The {@link Player} whose state changed. Use the getters to obtain the latest
+ * states.
*/
- private void createAdaptivePlaybackMessage(long sendMessagePosition) {
- mActivity.mPlayer.createMessage((messageType, payload) -> {
- TrackSelectionParameters currentParameters =
- mActivity.mPlayer.getTrackSelectionParameters();
- TrackSelectionParameters newParameters = currentParameters
- .buildUpon()
- .setOverrideForType(
- new TrackSelectionOverride(mVideoTrackGroup.getMediaTrackGroup(),
- mCurrentTrackIndex))
- .build();
- mActivity.mPlayer.setTrackSelectionParameters(newParameters);
- mResolutionChangeRequested = true;
- }).setLooper(Looper.getMainLooper()).setPosition(sendMessagePosition)
- .setDeleteAfterDelivery(true).send();
- }
-
- /**
- * Fetch only video tracks group from the given clip
- *
- * @param currentTracks Current tracks in the clip
- * @return Video tracks group
- */
- private Tracks.Group getVideoTrackGroup(Tracks currentTracks) {
- Tracks.Group videoTrackGroup = null;
- for (Tracks.Group currentTrackGroup : currentTracks.getGroups()) {
- if (currentTrackGroup.getType() == C.TRACK_TYPE_VIDEO) {
- videoTrackGroup = currentTrackGroup;
- break;
- }
- }
- return videoTrackGroup;
- }
-
- /**
- * Get all available formats from videoTrackGroup.
- */
- private List<Format> getVideoFormatList() {
- Tracks currentTracks = mActivity.mPlayer.getCurrentTracks();
- mVideoTrackGroup = getVideoTrackGroup(currentTracks);
- List<Format> videoFormatList = new ArrayList<>();
- // Populate the videoFormatList with video tracks
- for (int trackIndex = 0; trackIndex < mVideoTrackGroup.length; trackIndex++) {
- Format trackFormat = mVideoTrackGroup.getTrackFormat(trackIndex);
- videoFormatList.add(trackFormat);
- }
- assertEquals(mNumOfVideoTrack, videoFormatList.size());
- return videoFormatList;
- }
+ public abstract void onEventsMediaItemTransition(@NonNull Player player);
/**
* Create a message at given position to change the audio or the subtitle track
@@ -674,7 +253,7 @@
* @param trackGroupIndex Index of the current track group
* @param trackIndex Index of the current track
*/
- private void createSwitchTrackMessage(long sendMessagePosition, int trackGroupIndex,
+ protected final void createSwitchTrackMessage(long sendMessagePosition, int trackGroupIndex,
int trackIndex) {
mActivity.mPlayer.createMessage((messageType, payload) -> {
TrackSelectionParameters currentParameters =
@@ -702,11 +281,12 @@
* @param tracks The available tracks information. Never null, but may be of length zero.
*/
@Override
- public void onTracksChanged(Tracks tracks) {
+ public final void onTracksChanged(Tracks tracks) {
for (Tracks.Group currentTrackGroup : tracks.getGroups()) {
- if (currentTrackGroup.isSelected() && ((isSwitchAudioTrackTest() && (
- currentTrackGroup.getType() == C.TRACK_TYPE_AUDIO)) || (isSwitchSubtitleTrackTest() && (
- currentTrackGroup.getType() == C.TRACK_TYPE_TEXT)))) {
+ if (currentTrackGroup.isSelected() && (
+ (getTestType().equals(TestType.SWITCH_AUDIO_TRACK_TEST) && (currentTrackGroup.getType()
+ == C.TRACK_TYPE_AUDIO)) || (getTestType().equals(TestType.SWITCH_SUBTITLE_TRACK_TEST)
+ && (currentTrackGroup.getType() == C.TRACK_TYPE_TEXT)))) {
for (int trackIndex = 0; trackIndex < currentTrackGroup.length; trackIndex++) {
if (currentTrackGroup.isTrackSelected(trackIndex)) {
if (!mTrackChangeRequested) {
@@ -723,7 +303,7 @@
/**
* Get all audio/subtitle tracks group from the player's Tracks.
*/
- private List<Tracks.Group> getTrackGroups() {
+ protected final List<Tracks.Group> getTrackGroups() {
List<Tracks.Group> trackGroups = new ArrayList<>();
Tracks currentTracks = mActivity.mPlayer.getCurrentTracks();
for (Tracks.Group currentTrackGroup : currentTracks.getGroups()) {
@@ -734,24 +314,4 @@
}
return trackGroups;
}
-
- /**
- * Called when the value returned from getPlaybackSuppressionReason() changes. onEvents(Player,
- * Player.Events) will also be called to report this event along with other events that happen in
- * the same Looper message queue iteration.
- *
- * @param playbackSuppressionReason The current {@link PlaybackSuppressionReason}.
- */
- @Override
- public void onPlaybackSuppressionReasonChanged(int playbackSuppressionReason) {
- // Verify suppression reason change caused by call notification test
- if (mIsCallNotification) {
- if (!mActivity.mPlayer.isPlaying()) {
- assertEquals(Player.PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS,
- playbackSuppressionReason);
- } else {
- assertEquals(Player.PLAYBACK_SUPPRESSION_REASON_NONE, playbackSuppressionReason);
- }
- }
- }
}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/ScaleGestureListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/ScaleGestureListener.java
new file mode 100644
index 0000000..8a4eee8
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/ScaleGestureListener.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2023 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.media.cujcommon.cts;
+
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+
+import android.view.ScaleGestureDetector;
+
+import androidx.annotation.NonNull;
+import androidx.media3.ui.PlayerView;
+
+public class ScaleGestureListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
+ private float mCurrentScaleFactor = 1.0f;
+ private float mStartScaleFactor;
+ private final PlayerView mExoPlayerView;
+
+ ScaleGestureListener(PlayerView exoPlayerView) {
+ this.mExoPlayerView = exoPlayerView;
+ }
+
+ @Override
+ public boolean onScale(ScaleGestureDetector detector) {
+ mCurrentScaleFactor *= detector.getScaleFactor();
+ mExoPlayerView.setScaleX(mCurrentScaleFactor);
+ mExoPlayerView.setScaleY(mCurrentScaleFactor);
+ return true;
+ }
+
+ @Override
+ public boolean onScaleBegin(@NonNull ScaleGestureDetector detector) {
+ mStartScaleFactor = mCurrentScaleFactor;
+ mCurrentScaleFactor *= detector.getScaleFactor();
+ return true;
+ }
+
+ @Override
+ public void onScaleEnd(@NonNull ScaleGestureDetector detector) {
+ assertNotEquals(mStartScaleFactor, mCurrentScaleFactor);
+ // Zoom in starts with scaleFactor 1.
+ if (mStartScaleFactor == 1.0f) {
+ assertTrue(mCurrentScaleFactor > mStartScaleFactor);
+ } else {
+ assertTrue(mCurrentScaleFactor < mStartScaleFactor);
+ }
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/ScrollTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/ScrollTestPlayerListener.java
new file mode 100644
index 0000000..75c4426
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/ScrollTestPlayerListener.java
@@ -0,0 +1,84 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import android.os.Looper;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.Player;
+import androidx.media3.exoplayer.ExoPlayer;
+
+public class ScrollTestPlayerListener extends PlayerListener {
+
+ private final int mNumOfScrollIteration;
+
+ public ScrollTestPlayerListener(int numOfScrollIteration, long sendMessagePosition) {
+ super();
+ this.mNumOfScrollIteration = numOfScrollIteration;
+ this.mSendMessagePosition = sendMessagePosition;
+ }
+
+ /**
+ * Scroll the View vertically.
+ *
+ * @param yIndex The yIndex to scroll the view vertically.
+ */
+ private void scrollView(int yIndex) {
+ mScrollActivity.mScrollView.scrollTo(0, yIndex);
+ if (CURRENT_MEDIA_INDEX == mNumOfScrollIteration) {
+ mScrollRequested = true;
+ }
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.SCROLL_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ // In case of scroll test, send the message to scroll the view to change the surface
+ // positions. Scroll has two surfaceView (top and bottom), playback start on top view and
+ // after each mSendMessagePosition sec playback is switched to other view alternatively.
+ int yIndex;
+ ExoPlayer currentPlayer;
+ if ((CURRENT_MEDIA_INDEX % 2) == 0) {
+ currentPlayer = mScrollActivity.mFirstPlayer;
+ yIndex = mScrollActivity.SURFACE_HEIGHT * 2;
+ } else {
+ currentPlayer = mScrollActivity.mSecondPlayer;
+ yIndex = 0;
+ }
+ CURRENT_MEDIA_INDEX++;
+ for (int i = 0; i < mNumOfScrollIteration; i++) {
+ currentPlayer.createMessage((messageType, payload) -> {
+ scrollView(yIndex);
+ }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition * (i + 1))
+ .setDeleteAfterDelivery(true)
+ .send();
+ }
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SeekTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SeekTestPlayerListener.java
new file mode 100644
index 0000000..85fa89d
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SeekTestPlayerListener.java
@@ -0,0 +1,106 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import android.os.Looper;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.Player;
+
+import java.time.Clock;
+import java.time.Duration;
+import java.util.Random;
+
+public class SeekTestPlayerListener extends PlayerListener {
+
+ private static final String LOG_TAG = SeekTestPlayerListener.class.getSimpleName();
+
+ private final int mNumOfSeekIteration;
+ private long mSeekTimeUs;
+ private final long mSeed;
+ private boolean mSeekDone;
+
+ public SeekTestPlayerListener(int numOfSeekIteration, long seekTimeUs,
+ long sendMessagePosition) {
+ super();
+ this.mNumOfSeekIteration = numOfSeekIteration;
+ this.mSeekTimeUs = seekTimeUs;
+ this.mSeed = getSeed();
+ this.mSendMessagePosition = sendMessagePosition;
+ }
+
+ /**
+ * Returns seed for Seek test.
+ */
+ private long getSeed() {
+ // Truncate time to the nearest day.
+ long seed = Clock.tick(Clock.systemUTC(), Duration.ofDays(1)).instant().toEpochMilli();
+ Log.d(LOG_TAG, "Random seed = " + seed);
+ return seed;
+ }
+
+ /**
+ * Seek the player.
+ */
+ private void seek() {
+ Random random = new Random(mSeed);
+ // If number of seek requested is one then seek forward or backward alternatively for
+ // mSeekTimeUs on given media list.
+ // If number of seek requested is 30 then seek for mSeekTimeUs- forward 10 times,
+ // backward 10 times and then randomly backwards or forwards 10 times on each
+ // media item.
+ for (int i = 0; i < mNumOfSeekIteration; i++) {
+ mActivity.mPlayer.seekTo(mActivity.mPlayer.getCurrentPosition() + mSeekTimeUs);
+ if (mNumOfSeekIteration == 1 || i == 10) {
+ mSeekTimeUs *= -1;
+ } else if (i >= 20) {
+ mSeekTimeUs *= random.nextBoolean() ? -1 : 1;
+ }
+ }
+ mSeekDone = true;
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.SEEK_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ // Add change in duration due to seek
+ if (mSeekDone) {
+ mExpectedTotalTime += (mSendMessagePosition - player.getCurrentPosition());
+ mSeekDone = false;
+ } else {
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ }
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ mActivity.mPlayer.createMessage((messageType, payload) -> {
+ seek();
+ }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition)
+ .setDeleteAfterDelivery(true)
+ .send();
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SpeedChangeTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SpeedChangeTestPlayerListener.java
new file mode 100644
index 0000000..66f539f
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SpeedChangeTestPlayerListener.java
@@ -0,0 +1,97 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import static org.junit.Assert.assertEquals;
+
+import android.os.Looper;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.PlaybackParameters;
+import androidx.media3.common.Player;
+import androidx.media3.common.Player.Events;
+
+public class SpeedChangeTestPlayerListener extends PlayerListener {
+
+ private static final long START_SPEED_CHANGE_MS = 1000;
+ private static final float[] PLAYBACK_SPEEDS = {
+ 0.25f, 0.50f, 0.75f, 1.00f, 1.25f, 1.50f, 1.75f, 1.00f
+ };
+ private static final float DELTA = 0.001f;
+
+ private int mSpeedIndex;
+
+ public SpeedChangeTestPlayerListener() {
+ super();
+ this.mSendMessagePosition = START_SPEED_CHANGE_MS;
+ this.mSpeedIndex = 0;
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.SPEED_CHANGE_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ // Iterate sequentially through all the playback speeds
+ // Create messages to be executed at different positions
+ for (int index = 0; index < PLAYBACK_SPEEDS.length; index++) {
+ // Increment the message position to run the clip at different speeds for the same duration
+ // of 4 seconds i.e. for 0.25 speed it runs from PTS 1 sec (speed change starts from 1 sec) to
+ // 2 sec which takes playback time of 4 sec, for 0.50 speed it runs from PTS 2 sec to 4 sec
+ // which again takes playback time of 4 sec, similarly for 0.75 from PTS 4-7, for 1.0 from PTS
+ // 7-11, for 1.25 from PTS 11-16, for 1.5 from PTS 16-22 and for 1.75 from PTS 22-29 and back
+ // to normal speed from PTS 29 sec onwards. Total time taken to do the 7 speed change
+ // operations is 28 (7 * 4) seconds which is equivalent to the PTS duration within which speed
+ // change operations are done i.e. 28 (29 - 1) sec. So, The total time consumed is
+ // 7 (speeds) * 4 + 2 which is equal to the clip duration i.e. 30 sec.
+ mSendMessagePosition += (index * 1000L);
+ mActivity.mPlayer.createMessage((messageType, payload) -> {
+ PlaybackParameters newParameters = new PlaybackParameters(PLAYBACK_SPEEDS[mSpeedIndex]);
+ mActivity.mPlayer.setPlaybackParameters(newParameters);
+ }).setLooper(Looper.getMainLooper()).setPosition(mSendMessagePosition)
+ .setDeleteAfterDelivery(true).send();
+ }
+ }
+
+ /**
+ * Called when the value of getPlaybackParameters() changes. The playback parameters may change
+ * due to a call to setPlaybackParameters(PlaybackParameters), or the player itself may change
+ * them (for example, if audio playback switches to passthrough or offload mode, where speed
+ * adjustment is no longer possible).
+ *
+ * <p>{@link #onEvents(Player, Events)} will also be called to report this event along with
+ * other events that happen in the same {@link Looper} message queue iteration.
+ *
+ * @param playbackParameters The playback parameters.
+ */
+ @Override
+ public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) {
+ assertEquals(PLAYBACK_SPEEDS[mSpeedIndex], playbackParameters.speed, DELTA);
+ mSpeedIndex++;
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SwitchAudioTrackTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SwitchAudioTrackTestPlayerListener.java
new file mode 100644
index 0000000..13a3116
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SwitchAudioTrackTestPlayerListener.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.Player;
+
+public class SwitchAudioTrackTestPlayerListener extends PlayerListener {
+
+ private final int mNumOfAudioTrack;
+
+ public SwitchAudioTrackTestPlayerListener(int numOfAudioTrack, long sendMessagePosition) {
+ super();
+ this.mNumOfAudioTrack = numOfAudioTrack;
+ this.mSendMessagePosition = sendMessagePosition;
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.SWITCH_AUDIO_TRACK_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ // When player is ready, get the list of audio/subtitle track groups in the mediaItem
+ mTrackGroups = getTrackGroups();
+ } else if (mTrackChangeRequested && player.getPlaybackState() == Player.STATE_ENDED) {
+ assertEquals(mConfiguredTrackFormat, mCurrentTrackFormat);
+ assertFalse(isFormatSimilar(mStartTrackFormat, mCurrentTrackFormat));
+ mTrackChangeRequested = false;
+ mStartTrackFormat = mCurrentTrackFormat;
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ // Create messages to be executed at different positions
+ // First trackGroupIndex is selected at the time of playback start, so changing
+ // track from second track group Index onwards.
+ for (int trackGroupIndex = 1; trackGroupIndex < mNumOfAudioTrack; trackGroupIndex++) {
+ createSwitchTrackMessage(mSendMessagePosition * trackGroupIndex, trackGroupIndex,
+ 0 /* TrackIndex */);
+ }
+ }
+}
diff --git a/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SwitchSubtitleTrackTestPlayerListener.java b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SwitchSubtitleTrackTestPlayerListener.java
new file mode 100644
index 0000000..ceb2a62
--- /dev/null
+++ b/tests/tests/mediacujtest/common/src/android/media/cujcommon/cts/SwitchSubtitleTrackTestPlayerListener.java
@@ -0,0 +1,85 @@
+/**
+ * Copyright (C) 2024 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.media.cujcommon.cts;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+import androidx.annotation.NonNull;
+import androidx.media3.common.Player;
+import androidx.media3.common.TrackSelectionOverride;
+import androidx.media3.common.TrackSelectionParameters;
+
+public class SwitchSubtitleTrackTestPlayerListener extends PlayerListener {
+
+ private final int mNumOfSubtitleTrack;
+
+ public SwitchSubtitleTrackTestPlayerListener(int numOfSubtitleTrack, long sendMessagePosition) {
+ super();
+ this.mNumOfSubtitleTrack = numOfSubtitleTrack;
+ this.mSendMessagePosition = sendMessagePosition;
+ }
+
+ /**
+ * Select the first subtitle track explicitly.
+ */
+ private void selectFirstSubtitleTrack() {
+ TrackSelectionParameters currentParameters =
+ mActivity.mPlayer.getTrackSelectionParameters();
+ TrackSelectionParameters newParameters = currentParameters
+ .buildUpon()
+ .setOverrideForType(
+ new TrackSelectionOverride(mTrackGroups.get(0).getMediaTrackGroup(), 0))
+ .build();
+ mActivity.mPlayer.setTrackSelectionParameters(newParameters);
+ }
+
+ @Override
+ public TestType getTestType() {
+ return TestType.SWITCH_SUBTITLE_TRACK_TEST;
+ }
+
+ @Override
+ public void onEventsPlaybackStateChanged(@NonNull Player player) {
+ if (player.getPlaybackState() == Player.STATE_READY) {
+ // At the first media transition player is not ready. So, add duration of
+ // first clip when player is ready
+ mExpectedTotalTime += player.getDuration();
+ // When player is ready, get the list of audio/subtitle track groups in the mediaItem
+ mTrackGroups = getTrackGroups();
+ // For a subtitle track switching test, we need to explicitly select the first
+ // subtitle track
+ selectFirstSubtitleTrack();
+ } else if (mTrackChangeRequested && player.getPlaybackState() == Player.STATE_ENDED) {
+ assertEquals(mConfiguredTrackFormat, mCurrentTrackFormat);
+ assertFalse(isFormatSimilar(mStartTrackFormat, mCurrentTrackFormat));
+ mTrackChangeRequested = false;
+ mStartTrackFormat = mCurrentTrackFormat;
+ }
+ }
+
+ @Override
+ public void onEventsMediaItemTransition(@NonNull Player player) {
+ // Create messages to be executed at different positions
+ // First trackGroupIndex is selected at the time of playback start, so changing
+ // track from second track group Index onwards.
+ for (int trackGroupIndex = 1; trackGroupIndex < mNumOfSubtitleTrack; trackGroupIndex++) {
+ createSwitchTrackMessage(mSendMessagePosition * trackGroupIndex, trackGroupIndex,
+ 0 /* TrackIndex */);
+ }
+ }
+}
diff --git a/tests/tests/mediacujtest/largetest/AndroidTest.xml b/tests/tests/mediacujtest/largetest/AndroidTest.xml
index 76fbf60..f19716e 100644
--- a/tests/tests/mediacujtest/largetest/AndroidTest.xml
+++ b/tests/tests/mediacujtest/largetest/AndroidTest.xml
@@ -41,7 +41,7 @@
</target_preparer>
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.MediaPreparer">
<option name="push-all" value="true" />
- <option name="media-folder-name" value="CtsMediaCUJLargeTest-1.2" />
+ <option name="media-folder-name" value="CtsMediaCUJLargeTest-1.3" />
<option name="dynamic-config-module" value="CtsMediaCUJLargeTest" />
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
diff --git a/tests/tests/mediacujtest/largetest/DynamicConfig.xml b/tests/tests/mediacujtest/largetest/DynamicConfig.xml
index 07f028c..6ef3fe8 100644
--- a/tests/tests/mediacujtest/largetest/DynamicConfig.xml
+++ b/tests/tests/mediacujtest/largetest/DynamicConfig.xml
@@ -15,6 +15,6 @@
<dynamicConfig>
<entry key="media_files_url">
- <value>https://dl.google.com/android/xts/cts/tests/tests/mediacujtest/largetest/CtsMediaCUJLargeTest-1.2.zip</value>
+ <value>https://dl.google.com/android/xts/cts/tests/tests/mediacujtest/largetest/CtsMediaCUJLargeTest-1.3.zip</value>
</entry>
</dynamicConfig>
diff --git a/tests/tests/mediacujtest/largetest/src/android/media/cujlargetest/cts/CtsMediaLargeFormPlaybackTest.java b/tests/tests/mediacujtest/largetest/src/android/media/cujlargetest/cts/CtsMediaLargeFormPlaybackTest.java
index bcc87e5..c2b1f5e 100644
--- a/tests/tests/mediacujtest/largetest/src/android/media/cujlargetest/cts/CtsMediaLargeFormPlaybackTest.java
+++ b/tests/tests/mediacujtest/largetest/src/android/media/cujlargetest/cts/CtsMediaLargeFormPlaybackTest.java
@@ -16,9 +16,12 @@
package android.media.cujlargetest.cts;
+import android.media.cujcommon.cts.AdaptivePlaybackTestPlayerListener;
import android.media.cujcommon.cts.CujTestBase;
import android.media.cujcommon.cts.CujTestParam;
-import android.media.cujcommon.cts.PlayerListener;
+import android.media.cujcommon.cts.PlaybackTestPlayerListener;
+import android.media.cujcommon.cts.SeekTestPlayerListener;
+import android.media.cujcommon.cts.SpeedChangeTestPlayerListener;
import android.platform.test.annotations.AppModeFull;
import android.platform.test.annotations.PlatinumTest;
@@ -60,6 +63,8 @@
MEDIA_DIR + "ElephantsDream_BigBuckBunny_concat_1080p_avc_30min.mp4";
private static final String WEBM_ELEPHANTSDREAM_DASH_3MIN_URI_STRING =
MEDIA_DIR + "ElephantsDream.mpd";
+ private static final String WEBM_TEARSOFSTEEL_640x480_VP9_30S_URI_STRING =
+ MEDIA_DIR + "TearsOfSteel_640x480_vp9_30sec.webm";
CujTestParam mCujTestParam;
@@ -75,35 +80,35 @@
public static Collection<Object[]> input() {
// CujTestParam, testId
final List<Object[]> exhaustiveArgsList = new ArrayList<>(Arrays.asList(new Object[][]{
- {CujTestParam.builder().setMediaUrls(prepare_5minAudioList())
- .setTimeoutMilliSeconds(930000)
- .setPlayerListener(PlayerListener.createListenerForPlaybackTest()).build(),
+ {CujTestParam.builder().setMediaUrls(prepare_5minAudioList()).setTimeoutMilliSeconds(930000)
+ .setPlayerListener(new PlaybackTestPlayerListener()).build(),
"Audio_5min_PlaybackTest"},
{CujTestParam.builder().setMediaUrls(prepareVP9_640x480_5minVideoList())
.setTimeoutMilliSeconds(930000)
- .setPlayerListener(PlayerListener.createListenerForPlaybackTest()).build(),
- "VP9_640x480_5min"},
+ .setPlayerListener(new PlaybackTestPlayerListener()).build(), "VP9_640x480_5min"},
{CujTestParam.builder().setMediaUrls(prepareVP9_640x480_5minVideoList())
- .setTimeoutMilliSeconds(930000)
- .setPlayerListener(PlayerListener.createListenerForSeekTest(30, 10000, 30000)).build(),
+ .setTimeoutMilliSeconds(1230000)
+ .setPlayerListener(new SeekTestPlayerListener(30, 10000, 30000)).build(),
"VP9_640x480_5min_seekTest"},
{CujTestParam.builder().setMediaUrls(prepare_30minAudioList())
.setTimeoutMilliSeconds(1830000)
- .setPlayerListener(PlayerListener.createListenerForPlaybackTest()).build(),
+ .setPlayerListener(new PlaybackTestPlayerListener()).build(),
"Audio_30min_PlaybackTest"},
{CujTestParam.builder().setMediaUrls(prepareAvc_1080p_30minVideoList())
.setTimeoutMilliSeconds(1830000)
- .setPlayerListener(PlayerListener.createListenerForPlaybackTest()).build(),
- "Avc_1080p_30min"},
+ .setPlayerListener(new PlaybackTestPlayerListener()).build(), "Avc_1080p_30min"},
{CujTestParam.builder().setMediaUrls(prepareAvc_1080p_30minVideoList())
- .setTimeoutMilliSeconds(1830000)
- .setPlayerListener(PlayerListener.createListenerForSeekTest(30, 10000, 30000)).build(),
+ .setTimeoutMilliSeconds(1930000)
+ .setPlayerListener(new SeekTestPlayerListener(30, 10000, 30000)).build(),
"Avc_1080p_30min_seekTest"},
{CujTestParam.builder().setMediaUrls(prepareVp9_Local_DASH_3minVideoList())
.setTimeoutMilliSeconds(210000)
- .setPlayerListener(
- PlayerListener.createListenerForAdaptivePlaybackTest(6, 15000)).build(),
+ .setPlayerListener(new AdaptivePlaybackTestPlayerListener(6, 15000)).build(),
"Vp9_DASH_3min_adaptivePlaybackTest"},
+ {CujTestParam.builder().setMediaUrls(prepareHevc_720p_30secVideoListForSpeedChangeTest())
+ .setTimeoutMilliSeconds(60000)
+ .setPlayerListener(new SpeedChangeTestPlayerListener()).build(),
+ "Hevc_720p_30sec_SpeedChangeTest"},
}));
return exhaustiveArgsList;
}
@@ -157,6 +162,15 @@
return videoInput;
}
+ /**
+ * Prepare Hevc 720p 30sec video list for Speech change test
+ */
+ public static List<String> prepareHevc_720p_30secVideoListForSpeedChangeTest() {
+ List<String> videoInput = Arrays.asList(
+ WEBM_TEARSOFSTEEL_640x480_VP9_30S_URI_STRING);
+ return videoInput;
+ }
+
// Test to Verify video playback with and without seek
@ApiTest(apis = {"android.media.MediaCodec#configure",
"android.media.MediaCodec#createByCodecName",
diff --git a/tests/tests/mediacujtest/largetest/src/android/media/cujlargetest/cts/WorkDir.java b/tests/tests/mediacujtest/largetest/src/android/media/cujlargetest/cts/WorkDir.java
index 65c4865..0b359dc 100644
--- a/tests/tests/mediacujtest/largetest/src/android/media/cujlargetest/cts/WorkDir.java
+++ b/tests/tests/mediacujtest/largetest/src/android/media/cujlargetest/cts/WorkDir.java
@@ -24,6 +24,6 @@
*/
class WorkDir extends WorkDirBase {
static final String getMediaDirString() {
- return getMediaDirString("CtsMediaCUJLargeTest-1.2");
+ return getMediaDirString("CtsMediaCUJLargeTest-1.3");
}
}
diff --git a/tests/tests/mediacujtest/smalltest/src/android/media/cujsmalltest/cts/CtsMediaShortFormFullModePlaybackTest.java b/tests/tests/mediacujtest/smalltest/src/android/media/cujsmalltest/cts/CtsMediaShortFormFullModePlaybackTest.java
new file mode 100644
index 0000000..73e63fd
--- /dev/null
+++ b/tests/tests/mediacujtest/smalltest/src/android/media/cujsmalltest/cts/CtsMediaShortFormFullModePlaybackTest.java
@@ -0,0 +1,105 @@
+/**
+ * Copyright (C) 2024 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.media.cujsmalltest.cts;
+
+import android.media.cujcommon.cts.CallNotificationTestPlayerListener;
+import android.media.cujcommon.cts.CujTestBase;
+import android.media.cujcommon.cts.CujTestParam;
+import android.media.cujcommon.cts.MessageNotificationTestPlayerListener;
+import android.platform.test.annotations.AppModeFull;
+import android.platform.test.annotations.PlatinumTest;
+
+import androidx.test.filters.LargeTest;
+
+import com.android.compatibility.common.util.ApiTest;
+
+import org.junit.Assume;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+
+@LargeTest
+@AppModeFull(reason = "Instant apps doesn't support push message notification and phone calling")
+@RunWith(Parameterized.class)
+public class CtsMediaShortFormFullModePlaybackTest extends CujTestBase {
+
+ private static final String MP4_FORBIGGERJOYRIDES_ASSET_720P_HEVC_URI_STRING =
+ "android.resource://android.media.cujsmalltest.cts/raw/ForBiggerJoyrides_720p_hevc_15s";
+
+ CujTestParam mCujTestParam;
+ private final String mTestType;
+
+ public CtsMediaShortFormFullModePlaybackTest(CujTestParam cujTestParam, String testType) {
+ super(cujTestParam.playerListener());
+ mCujTestParam = cujTestParam;
+ this.mTestType = testType;
+ }
+
+ /**
+ * Returns the list of parameters
+ */
+ @Parameterized.Parameters(name = "{index}_{1}")
+ public static Collection<Object[]> input() {
+ // CujTestParam, testId
+ final List<Object[]> exhaustiveArgsList = new ArrayList<>(Arrays.asList(new Object[][]{
+ {CujTestParam.builder().setMediaUrls(prepareHevc_720p_15secVideoListForNotificationTest())
+ .setTimeoutMilliSeconds(52000)
+ .setPlayerListener(new CallNotificationTestPlayerListener(4000)).build(),
+ "Hevc_720p_15sec_CallNotificationTest"},
+ {CujTestParam.builder().setMediaUrls(prepareHevc_720p_15secVideoListForNotificationTest())
+ .setTimeoutMilliSeconds(45000)
+ .setPlayerListener(new MessageNotificationTestPlayerListener(4000)).build(),
+ "Hevc_720p_15sec_MessageNotificationTest"},
+ }));
+ return exhaustiveArgsList;
+ }
+
+ /**
+ * Prepare Hevc 720p 15sec video list for notification test.
+ */
+ public static List<String> prepareHevc_720p_15secVideoListForNotificationTest() {
+ List<String> videoInput = Arrays.asList(
+ MP4_FORBIGGERJOYRIDES_ASSET_720P_HEVC_URI_STRING);
+ return videoInput;
+ }
+
+ // Test to Verify video playback with and without seek
+ @ApiTest(apis = {"android.media.MediaCodec#configure",
+ "android.media.MediaCodec#createByCodecName",
+ "android.media.MediaCodecInfo#getName",
+ "android.media.MediaCodecInfo#getSupportedTypes",
+ "android.media.MediaCodecInfo#isSoftwareOnly"})
+ @Test
+ @PlatinumTest(focusArea = "media")
+ public void testVideoPlayback() throws Exception {
+ if (mCujTestParam.playerListener().isOrientationTest()) {
+ Assume.assumeTrue("Skipping " + mTestType + " as device doesn't support orientation.",
+ supportOrientationRequest(mActivity));
+ }
+ if (mCujTestParam.playerListener().isCallNotificationTest()) {
+ Assume.assumeTrue("Skipping " + mTestType + " as device doesn't support call feature",
+ deviceSupportPhoneCall(mActivity));
+ }
+ play(mCujTestParam.mediaUrls(), mCujTestParam.timeoutMilliSeconds());
+ }
+}
diff --git a/tests/tests/mediacujtest/smalltest/src/android/media/cujsmalltest/cts/CtsMediaShortFormPlaybackTest.java b/tests/tests/mediacujtest/smalltest/src/android/media/cujsmalltest/cts/CtsMediaShortFormPlaybackTest.java
index cba9275..2a746d1 100644
--- a/tests/tests/mediacujtest/smalltest/src/android/media/cujsmalltest/cts/CtsMediaShortFormPlaybackTest.java
+++ b/tests/tests/mediacujtest/smalltest/src/android/media/cujsmalltest/cts/CtsMediaShortFormPlaybackTest.java
@@ -18,7 +18,14 @@
import android.media.cujcommon.cts.CujTestBase;
import android.media.cujcommon.cts.CujTestParam;
-import android.media.cujcommon.cts.PlayerListener;
+import android.media.cujcommon.cts.OrientationTestPlayerListener;
+import android.media.cujcommon.cts.PinchToZoomTestPlayerListener;
+import android.media.cujcommon.cts.PipModeTestPlayerListener;
+import android.media.cujcommon.cts.PlaybackTestPlayerListener;
+import android.media.cujcommon.cts.ScrollTestPlayerListener;
+import android.media.cujcommon.cts.SeekTestPlayerListener;
+import android.media.cujcommon.cts.SwitchAudioTrackTestPlayerListener;
+import android.media.cujcommon.cts.SwitchSubtitleTrackTestPlayerListener;
import android.platform.test.annotations.PlatinumTest;
import androidx.test.filters.LargeTest;
@@ -90,48 +97,47 @@
final List<Object[]> exhaustiveArgsList = new ArrayList<>(Arrays.asList(new Object[][]{
{CujTestParam.builder().setMediaUrls(prepareHevc_720p_15secVideoList())
.setTimeoutMilliSeconds(330000)
- .setPlayerListener(PlayerListener.createListenerForPlaybackTest()).build(),
- "Hevc_720p_15sec"},
+ .setPlayerListener(new PlaybackTestPlayerListener()).build(), "Hevc_720p_15sec"},
{CujTestParam.builder().setMediaUrls(prepareHevc_720p_15secVideoList())
.setTimeoutMilliSeconds(330000)
- .setPlayerListener(PlayerListener.createListenerForSeekTest(1, 5000, 9000)).build(),
+ .setPlayerListener(new SeekTestPlayerListener(1, 5000, 9000)).build(),
"Hevc_720p_15sec_seekTest"},
{CujTestParam.builder().setMediaUrls(prepareHevc_480p_5secVideoList())
.setTimeoutMilliSeconds(60000)
- .setPlayerListener(PlayerListener.createListenerForOrientationTest(3000)).build(),
+ .setPlayerListener(new OrientationTestPlayerListener(3000)).build(),
"Hevc_480p_5sec_OrientationTest"},
{CujTestParam.builder().setMediaUrls(prepareAvc_1080p_5secVideoList())
.setTimeoutMilliSeconds(60000)
- .setPlayerListener(PlayerListener.createListenerForOrientationTest(3000)).build(),
+ .setPlayerListener(new OrientationTestPlayerListener(3000)).build(),
"Avc_1080p_5sec_OrientationTest"},
{CujTestParam.builder().setMediaUrls(prepareAvc_360x640_5secVideoList())
.setTimeoutMilliSeconds(60000)
- .setPlayerListener(PlayerListener.createListenerForOrientationTest(3000)).build(),
+ .setPlayerListener(new OrientationTestPlayerListener(3000)).build(),
"Avc_360x640_5sec_OrientationTest"},
{CujTestParam.builder().setMediaUrls(prepareHevc_480p_15secVideoListForScrollTest())
.setTimeoutMilliSeconds(90000)
- .setPlayerListener(PlayerListener.createListenerForScrollTest(2, 5000)).build(),
+ .setPlayerListener(new ScrollTestPlayerListener(2, 5000)).build(),
"Avc_360x640_15sec_ScrollTest"},
{CujTestParam.builder().setMediaUrls(prepare_Aac_2ch_44khz_Aac_1ch_44khz_5secVideoList())
.setTimeoutMilliSeconds(45000)
- .setPlayerListener(
- PlayerListener.createListenerForSwitchAudioTracksTest(2, 3000)).build(),
+ .setPlayerListener(new SwitchAudioTrackTestPlayerListener(2, 3000)).build(),
"Aac_2ch_44kHz_Aac_1ch_44kHz_5sec_SwitchAudioTracksTest"},
{CujTestParam.builder().setMediaUrls(prepare_Srt_Subtitles_Eng_French_5secVideoList())
.setTimeoutMilliSeconds(45000)
- .setPlayerListener(
- PlayerListener.createListenerForSwitchSubtitleTracksTest(2, 3000)).build(),
+ .setPlayerListener(new SwitchSubtitleTrackTestPlayerListener(2, 3000)).build(),
"Srt_Subtitle_eng_french_5sec_SwitchSubtitleTracksTest"},
{CujTestParam.builder().setMediaUrls(prepare_Ssa_Subtitles_Eng_French_5secVideoList())
.setTimeoutMilliSeconds(45000)
- .setPlayerListener(
- PlayerListener.createListenerForSwitchSubtitleTracksTest(2, 3000)).build(),
+ .setPlayerListener(new SwitchSubtitleTrackTestPlayerListener(2, 3000)).build(),
"Ssa_Subtitle_eng_french_5sec_SwitchSubtitleTracksTest"},
- {CujTestParam.builder().setMediaUrls(prepareHevc_720p_15secVideoListForNotificationTest())
- .setTimeoutMilliSeconds(52000)
- .setPlayerListener(
- PlayerListener.createListenerForNotificationTest(true, 4000)).build(),
- "Hevc_720p_15sec_CallNotificationTest"},
+ {CujTestParam.builder().setMediaUrls(prepareHevc_720p_15sec_SingleVideoList())
+ .setTimeoutMilliSeconds(45000)
+ .setPlayerListener(new PinchToZoomTestPlayerListener(3000)).build(),
+ "Hevc_720p_15sec_PinchToZoomTest"},
+ {CujTestParam.builder().setMediaUrls(prepareHevc_720p_15sec_SingleVideoList())
+ .setTimeoutMilliSeconds(45000)
+ .setPlayerListener(new PipModeTestPlayerListener(5000)).build(),
+ "Hevc_720p_15sec_PipModeTest"},
}));
return exhaustiveArgsList;
}
@@ -237,14 +243,15 @@
}
/**
- * Prepare Hevc 720p 15sec video list for notification test.
+ * Prepare Hevc 720p 15sec single video list.
*/
- public static List<String> prepareHevc_720p_15secVideoListForNotificationTest() {
+ public static List<String> prepareHevc_720p_15sec_SingleVideoList() {
List<String> videoInput = Arrays.asList(
MP4_FORBIGGERJOYRIDES_ASSET_720P_HEVC_URI_STRING);
return videoInput;
}
+
// Test to Verify video playback with and without seek
@ApiTest(apis = {"android.media.MediaCodec#configure",
"android.media.MediaCodec#createByCodecName",
@@ -258,6 +265,19 @@
Assume.assumeTrue("Skipping " + mTestType + " as device doesn't support orientation.",
supportOrientationRequest(mActivity));
}
+ if (mCujTestParam.playerListener().isCallNotificationTest()) {
+ Assume.assumeTrue("Skipping " + mTestType + " as device doesn't support call feature",
+ deviceSupportPhoneCall(mActivity));
+ }
+ if (mCujTestParam.playerListener().isPinchToZoomTest()) {
+ Assume.assumeFalse("Skipping " + mTestType + " as watch doesn't support zoom behaviour yet",
+ isWatchDevice(mActivity));
+ }
+ if (mCujTestParam.playerListener().isPipTest()) {
+ Assume.assumeFalse(
+ "Skipping " + mTestType + " as watch doesn't support picture-in-picture mode yet",
+ isWatchDevice(mActivity));
+ }
play(mCujTestParam.mediaUrls(), mCujTestParam.timeoutMilliSeconds());
}
}
diff --git a/tests/tests/mimemap/Android.bp b/tests/tests/mimemap/Android.bp
index 9622bd1..8dc3409 100644
--- a/tests/tests/mimemap/Android.bp
+++ b/tests/tests/mimemap/Android.bp
@@ -15,6 +15,7 @@
// Verifies the default MIME mapping as exposed by
// @CorePlatformApi libcore.content.type.MimeMap.getDefault()
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/multiuser/Android.bp b/tests/tests/multiuser/Android.bp
index 3eab598..96c2e6f 100644
--- a/tests/tests/multiuser/Android.bp
+++ b/tests/tests/multiuser/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_multiuser",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/nativeapi/Android.bp b/tests/tests/nativeapi/Android.bp
new file mode 100644
index 0000000..2f4f858
--- /dev/null
+++ b/tests/tests/nativeapi/Android.bp
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2024 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 {
+ default_team: "trendy_team_partner_eng",
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+android_test {
+ name: "CtsNonProductionReadyNativeApiTestCases",
+ srcs: ["src/**/*.java"],
+ // Include both the 32 and 64 bit versions.
+ compile_multilib: "both",
+ static_libs: [
+ "androidx.test.rules",
+ "compatibility-device-util-axt",
+ ],
+ jni_libs: [
+ "libnative-api-check-jni",
+ ],
+ host_required: ["cts-dynamic-config"],
+ test_suites: [
+ "general-tests",
+ "cts",
+ ],
+ data: [":cts-dynamic-config.dynamic"],
+ sdk_version: "current",
+}
+
+cc_library_shared {
+ name: "libnative-api-check-jni",
+ header_libs: [
+ "libnativehelper_header_only",
+ ],
+ srcs: [
+ "jni/NonProductionReadyNativeApiCheck-jni.cpp",
+ ],
+ shared_libs: [
+ "libaaudio",
+ "libamidi",
+ "libandroid",
+ "libc",
+ "libcamera2ndk",
+ "libdl",
+ "libEGL",
+ "libGLESv1_CM",
+ "libGLESv2",
+ "libGLESv3",
+ "libjnigraphics",
+ "liblog",
+ "libmediandk",
+ "libm",
+ "libneuralnetworks",
+ "libOpenMAXAL",
+ "libOpenSLES",
+ "libstdc++",
+ "libvulkan",
+ "libz",
+ ],
+ cflags: [
+ "-Werror",
+ "-Wno-unused-parameter",
+ ],
+ sdk_version: "current",
+}
diff --git a/tests/tests/nativeapi/AndroidManifest.xml b/tests/tests/nativeapi/AndroidManifest.xml
new file mode 100644
index 0000000..19f0c27
--- /dev/null
+++ b/tests/tests/nativeapi/AndroidManifest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2024 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="android.nativeapi.cts">
+ <!-- Needed for business logic test cases -->
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+
+ <application>
+ <uses-library android:name="android.test.runner"/>
+ </application>
+
+ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
+ android:targetPackage="android.nativeapi.cts"/>
+</manifest>
\ No newline at end of file
diff --git a/tests/tests/nativeapi/AndroidTest.xml b/tests/tests/nativeapi/AndroidTest.xml
new file mode 100644
index 0000000..0a40ddc
--- /dev/null
+++ b/tests/tests/nativeapi/AndroidTest.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2024 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.
+ -->
+<configuration description="Test native APIs">
+ <option name="test-suite-tag" value="cts" />
+ <option name="config-descriptor:metadata" key="component" value="framework" />
+ <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+ <option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
+ <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
+ <option name="config-descriptor:metadata" key="parameter" value="run_on_sdk_sandbox" />
+
+ <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
+ <option name="cleanup-apks" value="true" />
+ <option name="test-file-name" value="CtsNonProductionReadyNativeApiTestCases.apk" />
+ </target_preparer>
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.DynamicConfigPusher">
+ <option name="target" value="host" />
+ <option name="dynamic-config-name" value="cts-dynamic-config" />
+ <option name="version" value="1.0"/>
+ </target_preparer>
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.BusinessLogicPreparer">
+ <option name="business-logic-url" value="https://androidpartner.googleapis.com/v1/xtsBusinessLogic/suites/cts:select" />
+ <option name="business-logic-api-key" value="AIzaSyCZNccVFX50XFhVUbh_vEUxG0C8z8As6wk" />
+ <option name="business-logic-api-scope" value="https://www.googleapis.com/auth/androidPartner" />
+ <option name="config-filename" value="CtsNonProductionReadyNativeApiTestCases" />
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
+ <option name="package" value="android.nativeapi.cts" />
+ <option name="isolated-storage" value="false" />
+ <option name="runtime-hint" value="1m" />
+ </test>
+</configuration>
\ No newline at end of file
diff --git a/tests/tests/nativeapi/OWNERS b/tests/tests/nativeapi/OWNERS
new file mode 100644
index 0000000..6ffd2ed
--- /dev/null
+++ b/tests/tests/nativeapi/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 1332816
+wenshan@google.com
+slotus@google.com
\ No newline at end of file
diff --git a/tests/tests/nativeapi/jni/NonProductionReadyNativeApiCheck-jni.cpp b/tests/tests/nativeapi/jni/NonProductionReadyNativeApiCheck-jni.cpp
new file mode 100644
index 0000000..a0481e9
--- /dev/null
+++ b/tests/tests/nativeapi/jni/NonProductionReadyNativeApiCheck-jni.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2024 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 <dlfcn.h>
+#include <jni.h>
+#include <string.h>
+
+extern "C" {
+
+JNIEXPORT jobjectArray JNICALL Java_android_nativeapi_cts_NonProductionReadyNativeApiCheck_checkNonProductionReadyNativeApis(
+ JNIEnv* env, jobject obj, jobjectArray nonProductionReadyApis)
+{
+ int size = env->GetArrayLength(nonProductionReadyApis);
+ jobjectArray ret = (jobjectArray)env->NewObjectArray(
+ size,
+ env->FindClass("java/lang/String"),
+ env->NewStringUTF(""));
+
+ for (int i = 0; i < size; i++) {
+ jstring string = (jstring) env->GetObjectArrayElement(nonProductionReadyApis, i);
+ const char* api = env->GetStringUTFChars(string, 0);
+ if (dlsym(RTLD_DEFAULT, api) != nullptr) {
+ env->SetObjectArrayElement(
+ ret, i, env->NewStringUTF(api));
+ } else {
+ env->SetObjectArrayElement(
+ ret, i, env->NewStringUTF(""));
+ }
+ env->ReleaseStringUTFChars(string, api);
+ env->DeleteLocalRef(string);
+ }
+
+ return ret;
+}
+
+}
diff --git a/tests/tests/nativeapi/src/android/nativeapi/cts/NonProductionReadyNativeApiCheck.java b/tests/tests/nativeapi/src/android/nativeapi/cts/NonProductionReadyNativeApiCheck.java
new file mode 100644
index 0000000..bbbc2f4
--- /dev/null
+++ b/tests/tests/nativeapi/src/android/nativeapi/cts/NonProductionReadyNativeApiCheck.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2024 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.nativeapi.cts;
+
+import com.android.compatibility.common.util.BusinessLogicTestCase;
+import com.android.compatibility.common.util.CddTest;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@RunWith(JUnit4.class)
+public class NonProductionReadyNativeApiCheck extends BusinessLogicTestCase {
+ static {
+ System.loadLibrary("native-api-check-jni");
+ }
+
+ /**
+ * Checks any non production ready Native API is exposed.
+ *
+ * This method will be called via the BusinessLogic config. The non production ready native API
+ * list is also configured via BusinessLogic.
+ */
+ public void testNonProductionReadyNativeApis(String... nonProductionReadyNativeApis) {
+ List<String> exposedNonProductionReadyNativeApis = new ArrayList<>();
+ for (String s : checkNonProductionReadyNativeApis(nonProductionReadyNativeApis)) {
+ if (!s.isEmpty()) {
+ exposedNonProductionReadyNativeApis.add(s);
+ }
+ }
+
+ Assert.assertTrue(
+ String.format(
+ "Native APIs %s are not production ready and can not be exposed",
+ exposedNonProductionReadyNativeApis),
+ exposedNonProductionReadyNativeApis.isEmpty());
+ }
+
+ @Test
+ @CddTest(requirements = {"3.3.1/C-0-8"})
+ public void checkNonProductionReadyNativeApis_shouldNotExposed() {
+ }
+
+ private native String[] checkNonProductionReadyNativeApis(String[] nonProductionApis);
+}
diff --git a/tests/tests/nativehardware/Android.bp b/tests/tests/nativehardware/Android.bp
index 5f0120b..73a87ef 100644
--- a/tests/tests/nativehardware/Android.bp
+++ b/tests/tests/nativehardware/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_gpu",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/nativehardware/jni/Android.bp b/tests/tests/nativehardware/jni/Android.bp
index bf88b12..a73b226 100644
--- a/tests/tests/nativehardware/jni/Android.bp
+++ b/tests/tests/nativehardware/jni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_gpu",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/nativemidi/Android.bp b/tests/tests/nativemidi/Android.bp
index 411e984..548be5d 100644
--- a/tests/tests/nativemidi/Android.bp
+++ b/tests/tests/nativemidi/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/nativemidi/jni/Android.bp b/tests/tests/nativemidi/jni/Android.bp
index 34cdc3e..e20368c 100644
--- a/tests/tests/nativemidi/jni/Android.bp
+++ b/tests/tests/nativemidi/jni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/ndef/Android.bp b/tests/tests/ndef/Android.bp
index d5cf44c..e928e08 100644
--- a/tests/tests/ndef/Android.bp
+++ b/tests/tests/ndef/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_nfc",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/net/native/Android.bp b/tests/tests/net/native/Android.bp
index e52cb7c..04556ca 100644
--- a/tests/tests/net/native/Android.bp
+++ b/tests/tests/net/native/Android.bp
@@ -15,6 +15,7 @@
// Build the unit tests.
package {
+ default_team: "trendy_team_fwk_core_networking",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.bp b/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.bp
index 148ca87..bad460d 100644
--- a/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.bp
+++ b/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.bp b/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.bp
index 738c526..59136cb 100644
--- a/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.bp
+++ b/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.bp b/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.bp
index cf8d761..deca26b 100644
--- a/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.bp
+++ b/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/networksecurityconfig/Android.bp b/tests/tests/networksecurityconfig/Android.bp
index c22e16d..9868896 100644
--- a/tests/tests/networksecurityconfig/Android.bp
+++ b/tests/tests/networksecurityconfig/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-attributes/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-attributes/Android.bp
index cccde10..a8458d9 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-attributes/Android.bp
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-attributes/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-basic-domain/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-basic-domain/Android.bp
index 0672c5b..7cb6589 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-basic-domain/Android.bp
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-basic-domain/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-cleartext-pre-P/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-cleartext-pre-P/Android.bp
index e8b5a4d..8cf7b4d 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-cleartext-pre-P/Android.bp
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-cleartext-pre-P/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-cleartext/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-cleartext/Android.bp
index 88976ca..143c437 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-cleartext/Android.bp
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-cleartext/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-disabled/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-disabled/Android.bp
index 64f4538..2c3fc91 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-disabled/Android.bp
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-disabled/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-enabled/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-enabled/Android.bp
index 8a092cd..798c839 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-enabled/Android.bp
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-enabled/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.bp
index 29c0d21..f1f07c5 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.bp
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-invalid-pin/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-invalid-pin/Android.bp
index 84753b6..001f403 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-invalid-pin/Android.bp
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-invalid-pin/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-nested-domains/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-nested-domains/Android.bp
index cb33156..ab51aeb 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-nested-domains/Android.bp
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-nested-domains/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.bp
index 3089b32..b6f70ce 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.bp
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.bp
@@ -14,6 +14,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/nfc/Android.bp b/tests/tests/nfc/Android.bp
index 9771cbb..7b17474 100644
--- a/tests/tests/nfc/Android.bp
+++ b/tests/tests/nfc/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_nfc",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -27,12 +28,20 @@
"flag-junit",
"platform-test-annotations",
"testng",
+ "androidx.appcompat_appcompat",
],
- srcs: ["src/**/*.java"],
+ srcs: [
+ "src/android/nfc/cts/*.java",
+ "src/android/nfc/tech/cts/*.java",
+ // TODO(b/263565193): Temp hack until NFC APK can link against module_current.
+ ":framework-nfc-updatable-sources",
+ ],
// was: sdk_version: "current",
libs: [
"android.test.runner",
"android.test.base",
+ "framework-nfc.impl",
+ "unsupportedappusage",
],
// Tag this module as a cts test artifact
test_suites: [
@@ -40,3 +49,29 @@
"general-tests",
],
}
+
+android_test {
+ name: "CtsNfcInteractiveTestCases",
+ defaults: ["cts_defaults"],
+ static_libs: [
+ "ActivityContext",
+ "Interactive",
+ "ctstestrunner-axt",
+ "com.google.android.material_material",
+ "androidx.appcompat_appcompat",
+ ],
+ srcs: [
+ "src/android/nfc/cts/interactive/*.java",
+ "src/android/nfc/tech/cts/interactive/*.java",
+ ],
+ libs: [
+ "android.test.runner",
+ "android.test.base",
+ "framework-nfc.impl",
+ ],
+ test_suites: [
+ "cts-interactive",
+ "general-tests",
+ ],
+ test_config: "InteractiveAndroidTest.xml",
+}
diff --git a/tests/tests/nfc/AndroidManifest.xml b/tests/tests/nfc/AndroidManifest.xml
index ae7fa49..95f8da3 100644
--- a/tests/tests/nfc/AndroidManifest.xml
+++ b/tests/tests/nfc/AndroidManifest.xml
@@ -36,6 +36,9 @@
<activity android:name="android.nfc.cts.NfcFCardEmulationActivity"
android:exported="false">
</activity>
+ <activity android:name="android.nfc.cts.interactive.TagVerifierActivity"
+ android:theme="@style/Theme.AppCompat.Light"
+ android:exported="true"/>
</application>
<!-- This is a self-instrumenting test package. -->
diff --git a/tests/tests/nfc/InteractiveAndroidTest.xml b/tests/tests/nfc/InteractiveAndroidTest.xml
new file mode 100644
index 0000000..03c49d6
--- /dev/null
+++ b/tests/tests/nfc/InteractiveAndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2024 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.
+ -->
+
+<configuration description="Config for Interactive CTS NFC test cases">
+ <option name="test-suite-tag" value="cts-interactive" />
+
+ <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
+ <option name="cleanup-apks" value="true" />
+ <option name="install-arg" value="-t" />
+ <option name="test-file-name" value="CtsNfcInteractiveTestCases.apk" />
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
+ <option name="package" value="android.nfc.cts" />
+ <option name="include-annotation" value="com.android.interactive.annotations.Interactive" />
+ </test>
+</configuration>
\ No newline at end of file
diff --git a/tests/tests/nfc/res/layout/activity_main.xml b/tests/tests/nfc/res/layout/activity_main.xml
new file mode 100644
index 0000000..19f7ca6
--- /dev/null
+++ b/tests/tests/nfc/res/layout/activity_main.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2024 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.
+ -->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/activity_main"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+>
+</LinearLayout>
diff --git a/tests/tests/nfc/res/values/strings.xml b/tests/tests/nfc/res/values/strings.xml
index 64f9905..a00a5dd 100644
--- a/tests/tests/nfc/res/values/strings.xml
+++ b/tests/tests/nfc/res/values/strings.xml
@@ -15,4 +15,11 @@
-->
<resources>
<string name="CtsPaymentService">CTS Nfc Test Service</string>
+ <string name="nfc_scan_tag">Place device on a writable NDEF tag</string>
+ <string name="nfc_scan_tag_again">Place tag on device again to verify that contents match</string>
+ <string name="nfc_wrong_tag_title">Wrong type of tag scanned</string>
+ <string name="nfc_writing_tag_error">Error writing NFC tag</string>
+ <string name="nfc_reading_tag_error">Error reading NFC tag</string>
+ <string name="nfc_successful_write">Successful write. Moved to verify</string>
+ <string name="nfc_ndef_content">Id: %1$s\nMime: %2$s\nPayload: %3$s</string>
</resources>
diff --git a/tests/tests/nfc/src/android/nfc/cts/ApduServiceInfoTest.java b/tests/tests/nfc/src/android/nfc/cts/ApduServiceInfoTest.java
index 8a250ed..f4dc64f 100644
--- a/tests/tests/nfc/src/android/nfc/cts/ApduServiceInfoTest.java
+++ b/tests/tests/nfc/src/android/nfc/cts/ApduServiceInfoTest.java
@@ -225,10 +225,10 @@
ApduServiceInfo apduServiceInfo = new ApduServiceInfo(mResolveInfo, false, "",
new ArrayList<>(), mDynamicAidGroups, false, 0, 0, "", "", "");
- assertFalse(apduServiceInfo.isOtherServiceEnabled());
+ assertFalse(apduServiceInfo.isCategoryOtherServiceEnabled());
- apduServiceInfo.setOtherServiceEnabled(true);
- assertTrue(apduServiceInfo.isOtherServiceEnabled());
+ apduServiceInfo.setCategoryOtherServiceEnabled(true);
+ assertTrue(apduServiceInfo.isCategoryOtherServiceEnabled());
}
}
diff --git a/tests/tests/nfc/src/android/nfc/cts/NfcAdapterTest.java b/tests/tests/nfc/src/android/nfc/cts/NfcAdapterTest.java
index d6cdfea..0632677 100644
--- a/tests/tests/nfc/src/android/nfc/cts/NfcAdapterTest.java
+++ b/tests/tests/nfc/src/android/nfc/cts/NfcAdapterTest.java
@@ -2,6 +2,8 @@
import static android.Manifest.permission.WRITE_SECURE_SETTINGS;
+import static com.google.common.truth.Truth.assertThat;
+
import static org.junit.Assume.assumeTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
@@ -12,6 +14,7 @@
import android.app.Activity;
import android.app.PendingIntent;
+import android.app.UiAutomation;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -41,6 +44,10 @@
import org.mockito.internal.util.reflection.FieldSetter;
import java.util.ArrayList;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
@RunWith(JUnit4.class)
public class NfcAdapterTest {
@@ -72,8 +79,10 @@
if (!supportsHardware()) return;
// Restore the original service.
NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
- FieldSetter.setField(adapter,
- adapter.getClass().getDeclaredField("sService"), mSavedService);
+ if (adapter != null) {
+ FieldSetter.setField(adapter,
+ adapter.getClass().getDeclaredField("sService"), mSavedService);
+ }
}
@Test
@@ -278,6 +287,38 @@
}
@Test
+ @RequiresFlagsEnabled(Flags.FLAG_ENABLE_NFC_SET_DISCOVERY_TECH)
+ public void testResetDiscoveryTechnology() {
+ try {
+ NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
+ Activity activity = createAndResumeActivity();
+ adapter.resetDiscoveryTechnology(activity);
+ } catch (Exception e) {
+ throw new IllegalStateException("Unexpected Exception: " + e);
+ }
+ }
+
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_ENABLE_NFC_SET_DISCOVERY_TECH)
+ public void testSetDiscoveryTechnology() {
+ try {
+ NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
+ Activity activity = createAndResumeActivity();
+ adapter.setDiscoveryTechnology(activity,
+ NfcAdapter.FLAG_READER_NFC_A | NfcAdapter.FLAG_READER_NFC_B
+ | NfcAdapter.FLAG_READER_NFC_F,
+ NfcAdapter.FLAG_LISTEN_NFC_PASSIVE_A | NfcAdapter.FLAG_LISTEN_NFC_PASSIVE_B
+ | NfcAdapter.FLAG_LISTEN_NFC_PASSIVE_F);
+ adapter.resetDiscoveryTechnology(activity);
+ adapter.setDiscoveryTechnology(activity, NfcAdapter.FLAG_READER_DISABLE,
+ NfcAdapter.FLAG_LISTEN_KEEP);
+ adapter.resetDiscoveryTechnology(activity);
+ } catch (Exception e) {
+ throw new IllegalStateException("Unexpected Exception: " + e);
+ }
+ }
+
+ @Test
@RequiresFlagsEnabled(Flags.FLAG_ENABLE_NFC_MAINLINE)
public void testSetReaderMode() {
NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
@@ -330,6 +371,66 @@
}
}
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_NFC_VENDOR_CMD)
+ public void testSendVendorCmd() throws InterruptedException {
+ CountDownLatch rspCountDownLatch = new CountDownLatch(1);
+ CountDownLatch ntfCountDownLatch = new CountDownLatch(1);
+ NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(mContext);
+ Assert.assertNotNull(nfcAdapter);
+ NfcVendorNciCallback cb =
+ new NfcVendorNciCallback(rspCountDownLatch, ntfCountDownLatch);
+ try {
+ nfcAdapter.registerNfcVendorNciCallback(
+ Executors.newSingleThreadExecutor(), cb);
+
+ // Send random payload with a vendor gid.
+ byte[] payload = new byte[100];
+ new Random().nextBytes(payload);
+ int gid = 0xF;
+ int oid = 0xC;
+ nfcAdapter.sendVendorNciMessage(NfcAdapter.MESSAGE_TYPE_COMMAND, gid, oid, payload);
+
+ // Wait for response.
+ assertThat(rspCountDownLatch.await(1, TimeUnit.SECONDS)).isTrue();
+ assertThat(cb.gid).isEqualTo(gid);
+ assertThat(cb.oid).isEqualTo(oid);
+ assertThat(cb.payload).isNotEmpty();
+ } finally {
+ nfcAdapter.unregisterNfcVendorNciCallback(cb);
+ }
+ }
+
+ private class NfcVendorNciCallback implements NfcAdapter.NfcVendorNciCallback {
+ private final CountDownLatch mRspCountDownLatch;
+ private final CountDownLatch mNtfCountDownLatch;
+
+ public int gid;
+ public int oid;
+ public byte[] payload;
+
+ NfcVendorNciCallback(CountDownLatch rspCountDownLatch, CountDownLatch ntfCountDownLatch) {
+ mRspCountDownLatch = rspCountDownLatch;
+ mNtfCountDownLatch = ntfCountDownLatch;
+ }
+
+ @Override
+ public void onVendorNciResponse(int gid, int oid, byte[] payload) {
+ this.gid = gid;
+ this.oid = oid;
+ this.payload = payload;
+ mRspCountDownLatch.countDown();
+ }
+
+ @Override
+ public void onVendorNciNotification(int gid, int oid, byte[] payload) {
+ this.gid = gid;
+ this.oid = oid;
+ this.payload = payload;
+ mNtfCountDownLatch.countDown();
+ }
+ }
+
private class CtsReaderCallback implements NfcAdapter.ReaderCallback {
@Override
public void onTagDiscovered(Tag tag) {}
diff --git a/tests/tests/nfc/src/android/nfc/cts/interactive/TagVerifierActivity.java b/tests/tests/nfc/src/android/nfc/cts/interactive/TagVerifierActivity.java
new file mode 100644
index 0000000..2cfed12
--- /dev/null
+++ b/tests/tests/nfc/src/android/nfc/cts/interactive/TagVerifierActivity.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright (C) 2024 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.nfc.cts.interactive;
+
+import android.app.PendingIntent;
+import android.content.Intent;
+import android.nfc.NfcAdapter;
+import android.nfc.NfcManager;
+import android.nfc.Tag;
+import android.nfc.cts.R;
+import android.nfc.tech.cts.interactive.NdefTagTester;
+import android.nfc.tech.cts.interactive.TagTester;
+import android.nfc.tech.cts.interactive.TagVerifier;
+import android.nfc.tech.cts.interactive.TagVerifier.Result;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.util.Log;
+import android.widget.LinearLayout;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.google.android.material.snackbar.Snackbar;
+
+/**
+ * Activity used by CTS-Interactive test to verify Tag
+ */
+public class TagVerifierActivity extends AppCompatActivity {
+
+ private static final String TAG = "TagVerifierActivity";
+ public static boolean sWriteComplete = false;
+ public static boolean sVerifyComplete = false;
+ public static Result sResult = null;
+ private static Tag sTag;
+
+ private TagTester mTagTester;
+ private TagVerifier mTagVerifier;
+ private LinearLayout mRootView;
+ private NfcAdapter mNfcAdapter;
+ private PendingIntent mPendingIntent;
+
+ public static Result getResult() {
+ return sResult;
+ }
+
+ public static boolean getWriteComplete() {
+ return sWriteComplete;
+ }
+
+ public static boolean getVerifyComplete() {
+ return sVerifyComplete;
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mTagTester = new NdefTagTester(this);
+ NfcManager nfcManager = getSystemService(NfcManager.class);
+ mNfcAdapter = nfcManager.getDefaultAdapter();
+ mPendingIntent = PendingIntent.getActivity(this, 0,
+ new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),
+ PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ setContentView(R.layout.activity_main);
+ mRootView = findViewById(R.id.activity_main);
+
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ if (!mNfcAdapter.isEnabled()) {
+ Log.e(TAG, "NFC is not enabled");
+
+ }
+ mNfcAdapter.enableForegroundDispatch(this, mPendingIntent, null, null);
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ mNfcAdapter.disableForegroundDispatch(this);
+ }
+
+ @Override
+ protected void onNewIntent(Intent intent) {
+ Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
+ if (tag != null) {
+ sTag = tag;
+ if (!sWriteComplete) {
+ handleWriteStep(tag);
+ } else if (!sVerifyComplete) {
+ handleVerifyStep();
+ }
+ }
+ }
+
+ private void handleWriteStep(Tag tag) {
+ if (mTagTester.isTestableTag(tag)) {
+ new WriteTagTask().execute(sTag);
+ } else {
+ Snackbar.make(mRootView, getResources().getString(R.string.nfc_wrong_tag_title),
+ Snackbar.LENGTH_SHORT).show();
+ }
+ }
+
+ private void handleVerifyStep() {
+ new VerifyTagTask().execute(sTag);
+ }
+
+ class WriteTagTask extends AsyncTask<Tag, Void, TagVerifier> {
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ }
+
+ @Override
+ protected TagVerifier doInBackground(Tag... tags) {
+ try {
+ return mTagTester.writeTag(tags[0]);
+ } catch (Exception e) {
+ Log.e(TAG, "Error writing NFC tag...", e);
+ return null;
+ }
+ }
+
+ @Override
+ protected void onPostExecute(TagVerifier tagVerifier) {
+ mTagVerifier = tagVerifier;
+ int stringResId;
+ if (tagVerifier != null) {
+ sWriteComplete = true;
+ stringResId = R.string.nfc_successful_write;
+ } else {
+ stringResId = R.string.nfc_writing_tag_error;
+ }
+ Snackbar.make(mRootView, getResources().getString(stringResId),
+ Snackbar.LENGTH_SHORT).show();
+ }
+ }
+
+ class VerifyTagTask extends AsyncTask<Tag, Void, Result> {
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ }
+
+ @Override
+ protected Result doInBackground(Tag... tags) {
+ try {
+ return mTagVerifier.verifyTag(tags[0]);
+ } catch (Exception e) {
+ Log.e(TAG, "Error verifying NFC tag...", e);
+ return null;
+ }
+ }
+
+ @Override
+ protected void onPostExecute(Result result) {
+ super.onPostExecute(result);
+ TagVerifierActivity.sResult = result;
+ sVerifyComplete = true;
+ if (sResult != null) {
+ mTagVerifier = null;
+ } else {
+ Snackbar.make(mRootView, getResources().getString(R.string.nfc_reading_tag_error),
+ Snackbar.LENGTH_SHORT).show();
+ }
+ }
+ }
+
+}
diff --git a/tests/tests/nfc/src/android/nfc/cts/interactive/TagVerifierTest.java b/tests/tests/nfc/src/android/nfc/cts/interactive/TagVerifierTest.java
new file mode 100644
index 0000000..d647b9e
--- /dev/null
+++ b/tests/tests/nfc/src/android/nfc/cts/interactive/TagVerifierTest.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2024 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.nfc.cts.interactive;
+
+import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
+import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.app.Activity;
+import android.app.Instrumentation;
+import android.content.Context;
+import android.content.Intent;
+import android.nfc.cts.R;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import com.android.bedstead.harrier.BedsteadJUnit4;
+import com.android.bedstead.harrier.DeviceState;
+import com.android.bedstead.nene.TestApis;
+import com.android.interactive.Step;
+import com.android.interactive.annotations.Interactive;
+import com.android.interactive.annotations.NotFullyAutomated;
+import com.android.interactive.steps.ActAndWaitStep;
+
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Reading and writing NFC tags. Asks user to write data to tag. Asks user to scan tag to verify
+ * data was properly written and read back.
+ */
+@RunWith(BedsteadJUnit4.class)
+public class TagVerifierTest {
+
+ @ClassRule
+ @Rule
+ public static final DeviceState sDeviceState = new DeviceState();
+ private static final Context sContext = TestApis.context().instrumentedContext();
+ private static final Instrumentation sInstrumentation =
+ InstrumentationRegistry.getInstrumentation();
+
+
+ @Before
+ public void setUp() {
+ Intent intent = new Intent().setPackage(sContext.getPackageName())
+ .setClassName(sContext.getPackageName(), TagVerifierActivity.class.getName())
+ .setFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK);
+
+ Activity activity = sInstrumentation.startActivitySync(intent);
+ sInstrumentation.runOnMainSync(
+ () -> sInstrumentation.callActivityOnResume(activity));
+ }
+
+ @Test
+ @Interactive
+ @NotFullyAutomated(reason = "User must place tag against phone")
+ public void verifyTag() throws Exception {
+ Step.execute(WriteTagStep.class);
+ Step.execute(VerifyTagStep.class);
+ assertThat(TagVerifierActivity.getResult()).isNotNull();
+ assertThat(TagVerifierActivity.getResult().isMatch()).isTrue();
+ }
+
+
+ @NotFullyAutomated(reason = "Requires user to place tag")
+ public static final class WriteTagStep extends ActAndWaitStep {
+ public WriteTagStep() {
+ super(sContext.getResources().getString(R.string.nfc_scan_tag),
+ TagVerifierActivity::getWriteComplete);
+ }
+
+ }
+
+ @NotFullyAutomated(reason = "Requires user to place tag")
+ public static final class VerifyTagStep extends ActAndWaitStep {
+ public VerifyTagStep() {
+ super(sContext.getResources().getString(R.string.nfc_scan_tag_again),
+ TagVerifierActivity::getVerifyComplete);
+ }
+ }
+
+}
diff --git a/tests/tests/nfc/src/android/nfc/tech/cts/interactive/NdefTagTester.java b/tests/tests/nfc/src/android/nfc/tech/cts/interactive/NdefTagTester.java
new file mode 100644
index 0000000..6df0936
--- /dev/null
+++ b/tests/tests/nfc/src/android/nfc/tech/cts/interactive/NdefTagTester.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2024 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.nfc.tech.cts.interactive;
+
+import android.content.Context;
+import android.nfc.FormatException;
+import android.nfc.NdefMessage;
+import android.nfc.NdefRecord;
+import android.nfc.Tag;
+import android.nfc.tech.Ndef;
+import android.util.Log;
+
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.util.Random;
+
+/**
+ * {@link TagTester} for NDEF tags. It writes a semi-random NDEF tag with a random id but
+ * constant mime type and payload.
+ */
+public class NdefTagTester implements TagTester {
+
+ private static final String TAG = NdefTagTester.class.getSimpleName();
+
+ private static final String MIME_TYPE = "application/com.android.cts.verifier.nfc";
+
+ private static final String PAYLOAD = "CTS Verifier NDEF Tag";
+
+ private final Context mContext;
+
+
+ public NdefTagTester(Context context) {
+ this.mContext = context;
+ }
+
+ @Override
+ public boolean isTestableTag(Tag tag) {
+ if (tag != null) {
+ for (String tech : tag.getTechList()) {
+ if (tech.equals(Ndef.class.getName())) {
+ Ndef ndef = Ndef.get(tag);
+ return ndef != null && ndef.isWritable();
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public TagVerifier writeTag(Tag tag) throws IOException, FormatException {
+ Random random = new Random();
+ NdefRecord mimeRecord = createRandomMimeRecord(random);
+ NdefRecord[] expectedRecords = new NdefRecord[] {mimeRecord};
+
+ final NdefMessage expectedMessage = new NdefMessage(expectedRecords);
+ writeMessage(tag, expectedMessage);
+
+ final String expectedContent =
+ String.format("Id: %1$s\\nMime: %2$s\\nPayload: %3$s",
+ NfcUtils.displayByteArray(mimeRecord.getId()), MIME_TYPE, PAYLOAD);
+
+ return new TagVerifier() {
+ @Override
+ public Result verifyTag(Tag tag) throws IOException, FormatException {
+ String actualContent;
+ NdefMessage message = readMessage(tag);
+ NdefRecord[] records = message.getRecords();
+
+ if (records.length > 0) {
+ NdefRecord record = records[0];
+ actualContent = String.format("Id: %1$s\\nMime: %2$s\\nPayload: %3$s",
+
+ NfcUtils.displayByteArray(record.getId()),
+ new String(record.getType(), Charset.forName("US-ASCII")),
+ new String(record.getPayload(), Charset.forName("US-ASCII")));
+ } else {
+ actualContent = null;
+ }
+
+ return new Result(expectedContent, actualContent,
+ NfcUtils.areMessagesEqual(message, expectedMessage));
+ }
+ };
+ }
+
+ private NdefRecord createRandomMimeRecord(Random random) {
+ byte[] mimeBytes = MIME_TYPE.getBytes(Charset.forName("US-ASCII"));
+ byte[] id = new byte[4];
+ random.nextBytes(id);
+ byte[] payload = PAYLOAD.getBytes(Charset.forName("US-ASCII"));
+ return new NdefRecord(NdefRecord.TNF_MIME_MEDIA, mimeBytes, id, payload);
+ }
+
+ private void writeMessage(Tag tag, NdefMessage message) throws IOException, FormatException {
+ Ndef ndef = null;
+ try {
+ ndef = Ndef.get(tag);
+ ndef.connect();
+ ndef.writeNdefMessage(message);
+ } finally {
+ if (ndef != null) {
+ try {
+ ndef.close();
+ } catch (IOException e) {
+ Log.e(TAG, "IOException while closing NDEF...", e);
+ }
+ }
+ }
+ }
+
+ private NdefMessage readMessage(Tag tag) throws IOException, FormatException {
+ Ndef ndef = null;
+ try {
+ ndef = Ndef.get(tag);
+ if (ndef != null) {
+ ndef.connect();
+ return ndef.getNdefMessage();
+ }
+ } finally {
+ if (ndef != null) {
+ try {
+ ndef.close();
+ } catch (IOException e) {
+ Log.e(TAG, "Error closing Ndef...", e);
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/tests/tests/nfc/src/android/nfc/tech/cts/interactive/NfcUtils.java b/tests/tests/nfc/src/android/nfc/tech/cts/interactive/NfcUtils.java
new file mode 100644
index 0000000..3c0709c
--- /dev/null
+++ b/tests/tests/nfc/src/android/nfc/tech/cts/interactive/NfcUtils.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2024 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.nfc.tech.cts.interactive;
+
+import android.nfc.NdefMessage;
+import android.nfc.NdefRecord;
+
+import java.util.Arrays;
+
+/**
+ * Class with utility methods for testing equality of messages and displaying byte payloads
+ */
+public class NfcUtils {
+
+ /**
+ * Checks if contents of two NdefMessages are equal
+ * @param message - first message
+ * @param otherMessage - second message
+ * @return - if first message is equal to second message
+ */
+ public static boolean areMessagesEqual(NdefMessage message, NdefMessage otherMessage) {
+ return message != null && otherMessage != null
+ && areRecordArraysEqual(message.getRecords(), otherMessage.getRecords());
+ }
+
+ private static boolean areRecordArraysEqual(NdefRecord[] records, NdefRecord[] otherRecords) {
+ if (records.length == otherRecords.length) {
+ for (int i = 0; i < records.length; i++) {
+ if (!areRecordsEqual(records[i], otherRecords[i])) {
+ return false;
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private static boolean areRecordsEqual(NdefRecord record, NdefRecord otherRecord) {
+ return Arrays.equals(record.toByteArray(), otherRecord.toByteArray());
+ }
+
+ static CharSequence displayByteArray(byte[] bytes) {
+ StringBuilder builder = new StringBuilder().append("[");
+ for (int i = 0; i < bytes.length; i++) {
+ builder.append(Byte.toString(bytes[i]));
+ if (i + 1 < bytes.length) {
+ builder.append(", ");
+ }
+ }
+ return builder.append("]");
+ }
+}
diff --git a/tests/tests/nfc/src/android/nfc/tech/cts/interactive/TagTester.java b/tests/tests/nfc/src/android/nfc/tech/cts/interactive/TagTester.java
new file mode 100644
index 0000000..0e0f441
--- /dev/null
+++ b/tests/tests/nfc/src/android/nfc/tech/cts/interactive/TagTester.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 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.nfc.tech.cts.interactive;
+
+import android.nfc.Tag;
+
+/** Tag tester that writes data to the tag and returns a way to confirm a successful write. */
+public interface TagTester {
+
+ /** @return true if the tag is testable by this {@link TagTester} */
+ boolean isTestableTag(Tag tag);
+
+ /** Writes some data to the tag and returns a {@link TagVerifier} to confirm it. */
+ TagVerifier writeTag(Tag tag) throws Exception;
+}
diff --git a/tests/tests/nfc/src/android/nfc/tech/cts/interactive/TagVerifier.java b/tests/tests/nfc/src/android/nfc/tech/cts/interactive/TagVerifier.java
new file mode 100644
index 0000000..6563abe
--- /dev/null
+++ b/tests/tests/nfc/src/android/nfc/tech/cts/interactive/TagVerifier.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2024 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.nfc.tech.cts.interactive;
+
+
+import android.nfc.FormatException;
+import android.nfc.Tag;
+
+import java.io.IOException;
+
+/** Tag verifier for checking that the {@link Tag} has some expected value. */
+public interface TagVerifier {
+
+ /** @return true if the tag has the expected value */
+ Result verifyTag(Tag tag) throws FormatException, IOException;
+
+ /** Class with info necessary to show the user what was written and read from a tag. */
+ class Result {
+
+ private final CharSequence mExpectedContent;
+
+ private final CharSequence mActualContent;
+
+ private final boolean mIsMatch;
+
+ public Result(CharSequence expectedContent, CharSequence actualContent, boolean isMatch) {
+ this.mExpectedContent = expectedContent;
+ this.mActualContent = actualContent;
+ this.mIsMatch = isMatch;
+ }
+
+ /** @return {@link CharSequence} representation of the data written to the tag */
+ public CharSequence getExpectedContent() {
+ return mExpectedContent;
+ }
+
+ /** @return {@link CharSequence} representation of the data read back from the tag */
+ public CharSequence getActualContent() {
+ return mActualContent;
+ }
+
+ /** @return whether or not the expected content matched the actual content of the tag */
+ public boolean isMatch() {
+ return mIsMatch;
+ }
+ }
+}
diff --git a/tests/tests/notification/NotificationTrampolineBase/Android.bp b/tests/tests/notification/NotificationTrampolineBase/Android.bp
index 2af4fb0..ef8c84e 100644
--- a/tests/tests/notification/NotificationTrampolineBase/Android.bp
+++ b/tests/tests/notification/NotificationTrampolineBase/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/os/OWNERS b/tests/tests/os/OWNERS
index b06cdeb..e8aa841 100644
--- a/tests/tests/os/OWNERS
+++ b/tests/tests/os/OWNERS
@@ -6,9 +6,11 @@
per-file *NetworkTime* = file:platform/frameworks/base:/services/core/java/com/android/server/timezonedetector/OWNERS
per-file *Sntp* = file:platform/frameworks/base:/services/core/java/com/android/server/timezonedetector/OWNERS
per-file *LowPowerStandby* = file:platform/frameworks/base:/services/core/java/com/android/server/power/OWNERS
+per-file *SecurityStateManager* = file:platform/frameworks/base:/SECURITY_STATE_OWNERS
# Bug component: 826709 = per-file PerformanceHintManagerTest.java
+# Bug component: 826709 = per-file WorkDurationTest.java
# Bug component: 46788 = per-file PowerManager_ThermalTest.java
per-file *PerformanceHintManagerTest* = file:/platform/frameworks/base:/ADPF_OWNERS
per-file *PowerManager_ThermalTest* = xwxw@google.com,lpy@google.com,wvw@google.com
-
+per-file *WorkDurationTest* = file:/platform/frameworks/base:/ADPF_OWNERS
diff --git a/tests/tests/os/src/android/os/cts/BuildTest.java b/tests/tests/os/src/android/os/cts/BuildTest.java
index 61ad53b..3dcdd6b 100644
--- a/tests/tests/os/src/android/os/cts/BuildTest.java
+++ b/tests/tests/os/src/android/os/cts/BuildTest.java
@@ -16,9 +16,6 @@
package android.os.cts;
-import static android.os.Build.VERSION.ACTIVE_CODENAMES;
-import static android.os.Build.VERSION_CODES.CUR_DEVELOPMENT;
-
import android.os.Build;
import android.os.SystemProperties;
import android.platform.test.annotations.AppModeFull;
@@ -28,15 +25,12 @@
import junit.framework.TestCase;
import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.regex.Pattern;
-import java.util.stream.Collectors;
public class BuildTest extends TestCase {
@@ -261,66 +255,6 @@
}
/**
- * Tests that check for valid values of codenames related constants.
- */
- public void testBuildCodenameConstants() {
- // CUR_DEVELOPMENT must be larger than any released version.
- Field[] fields = Build.VERSION_CODES.class.getDeclaredFields();
- List<String> activeCodenames = Arrays.asList(ACTIVE_CODENAMES);
- // Make the codenames uppercase to match the field names.
- activeCodenames.replaceAll(String::toUpperCase);
- Set<String> knownCodenames = Build.VERSION.KNOWN_CODENAMES.stream()
- .map(String::toUpperCase)
- .collect(Collectors.toSet());
- HashSet<String> declaredCodenames = new HashSet<>();
- for (Field field : fields) {
- if (field.getType().equals(int.class) && Modifier.isStatic(field.getModifiers())) {
- String fieldName = field.getName();
- final int fieldValue;
- try {
- fieldValue = field.getInt(null);
- } catch (IllegalAccessException e) {
- throw new AssertionError(e.getMessage());
- }
- declaredCodenames.add(fieldName);
- if (fieldName.equals("CUR_DEVELOPMENT")) {
- // It should be okay to change the value of this constant in future, but it
- // should at least be a conscious decision.
- assertEquals(10000, fieldValue);
- } else {
- // Remove all underscores to match build level codenames, e.g. S_V2 is Sv2.
- String fieldNameWithoutUnderscores = fieldName.replaceAll("_", "");
- if (activeCodenames.contains(fieldNameWithoutUnderscores)) {
- // This is the current development version. Note that fieldName can
- // become < CUR_DEVELOPMENT before CODENAME becomes "REL", so we
- // can't assertEquals(CUR_DEVELOPMENT, fieldValue) here.
- assertTrue("Expected " + fieldName + " value to be <= " + CUR_DEVELOPMENT
- + ", got " + fieldValue, fieldValue <= CUR_DEVELOPMENT);
- } else {
- assertTrue("Expected " + fieldName + " value to be < " + CUR_DEVELOPMENT
- + ", got " + fieldValue, fieldValue < CUR_DEVELOPMENT);
- }
- declaredCodenames.add(fieldNameWithoutUnderscores);
- assertTrue("Expected " + fieldNameWithoutUnderscores
- + " to be declared in Build.VERSION.KNOWN_CODENAMES",
- knownCodenames.contains(fieldNameWithoutUnderscores));
- }
- }
- }
-
- HashSet<String> diff = new HashSet<>(knownCodenames);
- diff.removeAll(declaredCodenames);
- assertTrue(
- "Expected all elements in Build.VERSION.KNOWN_CODENAMES to be declared in"
- + " Build.VERSION_CODES, found " + diff, diff.isEmpty());
-
- if (!Build.VERSION.CODENAME.equals("REL")) {
- assertTrue("In-development CODENAME must be declared in Build.VERSION.KNOWN_CODENAMES",
- Build.VERSION.KNOWN_CODENAMES.contains(Build.VERSION.CODENAME));
- }
- }
-
- /**
* Verify that SDK versions are bounded by both high and low expected
* values.
*/
diff --git a/tests/tests/os/src/android/os/cts/OWNERS b/tests/tests/os/src/android/os/cts/OWNERS
new file mode 100644
index 0000000..2aeea0d
--- /dev/null
+++ b/tests/tests/os/src/android/os/cts/OWNERS
@@ -0,0 +1 @@
+per-file MessageQueueTest.java=mfasheh@google.com, shayba@google.com
diff --git a/tests/tests/os/src/android/os/cts/SecurityFeaturesTest.java b/tests/tests/os/src/android/os/cts/SecurityFeaturesTest.java
index 5958ad3..c7c98d9 100644
--- a/tests/tests/os/src/android/os/cts/SecurityFeaturesTest.java
+++ b/tests/tests/os/src/android/os/cts/SecurityFeaturesTest.java
@@ -19,6 +19,7 @@
import static android.system.OsConstants.PR_GET_DUMPABLE;
import android.os.Build;
+import android.os.SystemProperties;
import android.platform.test.annotations.AppModeFull;
import android.platform.test.annotations.RestrictedBuildTest;
import android.system.Os;
@@ -50,7 +51,7 @@
}
/**
- * Verifies that prctl(PR_GET_DUMPABLE) == ro.debuggable
+ * Verifies prctl(PR_GET_DUMPABLE)
*
* When PR_SET_DUMPABLE is 0, an application will not generate a
* coredump, and PTRACE_ATTACH is disallowed. It's a security best
@@ -61,8 +62,8 @@
* By default, PR_SET_DUMPABLE is 0 for zygote spawned apps, except
* in the following circumstances:
*
- * 1) ro.debuggable=1 (global debuggable enabled, i.e., userdebug or
- * eng builds).
+ * 1) eng build or userdebug build when one of property "persist.debug.ptrace.enabled"
+ * and "persist.debug.dalvik.vm.jdwp.enabled" is set.
*
* 2) android:debuggable="true" in the manifest for an individual
* application.
@@ -73,15 +74,16 @@
* <meta-data android:name="com.android.graphics.injectLayers.enable" android:value="true"/>
* in the application manifest.
*
- * For this test, neither #2, #3, nor #4 are true, so we expect ro.debuggable
- * to exactly equal prctl(PR_GET_DUMPABLE).
+ * For this test, neither #2, #3, nor #4 are true, so we only test #1.
*/
@AppModeFull(reason = "Instant apps cannot access APIs")
- @RestrictedBuildTest
public void testPrctlDumpable() throws Exception {
- boolean userBuild = "user".equals(Build.TYPE);
+ boolean userDebugBuild = "userdebug".equals(Build.TYPE);
+ boolean engBuild = "eng".equals(Build.TYPE);
+ boolean enablePtrace = SystemProperties.get("persist.debug.ptrace.enabled").equals("1");
+ boolean enableJDWP = SystemProperties.get("persist.debug.dalvik.vm.jdwp.enabled").equals("1");
int prctl_dumpable = Os.prctl(PR_GET_DUMPABLE, 0, 0, 0, 0);
- int expected = userBuild ? 0 : 1;
+ int expected = ((userDebugBuild && (enablePtrace || enableJDWP)) || engBuild) ? 1 : 0;
assertEquals(expected, prctl_dumpable);
}
}
diff --git a/tests/tests/packageinstaller/adminpackageinstaller/Android.bp b/tests/tests/packageinstaller/adminpackageinstaller/Android.bp
index 6cb9baf..5bd9c21 100644
--- a/tests/tests/packageinstaller/adminpackageinstaller/Android.bp
+++ b/tests/tests/packageinstaller/adminpackageinstaller/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/adminpackageinstaller/OWNERS b/tests/tests/packageinstaller/adminpackageinstaller/OWNERS
index 7455e48..5ebb1b1 100644
--- a/tests/tests/packageinstaller/adminpackageinstaller/OWNERS
+++ b/tests/tests/packageinstaller/adminpackageinstaller/OWNERS
@@ -1,4 +1,5 @@
# Bug component: 36137
-toddke@google.com
+include platform/frameworks/base:/PACKAGE_MANAGER_OWNERS
+
sunnygoyal@google.com
patb@google.com
diff --git a/tests/tests/packageinstaller/atomicinstall/Android.bp b/tests/tests/packageinstaller/atomicinstall/Android.bp
index 16292f7..3a5956d 100644
--- a/tests/tests/packageinstaller/atomicinstall/Android.bp
+++ b/tests/tests/packageinstaller/atomicinstall/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/contentprovider/Android.bp b/tests/tests/packageinstaller/contentprovider/Android.bp
index 4c7aff6..e4bce4cd 100644
--- a/tests/tests/packageinstaller/contentprovider/Android.bp
+++ b/tests/tests/packageinstaller/contentprovider/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/install/Android.bp b/tests/tests/packageinstaller/install/Android.bp
index 7b6a53b..a519375 100644
--- a/tests/tests/packageinstaller/install/Android.bp
+++ b/tests/tests/packageinstaller/install/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/install_appop_default/Android.bp b/tests/tests/packageinstaller/install_appop_default/Android.bp
index 8eb0e34..a0c5fdf 100644
--- a/tests/tests/packageinstaller/install_appop_default/Android.bp
+++ b/tests/tests/packageinstaller/install_appop_default/Android.bp
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/install_appop_denied/Android.bp b/tests/tests/packageinstaller/install_appop_denied/Android.bp
index 20e1ad4..738d5c0 100644
--- a/tests/tests/packageinstaller/install_appop_denied/Android.bp
+++ b/tests/tests/packageinstaller/install_appop_denied/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/nopermission/Android.bp b/tests/tests/packageinstaller/nopermission/Android.bp
index 3e5d914..35e80cb 100644
--- a/tests/tests/packageinstaller/nopermission/Android.bp
+++ b/tests/tests/packageinstaller/nopermission/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/nopermission25/Android.bp b/tests/tests/packageinstaller/nopermission25/Android.bp
index ab2aed3..0ed6d99 100644
--- a/tests/tests/packageinstaller/nopermission25/Android.bp
+++ b/tests/tests/packageinstaller/nopermission25/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/packagescheme/Android.bp b/tests/tests/packageinstaller/packagescheme/Android.bp
index c5cee92..13633b2 100644
--- a/tests/tests/packageinstaller/packagescheme/Android.bp
+++ b/tests/tests/packageinstaller/packagescheme/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/packagescheme/src/android/packageinstaller/packagescheme/cts/PackageSchemeTestBase.kt b/tests/tests/packageinstaller/packagescheme/src/android/packageinstaller/packagescheme/cts/PackageSchemeTestBase.kt
index 9686c6d..09f64f3 100644
--- a/tests/tests/packageinstaller/packagescheme/src/android/packageinstaller/packagescheme/cts/PackageSchemeTestBase.kt
+++ b/tests/tests/packageinstaller/packagescheme/src/android/packageinstaller/packagescheme/cts/PackageSchemeTestBase.kt
@@ -33,6 +33,8 @@
import androidx.test.uiautomator.BySelector
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.UiObject2
+import androidx.test.uiautomator.UiScrollable
+import androidx.test.uiautomator.UiSelector
import androidx.test.uiautomator.Until
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
@@ -144,8 +146,14 @@
var latch: CountDownLatch? = null
mScenario = ActivityScenario.launch(intent)
mScenario!!.onActivity {
- val button: UiObject2?
+ var button: UiObject2?
val btnName: String
+ // Need to scroll the screen to get to the buttons on some form factors
+ // (e.g. on a watch).
+ val scrollable = UiScrollable(UiSelector().scrollable(true))
+ if (scrollable.exists()) {
+ scrollable.flingToEnd(10)
+ }
if (packageHasVisibility && needTargetApp) {
button = mUiDevice.wait(
Until.findObject(getBySelector(NEGATIVE_BTN_ID)), DEFAULT_TIMEOUT)
@@ -156,7 +164,7 @@
btnName = "OK"
}
assertWithMessage("$btnName not found").that(button).isNotNull()
- button.click()
+ button?.click()
latch = it.mLatch
}
latch!!.await()
diff --git a/tests/tests/packageinstaller/tapjacking/Android.bp b/tests/tests/packageinstaller/tapjacking/Android.bp
index 570b2ea..91f1744 100644
--- a/tests/tests/packageinstaller/tapjacking/Android.bp
+++ b/tests/tests/packageinstaller/tapjacking/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/tapjacking/AndroidTest.xml b/tests/tests/packageinstaller/tapjacking/AndroidTest.xml
index 4b11f12..e23e25a 100644
--- a/tests/tests/packageinstaller/tapjacking/AndroidTest.xml
+++ b/tests/tests/packageinstaller/tapjacking/AndroidTest.xml
@@ -31,6 +31,13 @@
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
<option name="run-command" value="appops set android.packageinstaller.tapjacking.cts REQUEST_INSTALL_PACKAGES allow" />
<option name="teardown-command" value="appops set android.packageinstaller.tapjacking.cts REQUEST_INSTALL_PACKAGES default" />
+ <!-- Ensure the UI is ready and in an idle state before running tests -->
+ <option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
+ <option name="run-command" value="wm dismiss-keyguard" />
+ <!-- Collapse notifications -->
+ <option name="run-command" value="cmd statusbar collapse" />
+ <!-- dismiss all system dialogs before launch test -->
+ <option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS" />
</target_preparer>
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
diff --git a/tests/tests/packageinstaller/tapjacking/res/layout/overlay_activity.xml b/tests/tests/packageinstaller/tapjacking/res/layout/overlay_activity.xml
index 2f91bab..f01ceb1 100644
--- a/tests/tests/packageinstaller/tapjacking/res/layout/overlay_activity.xml
+++ b/tests/tests/packageinstaller/tapjacking/res/layout/overlay_activity.xml
@@ -19,7 +19,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/border"
- android:padding="8dp" >
+ android:padding="48dp" >
<TextView android:id="@+id/overlay_description"
android:layout_width="wrap_content"
diff --git a/tests/tests/packageinstaller/tapjacking/src/android/packageinstaller/tapjacking/cts/TapjackingTest.java b/tests/tests/packageinstaller/tapjacking/src/android/packageinstaller/tapjacking/cts/TapjackingTest.java
index 9b2ffce..486b635 100644
--- a/tests/tests/packageinstaller/tapjacking/src/android/packageinstaller/tapjacking/cts/TapjackingTest.java
+++ b/tests/tests/packageinstaller/tapjacking/src/android/packageinstaller/tapjacking/cts/TapjackingTest.java
@@ -17,6 +17,7 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import android.app.Activity;
import android.content.Context;
@@ -24,20 +25,21 @@
import android.net.Uri;
import android.os.Bundle;
import android.platform.test.annotations.AppModeFull;
-import android.support.test.uiautomator.By;
-import android.support.test.uiautomator.BySelector;
-import android.support.test.uiautomator.UiDevice;
-import android.support.test.uiautomator.UiObject2;
-import android.support.test.uiautomator.Until;
import android.util.Log;
import androidx.test.InstrumentationRegistry;
import androidx.test.core.app.ActivityScenario;
import androidx.test.filters.MediumTest;
import androidx.test.runner.AndroidJUnit4;
+import androidx.test.uiautomator.By;
+import androidx.test.uiautomator.BySelector;
+import androidx.test.uiautomator.UiDevice;
+import androidx.test.uiautomator.UiObject2;
+import androidx.test.uiautomator.Until;
import java.util.regex.Pattern;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -107,21 +109,60 @@
public void testTapsDroppedWhenObscured() throws Exception {
Log.i(LOG_TAG, "launchPackageInstaller");
launchPackageInstaller();
+
UiObject2 installButton = waitForButton(INSTALL_BUTTON_ID);
assertNotNull("Install button not shown", installButton);
+
Log.i(LOG_TAG, "launchOverlayingActivity");
launchOverlayingActivity();
assertNotNull("Overlaying activity not started",
waitForView(mPackageName, OVERLAY_ACTIVITY_TEXT_VIEW_ID));
+
installButton = waitForButton(INSTALL_BUTTON_ID);
- assertNotNull("Cannot find install button below overlay activity", installButton);
- Log.i(LOG_TAG, "installButton.click");
- installButton.click();
- assertFalse("Tap on install button succeeded", mUiDevice.wait(
- Until.gone(getBySelector(INSTALL_BUTTON_ID)),WAIT_FOR_UI_TIMEOUT));
+ if (installButton != null) {
+ Log.i(LOG_TAG, "installButton.click");
+ installButton.click();
+ assertFalse("Tap on install button succeeded", mUiDevice.wait(
+ Until.gone(getBySelector(INSTALL_BUTTON_ID)), WAIT_FOR_UI_TIMEOUT));
+ }
+
mUiDevice.pressBack();
}
+ @Test
+ @Ignore("b/322018861")
+ public void testTapsWhenNotObscured() throws Exception {
+ Log.i(LOG_TAG, "launchPackageInstaller");
+ launchPackageInstaller();
+
+ UiObject2 installButton = waitForButton(INSTALL_BUTTON_ID);
+ assertNotNull("Install button not shown", installButton);
+
+ Log.i(LOG_TAG, "launchOverlayingActivity");
+ launchOverlayingActivity();
+ assertNotNull("Overlaying activity not started",
+ waitForView(mPackageName, OVERLAY_ACTIVITY_TEXT_VIEW_ID));
+
+ installButton = waitForButton(INSTALL_BUTTON_ID);
+ if (installButton != null) {
+ Log.i(LOG_TAG, "installButton.click");
+ installButton.click();
+ assertFalse("Tap on install button succeeded", mUiDevice.wait(
+ Until.gone(getBySelector(INSTALL_BUTTON_ID)), WAIT_FOR_UI_TIMEOUT));
+ }
+
+ mUiDevice.pressBack();
+
+ // Overlay should be gone and we require that the button can be found.
+ installButton = waitForButton(INSTALL_BUTTON_ID);
+ assertNotNull("Cannot find install button", installButton);
+
+ Log.i(LOG_TAG, "installButton.click after overlay removed");
+ installButton.click();
+ assertTrue("Tap on install button failed", mUiDevice.wait(
+ Until.gone(getBySelector(INSTALL_BUTTON_ID)), WAIT_FOR_UI_TIMEOUT));
+ }
+
@After
public void tearDown() throws Exception {
mUiDevice.pressHome();
diff --git a/tests/tests/packageinstaller/test-apps/SelfUninstallingTestApp/Android.bp b/tests/tests/packageinstaller/test-apps/SelfUninstallingTestApp/Android.bp
index e501c90..3d613a3 100644
--- a/tests/tests/packageinstaller/test-apps/SelfUninstallingTestApp/Android.bp
+++ b/tests/tests/packageinstaller/test-apps/SelfUninstallingTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/test-apps/contentprovider/Android.bp b/tests/tests/packageinstaller/test-apps/contentprovider/Android.bp
index 37c828e..13a0b70 100644
--- a/tests/tests/packageinstaller/test-apps/contentprovider/Android.bp
+++ b/tests/tests/packageinstaller/test-apps/contentprovider/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/test-apps/emptyinstaller/Android.bp b/tests/tests/packageinstaller/test-apps/emptyinstaller/Android.bp
index ec93f7e..48bf7f8 100644
--- a/tests/tests/packageinstaller/test-apps/emptyinstaller/Android.bp
+++ b/tests/tests/packageinstaller/test-apps/emptyinstaller/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/test-apps/emptytestapp/Android.bp b/tests/tests/packageinstaller/test-apps/emptytestapp/Android.bp
index a395f1f..5eafbe9 100644
--- a/tests/tests/packageinstaller/test-apps/emptytestapp/Android.bp
+++ b/tests/tests/packageinstaller/test-apps/emptytestapp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/uninstall/Android.bp b/tests/tests/packageinstaller/uninstall/Android.bp
index 8b26e33..40b8aa0 100644
--- a/tests/tests/packageinstaller/uninstall/Android.bp
+++ b/tests/tests/packageinstaller/uninstall/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/packageinstaller/uninstall/AndroidTest.xml b/tests/tests/packageinstaller/uninstall/AndroidTest.xml
index 021ec19..b4e2b0a 100644
--- a/tests/tests/packageinstaller/uninstall/AndroidTest.xml
+++ b/tests/tests/packageinstaller/uninstall/AndroidTest.xml
@@ -37,6 +37,13 @@
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
<option name="run-command" value="mkdir -p /data/local/tmp/cts/uninstall" />
<option name="teardown-command" value="rm -rf /data/local/tmp/cts"/>
+ <!-- Ensure the UI is ready and in an idle state before running tests -->
+ <option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
+ <option name="run-command" value="wm dismiss-keyguard" />
+ <!-- Collapse notifications -->
+ <option name="run-command" value="cmd statusbar collapse" />
+ <!-- dismiss all system dialogs before launch test -->
+ <option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS" />
</target_preparer>
<!-- Load additional APKs onto device -->
diff --git a/tests/tests/permission/src/android/permission/cts/UndefinedGroupPermissionTest.kt b/tests/tests/permission/src/android/permission/cts/UndefinedGroupPermissionTest.kt
index 5f0e157..ec5c913 100644
--- a/tests/tests/permission/src/android/permission/cts/UndefinedGroupPermissionTest.kt
+++ b/tests/tests/permission/src/android/permission/cts/UndefinedGroupPermissionTest.kt
@@ -30,6 +30,7 @@
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.UiObject2
import androidx.test.uiautomator.UiObjectNotFoundException
+import com.android.compatibility.common.util.FeatureUtil
import com.android.compatibility.common.util.SystemUtil
import com.android.compatibility.common.util.SystemUtil.eventually
import com.android.compatibility.common.util.UiAutomatorUtils2.waitFindObject
@@ -135,8 +136,7 @@
}
fun findAllowButton(): UiObject2 {
- return if (mContext?.packageManager
- ?.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE) == true) {
+ return if (FeatureUtil.isAutomotive() || FeatureUtil.isWatch()) {
waitFindObject(By.text(mAllowButtonText!!), 2000)
} else {
waitFindObject(By.res(
@@ -163,8 +163,7 @@
startRequestActivity(arrayOf(targetPermission))
mUiDevice!!.waitForIdle()
try {
- if (mContext?.packageManager
- ?.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE) == true) {
+ if (FeatureUtil.isAutomotive() || FeatureUtil.isWatch()) {
waitFindObject(By.text(mDenyButtonText!!), 2000)
} else {
waitFindObject(By.res("com.android.permissioncontroller:id/grant_dialog"), 2000)
diff --git a/tests/tests/permission3/AppThatAccessesCameraAndMic/src/android/permission3/cts/appthataccessescameraandmic/AccessCameraOrMicActivity.kt b/tests/tests/permission3/AppThatAccessesCameraAndMic/src/android/permission3/cts/appthataccessescameraandmic/AccessCameraOrMicActivity.kt
index 885d3e4..04c3631 100644
--- a/tests/tests/permission3/AppThatAccessesCameraAndMic/src/android/permission3/cts/appthataccessescameraandmic/AccessCameraOrMicActivity.kt
+++ b/tests/tests/permission3/AppThatAccessesCameraAndMic/src/android/permission3/cts/appthataccessescameraandmic/AccessCameraOrMicActivity.kt
@@ -18,6 +18,7 @@
import android.app.Activity
import android.app.AppOpsManager
+import android.content.pm.PackageManager
import android.hardware.camera2.CameraAccessException
import android.hardware.camera2.CameraCaptureSession
import android.hardware.camera2.CameraCharacteristics
@@ -34,6 +35,7 @@
import android.os.Process
import android.util.Log
import android.util.Size
+import android.view.WindowManager
import androidx.annotation.NonNull
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
@@ -64,6 +66,7 @@
private var hotwordFinished = false
private var runHotword = false
private var finishEarly = false
+ private var isWatch = false
override fun onStart() {
super.onStart()
@@ -71,6 +74,7 @@
runMic = intent.getBooleanExtra(USE_MICROPHONE, false)
runHotword = intent.getBooleanExtra(USE_HOTWORD, false)
finishEarly = intent.getBooleanExtra(FINISH_EARLY, false)
+ isWatch = packageManager.hasSystemFeature(PackageManager.FEATURE_WATCH)
if (runMic) {
useMic()
@@ -83,6 +87,17 @@
if (runHotword) {
useHotword()
}
+
+ if (isWatch) {
+ // Make it possible for uiautomator to find the microphone icon
+ // The icon is shown on the home screen so it is hidden behind the activity unless the
+ // activity is set to translucent.
+ getWindow().setFlags(
+ WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
+ WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL)
+ setTranslucent(true)
+ getWindow().setLayout(100, 100)
+ }
}
override fun finish() {
diff --git a/tests/tests/permission3/src/android/permission3/cts/BasePermissionTest.kt b/tests/tests/permission3/src/android/permission3/cts/BasePermissionTest.kt
index 5533063..59cd528 100644
--- a/tests/tests/permission3/src/android/permission3/cts/BasePermissionTest.kt
+++ b/tests/tests/permission3/src/android/permission3/cts/BasePermissionTest.kt
@@ -104,6 +104,11 @@
@JvmStatic
protected val isAutomotive =
packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
+ @JvmStatic
+ protected val isAutomotiveSplitscreen = isAutomotive &&
+ packageManager.hasSystemFeature(
+ /* PackageManager.FEATURE_CAR_SPLITSCREEN_MULTITASKING */
+ "android.software.car.splitscreen_multitasking")
}
@get:Rule
diff --git a/tests/tests/permission3/src/android/permission3/cts/BaseUsePermissionTest.kt b/tests/tests/permission3/src/android/permission3/cts/BaseUsePermissionTest.kt
index 571ba47..4507b0c 100644
--- a/tests/tests/permission3/src/android/permission3/cts/BaseUsePermissionTest.kt
+++ b/tests/tests/permission3/src/android/permission3/cts/BaseUsePermissionTest.kt
@@ -138,6 +138,7 @@
const val NO_UPGRADE_AND_DONT_ASK_AGAIN_BUTTON_TEXT = "grant_dialog_button_no_upgrade"
const val ALERT_DIALOG_MESSAGE = "android:id/message"
const val ALERT_DIALOG_OK_BUTTON = "android:id/button1"
+ const val ALERT_DIALOG_DESC_CONFIRM = "confirm"
const val APP_PERMISSION_RATIONALE_CONTAINER_VIEW =
"com.android.permissioncontroller:id/app_permission_rationale_container"
const val APP_PERMISSION_RATIONALE_CONTENT_VIEW =
@@ -531,7 +532,12 @@
// Clear the low target SDK warning message if it's expected
if (getTargetSdk() <= MAX_SDK_FOR_SDK_WARNING) {
- clearTargetSdkWarning(timeoutMillis = QUICK_CHECK_TIMEOUT_MILLIS)
+ if (isWatch) {
+ // Warning takes longer to clear on watch
+ clearTargetSdkWarning()
+ } else {
+ clearTargetSdkWarning(timeoutMillis = QUICK_CHECK_TIMEOUT_MILLIS)
+ }
waitForIdle()
}
@@ -579,7 +585,7 @@
)
protected fun clickPermissionRequestAllowButton(timeoutMillis: Long = 20000) {
- if (isAutomotive) {
+ if (isAutomotive || isWatch) {
click(By.text(getPermissionControllerString(ALLOW_BUTTON_TEXT)), timeoutMillis)
} else {
click(By.res(ALLOW_BUTTON), timeoutMillis)
@@ -637,7 +643,7 @@
}
protected fun clickPermissionRequestAllowForegroundButton(timeoutMillis: Long = 10_000) {
- if (isAutomotive) {
+ if (isAutomotive || isWatch) {
click(By.text(
getPermissionControllerString(ALLOW_FOREGROUND_BUTTON_TEXT)), timeoutMillis)
} else {
@@ -957,7 +963,13 @@
targetSdk <= Build.VERSION_CODES.S_V2 &&
permission in MEDIA_PERMISSIONS
if (shouldShowStorageWarning) {
- click(By.res(ALERT_DIALOG_OK_BUTTON))
+ if (isWatch) {
+ val confirmPattern = Pattern.compile(Pattern.quote(ALERT_DIALOG_DESC_CONFIRM),
+ Pattern.CASE_INSENSITIVE or Pattern.UNICODE_CASE)
+ click(By.desc(confirmPattern))
+ } else {
+ click(By.res(ALERT_DIALOG_OK_BUTTON))
+ }
} else if (!alreadyChecked && isLegacyApp && wasGranted) {
if (!isTv) {
// Wait for alert dialog to popup, then scroll to the bottom of it
@@ -973,8 +985,7 @@
// Due to the limited real estate, Wear uses buttons with icons instead of text
// for dialogs
if (isWatch) {
- click(By.res(
- "com.android.permissioncontroller:id/wear_alertdialog_positive_button"))
+ click(By.desc(getPermissionControllerString("ok")))
} else {
val resources = context.createPackageContext(
packageManager.permissionControllerPackageName, 0
diff --git a/tests/tests/permission3/src/android/permission3/cts/CameraMicIndicatorsPermissionTest.kt b/tests/tests/permission3/src/android/permission3/cts/CameraMicIndicatorsPermissionTest.kt
index 3d52a69..f496062 100644
--- a/tests/tests/permission3/src/android/permission3/cts/CameraMicIndicatorsPermissionTest.kt
+++ b/tests/tests/permission3/src/android/permission3/cts/CameraMicIndicatorsPermissionTest.kt
@@ -79,6 +79,7 @@
private const val PRIVACY_CHIP_ID = "com.android.systemui:id/privacy_chip"
private const val PRIVACY_ITEM_ID = "com.android.systemui:id/privacy_item"
private const val INDICATORS_FLAG = "camera_mic_icons_enabled"
+private const val WEAR_MIC_LABEL = "Microphone"
private const val PERMISSION_INDICATORS_NOT_PRESENT = 162547999L
private const val IDLE_TIMEOUT_MILLIS: Long = 1000
private const val UNEXPECTED_TIMEOUT_MILLIS = 1000
@@ -101,6 +102,7 @@
private val isTv = packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
private val isCar = packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
+ private val isWatch = packageManager.hasSystemFeature(PackageManager.FEATURE_WATCH)
private val safetyCenterMicLabel = getPermissionControllerString(MIC_LABEL_NAME)
private val safetyCenterCameraLabel = getPermissionControllerString(CAMERA_LABEL_NAME)
private val originalCameraLabel = packageManager.getPermissionGroupInfo(
@@ -336,7 +338,14 @@
openApp(useMic, useCamera, useHotword, finishEarly)
try {
eventually {
- val appView = uiDevice.findObject(UiSelector().textContains(APP_LABEL))
+ val appView =
+ if (isWatch) {
+ // Title is disabled by default on watch apps
+ uiDevice.findObject(UiSelector().packageName(APP_PKG))
+ } else {
+ uiDevice.findObject(UiSelector().textContains(APP_LABEL))
+ }
+
assertTrue("View with text $APP_LABEL not found", appView.exists())
}
if (chainUsage) {
@@ -348,7 +357,7 @@
}
}
- if (!isTv && !isCar) {
+ if (!isTv && !isCar && !isWatch) {
uiDevice.openQuickSettings()
}
assertIndicatorsShown(useMic, useCamera, useHotword, chainUsage,
@@ -385,6 +394,8 @@
assertTvIndicatorsShown(useMic, useCamera, useHotword)
} else if (isCar) {
assertCarIndicatorsShown(useMic, useCamera, useHotword, chainUsage)
+ } else if (isWatch) {
+ assertWatchIndicatorsShown(useMic, useCamera, useHotword)
} else {
val micInUse = if (SdkLevel.isAtLeastU() && HOTWORD_DETECTION_SERVICE_REQUIRED) {
useMic || useHotword
@@ -396,6 +407,23 @@
}
}
+ private fun assertWatchIndicatorsShown(
+ useMic: Boolean,
+ useCamera: Boolean,
+ useHotword: Boolean
+ ) {
+ if (useMic || useHotword || (!useMic && !useCamera && !useHotword)) {
+ val iconView = UiAutomatorUtils2.waitFindObjectOrNull(By.descContains(WEAR_MIC_LABEL))
+ if (useMic) {
+ assertNotNull("Did not find mic chip", iconView)
+ } else {
+ assertNull("Found mic chip, but did not expect to", iconView)
+ // waitFindObject leaves the watch on the notification screen
+ pressBack()
+ }
+ }
+ }
+
private fun assertTvIndicatorsShown(useMic: Boolean, useCamera: Boolean, useHotword: Boolean) {
if (useMic || useHotword || (!useMic && !useCamera && !useHotword)) {
val found = WindowManagerStateHelper()
diff --git a/tests/tests/permission3/src/android/permission3/cts/NotificationPermissionTest.kt b/tests/tests/permission3/src/android/permission3/cts/NotificationPermissionTest.kt
index ec72411..b9a6641 100644
--- a/tests/tests/permission3/src/android/permission3/cts/NotificationPermissionTest.kt
+++ b/tests/tests/permission3/src/android/permission3/cts/NotificationPermissionTest.kt
@@ -193,7 +193,7 @@
fun notificationPromptShownForSubsequentStartsIfTaskStartWasLauncher() {
installPackage(APP_APK_PATH_CREATE_NOTIFICATION_CHANNELS_31, expectSuccess = true)
launchApp(startSecondActivity = true)
- if (isAutomotive) {
+ if (isAutomotive || isWatch) {
waitFindObject(By.text(getPermissionControllerString(ALLOW_BUTTON_TEXT)))
} else {
waitFindObject(By.res(ALLOW_BUTTON))
diff --git a/tests/tests/permission3/src/android/permission3/cts/PermissionTapjackingTest.kt b/tests/tests/permission3/src/android/permission3/cts/PermissionTapjackingTest.kt
index fadaa27..73fe137 100644
--- a/tests/tests/permission3/src/android/permission3/cts/PermissionTapjackingTest.kt
+++ b/tests/tests/permission3/src/android/permission3/cts/PermissionTapjackingTest.kt
@@ -43,6 +43,9 @@
// PermissionController for television uses a floating window.
assumeFalse(isTv)
+ // Automotive split-screen multitasking uses multi-window mode
+ assumeFalse(isAutomotiveSplitscreen)
+
assertAppHasPermission(ACCESS_FINE_LOCATION, false)
requestAppPermissionsForNoResult(ACCESS_FINE_LOCATION) {}
@@ -63,6 +66,9 @@
// PermissionController for television uses a floating window.
assumeFalse(isTv)
+ // Automotive split-screen multitasking uses multi-window mode
+ assumeFalse(isAutomotiveSplitscreen)
+
assertAppHasPermission(ACCESS_FINE_LOCATION, false)
requestAppPermissionsForNoResult(ACCESS_FINE_LOCATION) {}
diff --git a/tests/tests/permissionpolicy/res/raw/android_manifest.xml b/tests/tests/permissionpolicy/res/raw/android_manifest.xml
index 45e16fe..b5da915 100644
--- a/tests/tests/permissionpolicy/res/raw/android_manifest.xml
+++ b/tests/tests/permissionpolicy/res/raw/android_manifest.xml
@@ -1628,6 +1628,15 @@
android:description="@string/permdesc_cameraOpenCloseListener"
android:protectionLevel="signature" />
+ <!-- @SystemApi Allows camera access by Headless System User 0 when device is running in
+ HSUM Mode.
+ @hide -->
+ <permission android:name="android.permission.CAMERA_HEADLESS_SYSTEM_USER"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_cameraHeadlessSystemUser"
+ android:description="@string/permdesc_cameraHeadlessSystemUser"
+ android:protectionLevel="signature" />
+
<!-- ====================================================================== -->
<!-- Permissions for accessing the device sensors -->
<!-- ====================================================================== -->
@@ -2276,7 +2285,16 @@
@hide
-->
<permission android:name="android.permission.SUSPEND_APPS"
- android:protectionLevel="signature|role" />
+ android:protectionLevel="signature|role|verifier" />
+
+ <!-- @SystemApi
+ @hide
+ @FlaggedApi("android.content.pm.quarantined_enabled")
+ Allows an application to quarantine other apps, which will prevent
+ them from running without explicit user action.
+ -->
+ <permission android:name="android.permission.QUARANTINE_APPS"
+ android:protectionLevel="signature|verifier" />
<!-- Allows applications to discover and pair bluetooth devices.
<p>Protection level: normal
@@ -2851,6 +2869,16 @@
<permission android:name="android.permission.MANAGE_SENSORS"
android:protectionLevel="signature" />
+ <!-- Must be required by a DomainSelectionService to ensure that only the
+ system can bind to it.
+ <p>Protection level: signature
+ @SystemApi
+ @hide
+ @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service")
+ -->
+ <permission android:name="android.permission.BIND_DOMAIN_SELECTION_SERVICE"
+ android:protectionLevel="signature" />
+
<!-- Must be required by an ImsService to ensure that only the
system can bind to it.
<p>Protection level: signature|privileged|vendorPrivileged
@@ -2920,6 +2948,17 @@
<permission android:name="android.permission.ACCESS_RCS_USER_CAPABILITY_EXCHANGE"
android:protectionLevel="internal|role" />
+ <!-- Used to provide the Telecom framework with access to the last known call ID.
+ <p>Protection level: signature
+ @SystemApi
+ @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies")
+ @hide
+ -->
+ <permission android:name="android.permission.ACCESS_LAST_KNOWN_CELL_ID"
+ android:protectionLevel="signature"
+ android:label="@string/permlab_accessLastKnownCellId"
+ android:description="@string/permdesc_accessLastKnownCellId"/>
+
<!-- ================================== -->
<!-- Permissions for sdcard interaction -->
<!-- ================================== -->
@@ -3038,7 +3077,7 @@
types of interactions
@hide -->
<permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"
- android:protectionLevel="signature|installer|role" />
+ android:protectionLevel="signature|installer|module|role" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<!-- Allows interaction across profiles in the same profile group. -->
@@ -3426,6 +3465,13 @@
<permission android:name="android.permission.MANAGE_DEVICE_POLICY_NEARBY_COMMUNICATION"
android:protectionLevel="internal|role" />
+ <!-- Allows an application to set policy related to <a
+ href="https://www.threadgroup.org">Thread</a> network.
+ @FlaggedApi("com.android.net.thread.flags.thread_user_restriction_enabled")
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_THREAD_NETWORK"
+ android:protectionLevel="internal|role" />
+
<!-- Allows an application to set policy related to windows.
<p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
required to call APIs protected by this permission on users different to the calling user.
@@ -3625,6 +3671,13 @@
<permission android:name="android.permission.MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL"
android:protectionLevel="internal|role" />
+ <!-- Allows an application to access EnhancedConfirmationManager.
+ @SystemApi
+ @FlaggedApi("android.permission.flags.enhanced_confirmation_mode_apis_enabled")
+ @hide This is not a third-party API (intended for OEMs and system apps). -->
+ <permission android:name="android.permission.MANAGE_ENHANCED_CONFIRMATION_STATES"
+ android:protectionLevel="signature|installer" />
+
<!-- @SystemApi @hide Allows an application to set a device owner on retail demo devices.-->
<permission android:name="android.permission.PROVISION_DEMO_DEVICE"
android:protectionLevel="signature|setup|knownSigner"
@@ -3960,6 +4013,13 @@
<permission android:name="android.permission.READ_WALLPAPER_INTERNAL"
android:protectionLevel="signature|privileged" />
+ <!-- Allow apps to always update wallpaper by sending data.
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.ALWAYS_UPDATE_WALLPAPER"
+ android:protectionLevel="internal|role" />
+
<!-- ===================================================== -->
<!-- Permissions for changing the system clock / time zone -->
<!-- ===================================================== -->
@@ -4410,6 +4470,10 @@
<permission android:name="android.permission.READ_LOGS"
android:protectionLevel="signature|privileged|development" />
+ <!-- Allows an application to access the data in Dropbox-->
+ <permission android:name="android.permission.READ_DROPBOX_DATA"
+ android:protectionLevel="signature|privileged|development" />
+
<!-- Configure an application for debugging.
<p>Not for use by third-party applications. -->
<permission android:name="android.permission.SET_DEBUG_APP"
@@ -4497,7 +4561,7 @@
@hide
@SystemApi -->
<permission android:name="android.permission.STATUS_BAR_SERVICE"
- android:protectionLevel="signature" />
+ android:protectionLevel="signature|recents" />
<!-- Allows an application to bind to third party quick settings tiles.
<p>Should only be requested by the System, should be required by
@@ -4561,7 +4625,7 @@
@hide
-->
<permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW"
- android:protectionLevel="signature|module" />
+ android:protectionLevel="signature|module|recents" />
<!-- Allows an application to avoid all toast rate limiting restrictions.
<p>Not for use by third-party applications.
@@ -4754,7 +4818,7 @@
<p>Protection level: signature
-->
<permission android:name="android.permission.BIND_NFC_SERVICE"
- android:protectionLevel="signature" />
+ android:protectionLevel="signature|module" />
<!-- Must be required by a {@link android.service.quickaccesswallet.QuickAccessWalletService}
to ensure that only the system can bind to it.
@@ -4896,7 +4960,7 @@
<p>Intended for use by ROLE_ASSISTANT and signature apps only.
-->
<permission android:name="android.permission.SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE"
- android:protectionLevel="signature|role"/>
+ android:protectionLevel="signature|module|role"/>
<!-- Must be required by a {@link android.service.credentials.CredentialProviderService},
to ensure that only the system can bind to it.
@@ -5041,6 +5105,14 @@
<permission android:name="android.permission.BIND_REMOTE_DISPLAY"
android:protectionLevel="signature" />
+ <!-- Must be required by a android.media.tv.ad.TvAdService to ensure that only the system can
+ bind to it.
+ <p>Protection level: signature|privileged
+ @FlaggedApi("android.media.tv.flags.enable_ad_service_fw")
+ -->
+ <permission android:name="android.permission.BIND_TV_AD_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
<!-- Must be required by a {@link android.media.tv.TvInputService}
to ensure that only the system can bind to it.
<p>Protection level: signature|privileged
@@ -5203,6 +5275,13 @@
<permission android:name="android.permission.MONITOR_KEYBOARD_BACKLIGHT"
android:protectionLevel="signature" />
+ <!-- Allows low-level access to monitor sticky modifier state changes when A11Y Sticky keys
+ feature is enabled.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.MONITOR_STICKY_MODIFIER_STATE"
+ android:protectionLevel="signature" />
+
<!-- Allows an app to schedule a prioritized alarm that can be used to perform
background work even when the device is in doze.
<p>Not for use by third-party applications.
@@ -5419,6 +5498,12 @@
<permission android:name="android.permission.GRANT_RUNTIME_PERMISSIONS"
android:protectionLevel="signature|installer|verifier" />
+ <!-- @SystemApi Allows an application to launch the settings page which manages various
+ permissions.
+ @hide -->
+ <permission android:name="android.permission.LAUNCH_PERMISSION_SETTINGS"
+ android:protectionLevel="signature|privileged" />
+
<!-- @SystemApi Allows an app that has this permission and the permissions to install packages
to request certain runtime permissions to be granted at installation.
@hide -->
@@ -5482,7 +5567,7 @@
<!-- @SystemApi Allows an application to manage the holders of a role.
@hide -->
<permission android:name="android.permission.MANAGE_ROLE_HOLDERS"
- android:protectionLevel="signature|installer" />
+ android:protectionLevel="signature|installer|module" />
<!-- @SystemApi Allows an application to manage the holders of roles associated with default
applications.
@@ -5502,7 +5587,7 @@
<!-- @SystemApi Allows an application to observe role holder changes.
@hide -->
<permission android:name="android.permission.OBSERVE_ROLE_HOLDERS"
- android:protectionLevel="signature|installer" />
+ android:protectionLevel="signature|installer|module" />
<!-- Allows an application to manage the companion devices.
@hide -->
@@ -5515,6 +5600,14 @@
<permission android:name="android.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE"
android:protectionLevel="normal" />
+ <!-- Allows an application to subscribe to notifications about the nearby devices' presence
+ status change base on the UUIDs.
+ <p>Not for use by third-party applications.</p>
+ @FlaggedApi("android.companion.flags.device_presence")
+ -->
+ <permission android:name="android.permission.REQUEST_OBSERVE_DEVICE_UUID_PRESENCE"
+ android:protectionLevel="signature|privileged" />
+
<!-- Allows an application to deliver companion messages to system
-->
<permission android:name="android.permission.DELIVER_COMPANION_MESSAGES"
@@ -5523,7 +5616,7 @@
<!-- @SystemApi Allows an application to send and receive messages via CDM transports.
@hide -->
<permission android:name="android.permission.USE_COMPANION_TRANSPORTS"
- android:protectionLevel="signature|module" />
+ android:protectionLevel="signature" />
<!-- Allows an application to create new companion device associations.
@SystemApi
@@ -5819,6 +5912,13 @@
<permission android:name="android.permission.MEDIA_CONTENT_CONTROL"
android:protectionLevel="signature|privileged" />
+ <!-- Allows an application to control the routing of media apps.
+ <p>Only for use by role COMPANION_DEVICE_WATCH</p>
+ @FlaggedApi("com.android.media.flags.enable_privileged_routing_for_media_routing_control")
+ -->
+ <permission android:name="android.permission.MEDIA_ROUTING_CONTROL"
+ android:protectionLevel="signature|appop" />
+
<!-- @SystemApi @hide Allows an application to set the volume key long-press listener.
<p>When it's set, the application will receive the volume key long-press event
instead of changing volume.</p>
@@ -5967,6 +6067,12 @@
android:protectionLevel="signature|privileged|development|appop|retailDemo" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
+ <!-- @SystemApi @hide
+ @FlaggedApi("android.app.usage.report_usage_stats_permission")
+ Allows trusted system components to report events to UsageStatsManager -->
+ <permission android:name="android.permission.REPORT_USAGE_STATS"
+ android:protectionLevel="signature|module" />
+
<!-- Allows an application to query broadcast response stats (see
{@link android.app.usage.BroadcastResponseStats}).
@SystemApi
@@ -6387,10 +6493,24 @@
<permission android:name="android.permission.USE_BIOMETRIC_INTERNAL"
android:protectionLevel="signature" />
+ <!-- Allows privileged apps to access the background face authentication.
+ @SystemApi
+ @FlaggedApi("android.hardware.biometrics.face_background_authentication")
+ @hide -->
+ <permission android:name="android.permission.USE_BACKGROUND_FACE_AUTHENTICATION"
+ android:protectionLevel="signature|privileged" />
+
<!-- Allows the system to control the BiometricDialog (SystemUI). Reserved for the system. @hide -->
<permission android:name="android.permission.MANAGE_BIOMETRIC_DIALOG"
android:protectionLevel="signature" />
+ <!-- Allows an application to set the BiometricDialog (SystemUI) logo .
+ <p>Not for use by third-party applications.
+ @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt")
+ -->
+ <permission android:name="android.permission.SET_BIOMETRIC_DIALOG_LOGO"
+ android:protectionLevel="signature" />
+
<!-- Allows an application to control keyguard. Only allowed for system processes.
@hide -->
<permission android:name="android.permission.CONTROL_KEYGUARD"
@@ -6794,6 +6914,11 @@
<permission android:name="android.permission.MANAGE_SMARTSPACE"
android:protectionLevel="signature" />
+ <!-- @SystemApi Allows an application to access the smartspace service as a client.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.ACCESS_SMARTSPACE"
+ android:protectionLevel="signature|privileged|development" />
+
<!-- @SystemApi Allows an application to manage the wallpaper effects
generation service.
@hide <p>Not for use by third-party applications.</p> -->
@@ -6914,6 +7039,16 @@
android:label="@string/permlab_foregroundServiceFileManagement"
android:protectionLevel="normal|instant" />
+ <!-- @FlaggedApi("android.content.pm.introduce_media_processing_type")
+ Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "mediaProcessing".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROCESSING"
+ android:description="@string/permdesc_foregroundServiceMediaProcessing"
+ android:label="@string/permlab_foregroundServiceMediaProcessing"
+ android:protectionLevel="normal|instant" />
+
<!-- Allows a regular application to use {@link android.app.Service#startForeground
Service.startForeground} with the type "specialUse".
<p>Protection level: normal|appop|instant
@@ -6954,7 +7089,7 @@
{@link ActivityOptions#makeRemoteAnimation}
@hide <p>Not for use by third-party applications. -->
<permission android:name="android.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS"
- android:protectionLevel="signature|privileged" />
+ android:protectionLevel="signature|privileged|recents" />
<!-- Allows an application to watch changes and/or active state of app ops.
@hide <p>Not for use by third-party applications. -->
@@ -7017,6 +7152,13 @@
<permission android:name="android.permission.MANAGE_ACCESSIBILITY"
android:protectionLevel="signature|setup|recents|role" />
+ <!-- @FlaggedApi("com.android.server.accessibility.motion_event_observing")
+ @hide
+ @TestApi
+ Allows an accessibility service to observe motion events without consuming them. -->
+ <permission android:name="android.permission.ACCESSIBILITY_MOTION_EVENT_OBSERVING"
+ android:protectionLevel="signature" />
+
<!-- @SystemApi Allows an app to grant a profile owner access to device identifiers.
<p>Not for use by third-party applications.
@deprecated
@@ -7045,6 +7187,25 @@
android:description="@string/permdesc_fullScreenIntent"
android:protectionLevel="normal|appop" />
+ <!-- @SystemApi Required for the privileged assistant apps targeting
+ {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}
+ that receive voice trigger from a sandboxed {@link HotwordDetectionService}.
+ <p>Protection level: signature|privileged|appop
+ @FlaggedApi("android.permission.flags.voice_activation_permission_apis")
+ @hide -->
+ <permission android:name="android.permission.RECEIVE_SANDBOX_TRIGGER_AUDIO"
+ android:protectionLevel="signature|privileged|appop" />
+
+ <!-- @SystemApi Required for the privileged assistant apps targeting
+ {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}
+ that receive training data from a sandboxed {@link HotwordDetectionService} or
+ {@link VisualQueryDetectionService}.
+ <p>Protection level: internal|appop
+ @FlaggedApi("android.permission.flags.voice_activation_permission_apis")
+ @hide -->
+ <permission android:name="android.permission.RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA"
+ android:protectionLevel="internal|appop" />
+
<!-- @SystemApi Allows requesting the framework broadcast the
{@link Intent#ACTION_DEVICE_CUSTOMIZATION_READY} intent.
@hide -->
@@ -7230,6 +7391,13 @@
<permission android:name="android.permission.MODIFY_TOUCH_MODE_STATE"
android:protectionLevel="signature" />
+ <!-- @SystemApi Allows the holder to launch an Intent Resolver flow with custom presentation
+ and/or targets.
+ @FlaggedApi("android.service.chooser.support_nfc_resolver")
+ @hide -->
+ <permission android:name="android.permission.SHOW_CUSTOMIZED_RESOLVER"
+ android:protectionLevel="signature|privileged" />
+
<!-- @hide Allows an application to get a People Tile preview for a given shortcut. -->
<permission android:name="android.permission.GET_PEOPLE_TILE_PREVIEW"
android:protectionLevel="signature|recents" />
@@ -7479,6 +7647,10 @@
<permission android:name="android.permission.DELETE_STAGED_HEALTH_CONNECT_REMOTE_DATA"
android:protectionLevel="signature" />
+ <!-- @hide @TestApi Allows CTS tests running in Sandbox mode to launch activities -->
+ <permission android:name="android.permission.START_ACTIVITIES_FROM_SDK_SANDBOX"
+ android:protectionLevel="signature" />
+
<!-- @SystemApi Allows the holder to call health connect migration APIs.
@hide -->
<permission android:name="android.permission.MIGRATE_HEALTH_CONNECT_DATA"
@@ -7543,6 +7715,106 @@
<permission android:name="android.permission.WRITE_FLAGS"
android:protectionLevel="signature" />
+ <!-- @hide @SystemApi
+ @FlaggedApi("android.app.get_binding_uid_importance")
+ Allows to get the importance of an UID that has a service
+ binding to the app.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.GET_BINDING_UID_IMPORTANCE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide Allows internal applications to manage displays.
+ <p>This means intercept internal signals about displays being (dis-)connected
+ and being able to enable or disable connected displays.
+ <p>Not for use by third-party applications.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.MANAGE_DISPLAYS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows apps to reset hotword training data egress count for testing.
+ <p>CTS tests will use UiAutomation.AdoptShellPermissionIdentity() to gain access.
+ <p>Protection level: signature
+ @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds")
+ @hide -->
+ <permission android:name="android.permission.RESET_HOTWORD_TRAINING_DATA_EGRESS_COUNT"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an app to track all preparations for a complete factory reset.
+ <p>Protection level: signature|privileged
+ @FlaggedApi("android.permission.flags.factory_reset_prep_permission_apis")
+ @hide -->
+ <permission android:name="android.permission.PREPARE_FACTORY_RESET"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows focused window to override the default behavior of supported system keys.
+ The following keycodes are supported:
+ <p> KEYCODE_STEM_PRIMARY
+ <p>If an app is granted this permission and has a focused window, it will be allowed to
+ receive supported key events that are otherwise handled by the system. The app can choose
+ to consume the key events and trigger its own behavior, in which case the default key
+ behavior will be skipped.
+ <p>For example, KEYCODE_STEM_PRIMARY by default opens recent app launcher. If the foreground
+ fitness app is granted this permission, it can repurpose the KEYCODE_STEM_PRIMARY button
+ to pause/resume the current fitness session.
+ <p>Protection level: signature|privileged
+ @FlaggedApi("com.android.input.flags.override_key_behavior_permission_apis")
+ @hide -->
+ <permission android:name="android.permission.OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @FlaggedApi("android.app.job.backup_jobs_exemption")
+ Gives applications whose <b>primary use case</b> is to backup or sync content increased
+ job execution allowance in order to complete the related work. The jobs must have a valid
+ content URI trigger and network constraint set.
+ <p>This is a special access permission that can be revoked by the system or the user.
+ <p>Protection level: signature|privileged|appop
+ -->
+ <permission android:name="android.permission.RUN_BACKUP_JOBS"
+ android:protectionLevel="signature|privileged|appop"/>
+
+ <!-- @hide @SystemApi
+ @FlaggedApi("com.android.server.notification.flags.redact_otp_notifications_from_untrusted_listeners")
+ Allows apps with a NotificationListenerService to receive notifications with sensitive
+ information
+ <p>Apps with a NotificationListenerService without this permission will not be able
+ to view certain types of sensitive information contained in notifications
+ <p>Protection level: signature|role
+ -->
+ <permission android:name="android.permission.RECEIVE_SENSITIVE_NOTIFICATIONS"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi
+ @FlaggedApi("android.app.bic_client")
+ Allows app to call BackgroundInstallControlManager API to retrieve silently installed apps
+ for all users on device.
+ <p>Apps with a BackgroundInstallControlManager client will not be able to call any API without
+ this permission.
+ <p>Protection level: signature|role
+ @hide
+ -->
+ <permission android:name="android.permission.GET_BACKGROUND_INSTALLED_PACKAGES"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows an application to read the system grammatical gender.
+ @FlaggedApi("android.app.system_terms_of_address_enabled")
+ <p>Protection level: signature|privileged
+ @hide
+ -->
+ <permission android:name="android.permission.READ_SYSTEM_GRAMMATICAL_GENDER"
+ android:protectionLevel="signature|privileged"/>
+
+ <!-- @SystemApi
+ @FlaggedApi("android.content.pm.emergency_install_permission")
+ Allows each app store in the system image to designate another app in the system image to
+ update the app store
+ <p>Protection level: signature|privileged
+ @hide
+ -->
+ <permission android:name="android.permission.EMERGENCY_INSTALL_PACKAGES"
+ android:protectionLevel="signature|privileged"/>
+
<!-- Attribution for Geofencing service. -->
<attribution android:tag="GeofencingService" android:label="@string/geofencing_service"/>
<!-- Attribution for Country Detector. -->
diff --git a/tests/tests/permissionpolicy/res/raw/android_manifest_q2.xml b/tests/tests/permissionpolicy/res/raw/android_manifest_q2.xml
new file mode 100644
index 0000000..710b5f8
--- /dev/null
+++ b/tests/tests/permissionpolicy/res/raw/android_manifest_q2.xml
@@ -0,0 +1,8761 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/AndroidManifest.xml
+**
+** Copyright 2006, 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="android" coreApp="true" android:sharedUserId="android.uid.system"
+ android:sharedUserLabel="@string/android_system_label">
+
+ <!-- ================================================ -->
+ <!-- Special broadcasts that only the system can send -->
+ <!-- ================================================ -->
+ <eat-comment />
+
+ <protected-broadcast android:name="android.intent.action.SCREEN_OFF" />
+ <protected-broadcast android:name="android.intent.action.SCREEN_ON" />
+ <protected-broadcast android:name="android.intent.action.USER_PRESENT" />
+ <protected-broadcast android:name="android.intent.action.TIME_SET" />
+ <protected-broadcast android:name="android.intent.action.TIME_TICK" />
+ <protected-broadcast android:name="android.intent.action.TIMEZONE_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.DATE_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.PRE_BOOT_COMPLETED" />
+ <protected-broadcast android:name="android.intent.action.BOOT_COMPLETED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_INSTALL" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_ADDED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_REPLACED" />
+ <protected-broadcast android:name="android.intent.action.MY_PACKAGE_REPLACED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_REMOVED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_REMOVED_INTERNAL" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_FULLY_REMOVED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_FULLY_LOADED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_ENABLE_ROLLBACK" />
+ <protected-broadcast android:name="android.intent.action.CANCEL_ENABLE_ROLLBACK" />
+ <protected-broadcast android:name="android.intent.action.ROLLBACK_COMMITTED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_RESTARTED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_UNSTOPPED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_DATA_CLEARED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_FIRST_LAUNCH" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_NEEDS_INTEGRITY_VERIFICATION" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_NEEDS_VERIFICATION" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_VERIFIED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGES_SUSPENDED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGES_UNSUSPENDED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGES_SUSPENSION_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.PACKAGE_UNSUSPENDED_MANUALLY" />
+ <protected-broadcast android:name="android.intent.action.DISTRACTING_PACKAGES_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.ACTION_PREFERRED_ACTIVITY_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.UID_REMOVED" />
+ <protected-broadcast android:name="android.intent.action.QUERY_PACKAGE_RESTART" />
+ <protected-broadcast android:name="android.intent.action.CONFIGURATION_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.SPLIT_CONFIGURATION_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.LOCALE_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.APPLICATION_LOCALE_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.BATTERY_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.BATTERY_LEVEL_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.BATTERY_LOW" />
+ <protected-broadcast android:name="android.intent.action.BATTERY_OKAY" />
+ <protected-broadcast android:name="android.intent.action.ACTION_POWER_CONNECTED" />
+ <protected-broadcast android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
+ <protected-broadcast android:name="android.intent.action.ACTION_SHUTDOWN" />
+ <protected-broadcast android:name="android.intent.action.CHARGING" />
+ <protected-broadcast android:name="android.intent.action.DISCHARGING" />
+ <protected-broadcast android:name="android.intent.action.DEVICE_STORAGE_LOW" />
+ <protected-broadcast android:name="android.intent.action.DEVICE_STORAGE_OK" />
+ <protected-broadcast android:name="android.intent.action.DEVICE_STORAGE_FULL" />
+ <protected-broadcast android:name="android.intent.action.DEVICE_STORAGE_NOT_FULL" />
+ <protected-broadcast android:name="android.intent.action.NEW_OUTGOING_CALL" />
+ <protected-broadcast android:name="android.intent.action.REBOOT" />
+ <protected-broadcast android:name="android.intent.action.DOCK_EVENT" />
+ <protected-broadcast android:name="android.intent.action.THERMAL_EVENT" />
+ <protected-broadcast android:name="android.intent.action.MASTER_CLEAR_NOTIFICATION" />
+ <protected-broadcast android:name="android.intent.action.USER_ADDED" />
+ <protected-broadcast android:name="android.intent.action.USER_REMOVED" />
+ <protected-broadcast android:name="android.intent.action.USER_STARTING" />
+ <protected-broadcast android:name="android.intent.action.USER_STARTED" />
+ <protected-broadcast android:name="android.intent.action.USER_STOPPING" />
+ <protected-broadcast android:name="android.intent.action.USER_STOPPED" />
+ <protected-broadcast android:name="android.intent.action.USER_BACKGROUND" />
+ <protected-broadcast android:name="android.intent.action.USER_FOREGROUND" />
+ <protected-broadcast android:name="android.intent.action.USER_SWITCHED" />
+ <protected-broadcast android:name="android.intent.action.USER_INITIALIZE" />
+ <protected-broadcast android:name="android.intent.action.INTENT_FILTER_NEEDS_VERIFICATION" />
+ <protected-broadcast android:name="android.intent.action.DOMAINS_NEED_VERIFICATION" />
+ <protected-broadcast android:name="android.intent.action.OVERLAY_ADDED" />
+ <protected-broadcast android:name="android.intent.action.OVERLAY_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.OVERLAY_REMOVED" />
+ <protected-broadcast android:name="android.intent.action.OVERLAY_PRIORITY_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.MY_PACKAGE_SUSPENDED" />
+ <protected-broadcast android:name="android.intent.action.MY_PACKAGE_UNSUSPENDED" />
+ <protected-broadcast android:name="android.intent.action.UNARCHIVE_PACKAGE" />
+
+ <protected-broadcast android:name="android.os.action.POWER_SAVE_MODE_CHANGED" />
+ <protected-broadcast android:name="android.os.action.DEVICE_IDLE_MODE_CHANGED" />
+ <protected-broadcast android:name="android.os.action.POWER_SAVE_WHITELIST_CHANGED" />
+ <protected-broadcast android:name="android.os.action.POWER_SAVE_TEMP_WHITELIST_CHANGED" />
+ <protected-broadcast android:name="android.os.action.POWER_SAVE_MODE_CHANGED_INTERNAL" />
+ <protected-broadcast android:name="android.os.action.LOW_POWER_STANDBY_ENABLED_CHANGED" />
+ <protected-broadcast android:name="android.os.action.LOW_POWER_STANDBY_POLICY_CHANGED" />
+ <protected-broadcast android:name="android.os.action.LOW_POWER_STANDBY_PORTS_CHANGED" />
+ <protected-broadcast android:name="android.os.action.ENHANCED_DISCHARGE_PREDICTION_CHANGED" />
+
+ <!-- @deprecated This is rarely used and will be phased out soon. -->
+ <protected-broadcast android:name="android.os.action.SCREEN_BRIGHTNESS_BOOST_CHANGED" />
+
+ <protected-broadcast android:name="android.app.action.CLOSE_NOTIFICATION_HANDLER_PANEL" />
+
+ <protected-broadcast android:name="android.app.action.ENTER_CAR_MODE" />
+ <protected-broadcast android:name="android.app.action.EXIT_CAR_MODE" />
+ <protected-broadcast android:name="android.app.action.ENTER_CAR_MODE_PRIORITIZED" />
+ <protected-broadcast android:name="android.app.action.EXIT_CAR_MODE_PRIORITIZED" />
+ <protected-broadcast android:name="android.app.action.ENTER_DESK_MODE" />
+ <protected-broadcast android:name="android.app.action.EXIT_DESK_MODE" />
+ <protected-broadcast android:name="android.app.action.NEXT_ALARM_CLOCK_CHANGED" />
+
+ <protected-broadcast android:name="android.app.action.USER_ADDED" />
+ <protected-broadcast android:name="android.app.action.USER_REMOVED" />
+ <protected-broadcast android:name="android.app.action.USER_STARTED" />
+ <protected-broadcast android:name="android.app.action.USER_STOPPED" />
+ <protected-broadcast android:name="android.app.action.USER_SWITCHED" />
+
+ <protected-broadcast android:name="android.app.action.BUGREPORT_SHARING_DECLINED" />
+ <protected-broadcast android:name="android.app.action.BUGREPORT_FAILED" />
+ <protected-broadcast android:name="android.app.action.BUGREPORT_SHARE" />
+ <protected-broadcast android:name="android.app.action.SHOW_DEVICE_MONITORING_DIALOG" />
+ <protected-broadcast android:name="android.intent.action.PENDING_INCIDENT_REPORTS_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.INCIDENT_REPORT_READY" />
+
+ <protected-broadcast android:name="android.appwidget.action.APPWIDGET_UPDATE_OPTIONS" />
+ <protected-broadcast android:name="android.appwidget.action.APPWIDGET_DELETED" />
+ <protected-broadcast android:name="android.appwidget.action.APPWIDGET_DISABLED" />
+ <protected-broadcast android:name="android.appwidget.action.APPWIDGET_ENABLED" />
+ <protected-broadcast android:name="android.appwidget.action.APPWIDGET_HOST_RESTORED" />
+ <protected-broadcast android:name="android.appwidget.action.APPWIDGET_RESTORED" />
+ <protected-broadcast android:name="android.appwidget.action.APPWIDGET_ENABLE_AND_UPDATE" />
+
+ <protected-broadcast android:name="android.os.action.SETTING_RESTORED" />
+
+ <protected-broadcast android:name="android.app.backup.intent.CLEAR" />
+ <protected-broadcast android:name="android.app.backup.intent.INIT" />
+
+ <protected-broadcast android:name="android.bluetooth.intent.DISCOVERABLE_TIMEOUT" />
+ <protected-broadcast android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.adapter.action.SCAN_MODE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.adapter.action.DISCOVERY_STARTED" />
+ <protected-broadcast android:name="android.bluetooth.adapter.action.DISCOVERY_FINISHED" />
+ <protected-broadcast android:name="android.bluetooth.adapter.action.LOCAL_NAME_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.adapter.action.BLUETOOTH_ADDRESS_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.adapter.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.device.action.UUID" />
+ <protected-broadcast android:name="android.bluetooth.device.action.MAS_INSTANCE" />
+ <protected-broadcast android:name="android.bluetooth.device.action.ALIAS_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.device.action.FOUND" />
+ <protected-broadcast android:name="android.bluetooth.device.action.CLASS_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.device.action.ACL_CONNECTED" />
+ <protected-broadcast android:name="android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED" />
+ <protected-broadcast android:name="android.bluetooth.device.action.ACL_DISCONNECTED" />
+ <protected-broadcast android:name="android.bluetooth.device.action.NAME_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.device.action.BOND_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.device.action.NAME_FAILED" />
+ <protected-broadcast android:name="android.bluetooth.device.action.PAIRING_REQUEST" />
+ <protected-broadcast android:name="android.bluetooth.device.action.PAIRING_CANCEL" />
+ <protected-broadcast android:name="android.bluetooth.device.action.CONNECTION_ACCESS_REPLY" />
+ <protected-broadcast android:name="android.bluetooth.device.action.CONNECTION_ACCESS_CANCEL" />
+ <protected-broadcast android:name="android.bluetooth.device.action.CONNECTION_ACCESS_REQUEST" />
+ <protected-broadcast android:name="android.bluetooth.device.action.SDP_RECORD" />
+ <protected-broadcast android:name="android.bluetooth.device.action.BATTERY_LEVEL_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.device.action.REMOTE_ISSUE_OCCURRED" />
+ <protected-broadcast android:name="android.bluetooth.devicepicker.action.LAUNCH" />
+ <protected-broadcast android:name="android.bluetooth.devicepicker.action.DEVICE_SELECTED" />
+ <protected-broadcast
+ android:name="android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.headset.profile.action.AUDIO_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.headset.action.VENDOR_SPECIFIC_HEADSET_EVENT" />
+ <protected-broadcast
+ android:name="android.bluetooth.headset.action.HF_INDICATORS_VALUE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.headset.profile.action.ACTIVE_DEVICE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.headsetclient.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.headsetclient.profile.action.AUDIO_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.headsetclient.profile.action.AG_EVENT" />
+ <protected-broadcast
+ android:name="android.bluetooth.headsetclient.profile.action.AG_CALL_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.headsetclient.profile.action.RESULT" />
+ <protected-broadcast
+ android:name="android.bluetooth.headsetclient.profile.action.LAST_VTAG" />
+ <protected-broadcast
+ android:name="android.bluetooth.headsetclient.profile.action.NETWORK_SERVICE_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.hearingaid.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.hearingaid.profile.action.PLAYING_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.hearingaid.profile.action.ACTIVE_DEVICE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.action.CSIS_CONNECTION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.action.CSIS_DEVICE_AVAILABLE" />
+ <protected-broadcast android:name="android.bluetooth.action.CSIS_SET_MEMBER_AVAILABLE" />
+ <protected-broadcast
+ android:name="android.bluetooth.volume-control.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.a2dp.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.a2dp.profile.action.ACTIVE_DEVICE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.a2dp.profile.action.PLAYING_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.a2dp.profile.action.CODEC_CONFIG_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.a2dp-sink.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.a2dp-sink.profile.action.PLAYING_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.a2dp-sink.profile.action.AUDIO_CONFIG_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.avrcp-controller.profile.action.BROWSE_CONNECTION_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.avrcp-controller.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.avrcp-controller.profile.action.FOLDER_LIST" />
+ <protected-broadcast
+ android:name="android.bluetooth.avrcp-controller.profile.action.TRACK_EVENT" />
+ <protected-broadcast
+ android:name="android.bluetooth.input.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.input.profile.action.IDLE_TIME_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.input.profile.action.PROTOCOL_MODE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.input.profile.action.VIRTUAL_UNPLUG_STATUS" />
+ <protected-broadcast
+ android:name="android.bluetooth.hiddevice.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.map.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.mapmce.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.mapmce.profile.action.MESSAGE_RECEIVED" />
+ <protected-broadcast android:name="android.bluetooth.mapmce.profile.action.MESSAGE_SENT_SUCCESSFULLY" />
+ <protected-broadcast android:name="android.bluetooth.mapmce.profile.action.MESSAGE_DELIVERED_SUCCESSFULLY" />
+ <protected-broadcast android:name="android.bluetooth.mapmce.profile.action.MESSAGE_READ_STATUS_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.mapmce.profile.action.MESSAGE_DELETED_STATUS_CHANGED" />
+ <protected-broadcast
+ android:name="com.android.bluetooth.BluetoothMapContentObserver.action.MESSAGE_SENT" />
+ <protected-broadcast
+ android:name="com.android.bluetooth.BluetoothMapContentObserver.action.MESSAGE_DELIVERY" />
+ <protected-broadcast
+ android:name="android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.action.HAP_CONNECTION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.action.LE_AUDIO_CONNECTION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.action.LE_AUDIO_ACTIVE_DEVICE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.action.LE_AUDIO_CONF_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.action.LE_AUDIO_GROUP_NODE_STATUS_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.action.LE_AUDIO_GROUP_STATUS_CHANGED" />
+ <protected-broadcast
+ android:name="android.bluetooth.action.TETHERING_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.pbap.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.pbapclient.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.sap.profile.action.CONNECTION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.btopp.intent.action.INCOMING_FILE_NOTIFICATION" />
+ <protected-broadcast android:name="android.btopp.intent.action.USER_CONFIRMATION_TIMEOUT" />
+ <protected-broadcast android:name="android.btopp.intent.action.LIST" />
+ <protected-broadcast android:name="android.btopp.intent.action.OPEN_OUTBOUND" />
+ <protected-broadcast android:name="android.btopp.intent.action.HIDE_COMPLETE" />
+ <protected-broadcast android:name="android.btopp.intent.action.CONFIRM" />
+ <protected-broadcast android:name="android.btopp.intent.action.HIDE" />
+ <protected-broadcast android:name="android.btopp.intent.action.RETRY" />
+ <protected-broadcast android:name="android.btopp.intent.action.OPEN" />
+ <protected-broadcast android:name="android.btopp.intent.action.OPEN_INBOUND" />
+ <protected-broadcast android:name="android.btopp.intent.action.TRANSFER_COMPLETE" />
+ <protected-broadcast android:name="android.btopp.intent.action.ACCEPT" />
+ <protected-broadcast android:name="android.btopp.intent.action.DECLINE" />
+ <protected-broadcast android:name="com.android.bluetooth.gatt.REFRESH_BATCHED_SCAN" />
+ <protected-broadcast android:name="com.android.bluetooth.pbap.authchall" />
+ <protected-broadcast android:name="com.android.bluetooth.pbap.userconfirmtimeout" />
+ <protected-broadcast android:name="com.android.bluetooth.pbap.authresponse" />
+ <protected-broadcast android:name="com.android.bluetooth.pbap.authcancelled" />
+ <protected-broadcast android:name="com.android.bluetooth.sap.USER_CONFIRM_TIMEOUT" />
+ <protected-broadcast android:name="com.android.bluetooth.sap.action.DISCONNECT_ACTION" />
+
+ <protected-broadcast android:name="android.hardware.display.action.WIFI_DISPLAY_STATUS_CHANGED" />
+
+ <protected-broadcast android:name="android.hardware.usb.action.USB_STATE" />
+ <protected-broadcast android:name="android.hardware.usb.action.USB_PORT_CHANGED" />
+ <protected-broadcast android:name="android.hardware.usb.action.USB_PORT_COMPLIANCE_CHANGED" />
+ <protected-broadcast android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
+ <protected-broadcast android:name="android.hardware.usb.action.USB_ACCESSORY_DETACHED" />
+ <protected-broadcast android:name="android.hardware.usb.action.USB_ACCESSORY_HANDSHAKE" />
+ <protected-broadcast android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
+ <protected-broadcast android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />
+
+ <protected-broadcast android:name="android.intent.action.HEADSET_PLUG" />
+ <protected-broadcast android:name="android.media.action.HDMI_AUDIO_PLUG" />
+ <protected-broadcast android:name="android.media.action.MICROPHONE_MUTE_CHANGED" />
+ <protected-broadcast android:name="android.media.action.SPEAKERPHONE_STATE_CHANGED" />
+
+ <protected-broadcast android:name="android.media.AUDIO_BECOMING_NOISY" />
+ <protected-broadcast android:name="android.media.RINGER_MODE_CHANGED" />
+ <protected-broadcast android:name="android.media.VIBRATE_SETTING_CHANGED" />
+ <protected-broadcast android:name="android.media.VOLUME_CHANGED_ACTION" />
+ <protected-broadcast android:name="android.media.MASTER_VOLUME_CHANGED_ACTION" />
+ <protected-broadcast android:name="android.media.MASTER_MUTE_CHANGED_ACTION" />
+ <protected-broadcast android:name="android.media.MASTER_MONO_CHANGED_ACTION" />
+ <protected-broadcast android:name="android.media.MASTER_BALANCE_CHANGED_ACTION" />
+ <protected-broadcast android:name="android.media.SCO_AUDIO_STATE_CHANGED" />
+ <protected-broadcast android:name="android.media.ACTION_SCO_AUDIO_STATE_UPDATED" />
+ <protected-broadcast android:name="com.android.server.audio.action.CHECK_MUSIC_ACTIVE" />
+
+ <protected-broadcast android:name="android.intent.action.MEDIA_REMOVED" />
+ <protected-broadcast android:name="android.intent.action.MEDIA_UNMOUNTED" />
+ <protected-broadcast android:name="android.intent.action.MEDIA_CHECKING" />
+ <protected-broadcast android:name="android.intent.action.MEDIA_NOFS" />
+ <protected-broadcast android:name="android.intent.action.MEDIA_MOUNTED" />
+ <protected-broadcast android:name="android.intent.action.MEDIA_SHARED" />
+ <protected-broadcast android:name="android.intent.action.MEDIA_UNSHARED" />
+ <protected-broadcast android:name="android.intent.action.MEDIA_BAD_REMOVAL" />
+ <protected-broadcast android:name="android.intent.action.MEDIA_UNMOUNTABLE" />
+ <protected-broadcast android:name="android.intent.action.MEDIA_EJECT" />
+
+ <protected-broadcast android:name="android.net.conn.CAPTIVE_PORTAL" />
+ <protected-broadcast android:name="android.net.conn.CONNECTIVITY_CHANGE" />
+ <!-- @deprecated. Only {@link android.net.ConnectivityManager.CONNECTIVITY_ACTION} is sent. -->
+ <protected-broadcast android:name="android.net.conn.CONNECTIVITY_CHANGE_IMMEDIATE" />
+ <protected-broadcast android:name="android.net.conn.DATA_ACTIVITY_CHANGE" />
+ <protected-broadcast android:name="android.net.conn.RESTRICT_BACKGROUND_CHANGED" />
+ <protected-broadcast android:name="android.net.conn.BACKGROUND_DATA_SETTING_CHANGED" />
+ <protected-broadcast android:name="android.net.conn.CAPTIVE_PORTAL_TEST_COMPLETED" />
+
+ <protected-broadcast android:name="android.net.nsd.STATE_CHANGED" />
+
+ <!-- For OMAPI -->
+ <protected-broadcast android:name="android.se.omapi.action.SECURE_ELEMENT_STATE_CHANGED" />
+
+ <protected-broadcast android:name="android.nfc.action.ADAPTER_STATE_CHANGED" />
+ <protected-broadcast android:name="android.nfc.action.PREFERRED_PAYMENT_CHANGED" />
+ <protected-broadcast android:name="android.nfc.action.TRANSACTION_DETECTED" />
+ <protected-broadcast android:name="android.nfc.action.REQUIRE_UNLOCK_FOR_NFC" />
+ <protected-broadcast android:name="com.android.nfc.action.LLCP_UP" />
+ <protected-broadcast android:name="com.android.nfc.action.LLCP_DOWN" />
+ <protected-broadcast android:name="com.android.nfc.cardemulation.action.CLOSE_TAP_DIALOG" />
+ <protected-broadcast android:name="com.android.nfc.handover.action.ALLOW_CONNECT" />
+ <protected-broadcast android:name="com.android.nfc.handover.action.DENY_CONNECT" />
+ <protected-broadcast android:name="com.android.nfc.handover.action.TIMEOUT_CONNECT" />
+ <protected-broadcast android:name="com.android.nfc_extras.action.RF_FIELD_ON_DETECTED" />
+ <protected-broadcast android:name="com.android.nfc_extras.action.RF_FIELD_OFF_DETECTED" />
+ <protected-broadcast android:name="com.android.nfc_extras.action.AID_SELECTED" />
+ <!-- For NFC to BT handover -->
+ <protected-broadcast android:name="android.btopp.intent.action.WHITELIST_DEVICE" />
+ <protected-broadcast android:name="android.btopp.intent.action.STOP_HANDOVER_TRANSFER" />
+ <protected-broadcast android:name="android.nfc.handover.intent.action.HANDOVER_SEND" />
+ <protected-broadcast android:name="android.nfc.handover.intent.action.HANDOVER_SEND_MULTIPLE" />
+ <protected-broadcast android:name="com.android.nfc.handover.action.CANCEL_HANDOVER_TRANSFER" />
+
+ <protected-broadcast android:name="android.net.action.CLEAR_DNS_CACHE" />
+ <protected-broadcast android:name="android.intent.action.PROXY_CHANGE" />
+
+ <protected-broadcast android:name="android.os.UpdateLock.UPDATE_LOCK_CHANGED" />
+
+ <protected-broadcast android:name="android.intent.action.DREAMING_STARTED" />
+ <protected-broadcast android:name="android.intent.action.DREAMING_STOPPED" />
+ <protected-broadcast android:name="android.intent.action.ANY_DATA_STATE" />
+
+ <protected-broadcast android:name="com.android.server.stats.action.TRIGGER_COLLECTION" />
+
+ <protected-broadcast android:name="com.android.server.WifiManager.action.START_SCAN" />
+ <protected-broadcast android:name="com.android.server.WifiManager.action.START_PNO" />
+ <protected-broadcast android:name="com.android.server.WifiManager.action.DELAYED_DRIVER_STOP" />
+ <protected-broadcast android:name="com.android.server.WifiManager.action.DEVICE_IDLE" />
+ <protected-broadcast android:name="com.android.server.action.REMOTE_BUGREPORT_SHARING_ACCEPTED" />
+ <protected-broadcast android:name="com.android.server.action.REMOTE_BUGREPORT_SHARING_DECLINED" />
+ <protected-broadcast android:name="com.android.internal.action.EUICC_FACTORY_RESET" />
+ <protected-broadcast
+ android:name="com.android.internal.action.EUICC_REMOVE_INVISIBLE_SUBSCRIPTIONS" />
+ <protected-broadcast android:name="com.android.server.usb.ACTION_OPEN_IN_APPS" />
+ <protected-broadcast android:name="com.android.server.am.DELETE_DUMPHEAP" />
+ <protected-broadcast android:name="com.android.server.net.action.SNOOZE_WARNING" />
+ <protected-broadcast android:name="com.android.server.net.action.SNOOZE_RAPID" />
+ <protected-broadcast android:name="com.android.server.wifi.ACTION_SHOW_SET_RANDOMIZATION_DETAILS" />
+ <protected-broadcast android:name="com.android.server.wifi.action.NetworkSuggestion.USER_ALLOWED_APP" />
+ <protected-broadcast android:name="com.android.server.wifi.action.NetworkSuggestion.USER_DISALLOWED_APP" />
+ <protected-broadcast android:name="com.android.server.wifi.action.NetworkSuggestion.USER_DISMISSED" />
+ <protected-broadcast android:name="com.android.server.wifi.action.CarrierNetwork.USER_ALLOWED_CARRIER" />
+ <protected-broadcast android:name="com.android.server.wifi.action.CarrierNetwork.USER_DISALLOWED_CARRIER" />
+ <protected-broadcast android:name="com.android.server.wifi.action.CarrierNetwork.USER_DISMISSED" />
+ <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.USER_DISMISSED_NOTIFICATION" />
+ <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.CONNECT_TO_NETWORK" />
+ <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.PICK_WIFI_NETWORK" />
+ <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.PICK_NETWORK_AFTER_FAILURE" />
+ <protected-broadcast android:name="com.android.server.wifi.wakeup.DISMISS_NOTIFICATION" />
+ <protected-broadcast android:name="com.android.server.wifi.wakeup.OPEN_WIFI_PREFERENCES" />
+ <protected-broadcast android:name="com.android.server.wifi.wakeup.OPEN_WIFI_SETTINGS" />
+ <protected-broadcast android:name="com.android.server.wifi.wakeup.TURN_OFF_WIFI_WAKE" />
+ <protected-broadcast android:name="android.net.wifi.WIFI_STATE_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.WIFI_AP_STATE_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.WIFI_CREDENTIAL_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.aware.action.WIFI_AWARE_STATE_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.aware.action.WIFI_AWARE_RESOURCE_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.rtt.action.WIFI_RTT_STATE_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.SCAN_RESULTS" />
+ <protected-broadcast android:name="android.net.wifi.RSSI_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.STATE_CHANGE" />
+ <protected-broadcast android:name="android.net.wifi.LINK_CONFIGURATION_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.CONFIGURED_NETWORKS_CHANGE" />
+ <protected-broadcast android:name="android.net.wifi.action.NETWORK_SETTINGS_RESET" />
+ <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_DEAUTH_IMMINENT" />
+ <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_ICON" />
+ <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_OSU_PROVIDERS_LIST" />
+ <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_SUBSCRIPTION_REMEDIATION" />
+ <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW" />
+ <protected-broadcast android:name="android.net.wifi.action.REFRESH_USER_PROVISIONING" />
+ <protected-broadcast android:name="android.net.wifi.action.WIFI_NETWORK_SUGGESTION_POST_CONNECTION" />
+ <protected-broadcast android:name="android.net.wifi.action.WIFI_SCAN_AVAILABILITY_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.supplicant.CONNECTION_CHANGE" />
+ <protected-broadcast android:name="android.net.wifi.supplicant.STATE_CHANGE" />
+ <protected-broadcast android:name="android.net.wifi.p2p.STATE_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.p2p.DISCOVERY_STATE_CHANGE" />
+ <protected-broadcast android:name="android.net.wifi.p2p.THIS_DEVICE_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.p2p.PEERS_CHANGED" />
+ <protected-broadcast android:name="android.net.wifi.p2p.CONNECTION_STATE_CHANGE" />
+ <protected-broadcast android:name="android.net.wifi.p2p.action.WIFI_P2P_PERSISTENT_GROUPS_CHANGED" />
+ <protected-broadcast android:name="android.net.conn.TETHER_STATE_CHANGED" />
+ <protected-broadcast android:name="android.net.conn.INET_CONDITION_ACTION" />
+ <!-- This broadcast is no longer sent in S but it should stay protected to avoid third party
+ apps broadcasting this and confusing old system apps that may not have been updated. -->
+ <protected-broadcast android:name="android.net.conn.NETWORK_CONDITIONS_MEASURED" />
+ <protected-broadcast
+ android:name="android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSED" />
+ <protected-broadcast android:name="android.net.scoring.SCORE_NETWORKS" />
+ <protected-broadcast android:name="android.net.scoring.SCORER_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE" />
+ <protected-broadcast android:name="android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE" />
+ <protected-broadcast android:name="android.intent.action.AIRPLANE_MODE" />
+ <protected-broadcast android:name="android.intent.action.ADVANCED_SETTINGS" />
+ <protected-broadcast android:name="android.intent.action.APPLICATION_RESTRICTIONS_CHANGED" />
+ <protected-broadcast android:name="com.android.server.adb.WIRELESS_DEBUG_PAIRED_DEVICES" />
+ <protected-broadcast android:name="com.android.server.adb.WIRELESS_DEBUG_PAIRING_RESULT" />
+ <protected-broadcast android:name="com.android.server.adb.WIRELESS_DEBUG_STATUS" />
+
+ <!-- Legacy -->
+ <protected-broadcast android:name="android.intent.action.ACTION_IDLE_MAINTENANCE_START" />
+ <protected-broadcast android:name="android.intent.action.ACTION_IDLE_MAINTENANCE_END" />
+
+ <protected-broadcast android:name="com.android.server.ACTION_TRIGGER_IDLE" />
+
+ <protected-broadcast android:name="android.intent.action.HDMI_PLUGGED" />
+
+ <protected-broadcast android:name="android.intent.action.PHONE_STATE" />
+
+ <protected-broadcast android:name="android.intent.action.SUB_DEFAULT_CHANGED" />
+
+ <protected-broadcast android:name="android.location.PROVIDERS_CHANGED" />
+ <protected-broadcast android:name="android.location.MODE_CHANGED" />
+ <protected-broadcast android:name="android.location.action.GNSS_CAPABILITIES_CHANGED" />
+
+ <protected-broadcast android:name="android.net.proxy.PAC_REFRESH" />
+
+ <protected-broadcast android:name="android.telecom.action.DEFAULT_DIALER_CHANGED" />
+ <protected-broadcast android:name="android.provider.action.DEFAULT_SMS_PACKAGE_CHANGED" />
+ <protected-broadcast android:name="android.provider.action.SMS_MMS_DB_CREATED" />
+ <protected-broadcast android:name="android.provider.action.SMS_MMS_DB_LOST" />
+ <protected-broadcast android:name="android.intent.action.CONTENT_CHANGED" />
+ <protected-broadcast android:name="android.provider.Telephony.MMS_DOWNLOADED" />
+
+ <protected-broadcast
+ android:name="com.android.server.connectivityservice.CONNECTED_TO_PROVISIONING_NETWORK_ACTION" />
+
+ <!-- Defined in RestrictionsManager -->
+ <protected-broadcast android:name="android.content.action.PERMISSION_RESPONSE_RECEIVED" />
+ <protected-broadcast android:name="android.content.action.REQUEST_PERMISSION" />
+
+ <protected-broadcast android:name="android.nfc.handover.intent.action.HANDOVER_STARTED" />
+ <protected-broadcast android:name="android.nfc.handover.intent.action.TRANSFER_DONE" />
+ <protected-broadcast android:name="android.nfc.handover.intent.action.TRANSFER_PROGRESS" />
+ <protected-broadcast android:name="android.nfc.handover.intent.action.TRANSFER_DONE" />
+
+ <protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED" />
+
+ <protected-broadcast android:name="android.intent.action.ACTION_SET_RADIO_CAPABILITY_DONE" />
+ <protected-broadcast android:name="android.intent.action.ACTION_SET_RADIO_CAPABILITY_FAILED" />
+
+ <protected-broadcast android:name="android.internal.policy.action.BURN_IN_PROTECTION" />
+ <protected-broadcast android:name="android.app.action.SYSTEM_UPDATE_POLICY_CHANGED" />
+ <protected-broadcast android:name="android.app.action.RESET_PROTECTION_POLICY_CHANGED" />
+ <protected-broadcast android:name="android.app.action.DEVICE_OWNER_CHANGED" />
+ <protected-broadcast android:name="android.app.action.MANAGED_USER_CREATED" />
+
+ <!-- Added in N -->
+ <protected-broadcast android:name="android.intent.action.ANR" />
+ <protected-broadcast android:name="android.intent.action.CALL" />
+ <protected-broadcast android:name="android.intent.action.CALL_PRIVILEGED" />
+ <protected-broadcast android:name="android.intent.action.DROPBOX_ENTRY_ADDED" />
+ <protected-broadcast android:name="android.intent.action.INPUT_METHOD_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.internal_sim_state_changed" />
+ <protected-broadcast android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
+ <protected-broadcast android:name="android.intent.action.PRECISE_CALL_STATE" />
+ <protected-broadcast android:name="android.intent.action.SUBSCRIPTION_PHONE_STATE" />
+ <protected-broadcast android:name="android.intent.action.USER_INFO_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.USER_UNLOCKED" />
+ <protected-broadcast android:name="android.intent.action.WALLPAPER_CHANGED" />
+
+ <protected-broadcast android:name="android.app.action.DEVICE_POLICY_MANAGER_STATE_CHANGED" />
+ <protected-broadcast android:name="android.app.action.CHOOSE_PRIVATE_KEY_ALIAS" />
+ <protected-broadcast android:name="android.app.action.DEVICE_ADMIN_DISABLED" />
+ <protected-broadcast android:name="android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED" />
+ <protected-broadcast android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
+ <protected-broadcast android:name="android.app.action.LOCK_TASK_ENTERING" />
+ <protected-broadcast android:name="android.app.action.LOCK_TASK_EXITING" />
+ <protected-broadcast android:name="android.app.action.NOTIFY_PENDING_SYSTEM_UPDATE" />
+ <protected-broadcast android:name="android.app.action.ACTION_PASSWORD_CHANGED" />
+ <protected-broadcast android:name="android.app.action.ACTION_PASSWORD_EXPIRING" />
+ <protected-broadcast android:name="android.app.action.ACTION_PASSWORD_FAILED" />
+ <protected-broadcast android:name="android.app.action.ACTION_PASSWORD_SUCCEEDED" />
+ <protected-broadcast android:name="com.android.server.ACTION_EXPIRED_PASSWORD_NOTIFICATION" />
+ <protected-broadcast android:name="com.android.server.ACTION_PROFILE_OFF_DEADLINE" />
+ <protected-broadcast android:name="com.android.server.ACTION_TURN_PROFILE_ON_NOTIFICATION" />
+
+ <protected-broadcast android:name="android.intent.action.MANAGED_PROFILE_ADDED" />
+ <protected-broadcast android:name="android.intent.action.MANAGED_PROFILE_UNLOCKED" />
+ <protected-broadcast android:name="android.intent.action.MANAGED_PROFILE_REMOVED" />
+ <protected-broadcast android:name="android.app.action.MANAGED_PROFILE_PROVISIONED" />
+
+ <protected-broadcast android:name="android.bluetooth.adapter.action.BLE_STATE_CHANGED" />
+ <protected-broadcast android:name="com.android.bluetooth.map.USER_CONFIRM_TIMEOUT" />
+ <protected-broadcast android:name="com.android.bluetooth.BluetoothMapContentObserver.action.MESSAGE_SENT" />
+ <protected-broadcast android:name="com.android.bluetooth.BluetoothMapContentObserver.action.MESSAGE_DELIVERY" />
+ <protected-broadcast android:name="android.content.jobscheduler.JOB_DELAY_EXPIRED" />
+ <protected-broadcast android:name="android.content.syncmanager.SYNC_ALARM" />
+ <protected-broadcast android:name="android.media.INTERNAL_RINGER_MODE_CHANGED_ACTION" />
+ <protected-broadcast android:name="android.media.STREAM_DEVICES_CHANGED_ACTION" />
+ <protected-broadcast android:name="android.media.STREAM_MUTE_CHANGED_ACTION" />
+ <protected-broadcast android:name="android.net.sip.SIP_SERVICE_UP" />
+ <protected-broadcast android:name="android.nfc.action.ADAPTER_STATE_CHANGED" />
+ <protected-broadcast android:name="android.os.action.CHARGING" />
+ <protected-broadcast android:name="android.os.action.DISCHARGING" />
+ <protected-broadcast android:name="android.search.action.SEARCHABLES_CHANGED" />
+ <protected-broadcast android:name="android.security.STORAGE_CHANGED" />
+ <protected-broadcast android:name="android.security.action.TRUST_STORE_CHANGED" />
+ <protected-broadcast android:name="android.security.action.KEYCHAIN_CHANGED" />
+ <protected-broadcast android:name="android.security.action.KEY_ACCESS_CHANGED" />
+ <protected-broadcast android:name="android.telecom.action.NUISANCE_CALL_STATUS_CHANGED" />
+ <protected-broadcast android:name="android.telecom.action.PHONE_ACCOUNT_REGISTERED" />
+ <protected-broadcast android:name="android.telecom.action.PHONE_ACCOUNT_UNREGISTERED" />
+ <protected-broadcast android:name="android.telecom.action.POST_CALL" />
+ <protected-broadcast android:name="android.telecom.action.SHOW_MISSED_CALLS_NOTIFICATION" />
+ <protected-broadcast android:name="android.telephony.action.CARRIER_CONFIG_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.SECRET_CODE" />
+ <protected-broadcast android:name="android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION" />
+ <protected-broadcast android:name="android.telephony.action.SUBSCRIPTION_PLANS_CHANGED" />
+
+ <protected-broadcast android:name="com.android.bluetooth.btservice.action.ALARM_WAKEUP" />
+ <protected-broadcast android:name="com.android.server.action.NETWORK_STATS_POLL" />
+ <protected-broadcast android:name="com.android.server.action.NETWORK_STATS_UPDATED" />
+ <protected-broadcast android:name="com.android.server.timedetector.NetworkTimeUpdateService.action.POLL" />
+ <protected-broadcast android:name="com.android.server.telecom.intent.action.CALLS_ADD_ENTRY" />
+ <protected-broadcast android:name="com.android.settings.location.MODE_CHANGING" />
+ <protected-broadcast android:name="com.android.settings.bluetooth.ACTION_DISMISS_PAIRING" />
+ <protected-broadcast android:name="com.android.settings.network.DELETE_SUBSCRIPTION" />
+ <protected-broadcast android:name="com.android.settings.network.SWITCH_TO_SUBSCRIPTION" />
+ <protected-broadcast android:name="com.android.settings.wifi.action.NETWORK_REQUEST" />
+
+ <protected-broadcast android:name="android.app.action.KEYGUARD_PRIVATE_NOTIFICATIONS_CHANGED" />
+ <protected-broadcast android:name="NotificationManagerService.TIMEOUT" />
+ <protected-broadcast android:name="NotificationHistoryDatabase.CLEANUP" />
+ <protected-broadcast android:name="ScheduleConditionProvider.EVALUATE" />
+ <protected-broadcast android:name="EventConditionProvider.EVALUATE" />
+ <protected-broadcast android:name="SnoozeHelper.EVALUATE" />
+ <protected-broadcast android:name="wifi_scan_available" />
+
+ <protected-broadcast android:name="action.cne.started" />
+ <protected-broadcast android:name="android.content.jobscheduler.JOB_DEADLINE_EXPIRED" />
+ <protected-broadcast android:name="android.intent.action.ACTION_UNSOL_RESPONSE_OEM_HOOK_RAW" />
+ <protected-broadcast android:name="android.net.conn.CONNECTIVITY_CHANGE_SUPL" />
+ <protected-broadcast android:name="android.os.action.LIGHT_DEVICE_IDLE_MODE_CHANGED" />
+ <protected-broadcast android:name="android.os.storage.action.VOLUME_STATE_CHANGED" />
+ <protected-broadcast android:name="android.os.storage.action.DISK_SCANNED" />
+ <protected-broadcast android:name="com.android.server.action.UPDATE_TWILIGHT_STATE" />
+ <protected-broadcast android:name="com.android.server.action.RESET_TWILIGHT_AUTO" />
+ <protected-broadcast android:name="com.android.server.device_idle.STEP_IDLE_STATE" />
+ <protected-broadcast android:name="com.android.server.device_idle.STEP_LIGHT_IDLE_STATE" />
+ <protected-broadcast android:name="com.android.server.Wifi.action.TOGGLE_PNO" />
+ <protected-broadcast android:name="intent.action.ACTION_RF_BAND_INFO" />
+ <protected-broadcast android:name="android.intent.action.MEDIA_RESOURCE_GRANTED" />
+ <protected-broadcast android:name="android.app.action.NETWORK_LOGS_AVAILABLE" />
+ <protected-broadcast android:name="android.app.action.SECURITY_LOGS_AVAILABLE" />
+ <protected-broadcast android:name="android.app.action.COMPLIANCE_ACKNOWLEDGEMENT_REQUIRED" />
+
+ <protected-broadcast android:name="android.app.action.INTERRUPTION_FILTER_CHANGED" />
+ <protected-broadcast android:name="android.app.action.INTERRUPTION_FILTER_CHANGED_INTERNAL" />
+ <protected-broadcast android:name="android.app.action.NOTIFICATION_POLICY_CHANGED" />
+ <protected-broadcast android:name="android.app.action.NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED" />
+ <protected-broadcast android:name="android.app.action.AUTOMATIC_ZEN_RULE_STATUS_CHANGED" />
+ <protected-broadcast android:name="android.os.action.ACTION_EFFECTS_SUPPRESSOR_CHANGED" />
+ <protected-broadcast android:name="android.app.action.NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED" />
+ <protected-broadcast android:name="android.app.action.NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED" />
+ <protected-broadcast android:name="android.app.action.NOTIFICATION_LISTENER_ENABLED_CHANGED" />
+ <protected-broadcast android:name="android.app.action.APP_BLOCK_STATE_CHANGED" />
+
+ <protected-broadcast android:name="android.permission.GET_APP_GRANTED_URI_PERMISSIONS" />
+ <protected-broadcast android:name="android.permission.CLEAR_APP_GRANTED_URI_PERMISSIONS" />
+
+ <protected-broadcast android:name="android.intent.action.DYNAMIC_SENSOR_CHANGED" />
+
+ <protected-broadcast android:name="android.accounts.LOGIN_ACCOUNTS_CHANGED" />
+ <protected-broadcast android:name="android.accounts.action.ACCOUNT_REMOVED" />
+ <protected-broadcast android:name="android.accounts.action.VISIBLE_ACCOUNTS_CHANGED" />
+
+ <protected-broadcast android:name="com.android.sync.SYNC_CONN_STATUS_CHANGED" />
+
+ <protected-broadcast android:name="android.net.sip.action.SIP_INCOMING_CALL" />
+ <protected-broadcast android:name="com.android.phone.SIP_ADD_PHONE" />
+ <protected-broadcast android:name="android.net.sip.action.SIP_REMOVE_PROFILE" />
+ <protected-broadcast android:name="android.net.sip.action.SIP_SERVICE_UP" />
+ <protected-broadcast android:name="android.net.sip.action.SIP_CALL_OPTION_CHANGED" />
+ <protected-broadcast android:name="android.net.sip.action.START_SIP" />
+
+ <protected-broadcast android:name="android.bluetooth.adapter.action.BLE_ACL_CONNECTED" />
+ <protected-broadcast android:name="android.bluetooth.adapter.action.BLE_ACL_DISCONNECTED" />
+
+ <protected-broadcast android:name="android.bluetooth.input.profile.action.HANDSHAKE" />
+ <protected-broadcast android:name="android.bluetooth.input.profile.action.REPORT" />
+
+ <protected-broadcast android:name="android.intent.action.TWILIGHT_CHANGED" />
+
+ <protected-broadcast android:name="com.android.server.fingerprint.ACTION_LOCKOUT_RESET" />
+ <protected-broadcast android:name="android.net.wifi.PASSPOINT_ICON_RECEIVED" />
+
+ <protected-broadcast android:name="com.android.server.notification.CountdownConditionProvider" />
+ <protected-broadcast android:name="android.server.notification.action.ENABLE_NAS" />
+ <protected-broadcast android:name="android.server.notification.action.DISABLE_NAS" />
+ <protected-broadcast android:name="android.server.notification.action.LEARNMORE_NAS" />
+
+ <protected-broadcast android:name="com.android.internal.location.ALARM_WAKEUP" />
+ <protected-broadcast android:name="com.android.internal.location.ALARM_TIMEOUT" />
+ <protected-broadcast android:name="android.intent.action.GLOBAL_BUTTON" />
+
+ <protected-broadcast android:name="android.intent.action.MANAGED_PROFILE_AVAILABLE" />
+ <protected-broadcast android:name="android.intent.action.MANAGED_PROFILE_UNAVAILABLE" />
+ <protected-broadcast android:name="com.android.server.pm.DISABLE_QUIET_MODE_AFTER_UNLOCK" />
+
+ <protected-broadcast android:name="android.intent.action.PROFILE_ACCESSIBLE" />
+ <protected-broadcast android:name="android.intent.action.PROFILE_INACCESSIBLE" />
+
+ <protected-broadcast android:name="com.android.server.retaildemo.ACTION_RESET_DEMO" />
+
+ <protected-broadcast android:name="android.intent.action.DEVICE_LOCKED_CHANGED" />
+
+ <protected-broadcast android:name="com.android.content.pm.action.CAN_INTERACT_ACROSS_PROFILES_CHANGED"/>
+
+ <!-- Added in O -->
+ <protected-broadcast android:name="android.app.action.APPLICATION_DELEGATION_SCOPES_CHANGED" />
+ <protected-broadcast android:name="com.android.server.wm.ACTION_REVOKE_SYSTEM_ALERT_WINDOW_PERMISSION" />
+ <protected-broadcast android:name="android.media.tv.action.PARENTAL_CONTROLS_ENABLED_CHANGED" />
+
+ <protected-broadcast android:name="android.content.pm.action.SESSION_COMMITTED" />
+ <protected-broadcast android:name="android.os.action.USER_RESTRICTIONS_CHANGED" />
+ <protected-broadcast android:name="android.media.tv.action.PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT" />
+ <protected-broadcast android:name="android.media.tv.action.PREVIEW_PROGRAM_BROWSABLE_DISABLED" />
+ <protected-broadcast android:name="android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED" />
+ <protected-broadcast android:name="android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED" />
+
+ <!-- Made protected in P (was introduced in JB-MR2) -->
+ <protected-broadcast android:name="android.intent.action.GET_RESTRICTION_ENTRIES" />
+ <protected-broadcast android:name="android.telephony.euicc.action.OTA_STATUS_CHANGED" />
+
+ <!-- Added in P -->
+ <protected-broadcast android:name="android.app.action.PROFILE_OWNER_CHANGED" />
+ <protected-broadcast android:name="android.app.action.TRANSFER_OWNERSHIP_COMPLETE" />
+ <protected-broadcast android:name="android.app.action.AFFILIATED_PROFILE_TRANSFER_OWNERSHIP_COMPLETE" />
+ <protected-broadcast android:name="android.app.action.STATSD_STARTED" />
+ <protected-broadcast android:name="com.android.server.biometrics.fingerprint.ACTION_LOCKOUT_RESET" />
+ <protected-broadcast android:name="com.android.server.biometrics.face.ACTION_LOCKOUT_RESET" />
+
+ <!-- For IdleController -->
+ <protected-broadcast android:name="android.intent.action.DOCK_IDLE" />
+ <protected-broadcast android:name="android.intent.action.DOCK_ACTIVE" />
+
+ <!-- Added in Q -->
+ <protected-broadcast android:name="android.content.pm.action.SESSION_UPDATED" />
+ <protected-broadcast android:name="android.settings.action.GRAYSCALE_CHANGED" />
+
+ <!-- For CarIdlenessTracker -->
+ <protected-broadcast android:name="com.android.server.jobscheduler.GARAGE_MODE_ON" />
+ <protected-broadcast android:name="com.android.server.jobscheduler.GARAGE_MODE_OFF" />
+ <protected-broadcast android:name="com.android.server.jobscheduler.FORCE_IDLE" />
+ <protected-broadcast android:name="com.android.server.jobscheduler.UNFORCE_IDLE" />
+
+ <protected-broadcast android:name="android.provider.action.DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL" />
+
+ <protected-broadcast android:name="android.intent.action.DEVICE_CUSTOMIZATION_READY" />
+
+ <!-- Added in R -->
+ <protected-broadcast android:name="android.app.action.RESET_PROTECTION_POLICY_CHANGED" />
+
+ <!-- For tether entitlement recheck-->
+ <protected-broadcast
+ android:name="com.android.server.connectivity.tethering.PROVISIONING_RECHECK_ALARM" />
+
+ <!-- Made protected in S (was added in R) -->
+ <protected-broadcast android:name="com.android.internal.intent.action.BUGREPORT_REQUESTED" />
+
+ <!-- Added in S -->
+ <protected-broadcast android:name="android.scheduling.action.REBOOT_READY" />
+ <protected-broadcast android:name="android.app.action.DEVICE_POLICY_CONSTANTS_CHANGED" />
+ <protected-broadcast android:name="android.app.action.SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.app.action.SHOW_NEW_USER_DISCLAIMER" />
+
+ <!-- Moved from packages/services/Telephony in T -->
+ <protected-broadcast android:name="android.telecom.action.CURRENT_TTY_MODE_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.SERVICE_STATE" />
+ <protected-broadcast android:name="android.intent.action.RADIO_TECHNOLOGY" />
+ <protected-broadcast android:name="android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.EMERGENCY_CALL_STATE_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.SIG_STR" />
+ <protected-broadcast android:name="android.intent.action.ANY_DATA_STATE" />
+ <protected-broadcast android:name="android.intent.action.DATA_STALL_DETECTED" />
+ <protected-broadcast android:name="android.intent.action.SIM_STATE_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.USER_ACTIVITY_NOTIFICATION" />
+ <protected-broadcast android:name="android.telephony.action.SHOW_NOTICE_ECM_BLOCK_OTHERS" />
+ <protected-broadcast android:name="android.intent.action.ACTION_MDN_STATE_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.SERVICE_PROVIDERS_UPDATED" />
+ <protected-broadcast android:name="android.provider.Telephony.SIM_FULL" />
+ <protected-broadcast android:name="com.android.internal.telephony.carrier_key_download_alarm" />
+ <protected-broadcast android:name="com.android.internal.telephony.data-restart-trysetup" />
+ <protected-broadcast android:name="com.android.internal.telephony.data-stall" />
+ <protected-broadcast android:name="com.android.internal.telephony.provisioning_apn_alarm" />
+ <protected-broadcast android:name="android.intent.action.DATA_SMS_RECEIVED" />
+ <protected-broadcast android:name="android.provider.Telephony.SMS_RECEIVED" />
+ <protected-broadcast android:name="android.provider.Telephony.SMS_DELIVER" />
+ <protected-broadcast android:name="android.provider.Telephony.SMS_REJECTED" />
+ <protected-broadcast android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
+ <protected-broadcast android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
+ <protected-broadcast android:name="android.provider.Telephony.SMS_CB_RECEIVED" />
+ <protected-broadcast android:name="android.provider.action.SMS_EMERGENCY_CB_RECEIVED" />
+ <protected-broadcast android:name="android.provider.Telephony.SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED" />
+ <protected-broadcast android:name="android.provider.Telephony.SECRET_CODE" />
+ <protected-broadcast android:name="com.android.internal.stk.command" />
+ <protected-broadcast android:name="com.android.internal.stk.session_end" />
+ <protected-broadcast android:name="com.android.internal.stk.icc_status_change" />
+ <protected-broadcast android:name="com.android.internal.stk.alpha_notify" />
+ <protected-broadcast android:name="com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED" />
+ <protected-broadcast android:name="com.android.internal.telephony.CARRIER_SIGNAL_REQUEST_NETWORK_FAILED" />
+ <protected-broadcast android:name="com.android.internal.telephony.CARRIER_SIGNAL_PCO_VALUE" />
+ <protected-broadcast android:name="com.android.internal.telephony.CARRIER_SIGNAL_RESET" />
+ <protected-broadcast android:name="com.android.internal.telephony.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE" />
+ <protected-broadcast android:name="com.android.internal.telephony.PROVISION" />
+ <protected-broadcast android:name="com.android.internal.telephony.ACTION_LINE1_NUMBER_ERROR_DETECTED" />
+ <protected-broadcast android:name="com.android.internal.provider.action.VOICEMAIL_SMS_RECEIVED" />
+ <protected-broadcast android:name="com.android.intent.isim_refresh" />
+ <protected-broadcast android:name="com.android.ims.ACTION_RCS_SERVICE_AVAILABLE" />
+ <protected-broadcast android:name="com.android.ims.ACTION_RCS_SERVICE_UNAVAILABLE" />
+ <protected-broadcast android:name="com.android.ims.ACTION_RCS_SERVICE_DIED" />
+ <protected-broadcast android:name="com.android.ims.ACTION_PRESENCE_CHANGED" />
+ <protected-broadcast android:name="com.android.ims.ACTION_PUBLISH_STATUS_CHANGED" />
+ <protected-broadcast android:name="com.android.ims.IMS_SERVICE_UP" />
+ <protected-broadcast android:name="com.android.ims.IMS_SERVICE_DOWN" />
+ <protected-broadcast android:name="com.android.ims.IMS_INCOMING_CALL" />
+ <protected-broadcast android:name="com.android.ims.internal.uce.UCE_SERVICE_UP" />
+ <protected-broadcast android:name="com.android.ims.internal.uce.UCE_SERVICE_DOWN" />
+ <protected-broadcast android:name="com.android.imsconnection.DISCONNECTED" />
+ <protected-broadcast android:name="com.android.intent.action.IMS_FEATURE_CHANGED" />
+ <protected-broadcast android:name="com.android.intent.action.IMS_CONFIG_CHANGED" />
+ <protected-broadcast android:name="android.telephony.ims.action.WFC_IMS_REGISTRATION_ERROR" />
+ <protected-broadcast android:name="com.android.phone.vvm.omtp.sms.REQUEST_SENT" />
+ <protected-broadcast android:name="com.android.phone.vvm.ACTION_VISUAL_VOICEMAIL_SERVICE_EVENT" />
+ <protected-broadcast android:name="com.android.internal.telephony.CARRIER_VVM_PACKAGE_INSTALLED" />
+ <protected-broadcast android:name="com.android.cellbroadcastreceiver.GET_LATEST_CB_AREA_INFO" />
+ <protected-broadcast android:name="com.android.internal.telephony.ACTION_CARRIER_CERTIFICATE_DOWNLOAD" />
+ <protected-broadcast android:name="com.android.internal.telephony.action.COUNTRY_OVERRIDE" />
+ <protected-broadcast android:name="com.android.internal.telephony.OPEN_DEFAULT_SMS_APP" />
+ <protected-broadcast android:name="com.android.internal.telephony.ACTION_TEST_OVERRIDE_CARRIER_ID" />
+ <protected-broadcast android:name="android.telephony.action.SIM_CARD_STATE_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.SIM_APPLICATION_STATE_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.SIM_SLOT_STATUS_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.SUBSCRIPTION_CARRIER_IDENTITY_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.TOGGLE_PROVISION" />
+ <protected-broadcast android:name="android.telephony.action.NETWORK_COUNTRY_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.PRIMARY_SUBSCRIPTION_LIST_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.MULTI_SIM_CONFIG_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.CARRIER_SIGNAL_RESET" />
+ <protected-broadcast android:name="android.telephony.action.CARRIER_SIGNAL_PCO_VALUE" />
+ <protected-broadcast android:name="android.telephony.action.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE" />
+ <protected-broadcast android:name="android.telephony.action.CARRIER_SIGNAL_REDIRECTED" />
+ <protected-broadcast android:name="android.telephony.action.CARRIER_SIGNAL_REQUEST_NETWORK_FAILED" />
+ <protected-broadcast android:name="com.android.phone.settings.CARRIER_PROVISIONING" />
+ <protected-broadcast android:name="com.android.phone.settings.TRIGGER_CARRIER_PROVISIONING" />
+ <protected-broadcast android:name="com.android.internal.telephony.ACTION_VOWIFI_ENABLED" />
+ <protected-broadcast android:name="android.telephony.action.ANOMALY_REPORTED" />
+ <protected-broadcast android:name="android.intent.action.SUBSCRIPTION_INFO_RECORD_ADDED" />
+ <protected-broadcast android:name="android.intent.action.ACTION_MANAGED_ROAMING_IND" />
+ <protected-broadcast android:name="android.telephony.ims.action.RCS_SINGLE_REGISTRATION_CAPABILITY_UPDATE" />
+
+ <!-- Added in T -->
+ <protected-broadcast android:name="android.safetycenter.action.REFRESH_SAFETY_SOURCES" />
+ <protected-broadcast android:name="android.safetycenter.action.SAFETY_CENTER_ENABLED_CHANGED" />
+ <protected-broadcast android:name="android.app.action.DEVICE_POLICY_RESOURCE_UPDATED" />
+ <protected-broadcast android:name="android.intent.action.SHOW_FOREGROUND_SERVICE_MANAGER" />
+ <protected-broadcast android:name="android.service.autofill.action.DELAYED_FILL" />
+ <protected-broadcast android:name="android.app.action.PROVISIONING_COMPLETED" />
+ <protected-broadcast android:name="android.app.action.LOST_MODE_LOCATION_UPDATE" />
+
+ <!-- Added in U -->
+ <protected-broadcast android:name="android.intent.action.PROFILE_ADDED" />
+ <protected-broadcast android:name="android.intent.action.PROFILE_REMOVED" />
+ <protected-broadcast android:name="com.android.internal.telephony.cat.SMS_SENT_ACTION" />
+ <protected-broadcast android:name="com.android.internal.telephony.cat.SMS_DELIVERY_ACTION" />
+ <protected-broadcast android:name="com.android.internal.telephony.data.ACTION_RETRY" />
+ <protected-broadcast android:name="android.companion.virtual.action.VIRTUAL_DEVICE_REMOVED" />
+ <protected-broadcast android:name="com.android.internal.intent.action.FLASH_NOTIFICATION_START_PREVIEW" />
+ <protected-broadcast android:name="com.android.internal.intent.action.FLASH_NOTIFICATION_STOP_PREVIEW" />
+ <protected-broadcast android:name="android.app.admin.action.DEVICE_FINANCING_STATE_CHANGED" />
+ <protected-broadcast android:name="android.app.admin.action.DEVICE_POLICY_SET_RESULT" />
+ <protected-broadcast android:name="android.app.admin.action.DEVICE_POLICY_CHANGED" />
+
+ <!-- Added in V -->
+ <protected-broadcast android:name="android.intent.action.PROFILE_AVAILABLE" />
+ <protected-broadcast android:name="android.intent.action.PROFILE_UNAVAILABLE" />
+ <protected-broadcast android:name="android.app.action.CONSOLIDATED_NOTIFICATION_POLICY_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.MAIN_USER_LOCKSCREEN_KNOWLEDGE_FACTOR_CHANGED" />
+
+ <!-- ====================================================================== -->
+ <!-- RUNTIME PERMISSIONS -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Grouping for platform runtime permissions is not accessible to apps
+ @hide
+ @SystemApi
+ @TestApi
+ -->
+ <permission-group android:name="android.permission-group.UNDEFINED"
+ android:priority="100" />
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for accessing user's contacts including personal profile -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Used for runtime permissions related to contacts and profiles on this
+ device. -->
+ <permission-group android:name="android.permission-group.CONTACTS"
+ android:icon="@drawable/perm_group_contacts"
+ android:label="@string/permgrouplab_contacts"
+ android:description="@string/permgroupdesc_contacts"
+ android:priority="100" />
+
+ <!-- Allows an application to read the user's contacts data.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.READ_CONTACTS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readContacts"
+ android:description="@string/permdesc_readContacts"
+ android:protectionLevel="dangerous" />
+ <uses-permission android:name="android.permission.READ_CONTACTS" />
+
+ <!-- Allows an application to write the user's contacts data.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.WRITE_CONTACTS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_writeContacts"
+ android:description="@string/permdesc_writeContacts"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an app to update the verification status of E2EE contact keys owned by other apps.
+ <p>This permission is only granted to system apps.
+ <p>Protection level: signature|privileged
+ @SystemApi
+ @hide
+ @FlaggedApi("android.provider.user_keys")
+ -->
+ <permission android:name="android.permission.WRITE_VERIFICATION_STATE_E2EE_CONTACT_KEYS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_writeVerificationStateE2eeContactKeys"
+ android:description="@string/permdesc_writeVerificationStateE2eeContactKeys"
+ android:protectionLevel="signature|privileged"
+ android:featureFlag="android.provider.user_keys" />
+
+ <!-- Allows an application to set default account for new contacts.
+ <p> This permission is only granted to system applications fulfilling the Contacts app role.
+ <p>Protection level: internal|role
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.SET_DEFAULT_ACCOUNT_FOR_CONTACTS"
+ android:protectionLevel="internal|role" />
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for accessing user's calendar -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Used for runtime permissions related to user's calendar. -->
+ <permission-group android:name="android.permission-group.CALENDAR"
+ android:icon="@drawable/perm_group_calendar"
+ android:label="@string/permgrouplab_calendar"
+ android:description="@string/permgroupdesc_calendar"
+ android:priority="200" />
+
+ <!-- Allows an application to read the user's calendar data.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.READ_CALENDAR"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readCalendar"
+ android:description="@string/permdesc_readCalendar"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to write the user's calendar data.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.WRITE_CALENDAR"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_writeCalendar"
+ android:description="@string/permdesc_writeCalendar"
+ android:protectionLevel="dangerous" />
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for accessing and modifying user's SMS messages -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Allows accessing the messages on ICC
+ @hide Used internally. -->
+ <permission android:name="android.permission.ACCESS_MESSAGES_ON_ICC"
+ android:protectionLevel="signature" />
+
+ <!-- Used for runtime permissions related to user's SMS messages. -->
+ <permission-group android:name="android.permission-group.SMS"
+ android:icon="@drawable/perm_group_sms"
+ android:label="@string/permgrouplab_sms"
+ android:description="@string/permgroupdesc_sms"
+ android:priority="300" />
+
+ <!-- Allows an application to send SMS messages.
+ <p>Protection level: dangerous
+
+ <p> This is a hard restricted permission which cannot be held by an app until
+ the installer on record allowlists the permission. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+ -->
+ <permission android:name="android.permission.SEND_SMS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_sendSms"
+ android:description="@string/permdesc_sendSms"
+ android:permissionFlags="costsMoney|hardRestricted"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to receive SMS messages.
+ <p>Protection level: dangerous
+
+ <p> This is a hard restricted permission which cannot be held by an app until
+ the installer on record allowlists the permission. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+ -->
+ <permission android:name="android.permission.RECEIVE_SMS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_receiveSms"
+ android:description="@string/permdesc_receiveSms"
+ android:permissionFlags="hardRestricted"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to read SMS messages.
+ <p>Protection level: dangerous
+
+ <p> This is a hard restricted permission which cannot be held by an app until
+ the installer on record allowlists the permission. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+ -->
+ <permission android:name="android.permission.READ_SMS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readSms"
+ android:description="@string/permdesc_readSms"
+ android:permissionFlags="hardRestricted"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to receive WAP push messages.
+ <p>Protection level: dangerous
+
+ <p> This is a hard restricted permission which cannot be held by an app until
+ the installer on record allowlists the permission. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+ -->
+ <permission android:name="android.permission.RECEIVE_WAP_PUSH"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_receiveWapPush"
+ android:description="@string/permdesc_receiveWapPush"
+ android:permissionFlags="hardRestricted"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to monitor incoming MMS messages.
+ <p>Protection level: dangerous
+
+ <p> This is a hard restricted permission which cannot be held by an app until
+ the installer on record allowlists the permission. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+ -->
+ <permission android:name="android.permission.RECEIVE_MMS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_receiveMms"
+ android:description="@string/permdesc_receiveMms"
+ android:permissionFlags="hardRestricted"
+ android:protectionLevel="dangerous" />
+
+ <!-- @SystemApi @TestApi Allows an application to forward cell broadcast messages to the cell
+ broadcast module. This is required in order to bind to the cell broadcast service, and
+ ensures that only the system can forward messages to it.
+
+ <p>Protection level: signature
+
+ @hide -->
+ <permission android:name="android.permission.BIND_CELL_BROADCAST_SERVICE"
+ android:label="@string/permlab_bindCellBroadcastService"
+ android:description="@string/permdesc_bindCellBroadcastService"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @TestApi Allows an application to read previously received cell broadcast
+ messages and to register a content observer to get notifications when
+ a cell broadcast has been received and added to the database. For
+ emergency alerts, the database is updated immediately after the
+ alert dialog and notification sound/vibration/speech are presented.
+ The "read" column is then updated after the user dismisses the alert.
+ This enables supplementary emergency assistance apps to start loading
+ additional emergency information (if Internet access is available)
+ when the alert is first received, and to delay presenting the info
+ to the user until after the initial alert dialog is dismissed.
+ <p>Protection level: dangerous
+
+ <p> This is a hard restricted permission which cannot be held by an app until
+ the installer on record allowlists the permission. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+
+ @hide Pending API council approval -->
+ <permission android:name="android.permission.READ_CELL_BROADCASTS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readCellBroadcasts"
+ android:description="@string/permdesc_readCellBroadcasts"
+ android:permissionFlags="hardRestricted"
+ android:protectionLevel="dangerous" />
+
+ <!-- @SystemApi @hide Allows an application to communicate over satellite.
+ Only granted if the application is a system app or privileged app. -->
+ <permission android:name="android.permission.SATELLITE_COMMUNICATION"
+ android:protectionLevel="role|signature|privileged" />
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for accessing external storage -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Used for runtime permissions related to the shared external storage. -->
+ <permission-group android:name="android.permission-group.STORAGE"
+ android:icon="@drawable/perm_group_storage"
+ android:label="@string/permgrouplab_storage"
+ android:description="@string/permgroupdesc_storage"
+ android:priority="900" />
+
+ <!-- Allows an application to read from external storage.
+ <p class="note"><strong>Note: </strong>Starting in API level 33, this permission has no
+ effect. If your app accesses other apps' media files, request one or more of these permissions
+ instead: <a href="#READ_MEDIA_IMAGES"><code>READ_MEDIA_IMAGES</code></a>,
+ <a href="#READ_MEDIA_VIDEO"><code>READ_MEDIA_VIDEO</code></a>,
+ <a href="#READ_MEDIA_AUDIO"><code>READ_MEDIA_AUDIO</code></a>. Learn more about the
+ <a href="{@docRoot}training/data-storage/shared/media#storage-permission">storage
+ permissions</a> that are associated with media files.</p>
+
+ <p>This permission is enforced starting in API level 19. Before API level 19, this
+ permission is not enforced and all apps still have access to read from external storage.
+ You can test your app with the permission enforced by enabling <em>Protect USB
+ storage</em> under <b>Developer options</b> in the Settings app on a device running Android
+ 4.1 or higher.</p>
+ <p>Also starting in API level 19, this permission is <em>not</em> required to
+ read or write files in your application-specific directories returned by
+ {@link android.content.Context#getExternalFilesDir} and
+ {@link android.content.Context#getExternalCacheDir}.</p>
+ <p>Starting in API level 29, apps don't need to request this permission to access files in
+ their app-specific directory on external storage, or their own files in the
+ <a href="{@docRoot}reference/android/provider/MediaStore"><code>MediaStore</code></a>. Apps
+ shouldn't request this permission unless they need to access other apps' files in the
+ <code>MediaStore</code>. Read more about these changes in the
+ <a href="{@docRoot}training/data-storage#scoped-storage">scoped storage</a> section of the
+ developer documentation.</p>
+ <p>If <em>both</em> your <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+ minSdkVersion}</a> and <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> values are set to 3 or lower, the system implicitly
+ grants your app this permission. If you don't need this permission, be sure your <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> is 4 or higher.</p>
+
+ <p> This is a soft restricted permission which cannot be held by an app it its
+ full form until the installer on record allowlists the permission.
+ Specifically, if the permission is allowlisted the holder app can access
+ external storage and the visual and aural media collections while if the
+ permission is not allowlisted the holder app can only access to the visual
+ and aural medial collections. Also the permission is immutably restricted
+ meaning that the allowlist state can be specified only at install time and
+ cannot change until the app is installed. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.READ_EXTERNAL_STORAGE"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_sdcardRead"
+ android:description="@string/permdesc_sdcardRead"
+ android:permissionFlags="softRestricted|immutablyRestricted"
+ android:protectionLevel="dangerous" />
+
+ <!-- Required to be able to read audio files from shared storage.
+ <p>Protection level: dangerous -->
+ <permission-group android:name="android.permission-group.READ_MEDIA_AURAL"
+ android:icon="@drawable/perm_group_read_media_aural"
+ android:label="@string/permgrouplab_readMediaAural"
+ android:description="@string/permgroupdesc_readMediaAural"
+ android:priority="950" />
+
+ <!-- Allows an application to read audio files from external storage.
+ <p>This permission is enforced starting in API level
+ {@link android.os.Build.VERSION_CODES#TIRAMISU}. An app which targets
+ {@link android.os.Build.VERSION_CODES#TIRAMISU} or higher and needs to read audio files from
+ external storage must hold this permission; {@link #READ_EXTERNAL_STORAGE} is not required.
+ For apps with a <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> of {@link android.os.Build.VERSION_CODES#S_V2} or lower, the
+ {@link #READ_EXTERNAL_STORAGE} permission is required, instead, to read audio files.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.READ_MEDIA_AUDIO"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readMediaAudio"
+ android:description="@string/permdesc_readMediaAudio"
+ android:protectionLevel="dangerous" />
+
+ <!-- Required to be able to read image and video files from shared storage.
+ <p>Protection level: dangerous -->
+ <permission-group android:name="android.permission-group.READ_MEDIA_VISUAL"
+ android:icon="@drawable/perm_group_read_media_visual"
+ android:label="@string/permgrouplab_readMediaVisual"
+ android:description="@string/permgroupdesc_readMediaVisual"
+ android:priority="1000" />
+
+ <!-- Allows an application to read video files from external storage.
+ <p>This permission is enforced starting in API level
+ {@link android.os.Build.VERSION_CODES#TIRAMISU}. An app which targets
+ {@link android.os.Build.VERSION_CODES#TIRAMISU} or higher and needs to read video files from
+ external storage must hold this permission; {@link #READ_EXTERNAL_STORAGE} is not required.
+ For apps with a <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> of {@link android.os.Build.VERSION_CODES#S_V2} or lower, the
+ {@link #READ_EXTERNAL_STORAGE} permission is required, instead, to read video files.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.READ_MEDIA_VIDEO"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readMediaVideo"
+ android:description="@string/permdesc_readMediaVideo"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to read image files from external storage.
+ <p>This permission is enforced starting in API level
+ {@link android.os.Build.VERSION_CODES#TIRAMISU}. An app which targets
+ {@link android.os.Build.VERSION_CODES#TIRAMISU} or higher and needs to read image files from
+ external storage must hold this permission; {@link #READ_EXTERNAL_STORAGE} is not required.
+ For apps with a <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> of {@link android.os.Build.VERSION_CODES#S_V2} or lower, the
+ {@link #READ_EXTERNAL_STORAGE} permission is required, instead, to read image files.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.READ_MEDIA_IMAGES"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readMediaImages"
+ android:description="@string/permdesc_readMediaImages"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to read image or video files from external storage that a user has
+ selected via the permission prompt photo picker. Apps can check this permission to verify that
+ a user has decided to use the photo picker, instead of granting access to
+ {@link #READ_MEDIA_IMAGES} or {@link #READ_MEDIA_VIDEO}. It does not prevent apps from
+ accessing the standard photo picker manually. This permission should be requested alongside
+ {@link #READ_MEDIA_IMAGES} and/or {@link #READ_MEDIA_VIDEO}, depending on which type of media
+ is desired.
+ <p> This permission will be automatically added to an app's manifest if the app requests
+ {@link #READ_MEDIA_IMAGES}, {@link #READ_MEDIA_VIDEO}, or {@link #ACCESS_MEDIA_LOCATION}
+ regardless of target SDK. If an app does not request this permission, then the grant dialog
+ will return `PERMISSION_GRANTED` for {@link #READ_MEDIA_IMAGES} and/or
+ {@link #READ_MEDIA_VIDEO}, but the app will only have access to the media selected by the
+ user. This false grant state will persist until the app goes into the background.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readVisualUserSelect"
+ android:description="@string/permdesc_readVisualUserSelect"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to write to external storage.
+ <p><strong>Note: </strong>If your app targets {@link android.os.Build.VERSION_CODES#R} or
+ higher, this permission has no effect.
+
+ <p>If your app is on a device that runs API level 19 or higher, you don't need to declare
+ this permission to read and write files in your application-specific directories returned
+ by {@link android.content.Context#getExternalFilesDir} and
+ {@link android.content.Context#getExternalCacheDir}.
+
+ <p>Learn more about how to
+ <a href="{@docRoot}training/data-storage/shared/media#update-other-apps-files">modify media
+ files</a> that your app doesn't own, and how to
+ <a href="{@docRoot}training/data-storage/shared/documents-files">modify non-media files</a>
+ that your app doesn't own.
+
+ <p>If your app is a file manager and needs broad access to external storage files, then
+ the system must place your app on an allowlist so that you can successfully request the
+ <a href="#MANAGE_EXTERNAL_STORAGE><code>MANAGE_EXTERNAL_STORAGE</code></a> permission.
+ Learn more about the appropriate use cases for
+ <a href="{@docRoot}training/data-storage/manage-all-files>managing all files on a storage
+ device</a>.
+
+ <p>If <em>both</em> your <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+ minSdkVersion}</a> and <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> values are set to 3 or lower, the system implicitly
+ grants your app this permission. If you don't need this permission, be sure your <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> is 4 or higher.
+ <p>Protection level: dangerous</p>
+ -->
+ <permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_sdcardWrite"
+ android:description="@string/permdesc_sdcardWrite"
+ android:permissionFlags="softRestricted|immutablyRestricted"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to access any geographic locations persisted in the
+ user's shared collection.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.ACCESS_MEDIA_LOCATION"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_mediaLocation"
+ android:description="@string/permdesc_mediaLocation"
+ android:protectionLevel="dangerous" />
+
+ <!-- @hide @SystemApi @TestApi
+ Allows an application to modify OBB files visible to other apps. -->
+ <permission android:name="android.permission.WRITE_OBB"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application a broad access to external storage in scoped storage.
+ Intended to be used by few apps that need to manage files on behalf of the users.
+ <p>Protection level: signature|appop|preinstalled -->
+ <permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:protectionLevel="signature|appop|preinstalled" />
+
+ <!-- Allows an application to modify and delete media files on this device or any connected
+ storage device without user confirmation. Applications must already be granted the
+ {@link #READ_EXTERNAL_STORAGE} or {@link #MANAGE_EXTERNAL_STORAGE}} permissions for this
+ permission to take effect.
+ <p>Even if applications are granted this permission, if applications want to modify or
+ delete media files, they also must get the access by calling
+ {@link android.provider.MediaStore#createWriteRequest(ContentResolver, Collection)},
+ {@link android.provider.MediaStore#createDeleteRequest(ContentResolver, Collection)}, or
+ {@link android.provider.MediaStore#createTrashRequest(ContentResolver, Collection, boolean)}.
+ <p>This permission doesn't give read or write access directly. It only prevents the user
+ confirmation dialog for these requests.
+ <p>If applications are not granted {@link #ACCESS_MEDIA_LOCATION}, the system also pops up
+ the user confirmation dialog for the write request.
+ <p>Protection level: signature|appop|preinstalled -->
+ <permission android:name="android.permission.MANAGE_MEDIA"
+ android:protectionLevel="signature|appop|preinstalled" />
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for accessing the device location -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Used for permissions that allow accessing the device location. -->
+ <permission-group android:name="android.permission-group.LOCATION"
+ android:icon="@drawable/perm_group_location"
+ android:label="@string/permgrouplab_location"
+ android:description="@string/permgroupdesc_location"
+ android:priority="400" />
+
+ <!-- Allows an app to access precise location.
+ Alternatively, you might want {@link #ACCESS_COARSE_LOCATION}.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.ACCESS_FINE_LOCATION"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_accessFineLocation"
+ android:description="@string/permdesc_accessFineLocation"
+ android:backgroundPermission="android.permission.ACCESS_BACKGROUND_LOCATION"
+ android:protectionLevel="dangerous|instant" />
+
+ <!-- Allows an app to access approximate location.
+ Alternatively, you might want {@link #ACCESS_FINE_LOCATION}.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.ACCESS_COARSE_LOCATION"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_accessCoarseLocation"
+ android:description="@string/permdesc_accessCoarseLocation"
+ android:backgroundPermission="android.permission.ACCESS_BACKGROUND_LOCATION"
+ android:protectionLevel="dangerous|instant" />
+
+ <!-- Allows an app to access location in the background. If you're requesting this permission,
+ you must also request either {@link #ACCESS_COARSE_LOCATION} or
+ {@link #ACCESS_FINE_LOCATION}. Requesting this permission by itself doesn't give you
+ location access.
+ <p>Protection level: dangerous
+
+ <p> This is a hard restricted permission which cannot be held by an app until
+ the installer on record allowlists the permission. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+ -->
+ <permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_accessBackgroundLocation"
+ android:permissionFlags="hardRestricted"
+ android:description="@string/permdesc_accessBackgroundLocation"
+ android:protectionLevel="dangerous|instant" />
+
+ <!-- Allows an application (emergency or advanced driver-assistance app) to bypass
+ location settings.
+ <p>Not for use by third-party applications.
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.LOCATION_BYPASS"
+ android:protectionLevel="signature|privileged"/>
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for accessing the call log -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Used for permissions that are associated telephony features. -->
+ <permission-group android:name="android.permission-group.CALL_LOG"
+ android:icon="@drawable/perm_group_call_log"
+ android:label="@string/permgrouplab_calllog"
+ android:description="@string/permgroupdesc_calllog"
+ android:priority="450" />
+
+ <!-- Allows an application to access the IMS call service: making and
+ modifying a call
+ <p>Protection level: signature|privileged
+ @hide
+ -->
+ <permission android:name="android.permission.ACCESS_IMS_CALL_SERVICE"
+ android:label="@string/permlab_accessImsCallService"
+ android:description="@string/permdesc_accessImsCallService"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows an application to perform IMS Single Registration related actions.
+ Only granted if the application is a system app AND is in the Default SMS Role.
+ The permission is revoked when the app is taken out of the Default SMS Role.
+ <p>Protection level: internal|role
+ -->
+ <permission android:name="android.permission.PERFORM_IMS_SINGLE_REGISTRATION"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to read the user's call log.
+ <p class="note"><strong>Note:</strong> If your app uses the
+ {@link #READ_CONTACTS} permission and <em>both</em> your <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+ minSdkVersion}</a> and <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> values are set to 15 or lower, the system implicitly
+ grants your app this permission. If you don't need this permission, be sure your <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> is 16 or higher.</p>
+ <p>Protection level: dangerous
+
+ <p> This is a hard restricted permission which cannot be held by an app until
+ the installer on record allowlists the permission. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+ -->
+ <permission android:name="android.permission.READ_CALL_LOG"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readCallLog"
+ android:description="@string/permdesc_readCallLog"
+ android:permissionFlags="hardRestricted"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to write and read the user's call log data.
+ <p class="note"><strong>Note:</strong> If your app uses the
+ {@link #WRITE_CONTACTS} permission and <em>both</em> your <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+ minSdkVersion}</a> and <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> values are set to 15 or lower, the system implicitly
+ grants your app this permission. If you don't need this permission, be sure your <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> is 16 or higher.</p>
+ <p>Protection level: dangerous
+
+ <p> This is a hard restricted permission which cannot be held by an app until
+ the installer on record allowlists the permission. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+ -->
+ <permission android:name="android.permission.WRITE_CALL_LOG"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_writeCallLog"
+ android:description="@string/permdesc_writeCallLog"
+ android:permissionFlags="hardRestricted"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to see the number being dialed during an outgoing
+ call with the option to redirect the call to a different number or
+ abort the call altogether.
+ <p>Protection level: dangerous
+
+ <p> This is a hard restricted permission which cannot be held by an app until
+ the installer on record allowlists the permission. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+
+ @deprecated Applications should use {@link android.telecom.CallRedirectionService} instead
+ of the {@link android.content.Intent#ACTION_NEW_OUTGOING_CALL} broadcast.
+ -->
+ <permission android:name="android.permission.PROCESS_OUTGOING_CALLS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_processOutgoingCalls"
+ android:description="@string/permdesc_processOutgoingCalls"
+ android:permissionFlags="hardRestricted"
+ android:protectionLevel="dangerous" />
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for accessing the device telephony -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Used for permissions that are associated telephony features. -->
+ <permission-group android:name="android.permission-group.PHONE"
+ android:icon="@drawable/perm_group_phone_calls"
+ android:label="@string/permgrouplab_phone"
+ android:description="@string/permgroupdesc_phone"
+ android:priority="500" />
+
+ <!-- Allows read only access to phone state, including the current cellular network information,
+ the status of any ongoing calls, and a list of any {@link android.telecom.PhoneAccount}s
+ registered on the device.
+ <p class="note"><strong>Note:</strong> If <em>both</em> your <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+ minSdkVersion}</a> and <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> values are set to 3 or lower, the system implicitly
+ grants your app this permission. If you don't need this permission, be sure your <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+ targetSdkVersion}</a> is 4 or higher.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.READ_PHONE_STATE"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readPhoneState"
+ android:description="@string/permdesc_readPhoneState"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows read only access to phone state with a non dangerous permission,
+ including the information like cellular network type, software version. -->
+ <permission android:name="android.permission.READ_BASIC_PHONE_STATE"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readBasicPhoneState"
+ android:description="@string/permdesc_readBasicPhoneState"
+ android:protectionLevel="normal" />
+
+ <!-- Allows read access to the device's phone number(s). This is a subset of the capabilities
+ granted by {@link #READ_PHONE_STATE} but is exposed to instant applications.
+ <p>Protection level: dangerous-->
+ <permission android:name="android.permission.READ_PHONE_NUMBERS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_readPhoneNumbers"
+ android:description="@string/permdesc_readPhoneNumbers"
+ android:protectionLevel="dangerous|instant" />
+
+ <!-- Allows an application to initiate a phone call without going through
+ the Dialer user interface for the user to confirm the call.
+ <p class="note"><b>Note:</b> An app holding this permission can also call carrier MMI
+ codes to change settings such as call forwarding or call waiting preferences.</p>
+ <p>Protection level: dangerous</p>
+ -->
+ <permission android:name="android.permission.CALL_PHONE"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:permissionFlags="costsMoney"
+ android:label="@string/permlab_callPhone"
+ android:description="@string/permdesc_callPhone"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to add voicemails into the system.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="com.android.voicemail.permission.ADD_VOICEMAIL"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_addVoicemail"
+ android:description="@string/permdesc_addVoicemail"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to use SIP service.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.USE_SIP"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:description="@string/permdesc_use_sip"
+ android:label="@string/permlab_use_sip"
+ android:protectionLevel="dangerous"/>
+
+ <!-- Allows the app to answer an incoming phone call.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.ANSWER_PHONE_CALLS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_answerPhoneCalls"
+ android:description="@string/permdesc_answerPhoneCalls"
+ android:protectionLevel="dangerous|runtime" />
+
+ <!-- Allows a calling application which manages its own calls through the self-managed
+ {@link android.telecom.ConnectionService} APIs. See
+ {@link android.telecom.PhoneAccount#CAPABILITY_SELF_MANAGED} for more information on the
+ self-managed ConnectionService APIs.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.MANAGE_OWN_CALLS"
+ android:label="@string/permlab_manageOwnCalls"
+ android:description="@string/permdesc_manageOwnCalls"
+ android:protectionLevel="normal" />
+
+ <!--Allows an app which implements the
+ {@link android.telecom.InCallService InCallService} API to be eligible to be enabled as a
+ calling companion app. This means that the Telecom framework will bind to the app's
+ InCallService implementation when there are calls active. The app can use the InCallService
+ API to view information about calls on the system and control these calls.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.CALL_COMPANION_APP"
+ android:label="@string/permlab_callCompanionApp"
+ android:description="@string/permdesc_callCompanionApp"
+ android:protectionLevel="normal" />
+
+ <!-- Exempt this uid from restrictions to background audio recoding
+ <p>Protection level: signature|privileged
+ @hide
+ @SystemApi
+ -->
+ <permission android:name="android.permission.EXEMPT_FROM_AUDIO_RECORD_RESTRICTIONS"
+ android:label="@string/permlab_exemptFromAudioRecordRestrictions"
+ android:description="@string/permdesc_exemptFromAudioRecordRestrictions"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Allows a calling app to continue a call which was started in another app. An example is a
+ video calling app that wants to continue a voice call on the user's mobile network.<p>
+ When the handover of a call from one app to another takes place, there are two devices
+ which are involved in the handover; the initiating and receiving devices. The initiating
+ device is where the request to handover the call was started, and the receiving device is
+ where the handover request is confirmed by the other party.<p>
+ This permission protects access to the
+ {@link android.telecom.TelecomManager#acceptHandover(Uri, int, PhoneAccountHandle)} which
+ the receiving side of the handover uses to accept a handover.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.ACCEPT_HANDOVER"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android.label="@string/permlab_acceptHandover"
+ android:description="@string/permdesc_acceptHandovers"
+ android:protectionLevel="dangerous" />
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for accessing the device microphone -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Used for permissions that are associated with accessing
+ microphone audio from the device. Note that phone calls also capture audio
+ but are in a separate (more visible) permission group. -->
+ <permission-group android:name="android.permission-group.MICROPHONE"
+ android:icon="@drawable/perm_group_microphone"
+ android:label="@string/permgrouplab_microphone"
+ android:description="@string/permgroupdesc_microphone"
+ android:priority="600" />
+
+ <!-- Allows an application to record audio.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.RECORD_AUDIO"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_recordAudio"
+ android:description="@string/permdesc_recordAudio"
+ android:backgroundPermission="android.permission.RECORD_BACKGROUND_AUDIO"
+ android:protectionLevel="dangerous|instant" />
+
+ <!-- @SystemApi @TestApi Allows an application to record audio while in the background.
+ This permission is not intended to be held by apps.
+ <p>Protection level: internal
+ @hide -->
+ <permission android:name="android.permission.RECORD_BACKGROUND_AUDIO"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_recordBackgroundAudio"
+ android:description="@string/permdesc_recordBackgroundAudio"
+ android:protectionLevel="internal|role" />
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for activity recognition -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Used for permissions that are associated with activity recognition. -->
+ <permission-group android:name="android.permission-group.ACTIVITY_RECOGNITION"
+ android:icon="@drawable/perm_group_activity_recognition"
+ android:label="@string/permgrouplab_activityRecognition"
+ android:description="@string/permgroupdesc_activityRecognition"
+ android:priority="1000" />
+
+ <!-- Allows an application to recognize physical activity.
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.ACTIVITY_RECOGNITION"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_activityRecognition"
+ android:description="@string/permdesc_activityRecognition"
+ android:protectionLevel="dangerous|instant" />
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for accessing the vendor UCE Service -->
+ <!-- ====================================================================== -->
+
+ <!-- @hide Allows an application to Access UCE-Presence.
+ <p>Protection level: signature|privileged
+ @deprecated Framework should no longer use this permission to access the vendor UCE service
+ using AIDL, it is instead implemented by RcsCapabilityExchangeImplBase
+ -->
+ <permission android:name="android.permission.ACCESS_UCE_PRESENCE_SERVICE"
+ android:permissionGroup="android.permission-group.PHONE"
+ android:protectionLevel="signature|privileged"/>
+
+ <!-- @hide Allows an application to Access UCE-OPTIONS.
+ <p>Protection level: signature|privileged
+ @deprecated Framework should no longer use this permission to access the vendor UCE service
+ using AIDL, it is instead implemented by RcsCapabilityExchangeImplBase
+ -->
+ <permission android:name="android.permission.ACCESS_UCE_OPTIONS_SERVICE"
+ android:permissionGroup="android.permission-group.PHONE"
+ android:protectionLevel="signature|privileged"/>
+
+
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for accessing the device camera -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Used for permissions that are associated with accessing
+ camera or capturing images/video from the device. -->
+ <permission-group android:name="android.permission-group.CAMERA"
+ android:icon="@drawable/perm_group_camera"
+ android:label="@string/permgrouplab_camera"
+ android:description="@string/permgroupdesc_camera"
+ android:priority="700" />
+
+ <!-- Required to be able to access the camera device.
+ <p>This will automatically enforce the
+ <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">
+ uses-feature</a> manifest element for <em>all</em> camera features.
+ If you do not require all camera features or can properly operate if a camera
+ is not available, then you must modify your manifest as appropriate in order to
+ install on devices that don't support all camera features.</p>
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.CAMERA"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_camera"
+ android:description="@string/permdesc_camera"
+ android:backgroundPermission="android.permission.BACKGROUND_CAMERA"
+ android:protectionLevel="dangerous|instant" />
+
+ <!-- Required to be able to discover and connect to nearby Bluetooth devices.
+ <p>Protection level: dangerous -->
+ <permission-group android:name="android.permission-group.NEARBY_DEVICES"
+ android:icon="@drawable/perm_group_nearby_devices"
+ android:label="@string/permgrouplab_nearby_devices"
+ android:description="@string/permgroupdesc_nearby_devices"
+ android:priority="750" />
+
+ <!-- @SystemApi @TestApi Required to be able to access the camera device in the background.
+ This permission is not intended to be held by apps.
+ <p>Protection level: internal
+ @hide -->
+ <permission android:name="android.permission.BACKGROUND_CAMERA"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_backgroundCamera"
+ android:description="@string/permdesc_backgroundCamera"
+ android:protectionLevel="internal|role" />
+
+ <!-- @SystemApi Required in addition to android.permission.CAMERA to be able to access
+ system only camera devices.
+ <p>Protection level: system|signature|role
+ @hide -->
+ <permission android:name="android.permission.SYSTEM_CAMERA"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_systemCamera"
+ android:description="@string/permdesc_systemCamera"
+ android:protectionLevel="system|signature|role" />
+
+ <!-- @SystemApi Allows receiving the camera service notifications when a camera is opened
+ (by a certain application package) or closed.
+ @hide -->
+ <permission android:name="android.permission.CAMERA_OPEN_CLOSE_LISTENER"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_cameraOpenCloseListener"
+ android:description="@string/permdesc_cameraOpenCloseListener"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows camera access by Headless System User 0 when device is running in
+ HSUM Mode.
+ @FlaggedApi("com.android.internal.camera.flags.camera_hsum_permission")
+ @hide -->
+ <permission android:name="android.permission.CAMERA_HEADLESS_SYSTEM_USER"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_cameraHeadlessSystemUser"
+ android:description="@string/permdesc_cameraHeadlessSystemUser"
+ android:protectionLevel="signature"
+ android:featureFlag="com.android.internal.camera.flags.camera_hsum_permission" />
+
+
+ <!-- @SystemApi Allows camera access of allowlisted driver assistance apps
+ to be controlled separately.
+ <p> Not for use by third-party applications.
+ @FlaggedApi("com.android.internal.camera.flags.camera_privacy_allowlist")
+ @hide
+ -->
+ <permission android:name="android.permission.CAMERA_PRIVACY_ALLOWLIST"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for accessing the device sensors -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Used for permissions that are associated with accessing
+ body or environmental sensors. -->
+ <permission-group android:name="android.permission-group.SENSORS"
+ android:icon="@drawable/perm_group_sensors"
+ android:label="@string/permgrouplab_sensors"
+ android:description="@string/permgroupdesc_sensors"
+ android:priority="800" />
+
+ <!-- Allows an app to access sensor data with a sampling rate greater than 200 Hz.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS"
+ android:permissionGroup="android.permission-group.SENSORS"
+ android:label="@string/permlab_highSamplingRateSensors"
+ android:description="@string/permdesc_highSamplingRateSensors"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an application to access data from sensors that the user uses to
+ measure what is happening inside their body, such as heart rate.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.BODY_SENSORS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_bodySensors"
+ android:description="@string/permdesc_bodySensors"
+ android:backgroundPermission="android.permission.BODY_SENSORS_BACKGROUND"
+ android:protectionLevel="dangerous" />
+
+ <!-- Allows an application to access data from sensors that the user uses to measure what is
+ happening inside their body, such as heart rate. If you're requesting this permission, you
+ must also request {@link #BODY_SENSORS}. Requesting this permission by itself doesn't give
+ you Body sensors access.
+ <p>Protection level: dangerous
+
+ <p> This is a hard restricted permission which cannot be held by an app until
+ the installer on record allowlists the permission. For more details see
+ {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}.
+ -->
+ <permission android:name="android.permission.BODY_SENSORS_BACKGROUND"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_bodySensors_background"
+ android:description="@string/permdesc_bodySensors_background"
+ android:protectionLevel="dangerous"
+ android:permissionFlags="hardRestricted" />
+
+ <!-- Allows an app to use fingerprint hardware.
+ <p>Protection level: normal
+ @deprecated Applications should request {@link
+ android.Manifest.permission#USE_BIOMETRIC} instead
+ -->
+ <permission android:name="android.permission.USE_FINGERPRINT"
+ android:permissionGroup="android.permission-group.SENSORS"
+ android:label="@string/permlab_useFingerprint"
+ android:description="@string/permdesc_useFingerprint"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an app to use device supported biometric modalities.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.USE_BIOMETRIC"
+ android:permissionGroup="android.permission-group.SENSORS"
+ android:label="@string/permlab_useBiometric"
+ android:description="@string/permdesc_useBiometric"
+ android:protectionLevel="normal" />
+
+ <!-- ====================================================================== -->
+ <!-- Permissions for posting notifications -->
+ <!-- ====================================================================== -->
+ <eat-comment />
+
+ <!-- Used for permissions that are associated with posting notifications
+ -->
+ <permission-group android:name="android.permission-group.NOTIFICATIONS"
+ android:icon="@drawable/ic_notifications_alerted"
+ android:label="@string/permgrouplab_notifications"
+ android:description="@string/permgroupdesc_notifications"
+ android:priority="850" />
+
+ <!-- Allows an app to post notifications
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.POST_NOTIFICATIONS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:label="@string/permlab_postNotification"
+ android:description="@string/permdesc_postNotification"
+ android:protectionLevel="dangerous|instant" />
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
+
+ <!-- ====================================================================== -->
+ <!-- REMOVED PERMISSIONS -->
+ <!-- ====================================================================== -->
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.READ_PROFILE"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.WRITE_PROFILE"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.READ_SOCIAL_STREAM"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.WRITE_SOCIAL_STREAM"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.READ_USER_DICTIONARY"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.WRITE_USER_DICTIONARY"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @SystemApi @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.WRITE_SMS"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.MANAGE_ACCOUNTS"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.USE_CREDENTIALS"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.SUBSCRIBED_FEEDS_READ"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.SUBSCRIBED_FEEDS_WRITE"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- @hide We need to keep this around for backwards compatibility -->
+ <permission android:name="android.permission.FLASHLIGHT"
+ android:protectionLevel="normal"
+ android:permissionFlags="removed"/>
+
+ <!-- ====================================================================== -->
+ <!-- INSTALL PERMISSIONS -->
+ <!-- ====================================================================== -->
+
+ <!-- ================================== -->
+ <!-- Permissions for accessing messages -->
+ <!-- ================================== -->
+ <eat-comment />
+
+ <!-- Allows an application (Phone) to send a request to other applications
+ to handle the respond-via-message action during incoming calls.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.SEND_RESPOND_VIA_MESSAGE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to send SMS to premium shortcodes without user permission.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.SEND_SMS_NO_CONFIRMATION"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to filter carrier specific sms.
+ @hide -->
+ <permission android:name="android.permission.CARRIER_FILTER_SMS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to receive emergency cell broadcast messages,
+ to record or display them to the user.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.RECEIVE_EMERGENCY_BROADCAST"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to monitor incoming Bluetooth MAP messages, to record
+ or perform processing on them. -->
+ <!-- @hide -->
+ <permission android:name="android.permission.RECEIVE_BLUETOOTH_MAP"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows an application to execute contacts directory search.
+ This should only be used by ContactsProvider.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.BIND_DIRECTORY_SEARCH"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows an application to modify the cell broadcasts configuration
+ (i.e. enable or disable channels).
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MODIFY_CELL_BROADCASTS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- =============================================================== -->
+ <!-- Permissions for setting the device alarm -->
+ <!-- =============================================================== -->
+ <eat-comment />
+
+ <!-- Allows an application to broadcast an Intent to set an alarm for the user.
+ <p>Protection level: normal
+ -->
+ <permission android:name="com.android.alarm.permission.SET_ALARM"
+ android:label="@string/permlab_setAlarm"
+ android:description="@string/permdesc_setAlarm"
+ android:protectionLevel="normal" />
+
+ <!-- =============================================================== -->
+ <!-- Permissions for accessing the user voicemail -->
+ <!-- =============================================================== -->
+ <eat-comment />
+
+ <!-- Allows an application to modify and remove existing voicemails in the system.
+ <p>Protection level: signature|privileged|role
+ -->
+ <permission android:name="com.android.voicemail.permission.WRITE_VOICEMAIL"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Allows an application to read voicemails in the system.
+ <p>Protection level: signature|privileged|role
+ -->
+ <permission android:name="com.android.voicemail.permission.READ_VOICEMAIL"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- ======================================= -->
+ <!-- Permissions for accessing location info -->
+ <!-- ======================================= -->
+ <eat-comment />
+
+ <!-- Allows an application to access extra location provider commands.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"
+ android:label="@string/permlab_accessLocationExtraCommands"
+ android:description="@string/permdesc_accessLocationExtraCommands"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an application to install a location provider into the Location Manager.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.INSTALL_LOCATION_PROVIDER"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows an application to provide location-based time zone suggestions to
+ the system server. This is needed because the system server discovers time zone providers
+ by exposed intent actions and metadata, without it any app could potentially register
+ itself as time zone provider. The system server checks for this permission.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows an application to bind to a android.service.TimeZoneProviderService
+ for the purpose of detecting the device's time zone. This prevents arbitrary clients
+ connecting to the time zone provider service. The system server checks that the provider's
+ intent service explicitly sets this permission via the android:permission attribute of the
+ service.
+ This is only expected to be possessed by the system server outside of tests.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.BIND_TIME_ZONE_PROVIDER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows HDMI-CEC service to access device and configuration files.
+ This should only be used by HDMI-CEC service.
+ -->
+ <permission android:name="android.permission.HDMI_CEC"
+ android:protectionLevel="signature|privileged|vendorPrivileged" />
+
+ <!-- Allows an application to use location features in hardware,
+ such as the geofencing api.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.LOCATION_HARDWARE"
+ android:protectionLevel="signature|privileged|role" />
+ <uses-permission android:name="android.permission.LOCATION_HARDWARE"/>
+
+ <!-- @SystemApi Allows an application to use the Context Hub.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.ACCESS_CONTEXT_HUB"
+ android:protectionLevel="signature|privileged" />
+ <uses-permission android:name="android.permission.ACCESS_CONTEXT_HUB"/>
+
+ <!-- @SystemApi Allows an application to create mock location providers for testing.
+ <p>Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.ACCESS_MOCK_LOCATION"
+ android:protectionLevel="signature" />
+
+ <!-- @hide @SystemApi(client=android.annotation.SystemApi.Client.MODULE_LIBRARIES)
+ Allows automotive applications to control location
+ suspend state for power management use cases.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.CONTROL_AUTOMOTIVE_GNSS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- ======================================= -->
+ <!-- Permissions for accessing networks -->
+ <!-- ======================================= -->
+ <eat-comment />
+
+ <!-- Allows applications to open network sockets.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.INTERNET"
+ android:description="@string/permdesc_createNetworkSockets"
+ android:label="@string/permlab_createNetworkSockets"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows applications to access information about networks.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.ACCESS_NETWORK_STATE"
+ android:description="@string/permdesc_accessNetworkState"
+ android:label="@string/permlab_accessNetworkState"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows applications to access information about Wi-Fi networks.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.ACCESS_WIFI_STATE"
+ android:description="@string/permdesc_accessWifiState"
+ android:label="@string/permlab_accessWifiState"
+ android:protectionLevel="normal" />
+
+ <!-- Allows applications to change Wi-Fi connectivity state.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.CHANGE_WIFI_STATE"
+ android:description="@string/permdesc_changeWifiState"
+ android:label="@string/permlab_changeWifiState"
+ android:protectionLevel="normal" />
+
+ <!-- This permission is used to let OEMs grant their trusted app access to a subset of
+ privileged wifi APIs to improve wifi performance. Allows applications to manage
+ Wi-Fi network selection related features such as enable or disable global auto-join,
+ modify connectivity scan intervals, and approve Wi-Fi Direct connections.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MANAGE_WIFI_NETWORK_SELECTION"
+ android:protectionLevel="signature|privileged|knownSigner"
+ android:knownCerts="@array/wifi_known_signers" />
+
+ <!-- Allows applications to get notified when a Wi-Fi interface request cannot
+ be satisfied without tearing down one or more other interfaces, and provide a decision
+ whether to approve the request or reject it.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MANAGE_WIFI_INTERFACES"
+ android:protectionLevel="signature|privileged|knownSigner"
+ android:knownCerts="@array/wifi_known_signers" />
+
+ <!-- @SystemApi @hide Allows apps to create and manage IPsec tunnels.
+ <p>Only granted to applications that are currently bound by the
+ system for creating and managing IPsec-based interfaces.
+ -->
+ <permission android:name="android.permission.MANAGE_IPSEC_TUNNELS"
+ android:protectionLevel="signature|appop" />
+
+ <!-- @SystemApi @hide Allows apps to create and manage Test Networks.
+ <p>Granted only to shell. CTS tests will use
+ UiAutomation.AdoptShellPermissionIdentity() to gain access.
+ -->
+ <permission android:name="android.permission.MANAGE_TEST_NETWORKS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows direct access to the <RemoteAuth>Service interfaces.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_REMOTE_AUTH"
+ android:protectionLevel="signature" />
+
+ <!-- Allows direct access to the <RemoteAuth>Service authentication methods.
+ @hide -->
+ <permission android:name="android.permission.USE_REMOTE_AUTH"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows applications to read Wi-Fi credential.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.READ_WIFI_CREDENTIAL"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows applications to change tether state and run
+ tether carrier provisioning.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.TETHER_PRIVILEGED"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allow system apps to receive broadcast
+ when a wifi network credential is changed.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.RECEIVE_WIFI_CREDENTIAL_CHANGE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to modify any wifi configuration, even if created
+ by another application. Once reconfigured the original creator cannot make any further
+ modifications.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.OVERRIDE_WIFI_CONFIG"
+ android:protectionLevel="signature|privileged|knownSigner"
+ android:knownCerts="@array/wifi_known_signers" />
+
+ <!-- @deprecated Allows applications to act as network scorers. @hide @SystemApi-->
+ <permission android:name="android.permission.SCORE_NETWORKS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @deprecated Allows applications to request network
+ recommendations and scores from the NetworkScoreService.
+ @SystemApi
+ <p>Not for use by third-party applications. @hide -->
+ <permission android:name="android.permission.REQUEST_NETWORK_SCORES"
+ android:protectionLevel="signature|setup" />
+
+ <!-- Allows applications to restart the Wi-Fi subsystem.
+ @SystemApi
+ <p>Not for use by third-party applications. @hide -->
+ <permission android:name="android.permission.RESTART_WIFI_SUBSYSTEM"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows applications to toggle airplane mode.
+ <p>Not for use by third-party or privileged applications.
+ -->
+ <permission android:name="android.permission.NETWORK_AIRPLANE_MODE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows network stack services (Connectivity and Wifi) to coordinate
+ <p>Not for use by third-party or privileged applications.
+ @SystemApi @TestApi
+ @hide This should only be used by Connectivity and Wifi Services.
+ -->
+ <permission android:name="android.permission.NETWORK_STACK"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows an application to observe network policy changes. -->
+ <permission android:name="android.permission.OBSERVE_NETWORK_POLICY"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows applications to register network factory or agent -->
+ <permission android:name="android.permission.NETWORK_FACTORY"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi @hide Allows applications to access network stats provider -->
+ <permission android:name="android.permission.NETWORK_STATS_PROVIDER"
+ android:protectionLevel="signature" />
+
+ <!-- Allows Settings and SystemUI to call methods in Networking services
+ <p>Not for use by third-party or privileged applications.
+ @SystemApi @TestApi
+ @hide This should only be used by Settings and SystemUI.
+ -->
+ <permission android:name="android.permission.NETWORK_SETTINGS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows holder to request bluetooth/wifi scan bypassing global "use location" setting and
+ location permissions.
+ <p>Not for use by third-party or privileged applications.
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.RADIO_SCAN_WITHOUT_LOCATION"
+ android:protectionLevel="signature|companion" />
+
+ <!-- Allows SetupWizard to call methods in Networking services
+ <p>Not for use by any other third-party or privileged applications.
+ @SystemApi
+ @hide This should only be used by SetupWizard.
+ -->
+ <permission android:name="android.permission.NETWORK_SETUP_WIZARD"
+ android:protectionLevel="signature|setup" />
+
+ <!-- Allows Managed Provisioning to call methods in Networking services
+ <p>Not for use by any other third-party or privileged applications.
+ @SystemApi
+ @hide This should only be used by ManagedProvisioning app.
+ -->
+ <permission android:name="android.permission.NETWORK_MANAGED_PROVISIONING"
+ android:protectionLevel="signature|role" />
+
+ <!-- Allows Carrier Provisioning to call methods in Networking services
+ <p>Not for use by any other third-party or privileged applications.
+ @SystemApi
+ @hide This should only be used by CarrierProvisioning.
+ -->
+ <permission android:name="android.permission.NETWORK_CARRIER_PROVISIONING"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- #SystemApi @hide Allows applications to access information about LoWPAN interfaces.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.ACCESS_LOWPAN_STATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- #SystemApi @hide Allows applications to change LoWPAN connectivity state.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.CHANGE_LOWPAN_STATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- #SystemApi @hide Allows applications to read LoWPAN credential.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.READ_LOWPAN_CREDENTIAL"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- #SystemApi @hide Allows a service to register or unregister
+ new LoWPAN interfaces.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MANAGE_LOWPAN_INTERFACES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows changing Thread network state and access to Thread network
+ credentials such as Network Key and PSKc.
+ <p>Not for use by third-party applications.
+ @FlaggedApi("com.android.net.thread.flags.thread_enabled_platform") -->
+ <permission android:name="android.permission.THREAD_NETWORK_PRIVILEGED"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- #SystemApi @hide Allows an app to bypass Private DNS.
+ <p>Not for use by third-party applications.
+ TODO: publish as system API in next API release. -->
+ <permission android:name="android.permission.NETWORK_BYPASS_PRIVATE_DNS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows device mobility state to be set so that Wifi scan interval can
+ be increased when the device is stationary in order to save power.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.WIFI_SET_DEVICE_MOBILITY_STATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows privileged system APK to update Wifi usability stats and score.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.WIFI_UPDATE_USABILITY_STATS_SCORE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows applications to update Wifi/Cellular coex channels to avoid.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.WIFI_UPDATE_COEX_UNSAFE_CHANNELS"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi @hide Allows applications to access Wifi/Cellular coex channels being avoided.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi @hide Allows system APK to manage country code.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MANAGE_WIFI_COUNTRY_CODE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows an application to manage an automotive device's application network
+ preference as it relates to OEM_PAID and OEM_PRIVATE capable networks.
+ <p>Not for use by third-party or privileged applications. -->
+ <permission android:name="android.permission.CONTROL_OEM_PAID_NETWORK_PREFERENCE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows an application to manage ethernet networks.
+ <p>Not for use by third-party or privileged applications. -->
+ <permission android:name="android.permission.MANAGE_ETHERNET_NETWORKS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows system apps to call methods to register itself as a mDNS offload engine.
+ <p>Not for use by third-party or privileged applications.
+ @SystemApi
+ @FlaggedApi("com.android.net.flags.register_nsd_offload_engine")
+ @hide This should only be used by system apps.
+ -->
+ <permission android:name="android.permission.REGISTER_NSD_OFFLOAD_ENGINE"
+ android:protectionLevel="signature"
+ android:featureFlag="com.android.net.flags.register_nsd_offload_engine" />
+
+ <!-- ======================================= -->
+ <!-- Permissions for short range, peripheral networks -->
+ <!-- ======================================= -->
+ <eat-comment />
+
+ <!-- Allows applications to connect to paired bluetooth devices.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.BLUETOOTH"
+ android:description="@string/permdesc_bluetooth"
+ android:label="@string/permlab_bluetooth"
+ android:protectionLevel="normal" />
+
+ <!-- Required to be able to discover and pair nearby Bluetooth devices.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.BLUETOOTH_SCAN"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:description="@string/permdesc_bluetooth_scan"
+ android:label="@string/permlab_bluetooth_scan"
+ android:protectionLevel="dangerous" />
+
+ <!-- Required to be able to connect to paired Bluetooth devices.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.BLUETOOTH_CONNECT"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:description="@string/permdesc_bluetooth_connect"
+ android:label="@string/permlab_bluetooth_connect"
+ android:protectionLevel="dangerous" />
+
+ <!-- Required to be able to advertise to nearby Bluetooth devices.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.BLUETOOTH_ADVERTISE"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:description="@string/permdesc_bluetooth_advertise"
+ android:label="@string/permlab_bluetooth_advertise"
+ android:protectionLevel="dangerous" />
+
+ <!-- Required to be able to range to devices using ultra-wideband.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.UWB_RANGING"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:description="@string/permdesc_uwb_ranging"
+ android:label="@string/permlab_uwb_ranging"
+ android:protectionLevel="dangerous" />
+
+ <!-- Required to be able to advertise and connect to nearby devices via Wi-Fi.
+ <p>Protection level: dangerous -->
+ <permission android:name="android.permission.NEARBY_WIFI_DEVICES"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:description="@string/permdesc_nearby_wifi_devices"
+ android:label="@string/permlab_nearby_wifi_devices"
+ android:protectionLevel="dangerous" />
+
+ <!-- @SystemApi @TestApi Allows an application to suspend other apps, which will prevent the
+ user from using them until they are unsuspended.
+ @hide
+ -->
+ <permission android:name="android.permission.SUSPEND_APPS"
+ android:protectionLevel="signature|role|verifier" />
+
+ <!-- @SystemApi
+ @hide
+ @FlaggedApi("android.content.pm.quarantined_enabled")
+ Allows an application to quarantine other apps, which will prevent
+ them from running without explicit user action.
+ -->
+ <permission android:name="android.permission.QUARANTINE_APPS"
+ android:protectionLevel="signature|verifier"
+ android:featureFlag="android.content.pm.quarantined_enabled" />
+
+ <!-- Allows applications to discover and pair bluetooth devices.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.BLUETOOTH_ADMIN"
+ android:description="@string/permdesc_bluetoothAdmin"
+ android:label="@string/permlab_bluetoothAdmin"
+ android:protectionLevel="normal" />
+
+ <!-- Allows applications to pair bluetooth devices without user interaction, and to
+ allow or disallow phonebook access or message access.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.BLUETOOTH_PRIVILEGED"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Control access to email providers exclusively for Bluetooth
+ @hide
+ -->
+ <permission android:name="android.permission.BLUETOOTH_MAP"
+ android:protectionLevel="signature|role" />
+
+ <!-- Allows bluetooth stack to access files
+ This should only be granted to the Bluetooth apk.
+ @hide @SystemApi(client=android.annotation.SystemApi.Client.MODULE_LIBRARIES)
+ -->
+ <permission android:name="android.permission.BLUETOOTH_STACK"
+ android:protectionLevel="signature|role" />
+
+ <!-- Allows uhid write access for creating virtual input devices
+ @hide
+ -->
+ <permission android:name="android.permission.VIRTUAL_INPUT_DEVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows applications to perform I/O operations over NFC.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.NFC"
+ android:description="@string/permdesc_nfc"
+ android:label="@string/permlab_nfc"
+ android:protectionLevel="normal" />
+
+ <!-- Allows applications to receive NFC transaction events.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.NFC_TRANSACTION_EVENT"
+ android:description="@string/permdesc_nfcTransactionEvent"
+ android:label="@string/permlab_nfcTransactionEvent"
+ android:protectionLevel="normal" />
+
+ <!-- Allows applications to receive NFC preferred payment service information.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.NFC_PREFERRED_PAYMENT_INFO"
+ android:description="@string/permdesc_preferredPaymentInfo"
+ android:label="@string/permlab_preferredPaymentInfo"
+ android:protectionLevel="normal" />
+
+ <!-- @SystemApi Allows access to set NFC controller always on states.
+ <p>Protection level: signature|privileged
+ @hide -->
+ <permission android:name="android.permission.NFC_SET_CONTROLLER_ALWAYS_ON"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an internal user to use privileged SecureElement APIs.
+ Applications holding this permission can access OMAPI reset system API
+ and bypass OMAPI AccessControlEnforcer.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.SECURE_ELEMENT_PRIVILEGED_OPERATION"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @deprecated This permission used to allow too broad access to sensitive methods and all its
+ uses have been replaced by a more appropriate permission. Most uses have been replaced with
+ a NETWORK_STACK or NETWORK_SETTINGS check. Please look up the documentation of the
+ individual functions to figure out what permission now protects the individual function.
+ @SystemApi Allows an internal user to use privileged ConnectivityManager APIs.
+ @hide -->
+ <permission android:name="android.permission.CONNECTIVITY_INTERNAL"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an internal user to use restricted Networks.
+ @hide -->
+ <permission android:name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS"
+ android:protectionLevel="signature|privileged" />
+ <uses-permission android:name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS"/>
+
+ <!-- @SystemApi Allows an internal user to set signal strength in NetworkRequest. This kind of
+ request will wake up device when signal strength meets the given value.
+ @hide -->
+ <permission android:name="android.permission.NETWORK_SIGNAL_STRENGTH_WAKEUP"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows a system application to access hardware packet offload capabilities.
+ @hide -->
+ <permission android:name="android.permission.PACKET_KEEPALIVE_OFFLOAD"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi
+ @hide -->
+ <permission android:name="android.permission.RECEIVE_DATA_ACTIVITY_CHANGE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows access to the loop radio (Android@Home mesh network) device.
+ @hide -->
+ <permission android:name="android.permission.LOOP_RADIO"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows sending and receiving handover transfer status from Wifi and Bluetooth
+ @hide -->
+ <permission android:name="android.permission.NFC_HANDOVER_STATUS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows internal management of Bluetooth state when on wireless consent mode.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_BLUETOOTH_WHEN_WIRELESS_CONSENT_REQUIRED"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows the device to be reset, clearing all data and enables Test Harness Mode. -->
+ <permission android:name="android.permission.ENABLE_TEST_HARNESS_MODE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows access to ultra wideband device.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.UWB_PRIVILEGED"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- ================================== -->
+ <!-- Permissions for accessing accounts -->
+ <!-- ================================== -->
+ <eat-comment />
+
+ <!-- Allows access to the list of accounts in the Accounts Service.
+
+ <p class="note"><strong>Note:</strong> Beginning with Android 6.0 (API level
+ 23), if an app shares the signature of the authenticator that manages an
+ account, it does not need <code>"GET_ACCOUNTS"</code> permission to read
+ information about that account. On Android 5.1 and lower, all apps need
+ <code>"GET_ACCOUNTS"</code> permission to read information about any
+ account.</p>
+
+ <p>Protection level: dangerous
+ -->
+ <permission android:name="android.permission.GET_ACCOUNTS"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:protectionLevel="dangerous"
+ android:description="@string/permdesc_getAccounts"
+ android:label="@string/permlab_getAccounts" />
+ <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
+
+ <!-- Allows applications to call into AccountAuthenticators.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.ACCOUNT_MANAGER"
+ android:protectionLevel="signature" />
+
+ <!-- ================================== -->
+ <!-- Permissions for accessing hardware that may effect battery life-->
+ <!-- ================================== -->
+ <eat-comment />
+
+ <!-- Allows applications to enter Wi-Fi Multicast mode.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"
+ android:description="@string/permdesc_changeWifiMulticastState"
+ android:label="@string/permlab_changeWifiMulticastState"
+ android:protectionLevel="normal" />
+
+ <!-- Allows access to the vibrator.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.VIBRATE"
+ android:label="@string/permlab_vibrate"
+ android:description="@string/permdesc_vibrate"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows access to the vibrator always-on settings.
+ <p>Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.VIBRATE_ALWAYS_ON"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows access to the vibrator state.
+ <p>Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.ACCESS_VIBRATOR_STATE"
+ android:label="@string/permdesc_vibrator_state"
+ android:description="@string/permdesc_vibrator_state"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows using PowerManager WakeLocks to keep processor from sleeping or screen
+ from dimming.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.WAKE_LOCK"
+ android:label="@string/permlab_wakeLock"
+ android:description="@string/permdesc_wakeLock"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows using the device's IR transmitter, if available.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.TRANSMIT_IR"
+ android:label="@string/permlab_transmitIr"
+ android:description="@string/permdesc_transmitIr"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an app to turn on the screen on, e.g. with
+ {@link android.os.PowerManager#ACQUIRE_CAUSES_WAKEUP}.
+ <p>Intended to only be used by home automation apps.
+ -->
+ <permission android:name="android.permission.TURN_SCREEN_ON"
+ android:label="@string/permlab_turnScreenOn"
+ android:description="@string/permdesc_turnScreenOn"
+ android:protectionLevel="signature|privileged|appop" />
+
+ <!-- ==================================================== -->
+ <!-- Permissions related to changing audio settings -->
+ <!-- ==================================================== -->
+ <eat-comment />
+
+ <!-- Allows an application to modify global audio settings.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"
+ android:label="@string/permlab_modifyAudioSettings"
+ android:description="@string/permdesc_modifyAudioSettings"
+ android:protectionLevel="normal" />
+
+ <!-- ==================================================== -->
+ <!-- Permissions related to screen capture -->
+ <!-- ==================================================== -->
+ <eat-comment />
+
+ <!-- Allows an application to capture screen content to perform a screenshot using the intent
+ action {@link android.content.Intent#ACTION_LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE}.
+ <p>Protection level: internal|role
+ <p>Intended for use by ROLE_NOTES only.
+ -->
+ <permission android:name="android.permission.LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to get notified when a screen capture of its windows is attempted.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.DETECT_SCREEN_CAPTURE"
+ android:label="@string/permlab_detectScreenCapture"
+ android:description="@string/permdesc_detectScreenCapture"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an application to get notified when it is being recorded.
+ <p>Protection level: normal
+ @FlaggedApi("com.android.window.flags.screen_recording_callbacks")
+ -->
+ <permission android:name="android.permission.DETECT_SCREEN_RECORDING"
+ android:protectionLevel="normal"
+ android:featureFlag="com.android.window.flags.screen_recording_callbacks" />
+
+ <!-- ======================================== -->
+ <!-- Permissions for factory reset protection -->
+ <!-- ======================================== -->
+ <eat-comment />
+
+ <!-- @SystemApi Allows an application to set a factory reset protection (FRP) policy.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.MANAGE_FACTORY_RESET_PROTECTION"
+ android:protectionLevel="signature|privileged"/>
+
+ <!-- ======================================== -->
+ <!-- Permissions for lost mode -->
+ <!-- ======================================== -->
+ <eat-comment />
+
+ <!-- @SystemApi Allows an application to trigger lost mode on an organization-owned device.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.TRIGGER_LOST_MODE"
+ android:protectionLevel="signature|role"/>
+
+ <!-- ================================== -->
+ <!-- Permissions for accessing hardware -->
+ <!-- ================================== -->
+ <eat-comment />
+
+ <!-- @SystemApi Allows an application to manage preferences and permissions for USB devices
+ @hide -->
+ <permission android:name="android.permission.MANAGE_USB"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to manage Android Debug Bridge settings.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_DEBUGGING"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to access the MTP USB kernel driver.
+ For use only by the device side MTP implementation.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_MTP"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows access to hardware peripherals. Intended only for hardware testing.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.HARDWARE_TEST"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to manage DynamicSystem image -->
+ <permission android:name="android.permission.MANAGE_DYNAMIC_SYSTEM"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to install a DynamicSystem image and get status updates.
+ @hide -->
+ <permission android:name="android.permission.INSTALL_DYNAMIC_SYSTEM"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows access to Broadcast Radio
+ @hide This is not a third-party API (intended for system apps).-->
+ <permission android:name="android.permission.ACCESS_BROADCAST_RADIO"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @deprecated @SystemApi Allows access to FM
+ @hide This is not a third-party API (intended for system apps).-->
+ <permission android:name="android.permission.ACCESS_FM_RADIO"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows access to configure network interfaces, configure/use IPSec, etc.
+ @hide -->
+ <permission android:name="android.permission.NET_ADMIN"
+ android:protectionLevel="signature|role" />
+
+ <!-- Allows registration for remote audio playback. @hide -->
+ <permission android:name="android.permission.REMOTE_AUDIO_PLAYBACK"
+ android:protectionLevel="signature" />
+
+ <!-- Allows TvInputService to access underlying TV input hardware such as
+ built-in tuners and HDMI-in's.
+ <p>This should only be used by OEM's TvInputService's.
+ @hide @SystemApi -->
+ <permission android:name="android.permission.TV_INPUT_HARDWARE"
+ android:protectionLevel="signature|privileged|vendorPrivileged" />
+
+ <!-- Allows to capture a frame of TV input hardware such as
+ built-in tuners and HDMI-in's.
+ <p>Not for use by third-party applications.
+ @hide @SystemApi -->
+ <permission android:name="android.permission.CAPTURE_TV_INPUT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide Allows TvInputService to access DVB device.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.DVB_DEVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows reading and enabling/disabling the OEM unlock allowed by carrier state
+ @hide <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows reading and enabling/disabling the OEM unlock allowed by user state
+ @hide <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MANAGE_USER_OEM_UNLOCK_STATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows reading the OEM unlock state
+ @hide <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.READ_OEM_UNLOCK_STATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide Allows enabling/disabling OEM unlock
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.OEM_UNLOCK_STATE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows configuration of factory reset protection
+ @FlaggedApi("android.security.frp_enforcement")
+ @hide <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.CONFIGURE_FACTORY_RESET_PROTECTION"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows querying state of PersistentDataBlock
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.ACCESS_PDB_STATE"
+ android:protectionLevel="signature|role" />
+
+ <!-- Allows testing if a passwords is forbidden by the admins.
+ @hide <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.TEST_BLACKLISTED_PASSWORD"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows system update service to notify device owner about pending updates.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.NOTIFY_PENDING_SYSTEM_UPDATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- =========================================== -->
+ <!-- Permissions associated with camera and image capture -->
+ <!-- =========================================== -->
+ <eat-comment />
+
+ <!-- @SystemApi Allows disabling the transmit-indicator LED that is normally on when
+ a camera is in use by an application.
+ @hide -->
+ <permission android:name="android.permission.CAMERA_DISABLE_TRANSMIT_LED"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows sending the camera service notifications about system-wide events.
+ @hide -->
+ <permission android:name="android.permission.CAMERA_SEND_SYSTEM_EVENTS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows injecting the external camera to replace the internal camera.
+ @hide -->
+ <permission android:name="android.permission.CAMERA_INJECT_EXTERNAL_CAMERA"
+ android:protectionLevel="signature" />
+
+ <!-- =========================================== -->
+ <!-- Permissions associated with telephony state -->
+ <!-- =========================================== -->
+ <eat-comment />
+
+ <!-- @SystemApi Allows granting runtime permissions to telephony related components.
+ @hide -->
+ <permission android:name="android.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows modification of the telephony state - power on, mmi, etc.
+ Does not include placing calls.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MODIFY_PHONE_STATE"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Allows read only access to precise phone state.
+ Allows reading of detailed information about phone state for special-use applications
+ such as dialers, carrier applications, or ims applications. -->
+ <permission android:name="android.permission.READ_PRECISE_PHONE_STATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @TestApi Allows read access to privileged phone state.
+ @hide Used internally. -->
+ <permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Allows to read device identifiers and use ICC based authentication like EAP-AKA.
+ Often required in authentication to access the carrier's server and manage services
+ of the subscriber.
+ <p>Protection level: signature|appop -->
+ <permission android:name="android.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER"
+ android:protectionLevel="signature|appop" />
+
+ <!-- @SystemApi Allows read access to emergency number information for ongoing calls or SMS
+ sessions.
+ @hide Used internally. -->
+ <permission android:name="android.permission.READ_ACTIVE_EMERGENCY_SESSION"
+ android:protectionLevel="signature" />
+
+ <!-- Allows listen permission to always reported system signal strength.
+ @hide Used internally. -->
+ <permission android:name="android.permission.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Protects the ability to register any PhoneAccount with
+ PhoneAccount#CAPABILITY_SIM_SUBSCRIPTION. This capability indicates that the PhoneAccount
+ corresponds to a device SIM.
+ @hide -->
+ <permission android:name="android.permission.REGISTER_SIM_SUBSCRIPTION"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Protects the ability to register any PhoneAccount with
+ PhoneAccount#CAPABILITY_CALL_PROVIDER.
+ @hide -->
+ <permission android:name="android.permission.REGISTER_CALL_PROVIDER"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Protects the ability to register any PhoneAccount with
+ PhoneAccount#CAPABILITY_CONNECTION_MANAGER
+ @hide -->
+ <permission android:name="android.permission.REGISTER_CONNECTION_MANAGER"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by a {@link android.telecom.InCallService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.BIND_INCALL_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by a {@link android.telecom.CallStreamingService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ @SystemApi @hide-->
+ <permission android:name="android.permission.BIND_CALL_STREAMING_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows to query ongoing call details and manage ongoing calls
+ <p>Protection level: signature|appop -->
+ <permission android:name="android.permission.MANAGE_ONGOING_CALLS"
+ android:protectionLevel="signature|appop"
+ android:label="@string/permlab_manageOngoingCalls"
+ android:description="@string/permdesc_manageOngoingCalls" />
+
+ <!-- Allows the app to request network scans from telephony.
+ <p>Not for use by third-party applications.
+ @SystemApi @hide-->
+ <permission android:name="android.permission.NETWORK_SCAN"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by a link {@link android.telephony.VisualVoicemailService} to ensure that
+ only the system can bind to it.
+ <p>Protection level: signature|privileged
+ -->
+ <permission
+ android:name="android.permission.BIND_VISUAL_VOICEMAIL_SERVICE"
+ android:protectionLevel="signature|privileged"/>
+
+ <!-- Must be required by a {@link android.telecom.CallScreeningService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.BIND_SCREENING_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by a {@link android.telecom.PhoneAccountSuggestionService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a {@link android.telecom.CallDiagnosticService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_CALL_DIAGNOSTIC_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a {@link android.telecom.CallRedirectionService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.BIND_CALL_REDIRECTION_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by a {@link android.telecom.ConnectionService},
+ to ensure that only the system can bind to it.
+ @deprecated {@link android.telecom.ConnectionService}s should require
+ android.permission.BIND_TELECOM_CONNECTION_SERVICE instead.
+ @SystemApi
+ @hide -->
+ <permission android:name="android.permission.BIND_CONNECTION_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by a {@link android.telecom.ConnectionService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.BIND_TELECOM_CONNECTION_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to control the in-call experience.
+ @hide -->
+ <permission android:name="android.permission.CONTROL_INCALL_EXPERIENCE"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Allows an application to receive STK related commands.
+ @hide -->
+ <permission android:name="android.permission.RECEIVE_STK_COMMANDS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to send EMBMS download intents to apps
+ @hide -->
+ <permission android:name="android.permission.SEND_EMBMS_INTENTS"
+ android:protectionLevel="signature|privileged" />
+
+
+ <!-- Allows internal management of the sensor framework
+ @hide -->
+ <permission android:name="android.permission.MANAGE_SENSORS"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a DomainSelectionService to ensure that only the
+ system can bind to it.
+ <p>Protection level: signature
+ @SystemApi
+ @hide
+ @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service")
+ -->
+ <permission android:name="android.permission.BIND_DOMAIN_SELECTION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an ImsService to ensure that only the
+ system can bind to it.
+ <p>Protection level: signature|privileged|vendorPrivileged
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_IMS_SERVICE"
+ android:protectionLevel="signature|privileged|vendorPrivileged" />
+
+ <!-- Must be required by a SatelliteService to ensure that only the
+ system can bind to it.
+ <p>Protection level: signature|privileged|vendorPrivileged
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_SATELLITE_SERVICE"
+ android:protectionLevel="signature|privileged|vendorPrivileged" />
+
+ <!-- Must be required by a SatelliteGatewayService to ensure that only the
+ system can bind to it.
+ <p>Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_SATELLITE_GATEWAY_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a telephony data service to ensure that only the
+ system can bind to it.
+ <p>Protection level: signature
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_TELEPHONY_DATA_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a NetworkService to ensure that only the
+ system can bind to it.
+ <p>Protection level: signature
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_TELEPHONY_NETWORK_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to manage embedded subscriptions (those on a eUICC)
+ through EuiccManager APIs.
+ <p>Protection level: signature|privileged|development
+ @hide
+ -->
+ <permission android:name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- @SystemApi Must be required by an EuiccService to ensure that only the system can bind to
+ it.
+ <p>Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_EUICC_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Required for reading information about carrier apps from SystemConfigManager.
+ <p>Protection level: signature
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.READ_CARRIER_APP_INFO"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an GbaService to ensure that only the
+ system can bind to it.
+ <p>Protection level: signature
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_GBA_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Required for an Application to access APIs related to RCS User Capability Exchange.
+ <p> This permission is only granted to system applications fulfilling the SMS, Dialer, and
+ Contacts app roles.
+ <p>Protection level: internal|role
+ @SystemApi
+ @hide -->
+ <permission android:name="android.permission.ACCESS_RCS_USER_CAPABILITY_EXCHANGE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Used to provide the Telecom framework with access to the last known call ID.
+ <p>Protection level: signature
+ @SystemApi
+ @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies")
+ @hide
+ -->
+ <permission android:name="android.permission.ACCESS_LAST_KNOWN_CELL_ID"
+ android:protectionLevel="signature"
+ android:label="@string/permlab_accessLastKnownCellId"
+ android:description="@string/permdesc_accessLastKnownCellId"/>
+
+ <!-- ================================== -->
+ <!-- Permissions for sdcard interaction -->
+ <!-- ================================== -->
+ <eat-comment />
+
+ <!-- @SystemApi @TestApi Allows an application to write to internal media storage
+ @deprecated This permission is no longer honored in the system and no longer adds
+ the media_rw gid as a supplementary gid to the holder. Use the
+ android.permission.MANAGE_EXTERNAL_STORAGE instead.
+ @hide -->
+ <permission android:name="android.permission.WRITE_MEDIA_STORAGE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to manage access to documents, usually as part
+ of a document picker.
+ <p>This permission should <em>only</em> be requested by the platform
+ document management app. This permission cannot be granted to
+ third-party apps.
+ -->
+ <permission android:name="android.permission.MANAGE_DOCUMENTS"
+ android:protectionLevel="signature|role" />
+
+ <!-- Allows an application to manage access to crates, usually as part
+ of a crates picker.
+ <p>This permission should <em>only</em> be requested by the platform
+ management app. This permission cannot be granted to
+ third-party apps.
+ @hide
+ @TestApi
+ -->
+ <permission android:name="android.permission.MANAGE_CRATES"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to cache content.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.CACHE_CONTENT"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi @hide
+ Allows an application to aggressively allocate disk space.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.ALLOCATE_AGGRESSIVE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide
+ Allows an application to use reserved disk space.
+ <p>Not for use by third-party applications. Should only be requested by
+ apps that provide core system functionality, to ensure system stability
+ when disk is otherwise completely full.
+ -->
+ <permission android:name="android.permission.USE_RESERVED_DISK"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- ================================== -->
+ <!-- Permissions for screenlock -->
+ <!-- ================================== -->
+ <eat-comment />
+
+ <!-- Allows applications to disable the keyguard if it is not secure.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.DISABLE_KEYGUARD"
+ android:description="@string/permdesc_disableKeyguard"
+ android:label="@string/permlab_disableKeyguard"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an application to request the screen lock complexity and prompt users to update the
+ screen lock to a certain complexity level.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.REQUEST_PASSWORD_COMPLEXITY"
+ android:label="@string/permlab_requestPasswordComplexity"
+ android:description="@string/permdesc_requestPasswordComplexity"
+ android:protectionLevel="normal" />
+
+ <!-- ================================== -->
+ <!-- Permissions to access other installed applications -->
+ <!-- ================================== -->
+ <eat-comment />
+
+ <!-- @deprecated No longer enforced. -->
+ <permission android:name="android.permission.GET_TASKS"
+ android:label="@string/permlab_getTasks"
+ android:description="@string/permdesc_getTasks"
+ android:protectionLevel="normal" />
+
+ <!-- New version of GET_TASKS that apps can request, since GET_TASKS doesn't really
+ give access to task information. We need this new one because there are
+ many existing apps that use add libraries and such that have validation
+ code to ensure the app has requested the GET_TASKS permission by seeing
+ if it has been granted the permission... if it hasn't, it kills the app
+ with a message about being upset. So we need to have it continue to look
+ like the app is getting that permission, even though it will never be
+ checked, and new privileged apps can now request this one for real access.
+ @hide
+ @SystemApi -->
+ <permission android:name="android.permission.REAL_GET_TASKS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to start a task from a ActivityManager#RecentTaskInfo.
+ @hide -->
+ <permission android:name="android.permission.START_TASKS_FROM_RECENTS"
+ android:protectionLevel="signature|privileged|recents" />
+
+ <!-- @SystemApi @hide Allows an application to call APIs that allow it to do interactions
+ across the users on the device, using singleton services and
+ user-targeted broadcasts. This permission is not available to
+ third party applications. -->
+ <permission android:name="android.permission.INTERACT_ACROSS_USERS"
+ android:protectionLevel="signature|privileged|development|role" />
+
+ <!-- @SystemApi Fuller form of {@link android.Manifest.permission#INTERACT_ACROSS_USERS}
+ that removes restrictions on where broadcasts can be sent and allows other
+ types of interactions
+ @hide -->
+ <permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"
+ android:protectionLevel="signature|installer|module|role" />
+ <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
+
+ <!-- Allows interaction across profiles in the same profile group. -->
+ <permission android:name="android.permission.INTERACT_ACROSS_PROFILES"
+ android:protectionLevel="signature|appop" />
+
+ <!-- Allows applications to access profiles with ACCESS_HIDDEN_PROFILES user property
+ <p>Protection level: normal
+ @FlaggedApi("android.multiuser.enable_permission_to_access_hidden_profiles") -->
+ <permission android:name="android.permission.ACCESS_HIDDEN_PROFILES"
+ android:label="@string/permlab_accessHiddenProfile"
+ android:description="@string/permdesc_accessHiddenProfile"
+ android:protectionLevel="normal" />
+
+ <!-- @SystemApi @hide Allows privileged applications to get details about hidden profile
+ users.
+ @FlaggedApi("android.multiuser.flags.enable_permission_to_access_hidden_profiles") -->
+ <permission
+ android:name="android.permission.ACCESS_HIDDEN_PROFILES_FULL"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows starting activities across profiles in the same profile group. -->
+ <permission android:name="android.permission.START_CROSS_PROFILE_ACTIVITIES"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows configuring apps to have the INTERACT_ACROSS_PROFILES permission so that
+ they can interact across profiles in the same profile group.
+ @hide -->
+ <permission android:name="android.permission.CONFIGURE_INTERACT_ACROSS_PROFILES"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi @hide Allows an application to call APIs that allow it to query and manage
+ users on the device. This permission is not available to
+ third party applications. -->
+ <permission android:name="android.permission.MANAGE_USERS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows an application to create, remove users and get the list of
+ users on the device. Applications holding this permission can create users (including
+ normal, restricted, guest, managed, and demo users) and can optionally endow them with the
+ ephemeral property. For creating users with other kinds of properties,
+ {@link android.Manifest.permission#MANAGE_USERS} is needed.
+ This permission is not available to third party applications. -->
+ <permission android:name="android.permission.CREATE_USERS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows an application to set user association
+ with a certain subscription. Used by Enterprise to associate a
+ subscription with a work or personal profile. -->
+ <permission android:name="android.permission.MANAGE_SUBSCRIPTION_USER_ASSOCIATION"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows an application to call APIs that allow it to query users on the
+ device. -->
+ <permission android:name="android.permission.QUERY_USERS"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Allows an application to access data blobs across users. -->
+ <permission android:name="android.permission.ACCESS_BLOBS_ACROSS_USERS"
+ android:protectionLevel="signature|privileged|development|role" />
+
+ <!-- @SystemApi @hide Allows an application to set the profile owners and the device owner.
+ This permission is not available to third party applications.-->
+ <permission android:name="android.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS"
+ android:protectionLevel="signature|role"
+ android:label="@string/permlab_manageProfileAndDeviceOwners"
+ android:description="@string/permdesc_manageProfileAndDeviceOwners" />
+
+ <!-- @SystemApi @hide Allows an application to query device policies set by any admin on
+ the device.-->
+ <permission android:name="android.permission.QUERY_ADMIN_POLICY"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi @hide Allows an application to exempt apps from platform restrictions.-->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_APP_EXEMPTIONS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage device policy relating to time.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.-->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_TIME"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set the grant state of runtime permissions on packages.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_RUNTIME_PERMISSIONS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage the identity of the managing organization.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_ORGANIZATION_IDENTITY"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set support messages for when a user action is affected by an
+ active policy.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_SUPPORT_MESSAGE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage backup service policy.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_BACKUP_SERVICE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage lock task policy.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_LOCK_TASK"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy regarding modifying applications.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_APPS_CONTROL"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage installing from unknown sources policy.
+ <p>MANAGE_SECURITY_CRITICAL_DEVICE_POLICY_ACROSS_USERS is required to call APIs protected
+ by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_INSTALL_UNKNOWN_SOURCES"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage application restrictions.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_APP_RESTRICTIONS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage calling policy.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_CALLS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage debugging features policy.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_DEBUGGING_FEATURES"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy preventing users from modifying users.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_MODIFY_USERS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage safe boot policy.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_SAFE_BOOT"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to restricting a user's ability to use or
+ enable and disable the microphone.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_MICROPHONE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to restricting a user's ability to use or
+ enable and disable the camera.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_CAMERA"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to keyguard.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_SECURITY_CRITICAL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_KEYGUARD"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to account management.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_ACCOUNT_MANAGEMENT"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to hiding and suspending packages.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_PACKAGE_STATE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to force set a new device unlock password or a managed profile
+ challenge on current user.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_RESET_PASSWORD"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to the status bar.-->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_STATUS_BAR"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to bluetooth.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_BLUETOOTH"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to fun.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_FUN"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to airplane mode.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_AIRPLANE_MODE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to mobile networks.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_MOBILE_NETWORK"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to physical media.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_PHYSICAL_MEDIA"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to sms.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_SMS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to usb file transfers.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_USB_FILE_TRANSFER"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to lock credentials.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_SECURITY_CRITICAL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to Wifi.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_WIFI"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to screen capture.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_SCREEN_CAPTURE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to input methods.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_INPUT_METHODS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to restricting the user from configuring
+ private DNS.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_RESTRICT_PRIVATE_DNS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to the default sms application.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_DEFAULT_SMS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to profiles.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_PROFILES"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to interacting with profiles (e.g. Disallowing
+ cross-profile copy and paste).
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_PROFILE_INTERACTION"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to VPNs.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_VPN"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to audio output.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_AUDIO_OUTPUT"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to the display.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_DISPLAY"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to location.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_LOCATION"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to factory reset.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_FACTORY_RESET"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to the wallpaper.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_WALLPAPER"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to the usage of the contents of the screen.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_SCREEN_CONTENT"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to system dialogs.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_SYSTEM_DIALOGS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to users running in the background.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_RUN_IN_BACKGROUND"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to printing.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_PRINTING"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to nearby communications (e.g. Beam and
+ nearby streaming).
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_NEARBY_COMMUNICATION"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to <a
+ href="https://www.threadgroup.org">Thread</a> network.
+ @FlaggedApi("com.android.net.thread.flags.thread_user_restriction_enabled")
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_THREAD_NETWORK"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to sending assist content to a
+ privileged app such as the Assistant app.
+ @FlaggedApi("android.app.admin.flags.assist_content_user_restriction_enabled")
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_ASSIST_CONTENT"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to windows.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_WINDOWS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to locale.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_LOCALE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to autofill.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_AUTOFILL"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to users.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_USERS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to certificates.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_CERTIFICATES"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to override APNs.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_OVERRIDE_APN"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to security logging.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_SECURITY_LOGGING"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to use audit logging API.
+ @hide
+ @SystemApi
+ @FlaggedApi("android.app.admin.flags.security_log_v2_enabled")
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_AUDIT_LOGGING"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to system updates.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_SYSTEM_UPDATES"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application query system updates.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_QUERY_SYSTEM_UPDATES"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to private DNS.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_PRIVATE_DNS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to settings.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_SETTINGS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to network logging.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_NETWORK_LOGGING"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to usb data signalling.-->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_USB_DATA_SIGNALLING"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to suspending personal apps.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_SUSPEND_PERSONAL_APPS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to keeping uninstalled packages.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is
+ required to call APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_KEEP_UNINSTALLED_PACKAGES"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to accessibility.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_ACCESSIBILITY"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to common criteria mode.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_COMMON_CRITERIA_MODE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to metered data.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_METERED_DATA"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set a network-independent global HTTP proxy.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_PROXY"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to request bugreports with user consent.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_BUGREPORT"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to application user data.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_APP_USER_DATA"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to lock a profile or the device with the appropriate cross-user
+ permission.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_LOCK"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to theft detection.
+ @FlaggedApi("android.app.admin.flags.device_theft_api_enabled")
+ @hide
+ @SystemApi
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_THEFT_DETECTION"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to system apps.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_SYSTEM_APPS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to wiping data.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS} is required to call
+ APIs protected by this permission on users different to the calling user.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_WIPE_DATA"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to the Memory Tagging Extension (MTE).
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_MTE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to device identifiers. -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_DEVICE_IDENTIFIERS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to content protection.
+ <p>Protection level: internal|role
+ @FlaggedApi("android.view.contentprotection.flags.manage_device_policy_enabled")
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_CONTENT_PROTECTION"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set policy related to subscriptions downloaded by an admin.
+ <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call
+ APIs protected by this permission on users different to the calling user.
+ @FlaggedApi("android.app.admin.flags.esim_management_enabled") -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to block package uninstallation.
+ @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled")
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_BLOCK_UNINSTALL"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to camera toggle.
+ @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled")
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_CAMERA_TOGGLE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to manage policy related to microphone toggle.
+ @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled")
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_MICROPHONE_TOGGLE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set device policies outside the current user
+ that are critical for securing data within the current user.
+ <p>Holding this permission allows the use of other held MANAGE_DEVICE_POLICY_*
+ permissions across all users on the device provided they are required for securing data
+ within the current user.-->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_ACROSS_USERS_SECURITY_CRITICAL"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set device policies outside the current user
+ that are required for securing device ownership without accessing user data.
+ <p>Holding this permission allows the use of other held MANAGE_DEVICE_POLICY_*
+ permissions across all users on the device provided they do not grant access to user
+ data. -->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_ACROSS_USERS"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to set device policies outside the current user.
+ <p>Fuller form of {@link android.Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS}
+ that removes the restriction on accessing user data.
+ <p>Holding this permission allows the use of any other held MANAGE_DEVICE_POLICY_*
+ permissions across all users on the device.-->
+ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to access EnhancedConfirmationManager.
+ @SystemApi
+ @FlaggedApi("android.permission.flags.enhanced_confirmation_mode_apis_enabled")
+ @hide This is not a third-party API (intended for OEMs and system apps). -->
+ <permission android:name="android.permission.MANAGE_ENHANCED_CONFIRMATION_STATES"
+ android:protectionLevel="signature|installer" />
+ <uses-permission android:name="android.permission.MANAGE_ENHANCED_CONFIRMATION_STATES" />
+
+ <!-- @SystemApi @hide Allows an application to set a device owner on retail demo devices.-->
+ <permission android:name="android.permission.PROVISION_DEMO_DEVICE"
+ android:protectionLevel="signature|setup|knownSigner"
+ android:knownCerts="@array/demo_device_provisioning_known_signers" />
+
+ <!-- @TestApi @hide Allows an application to reset the record of previous system update freeze
+ periods. -->
+ <permission android:name="android.permission.CLEAR_FREEZE_PERIOD"
+ android:protectionLevel="signature" />
+
+ <!-- @TestApi @hide Allows an application to force available DevicePolicyManager logs to
+ DPC. -->
+ <permission android:name="android.permission.FORCE_DEVICE_POLICY_MANAGER_LOGS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to get full detailed information about
+ recently running tasks, with full fidelity to the real state.
+ @hide -->
+ <permission android:name="android.permission.GET_DETAILED_TASKS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to change the Z-order of tasks.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.REORDER_TASKS"
+ android:label="@string/permlab_reorderTasks"
+ android:description="@string/permdesc_reorderTasks"
+ android:protectionLevel="normal" />
+
+ <!-- @SystemApi @TestApi @hide Allows an application to change to remove/kill tasks -->
+ <permission android:name="android.permission.REMOVE_TASKS"
+ android:protectionLevel="signature|recents|role" />
+
+ <!-- @deprecated Use MANAGE_ACTIVITY_TASKS instead.
+ @SystemApi @TestApi @hide Allows an application to create/manage/remove stacks -->
+ <permission android:name="android.permission.MANAGE_ACTIVITY_STACKS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @TestApi @hide Allows an application to create/manage/remove tasks -->
+ <permission android:name="android.permission.MANAGE_ACTIVITY_TASKS"
+ android:protectionLevel="signature|recents" />
+
+ <!-- @SystemApi @TestApi @hide Allows an application to embed other activities -->
+ <permission android:name="android.permission.ACTIVITY_EMBEDDING"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to embed any other apps in untrusted embedding mode without the need
+ for the embedded app to consent.
+ <p>For now, this permission is only granted to the Assistant application selected by
+ the user.
+ {@see https://developer.android.com/guide/topics/large-screens/activity-embedding#trust_model}
+ @SystemApi
+ @FlaggedApi("com.android.window.flags.untrusted_embedding_any_app_permission")
+ @hide
+ -->
+ <permission android:name="android.permission.EMBED_ANY_APP_IN_UNTRUSTED_MODE"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to start any activity, regardless of permission
+ protection or exported state.
+ @hide -->
+ <permission android:name="android.permission.START_ANY_ACTIVITY"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows an application to start activities from background -->
+ <permission android:name="android.permission.START_ACTIVITIES_FROM_BACKGROUND"
+ android:protectionLevel="signature|privileged|vendorPrivileged|oem|verifier|role" />
+
+ <!-- Allows an application to start foreground services from the background at any time.
+ <em>This permission is not for use by third-party applications</em>,
+ with the only exception being if the app is the default SMS app.
+ Otherwise, it's only usable by privileged apps, app verifier app, and apps with
+ any of the EMERGENCY or SYSTEM GALLERY roles.
+ -->
+ <permission android:name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND"
+ android:protectionLevel="signature|privileged|vendorPrivileged|oem|verifier|role"/>
+
+ <!-- Allows an application to request interactive options when sending a broadcast.
+ @hide -->
+ <permission android:name="android.permission.BROADCAST_OPTION_INTERACTIVE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Must be required by activities that handle the intent action
+ {@link Intent#ACTION_SEND_SHOW_SUSPENDED_APP_DETAILS}. This is for use by apps that
+ hold {@link Manifest.permission#SUSPEND_APPS} to interact with the system.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.SEND_SHOW_SUSPENDED_APP_DETAILS"
+ android:protectionLevel="signature" />
+ <uses-permission android:name="android.permission.SEND_SHOW_SUSPENDED_APP_DETAILS" />
+
+ <!-- Allows an application to start an activity as another app, provided that app has been
+ granted a permissionToken from the ActivityManagerService.
+ @hide -->
+ <permission android:name="android.permission.START_ACTIVITY_AS_CALLER"
+ android:protectionLevel="signature" />
+
+ <!-- @deprecated The {@link android.app.ActivityManager#restartPackage}
+ API is no longer supported. -->
+ <permission android:name="android.permission.RESTART_PACKAGES"
+ android:label="@string/permlab_killBackgroundProcesses"
+ android:description="@string/permdesc_killBackgroundProcesses"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an application to call
+ {@link android.app.ActivityManager#killBackgroundProcesses}.
+ <p>As of Android version {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE},
+ the {@link android.app.ActivityManager#killBackgroundProcesses} is no longer available to
+ third party applications. For backwards compatibility, the background processes of the
+ caller's own package will still be killed when calling this API. If the caller has
+ the system permission {@code KILL_ALL_BACKGROUND_PROCESSES}, other processes will be
+ killed too.
+
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"
+ android:label="@string/permlab_killBackgroundProcesses"
+ android:description="@string/permdesc_killBackgroundProcesses"
+ android:protectionLevel="normal" />
+
+ <!-- @SystemApi @hide Allows an application to call
+ {@link android.app.ActivityManager#killBackgroundProcesses}
+ to kill background processes of other apps.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.KILL_ALL_BACKGROUND_PROCESSES"
+ android:label="@string/permlab_killBackgroundProcesses"
+ android:description="@string/permdesc_killBackgroundProcesses"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows an application to query process states and current
+ OOM adjustment scores.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.GET_PROCESS_STATE_AND_OOM_SCORE"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Allows use of PendingIntent.getIntent(), .
+ @hide @SystemApi(client=android.annotation.SystemApi.Client.MODULE_LIBRARIES)
+ -->
+ <permission android:name="android.permission.GET_INTENT_SENDER_INTENT"
+ android:protectionLevel="signature" />
+
+ <!-- ================================== -->
+ <!-- Permissions affecting the display of other applications -->
+ <!-- ================================== -->
+ <eat-comment />
+
+ <!-- Allows an app to create windows using the type
+ {@link android.view.WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY},
+ shown on top of all other apps. Very few apps
+ should use this permission; these windows are intended for
+ system-level interaction with the user.
+
+ <p class="note"><strong>Note:</strong> If the app
+ targets API level 23 or higher, the app user must explicitly grant
+ this permission to the app through a permission management screen. The app requests
+ the user's approval by sending an intent with action
+ {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}.
+ The app can check whether it has this authorization by calling
+ {@link android.provider.Settings#canDrawOverlays
+ Settings.canDrawOverlays()}.
+ <p>Protection level: signature|setup|appop|installer|pre23|development -->
+ <permission android:name="android.permission.SYSTEM_ALERT_WINDOW"
+ android:label="@string/permlab_systemAlertWindow"
+ android:description="@string/permdesc_systemAlertWindow"
+ android:protectionLevel="signature|setup|appop|installer|pre23|development" />
+
+ <!-- @SystemApi @hide Allows an application to create windows using the type
+ {@link android.view.WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY},
+ shown on top of all other apps.
+
+ Allows an application to use
+ {@link android.view.WindowManager.LayoutsParams#setSystemApplicationOverlay(boolean)}
+ to create overlays that will stay visible, even if another window is requesting overlays to
+ be hidden through {@link android.view.Window#setHideOverlayWindows(boolean)}.
+
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.SYSTEM_APPLICATION_OVERLAY"
+ android:protectionLevel="signature|recents|role|installer"/>
+
+ <!-- @deprecated Use {@link android.Manifest.permission#REQUEST_COMPANION_RUN_IN_BACKGROUND}
+ @hide
+ -->
+ <permission android:name="android.permission.RUN_IN_BACKGROUND"
+ android:label="@string/permlab_runInBackground"
+ android:description="@string/permdesc_runInBackground"
+ android:protectionLevel="signature" />
+
+ <!-- @deprecated Use
+ {@link android.Manifest.permission#REQUEST_COMPANION_USE_DATA_IN_BACKGROUND}
+ @hide
+ -->
+ <permission android:name="android.permission.USE_DATA_IN_BACKGROUND"
+ android:label="@string/permlab_useDataInBackground"
+ android:description="@string/permdesc_useDataInBackground"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to set display offsets for the screen.
+ This permission is not available to third party applications. -->
+ <permission android:name="android.permission.SET_DISPLAY_OFFSET"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows a companion app to run in the background. This permission implies
+ {@link android.Manifest.permission#REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND},
+ and allows to start a foreground service from the background.
+ If an app does not have to run in the background, but only needs to start a foreground
+ service from the background, consider using
+ {@link android.Manifest.permission#REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND},
+ which is less powerful.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND"
+ android:label="@string/permlab_runInBackground"
+ android:description="@string/permdesc_runInBackground"
+ android:protectionLevel="normal" />
+
+ <!-- Allows a companion app to start a foreground service from the background.
+ {@see android.Manifest.permission#REQUEST_COMPANION_RUN_IN_BACKGROUND}
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND"
+ android:label="@string/permlab_startForegroundServicesFromBackground"
+ android:description="@string/permdesc_startForegroundServicesFromBackground"
+ android:protectionLevel="normal"/>
+
+ <!-- Allows a companion app to use data in the background.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND"
+ android:label="@string/permlab_useDataInBackground"
+ android:description="@string/permdesc_useDataInBackground"
+ android:protectionLevel="normal" />
+
+ <!-- Allows app to request to be associated with a device via
+ {@link android.companion.CompanionDeviceManager}
+ as a "watch"
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_WATCH"
+ android:label="@string/permlab_companionProfileWatch"
+ android:description="@string/permdesc_companionProfileWatch"
+ android:protectionLevel="normal" />
+
+ <!-- Allows app to request to be associated with a device via
+ {@link android.companion.CompanionDeviceManager}
+ as "glasses"
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_GLASSES"
+ android:protectionLevel="normal" />
+
+ <!-- Allows application to request to be associated with a virtual display capable of streaming
+ Android applications
+ ({@link android.companion.AssociationRequest#DEVICE_PROFILE_APP_STREAMING})
+ by {@link android.companion.CompanionDeviceManager}.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows application to request to stream content from an Android host to a nearby device
+ ({@link android.companion.AssociationRequest#DEVICE_PROFILE_NEARBY_DEVICE_STREAMING})
+ by {@link android.companion.CompanionDeviceManager}.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_NEARBY_DEVICE_STREAMING"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows application to request to be associated with a vehicle head unit capable of
+ automotive projection
+ ({@link android.companion.AssociationRequest#DEVICE_PROFILE_AUTOMOTIVE_PROJECTION})
+ by {@link android.companion.CompanionDeviceManager}.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows application to request to be associated with a computer to share functionality
+ and/or data with other devices, such as notifications, photos and media
+ ({@link android.companion.AssociationRequest#DEVICE_PROFILE_COMPUTER})
+ by {@link android.companion.CompanionDeviceManager}.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_COMPUTER"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to create a "self-managed" association.
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_SELF_MANAGED"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows a companion app to associate to Wi-Fi.
+ <p>Only for use by a single pre-approved app.
+ @hide
+ @SystemApi
+ -->
+ <permission android:name="android.permission.COMPANION_APPROVE_WIFI_CONNECTIONS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an app to read and listen to projection state.
+ @hide
+ @SystemApi
+ -->
+ <permission android:name="android.permission.READ_PROJECTION_STATE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an app to set and release automotive projection.
+ @hide
+ @SystemApi
+ -->
+ <permission android:name="android.permission.TOGGLE_AUTOMOTIVE_PROJECTION"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an app to prevent non-system-overlay windows from being drawn on top of it -->
+ <permission android:name="android.permission.HIDE_OVERLAY_WINDOWS"
+ android:label="@string/permlab_hideOverlayWindows"
+ android:description="@string/permdesc_hideOverlayWindows"
+ android:protectionLevel="normal" />
+
+ <!-- ================================== -->
+ <!-- Permissions affecting the system wallpaper -->
+ <!-- ================================== -->
+ <eat-comment />
+
+ <!-- Allows applications to set the wallpaper.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.SET_WALLPAPER"
+ android:label="@string/permlab_setWallpaper"
+ android:description="@string/permdesc_setWallpaper"
+ android:protectionLevel="normal" />
+
+ <!-- Allows applications to set the wallpaper hints.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.SET_WALLPAPER_HINTS"
+ android:label="@string/permlab_setWallpaperHints"
+ android:description="@string/permdesc_setWallpaperHints"
+ android:protectionLevel="normal" />
+
+ <!-- Allow the app to read the system and lock wallpaper images.
+ <p>Not for use by third-party applications.
+ @hide
+ @SystemApi
+ -->
+ <permission android:name="android.permission.READ_WALLPAPER_INTERNAL"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allow apps to always update wallpaper by sending data.
+ @SystemApi
+ @hide
+ @FlaggedApi("com.android.window.flags.always_update_wallpaper_permission")
+ -->
+ <permission android:name="android.permission.ALWAYS_UPDATE_WALLPAPER"
+ android:protectionLevel="internal|role" />
+
+ <!-- ===================================================== -->
+ <!-- Permissions for changing the system clock / time zone -->
+ <!-- ===================================================== -->
+ <eat-comment />
+
+ <!-- Allows applications to set the system time directly.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.SET_TIME"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Allows applications to set the system time zone directly.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.SET_TIME_ZONE"
+ android:label="@string/permlab_setTimeZone"
+ android:description="@string/permdesc_setTimeZone"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Allows telephony to suggest the time / time zone.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.SUGGEST_TELEPHONY_TIME_AND_ZONE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows applications like settings to suggest the user's manually chosen time / time zone.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.SUGGEST_MANUAL_TIME_AND_ZONE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows system clock time suggestions from an external clock / time source to be made.
+ The nature of "external" could be highly form-factor specific. Example, times
+ obtained via the VHAL for Android Auto OS.
+ <p>Not for use by third-party applications.
+ @SystemApi @hide
+ -->
+ <permission android:name="android.permission.SUGGEST_EXTERNAL_TIME"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows applications like settings to manage configuration associated with automatic time
+ and time zone detection.
+ <p>Not for use by third-party applications.
+ @SystemApi @hide
+ -->
+ <permission android:name="android.permission.MANAGE_TIME_AND_ZONE_DETECTION"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- ==================================================== -->
+ <!-- Permissions related to changing status bar -->
+ <!-- ==================================================== -->
+ <eat-comment />
+
+ <!-- Allows an application to expand or collapse the status bar.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.EXPAND_STATUS_BAR"
+ android:label="@string/permlab_expandStatusBar"
+ android:description="@string/permdesc_expandStatusBar"
+ android:protectionLevel="normal" />
+
+ <!-- ============================================================== -->
+ <!-- Permissions related to adding/removing shortcuts from Launcher -->
+ <!-- ============================================================== -->
+ <eat-comment />
+
+ <!-- Allows an application to install a shortcut in Launcher.
+ <p>In Android O (API level 26) and higher, the <code>INSTALL_SHORTCUT</code> broadcast no
+ longer has any effect on your app because it's a private, implicit
+ broadcast. Instead, you should create an app shortcut by using the
+ {@link android.content.pm.ShortcutManager#requestPinShortcut requestPinShortcut()}
+ method from the {@link android.content.pm.ShortcutManager} class.
+ <p>Protection level: normal
+ -->
+ <permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
+ android:label="@string/permlab_install_shortcut"
+ android:description="@string/permdesc_install_shortcut"
+ android:protectionLevel="normal"/>
+
+ <!-- <p class="caution"><strong>Don't use this permission in your app.</strong><br>This
+ permission is no longer supported.
+ -->
+ <permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"
+ android:label="@string/permlab_uninstall_shortcut"
+ android:description="@string/permdesc_uninstall_shortcut"
+ android:protectionLevel="normal"/>
+
+ <!-- ==================================================== -->
+ <!-- Permissions related to accessing sync settings -->
+ <!-- ==================================================== -->
+ <eat-comment />
+
+ <!-- Allows applications to read the sync settings.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.READ_SYNC_SETTINGS"
+ android:description="@string/permdesc_readSyncSettings"
+ android:label="@string/permlab_readSyncSettings"
+ android:protectionLevel="normal" />
+
+ <!-- Allows applications to write the sync settings.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.WRITE_SYNC_SETTINGS"
+ android:description="@string/permdesc_writeSyncSettings"
+ android:label="@string/permlab_writeSyncSettings"
+ android:protectionLevel="normal" />
+
+ <!-- Allows applications to read the sync stats.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.READ_SYNC_STATS"
+ android:description="@string/permdesc_readSyncStats"
+ android:label="@string/permlab_readSyncStats"
+ android:protectionLevel="normal" />
+
+ <!-- ============================================ -->
+ <!-- Permissions for low-level system interaction -->
+ <!-- ============================================ -->
+ <eat-comment />
+
+ <!-- @SystemApi @hide Change the screen compatibility mode of applications -->
+ <permission android:name="android.permission.SET_SCREEN_COMPATIBILITY"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to modify the current configuration, such
+ as locale.
+ <p>Protection level: signature|privileged|development -->
+ <permission android:name="android.permission.CHANGE_CONFIGURATION"
+ android:protectionLevel="signature|privileged|development|role" />
+
+ <!-- Allows an application to read or write the system settings.
+
+ <p class="note"><strong>Note:</strong> If the app targets API level 23
+ or higher, the app user
+ must explicitly grant this permission to the app through a permission management screen.
+ The app requests the user's approval by sending an intent with action
+ {@link android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}. The app
+ can check whether it has this authorization by calling {@link
+ android.provider.Settings.System#canWrite Settings.System.canWrite()}.
+
+ <p>Protection level: signature|preinstalled|appop|pre23
+ -->
+ <permission android:name="android.permission.WRITE_SETTINGS"
+ android:label="@string/permlab_writeSettings"
+ android:description="@string/permdesc_writeSettings"
+ android:protectionLevel="signature|preinstalled|appop|pre23|role" />
+
+ <!-- Allows an application to modify the Google service map.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.WRITE_GSERVICES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @TestApi @hide Allows an application to modify config settings.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.WRITE_DEVICE_CONFIG"
+ android:protectionLevel="signature|verifier|configurator"/>
+
+ <!-- @SystemApi @TestApi @hide Allows an application to modify only allowlisted settings.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.WRITE_ALLOWLISTED_DEVICE_CONFIG"
+ android:protectionLevel="signature|verifier|configurator"/>
+
+ <!-- @SystemApi @TestApi @hide Allows an application to read/write sync disabled mode config.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.READ_WRITE_SYNC_DISABLED_MODE_CONFIG"
+ android:protectionLevel="signature|verifier|configurator"/>
+
+ <!-- @SystemApi @hide Allows an application to read config settings.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.READ_DEVICE_CONFIG"
+ android:protectionLevel="signature|preinstalled" />
+
+ <!-- @SystemApi @hide Allows applications like settings to read system-owned
+ application-specific locale configs.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.READ_APP_SPECIFIC_LOCALES"
+ android:protectionLevel="signature|installer" />
+
+ <!-- @hide Allows applications to set an application-specific {@link LocaleConfig}.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.SET_APP_SPECIFIC_LOCALECONFIG"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows an application to monitor {@link android.provider.Settings.Config} access.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MONITOR_DEVICE_CONFIG_ACCESS"
+ android:protectionLevel="signature"/>
+
+ <!-- @SystemApi @TestApi Allows an application to call
+ {@link android.app.ActivityManager#forceStopPackage}.
+ @hide -->
+ <permission android:name="android.permission.FORCE_STOP_PACKAGES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows an application to retrieve the content of the active window
+ An active window is the window that has fired an accessibility event. -->
+ <permission android:name="android.permission.RETRIEVE_WINDOW_CONTENT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Modify the global animation scaling factor.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.SET_ANIMATION_SCALE"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- @deprecated This functionality will be removed in the future; please do
+ not use. Allow an application to make its activities persistent. -->
+ <permission android:name="android.permission.PERSISTENT_ACTIVITY"
+ android:label="@string/permlab_persistentActivity"
+ android:description="@string/permdesc_persistentActivity"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an application to find out the space used by any package.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.GET_PACKAGE_SIZE"
+ android:label="@string/permlab_getPackageSize"
+ android:description="@string/permdesc_getPackageSize"
+ android:protectionLevel="normal" />
+
+ <!-- @deprecated No longer useful, see
+ {@link android.content.pm.PackageManager#addPackageToPreferred}
+ for details. -->
+ <permission android:name="android.permission.SET_PREFERRED_APPLICATIONS"
+ android:protectionLevel="signature|installer|verifier" />
+
+ <!-- Allows an application to receive the
+ {@link android.content.Intent#ACTION_BOOT_COMPLETED} that is
+ broadcast after the system finishes booting. If you don't
+ request this permission, you will not receive the broadcast at
+ that time. Though holding this permission does not have any
+ security implications, it can have a negative impact on the
+ user experience by increasing the amount of time it takes the
+ system to start and allowing applications to have themselves
+ running without the user being aware of them. As such, you must
+ explicitly declare your use of this facility to make that visible
+ to the user.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"
+ android:label="@string/permlab_receiveBootCompleted"
+ android:description="@string/permdesc_receiveBootCompleted"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an application to broadcast sticky intents. These are
+ broadcasts whose data is held by the system after being finished,
+ so that clients can quickly retrieve that data without having
+ to wait for the next broadcast.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.BROADCAST_STICKY"
+ android:label="@string/permlab_broadcastSticky"
+ android:description="@string/permdesc_broadcastSticky"
+ android:protectionLevel="normal" />
+
+ <!-- Allows mounting and unmounting file systems for removable storage.
+ <p>Not for use by third-party applications.-->
+ <permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows formatting file systems for removable storage.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MOUNT_FORMAT_FILESYSTEMS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide -->
+ <permission android:name="android.permission.STORAGE_INTERNAL"
+ android:protectionLevel="signature" />
+
+ <!-- Allows access to ASEC non-destructive API calls
+ @hide -->
+ <permission android:name="android.permission.ASEC_ACCESS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows creation of ASEC volumes
+ @hide -->
+ <permission android:name="android.permission.ASEC_CREATE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows destruction of ASEC volumes
+ @hide -->
+ <permission android:name="android.permission.ASEC_DESTROY"
+ android:protectionLevel="signature" />
+
+ <!-- Allows mount / unmount of ASEC volumes
+ @hide -->
+ <permission android:name="android.permission.ASEC_MOUNT_UNMOUNT"
+ android:protectionLevel="signature" />
+
+ <!-- Allows rename of ASEC volumes
+ @hide -->
+ <permission android:name="android.permission.ASEC_RENAME"
+ android:protectionLevel="signature" />
+
+ <!-- Allows applications to write the apn settings and read sensitive fields of
+ an existing apn settings like user and password.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.WRITE_APN_SETTINGS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows applications to change network connectivity state.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.CHANGE_NETWORK_STATE"
+ android:description="@string/permdesc_changeNetworkState"
+ android:label="@string/permlab_changeNetworkState"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an application to clear the caches of all installed
+ applications on the device.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.CLEAR_APP_CACHE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to use any media decoder when decoding for playback
+ @hide -->
+ <permission android:name="android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to install and/or uninstall CA certificates on
+ behalf of the user.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_CA_CERTIFICATES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to do certain operations needed for
+ interacting with the recovery (system update) system.
+ @hide -->
+ <permission android:name="android.permission.RECOVERY"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to do certain operations needed for
+ resume on reboot feature.
+ @hide -->
+ <permission android:name="android.permission.BIND_RESUME_ON_REBOOT_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to read system update info.
+ @hide -->
+ <permission android:name="android.permission.READ_SYSTEM_UPDATE_INFO"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows the system to bind to an application's task services
+ @hide -->
+ <permission android:name="android.permission.BIND_JOB_SERVICE"
+ android:protectionLevel="signature" />
+ <uses-permission android:name="android.permission.BIND_JOB_SERVICE"/>
+
+ <!-- Allows an application to initiate configuration updates
+ <p>An application requesting this permission is responsible for
+ verifying the source and integrity of any update before passing
+ it off to the various individual installer components
+ @hide -->
+ <permission android:name="android.permission.UPDATE_CONFIG"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to query the current time zone rules state
+ on device.
+ @SystemApi @hide
+ @deprecated Vestigial permission declaration. No longer used. -->
+ <permission android:name="android.permission.QUERY_TIME_ZONE_RULES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows a time zone rule updater application to request
+ the system installs / uninstalls timezone rules.
+ <p>An application requesting this permission is responsible for
+ verifying the source and integrity of the update before passing
+ it off to the installer components.
+ @SystemApi @hide
+ @deprecated Vestigial permission declaration. No longer used. -->
+ <permission android:name="android.permission.UPDATE_TIME_ZONE_RULES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows the system to reset throttling in shortcut manager.
+ @hide -->
+ <permission android:name="android.permission.RESET_SHORTCUT_MANAGER_THROTTLING"
+ android:protectionLevel="signature" />
+
+ <!-- Allows the system to bind to the discovered Network Recommendation Service.
+ @SystemApi @hide -->
+ <permission android:name="android.permission.BIND_NETWORK_RECOMMENDATION_SERVICE"
+ android:protectionLevel="signature" />
+ <uses-permission android:name="android.permission.BIND_NETWORK_RECOMMENDATION_SERVICE"/>
+
+ <!-- Allows an application to enable, disable and change priority of
+ runtime resource overlays.
+ @hide -->
+ <permission android:name="android.permission.CHANGE_OVERLAY_PACKAGES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to set, update and remove the credential management app.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_CREDENTIAL_MANAGEMENT_APP"
+ android:protectionLevel="signature" />
+
+ <!-- Allows a font updater application to request that the system installs/uninstalls/updates
+ font files. @SystemApi @hide -->
+ <permission android:name="android.permission.UPDATE_FONTS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to use the AttestationVerificationService.
+ @hide -->
+ <permission android:name="android.permission.USE_ATTESTATION_VERIFICATION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to export a AttestationVerificationService to verify attestations on
+ behalf of AttestationVerificationManager for system-defined attestation profiles.
+ @hide -->
+ <permission android:name="android.permission.VERIFY_ATTESTATION"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by any AttestationVerificationService to ensure that only the system can
+ bind to it.
+ @hide -->
+ <permission android:name="android.permission.BIND_ATTESTATION_VERIFICATION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows the caller to generate keymint keys with the INCLUDE_UNIQUE_ID tag, which
+ uniquely identifies the device via the attestation certificate.
+ @hide @TestApi -->
+ <permission android:name="android.permission.REQUEST_UNIQUE_ID_ATTESTATION"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to get enabled credential manager providers.
+ @hide -->
+ <permission android:name="android.permission.LIST_ENABLED_CREDENTIAL_PROVIDERS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows a system application to be registered with credential manager without
+ having to be enabled by the user.
+ @hide @SystemApi -->
+ <permission android:name="android.permission.PROVIDE_DEFAULT_ENABLED_CREDENTIAL_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows specifying candidate credential providers to be queried in Credential Manager
+ get flows, or to be preferred as a default in the Credential Manager create flows.
+ <p>Protection level: normal -->
+ <permission android:name="android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS"
+ android:protectionLevel="normal" />
+
+ <!-- Allows a browser to invoke credential manager APIs on behalf of another RP.
+ <p>Protection level: normal -->
+ <permission android:name="android.permission.CREDENTIAL_MANAGER_SET_ORIGIN"
+ android:protectionLevel="normal" />
+
+ <!-- Allows a browser to invoke the set of query apis to get metadata about credential
+ candidates prepared during the CredentialManager.prepareGetCredential API.
+ <p>Protection level: normal -->
+ <permission android:name="android.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS"
+ android:protectionLevel="normal" />
+
+ <!-- Allows permission to use Credential Manager UI for providing and saving credentials
+ @hide -->
+ <permission android:name="android.permission.LAUNCH_CREDENTIAL_SELECTOR"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to be able to store and retrieve credentials from a remote
+ device.
+ <p>Protection level: signature|privileged|role -->
+ <permission android:name="android.permission.PROVIDE_REMOTE_CREDENTIALS"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- ========================================= -->
+ <!-- Permissions for special development tools -->
+ <!-- ========================================= -->
+ <eat-comment />
+
+ <!-- Allows an application to read or write the secure system settings.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.WRITE_SECURE_SETTINGS"
+ android:protectionLevel="signature|privileged|development|role|installer" />
+
+ <!-- Allows an application to retrieve state dump information from system services.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.DUMP"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Allows an application to start tracing for InputMethod and WindowManager.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.CONTROL_UI_TRACING"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Allows an application to read the low-level system log files.
+ <p>Not for use by third-party applications, because
+ Log entries can contain the user's private information. -->
+ <permission android:name="android.permission.READ_LOGS"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Configure an application for debugging.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.SET_DEBUG_APP"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Allows an application to access the data in Dropbox.
+ <p>Not for use by third-party applications.
+ @FlaggedApi("com.android.server.feature.flags.enable_read_dropbox_permission") -->
+ <permission android:name="android.permission.READ_DROPBOX_DATA"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Allows an application to set the maximum number of (not needed)
+ application processes that can be running.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.SET_PROCESS_LIMIT"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Allows an application to control whether activities are immediately
+ finished when put in the background.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.SET_ALWAYS_FINISH"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Allow an application to request that a signal be sent to all persistent processes.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.SIGNAL_PERSISTENT_PROCESSES"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- @hide @SystemApi Must be required by a
+ {@link com.android.service.tracing.TraceReportService}, to ensure that only the system
+ can bind to it.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.BIND_TRACE_REPORT_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @hide @SystemApi @TestApi
+ Allow an application to approve incident and bug reports to be
+ shared off-device. There can be only one application installed on the
+ device with this permission, and since this is a privileged permission, it
+ must be in priv-app.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.APPROVE_INCIDENT_REPORTS"
+ android:protectionLevel="signature|incidentReportApprover" />
+
+ <!-- @hide Allow an application to approve an incident or bug report approval from
+ the system. -->
+ <permission android:name="android.permission.REQUEST_INCIDENT_REPORT_APPROVAL"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- ==================================== -->
+ <!-- Private permissions -->
+ <!-- ==================================== -->
+ <eat-comment />
+
+ <!-- Allows access to the list of accounts in the Accounts Service.
+ <p>Protection level: signature|privileged -->
+ <permission android:name="android.permission.GET_ACCOUNTS_PRIVILEGED"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows but does not guarantee access to user passwords at the conclusion of add account
+ @hide -->
+ <permission android:name="android.permission.GET_PASSWORD"
+ android:protectionLevel="signature" />
+
+ <!-- Allows applications to RW to diagnostic resources.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.DIAGNOSTIC"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to open, close, or disable the status bar
+ and its icons.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.STATUS_BAR"
+ android:protectionLevel="signature|privileged|recents" />
+
+ <!-- Allows an application to trigger bugreport via shell using the bugreport API.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.TRIGGER_SHELL_BUGREPORT"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to trigger profcollect report upload via shell.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.TRIGGER_SHELL_PROFCOLLECT_UPLOAD"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to be the status bar. Currently used only by SystemUI.apk
+ @hide
+ @SystemApi -->
+ <permission android:name="android.permission.STATUS_BAR_SERVICE"
+ android:protectionLevel="signature|recents" />
+
+ <!-- Allows an application to bind to third party quick settings tiles.
+ <p>Should only be requested by the System, should be required by
+ TileService declarations.-->
+ <permission android:name="android.permission.BIND_QUICK_SETTINGS_TILE"
+ android:protectionLevel="signature|recents" />
+
+ <!-- Allows SystemUI to request third party controls.
+ <p>Should only be requested by the System and required by
+ {@link android.service.controls.ControlsProviderService} declarations.
+ -->
+ <permission android:name="android.permission.BIND_CONTROLS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to force a BACK operation on whatever is the
+ top activity.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.FORCE_BACK"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to update device statistics.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.UPDATE_DEVICE_STATS"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi @hide Allows an application to collect application operation statistics.
+ Not for use by third party apps. -->
+ <permission android:name="android.permission.GET_APP_OPS_STATS"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- @SystemApi @hide Allows an application to collect historical application operation
+ statistics.
+ <p>Not for use by third party applications.
+ -->
+ <permission android:name="android.permission.GET_HISTORICAL_APP_OPS_STATS"
+ android:protectionLevel="internal|role" />
+
+ <!-- @SystemApi Allows an application to update application operation statistics. Not for
+ use by third party apps.
+ @hide -->
+ <permission android:name="android.permission.UPDATE_APP_OPS_STATS"
+ android:protectionLevel="signature|privileged|installer|role" />
+
+ <!-- @SystemApi Allows an application to update the user app op restrictions.
+ Not for use by third party apps.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_APP_OPS_RESTRICTIONS"
+ android:protectionLevel="signature|installer" />
+
+ <!-- @TestApi Allows an application to update the user app op modes.
+ Not for use by third party apps.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_APP_OPS_MODES"
+ android:protectionLevel="signature|installer|verifier|role" />
+
+ <!-- @SystemApi Allows an application to open windows that are for use by parts
+ of the system user interface.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW"
+ android:protectionLevel="signature|module|recents" />
+
+ <!-- Allows an application to avoid all toast rate limiting restrictions.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.UNLIMITED_TOASTS"
+ android:protectionLevel="signature" />
+ <uses-permission android:name="android.permission.UNLIMITED_TOASTS" />
+
+ <!-- @SystemApi Allows an application to use
+ {@link android.view.WindowManager.LayoutsParams#SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS}
+ to hide non-system-overlay windows.
+ <p>Not for use by third-party applications.
+ @deprecated Use {@link android.Manifest.permission#HIDE_OVERLAY_WINDOWS} instead
+ @hide
+ -->
+ <permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"
+ android:protectionLevel="signature|preinstalled" />
+
+ <!-- @SystemApi Allows an application to manage (create, destroy,
+ Z-order) application tokens in the window manager.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.MANAGE_APP_TOKENS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows System UI to register listeners for events from Window Manager.
+ @hide -->
+ <permission android:name="android.permission.REGISTER_WINDOW_MANAGER_LISTENERS"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows the application to temporarily freeze the screen for a
+ full-screen transition. -->
+ <permission android:name="android.permission.FREEZE_SCREEN"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to inject user events (keys, touch, trackball)
+ into the event stream and deliver them to ANY window. Without this
+ permission, you can only deliver events to windows in your own process.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.INJECT_EVENTS"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to register an input filter which filters the stream
+ of user events (keys, touch, trackball) before they are dispatched to any window. -->
+ <permission android:name="android.permission.FILTER_EVENTS"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to retrieve the window token from the accessibility manager. -->
+ <permission android:name="android.permission.RETRIEVE_WINDOW_TOKEN"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to modify accessibility information from another app. -->
+ <permission android:name="android.permission.MODIFY_ACCESSIBILITY_DATA"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to perform accessibility operations (e.g. send events) on
+ behalf of another package. -->
+ <permission android:name="android.permission.ACT_AS_PACKAGE_FOR_ACCESSIBILITY"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to change the accessibility volume. -->
+ <permission android:name="android.permission.CHANGE_ACCESSIBILITY_VOLUME"
+ android:protectionLevel="signature" />
+
+ <!-- @FlaggedApi("com.android.server.accessibility.motion_event_observing")
+ @hide
+ @TestApi
+ Allows an accessibility service to observe motion events without consuming them. -->
+ <permission android:name="android.permission.ACCESSIBILITY_MOTION_EVENT_OBSERVING"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to collect frame statistics -->
+ <permission android:name="android.permission.FRAME_STATS"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to temporary enable accessibility on the device. -->
+ <permission android:name="android.permission.TEMPORARY_ENABLE_ACCESSIBILITY"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to launch detail settings activity of a particular
+ accessibility service.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.OPEN_ACCESSIBILITY_DETAILS_SETTINGS"
+ android:protectionLevel="signature|installer" />
+
+ <!-- @SystemApi Allows an application to watch and control how activities are
+ started globally in the system. Only for is in debugging
+ (usually the monkey command).
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.SET_ACTIVITY_WATCHER"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to call the activity manager shutdown() API
+ to put the higher-level system there into a shutdown state.
+ @hide -->
+ <permission android:name="android.permission.SHUTDOWN"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi Allows an application to tell the activity manager to temporarily
+ stop application switches, putting it into a special mode that
+ prevents applications from immediately switching away from some
+ critical UI such as the home screen.
+ @hide -->
+ <permission android:name="android.permission.STOP_APP_SWITCHES"
+ android:protectionLevel="signature|privileged|recents" />
+
+ <!-- @SystemApi Allows an application to retrieve private information about
+ the current top activity, such as any assist context it can provide.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.GET_TOP_ACTIVITY_INFO"
+ android:protectionLevel="signature|recents" />
+
+ <!-- @SystemApi Allows an application to set the system audio caption and its UI
+ enabled state.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.SET_SYSTEM_AUDIO_CAPTION"
+ android:protectionLevel="signature|role" />
+
+ <!-- Allows an application to retrieve the current state of keys and
+ switches.
+ <p>Not for use by third-party applications.
+ @deprecated The API that used this permission has been removed. -->
+ <permission android:name="android.permission.READ_INPUT_STATE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an {@link android.inputmethodservice.InputMethodService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_INPUT_METHOD"
+ android:protectionLevel="signature" />
+
+ <!-- Allows access to Test APIs defined in {@link android.view.inputmethod.InputMethodManager}.
+ @hide
+ @TestApi -->
+ <permission android:name="android.permission.TEST_INPUT_METHOD"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an {@link android.media.midi.MidiDeviceService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_MIDI_DEVICE_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an {@link android.accessibilityservice.AccessibilityService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a {@link android.printservice.PrintService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_PRINT_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a {@link android.printservice.recommendation.RecommendationService},
+ to ensure that only the system can bind to it.
+ @hide
+ @SystemApi
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_PRINT_RECOMMENDATION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows applications to get the installed and enabled print services.
+ @hide
+ @SystemApi
+ <p>Protection level: signature|preinstalled
+ -->
+ <permission android:name="android.permission.READ_PRINT_SERVICES"
+ android:protectionLevel="signature|preinstalled" />
+
+ <!-- Allows applications to get the currently recommended print services for printers.
+ @hide
+ @SystemApi
+ <p>Protection level: signature|preinstalled
+ -->
+ <permission android:name="android.permission.READ_PRINT_SERVICE_RECOMMENDATIONS"
+ android:protectionLevel="signature|preinstalled" />
+
+ <!-- Must be required by a {@link android.nfc.cardemulation.HostApduService}
+ or {@link android.nfc.cardemulation.OffHostApduService} to ensure that only
+ the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_NFC_SERVICE"
+ android:protectionLevel="signature|module" />
+
+ <!-- Must be required by a {@link android.service.quickaccesswallet.QuickAccessWalletService}
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_QUICK_ACCESS_WALLET_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by the PrintSpooler to ensure that only the system can bind to it.
+ @hide -->
+ <permission android:name="android.permission.BIND_PRINT_SPOOLER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by the CompanionDeviceManager to ensure that only the system can bind to it.
+ @hide -->
+ <permission android:name="android.permission.BIND_COMPANION_DEVICE_MANAGER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by any
+ {@link android.companion.CompanionDeviceService}s
+ to ensure that only the system can bind to it. -->
+ <permission android:name="android.permission.BIND_COMPANION_DEVICE_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Must be required by the RuntimePermissionPresenterService to ensure
+ that only the system can bind to it.
+ @hide -->
+ <permission android:name="android.permission.BIND_RUNTIME_PERMISSION_PRESENTER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a TextService (e.g. SpellCheckerService)
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_TEXT_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Must be required by a AttentionService
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_ATTENTION_SERVICE"
+ android:protectionLevel="signature" />
+ <uses-permission android:name="android.permission.BIND_ATTENTION_SERVICE" />
+
+ <!-- @SystemApi Must be required by a RotationResolverService
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_ROTATION_RESOLVER_SERVICE"
+ android:protectionLevel="signature" />
+ <uses-permission android:name="android.permission.BIND_ROTATION_RESOLVER_SERVICE" />
+
+ <!-- Must be required by a {@link android.net.VpnService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_VPN_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a {@link android.service.wallpaper.WallpaperService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.BIND_WALLPAPER"
+ android:protectionLevel="signature|privileged" />
+
+
+ <!-- Must be required by a game service to ensure that only the
+ system can bind to it.
+ <p>Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_GAME_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a {@link android.service.voice.VoiceInteractionService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_VOICE_INTERACTION"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Must be required by a {@link android.service.voice.HotwordDetectionService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ @hide This is not a third-party API (intended for OEMs and system apps).
+ -->
+ <permission android:name="android.permission.BIND_HOTWORD_DETECTION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to manage hotword detection and visual query detection
+ on the device.
+ <p>Protection level: internal|preinstalled
+ @hide This is not a third-party API (intended for OEMs and system apps).
+ -->
+ <permission android:name="android.permission.MANAGE_HOTWORD_DETECTION"
+ android:protectionLevel="internal|preinstalled" />
+
+ <!-- @SystemApi Must be required by a {@link android.service.voice.VisualQueryDetectionService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ @hide This is not a third-party API (intended for OEMs and system apps).
+ -->
+ <permission android:name="android.permission.BIND_VISUAL_QUERY_DETECTION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to subscribe to keyguard locked (i.e., showing) state.
+ <p>Protection level: signature|role
+ <p>Intended for use by ROLE_ASSISTANT and signature apps only.
+ -->
+ <permission android:name="android.permission.SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE"
+ android:protectionLevel="signature|module|role"/>
+
+ <!-- Must be required by a {@link android.service.autofill.AutofillService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_AUTOFILL_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a
+ {@link android.service.assist.classification.FieldClassificationService},
+ to ensure that only the system can bind to it.
+ @SystemApi @hide This is not a third-party API (intended for OEMs and system apps).
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_FIELD_CLASSIFICATION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a CredentialProviderService to ensure that only the
+ system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_CREDENTIAL_PROVIDER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Alternative version of android.permission.BIND_AUTOFILL_FIELD_CLASSIFICATION_SERVICE.
+ This permission was renamed during the O previews but it was supported on the final O
+ release, so we need to carry it over.
+ <p>Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_AUTOFILL"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an {@link android.service.autofill.AutofillFieldClassificationService}
+ to ensure that only the system can bind to it.
+ @hide This is not a third-party API (intended for OEMs and system apps).
+ -->
+ <permission android:name="android.permission.BIND_AUTOFILL_FIELD_CLASSIFICATION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an {@link android.service.autofill.InlineSuggestionRenderService}
+ to ensure that only the system can bind to it.
+ @hide This is not a third-party API (intended for OEMs and system apps).
+ -->
+ <permission android:name="android.permission.BIND_INLINE_SUGGESTION_RENDER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a android.service.textclassifier.TextClassifierService,
+ to ensure that only the system can bind to it.
+ @SystemApi @hide This is not a third-party API (intended for OEMs and system apps).
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_TEXTCLASSIFIER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a
+ {@link android.service.remotelockscreenvalidation.RemoteLockscreenValidationService}
+ to ensure that only the system can bind to it.
+ @SystemApi @hide This is not a third-party API
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_REMOTE_LOCKSCREEN_VALIDATION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a android.service.selectiontoolbar.SelectionToolbarRenderService,
+ to ensure that only the system can bind to it.
+ @hide This is not a third-party API (intended for OEMs and system apps).
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_SELECTION_TOOLBAR_RENDER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a android.service.contentcapture.ContentCaptureService,
+ to ensure that only the system can bind to it.
+ @SystemApi @hide This is not a third-party API (intended for OEMs and system apps).
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_CONTENT_CAPTURE_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a android.service.translation.TranslationService,
+ to ensure that only the system can bind to it.
+ @SystemApi @hide This is not a third-party API (intended for OEMs and system apps).
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_TRANSLATION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows apps to use ui translation functions.
+ <p>Protection level: signature|privileged
+ @hide Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.MANAGE_UI_TRANSLATION"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Must be required by a android.service.contentsuggestions.ContentSuggestionsService,
+ to ensure that only the system can bind to it.
+ @SystemApi @hide This is not a third-party API (intended for OEMs and system apps).
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_CONTENT_SUGGESTIONS_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a
+ android.service.wallpapereffectsgeneration.WallpaperEffectsGenerationService,
+ to ensure that only the system can bind to it.
+ @SystemApi @hide This is not a third-party API (intended for OEMs and system apps).
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_WALLPAPER_EFFECTS_GENERATION_SERVICE"
+ android:protectionLevel="signature" />
+
+
+ <!-- Must be declared by a android.service.musicrecognition.MusicRecognitionService,
+ to ensure that only the system can bind to it.
+ @SystemApi @hide This is not a third-party API (intended for OEMs and system apps).
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_MUSIC_RECOGNITION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a android.service.autofill.augmented.AugmentedAutofillService,
+ to ensure that only the system can bind to it.
+ @SystemApi @hide This is not a third-party API (intended for OEMs and system apps).
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_AUGMENTED_AUTOFILL_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a {@link android.service.voice.VoiceInteractionService} implementation
+ to enroll its own sound models. This is a more restrictive permission than the higher-level
+ permission KEYPHRASE_ENROLLMENT_APPLICATION. For the caller to enroll sound models with
+ this permission, it must hold the permission and be the active VoiceInteractionService in
+ the system.
+ {@see Settings.Secure.VOICE_INTERACTION_SERVICE}
+ @hide @SystemApi Intended for OEM and system apps.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.MANAGE_VOICE_KEYPHRASES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by a keyphrase enrollment application, to enroll sound models. This is
+ treated as a higher-level permission to MANAGE_VOICE_KEYPHRASES as a caller can enroll
+ sound models at any time. This permission should be reserved for system enrollment
+ applications detected by {@link android.hardware.soundtrigger.KeyphraseEnrollmentInfo}
+ only.
+ @hide @SystemApi Intended for OEM and system apps.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.KEYPHRASE_ENROLLMENT_APPLICATION"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by a {@link com.android.media.remotedisplay.RemoteDisplayProvider},
+ to ensure that only the system can bind to it.
+ @hide -->
+ <permission android:name="android.permission.BIND_REMOTE_DISPLAY"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a android.media.tv.ad.TvAdService to ensure that only the system can
+ bind to it.
+ <p>Protection level: signature|privileged
+ @FlaggedApi("android.media.tv.flags.enable_ad_service_fw")
+ -->
+ <permission android:name="android.permission.BIND_TV_AD_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by a {@link android.media.tv.TvInputService}
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.BIND_TV_INPUT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by a {@link android.media.tv.interactive.TvInteractiveAppService}
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.BIND_TV_INTERACTIVE_APP"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi
+ Must be required by a {@link com.android.media.tv.remoteprovider.TvRemoteProvider}
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature|privileged
+ <p>Not for use by third-party applications. </p>
+ @hide -->
+ <permission android:name="android.permission.BIND_TV_REMOTE_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi
+ Must be required for a virtual remote controller for TV.
+ <p>Protection level: signature|privileged
+ <p>Not for use by third-party applications. </p>
+ @hide -->
+ <permission android:name="android.permission.TV_VIRTUAL_REMOTE_CONTROLLER"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to change HDMI CEC active source.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.CHANGE_HDMI_CEC_ACTIVE_SOURCE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to modify parental controls
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.MODIFY_PARENTAL_CONTROLS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to read TvContentRatingSystemInfo
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.READ_CONTENT_RATING_SYSTEMS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to notify TV inputs by sending broadcasts.
+ <p>Protection level: signature|privileged
+ <p>Not for use by third-party applications.
+ @hide @SystemApi -->
+ <permission android:name="android.permission.NOTIFY_TV_INPUTS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- This permission is required among systems services when accessing
+ tuner resource management related APIs or information.
+ <p>Protection level: signature|privileged|vendorPrivileged
+ <p>This should only be used by the OEM TvInputService.
+ @hide -->
+ <permission android:name="android.permission.TUNER_RESOURCE_ACCESS"
+ android:protectionLevel="signature|privileged|vendorPrivileged" />
+
+ <!-- @SystemApi This permission is required by Media Resource Manager Service when
+ system services create MediaCodecs on behalf of other processes and apps.
+ <p>Protection level: signature|privileged|vendorPrivileged
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.MEDIA_RESOURCE_OVERRIDE_PID"
+ android:protectionLevel="signature|privileged|vendorPrivileged" />
+ <uses-permission android:name="android.permission.MEDIA_RESOURCE_OVERRIDE_PID" />
+
+ <!-- This permission is required by Media Resource Observer Service when
+ accessing its registerObserver Api.
+ <p>Protection level: signature|privileged
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.REGISTER_MEDIA_RESOURCE_OBSERVER"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by a {@link android.media.routing.MediaRouteService}
+ to ensure that only the system can interact with it.
+ @hide -->
+ <permission android:name="android.permission.BIND_ROUTE_PROVIDER"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by device administration receiver, to ensure that only the
+ system can interact with it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_DEVICE_ADMIN"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Required to add or remove another application as a device admin.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_DEVICE_ADMINS"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows an app to reset the device password.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.RESET_PASSWORD"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an app to lock the device.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.LOCK_DEVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows low-level access to setting the orientation (actually
+ rotation) of the screen.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.SET_ORIENTATION"
+ android:protectionLevel="signature|recents" />
+
+ <!-- @SystemApi Allows low-level access to setting the pointer speed.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.SET_POINTER_SPEED"
+ android:protectionLevel="signature" />
+
+ <!-- Allows low-level access to setting input device calibration.
+ <p>Not for use by normal applications.
+ @hide -->
+ <permission android:name="android.permission.SET_INPUT_CALIBRATION"
+ android:protectionLevel="signature" />
+
+ <!-- Allows low-level access to setting the keyboard layout.
+ <p>Not for use by third-party applications.
+ @hide
+ @TestApi -->
+ <permission android:name="android.permission.SET_KEYBOARD_LAYOUT"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an app to schedule a prioritized alarm that can be used to perform
+ background work even when the device is in doze.
+ <p>Not for use by third-party applications.
+ @hide
+ @SystemApi
+ -->
+ <permission android:name="android.permission.SCHEDULE_PRIORITIZED_ALARM"
+ android:protectionLevel="signature|privileged"/>
+
+ <!-- Allows applications to use exact alarm APIs.
+ <p>This is a special access permission that can be revoked by the system or the user.
+ It should only be used to enable <b>user-facing features</b> that require exact alarms.
+ For more details, please go through the associated
+ <a href="{@docRoot}training/scheduling/alarms#exact">developer docs</a>.
+ <p>Apps need to target API {@link android.os.Build.VERSION_CODES#S} or above to be able to
+ request this permission. Note that apps targeting lower API levels do not need this
+ permission to use exact alarm APIs.
+ <p>Apps that hold this permission and target API
+ {@link android.os.Build.VERSION_CODES#TIRAMISU} and below always stay in the
+ {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_WORKING_SET WORKING_SET} or
+ lower standby bucket.
+ <p>If your app relies on exact alarms for core functionality, it can instead request
+ {@link android.Manifest.permission#USE_EXACT_ALARM} once it targets API
+ {@link android.os.Build.VERSION_CODES#TIRAMISU}. All apps using exact alarms for secondary
+ features (which should still be user facing) should continue using this permission.
+ <p>Protection level: signature|privileged|appop
+ -->
+ <permission android:name="android.permission.SCHEDULE_EXACT_ALARM"
+ android:label="@string/permlab_schedule_exact_alarm"
+ android:description="@string/permdesc_schedule_exact_alarm"
+ android:protectionLevel="signature|privileged|appop"/>
+
+ <!-- Allows apps to use exact alarms just like with {@link
+ android.Manifest.permission#SCHEDULE_EXACT_ALARM} but without needing to request this
+ permission from the user.
+ <p><b> This is only intended for use by apps that rely on exact alarms for their core
+ functionality.</b> You should continue using {@code SCHEDULE_EXACT_ALARM} if your app needs
+ exact alarms for a secondary feature that users may or may not use within your app.
+ <p> Keep in mind that this is a powerful permission and app stores may enforce policies to
+ audit and review the use of this permission. Such audits may involve removal from the app
+ store if the app is found to be misusing this permission.
+ <p> Apps need to target API {@link android.os.Build.VERSION_CODES#TIRAMISU} or above to be
+ able to request this permission. Note that only one of {@code USE_EXACT_ALARM} or
+ {@code SCHEDULE_EXACT_ALARM} should be requested on a device. If your app is already using
+ {@code SCHEDULE_EXACT_ALARM} on older SDKs but needs {@code USE_EXACT_ALARM} on SDK 33 and
+ above, then {@code SCHEDULE_EXACT_ALARM} should be declared with a max-sdk attribute, like:
+ <pre>
+ <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"
+ 	 android:maxSdkVersion="32" />
+ </pre>
+ <p>Apps that hold this permission, always stay in the
+ {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_WORKING_SET WORKING_SET} or
+ lower standby bucket.
+ -->
+ <permission android:name="android.permission.USE_EXACT_ALARM"
+ android:label="@string/permlab_use_exact_alarm"
+ android:description="@string/permdesc_use_exact_alarm"
+ android:protectionLevel="normal"/>
+
+ <!-- Allows an application to query tablet mode state and monitor changes
+ in it.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.TABLET_MODE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to request installing packages. Apps
+ targeting APIs greater than 25 must hold this permission in
+ order to use {@link android.content.Intent#ACTION_INSTALL_PACKAGE}.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"
+ android:label="@string/permlab_requestInstallPackages"
+ android:description="@string/permdesc_requestInstallPackages"
+ android:protectionLevel="signature|appop" />
+
+ <!-- Allows an application to request deleting packages. Apps
+ targeting APIs {@link android.os.Build.VERSION_CODES#P} or greater must hold this
+ permission in order to use {@link android.content.Intent#ACTION_UNINSTALL_PACKAGE} or
+ {@link android.content.pm.PackageInstaller#uninstall}.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.REQUEST_DELETE_PACKAGES"
+ android:label="@string/permlab_requestDeletePackages"
+ android:description="@string/permdesc_requestDeletePackages"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an application to install packages.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.INSTALL_PACKAGES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to install self updates. This is a limited version
+ of {@link android.Manifest.permission#INSTALL_PACKAGES}.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.INSTALL_SELF_UPDATES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to install updates. This is a limited version
+ of {@link android.Manifest.permission#INSTALL_PACKAGES}.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.INSTALL_PACKAGE_UPDATES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to install existing system packages. This is a limited
+ version of {@link android.Manifest.permission#INSTALL_PACKAGES}.
+ <p>Not for use by third-party applications.
+ TODO(b/80204953): remove this permission once we have a long-term solution.
+ @hide
+ -->
+ <permission android:name="com.android.permission.INSTALL_EXISTING_PACKAGES"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Allows an application to use the package installer v2 APIs.
+ <p>The package installer v2 APIs are still a work in progress and we're
+ currently validating they work in all scenarios.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="com.android.permission.USE_INSTALLER_V2"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @TestApi Allows a testOnly application to get installed.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.INSTALL_TEST_ONLY_PACKAGE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to install DPCs only, an application is
+ considered a DPC if it has a {@link android.app.admin.DeviceAdminReceiver}
+ protected by {@link android.Manifest.permission#BIND_DEVICE_ADMIN).
+ This is a limited version of
+ {@link android.Manifest.permission#INSTALL_PACKAGES}.
+ @hide
+ -->
+ <permission android:name="android.permission.INSTALL_DPC_PACKAGES"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows an application to read resolved paths to the APKs (Base and any splits)
+ of a session based install.
+ <p>Not for use by third-party applications.
+ @hide
+ @FlaggedApi("android.content.pm.get_resolved_apk_path")
+ -->
+ <permission android:name="android.permission.READ_INSTALLED_SESSION_PATHS"
+ android:protectionLevel="signature|installer" />
+ <uses-permission android:name="android.permission.READ_INSTALLED_SESSION_PATHS" />
+
+ <!-- Allows an application to use System Data Loaders.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="com.android.permission.USE_SYSTEM_DATA_LOADERS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @TestApi Allows an application to clear user data.
+ <p>Not for use by third-party applications
+ @hide
+ -->
+ <permission android:name="android.permission.CLEAR_APP_USER_DATA"
+ android:protectionLevel="signature|installer" />
+
+ <!-- @hide Allows an application to get the URI permissions
+ granted to another application.
+ <p>Not for use by third-party applications
+ -->
+ <permission android:name="android.permission.GET_APP_GRANTED_URI_PERMISSIONS"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to clear the URI permissions
+ granted to another application.
+ <p>Not for use by third-party applications
+ -->
+ <permission
+ android:name="android.permission.CLEAR_APP_GRANTED_URI_PERMISSIONS"
+ android:protectionLevel="signature" />
+
+ <!-- @hide
+ Allows an application to change the status of Scoped Access Directory requests granted or
+ rejected by the user.
+ <p>This permission should <em>only</em> be requested by the platform
+ settings app. This permission cannot be granted to third-party apps.
+ <p>Protection level: signature
+ -->
+ <permission
+ android:name="android.permission.MANAGE_SCOPED_ACCESS_DIRECTORY_PERMISSIONS"
+ android:protectionLevel="signature" />
+
+ <!-- @hide
+ Allows an application to change the status of a persistable URI permission granted
+ to another application.
+ <p>This permission should <em>only</em> be requested by the platform
+ settings app. This permission cannot be granted to third-party apps.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.FORCE_PERSISTABLE_URI_PERMISSIONS"
+ android:protectionLevel="signature" />
+
+ <!-- Old permission for deleting an app's cache files, no longer used,
+ but signals for us to quietly ignore calls instead of throwing an exception.
+ <p>Protection level: signature|privileged -->
+ <permission android:name="android.permission.DELETE_CACHE_FILES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to delete cache files.
+ @hide -->
+ <permission android:name="android.permission.INTERNAL_DELETE_CACHE_FILES"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to delete packages.
+ <p>Not for use by third-party applications.
+ <p>Starting in {@link android.os.Build.VERSION_CODES#N}, user confirmation is requested
+ when the application deleting the package is not the same application that installed the
+ package. -->
+ <permission android:name="android.permission.DELETE_PACKAGES"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi Allows an application to move location of installed package.
+ @hide -->
+ <permission android:name="android.permission.MOVE_PACKAGE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @TestApi Allows an application to keep uninstalled packages as apks.
+ @hide -->
+ <permission android:name="android.permission.KEEP_UNINSTALLED_PACKAGES"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to change whether an application component (other than its own) is
+ enabled or not.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi @TestApi iAllows an application to grant specific permissions.
+ @hide -->
+ <permission android:name="android.permission.GRANT_RUNTIME_PERMISSIONS"
+ android:protectionLevel="signature|installer|verifier" />
+
+ <!-- @SystemApi Allows an application to launch the settings page which manages various
+ permissions.
+ @hide -->
+ <permission android:name="android.permission.LAUNCH_PERMISSION_SETTINGS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an app that has this permission and the permissions to install packages
+ to request certain runtime permissions to be granted at installation.
+ @hide -->
+ <permission android:name="android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS"
+ android:protectionLevel="signature|installer|verifier" />
+
+ <!-- @SystemApi Allows an application to revoke specific permissions.
+ @hide -->
+ <permission android:name="android.permission.REVOKE_RUNTIME_PERMISSIONS"
+ android:protectionLevel="signature|installer|verifier" />
+
+ <!-- @TestApi Allows an application to revoke the POST_NOTIFICATIONS permission from an app
+ without killing the app. Only granted to the shell.
+ @hide -->
+ <permission android:name="android.permission.REVOKE_POST_NOTIFICATIONS_WITHOUT_KILL"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows the system to read runtime permission state.
+ @hide -->
+ <permission android:name="android.permission.GET_RUNTIME_PERMISSIONS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows the system to restore runtime permission state. This might grant
+ permissions, hence this is a more scoped, less powerful variant of GRANT_RUNTIME_PERMISSIONS.
+ Among other restrictions this cannot override user choices.
+ @hide -->
+ <permission android:name="android.permission.RESTORE_RUNTIME_PERMISSIONS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @TestApi Allows an application to change policy_fixed permissions.
+ @hide -->
+ <permission android:name="android.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY"
+ android:protectionLevel="signature|installer" />
+
+ <!-- @SystemApi @TestApi Allows an application to upgrade runtime permissions.
+ @hide -->
+ <permission android:name="android.permission.UPGRADE_RUNTIME_PERMISSIONS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to allowlist restricted permissions
+ on any of the allowlists.
+ @hide -->
+ <permission android:name="android.permission.WHITELIST_RESTRICTED_PERMISSIONS"
+ android:protectionLevel="signature|installer" />
+
+ <!-- @SystemApi Allows an application to an exempt an app from having its permission be
+ auto-revoked when unused for an extended period of time.
+ @hide -->
+ <permission android:name="android.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS"
+ android:protectionLevel="signature|installer" />
+
+ <!-- @hide Allows an application to observe permission changes. -->
+ <permission android:name="android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to start and stop one time permission sessions
+ @hide -->
+ <permission android:name="android.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS"
+ android:protectionLevel="signature|installer" />
+
+ <!-- @SystemApi Allows an application to manage the holders of a role.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_ROLE_HOLDERS"
+ android:protectionLevel="signature|installer|module" />
+ <uses-permission android:name="android.permission.MANAGE_ROLE_HOLDERS" />
+
+ <!-- @SystemApi Allows an application to manage the holders of roles associated with default
+ applications.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_DEFAULT_APPLICATIONS"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows an application to bypass role qualification. This allows switching role
+ holders to otherwise non eligible holders. Only the shell is allowed to do this, the
+ qualification for the shell role itself cannot be bypassed, and each role needs to
+ explicitly allow bypassing qualification in its definition. The bypass state will not be
+ persisted across reboot.
+ @hide -->
+ <permission android:name="android.permission.BYPASS_ROLE_QUALIFICATION"
+ android:protectionLevel="internal|role" />
+
+ <!-- @SystemApi Allows an application to observe role holder changes.
+ @hide -->
+ <permission android:name="android.permission.OBSERVE_ROLE_HOLDERS"
+ android:protectionLevel="signature|installer|module" />
+
+ <!-- Allows an application to manage the companion devices.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_COMPANION_DEVICES"
+ android:protectionLevel="module|signature|role" />
+
+ <!-- Allows an application to subscribe to notifications about the presence status change
+ of their associated companion device
+ -->
+ <permission android:name="android.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE"
+ android:label="@string/permlab_observeCompanionDevicePresence"
+ android:description="@string/permdesc_observeCompanionDevicePresence"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an application to subscribe to notifications about the nearby devices' presence
+ status change base on the UUIDs.
+ <p>Not for use by third-party applications.</p>
+ @FlaggedApi("android.companion.flags.device_presence")
+ -->
+ <permission android:name="android.permission.REQUEST_OBSERVE_DEVICE_UUID_PRESENCE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to deliver companion messages to system
+ -->
+ <permission android:name="android.permission.DELIVER_COMPANION_MESSAGES"
+ android:label="@string/permlab_deliverCompanionMessages"
+ android:description="@string/permdesc_deliverCompanionMessages"
+ android:protectionLevel="normal" />
+
+ <!-- @hide @FlaggedApi("android.companion.flags.companion_transport_apis")
+ Allows an application to send and receive messages via CDM transports.
+ -->
+ <permission android:name="android.permission.USE_COMPANION_TRANSPORTS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to create new companion device associations.
+ @SystemApi
+ @hide -->
+ <permission android:name="android.permission.ASSOCIATE_COMPANION_DEVICES"
+ android:protectionLevel="internal|role" />
+
+ <!-- @SystemApi Allows an application to use SurfaceFlinger's low level features.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.ACCESS_SURFACE_FLINGER"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to rotate a surface by arbitrary degree.
+ This is a sub-feature of ACCESS_SURFACE_FLINGER and can be granted in a more concrete way.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.ROTATE_SURFACE_FLINGER"
+ android:protectionLevel="signature|recents" />
+
+ <!-- Allows an application to provide hints to SurfaceFlinger that can influence
+ its wakes up time to compose the next frame. This is a subset of the capabilities granted
+ by {@link #ACCESS_SURFACE_FLINGER}.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.WAKEUP_SURFACE_FLINGER"
+ android:protectionLevel="signature|recents" />
+
+ <!-- Allows an application to take screen shots and more generally
+ get access to the frame buffer data.
+ <p>Not for use by third-party applications.
+ @hide
+ @removed -->
+ <permission android:name="android.permission.READ_FRAME_BUFFER"
+ android:protectionLevel="signature|recents" />
+
+ <!-- Allows an application to change the touch mode state.
+ Without this permission, an app can only change the touch mode
+ if it currently has focus.
+ @hide -->
+ <permission android:name="android.permission.MODIFY_TOUCH_MODE_STATE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to use InputFlinger's low level features.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_INPUT_FLINGER"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to disable/enable input devices.
+ Could be used to prevent unwanted touch events
+ on a touchscreen, for example during swimming or rain.
+ @hide -->
+ <permission android:name="android.permission.DISABLE_INPUT_DEVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to configure and connect to Wifi displays -->
+ <permission android:name="android.permission.CONFIGURE_WIFI_DISPLAY"
+ android:protectionLevel="signature|knownSigner"
+ android:knownCerts="@array/wifi_known_signers" />
+
+ <!-- Allows an application to control low-level features of Wifi displays
+ such as opening an RTSP socket. This permission should only be used
+ by the display manager.
+ @hide -->
+ <permission android:name="android.permission.CONTROL_WIFI_DISPLAY"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to control the color modes set for displays system-wide.
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.CONFIGURE_DISPLAY_COLOR_MODE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to control the lights on the device.
+ @hide
+ @SystemApi
+ @TestApi -->
+ <permission android:name="android.permission.CONTROL_DEVICE_LIGHTS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to control the color saturation of the display.
+ @hide
+ @SystemApi -->
+ <permission android:name="android.permission.CONTROL_DISPLAY_SATURATION"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to control display color transformations.
+ <p>Not for use by third-party applications.</p>
+ @hide
+ @SystemApi -->
+ <permission android:name="android.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to collect usage information about brightness slider changes.
+ <p>Not for use by third-party applications.</p>
+ @hide
+ @SystemApi
+ @TestApi -->
+ <permission android:name="android.permission.BRIGHTNESS_SLIDER_USAGE"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Allows an application to collect ambient light stats.
+ <p>Not for use by third party applications.</p>
+ @hide
+ @SystemApi -->
+ <permission android:name="android.permission.ACCESS_AMBIENT_LIGHT_STATS"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Allows an application to modify the display brightness configuration
+ @hide
+ @SystemApi
+ @TestApi -->
+ <permission android:name="android.permission.CONFIGURE_DISPLAY_BRIGHTNESS"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Allows an application to control the system's display brightness
+ @hide -->
+ <permission android:name="android.permission.CONTROL_DISPLAY_BRIGHTNESS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to override the display mode requests
+ so the app requested mode will be selected and user settings and display
+ policies will be ignored.
+ @hide
+ @TestApi -->
+ <permission android:name="android.permission.OVERRIDE_DISPLAY_MODE_REQUESTS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to modify the refresh rate switching type. This
+ matches Setting.Secure.MATCH_CONTENT_FRAME_RATE.
+ @hide
+ @TestApi -->
+ <permission android:name="android.permission.MODIFY_REFRESH_RATE_SWITCHING_TYPE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to modify the user preferred display mode.
+ @hide
+ @TestApi -->
+ <permission android:name="android.permission.MODIFY_USER_PREFERRED_DISPLAY_MODE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to modify the HDR conversion mode.
+ @hide
+ @TestApi -->
+ <permission android:name="android.permission.MODIFY_HDR_CONVERSION_MODE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to control VPN.
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.CONTROL_VPN"
+ android:protectionLevel="signature|privileged" />
+ <uses-permission android:name="android.permission.CONTROL_VPN" />
+
+ <!-- Allows an application to access and modify always-on VPN configuration.
+ <p>Not for use by third-party or privileged applications.
+ @hide -->
+ <permission android:name="android.permission.CONTROL_ALWAYS_ON_VPN"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to capture the audio from tuner input devices types,
+ such as FM_TUNER.
+
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.CAPTURE_TUNER_AUDIO_INPUT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to capture audio output.
+ Use the {@code CAPTURE_MEDIA_OUTPUT} permission if only the {@code USAGE_UNKNOWN}),
+ {@code USAGE_MEDIA}) or {@code USAGE_GAME}) usages are intended to be captured.
+ <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi Allows an application to capture the audio played by other apps
+ that have set an allow capture policy of
+ {@link android.media.AudioAttributes#ALLOW_CAPTURE_BY_SYSTEM}.
+
+ Without this permission, only audio with an allow capture policy of
+ {@link android.media.AudioAttributes#ALLOW_CAPTURE_BY_ALL} can be used.
+
+ There are strong restriction listed at
+ {@link android.media.AudioAttributes#ALLOW_CAPTURE_BY_SYSTEM}
+ on what an app can do with the captured audio.
+
+ See {@code CAPTURE_AUDIO_OUTPUT} for capturing audio use cases other than media playback.
+
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.CAPTURE_MEDIA_OUTPUT"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi Allows an application to capture the audio played by other apps
+ with the {@code USAGE_VOICE_COMMUNICATION} usage.
+
+ The application may opt out of capturing by setting an allow capture policy of
+ {@link android.media.AudioAttributes#ALLOW_CAPTURE_BY_NONE}.
+
+ There are strong restriction listed at
+ {@link android.media.AudioAttributes#ALLOW_CAPTURE_BY_SYSTEM}
+ on what an app can do with the captured audio.
+
+ See {@code CAPTURE_AUDIO_OUTPUT} and {@code CAPTURE_MEDIA_OUTPUT} for capturing
+ audio use cases other than voice communication playback.
+
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.CAPTURE_VOICE_COMMUNICATION_OUTPUT"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi Allows an application to capture audio for hotword detection.
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.CAPTURE_AUDIO_HOTWORD"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi Allows an application to access the ultrasound content.
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.ACCESS_ULTRASOUND"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Puts an application in the chain of trust for sound trigger
+ operations. Being in the chain of trust allows an application to
+ delegate an identity of a separate entity to the sound trigger system
+ and vouch for the authenticity of this identity.
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.SOUNDTRIGGER_DELEGATE_IDENTITY"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to modify audio routing and override policy decisions.
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.MODIFY_AUDIO_ROUTING"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!--@SystemApi Allows an application to modify system audio settings that shouldn't be
+ controllable by external apps, such as volume settings or volume behaviors for audio
+ devices, regardless of their connection status.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to access the uplink and downlink audio of an ongoing
+ call.
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.CALL_AUDIO_INTERCEPTION"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @TestApi Allows an application to query audio related state.
+ @hide -->
+ <permission android:name="android.permission.QUERY_AUDIO_STATE"
+ android:protectionLevel="signature|role" />
+
+ <!-- Allows an application to modify what effects are applied to all audio
+ (matching certain criteria) from any application.
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.MODIFY_DEFAULT_AUDIO_EFFECTS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to disable system sound effects when the user exits one of
+ the application's activities.
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.DISABLE_SYSTEM_SOUND_EFFECTS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to provide remote displays.
+ <p>Not for use by third-party applications.</p>
+ @hide -->
+ <permission android:name="android.permission.REMOTE_DISPLAY_PROVIDER"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to capture video output.
+ <p>Not for use by third-party applications.</p>
+ @hide
+ @removed -->
+ <permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to capture secure video output.
+ <p>Not for use by third-party applications.</p>
+ @hide
+ @removed -->
+ <permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to know what content is playing and control its playback.
+ <p>Not for use by third-party applications due to privacy of media consumption</p> -->
+ <permission android:name="android.permission.MEDIA_CONTENT_CONTROL"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to control the routing of media apps.
+ <p>Only for use by role COMPANION_DEVICE_WATCH</p>
+ @FlaggedApi("com.android.media.flags.enable_privileged_routing_for_media_routing_control")
+ -->
+ <permission android:name="android.permission.MEDIA_ROUTING_CONTROL"
+ android:protectionLevel="signature|appop" />
+
+ <!-- @SystemApi @hide Allows an application to set the volume key long-press listener.
+ <p>When it's set, the application will receive the volume key long-press event
+ instead of changing volume.</p>
+ <p>Not for use by third-party applications</p> -->
+ <permission android:name="android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- @SystemApi @hide Allows an application to set media key event listener.
+ <p>When it's set, the application will receive the media key event before
+ any other media sessions. If the event is handled by the listener, other sessions
+ cannot get the event.</p>
+ <p>Not for use by third-party applications</p> -->
+ <permission android:name="android.permission.SET_MEDIA_KEY_LISTENER"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- @SystemApi Required to be able to disable the device (very dangerous!).
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.BRICK"
+ android:protectionLevel="signature" />
+
+ <!-- Required to be able to reboot the device.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.REBOOT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows low-level access to power management.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.DEVICE_POWER"
+ android:protectionLevel="signature|role" />
+
+ <!-- Allows toggling battery saver on the system.
+ Superseded by DEVICE_POWER permission. @hide @SystemApi
+ -->
+ <permission android:name="android.permission.POWER_SAVER"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows providing the system with battery predictions.
+ Superseded by DEVICE_POWER permission. @hide @SystemApi
+ -->
+ <permission android:name="android.permission.BATTERY_PREDICTION"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows access to the PowerManager.userActivity function.
+ <p>Not for use by third-party applications. @hide @SystemApi -->
+ <permission android:name="android.permission.USER_ACTIVITY"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide @SystemApi Allows an application to manage Low Power Standby settings.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MANAGE_LOW_POWER_STANDBY"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide @SystemApi Allows an application to request ports to remain open during
+ Low Power Standby.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.SET_LOW_POWER_STANDBY_PORTS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide Allows low-level access to tun tap driver -->
+ <permission android:name="android.permission.NET_TUNNELING"
+ android:protectionLevel="signature|role" />
+
+ <!-- Run as a manufacturer test application, running as the root user.
+ Only available when the device is running in manufacturer test mode.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.FACTORY_TEST"
+ android:protectionLevel="signature" />
+
+ <!-- @hide @TestApi @SystemApi Allows an application to broadcast the intent {@link
+ android.content.Intent#ACTION_CLOSE_SYSTEM_DIALOGS}.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS"
+ android:protectionLevel="signature|privileged|recents" />
+ <uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS" />
+
+ <!-- Allows an application to broadcast a notification that an application
+ package has been removed.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.BROADCAST_PACKAGE_REMOVED"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to broadcast an SMS receipt notification.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.BROADCAST_SMS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to broadcast a WAP PUSH receipt notification.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.BROADCAST_WAP_PUSH"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to broadcast privileged networking requests.
+ <p>Not for use by third-party applications.
+ @hide
+ @deprecated Use {@link android.Manifest.permission#REQUEST_NETWORK_SCORES} instead
+ -->
+ <permission android:name="android.permission.BROADCAST_NETWORK_PRIVILEGED"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Not for use by third-party applications. -->
+ <permission android:name="android.permission.MASTER_CLEAR"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Allows an application to call any phone number, including emergency
+ numbers, without going through the Dialer user interface for the user
+ to confirm the call being placed.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.CALL_PRIVILEGED"
+ android:protectionLevel="signature|privileged" />
+ <uses-permission android:name="android.permission.CALL_PRIVILEGED" />
+
+ <!-- @SystemApi Allows an application to perform CDMA OTA provisioning @hide -->
+ <permission android:name="android.permission.PERFORM_CDMA_PROVISIONING"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi Allows an application to perform SIM Activation @hide -->
+ <permission android:name="android.permission.PERFORM_SIM_ACTIVATION"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows enabling/disabling location update notifications from
+ the radio.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.CONTROL_LOCATION_UPDATES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows read/write access to the "properties" table in the checkin
+ database, to change values that get uploaded.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to collect component usage
+ statistics
+ <p>Declaring the permission implies intention to use the API and the user of the
+ device can grant permission through the Settings application.
+ <p>Protection level: signature|privileged|development|appop|retailDemo -->
+ <permission android:name="android.permission.PACKAGE_USAGE_STATS"
+ android:protectionLevel="signature|privileged|development|appop|retailDemo" />
+ <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
+
+ <!-- @SystemApi @hide
+ @FlaggedApi("android.app.usage.report_usage_stats_permission")
+ Allows trusted system components to report events to UsageStatsManager -->
+ <permission android:name="android.permission.REPORT_USAGE_STATS"
+ android:protectionLevel="signature|module" />
+
+ <!-- Allows an application to query broadcast response stats (see
+ {@link android.app.usage.BroadcastResponseStats}).
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.ACCESS_BROADCAST_RESPONSE_STATS"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- Allows a data loader to read a package's access logs. The access logs contain the
+ set of pages referenced over time.
+ <p>Declaring the permission implies intention to use the API and the user of the
+ device can grant permission through the Settings application.
+ <p>Protection level: signature|privileged|appop
+ <p>A data loader has to be the one which provides data to install an app.
+ <p>A data loader has to have both permission:LOADER_USAGE_STATS AND
+ appop:LOADER_USAGE_STATS allowed to be able to access the read logs. -->
+ <permission android:name="android.permission.LOADER_USAGE_STATS"
+ android:protectionLevel="signature|privileged|appop" />
+ <uses-permission android:name="android.permission.LOADER_USAGE_STATS" />
+
+ <!-- @hide @SystemApi Allows an application to observe usage time of apps. The app can register
+ for callbacks when apps reach a certain usage time limit, etc. -->
+ <permission android:name="android.permission.OBSERVE_APP_USAGE"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @hide @TestApi @SystemApi Allows an application to change the app idle state of an app.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.CHANGE_APP_IDLE_STATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide @SystemApi Allows an application to change the estimated launch time of an app.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.CHANGE_APP_LAUNCH_TIME_ESTIMATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide @SystemApi Allows an application to temporarily allowlist an inactive app to
+ access the network and acquire wakelocks.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Permission an application must hold in order to use
+ {@link android.provider.Settings#ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}.
+ <p>Protection level: normal -->
+ <permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"
+ android:label="@string/permlab_requestIgnoreBatteryOptimizations"
+ android:description="@string/permdesc_requestIgnoreBatteryOptimizations"
+ android:protectionLevel="normal" />
+
+ <!-- Allows an application to collect battery statistics
+ <p>Protection level: signature|privileged|development -->
+ <permission android:name="android.permission.BATTERY_STATS"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!--Allows an application to manage statscompanion.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.STATSCOMPANION"
+ android:protectionLevel="signature" />
+
+ <!--@SystemApi @hide Allows an application to register stats pull atom callbacks.
+ <p>Not for use by third-party applications.-->
+ <permission android:name="android.permission.REGISTER_STATS_PULL_ATOM"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows an application to read restricted stats from statsd.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.READ_RESTRICTED_STATS"
+ android:protectionLevel="internal|privileged" />
+
+ <!-- @SystemApi Allows an application to control the backup and restore process.
+ <p>Not for use by third-party applications.
+ @hide pending API council -->
+ <permission android:name="android.permission.BACKUP"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to make modifications to device settings such that these
+ modifications will be overridden by settings restore..
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE"
+ android:protectionLevel="signature|setup" />
+
+ <!-- @SystemApi Allows application to manage
+ {@link android.security.keystore.recovery.RecoveryController}.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.RECOVER_KEYSTORE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows a package to launch the secure full-backup confirmation UI.
+ ONLY the system process may hold this permission.
+ @hide -->
+ <permission android:name="android.permission.CONFIRM_FULL_BACKUP"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a {@link android.widget.RemoteViewsService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature|privileged -->
+ <permission android:name="android.permission.BIND_REMOTEVIEWS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to tell the AppWidget service which application
+ can access AppWidget's data. The normal user flow is that a user
+ picks an AppWidget to go into a particular host, thereby giving that
+ host application access to the private data from the AppWidget app.
+ An application that has this permission should honor that contract.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.BIND_APPWIDGET"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide Allows sysui to manage user grants of slice permissions. -->
+ <permission android:name="android.permission.MANAGE_SLICE_PERMISSIONS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Private permission, to restrict who can bring up a dialog to add a new
+ keyguard widget
+ @hide -->
+ <permission android:name="android.permission.BIND_KEYGUARD_APPWIDGET"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Internal permission allowing an application to query/set which
+ applications can bind AppWidgets.
+ @hide -->
+ <permission android:name="android.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows applications to change the background data setting.
+ <p>Not for use by third-party applications.
+ @hide pending API council -->
+ <permission android:name="android.permission.CHANGE_BACKGROUND_DATA_SETTING"
+ android:protectionLevel="signature" />
+
+ <!-- This permission can be used on content providers to allow the global
+ search system to access their data. Typically it used when the
+ provider has some permissions protecting it (which global search
+ would not be expected to hold), and added as a read-only permission
+ to the path in the provider where global search queries are
+ performed. This permission can not be held by regular applications;
+ it is used by applications to protect themselves from everyone else
+ besides global search.
+ <p>Protection level: signature|privileged -->
+ <permission android:name="android.permission.GLOBAL_SEARCH"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Internal permission protecting access to the global search
+ system: ensures that only the system can access the provider
+ to perform queries (since this otherwise provides unrestricted
+ access to a variety of content providers), and to write the
+ search statistics (to keep applications from gaming the source
+ ranking).
+ @hide -->
+ <permission android:name="android.permission.GLOBAL_SEARCH_CONTROL"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Internal permission to allows an application to read indexable data.
+ @hide -->
+ <permission android:name="android.permission.READ_SEARCH_INDEXABLES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Internal permission to allows an application to bind to suggestion service.
+ @hide -->
+ <permission android:name="android.permission.BIND_SETTINGS_SUGGESTIONS_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Internal permission to allows an application to access card content provider. -->
+ <permission android:name="android.permission.WRITE_SETTINGS_HOMEPAGE_DATA"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- An application needs this permission for
+ {@link android.provider.Settings#ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY} to show its
+ {@link android.app.Activity} embedded in Settings app. -->
+ <permission android:name="android.permission.LAUNCH_MULTI_PANE_SETTINGS_DEEP_LINK"
+ android:protectionLevel="signature|preinstalled" />
+
+ <!-- @SystemApi {@link android.app.Activity} should require this permission to ensure that only
+ the settings app can embed it in a multi pane window.
+ @hide -->
+ <permission android:name="android.permission.ALLOW_PLACE_IN_MULTI_PANE_SETTINGS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows applications to set a live wallpaper.
+ @hide XXX Change to signature once the picker is moved to its
+ own apk as Ghod Intended. -->
+ <permission android:name="android.permission.SET_WALLPAPER_COMPONENT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows applications to set the wallpaper dim amount.
+ @hide. -->
+ <permission android:name="android.permission.SET_WALLPAPER_DIM_AMOUNT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows applications to read dream settings and dream state.
+ @hide -->
+ <permission android:name="android.permission.READ_DREAM_STATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows applications to write dream settings, and start or stop dreaming.
+ @hide -->
+ <permission android:name="android.permission.WRITE_DREAM_STATE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide Allows applications to read whether ambient display is suppressed. -->
+ <permission android:name="android.permission.READ_DREAM_SUPPRESSION"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allow an application to read and write the cache partition.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by default container service so that only
+ the system can bind to it and use it to copy
+ protected data to secure containers or files
+ accessible to the system.
+ @hide -->
+ <permission android:name="android.permission.COPY_PROTECTED_DATA"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Internal permission protecting access to the encryption methods
+ @hide
+ -->
+ <permission android:name="android.permission.CRYPT_KEEPER"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi Allows an application to read historical network usage for
+ specific networks and applications. @hide -->
+ <permission android:name="android.permission.READ_NETWORK_USAGE_HISTORY"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to manage network policies (such as warning and disable
+ limits) and to define application-specific rules. @hide -->
+ <permission android:name="android.permission.MANAGE_NETWORK_POLICY"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide @deprecated use UPDATE_DEVICE_STATS instead -->
+ <permission android:name="android.permission.MODIFY_NETWORK_ACCOUNTING"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi @hide Allows an application to manage carrier subscription plans. -->
+ <permission android:name="android.permission.MANAGE_SUBSCRIPTION_PLANS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- C2DM permission.
+ @hide Used internally.
+ -->
+ <permission android:name="android.intent.category.MASTER_CLEAR.permission.C2D_MESSAGE"
+ android:protectionLevel="signature" />
+ <uses-permission android:name="android.intent.category.MASTER_CLEAR.permission.C2D_MESSAGE"/>
+
+ <!-- @SystemApi @hide Package verifier needs to have this permission before the PackageManager will
+ trust it to verify packages.
+ -->
+ <permission android:name="android.permission.PACKAGE_VERIFICATION_AGENT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by package verifier receiver, to ensure that only the
+ system can interact with it.
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_PACKAGE_VERIFIER"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Rollback manager needs to have this permission before the PackageManager will
+ trust it to enable rollback.
+ -->
+ <permission android:name="android.permission.PACKAGE_ROLLBACK_AGENT"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @TestApi @hide Allows managing apk level rollbacks. -->
+ <permission android:name="android.permission.MANAGE_ROLLBACKS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @TestApi @hide Allows testing apk level rollbacks. -->
+ <permission android:name="android.permission.TEST_MANAGE_ROLLBACKS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows an application to mark other applications as harmful -->
+ <permission android:name="android.permission.SET_HARMFUL_APP_WARNINGS"
+ android:protectionLevel="signature|verifier" />
+
+ <!-- @SystemApi @hide Intent filter verifier needs to have this permission before the
+ PackageManager will trust it to verify intent filters.
+ -->
+ <permission android:name="android.permission.INTENT_FILTER_VERIFICATION_AGENT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by intent filter verifier rintent-filtereceiver, to ensure that only the
+ system can interact with it.
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_INTENT_FILTER_VERIFIER"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Domain verification agent package needs to have this permission before the
+ system will trust it to verify domains.
+
+ TODO(159952358): STOPSHIP: This must be updated to the new "internal" protectionLevel
+ -->
+ <permission android:name="android.permission.DOMAIN_VERIFICATION_AGENT"
+ android:protectionLevel="internal|privileged" />
+
+ <!-- @SystemApi @hide Must be required by the domain verification agent's intent
+ BroadcastReceiver, to ensure that only the system can interact with it.
+ -->
+ <permission android:name="android.permission.BIND_DOMAIN_VERIFICATION_AGENT"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @hide Allows an app like Settings to update the user's grants to what domains
+ an app is allowed to automatically open.
+ -->
+ <permission android:name="android.permission.UPDATE_DOMAIN_VERIFICATION_USER_SELECTION"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows applications to access serial ports via the SerialManager.
+ @hide -->
+ <permission android:name="android.permission.SERIAL_PORT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows the holder to access content providers from outside an ApplicationThread.
+ This permission is enforced by the ActivityManagerService on the corresponding APIs,
+ in particular ActivityManagerService#getContentProviderExternal(String) and
+ ActivityManagerService#removeContentProviderExternal(String).
+ @hide
+ -->
+ <permission android:name="android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to hold an UpdateLock, recommending that a headless
+ OTA reboot *not* occur while the lock is held.
+ @hide -->
+ <permission android:name="android.permission.UPDATE_LOCK"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application the opportunity to become a
+ {@link android.service.notification.NotificationAssistantService}.
+ User permission is still required before access is granted.
+ @hide -->
+ <permission android:name="android.permission.REQUEST_NOTIFICATION_ASSISTANT_SERVICE"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi @TestApi Allows an application to read the current set of notifications, including
+ any metadata and intents attached.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_NOTIFICATIONS"
+ android:protectionLevel="signature|privileged|appop" />
+
+ <!-- Marker permission for applications that wish to access notification policy. This permission
+ is not supported on managed profiles.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY"
+ android:description="@string/permdesc_access_notification_policy"
+ android:label="@string/permlab_access_notification_policy"
+ android:protectionLevel="normal" />
+
+ <!-- Allows modification of do not disturb rules and policies. Only allowed for system
+ processes.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_NOTIFICATIONS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi @TestApi Allows adding/removing enabled notification listener components.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_NOTIFICATION_LISTENERS"
+ android:protectionLevel="signature|installer" />
+ <uses-permission android:name="android.permission.MANAGE_NOTIFICATION_LISTENERS" />
+
+ <!-- @SystemApi Allows notifications to be colorized
+ <p>Not for use by third-party applications. @hide -->
+ <permission android:name="android.permission.USE_COLORIZED_NOTIFICATIONS"
+ android:protectionLevel="signature|setup|role" />
+
+ <!-- Allows access to keyguard secure storage. Only allowed for system processes.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE"
+ android:protectionLevel="signature|setup" />
+
+ <!-- Allows applications to set the initial lockscreen state.
+ <p>Not for use by third-party applications. @hide -->
+ <permission android:name="android.permission.SET_INITIAL_LOCK"
+ android:protectionLevel="signature|setup"/>
+
+ <!-- @TestApi Allows applications to set and verify lockscreen credentials.
+ @hide -->
+ <permission android:name="android.permission.SET_AND_VERIFY_LOCKSCREEN_CREDENTIALS"
+ android:protectionLevel="signature"/>
+
+ <!-- @SystemApi Allows application to verify lockscreen credentials provided by a remote device.
+ @hide -->
+ <permission android:name="android.permission.CHECK_REMOTE_LOCKSCREEN"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows managing (adding, removing) fingerprint templates. Reserved for the system. @hide -->
+ <permission android:name="android.permission.MANAGE_FINGERPRINT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows managing (adding, removing) face templates. Reserved for the system. @hide -->
+ <permission android:name="android.permission.MANAGE_FACE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an app to reset fingerprint attempt counter. Reserved for the system. @hide -->
+ <permission android:name="android.permission.RESET_FINGERPRINT_LOCKOUT"
+ android:protectionLevel="signature" />
+
+ <!-- Allows access to TestApis for various components in the biometric stack, including
+ FingerprintService, FaceService, BiometricService. Used by com.android.server.biometrics
+ CTS tests. @hide @TestApi -->
+ <permission android:name="android.permission.TEST_BIOMETRIC"
+ android:protectionLevel="signature" />
+
+ <!-- Allows direct access to the <Biometric>Service interfaces. Reserved for the system. @hide -->
+ <permission android:name="android.permission.MANAGE_BIOMETRIC"
+ android:protectionLevel="signature" />
+
+ <!-- Allows direct access to the <Biometric>Service authentication methods. Reserved for the system. @hide -->
+ <permission android:name="android.permission.USE_BIOMETRIC_INTERNAL"
+ android:protectionLevel="signature" />
+
+ <!-- Allows privileged apps to access the background face authentication.
+ @SystemApi
+ @FlaggedApi("android.hardware.biometrics.face_background_authentication")
+ @hide -->
+ <permission android:name="android.permission.USE_BACKGROUND_FACE_AUTHENTICATION"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows the system to control the BiometricDialog (SystemUI). Reserved for the system. @hide -->
+ <permission android:name="android.permission.MANAGE_BIOMETRIC_DIALOG"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to set the BiometricDialog (SystemUI) logo .
+ <p>Not for use by third-party applications.
+ @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt")
+ -->
+ <permission android:name="android.permission.SET_BIOMETRIC_DIALOG_LOGO"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to control keyguard. Only allowed for system processes.
+ @hide -->
+ <permission android:name="android.permission.CONTROL_KEYGUARD"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to control keyguard features like secure notifications.
+ @hide -->
+ <permission android:name="android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to manage weak escrow token on the device. This permission
+ is not available to third party applications.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_WEAK_ESCROW_TOKEN"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to listen to trust changes. Only allowed for system processes.
+ @hide -->
+ <permission android:name="android.permission.TRUST_LISTENER"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to provide a trust agent.
+ @hide For security reasons, this is a platform-only permission. -->
+ <permission android:name="android.permission.PROVIDE_TRUST_AGENT"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to show a message
+ on the keyguard when asking to dismiss it.
+ @hide For security reasons, this is a platform-only permission. -->
+ <permission android:name="android.permission.SHOW_KEYGUARD_MESSAGE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to launch the trust agent settings activity.
+ @hide -->
+ <permission android:name="android.permission.LAUNCH_TRUST_AGENT_SETTINGS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Must be required by an {@link
+ android.service.trust.TrustAgentService},
+ to ensure that only the system can bind to it.
+ @hide -->
+ <permission android:name="android.permission.BIND_TRUST_AGENT"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an {@link
+ android.service.notification.NotificationListenerService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Must be required by an {@link
+ android.service.notification.NotificationAssistantService} to ensure that only the system
+ can bind to it.
+ <p>Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_NOTIFICATION_ASSISTANT_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a {@link
+ android.service.chooser.ChooserTargetService}, to ensure that
+ only the system can bind to it.
+ <p>Protection level: signature
+
+ @deprecated For publishing direct share targets, please follow the instructions in
+ https://developer.android.com/training/sharing/receive.html#providing-direct-share-targets
+ instead.
+ -->
+ <permission android:name="android.permission.BIND_CHOOSER_TARGET_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Must be held by services that extend
+ {@link android.service.resolver.ResolverRankerService}.
+ <p>Protection level: signature|privileged
+ @hide
+ -->
+ <permission android:name="android.permission.PROVIDE_RESOLVER_RANKER_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Must be required by services that extend
+ {@link android.service.resolver.ResolverRankerService}, to ensure that only the system can
+ bind to them.
+ <p>Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_RESOLVER_RANKER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by a {@link
+ android.service.notification.ConditionProviderService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_CONDITION_PROVIDER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an {@link android.service.dreams.DreamService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.BIND_DREAM_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an {@link android.app.usage.CacheQuotaService} to ensure that only the
+ system can bind to it.
+ @hide This is not a third-party API (intended for OEMs and system apps).
+ -->
+ <permission android:name="android.permission.BIND_CACHE_QUOTA_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to call into a carrier setup flow. It is up to the
+ carrier setup application to enforce that this permission is required
+ @hide This is not a third-party API (intended for OEMs and system apps). -->
+ <permission android:name="android.permission.INVOKE_CARRIER_SETUP"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to listen for network condition observations.
+ @hide This is not a third-party API (intended for system apps). -->
+ <permission android:name="android.permission.ACCESS_NETWORK_CONDITIONS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to provision and access DRM certificates
+ @hide This is not a third-party API (intended for system apps). -->
+ <permission android:name="android.permission.ACCESS_DRM_CERTIFICATES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Api Allows an application to manage media projection sessions.
+ @hide This is not a third-party API (intended for system apps). -->
+ <permission android:name="android.permission.MANAGE_MEDIA_PROJECTION"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to read install sessions
+ @hide This is not a third-party API (intended for system apps). -->
+ <permission android:name="android.permission.READ_INSTALL_SESSIONS"
+ android:label="@string/permlab_readInstallSessions"
+ android:description="@string/permdesc_readInstallSessions"
+ android:protectionLevel="normal"/>
+
+ <!-- @SystemApi Allows an application to remove DRM certificates
+ @hide This is not a third-party API (intended for system apps). -->
+ <permission android:name="android.permission.REMOVE_DRM_CERTIFICATES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @deprecated Use {@link android.Manifest.permission#BIND_CARRIER_SERVICES} instead -->
+ <permission android:name="android.permission.BIND_CARRIER_MESSAGING_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to interact with the currently active
+ {@link android.service.voice.VoiceInteractionService}.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_VOICE_INTERACTION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- The system process that is allowed to bind to services in carrier apps will
+ have this permission. Carrier apps should use this permission to protect
+ their services that only the system is allowed to bind to.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.BIND_CARRIER_SERVICES"
+ android:label="@string/permlab_bindCarrierServices"
+ android:description="@string/permdesc_bindCarrierServices"
+ android:protectionLevel="signature|privileged" />
+
+ <!--
+ Allows the holder to start the permission usage screen for an app.
+ <p>Protection level: signature|installer
+ -->
+ <permission android:name="android.permission.START_VIEW_PERMISSION_USAGE"
+ android:label="@string/permlab_startViewPermissionUsage"
+ android:description="@string/permdesc_startViewPermissionUsage"
+ android:protectionLevel="signature|installer|module" />
+
+ <!--
+ @SystemApi
+ Allows the holder to start the screen to review permission decisions.
+ <p>Protection level: signature|installer
+ @hide -->
+ <permission android:name="android.permission.START_REVIEW_PERMISSION_DECISIONS"
+ android:label="@string/permlab_startReviewPermissionDecisions"
+ android:description="@string/permdesc_startReviewPermissionDecisions"
+ android:protectionLevel="signature|installer" />
+
+ <!--
+ Allows the holder to start the screen with a list of app features.
+ <p>Protection level: signature|installer
+ -->
+ <permission android:name="android.permission.START_VIEW_APP_FEATURES"
+ android:label="@string/permlab_startViewAppFeatures"
+ android:description="@string/permdesc_startViewAppFeatures"
+ android:protectionLevel="signature|installer" />
+
+ <!-- Allows an application to query whether DO_NOT_ASK_CREDENTIALS_ON_BOOT
+ flag is set.
+ @hide -->
+ <permission android:name="android.permission.QUERY_DO_NOT_ASK_CREDENTIALS_ON_BOOT"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows applications to kill UIDs.
+ <p>This permission can be granted to the SYSTEM_SUPERVISOR role used for parental
+ controls.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.KILL_UID"
+ android:protectionLevel="signature|installer|role" />
+
+ <!-- @SystemApi Allows applications to read the local WiFi and Bluetooth MAC address.
+ @hide -->
+ <permission android:name="android.permission.LOCAL_MAC_ADDRESS"
+ android:protectionLevel="signature|privileged" />
+ <uses-permission android:name="android.permission.LOCAL_MAC_ADDRESS"/>
+
+ <!-- @SystemApi Allows access to MAC addresses of WiFi and Bluetooth peer devices.
+ @hide -->
+ <permission android:name="android.permission.PEERS_MAC_ADDRESS"
+ android:protectionLevel="signature|setup|role" />
+
+ <!-- Allows the Nfc stack to dispatch Nfc messages to applications. Applications
+ can use this permission to ensure incoming Nfc messages are from the Nfc stack
+ and not simulated by another application.
+ @hide -->
+ <permission android:name="android.permission.DISPATCH_NFC_MESSAGE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows changing day / night mode when system is configured with
+ config_lockDayNightMode set to true. If requesting app does not have permission,
+ it will be ignored.
+ @hide -->
+ <permission android:name="android.permission.MODIFY_DAY_NIGHT_MODE"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi Allows entering or exiting car mode using a specified priority.
+ This permission is required to use UiModeManager while specifying a priority for the calling
+ app. A device manufacturer uses this permission to prioritize the apps which can
+ potentially request to enter car-mode on a device to help establish the correct behavior
+ where multiple such apps are active at the same time.
+ @hide -->
+ <permission android:name="android.permission.ENTER_CAR_MODE_PRIORITIZED"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Required to receive ACTION_ENTER_CAR_MODE_PRIVILEGED or
+ ACTION_EXIT_CAR_MODE_PRIVILEGED.
+ @hide -->
+ <permission android:name="android.permission.HANDLE_CAR_MODE_CHANGES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows the holder to send category_car notifications.
+ @hide -->
+ <permission
+ android:name="android.permission.SEND_CATEGORY_CAR_NOTIFICATIONS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- The system process is explicitly the only one allowed to launch the
+ confirmation UI for full backup/restore -->
+ <uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP"/>
+
+ <!-- @SystemApi Allows the holder to access and manage instant applications on the device.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_INSTANT_APPS"
+ android:protectionLevel="signature|installer|verifier|role" />
+ <uses-permission android:name="android.permission.ACCESS_INSTANT_APPS"/>
+
+ <!-- Allows the holder to view the instant applications on the device.
+ @hide -->
+ <permission android:name="android.permission.VIEW_INSTANT_APPS"
+ android:protectionLevel="signature|preinstalled" />
+
+ <!-- Allows the holder to manage whether the system can bind to services
+ provided by instant apps. This permission is intended to protect
+ test/development fucntionality and should be used only in such cases.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_BIND_INSTANT_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Allows receiving the usage of media resource e.g. video/audio codec and
+ graphic memory.
+ @hide -->
+ <permission android:name="android.permission.RECEIVE_MEDIA_RESOURCE_USAGE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by system/priv apps when accessing the sound trigger
+ APIs given by {@link SoundTriggerManager}.
+ @hide
+ @SystemApi -->
+ <permission android:name="android.permission.MANAGE_SOUND_TRIGGER"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- Must be required by system/priv apps to run sound trigger recognition sessions while in
+ battery saver mode.
+ @hide
+ @SystemApi -->
+ <permission android:name="android.permission.SOUND_TRIGGER_RUN_IN_BATTERY_SAVER"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Must be required by system/priv apps implementing sound trigger detection services
+ @hide
+ @SystemApi -->
+ <permission android:name="android.permission.BIND_SOUND_TRIGGER_DETECTION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows trusted applications to dispatch managed provisioning message to Managed
+ Provisioning app. If requesting app does not have permission, it will be ignored.
+ @hide -->
+ <permission android:name="android.permission.DISPATCH_PROVISIONING_MESSAGE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows the holder to read blocked numbers. See
+ {@link android.provider.BlockedNumberContract}.
+ @SystemApi
+ @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies")
+ @hide -->
+ <permission android:name="android.permission.READ_BLOCKED_NUMBERS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows the holder to write blocked numbers. See
+ {@link android.provider.BlockedNumberContract}.
+ @SystemApi
+ @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies")
+ @hide -->
+ <permission android:name="android.permission.WRITE_BLOCKED_NUMBERS"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an {@link android.service.vr.VrListenerService}, to ensure that only
+ the system can bind to it.
+ <p>Protection level: signature -->
+ <permission android:name="android.permission.BIND_VR_LISTENER_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by system apps when accessing restricted VR APIs.
+ @hide
+ @SystemApi
+ <p>Protection level: signature -->
+ <permission android:name="android.permission.RESTRICTED_VR_ACCESS"
+ android:protectionLevel="signature|preinstalled" />
+
+ <!-- Required to make calls to {@link android.service.vr.IVrManager}.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_VR_MANAGER"
+ android:protectionLevel="signature" />
+
+ <!-- Required to access VR-Mode state and state change events via {android.app.VrStateCallback}
+ @hide -->
+ <permission android:name="android.permission.ACCESS_VR_STATE"
+ android:protectionLevel="signature|preinstalled" />
+
+ <!-- Allows an application to allowlist tasks during lock task mode
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.UPDATE_LOCK_TASK_PACKAGES"
+ android:protectionLevel="signature|setup" />
+
+ <!-- @SystemApi Allows an application to replace the app name displayed alongside notifications
+ in the N-release and later.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to show notifications before the device is provisioned.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.NOTIFICATION_DURING_SETUP"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to manage auto-fill sessions.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MANAGE_AUTO_FILL"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to manage the content capture service.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MANAGE_CONTENT_CAPTURE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to manager the rotation resolver service.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MANAGE_ROTATION_RESOLVER"
+ android:protectionLevel="signature"/>
+
+ <!-- @SystemApi Allows an application to manage the cloudsearch service.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MANAGE_CLOUDSEARCH"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi Allows an application to manage the music recognition service.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MANAGE_MUSIC_RECOGNITION"
+ android:protectionLevel="signature|privileged|role" />
+
+ <!-- @SystemApi Allows an application to manage speech recognition service.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MANAGE_SPEECH_RECOGNITION"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to interact with the content suggestions service.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MANAGE_CONTENT_SUGGESTIONS"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows an application to manage the app predictions service.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MANAGE_APP_PREDICTIONS"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows an application to manage the search ui service.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MANAGE_SEARCH_UI"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows an application to manage the smartspace service.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MANAGE_SMARTSPACE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to access the smartspace service as a client.
+ @FlaggedApi(android.app.smartspace.flags.Flags.FLAG_ACCESS_SMARTSPACE)
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.ACCESS_SMARTSPACE"
+ android:protectionLevel="signature|privileged|development" />
+
+ <!-- @SystemApi Allows an application to manage the wallpaper effects
+ generation service.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MANAGE_WALLPAPER_EFFECTS_GENERATION"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an app to set the theme overlay in /vendor/overlay
+ being used.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.MODIFY_THEME_OVERLAY"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an instant app to create foreground services.
+ <p>Protection level: signature|development|instant|appop -->
+ <permission android:name="android.permission.INSTANT_APP_FOREGROUND_SERVICE"
+ android:protectionLevel="signature|development|instant|appop" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground}.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE"
+ android:description="@string/permdesc_foregroundService"
+ android:label="@string/permlab_foregroundService"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "camera".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA"
+ android:description="@string/permdesc_foregroundServiceCamera"
+ android:label="@string/permlab_foregroundServiceCamera"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "connectedDevice".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE"
+ android:description="@string/permdesc_foregroundServiceConnectedDevice"
+ android:label="@string/permlab_foregroundServiceConnectedDevice"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "dataSync".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"
+ android:description="@string/permdesc_foregroundServiceDataSync"
+ android:label="@string/permlab_foregroundServiceDataSync"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "location".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION"
+ android:description="@string/permdesc_foregroundServiceLocation"
+ android:label="@string/permlab_foregroundServiceLocation"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "mediaPlayback".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"
+ android:description="@string/permdesc_foregroundServiceMediaPlayback"
+ android:label="@string/permlab_foregroundServiceMediaPlayback"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "mediaProjection".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"
+ android:description="@string/permdesc_foregroundServiceMediaProjection"
+ android:label="@string/permlab_foregroundServiceMediaProjection"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "microphone".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"
+ android:description="@string/permdesc_foregroundServiceMicrophone"
+ android:label="@string/permlab_foregroundServiceMicrophone"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "phoneCall".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL"
+ android:description="@string/permdesc_foregroundServicePhoneCall"
+ android:label="@string/permlab_foregroundServicePhoneCall"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "health".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH"
+ android:description="@string/permdesc_foregroundServiceHealth"
+ android:label="@string/permlab_foregroundServiceHealth"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "remoteMessaging".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING"
+ android:description="@string/permdesc_foregroundServiceRemoteMessaging"
+ android:label="@string/permlab_foregroundServiceRemoteMessaging"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "systemExempted".
+ Apps are allowed to use this type only in the use cases listed in
+ {@link android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED}.
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED"
+ android:description="@string/permdesc_foregroundServiceSystemExempted"
+ android:label="@string/permlab_foregroundServiceSystemExempted"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "fileManagement".
+ <p>Protection level: normal|instant
+ @hide
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_FILE_MANAGEMENT"
+ android:description="@string/permdesc_foregroundServiceFileManagement"
+ android:label="@string/permlab_foregroundServiceFileManagement"
+ android:protectionLevel="normal|instant" />
+
+ <!-- @FlaggedApi("android.content.pm.introduce_media_processing_type")
+ Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "mediaProcessing".
+ <p>Protection level: normal|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROCESSING"
+ android:description="@string/permdesc_foregroundServiceMediaProcessing"
+ android:label="@string/permlab_foregroundServiceMediaProcessing"
+ android:protectionLevel="normal|instant" />
+
+ <!-- Allows a regular application to use {@link android.app.Service#startForeground
+ Service.startForeground} with the type "specialUse".
+ <p>Protection level: normal|appop|instant
+ -->
+ <permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"
+ android:description="@string/permdesc_foregroundServiceSpecialUse"
+ android:label="@string/permlab_foregroundServiceSpecialUse"
+ android:protectionLevel="normal|appop|instant" />
+
+ <!-- @SystemApi Allows to access all app shortcuts.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_SHORTCUTS"
+ android:protectionLevel="signature|role|recents" />
+
+ <!-- @SystemApi Allows unlimited calls to shortcut mutation APIs.
+ @hide -->
+ <permission android:name="android.permission.UNLIMITED_SHORTCUTS_API_CALLS"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows an application to read the runtime profiles of other apps.
+ @hide <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.READ_RUNTIME_PROFILES"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide Allows audio policy management. -->
+ <permission android:name="android.permission.MANAGE_AUDIO_POLICY"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to turn on / off quiet mode.
+ @hide -->
+ <permission android:name="android.permission.MODIFY_QUIET_MODE"
+ android:protectionLevel="signature|privileged|development|role" />
+
+ <!-- Allows internal management of the camera framework
+ @hide -->
+ <permission android:name="android.permission.MANAGE_CAMERA"
+ android:protectionLevel="signature" />
+
+ <!-- Allows an application to control remote animations. See
+ {@link ActivityOptions#makeRemoteAnimation}
+ @hide <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS"
+ android:protectionLevel="signature|privileged|recents" />
+
+ <!-- Allows an application to watch changes and/or active state of app ops.
+ @hide <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.WATCH_APPOPS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows hidden API checks to be disabled when starting a process.
+ @hide <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.DISABLE_HIDDEN_API_CHECKS"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Permission that protects the
+ {@link android.provider.Telephony.Intents#ACTION_DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL}
+ broadcast -->
+ <permission android:name="android.permission.MONITOR_DEFAULT_SMS_PACKAGE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- A subclass of {@link android.service.carrier.CarrierMessagingClientService} must be protected with this permission.
+ <p>Protection level: signature -->
+ <permission android:name="android.permission.BIND_CARRIER_MESSAGING_CLIENT_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- Must be required by an {@link android.service.watchdog.ExplicitHealthCheckService} to
+ ensure that only the system can bind to it.
+ @hide This is not a third-party API (intended for OEMs and system apps).
+ -->
+ <permission android:name="android.permission.BIND_EXPLICIT_HEALTH_CHECK_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Must be required by an {@link android.service.storage.ExternalStorageService} to
+ ensure that only the system can bind to it.
+ @hide This is not a third-party API (intended for OEMs and system apps).
+ -->
+ <permission android:name="android.permission.BIND_EXTERNAL_STORAGE_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Permission that allows configuring appops.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MANAGE_APPOPS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Permission that allows background clipboard access.
+ @hide Not for use by third-party applications. -->
+ <permission android:name="android.permission.READ_CLIPBOARD_IN_BACKGROUND"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Permission that allows apps to disable the clipboard access notifications.
+ @hide
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.MANAGE_CLIPBOARD_ACCESS_NOTIFICATION"
+ android:protectionLevel="signature|installer" />
+
+ <!-- @hide Permission that suppresses the notification when the clipboard is accessed.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.SUPPRESS_CLIPBOARD_ACCESS_NOTIFICATION"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows modifying accessibility state.
+ <p> The only approved role for this permission is COMPANION_DEVICE_APP_STREAMING.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_ACCESSIBILITY"
+ android:protectionLevel="signature|setup|recents|role" />
+
+ <!-- @SystemApi Allows an app to grant a profile owner access to device identifiers.
+ <p>Not for use by third-party applications.
+ @deprecated
+ @hide -->
+ <permission android:name="android.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an app to mark a profile owner as managing an organization-owned device.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.MARK_DEVICE_ORGANIZATION_OWNED"
+ android:protectionLevel="signature|role" />
+
+ <!-- Allows financial apps to read filtered sms messages.
+ Protection level: signature|appop
+ @deprecated The API that used this permission is no longer functional. -->
+ <permission android:name="android.permission.SMS_FINANCIAL_TRANSACTIONS"
+ android:protectionLevel="signature|appop" />
+
+ <!-- Required for apps targeting {@link android.os.Build.VERSION_CODES#Q} that want to use
+ {@link android.app.Notification.Builder#setFullScreenIntent notification full screen
+ intents}.
+ <p>Protection level: normal -->
+ <permission android:name="android.permission.USE_FULL_SCREEN_INTENT"
+ android:label="@string/permlab_fullScreenIntent"
+ android:description="@string/permdesc_fullScreenIntent"
+ android:protectionLevel="normal|appop" />
+
+ <!-- @SystemApi Required for the privileged assistant apps targeting
+ {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}
+ that receive voice trigger from a sandboxed {@link HotwordDetectionService}.
+ <p>Protection level: signature|privileged|appop
+ @FlaggedApi("android.permission.flags.voice_activation_permission_apis")
+ @hide -->
+ <permission android:name="android.permission.RECEIVE_SANDBOX_TRIGGER_AUDIO"
+ android:protectionLevel="signature|privileged|appop" />
+
+ <!-- @SystemApi Required for the privileged assistant apps targeting
+ {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}
+ that receive training data from a sandboxed {@link HotwordDetectionService} or
+ {@link VisualQueryDetectionService}.
+ <p>Protection level: internal|appop
+ @FlaggedApi("android.permission.flags.voice_activation_permission_apis")
+ @hide -->
+ <permission android:name="android.permission.RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA"
+ android:protectionLevel="internal|appop" />
+
+ <!-- @SystemApi Allows requesting the framework broadcast the
+ {@link Intent#ACTION_DEVICE_CUSTOMIZATION_READY} intent.
+ @hide -->
+ <permission android:name="android.permission.SEND_DEVICE_CUSTOMIZATION_READY"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Permission that protects the {@link Intent#ACTION_DEVICE_CUSTOMIZATION_READY}
+ intent.
+ @hide -->
+ <permission android:name="android.permission.RECEIVE_DEVICE_CUSTOMIZATION_READY"
+ android:protectionLevel="signature|preinstalled" />
+
+ <!-- @SystemApi Allows wallpaper to be rendered in ambient mode.
+ @hide -->
+ <permission android:name="android.permission.AMBIENT_WALLPAPER"
+ android:protectionLevel="signature|preinstalled" />
+
+ <!-- @SystemApi Allows sensor privacy to be modified.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_SENSOR_PRIVACY"
+ android:protectionLevel="internal|role|installer" />
+
+ <!-- @SystemApi Allows sensor privacy changes to be observed.
+ @hide -->
+ <permission android:name="android.permission.OBSERVE_SENSOR_PRIVACY"
+ android:protectionLevel="internal|role|installer" />
+
+ <!-- @SystemApi Permission that protects the {@link Intent#ACTION_REVIEW_ACCESSIBILITY_SERVICES}
+ intent.
+ @hide -->
+ <permission android:name="android.permission.REVIEW_ACCESSIBILITY_SERVICES"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an activity to replace the app name and icon displayed in share targets
+ in the sharesheet for the Q-release and later.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.SUBSTITUTE_SHARE_TARGET_APP_NAME_AND_ICON"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an application to access shared libraries.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_SHARED_LIBRARIES"
+ android:protectionLevel="signature|installer" />
+
+ <!-- Allows an app to log compat change usage.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.LOG_COMPAT_CHANGE"
+ android:protectionLevel="signature|privileged" />
+ <!-- Allows an app to read compat change config.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.READ_COMPAT_CHANGE_CONFIG"
+ android:protectionLevel="signature|privileged" />
+ <!-- Allows an app to override compat change config.
+ This permission only allows to override config on debuggable builds or test-apks and is
+ therefore a less powerful version of OVERRIDE_COMPAT_CHANGE_CONFIG_ON_RELEASE_BUILD.
+ @hide <p>Not for use by third-party applications.</p> -->
+ <permission android:name="android.permission.OVERRIDE_COMPAT_CHANGE_CONFIG"
+ android:protectionLevel="signature|privileged" />
+ <!-- @SystemApi Allows an app to override compat change config on release builds.
+ Only ChangeIds that are annotated as @Overridable can be overridden on release builds.
+ @hide -->
+ <permission android:name="android.permission.OVERRIDE_COMPAT_CHANGE_CONFIG_ON_RELEASE_BUILD"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows input events to be monitored. Very dangerous! @hide -->
+ <permission android:name="android.permission.MONITOR_INPUT"
+ android:protectionLevel="signature|recents" />
+ <!-- @SystemApi Allows the use of FLAG_SLIPPERY, which permits touch events to slip from the
+ current window to the window where the touch currently is on top of. @hide -->
+ <permission android:name="android.permission.ALLOW_SLIPPERY_TOUCHES"
+ android:protectionLevel="signature|privileged|recents|role" />
+ <!-- Allows the caller to change the associations between input devices and displays.
+ Very dangerous! @hide -->
+ <permission android:name="android.permission.ASSOCIATE_INPUT_DEVICE_TO_DISPLAY"
+ android:protectionLevel="signature" />
+
+ <!-- Allows query of any normal app on the device, regardless of manifest declarations.
+ <p>Protection level: normal -->
+ <permission android:name="android.permission.QUERY_ALL_PACKAGES"
+ android:label="@string/permlab_queryAllPackages"
+ android:description="@string/permdesc_queryAllPackages"
+ android:protectionLevel="normal" />
+ <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
+
+ <!-- @hide Allow the caller to collect debugging data from processes that otherwise
+ would require USAGE_STATS. Before sharing this data with other apps, holders
+ of this permission are REQUIRED to themselves check that the caller has
+ PACKAGE_USAGE_STATS and OP_GET_USAGE_STATS. -->
+ <permission android:name="android.permission.PEEK_DROPBOX_DATA"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to access TV tuner HAL
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_TV_TUNER"
+ android:protectionLevel="signature|privileged|vendorPrivileged" />
+
+ <!-- @SystemApi Allows an application to access descrambler of TV tuner HAL
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_TV_DESCRAMBLER"
+ android:protectionLevel="signature|privileged|vendorPrivileged" />
+
+ <!-- @SystemApi Allows an application to access shared filter of TV tuner HAL
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_TV_SHARED_FILTER"
+ android:protectionLevel="signature|privileged|vendorPrivileged" />
+
+ <!-- Allows an application to create trusted displays. @hide @SystemApi -->
+ <permission android:name="android.permission.ADD_TRUSTED_DISPLAY"
+ android:protectionLevel="signature|role" />
+
+ <!-- Allows an application to create always-unlocked displays. @hide @SystemApi -->
+ <permission android:name="android.permission.ADD_ALWAYS_UNLOCKED_DISPLAY"
+ android:protectionLevel="signature|role"/>
+
+ <!-- @hide @SystemApi Allows an application to access locusId events in the usage stats. -->
+ <permission android:name="android.permission.ACCESS_LOCUS_ID_USAGE_STATS"
+ android:protectionLevel="signature|role" />
+
+ <!-- @hide @SystemApi Allows an application to manage app hibernation state. -->
+ <permission android:name="android.permission.MANAGE_APP_HIBERNATION"
+ android:protectionLevel="signature|installer" />
+
+ <!-- @hide @TestApi Allows apps to reset the state of {@link com.android.server.am.AppErrors}.
+ <p>CTS tests will use UiAutomation.adoptShellPermissionIdentity() to gain access. -->
+ <permission android:name="android.permission.RESET_APP_ERRORS"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows ThemeOverlayController to delay launch of Home / SetupWizard on boot, ensuring
+ Theme Palettes and Colors are ready -->
+ <permission android:name="android.permission.SET_THEME_OVERLAY_CONTROLLER_READY"
+ android:protectionLevel="signature|setup" />
+
+ <!-- @hide Allows an application to create/destroy input consumer. -->
+ <permission android:name="android.permission.INPUT_CONSUMER"
+ android:protectionLevel="signature" />
+
+ <!-- @hide @TestApi Allows an application to control the system's device state managed by the
+ {@link android.service.devicestate.DeviceStateManagerService}. For example, on foldable
+ devices this would grant access to toggle between the folded and unfolded states. -->
+ <permission android:name="android.permission.CONTROL_DEVICE_STATE"
+ android:protectionLevel="signature" />
+
+ <!-- @hide @SystemApi Must be required by a
+ {@link android.service.displayhash.DisplayHashingService}
+ to ensure that only the system can bind to it.
+ This is not a third-party API (intended for OEMs and system apps).
+ -->
+ <permission android:name="android.permission.BIND_DISPLAY_HASHING_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @hide @TestApi Allows an application to enable/disable toast rate limiting.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.MANAGE_TOAST_RATE_LIMITING"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows managing the Game Mode
+ @hide -->
+ <permission android:name="android.permission.MANAGE_GAME_MODE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @TestApi Allows setting the game service provider, meant for tests only.
+ @hide -->
+ <permission android:name="android.permission.SET_GAME_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows accessing the frame rate per second of a given application
+ @hide -->
+ <permission android:name="android.permission.ACCESS_FPS_COUNTER"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows the GameService provider to create GameSession and call GameSession
+ APIs and overlay a view on top of the game's Activity.
+ @hide -->
+ <permission android:name="android.permission.MANAGE_GAME_ACTIVITY"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows the holder to register callbacks to inform the RebootReadinessManager
+ when they are performing reboot-blocking work.
+ @hide -->
+ <permission android:name="android.permission.SIGNAL_REBOOT_READINESS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows the holder to launch an Intent Resolver flow with custom presentation
+ and/or targets.
+ @FlaggedApi("android.nfc.enable_nfc_mainline")
+ @hide -->
+ <permission android:name="android.permission.SHOW_CUSTOMIZED_RESOLVER"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide Allows an application to get a People Tile preview for a given shortcut. -->
+ <permission android:name="android.permission.GET_PEOPLE_TILE_PREVIEW"
+ android:protectionLevel="signature|recents" />
+
+ <!-- @hide @SystemApi Allows an application to retrieve whether shortcut is backed by a
+ Conversation.
+ TODO(b/180412052): STOPSHIP: Define a role so it can be granted to Shell and AiAi. -->
+ <permission android:name="android.permission.READ_PEOPLE_DATA"
+ android:protectionLevel="signature|recents|role"/>
+
+ <!-- @hide @SystemApi Allows a logical component within an application to
+ temporarily renounce a set of otherwise granted permissions. -->
+ <permission android:name="android.permission.RENOUNCE_PERMISSIONS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an application to read nearby streaming policy. The policy controls
+ whether to allow the device to stream its notifications and apps to nearby devices.
+ Applications that are not the device owner will need this permission to call
+ {@link android.app.admin.DevicePolicyManager#getNearbyNotificationStreamingPolicy} or
+ {@link android.app.admin.DevicePolicyManager#getNearbyAppStreamingPolicy}. -->
+ <permission android:name="android.permission.READ_NEARBY_STREAMING_POLICY"
+ android:protectionLevel="normal" />
+
+ <!-- @SystemApi Allows the holder to set the source of the data when setting a clip on the
+ clipboard.
+ @hide -->
+ <permission android:name="android.permission.SET_CLIP_SOURCE"
+ android:protectionLevel="signature|recents" />
+
+ <!-- @SystemApi Allows an application to access TV tuned info
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_TUNED_INFO"
+ android:protectionLevel="signature|privileged|vendorPrivileged" />
+
+ <!-- Allows an application to indicate via
+ {@link android.content.pm.PackageInstaller.SessionParams#setRequireUserAction(int)}
+ that user action should not be required for an app update.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION"
+ android:label="@string/permlab_updatePackagesWithoutUserAction"
+ android:description="@string/permdesc_updatePackagesWithoutUserAction"
+ android:protectionLevel="normal" />
+ <uses-permission android:name="android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION"/>
+
+ <!-- Allows an application to indicate via {@link
+ android.content.pm.PackageInstaller.SessionParams#setRequestUpdateOwnership}
+ that it has the intention of becoming the update owner.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.ENFORCE_UPDATE_OWNERSHIP"
+ android:protectionLevel="normal" />
+ <uses-permission android:name="android.permission.ENFORCE_UPDATE_OWNERSHIP" />
+
+
+ <!-- Allows an application to take screenshots of layers that normally would be blacked out when
+ a screenshot is taken. Specifically, layers that have the flag
+ {@link android.view.SurfaceControl#SECURE} will be screenshot if the caller requests to
+ capture secure layers. Normally those layers will be rendered black.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.CAPTURE_BLACKOUT_CONTENT"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an application to query over global data in AppSearch.
+ @hide -->
+ <permission android:name="android.permission.READ_GLOBAL_APP_SEARCH_DATA"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to query over global data in AppSearch that's visible to the
+ ASSISTANT role. -->
+ <permission android:name="android.permission.READ_ASSISTANT_APP_SEARCH_DATA"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to query over global data in AppSearch that's visible to the
+ HOME role. -->
+ <permission android:name="android.permission.READ_HOME_APP_SEARCH_DATA"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an assistive application to perform actions on behalf of users inside of
+ applications.
+ <p>For now, this permission is only granted to the Assistant application selected by
+ the user.
+ <p>Protection level: internal|role
+ -->
+ <permission android:name="android.permission.EXECUTE_APP_ACTION"
+ android:protectionLevel="internal|role" />
+
+ <!-- Allows an application to display its suggestions using the autofill framework.
+ <p>For now, this permission is only granted to the Browser application.
+ <p>Protection level: internal|role
+ -->
+ <permission android:name="android.permission.PROVIDE_OWN_AUTOFILL_SUGGESTIONS"
+ android:protectionLevel="internal|role" />
+
+ <!-- @SystemApi Allows an application to create virtual devices in VirtualDeviceManager.
+ @hide -->
+ <permission android:name="android.permission.CREATE_VIRTUAL_DEVICE"
+ android:protectionLevel="internal|role" />
+
+ <!-- @SystemApi Must be required by a safety source to send an update using the
+ {@link android.safetycenter.SafetyCenterManager}.
+ <p>Protection level: internal|privileged
+ @hide
+ -->
+ <permission android:name="android.permission.SEND_SAFETY_CENTER_UPDATE"
+ android:protectionLevel="internal|privileged" />
+
+ <!-- @SystemApi Allows an application to launch device manager setup screens.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.LAUNCH_DEVICE_MANAGER_SETUP"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows an application to update certain device management related system
+ resources.
+ @hide -->
+ <permission android:name="android.permission.UPDATE_DEVICE_MANAGEMENT_RESOURCES"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows an app to read whether SafetyCenter is enabled/disabled.
+ <p>Protection level: signature|privileged
+ @hide
+ -->
+ <permission android:name="android.permission.READ_SAFETY_CENTER_STATUS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Required to access the safety center internal APIs using the
+ {@link android.safetycenter.SafetyCenterManager}.
+ <p>Protection level: internal|installer|role
+ @hide
+ -->
+ <permission android:name="android.permission.MANAGE_SAFETY_CENTER"
+ android:protectionLevel="internal|installer|role" />
+
+ <!-- @SystemApi Allows an application to access the AmbientContextEvent service.
+ @hide
+ -->
+ <permission android:name="android.permission.ACCESS_AMBIENT_CONTEXT_EVENT"
+ android:protectionLevel="signature|privileged|role"/>
+
+ <!-- @SystemApi Required by a AmbientContextEventDetectionService
+ to ensure that only the service with this permission can bind to it.
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_AMBIENT_CONTEXT_DETECTION_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an app to set keep-clear areas without restrictions on the size or
+ number of keep-clear areas (see {@link android.view.View#setPreferKeepClearRects}).
+ When the system arranges floating windows onscreen, it might decide to ignore keep-clear
+ areas from windows, whose owner does not have this permission.
+ @hide
+ -->
+ <permission android:name="android.permission.SET_UNRESTRICTED_KEEP_CLEAR_AREAS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an app to set gesture exclusion without restrictions on the vertical extent of the
+ exclusions (see {@link android.view.View#setSystemGestureExclusionRects}).
+ @hide
+ -->
+ <permission android:name="android.permission.SET_UNRESTRICTED_GESTURE_EXCLUSION"
+ android:protectionLevel="signature|privileged|recents" />
+
+ <!-- @SystemApi Allows TV input apps and TV apps to use TIS extension interfaces for
+ domain-specific features.
+ <p>Protection level: signature|privileged|vendorPrivileged
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.TIS_EXTENSION_INTERFACE"
+ android:protectionLevel="signature|privileged|vendorPrivileged" />
+
+ <!-- @SystemApi Allows an application to write to the security log buffer in logd.
+ @hide -->
+ <permission android:name="android.permission.WRITE_SECURITY_LOG"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- Allows an UID to be visible to the application based on an interaction between the
+ two apps. This permission is not intended to be held by apps.
+ @hide @TestApi @SystemApi(client=android.annotation.SystemApi.Client.MODULE_LIBRARIES) -->
+ <permission android:name="android.permission.MAKE_UID_VISIBLE"
+ android:protectionLevel="signature" />
+
+ <!-- Limits the system as the only handler of the QUERY_PACKAGE_RESTART broadcast
+ @hide -->
+ <permission android:name="android.permission.HANDLE_QUERY_PACKAGE_RESTART"
+ android:protectionLevel="signature" />
+
+ <!-- Allows low-level access to re-mapping modifier keys.
+ <p>Not for use by third-party applications.
+ @hide
+ @TestApi -->
+ <permission android:name="android.permission.REMAP_MODIFIER_KEYS"
+ android:protectionLevel="signature" />
+
+ <!-- Allows low-level access to monitor keyboard backlight changes.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.MONITOR_KEYBOARD_BACKLIGHT"
+ android:protectionLevel="signature" />
+
+ <!-- Allows low-level access to monitor sticky modifier state changes when A11Y Sticky keys
+ feature is enabled.
+ <p>Not for use by third-party applications.
+ @hide -->
+ <permission android:name="android.permission.MONITOR_STICKY_MODIFIER_STATE"
+ android:protectionLevel="signature" />
+
+ <uses-permission android:name="android.permission.HANDLE_QUERY_PACKAGE_RESTART" />
+
+ <!-- Allows financed device kiosk apps to perform actions on the Device Lock service
+ <p>Protection level: internal|role
+ <p>Intended for use by the FINANCED_DEVICE_KIOSK role only.
+ -->
+ <permission android:name="android.permission.MANAGE_DEVICE_LOCK_STATE"
+ android:protectionLevel="internal|role" />
+
+ <!-- @SystemApi Required by a WearableSensingService to
+ ensure that only the caller with this permission can bind to it.
+ <p> Protection level: signature
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_WEARABLE_SENSING_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an app to manage the wearable sensing service.
+ <p>Protection level: signature|privileged
+ @hide
+ -->
+ <permission android:name="android.permission.MANAGE_WEARABLE_SENSING_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows an app to use the on-device intelligence service.
+ <p>Protection level: signature|privileged
+ @hide
+ @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence")
+ -->
+ <permission android:name="android.permission.USE_ON_DEVICE_INTELLIGENCE"
+ android:protectionLevel="signature|privileged" />
+
+
+ <!-- @SystemApi Allows an app to bind the on-device intelligence service.
+ <p>Protection level: signature|privileged
+ @hide
+ @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence")
+ -->
+ <permission android:name="android.permission.BIND_ON_DEVICE_INTELLIGENCE_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
+
+ <!-- @SystemApi Allows an app to bind the on-device trusted service.
+ <p>Protection level: signature|privileged
+ @hide
+ @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence")
+ -->
+ <permission android:name="android.permission.BIND_ON_DEVICE_TRUSTED_SERVICE"
+ android:protectionLevel="signature"/>
+
+
+ <!-- Allows applications to use the user-initiated jobs API. For more details
+ see {@link android.app.job.JobInfo.Builder#setUserInitiated}.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.RUN_USER_INITIATED_JOBS"
+ android:protectionLevel="normal"/>
+
+ <!-- @FlaggedApi("android.app.job.backup_jobs_exemption")
+ Gives applications with a <b>major use case</b> of backing-up or syncing content increased
+ job execution allowance in order to complete the related work. The jobs must have a valid
+ content URI trigger and network constraint set.
+ <p>This is a special access permission that can be revoked by the system or the user.
+ <p>Protection level: signature|privileged|appop
+ -->
+ <permission android:name="android.permission.RUN_BACKUP_JOBS"
+ android:protectionLevel="signature|privileged|appop"/>
+
+ <!-- Allows an app access to the installer provided app metadata.
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.GET_APP_METADATA"
+ android:protectionLevel="signature|installer" />
+
+ <!-- @hide @SystemApi Allows an application to stage HealthConnect's remote data so that
+ HealthConnect can later integrate it. -->
+ <permission android:name="android.permission.STAGE_HEALTH_CONNECT_REMOTE_DATA"
+ android:protectionLevel="signature|knownSigner"
+ android:knownCerts="@array/config_healthConnectRestoreKnownSigners"/>
+
+ <!-- @hide @TestApi Allows an application to clear HealthConnect's staged remote data for
+ testing only. For security reasons, this is a platform-only permission. -->
+ <permission android:name="android.permission.DELETE_STAGED_HEALTH_CONNECT_REMOTE_DATA"
+ android:protectionLevel="signature" />
+
+ <!-- @hide @TestApi Allows tests running in CTS-in-sandbox mode to launch activities -->
+ <permission android:name="android.permission.START_ACTIVITIES_FROM_SDK_SANDBOX"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows the holder to call health connect migration APIs.
+ @hide -->
+ <permission android:name="android.permission.MIGRATE_HEALTH_CONNECT_DATA"
+ android:protectionLevel="signature|knownSigner"
+ android:knownCerts="@array/config_healthConnectMigrationKnownSigners" />
+
+ <!-- @SystemApi Allows an app to query apps in clone profile. The permission is
+ bidirectional in nature, i.e. cloned apps would be able to query apps in root user.
+ The permission is not meant for 3P apps as of now.
+ <p>Protection level: signature|privileged
+ @hide
+ -->
+ <permission android:name="android.permission.QUERY_CLONED_APPS"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide @SystemApi
+ Allows applications to capture bugreport directly without consent dialog when using the
+ bugreporting API on userdebug/eng build.
+ <p>The application still needs to hold {@link android.permission.DUMP} permission and be
+ bugreport-whitelisted to be able to capture a bugreport using the bugreporting API in the
+ first place. Then, when the corresponding app op of this permission is ALLOWED, the
+ bugreport can be captured directly without going through the consent dialog.
+ <p>Protection level: internal|appop
+ <p>Intended to only be used on userdebug/eng build.
+ <p>Not for use by third-party applications. -->
+ <permission android:name="android.permission.CAPTURE_CONSENTLESS_BUGREPORT_ON_USERDEBUG_BUILD"
+ android:protectionLevel="internal|appop" />
+
+ <!-- @SystemApi Allows to call APIs that log process lifecycle events
+ @hide -->
+ <permission android:name="android.permission.LOG_FOREGROUND_RESOURCE_USE"
+ android:protectionLevel="signature|module" />
+
+ <!-- @hide Allows the settings app to access GPU service APIs".
+ <p>Not for use by third-party applications.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.ACCESS_GPU_SERVICE"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows an application to get type of any provider uri.
+ <p>Not for use by third-party applications.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.GET_ANY_PROVIDER_TYPE"
+ android:protectionLevel="signature" />
+
+
+ <!-- @hide Allows internal applications to read and synchronize non-core flags.
+ Apps without this permission can only read a subset of flags specifically intended
+ for use in "core", (i.e. third party apps). Apps with this permission can define their
+ own flags, and federate those values with other system-level apps.
+ <p>Not for use by third-party applications.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.SYNC_FLAGS"
+ android:protectionLevel="signature" />
+
+ <!-- @hide Allows internal applications to override flags in the FeatureFlags service.
+ <p>Not for use by third-party applications.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.WRITE_FLAGS"
+ android:protectionLevel="signature" />
+
+ <!-- @hide @SystemApi
+ @FlaggedApi("android.app.get_binding_uid_importance")
+ Allows to get the importance of an UID that has a service
+ binding to the app.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.GET_BINDING_UID_IMPORTANCE"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide Allows internal applications to manage displays.
+ <p>This means intercept internal signals about displays being (dis-)connected
+ and being able to enable or disable the external displays.
+ <p>Not for use by third-party applications.
+ <p>Protection level: signature
+ -->
+ <permission android:name="android.permission.MANAGE_DISPLAYS"
+ android:protectionLevel="signature" />
+
+ <!-- @SystemApi Allows an app to track all preparations for a complete factory reset.
+ <p>Protection level: signature|privileged
+ @FlaggedApi("android.permission.flags.factory_reset_prep_permission_apis")
+ @hide -->
+ <permission android:name="android.permission.PREPARE_FACTORY_RESET"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @SystemApi Allows focused window to override the default behavior of supported system keys.
+ The following keycodes are supported:
+ <p> KEYCODE_STEM_PRIMARY
+ <p>If an app is granted this permission and has a focused window, it will be allowed to
+ receive supported key events that are otherwise handled by the system. The app can choose
+ to consume the key events and trigger its own behavior, in which case the default key
+ behavior will be skipped.
+ <p>For example, KEYCODE_STEM_PRIMARY by default opens recent app launcher. If the foreground
+ fitness app is granted this permission, it can repurpose the KEYCODE_STEM_PRIMARY button
+ to pause/resume the current fitness session.
+ <p>Protection level: signature|privileged
+ @FlaggedApi("com.android.input.flags.override_key_behavior_permission_apis")
+ @hide -->
+ <permission android:name="android.permission.OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @hide @SystemApi
+ @FlaggedApi("com.android.server.notification.flags.redact_otp_notifications_from_untrusted_listeners")
+ Allows apps with a NotificationListenerService to receive notifications with sensitive
+ information
+ <p>Apps with a NotificationListenerService without this permission will not be able
+ to view certain types of sensitive information contained in notifications
+ <p>Protection level: signature|role
+ -->
+ <permission android:name="android.permission.RECEIVE_SENSITIVE_NOTIFICATIONS"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi
+ @FlaggedApi("android.app.bic_client")
+ Allows app to call BackgroundInstallControlManager API to retrieve silently installed apps
+ for all users on device.
+ <p>Apps with a BackgroundInstallControlManager client will not be able to call any API without
+ this permission.
+ <p>Protection level: signature|role
+ @hide
+ -->
+ <permission android:name="android.permission.GET_BACKGROUND_INSTALLED_PACKAGES"
+ android:protectionLevel="signature|role" />
+
+ <!-- @SystemApi Allows an application to read the system grammatical gender.
+ @FlaggedApi("android.app.system_terms_of_address_enabled")
+ <p>Protection level: signature|privileged
+ @hide
+ -->
+ <permission android:name="android.permission.READ_SYSTEM_GRAMMATICAL_GENDER"
+ android:protectionLevel="signature|privileged"/>
+
+ <!-- @SystemApi
+ @FlaggedApi("android.content.pm.emergency_install_permission")
+ Allows each app store in the system image to designate another app in the system image to
+ update the app store
+ <p>Protection level: signature|privileged
+ @hide
+ -->
+ <permission android:name="android.permission.EMERGENCY_INSTALL_PACKAGES"
+ android:protectionLevel="signature|privileged"/>
+
+ <!-- Attribution for Geofencing service. -->
+ <attribution android:tag="GeofencingService" android:label="@string/geofencing_service"/>
+ <!-- Attribution for Country Detector. -->
+ <attribution android:tag="CountryDetector" android:label="@string/country_detector"/>
+ <!-- Attribution for Location service. -->
+ <attribution android:tag="LocationService" android:label="@string/location_service"/>
+ <!-- Attribution for Gnss service. -->
+ <attribution android:tag="GnssService" android:label="@string/gnss_service"/>
+ <!-- Attribution for Sensor Notification service. -->
+ <attribution android:tag="SensorNotificationService"
+ android:label="@string/sensor_notification_service"/>
+ <!-- Attribution for Twilight service. -->
+ <attribution android:tag="TwilightService" android:label="@string/twilight_service"/>
+ <!-- Attribution for Gnss Time Update service. -->
+ <attribution android:tag="GnssTimeUpdateService"
+ android:label="@string/gnss_time_update_service"/>
+ <!-- Attribution for MusicRecognitionManagerService.
+ <p>Not for use by third-party applications.</p> -->
+ <attribution android:tag="MusicRecognitionManagerService"
+ android:label="@string/music_recognition_manager_service"/>
+ <!-- Attribution for Device Policy Manager service. -->
+ <attribution android:tag="DevicePolicyManagerService"
+ android:label="@string/device_policy_manager_service"/>
+
+ <application android:process="system"
+ android:persistent="true"
+ android:hasCode="false"
+ android:label="@string/android_system_label"
+ android:allowClearUserData="false"
+ android:backupAgent="com.android.server.backup.SystemBackupAgent"
+ android:killAfterRestore="false"
+ android:icon="@drawable/ic_launcher_android"
+ android:supportsRtl="true"
+ android:theme="@style/Theme.DeviceDefault.Light.DarkActionBar"
+ android:defaultToDeviceProtectedStorage="true"
+ android:forceQueryable="true"
+ android:directBootAware="true">
+ <activity android:name="com.android.internal.accessibility.dialog.AccessibilityShortcutChooserActivity"
+ android:exported="false"
+ android:theme="@style/Theme.DeviceDefault.Dialog.Alert.DayNight"
+ android:finishOnCloseSystemDialogs="true"
+ android:excludeFromRecents="true"
+ android:documentLaunchMode="never"
+ android:relinquishTaskIdentity="true"
+ android:process=":ui"
+ android:visibleToInstantApps="true">
+ <intent-filter>
+ <action android:name="com.android.internal.intent.action.CHOOSE_ACCESSIBILITY_BUTTON" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+ <activity android:name="com.android.internal.accessibility.dialog.AccessibilityButtonChooserActivity"
+ android:exported="false"
+ android:theme="@style/Theme.DeviceDefault.Resolver"
+ android:finishOnCloseSystemDialogs="true"
+ android:excludeFromRecents="true"
+ android:documentLaunchMode="never"
+ android:relinquishTaskIdentity="true"
+ android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
+ android:process=":ui"
+ android:visibleToInstantApps="true">
+ <intent-filter>
+ <action android:name="com.android.internal.intent.action.CHOOSE_ACCESSIBILITY_BUTTON" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+ <activity android:name="com.android.internal.app.NfcResolverActivity"
+ android:theme="@style/Theme.Dialog.Alert"
+ android:finishOnCloseSystemDialogs="true"
+ android:excludeFromRecents="true"
+ android:multiprocess="true"
+ android:permission="android.permission.SHOW_CUSTOMIZED_RESOLVER"
+ android:exported="true">
+ <intent-filter android:priority="100" >
+ <action android:name="android.nfc.action.SHOW_NFC_RESOLVER" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+ <activity android:name="com.android.internal.app.IntentForwarderActivity"
+ android:finishOnCloseSystemDialogs="true"
+ android:theme="@style/Theme.DeviceDefault.Resolver"
+ android:excludeFromRecents="true"
+ android:documentLaunchMode="never"
+ android:relinquishTaskIdentity="true"
+ android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
+ android:label="@string/user_owner_label"
+ android:exported="true"
+ android:visibleToInstantApps="true"
+ >
+ </activity>
+ <activity-alias android:name="com.android.internal.app.ForwardIntentToParent"
+ android:targetActivity="com.android.internal.app.IntentForwarderActivity"
+ android:exported="true"
+ android:label="@string/user_owner_label">
+ </activity-alias>
+ <activity-alias android:name="com.android.internal.app.ForwardIntentToManagedProfile"
+ android:targetActivity="com.android.internal.app.IntentForwarderActivity"
+ android:icon="@drawable/ic_corp_badge"
+ android:exported="true"
+ android:label="@string/managed_profile_label">
+ </activity-alias>
+ <activity android:name="com.android.internal.app.HeavyWeightSwitcherActivity"
+ android:theme="@style/Theme.DeviceDefault.System.Dialog.Alert"
+ android:label="@string/heavy_weight_switcher_title"
+ android:finishOnCloseSystemDialogs="true"
+ android:excludeFromRecents="true"
+ android:process=":ui">
+ </activity>
+ <activity android:name="com.android.internal.app.PlatLogoActivity"
+ android:theme="@style/Theme.NoTitleBar.Fullscreen"
+ android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
+ android:enableOnBackInvokedCallback="true"
+ android:icon="@drawable/platlogo"
+ android:process=":ui">
+ </activity>
+ <activity android:name="com.android.internal.app.DisableCarModeActivity"
+ android:theme="@style/Theme.NoDisplay"
+ android:excludeFromRecents="true"
+ android:process=":ui">
+ </activity>
+
+ <activity android:name="android.accounts.ChooseAccountActivity"
+ android:excludeFromRecents="true"
+ android:exported="true"
+ android:theme="@style/Theme.DeviceDefault.Light.Dialog"
+ android:label="@string/choose_account_label"
+ android:process=":ui"
+ android:visibleToInstantApps="true">
+ </activity>
+
+ <activity android:name="android.accounts.ChooseTypeAndAccountActivity"
+ android:excludeFromRecents="true"
+ android:exported="true"
+ android:theme="@style/Theme.DeviceDefault.Light.Dialog"
+ android:label="@string/choose_account_label"
+ android:process=":ui"
+ android:visibleToInstantApps="true">
+ </activity>
+
+ <activity android:name="android.accounts.ChooseAccountTypeActivity"
+ android:excludeFromRecents="true"
+ android:theme="@style/Theme.DeviceDefault.Light.Dialog"
+ android:label="@string/choose_account_label"
+ android:process=":ui"
+ android:visibleToInstantApps="true">
+ </activity>
+
+ <activity android:name="android.accounts.CantAddAccountActivity"
+ android:excludeFromRecents="true"
+ android:exported="true"
+ android:theme="@style/Theme.DeviceDefault.Light.Dialog.NoActionBar"
+ android:process=":ui">
+ </activity>
+
+ <activity android:name="android.accounts.GrantCredentialsPermissionActivity"
+ android:excludeFromRecents="true"
+ android:exported="true"
+ android:theme="@style/Theme.DeviceDefault.Light.DialogWhenLarge"
+ android:process=":ui"
+ android:visibleToInstantApps="true">
+ </activity>
+
+ <activity android:name="android.content.SyncActivityTooManyDeletes"
+ android:theme="@style/Theme.DeviceDefault.Light.Dialog"
+ android:label="@string/sync_too_many_deletes"
+ android:process=":ui">
+ </activity>
+
+ <activity android:name="com.android.internal.app.ShutdownActivity"
+ android:permission="android.permission.SHUTDOWN"
+ android:theme="@style/Theme.NoDisplay"
+ android:exported="true"
+ android:excludeFromRecents="true">
+ <intent-filter>
+ <action android:name="com.android.internal.intent.action.REQUEST_SHUTDOWN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.REBOOT" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+
+ <activity android:name="com.android.internal.app.SystemUserHomeActivity"
+ android:enabled="false"
+ android:process=":ui"
+ android:systemUserOnly="true"
+ android:exported="true"
+ android:theme="@style/Theme.Translucent.NoTitleBar">
+ <intent-filter android:priority="-100">
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.HOME" />
+ </intent-filter>
+ </activity>
+
+ <!-- Activity to prompt user if it's ok to create a new user sandbox for a
+ specified account. -->
+ <activity android:name="com.android.internal.app.ConfirmUserCreationActivity"
+ android:excludeFromRecents="true"
+ android:process=":ui"
+ android:exported="true"
+ android:theme="@style/Theme.Dialog.Confirmation">
+ <intent-filter android:priority="1000">
+ <action android:name="android.os.action.CREATE_USER" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+
+ <activity android:name="com.android.internal.app.SuspendedAppActivity"
+ android:theme="@style/Theme.Dialog.Confirmation"
+ android:excludeFromRecents="true"
+ android:process=":ui">
+ </activity>
+
+ <activity android:name="com.android.internal.app.UnlaunchableAppActivity"
+ android:theme="@style/Theme.Dialog.Confirmation"
+ android:excludeFromRecents="true"
+ android:process=":ui">
+ </activity>
+
+ <activity android:name="com.android.internal.app.BlockedAppActivity"
+ android:theme="@style/Theme.Dialog.Confirmation"
+ android:excludeFromRecents="true"
+ android:lockTaskMode="always"
+ android:process=":ui">
+ </activity>
+
+ <activity android:name="com.android.internal.app.BlockedAppStreamingActivity"
+ android:theme="@style/Theme.Dialog.Confirmation"
+ android:excludeFromRecents="true"
+ android:process=":ui">
+ </activity>
+
+ <activity android:name="com.android.internal.app.LaunchAfterAuthenticationActivity"
+ android:theme="@style/Theme.Translucent.NoTitleBar"
+ android:excludeFromRecents="true"
+ android:process=":ui">
+ </activity>
+
+ <activity android:name="com.android.settings.notification.NotificationAccessConfirmationActivity"
+ android:theme="@style/Theme.Dialog.Confirmation"
+ android:excludeFromRecents="true">
+ </activity>
+
+ <activity android:name="com.android.internal.app.HarmfulAppWarningActivity"
+ android:theme="@style/Theme.Dialog.Confirmation"
+ android:excludeFromRecents="true"
+ android:process=":ui"
+ android:label="@string/harmful_app_warning_title"
+ android:exported="false">
+ </activity>
+
+ <activity android:name="com.android.server.notification.NASLearnMoreActivity"
+ android:theme="@style/Theme.Dialog.Confirmation"
+ android:excludeFromRecents="true"
+ android:exported="false">
+ </activity>
+
+ <activity android:name="android.service.games.GameSessionTrampolineActivity"
+ android:excludeFromRecents="true"
+ android:exported="true"
+ android:permission="android.permission.MANAGE_GAME_ACTIVITY"
+ android:theme="@style/Theme.GameSessionTrampoline">
+ </activity>
+
+ <receiver android:name="com.android.server.BootReceiver"
+ android:exported="true"
+ android:systemUserOnly="true">
+ <intent-filter android:priority="1000">
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.CertPinInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="android.intent.action.UPDATE_PINS" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.IntentFirewallInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="android.intent.action.UPDATE_INTENT_FIREWALL" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.SmsShortCodesInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="android.intent.action.UPDATE_SMS_SHORT_CODES" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.NetworkWatchlistInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="android.intent.action.UPDATE_NETWORK_WATCHLIST" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.ApnDbInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="com.android.internal.intent.action.UPDATE_APN_DB" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.CarrierProvisioningUrlsInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="android.intent.action.UPDATE_CARRIER_PROVISIONING_URLS" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.CertificateTransparencyLogInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="android.intent.action.UPDATE_CT_LOGS" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.LangIdInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="android.intent.action.UPDATE_LANG_ID" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.SmartSelectionInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="android.intent.action.UPDATE_SMART_SELECTION" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.ConversationActionsInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="android.intent.action.UPDATE_CONVERSATION_ACTIONS" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.CarrierIdInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="android.os.action.UPDATE_CARRIER_ID_DB" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.updates.EmergencyNumberDbInstallReceiver"
+ android:exported="true"
+ android:permission="android.permission.UPDATE_CONFIG">
+ <intent-filter>
+ <action android:name="android.os.action.UPDATE_EMERGENCY_NUMBER_DB" />
+ <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.MasterClearReceiver"
+ android:exported="true"
+ android:permission="android.permission.MASTER_CLEAR">
+ <intent-filter
+ android:priority="100" >
+ <!-- For Checkin, Settings, etc.: action=FACTORY_RESET -->
+ <action android:name="android.intent.action.FACTORY_RESET" />
+ <!-- As above until all the references to the deprecated MASTER_CLEAR get updated to
+ FACTORY_RESET. -->
+ <action android:name="android.intent.action.MASTER_CLEAR" />
+
+ <!-- MCS always uses REMOTE_INTENT: category=MASTER_CLEAR -->
+ <action android:name="com.google.android.c2dm.intent.RECEIVE" />
+ <category android:name="android.intent.category.MASTER_CLEAR" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.android.server.WallpaperUpdateReceiver"
+ android:exported="true"
+ android:permission="android.permission.RECEIVE_DEVICE_CUSTOMIZATION_READY">
+ <intent-filter>
+ <action android:name="android.intent.action.DEVICE_CUSTOMIZATION_READY"/>
+ </intent-filter>
+ </receiver>
+
+ <!-- Broadcast Receiver listens to sufficient verifier broadcast from Package Manager
+ when installing new SDK. Verification of SDK code during installation time is run
+ to determine compatibility with privacy sandbox restrictions. -->
+ <receiver android:name="com.android.server.sdksandbox.SdkSandboxVerifierReceiver"
+ android:exported="false">
+ <intent-filter>
+ <action android:name="android.intent.action.PACKAGE_NEEDS_VERIFICATION"/>
+ </intent-filter>
+ </receiver>
+
+ <service android:name="android.hardware.location.GeofenceHardwareService"
+ android:permission="android.permission.LOCATION_HARDWARE"
+ android:exported="false" />
+
+ <service android:name="com.android.server.MountServiceIdler"
+ android:exported="true"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.SmartStorageMaintIdler"
+ android:exported="true"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.ZramWriteback"
+ android:exported="false"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.backup.FullBackupJob"
+ android:exported="true"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.backup.KeyValueBackupJob"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.content.SyncJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.pm.BackgroundDexOptJobService"
+ android:exported="true"
+ android:permission="android.permission.BIND_JOB_SERVICE">
+ </service>
+
+ <service android:name="com.android.server.pm.DynamicCodeLoggingService"
+ android:permission="android.permission.BIND_JOB_SERVICE">
+ </service>
+
+ <service android:name="com.android.server.selinux.SelinuxAuditLogsService"
+ android:permission="android.permission.BIND_JOB_SERVICE">
+ </service>
+
+ <service android:name="com.android.server.compos.IsolatedCompilationJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE">
+ </service>
+
+ <service android:name="com.android.server.PruneInstantAppsJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.storage.DiskStatsLoggingService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.PreloadsFileCacheExpirationJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.camera.CameraStatsJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.usage.UsageStatsIdleService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.net.watchlist.ReportWatchlistJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.display.BrightnessIdleJob"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.people.data.DataMaintenanceService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.profcollect.ProfcollectForwardingService$ProfcollectBGJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.pm.GentleUpdateHelper$Service"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service
+ android:name="com.android.server.autofill.AutofillCompatAccessibilityService"
+ android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
+ android:visibleToInstantApps="true"
+ android:exported="true">
+ <meta-data
+ android:name="android.accessibilityservice"
+ android:resource="@xml/autofill_compat_accessibility_service" />
+ </service>
+
+ <service android:name="com.android.server.blob.BlobStoreIdleJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE">
+ </service>
+
+ <service android:name="com.android.server.companion.InactiveAssociationsRemovalService"
+ android:permission="android.permission.BIND_JOB_SERVICE">
+ </service>
+
+ <service android:name="com.android.server.appsearch.contactsindexer.ContactsIndexerMaintenanceService"
+ android:permission="android.permission.BIND_JOB_SERVICE">
+ </service>
+
+ <service android:name="com.android.server.BinaryTransparencyService$UpdateMeasurementsJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE">
+ </service>
+
+ <service android:name="com.android.server.notification.ReviewNotificationPermissionsJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE">
+ </service>
+
+ <service android:name="com.android.server.notification.NotificationHistoryJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.notification.NotificationBitmapJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.healthconnect.HealthConnectDailyService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.healthconnect.migration.MigrationBroadcastJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE">
+ </service>
+
+ <service android:name="com.android.server.healthconnect.backuprestore.BackupRestore$BackupRestoreJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE">
+ </service>
+
+ <service android:name="com.android.server.pm.PackageManagerShellCommandDataLoader"
+ android:exported="false">
+ <intent-filter>
+ <action android:name="android.intent.action.LOAD_DATA"/>
+ </intent-filter>
+ </service>
+
+ <!-- TODO: Move to ExtServices or relevant component. -->
+ <service android:name="android.service.selectiontoolbar.DefaultSelectionToolbarRenderService"
+ android:permission="android.permission.BIND_SELECTION_TOOLBAR_RENDER_SERVICE"
+ android:process=":ui"
+ android:exported="false">
+ <intent-filter>
+ <action android:name="android.service.selectiontoolbar.SelectionToolbarRenderService"/>
+ </intent-filter>
+ </service>
+
+ <service android:name="com.android.server.art.BackgroundDexoptJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
+ <service android:name="com.android.server.companion.datatransfer.contextsync.CallMetadataSyncInCallService"
+ android:permission="android.permission.BIND_INCALL_SERVICE"
+ android:exported="true">
+ <meta-data android:name="android.telecom.INCLUDE_SELF_MANAGED_CALLS"
+ android:value="true" />
+ <intent-filter>
+ <action android:name="android.telecom.InCallService"/>
+ </intent-filter>
+ </service>
+
+ <service android:name="com.android.server.companion.datatransfer.contextsync.CallMetadataSyncConnectionService"
+ android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.telecom.ConnectionService"/>
+ </intent-filter>
+ </service>
+
+ <provider
+ android:name="com.android.server.textclassifier.IconsContentProvider"
+ android:authorities="com.android.textclassifier.icons"
+ android:singleUser="true"
+ android:enabled="true"
+ android:exported="true">
+ </provider>
+
+ <meta-data
+ android:name="com.android.server.patch.25239169"
+ android:value="true" />
+
+ </application>
+
+</manifest>
diff --git a/tests/tests/permissionpolicy/src/android/permissionpolicy/cts/PermissionPolicyTest.java b/tests/tests/permissionpolicy/src/android/permissionpolicy/cts/PermissionPolicyTest.java
index c651bb0..96d1583 100644
--- a/tests/tests/permissionpolicy/src/android/permissionpolicy/cts/PermissionPolicyTest.java
+++ b/tests/tests/permissionpolicy/src/android/permissionpolicy/cts/PermissionPolicyTest.java
@@ -17,6 +17,10 @@
package android.permissionpolicy.cts;
import static android.content.pm.PermissionInfo.FLAG_INSTALLED;
+import static android.content.pm.PermissionInfo.PROTECTION_FLAG_INSTALLER;
+import static android.content.pm.PermissionInfo.PROTECTION_FLAG_MODULE;
+import static android.content.pm.PermissionInfo.PROTECTION_FLAG_PRIVILEGED;
+import static android.content.pm.PermissionInfo.PROTECTION_FLAG_ROLE;
import static android.content.pm.PermissionInfo.PROTECTION_MASK_BASE;
import static android.os.Build.VERSION.SECURITY_PATCH;
@@ -54,6 +58,7 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -65,16 +70,95 @@
@AppModeFull(reason = "Instant apps cannot read the system servers permission")
@RunWith(AndroidJUnit4.class)
public class PermissionPolicyTest {
- private static final Date HIDE_NON_SYSTEM_OVERLAY_WINDOWS_PATCH_DATE = parseDate("2017-11-01");
- private static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS_PERMISSION
+ private static final String ACCESS_SMARTSPACE = "android.permission.ACCESS_SMARTSPACE";
+ private static final String ACCESSIBILITY_MOTION_EVENT_OBSERVING =
+ "android.permission.ACCESSIBILITY_MOTION_EVENT_OBSERVING";
+ private static final String ALWAYS_UPDATE_WALLPAPER =
+ "android.permission.ALWAYS_UPDATE_WALLPAPER";
+ private static final String CAMERA_HEADLESS_SYSTEM_USER =
+ "android.permission.CAMERA_HEADLESS_SYSTEM_USER";
+ private static final String CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS =
+ "android.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS";
+ private static final String GET_BINDING_UID_IMPORTANCE =
+ "android.permission.GET_BINDING_UID_IMPORTANCE";
+ private static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS
= "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS";
+ private static final String INTERNAL_SYSTEM_WINDOW =
+ "android.permission.INTERNAL_SYSTEM_WINDOW";
+ private static final String LAUNCH_PERMISSION_SETTINGS =
+ "android.permission.LAUNCH_PERMISSION_SETTINGS";
+ private static final String MANAGE_COMPANION_DEVICES =
+ "android.permission.MANAGE_COMPANION_DEVICES";
+ private static final String MANAGE_DISPLAYS = "android.permission.MANAGE_DISPLAYS";
+ private static final String MANAGE_REMOTE_AUTH = "android.permission.MANAGE_REMOTE_AUTH";
+ private static final String MEDIA_ROUTING_CONTROL = "android.permission.MEDIA_ROUTING_CONTROL";
+ private static final String MODIFY_DAY_NIGHT_MODE = "android.permission.MODIFY_DAY_NIGHT_MODE";
+ private static final String OBSERVE_APP_USAGE = "android.permission.OBSERVE_APP_USAGE";
+ private static final String OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW =
+ "android.permission.OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW";
+ private static final String PREPARE_FACTORY_RESET = "android.permission.PREPARE_FACTORY_RESET";
+ private static final String QUARANTINE_APPS = "android.permission.QUARANTINE_APPS";
+ private static final String READ_DROPBOX_DATA = "android.permission.READ_DROPBOX_DATA";
+ private static final String RECEIVE_SANDBOX_TRIGGER_AUDIO =
+ "android.permission.RECEIVE_SANDBOX_TRIGGER_AUDIO";
+ private static final String RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA =
+ "android.permission.RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA";
+ private static final String REGISTER_NSD_OFFLOAD_ENGINE =
+ "android.permission.REGISTER_NSD_OFFLOAD_ENGINE";
+ private static final String REPORT_USAGE_STATS = "android.permission.REPORT_USAGE_STATS";
+ private static final String RESET_HOTWORD_TRAINING_DATA_EGRESS_COUNT =
+ "android.permission.RESET_HOTWORD_TRAINING_DATA_EGRESS_COUNT";
+ private static final String SHOW_CUSTOMIZED_RESOLVER =
+ "android.permission.SHOW_CUSTOMIZED_RESOLVER";
+ private static final String START_ACTIVITIES_FROM_SDK_SANDBOX =
+ "android.permission.START_ACTIVITIES_FROM_SDK_SANDBOX";
+ private static final String STATUS_BAR_SERVICE = "android.permission.STATUS_BAR_SERVICE";
+ private static final String SUSPEND_APPS = "android.permission.SUSPEND_APPS";
+ private static final String SYNC_FLAGS = "android.permission.SYNC_FLAGS";
+ private static final String THREAD_NETWORK_PRIVILEGED =
+ "android.permission.THREAD_NETWORK_PRIVILEGED";
+ private static final String USE_COMPANION_TRANSPORTS =
+ "android.permission.USE_COMPANION_TRANSPORTS";
+ private static final String USE_REMOTE_AUTH = "android.permission.USE_REMOTE_AUTH";
+ private static final String WRITE_FLAGS = "android.permission.WRITE_FLAGS";
+ private static final String BIND_TV_AD_SERVICE = "android.permission.BIND_TV_AD_SERVICE";
+ private static final String RECEIVE_SENSITIVE_NOTIFICATIONS =
+ "android.permission.RECEIVE_SENSITIVE_NOTIFICATIONS";
+ private static final String BIND_DOMAIN_SELECTION_SERVICE =
+ "android.permission.BIND_DOMAIN_SELECTION_SERVICE";
+ private static final String MANAGE_DEVICE_POLICY_THREAD_NETWORK =
+ "android.permission.MANAGE_DEVICE_POLICY_THREAD_NETWORK";
+ private static final String FOREGROUND_SERVICE_MEDIA_PROCESSING =
+ "android.permission.FOREGROUND_SERVICE_MEDIA_PROCESSING";
+ private static final String RUN_BACKUP_JOBS = "android.permission.RUN_BACKUP_JOBS";
+ private static final String EMERGENCY_INSTALL_PACKAGES =
+ "android.permission.EMERGENCY_INSTALL_PACKAGES";
+ private static final String ACCESS_LAST_KNOWN_CELL_ID =
+ "android.permission.ACCESS_LAST_KNOWN_CELL_ID";
+ private static final String GET_BACKGROUND_INSTALLED_PACKAGES =
+ "android.permission.GET_BACKGROUND_INSTALLED_PACKAGES";
+ private static final String MANAGE_ENHANCED_CONFIRMATION_STATES =
+ "android.permission.MANAGE_ENHANCED_CONFIRMATION_STATES";
+ private static final String USE_BACKGROUND_FACE_AUTHENTICATION =
+ "android.permission.USE_BACKGROUND_FACE_AUTHENTICATION";
+ private static final String REQUEST_OBSERVE_DEVICE_UUID_PRESENCE =
+ "android.permission.REQUEST_OBSERVE_DEVICE_UUID_PRESENCE";
+ private static final String READ_SYSTEM_GRAMMATICAL_GENDER =
+ "android.permission.READ_SYSTEM_GRAMMATICAL_GENDER";
+ private static final String SET_BIOMETRIC_DIALOG_LOGO =
+ "android.permission.SET_BIOMETRIC_DIALOG_LOGO";
+ private static final String MONITOR_STICKY_MODIFIER_STATE =
+ "android.permission.MONITOR_STICKY_MODIFIER_STATE";
+ private static final String INTERACT_ACROSS_USERS_FULL =
+ "android.permission.INTERACT_ACROSS_USERS_FULL";
+ private static final String BIND_NFC_SERVICE = "android.permission.BIND_NFC_SERVICE";
+ private static final String SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE =
+ "android.permission.SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE";
+ private static final String MANAGE_ROLE_HOLDERS = "android.permission.MANAGE_ROLE_HOLDERS";
+ private static final String OBSERVE_ROLE_HOLDERS = "android.permission.OBSERVE_ROLE_HOLDERS";
+ private static final Date HIDE_NON_SYSTEM_OVERLAY_WINDOWS_PATCH_DATE = parseDate("2017-11-01");
private static final Date MANAGE_COMPANION_DEVICES_PATCH_DATE = parseDate("2020-07-01");
- private static final String MANAGE_COMPANION_DEVICES_PERMISSION
- = "android.permission.MANAGE_COMPANION_DEVICES";
-
- private static final String SYNC_FLAGS_PERMISSION = "android.permission.SYNC_FLAGS";
- private static final String WRITE_FLAGS_PERMISSION = "android.permission.WRITE_FLAGS";
private static final String LOG_TAG = "PermissionProtectionTest";
@@ -94,6 +178,47 @@
private static final Context sContext =
InstrumentationRegistry.getInstrumentation().getTargetContext();
+ /** Permissions added since the FRC of U. */
+ private static final ArraySet<String> permissionsAddedInUqpr2 = new ArraySet<>(
+ new String[]{ACCESS_SMARTSPACE, ACCESSIBILITY_MOTION_EVENT_OBSERVING,
+ ALWAYS_UPDATE_WALLPAPER, CAMERA_HEADLESS_SYSTEM_USER,
+ GET_BINDING_UID_IMPORTANCE, LAUNCH_PERMISSION_SETTINGS, MANAGE_DISPLAYS,
+ MANAGE_REMOTE_AUTH, MEDIA_ROUTING_CONTROL,
+ OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW, PREPARE_FACTORY_RESET,
+ READ_DROPBOX_DATA, RECEIVE_SANDBOX_TRIGGER_AUDIO,
+ RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA, REGISTER_NSD_OFFLOAD_ENGINE,
+ REPORT_USAGE_STATS, RESET_HOTWORD_TRAINING_DATA_EGRESS_COUNT,
+ START_ACTIVITIES_FROM_SDK_SANDBOX, SHOW_CUSTOMIZED_RESOLVER, SYNC_FLAGS,
+ THREAD_NETWORK_PRIVILEGED, USE_COMPANION_TRANSPORTS, USE_REMOTE_AUTH,
+ QUARANTINE_APPS, WRITE_FLAGS, BIND_TV_AD_SERVICE,
+ RECEIVE_SENSITIVE_NOTIFICATIONS, BIND_DOMAIN_SELECTION_SERVICE,
+ MANAGE_DEVICE_POLICY_THREAD_NETWORK, FOREGROUND_SERVICE_MEDIA_PROCESSING,
+ RUN_BACKUP_JOBS, EMERGENCY_INSTALL_PACKAGES, ACCESS_LAST_KNOWN_CELL_ID,
+ GET_BACKGROUND_INSTALLED_PACKAGES, MANAGE_ENHANCED_CONFIRMATION_STATES,
+ USE_BACKGROUND_FACE_AUTHENTICATION, REQUEST_OBSERVE_DEVICE_UUID_PRESENCE,
+ READ_SYSTEM_GRAMMATICAL_GENDER, SET_BIOMETRIC_DIALOG_LOGO,
+ MONITOR_STICKY_MODIFIER_STATE});
+
+ /**
+ * Map of permissions to their protection flags in the FRC for U which have changed since.
+ */
+ private static final Map<String, Integer> permissionsToLegacyProtection = new HashMap<>() {
+ {
+ put(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS, PROTECTION_FLAG_PRIVILEGED);
+ put(INTERNAL_SYSTEM_WINDOW, PROTECTION_FLAG_MODULE);
+ put(MODIFY_DAY_NIGHT_MODE, PROTECTION_FLAG_PRIVILEGED);
+ put(OBSERVE_APP_USAGE, PROTECTION_FLAG_PRIVILEGED);
+ put(STATUS_BAR_SERVICE, 0x0);
+ put(SUSPEND_APPS, PROTECTION_FLAG_ROLE);
+ put(INTERACT_ACROSS_USERS_FULL, PROTECTION_FLAG_INSTALLER | PROTECTION_FLAG_ROLE);
+ put(BIND_NFC_SERVICE, 0X0);
+ put(SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE, PROTECTION_FLAG_ROLE);
+ put(MANAGE_ROLE_HOLDERS, PROTECTION_FLAG_INSTALLER);
+ put(OBSERVE_ROLE_HOLDERS, PROTECTION_FLAG_INSTALLER);
+ put(USE_COMPANION_TRANSPORTS, PROTECTION_FLAG_MODULE);
+ }
+ };
+
@Test
public void shellIsOnlySystemAppThatRequestsRevokePostNotificationsWithoutKill() {
List<PackageInfo> pkgs = sContext.getPackageManager().getInstalledPackages(
@@ -180,8 +305,15 @@
// OEMs cannot remove permissions
PermissionInfo declaredPermission = declaredPermissionsMap.get(expectedPermissionName);
if (declaredPermission == null) {
- offendingList.add("Permission " + expectedPermissionName + " must be declared");
- continue;
+ // If expected permission is not found, it is possible that this build doesn't yet
+ // contain certain new permissions added after the FRC for U, in which case we skip
+ // the check.
+ if (permissionsAddedInUqpr2.contains(expectedPermissionName)) {
+ continue;
+ } else {
+ offendingList.add("Permission " + expectedPermissionName + " must be declared");
+ continue;
+ }
}
// We want to end up with OEM defined permissions and groups to check their namespace
@@ -216,12 +348,21 @@
expectedPermission.protectionLevel & ~PROTECTION_MASK_BASE;
final int declaredProtectionFlags = declaredPermission.getProtectionFlags();
if (expectedProtectionFlags != declaredProtectionFlags) {
- offendingList.add(
+ // If expected and declared protection flags do not match, it is possible that
+ // this build doesn't yet contain certain protection flags expanded in U QPR 2,
+ // in which case we check that the declared protection flags match those in U
+ // or U QPR 1.
+ if (permissionsToLegacyProtection.getOrDefault(expectedPermissionName, -1)
+ == declaredProtectionFlags) {
+ continue;
+ } else {
+ offendingList.add(
String.format(
"Permission %s invalid enforced protection %x, expected %x",
expectedPermissionName,
declaredProtectionFlags,
expectedProtectionFlags));
+ }
}
// OEMs cannot change permission grouping
@@ -508,12 +649,9 @@
private boolean shouldSkipPermission(String permissionName) {
switch (permissionName) {
- case SYNC_FLAGS_PERMISSION:
- case WRITE_FLAGS_PERMISSION:
- return true; // Added in u-qpr.
- case HIDE_NON_SYSTEM_OVERLAY_WINDOWS_PERMISSION:
+ case HIDE_NON_SYSTEM_OVERLAY_WINDOWS:
return parseDate(SECURITY_PATCH).before(HIDE_NON_SYSTEM_OVERLAY_WINDOWS_PATCH_DATE);
- case MANAGE_COMPANION_DEVICES_PERMISSION:
+ case MANAGE_COMPANION_DEVICES:
return parseDate(SECURITY_PATCH).before(MANAGE_COMPANION_DEVICES_PATCH_DATE);
default:
return false;
diff --git a/tests/tests/preference/Android.bp b/tests/tests/preference/Android.bp
index a298b23..976d456 100644
--- a/tests/tests/preference/Android.bp
+++ b/tests/tests/preference/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/preference/AndroidManifest.xml b/tests/tests/preference/AndroidManifest.xml
index b861458..585d07e 100644
--- a/tests/tests/preference/AndroidManifest.xml
+++ b/tests/tests/preference/AndroidManifest.xml
@@ -52,6 +52,7 @@
<!-- Portrait setup of PreferenceWithHeaders -->
<activity
android:name="PreferenceWithHeadersPortrait"
+ android:enableOnBackInvokedCallback="false"
android:screenOrientation="portrait"/>
<activity android:name="FragmentPreferences" />
</application>
diff --git a/tests/tests/resolverservice/Android.bp b/tests/tests/resolverservice/Android.bp
index 780299d..1f062ca 100644
--- a/tests/tests/resolverservice/Android.bp
+++ b/tests/tests/resolverservice/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_android_packages",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/resourcesloader/OWNERS b/tests/tests/resourcesloader/OWNERS
index 5174db8..844186c 100644
--- a/tests/tests/resourcesloader/OWNERS
+++ b/tests/tests/resourcesloader/OWNERS
@@ -1,5 +1,3 @@
# Bug component: 568761
zyy@google.com
-chiuwinson@google.com
-toddke@google.com
patb@google.com
diff --git a/tests/tests/role/src/android/app/role/cts/RoleManagerTest.java b/tests/tests/role/src/android/app/role/cts/RoleManagerTest.java
index 32ffcc6..971ee2d 100644
--- a/tests/tests/role/src/android/app/role/cts/RoleManagerTest.java
+++ b/tests/tests/role/src/android/app/role/cts/RoleManagerTest.java
@@ -19,8 +19,8 @@
import static com.android.compatibility.common.util.SystemUtil.callWithShellPermissionIdentity;
import static com.android.compatibility.common.util.SystemUtil.runShellCommand;
import static com.android.compatibility.common.util.SystemUtil.runWithShellPermissionIdentity;
-import static com.android.compatibility.common.util.UiAutomatorUtils.waitFindObject;
-import static com.android.compatibility.common.util.UiAutomatorUtils.waitFindObjectOrNull;
+import static com.android.compatibility.common.util.UiAutomatorUtils2.waitFindObject;
+import static com.android.compatibility.common.util.UiAutomatorUtils2.waitFindObjectOrNull;
import static com.google.common.truth.Truth.assertThat;
@@ -42,10 +42,6 @@
import android.os.UserHandle;
import android.provider.Settings;
import android.provider.Telephony;
-import android.support.test.uiautomator.By;
-import android.support.test.uiautomator.BySelector;
-import android.support.test.uiautomator.UiObject2;
-import android.support.test.uiautomator.UiObjectNotFoundException;
import android.util.Pair;
import androidx.annotation.NonNull;
@@ -54,6 +50,10 @@
import androidx.test.filters.SdkSuppress;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
+import androidx.test.uiautomator.By;
+import androidx.test.uiautomator.BySelector;
+import androidx.test.uiautomator.UiObject2;
+import androidx.test.uiautomator.UiObjectNotFoundException;
import com.android.compatibility.common.util.DisableAnimationRule;
import com.android.compatibility.common.util.FreezeRotationRule;
@@ -124,6 +124,17 @@
private static final Context sContext = InstrumentationRegistry.getTargetContext();
private static final PackageManager sPackageManager = sContext.getPackageManager();
private static final RoleManager sRoleManager = sContext.getSystemService(RoleManager.class);
+ private static final boolean sIsWatch = sPackageManager.hasSystemFeature(
+ PackageManager.FEATURE_WATCH);
+
+ private static final BySelector NEGATIVE_BUTTON_SELECTOR =
+ sIsWatch ? By.text("Cancel") : By.res("android:id/button2");
+ private static final BySelector POSITIVE_BUTTON_SELECTOR =
+ sIsWatch ? By.text("Set as default") : By.res("android:id/button1");
+ private static final BySelector DONT_ASK_AGAIN_TOGGLE_SELECTOR =
+ sIsWatch
+ ? By.text("Don\u2019t ask again")
+ : By.res("com.android.permissioncontroller:id/dont_ask_again");
@Rule
public DisableAnimationRule mDisableAnimationRule = new DisableAnimationRule();
@@ -284,7 +295,7 @@
TestUtils.waitUntil("Find and respond to request role UI", () -> {
requestRole(ROLE_NAME);
- UiObject2 cancelButton = waitFindObjectOrNull(By.res("android:id/button2"));
+ UiObject2 cancelButton = waitFindObjectOrNull(NEGATIVE_BUTTON_SELECTOR);
if (cancelButton == null) {
// Dialog not found, try again later.
return false;
@@ -319,7 +330,7 @@
TestUtils.waitUntil("Find and respond to request role UI", () -> {
requestRole(ROLE_NAME);
- UiObject2 cancelButton = waitFindObjectOrNull(By.res("android:id/button2"));
+ UiObject2 cancelButton = waitFindObjectOrNull(NEGATIVE_BUTTON_SELECTOR);
if (cancelButton == null) {
// Dialog not found, try again later.
return false;
@@ -388,10 +399,9 @@
@Nullable
private UiObject2 findDontAskAgainCheck(boolean expected) throws UiObjectNotFoundException {
- BySelector selector = By.res("com.android.permissioncontroller:id/dont_ask_again");
return expected
- ? waitFindObject(selector)
- : waitFindObjectOrNull(selector, UNEXPECTED_TIMEOUT_MILLIS);
+ ? waitFindObject(DONT_ASK_AGAIN_TOGGLE_SELECTOR)
+ : waitFindObjectOrNull(DONT_ASK_AGAIN_TOGGLE_SELECTOR, UNEXPECTED_TIMEOUT_MILLIS);
}
@Nullable
@@ -402,7 +412,7 @@
@NonNull
private Pair<Integer, Intent> clickButtonAndWaitForResult(boolean positive)
throws InterruptedException, UiObjectNotFoundException {
- waitFindObject(By.res(positive ? "android:id/button1" : "android:id/button2")).click();
+ waitFindObject(positive ? POSITIVE_BUTTON_SELECTOR : NEGATIVE_BUTTON_SELECTOR).click();
return waitForResult();
}
@@ -464,7 +474,7 @@
.putExtra(Intent.EXTRA_PACKAGE_NAME, APP_28_PACKAGE_NAME)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
waitFindObject(By.text(APP_28_LABEL)).click();
- waitFindObject(By.res("android:id/button1")).click();
+ waitFindObject(POSITIVE_BUTTON_SELECTOR).click();
// TODO(b/149037075): Use TelecomManager.getDefaultDialerPackage() once the bug is fixed.
//TelecomManager telecomManager = sContext.getSystemService(TelecomManager.class);
@@ -484,7 +494,7 @@
.putExtra(Intent.EXTRA_PACKAGE_NAME, APP_28_PACKAGE_NAME)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
waitFindObject(By.text(APP_28_LABEL)).click();
- waitFindObject(By.res("android:id/button1")).click();
+ waitFindObject(POSITIVE_BUTTON_SELECTOR).click();
TestUtils.waitUntil("App is not set as default sms app", () -> Objects.equals(
Telephony.Sms.getDefaultSmsPackage(sContext), APP_28_PACKAGE_NAME));
@@ -533,7 +543,7 @@
.putExtra(Intent.EXTRA_PACKAGE_NAME, APP_PACKAGE_NAME)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
waitFindObject(By.text(APP_LABEL)).click();
- waitFindObject(By.res("android:id/button1")).click();
+ waitFindObject(POSITIVE_BUTTON_SELECTOR).click();
// TODO(b/149037075): Use TelecomManager.getDefaultDialerPackage() once the bug is fixed.
//TelecomManager telecomManager = sContext.getSystemService(TelecomManager.class);
@@ -578,7 +588,7 @@
.putExtra(Intent.EXTRA_PACKAGE_NAME, APP_PACKAGE_NAME)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
waitFindObject(By.text(APP_LABEL)).click();
- waitFindObject(By.res("android:id/button1")).click();
+ waitFindObject(POSITIVE_BUTTON_SELECTOR).click();
TestUtils.waitUntil("App is not set as default sms app", () -> Objects.equals(
Telephony.Sms.getDefaultSmsPackage(sContext), APP_PACKAGE_NAME));
@@ -593,8 +603,12 @@
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TASK)));
- waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
- .hasDescendant(By.text(APP_LABEL)));
+ if (sIsWatch) {
+ waitFindObject(By.clickable(true).checked(false).hasDescendant(By.text(APP_LABEL)));
+ } else {
+ waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
+ .hasDescendant(By.text(APP_LABEL)));
+ }
pressBack();
}
@@ -608,11 +622,20 @@
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TASK)));
waitForIdle();
- waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
- .hasDescendant(By.text(APP_LABEL))).click();
+ if (sIsWatch) {
+ waitFindObject(By.clickable(true).checked(false).hasDescendant(
+ By.text(APP_LABEL))).click();
+ } else {
+ waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
+ .hasDescendant(By.text(APP_LABEL))).click();
+ }
- waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(true))
- .hasDescendant(By.text(APP_LABEL)));
+ if (sIsWatch) {
+ waitFindObject(By.clickable(true).checked(true).hasDescendant(By.text(APP_LABEL)));
+ } else {
+ waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(true))
+ .hasDescendant(By.text(APP_LABEL)));
+ }
assertIsRoleHolder(ROLE_NAME, APP_PACKAGE_NAME, true);
pressBack();
@@ -628,15 +651,30 @@
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TASK)));
waitForIdle();
- waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
- .hasDescendant(By.text(APP_LABEL))).click();
- waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(true))
- .hasDescendant(By.text(APP_LABEL)));
+ if (sIsWatch) {
+ waitFindObject(By.clickable(true).checked(false).hasDescendant(
+ By.text(APP_LABEL))).click();
+ waitFindObject(By.clickable(true).checked(true).hasDescendant(By.text(APP_LABEL)));
+ } else {
+ waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
+ .hasDescendant(By.text(APP_LABEL))).click();
+ waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(true))
+ .hasDescendant(By.text(APP_LABEL)));
+ }
waitForIdle();
- waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))).click();
+ if (sIsWatch) {
+ waitFindObject(By.clickable(true).checked(false)).click();
+ } else {
+ waitFindObject(
+ By.clickable(true).hasDescendant(By.checkable(true).checked(false))).click();
+ }
- waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
- .hasDescendant(By.text(APP_LABEL)));
+ if (sIsWatch) {
+ waitFindObject(By.clickable(true).checked(false).hasDescendant(By.text(APP_LABEL)));
+ } else {
+ waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
+ .hasDescendant(By.text(APP_LABEL)));
+ }
assertIsRoleHolder(ROLE_NAME, APP_PACKAGE_NAME, false);
pressBack();
@@ -673,11 +711,20 @@
waitForIdle();
waitFindObject(By.text(ROLE_SHORT_LABEL)).click();
waitForIdle();
- waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
- .hasDescendant(By.text(APP_LABEL))).click();
+ if (sIsWatch) {
+ waitFindObject(By.clickable(true).checked(false).hasDescendant(
+ By.text(APP_LABEL))).click();
+ } else {
+ waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
+ .hasDescendant(By.text(APP_LABEL))).click();
+ }
- waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(true))
- .hasDescendant(By.text(APP_LABEL)));
+ if (sIsWatch) {
+ waitFindObject(By.clickable(true).checked(true).hasDescendant(By.text(APP_LABEL)));
+ } else {
+ waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(true))
+ .hasDescendant(By.text(APP_LABEL)));
+ }
assertIsRoleHolder(ROLE_NAME, APP_PACKAGE_NAME, true);
pressBack();
@@ -692,10 +739,16 @@
waitForIdle();
waitFindObject(By.text(ROLE_SHORT_LABEL)).click();
waitForIdle();
- waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
- .hasDescendant(By.text(APP_LABEL))).click();
- waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(true))
- .hasDescendant(By.text(APP_LABEL)));
+ if (sIsWatch) {
+ waitFindObject(By.clickable(true).checked(false).hasDescendant(
+ By.text(APP_LABEL))).click();
+ waitFindObject(By.clickable(true).checked(true).hasDescendant(By.text(APP_LABEL)));
+ } else {
+ waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(false))
+ .hasDescendant(By.text(APP_LABEL))).click();
+ waitFindObject(By.clickable(true).hasDescendant(By.checkable(true).checked(true))
+ .hasDescendant(By.text(APP_LABEL)));
+ }
pressBack();
waitFindObject(By.text(APP_LABEL));
diff --git a/tests/tests/sax/Android.bp b/tests/tests/sax/Android.bp
index da59526..a037960 100644
--- a/tests/tests/sax/Android.bp
+++ b/tests/tests/sax/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_java_core_libraries",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/sdksandbox/webkit/Android.bp b/tests/tests/sdksandbox/webkit/Android.bp
index f0ab143..434ec37 100644
--- a/tests/tests/sdksandbox/webkit/Android.bp
+++ b/tests/tests/sdksandbox/webkit/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_chromium_webview",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -31,7 +32,6 @@
"ctswebkitsharedenv",
],
data: [
- ":EmptySdkProviderApp",
":WebViewSandboxTestSdk",
],
srcs: [
diff --git a/tests/tests/sdksandbox/webkit/AndroidManifest.xml b/tests/tests/sdksandbox/webkit/AndroidManifest.xml
index 24cc75f..777e43a 100644
--- a/tests/tests/sdksandbox/webkit/AndroidManifest.xml
+++ b/tests/tests/sdksandbox/webkit/AndroidManifest.xml
@@ -24,9 +24,6 @@
<application android:maxRecents="1">
<uses-library android:name="android.test.runner"/>
- <uses-sdk-library android:name="com.android.emptysdkprovider"
- android:versionMajor="1"
- android:certDigest="0B:44:2D:88:FA:A7:B3:AD:23:8D:DE:29:8A:A1:9B:D5:62:03:92:0B:BF:D8:D3:EB:C8:99:33:2C:8E:E1:15:99"/>
<uses-sdk-library android:name="com.android.cts.sdk.webviewsandboxtest"
android:versionMajor="1"
android:certDigest="0B:44:2D:88:FA:A7:B3:AD:23:8D:DE:29:8A:A1:9B:D5:62:03:92:0B:BF:D8:D3:EB:C8:99:33:2C:8E:E1:15:99"/>
diff --git a/tests/tests/sdksandbox/webkit/AndroidTest.xml b/tests/tests/sdksandbox/webkit/AndroidTest.xml
index 783ce8f..8052a9f 100644
--- a/tests/tests/sdksandbox/webkit/AndroidTest.xml
+++ b/tests/tests/sdksandbox/webkit/AndroidTest.xml
@@ -23,7 +23,6 @@
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
<option name="cleanup-apks" value="true"/>
<option name="test-file-name" value="WebViewSandboxTestSdk.apk"/>
- <option name="test-file-name" value="EmptySdkProviderApp.apk"/>
<option name="test-file-name" value="CtsSdkSandboxWebkitTestCases.apk"/>
</target_preparer>
diff --git a/tests/tests/sdksandbox/webkit/sdk/Android.bp b/tests/tests/sdksandbox/webkit/sdk/Android.bp
index 625d304..5fee4a9 100644
--- a/tests/tests/sdksandbox/webkit/sdk/Android.bp
+++ b/tests/tests/sdksandbox/webkit/sdk/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_chromium_webview",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/sdksandbox/webkit/sdk/src/com/android/cts/sdk/WebViewSandboxTestSdk.java b/tests/tests/sdksandbox/webkit/sdk/src/com/android/cts/sdk/WebViewSandboxTestSdk.java
index 91dda0f..ae8660b 100644
--- a/tests/tests/sdksandbox/webkit/sdk/src/com/android/cts/sdk/WebViewSandboxTestSdk.java
+++ b/tests/tests/sdksandbox/webkit/sdk/src/com/android/cts/sdk/WebViewSandboxTestSdk.java
@@ -27,8 +27,11 @@
import android.webkit.cts.IHostAppInvoker;
import android.webkit.cts.SharedWebViewTest;
import android.webkit.cts.SharedWebViewTestEnvironment;
+import android.webkit.cts.WebkitUtils;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
+import android.view.ViewGroup;
+import android.view.ViewParent;
import androidx.annotation.Nullable;
@@ -76,6 +79,20 @@
return rootLayout;
}
+ @Override
+ public void cleanUpOnTestFinish() {
+ // Enforcing UI thread cleanup after Binder thread execution to match test origin
+ // and prevent threading issues.
+ WebkitUtils.onMainThreadSync(() -> {
+ WebView webView = mTestInstance.getTestEnvironment().getWebView();
+ ViewParent webviewParent = webView.getParent();
+ if (webviewParent instanceof ViewGroup) {
+ ((ViewGroup) webviewParent).removeView(webView);
+ }
+ webView.destroy();
+ });
+ }
+
private FrameLayout wrapWebViewInLayout(WebView webView) {
// Some tests add content views the root view of the activity which
// is a FrameLayout, hence adding a FrameLayout as a root here as well
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkMimeTypeMapTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkMimeTypeMapTest.java
index 4834cb3..50d09f9 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkMimeTypeMapTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkMimeTypeMapTest.java
@@ -16,14 +16,12 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
import android.platform.test.annotations.AppModeFull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,40 +30,36 @@
@RunWith(AndroidJUnit4.class)
public class SdkMimeTypeMapTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.MimeTypeMapTest");
@Test
- public void testGetFileExtensionFromUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetFileExtensionFromUrl");
+ public void testGetFileExtensionFromUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetFileExtensionFromUrl");
}
@Test
- public void testHasMimeType() throws Exception {
- sdkTester.assertSdkTestRunPasses("testHasMimeType");
+ public void testHasMimeType() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testHasMimeType");
}
@Test
- public void testGetMimeTypeFromExtension() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetMimeTypeFromExtension");
+ public void testGetMimeTypeFromExtension() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetMimeTypeFromExtension");
}
@Test
- public void testHasExtension() throws Exception {
- sdkTester.assertSdkTestRunPasses("testHasExtension");
+ public void testHasExtension() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testHasExtension");
}
@Test
- public void testGetExtensionFromMimeType() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetExtensionFromMimeType");
+ public void testGetExtensionFromMimeType() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetExtensionFromMimeType");
}
@Test
- public void testGetSingleton() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetSingleton");
+ public void testGetSingleton() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetSingleton");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxCookieManagerTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxCookieManagerTest.java
index 8db9cdf..c3137f7 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxCookieManagerTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxCookieManagerTest.java
@@ -16,13 +16,10 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
-
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,80 +27,76 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxCookieManagerTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.CookieManagerTest");
@Test
- public void testGetInstance() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetInstance");
+ public void testGetInstance() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetInstance");
}
@Test
- public void testFlush() throws Exception {
- sdkTester.assertSdkTestRunPasses("testFlush");
+ public void testFlush() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testFlush");
}
@Test
- public void testAcceptCookie() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAcceptCookie");
+ public void testAcceptCookie() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAcceptCookie");
}
@Test
- public void testSetCookie() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetCookie");
+ public void testSetCookie() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetCookie");
}
@Test
- public void testSetCookieNullCallback() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetCookieNullCallback");
+ public void testSetCookieNullCallback() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetCookieNullCallback");
}
@Test
- public void testSetCookieCallback() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetCookieCallback");
+ public void testSetCookieCallback() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetCookieCallback");
}
@Test
- public void testRemoveCookies() throws Exception {
- sdkTester.assertSdkTestRunPasses("testRemoveCookies");
+ public void testRemoveCookies() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testRemoveCookies");
}
@Test
- public void testRemoveCookiesNullCallback() throws Exception {
- sdkTester.assertSdkTestRunPasses("testRemoveCookiesNullCallback");
+ public void testRemoveCookiesNullCallback() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testRemoveCookiesNullCallback");
}
@Test
- public void testRemoveCookiesCallback() throws Exception {
- sdkTester.assertSdkTestRunPasses("testRemoveCookiesCallback");
+ public void testRemoveCookiesCallback() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testRemoveCookiesCallback");
}
@Test
- public void testThirdPartyCookie() throws Exception {
- sdkTester.assertSdkTestRunPasses("testThirdPartyCookie");
+ public void testThirdPartyCookie() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testThirdPartyCookie");
}
@Test
- public void testSameSiteLaxByDefault() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSameSiteLaxByDefault");
+ public void testSameSiteLaxByDefault() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSameSiteLaxByDefault");
}
@Test
- public void testSameSiteNoneRequiresSecure() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSameSiteNoneRequiresSecure");
+ public void testSameSiteNoneRequiresSecure() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSameSiteNoneRequiresSecure");
}
@Test
- public void testSchemefulSameSite() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSchemefulSameSite");
+ public void testSchemefulSameSite() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSchemefulSameSite");
}
@Test
- public void testb3167208() throws Exception {
- sdkTester.assertSdkTestRunPasses("testb3167208");
+ public void testb3167208() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testb3167208");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxCookieTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxCookieTest.java
index 52f4daf..2fa6473 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxCookieTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxCookieTest.java
@@ -16,14 +16,12 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
import android.platform.test.annotations.Presubmit;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -31,36 +29,32 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxCookieTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.CookieTest");
@Presubmit
@Test
- public void testDomain() throws Exception {
- sdkTester.assertSdkTestRunPasses("testDomain");
+ public void testDomain() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testDomain");
}
@Test
- public void testSubDomain() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSubDomain");
+ public void testSubDomain() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSubDomain");
}
@Test
- public void testInvalidDomain() throws Exception {
- sdkTester.assertSdkTestRunPasses("testInvalidDomain");
+ public void testInvalidDomain() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testInvalidDomain");
}
@Test
- public void testPath() throws Exception {
- sdkTester.assertSdkTestRunPasses("testPath");
+ public void testPath() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testPath");
}
@Test
- public void testEmptyValue() throws Exception {
- sdkTester.assertSdkTestRunPasses("testEmptyValue");
+ public void testEmptyValue() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testEmptyValue");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxDateSorterTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxDateSorterTest.java
index e83a524..3099a8f 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxDateSorterTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxDateSorterTest.java
@@ -16,14 +16,12 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
import android.platform.test.annotations.AppModeFull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,30 +30,26 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxDateSorterTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.DateSorterTest");
@Test
- public void testConstructor() throws Exception {
- sdkTester.assertSdkTestRunPasses("testConstructor");
+ public void testConstructor() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testConstructor");
}
@Test
- public void testGetLabel() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetLabel");
+ public void testGetLabel() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetLabel");
}
@Test
- public void testGetIndex() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetIndex");
+ public void testGetIndex() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetIndex");
}
@Test
- public void testGetBoundary() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetBoundary");
+ public void testGetBoundary() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetBoundary");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxHttpAuthHandlerTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxHttpAuthHandlerTest.java
index 05e9a1f..cb9efcc 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxHttpAuthHandlerTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxHttpAuthHandlerTest.java
@@ -16,14 +16,12 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
import android.platform.test.annotations.AppModeFull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,25 +30,21 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxHttpAuthHandlerTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.HttpAuthHandlerTest");
@Test
- public void testProceed() throws Exception {
- sdkTester.assertSdkTestRunPasses("testProceed");
+ public void testProceed() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testProceed");
}
@Test
- public void testCancel() throws Exception {
- sdkTester.assertSdkTestRunPasses("testCancel");
+ public void testCancel() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testCancel");
}
@Test
- public void testUseHttpAuthUsernamePassword() throws Exception {
- sdkTester.assertSdkTestRunPasses("testUseHttpAuthUsernamePassword");
+ public void testUseHttpAuthUsernamePassword() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testUseHttpAuthUsernamePassword");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxPostMessageTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxPostMessageTest.java
index 214084a..2b92f47 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxPostMessageTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxPostMessageTest.java
@@ -16,14 +16,12 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
import android.platform.test.annotations.AppModeFull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,55 +30,51 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxPostMessageTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.PostMessageTest");
@Test
- public void testSimpleMessageToMainFrame() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSimpleMessageToMainFrame");
+ public void testSimpleMessageToMainFrame() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSimpleMessageToMainFrame");
}
@Test
- public void testWildcardOriginMatchesAnything() throws Exception {
- sdkTester.assertSdkTestRunPasses("testWildcardOriginMatchesAnything");
+ public void testWildcardOriginMatchesAnything() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testWildcardOriginMatchesAnything");
}
@Test
- public void testEmptyStringOriginMatchesAnything() throws Exception {
- sdkTester.assertSdkTestRunPasses("testEmptyStringOriginMatchesAnything");
+ public void testEmptyStringOriginMatchesAnything() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testEmptyStringOriginMatchesAnything");
}
@Test
- public void testMultipleMessagesToMainFrame() throws Exception {
- sdkTester.assertSdkTestRunPasses("testMultipleMessagesToMainFrame");
+ public void testMultipleMessagesToMainFrame() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testMultipleMessagesToMainFrame");
}
@Test
- public void testMessageChannel() throws Exception {
- sdkTester.assertSdkTestRunPasses("testMessageChannel");
+ public void testMessageChannel() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testMessageChannel");
}
@Test
- public void testClose() throws Exception {
- sdkTester.assertSdkTestRunPasses("testClose");
+ public void testClose() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testClose");
}
@Test
- public void testReceiveMessagePort() throws Exception {
- sdkTester.assertSdkTestRunPasses("testReceiveMessagePort");
+ public void testReceiveMessagePort() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testReceiveMessagePort");
}
@Test
- public void testWebMessageHandler() throws Exception {
- sdkTester.assertSdkTestRunPasses("testWebMessageHandler");
+ public void testWebMessageHandler() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testWebMessageHandler");
}
@Test
- public void testWebMessageDefaultHandler() throws Exception {
- sdkTester.assertSdkTestRunPasses("testWebMessageDefaultHandler");
+ public void testWebMessageDefaultHandler() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testWebMessageDefaultHandler");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxServiceWorkerClientTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxServiceWorkerClientTest.java
index 39922ed..944e2e1 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxServiceWorkerClientTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxServiceWorkerClientTest.java
@@ -16,13 +16,10 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
-
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,20 +27,16 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxServiceWorkerClientTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.ServiceWorkerClientTest");
@Test
- public void testServiceWorkerClientInterceptCallback() throws Exception {
- sdkTester.assertSdkTestRunPasses("testServiceWorkerClientInterceptCallback");
+ public void testServiceWorkerClientInterceptCallback() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testServiceWorkerClientInterceptCallback");
}
@Test
- public void testSetNullServiceWorkerClient() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetNullServiceWorkerClient");
+ public void testSetNullServiceWorkerClient() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetNullServiceWorkerClient");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxURLUtilTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxURLUtilTest.java
index 4e047c7..1159d03 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxURLUtilTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxURLUtilTest.java
@@ -16,14 +16,12 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
import android.platform.test.annotations.AppModeFull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,90 +30,86 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxURLUtilTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.URLUtilTest");
@Test
- public void testIsAssetUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIsAssetUrl");
+ public void testIsAssetUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIsAssetUrl");
}
@Test
- public void testIsAboutUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIsAboutUrl");
+ public void testIsAboutUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIsAboutUrl");
}
@Test
- public void testIsContentUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIsContentUrl");
+ public void testIsContentUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIsContentUrl");
}
@Test
- public void testIsCookielessProxyUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIsCookielessProxyUrl");
+ public void testIsCookielessProxyUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIsCookielessProxyUrl");
}
@Test
- public void testIsDataUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIsDataUrl");
+ public void testIsDataUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIsDataUrl");
}
@Test
- public void testIsFileUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIsFileUrl");
+ public void testIsFileUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIsFileUrl");
}
@Test
- public void testIsHttpsUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIsHttpsUrl");
+ public void testIsHttpsUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIsHttpsUrl");
}
@Test
- public void testIsHttpUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIsHttpUrl");
+ public void testIsHttpUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIsHttpUrl");
}
@Test
- public void testIsJavaScriptUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIsJavaScriptUrl");
+ public void testIsJavaScriptUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIsJavaScriptUrl");
}
@Test
- public void testIsNetworkUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIsNetworkUrl");
+ public void testIsNetworkUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIsNetworkUrl");
}
@Test
- public void testIsValidUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIsValidUrl");
+ public void testIsValidUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIsValidUrl");
}
@Test
- public void testComposeSearchUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testComposeSearchUrl");
+ public void testComposeSearchUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testComposeSearchUrl");
}
@Test
- public void testDecode() throws Exception {
- sdkTester.assertSdkTestRunPasses("testDecode");
+ public void testDecode() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testDecode");
}
@Test
- public void testGuessFileName() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGuessFileName");
+ public void testGuessFileName() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGuessFileName");
}
@Test
- public void testGuessUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGuessUrl");
+ public void testGuessUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGuessUrl");
}
@Test
- public void testStripAnchor() throws Exception {
- sdkTester.assertSdkTestRunPasses("testStripAnchor");
+ public void testStripAnchor() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testStripAnchor");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebBackForwardListTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebBackForwardListTest.java
index 7d8c85b..c9214e2 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebBackForwardListTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebBackForwardListTest.java
@@ -16,13 +16,10 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
-
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,15 +27,11 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxWebBackForwardListTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.WebBackForwardListTest");
@Test
- public void testGetCurrentItem() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetCurrentItem");
+ public void testGetCurrentItem() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetCurrentItem");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebChromeClientTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebChromeClientTest.java
index 95ec8da..778b014 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebChromeClientTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebChromeClientTest.java
@@ -15,13 +15,10 @@
*/
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
-
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,66 +27,62 @@
public class SdkSandboxWebChromeClientTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.WebChromeClientTest");
@Test
- public void testOnProgressChanged() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnProgressChanged");
+ public void testOnProgressChanged() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnProgressChanged");
}
@Test
- public void testOnReceivedTitle() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnReceivedTitle");
+ public void testOnReceivedTitle() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnReceivedTitle");
}
@Test
- public void testOnReceivedIcon() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnReceivedIcon");
+ public void testOnReceivedIcon() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnReceivedIcon");
}
@Test
- public void testWindows() throws Exception {
- sdkTester.assertSdkTestRunPasses("testWindows");
+ public void testWindows() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testWindows");
}
@Test
- public void testBlockWindowsSync() throws Exception {
- sdkTester.assertSdkTestRunPasses("testBlockWindowsSync");
+ public void testBlockWindowsSync() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testBlockWindowsSync");
}
@Test
- public void testBlockWindowsAsync() throws Exception {
- sdkTester.assertSdkTestRunPasses("testBlockWindowsAsync");
+ public void testBlockWindowsAsync() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testBlockWindowsAsync");
}
@Test
- public void testOnJsAlert() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnJsAlert");
+ public void testOnJsAlert() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnJsAlert");
}
@Test
- public void testOnJsConfirm() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnJsConfirm");
+ public void testOnJsConfirm() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnJsConfirm");
}
@Test
- public void testOnJsPrompt() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnJsPrompt");
+ public void testOnJsPrompt() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnJsPrompt");
}
@Test
- public void testOnConsoleMessage() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnConsoleMessage");
+ public void testOnConsoleMessage() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnConsoleMessage");
}
@Test
- public void testOnJsBeforeUnloadIsCalled() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnJsBeforeUnloadIsCalled");
+ public void testOnJsBeforeUnloadIsCalled() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnJsBeforeUnloadIsCalled");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebHistoryItemTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebHistoryItemTest.java
index 5eb7225..53ce916 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebHistoryItemTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebHistoryItemTest.java
@@ -16,13 +16,10 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
-
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,15 +27,11 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxWebHistoryItemTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.WebHistoryItemTest");
@Test
- public void testWebHistoryItem() throws Exception {
- sdkTester.assertSdkTestRunPasses("testWebHistoryItem");
+ public void testWebHistoryItem() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testWebHistoryItem");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebSettingsTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebSettingsTest.java
index e2112ae..85497c0 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebSettingsTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebSettingsTest.java
@@ -16,13 +16,10 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
-
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,250 +27,250 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxWebSettingsTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.WebSettingsTest");
@Test
- public void testUserAgentString_default() throws Exception {
- sdkTester.assertSdkTestRunPasses("testUserAgentString_default");
+ public void testUserAgentString_default() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testUserAgentString_default");
}
@Test
- public void testUserAgentStringTest() throws Exception {
- sdkTester.assertSdkTestRunPasses("testUserAgentStringTest");
+ public void testUserAgentStringTest() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testUserAgentStringTest");
}
@Test
- public void testAccessUserAgentString() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessUserAgentString");
+ public void testAccessUserAgentString() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessUserAgentString");
}
@Test
- public void testAccessCacheMode_defaultValue() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessCacheMode_defaultValue");
+ public void testAccessCacheMode_defaultValue() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessCacheMode_defaultValue");
}
@Test
- public void testAccessCacheMode_cacheElseNetwork() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessCacheMode_cacheElseNetwork");
+ public void testAccessCacheMode_cacheElseNetwork() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessCacheMode_cacheElseNetwork");
}
@Test
- public void testAccessCacheMode_noCache() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessCacheMode_noCache");
+ public void testAccessCacheMode_noCache() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessCacheMode_noCache");
}
@Test
- public void testAccessCacheMode_cacheOnly() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessCacheMode_cacheOnly");
+ public void testAccessCacheMode_cacheOnly() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessCacheMode_cacheOnly");
}
@Test
- public void testAccessCursiveFontFamily() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessCursiveFontFamily");
+ public void testAccessCursiveFontFamily() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessCursiveFontFamily");
}
@Test
- public void testAccessFantasyFontFamily() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessFantasyFontFamily");
+ public void testAccessFantasyFontFamily() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessFantasyFontFamily");
}
@Test
- public void testAccessFixedFontFamily() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessFixedFontFamily");
+ public void testAccessFixedFontFamily() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessFixedFontFamily");
}
@Test
- public void testAccessSansSerifFontFamily() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessSansSerifFontFamily");
+ public void testAccessSansSerifFontFamily() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessSansSerifFontFamily");
}
@Test
- public void testAccessSerifFontFamily() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessSerifFontFamily");
+ public void testAccessSerifFontFamily() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessSerifFontFamily");
}
@Test
- public void testAccessStandardFontFamily() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessStandardFontFamily");
+ public void testAccessStandardFontFamily() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessStandardFontFamily");
}
@Test
- public void testAccessDefaultFontSize() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessDefaultFontSize");
+ public void testAccessDefaultFontSize() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessDefaultFontSize");
}
@Test
- public void testAccessDefaultFixedFontSize() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessDefaultFixedFontSize");
+ public void testAccessDefaultFixedFontSize() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessDefaultFixedFontSize");
}
@Test
- public void testAccessDefaultTextEncodingName() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessDefaultTextEncodingName");
+ public void testAccessDefaultTextEncodingName() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessDefaultTextEncodingName");
}
@Test
- public void testAccessJavaScriptCanOpenWindowsAutomatically() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessJavaScriptCanOpenWindowsAutomatically");
+ public void testAccessJavaScriptCanOpenWindowsAutomatically() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testAccessJavaScriptCanOpenWindowsAutomatically");
}
@Test
- public void testAccessJavaScriptEnabled() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessJavaScriptEnabled");
+ public void testAccessJavaScriptEnabled() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessJavaScriptEnabled");
}
@Test
- public void testAccessLayoutAlgorithm() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessLayoutAlgorithm");
+ public void testAccessLayoutAlgorithm() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessLayoutAlgorithm");
}
@Test
- public void testAccessMinimumFontSize() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessMinimumFontSize");
+ public void testAccessMinimumFontSize() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessMinimumFontSize");
}
@Test
- public void testAccessMinimumLogicalFontSize() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessMinimumLogicalFontSize");
+ public void testAccessMinimumLogicalFontSize() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessMinimumLogicalFontSize");
}
@Test
- public void testAccessPluginsEnabled() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessPluginsEnabled");
+ public void testAccessPluginsEnabled() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessPluginsEnabled");
}
@Test
- public void testOffscreenPreRaster() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOffscreenPreRaster");
+ public void testOffscreenPreRaster() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOffscreenPreRaster");
}
@Test
- public void testAccessPluginsPath() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessPluginsPath");
+ public void testAccessPluginsPath() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessPluginsPath");
}
@Test
- public void testAccessTextSize() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessTextSize");
+ public void testAccessTextSize() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessTextSize");
}
@Test
- public void testAccessUseDoubleTree() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessUseDoubleTree");
+ public void testAccessUseDoubleTree() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessUseDoubleTree");
}
@Test
- public void testAccessUseWideViewPort() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessUseWideViewPort");
+ public void testAccessUseWideViewPort() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessUseWideViewPort");
}
@Test
- public void testSetNeedInitialFocus() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetNeedInitialFocus");
+ public void testSetNeedInitialFocus() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetNeedInitialFocus");
}
@Test
- public void testSetRenderPriority() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetRenderPriority");
+ public void testSetRenderPriority() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetRenderPriority");
}
@Test
- public void testAccessSupportMultipleWindows() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessSupportMultipleWindows");
+ public void testAccessSupportMultipleWindows() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessSupportMultipleWindows");
}
@Test
- public void testAccessSupportZoom() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessSupportZoom");
+ public void testAccessSupportZoom() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessSupportZoom");
}
@Test
- public void testAccessBuiltInZoomControls() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessBuiltInZoomControls");
+ public void testAccessBuiltInZoomControls() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessBuiltInZoomControls");
}
@Test
- public void testAppCacheDisabled() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAppCacheDisabled");
+ public void testAppCacheDisabled() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAppCacheDisabled");
}
@Test
- public void testAppCacheEnabled() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAppCacheEnabled");
+ public void testAppCacheEnabled() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAppCacheEnabled");
}
@Test
- public void testDatabaseDisabled() throws Exception {
- sdkTester.assertSdkTestRunPasses("testDatabaseDisabled");
+ public void testDatabaseDisabled() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testDatabaseDisabled");
}
@Test
- public void testDisabledActionModeMenuItems() throws Exception {
- sdkTester.assertSdkTestRunPasses("testDisabledActionModeMenuItems");
+ public void testDisabledActionModeMenuItems() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testDisabledActionModeMenuItems");
}
@Test
- public void testLoadsImagesAutomatically_default() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadsImagesAutomatically_default");
+ public void testLoadsImagesAutomatically_default() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testLoadsImagesAutomatically_default");
}
@Test
- public void testLoadsImagesAutomatically_httpImagesLoaded() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadsImagesAutomatically_httpImagesLoaded");
+ public void testLoadsImagesAutomatically_httpImagesLoaded() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testLoadsImagesAutomatically_httpImagesLoaded");
}
@Test
- public void testLoadsImagesAutomatically_dataUriImagesLoaded() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadsImagesAutomatically_dataUriImagesLoaded");
+ public void testLoadsImagesAutomatically_dataUriImagesLoaded() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testLoadsImagesAutomatically_dataUriImagesLoaded");
}
@Test
- public void testLoadsImagesAutomatically_blockLoadingImages() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadsImagesAutomatically_blockLoadingImages");
+ public void testLoadsImagesAutomatically_blockLoadingImages() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testLoadsImagesAutomatically_blockLoadingImages");
}
@Test
- public void testLoadsImagesAutomatically_loadImagesWithoutReload() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadsImagesAutomatically_loadImagesWithoutReload");
+ public void testLoadsImagesAutomatically_loadImagesWithoutReload() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testLoadsImagesAutomatically_loadImagesWithoutReload");
}
@Test
- public void testBlockNetworkImage() throws Exception {
- sdkTester.assertSdkTestRunPasses("testBlockNetworkImage");
+ public void testBlockNetworkImage() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testBlockNetworkImage");
}
@Test
- public void testBlockNetworkLoads() throws Exception {
- sdkTester.assertSdkTestRunPasses("testBlockNetworkLoads");
+ public void testBlockNetworkLoads() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testBlockNetworkLoads");
}
@Test
- public void testIframesWhenAccessFromFileURLsDisabled() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIframesWhenAccessFromFileURLsDisabled");
+ public void testIframesWhenAccessFromFileURLsDisabled() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIframesWhenAccessFromFileURLsDisabled");
}
@Test
- public void testXHRWhenAccessFromFileURLsEnabled() throws Exception {
- sdkTester.assertSdkTestRunPasses("testXHRWhenAccessFromFileURLsEnabled");
+ public void testXHRWhenAccessFromFileURLsEnabled() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testXHRWhenAccessFromFileURLsEnabled");
}
@Test
- public void testXHRWhenAccessFromFileURLsDisabled() throws Exception {
- sdkTester.assertSdkTestRunPasses("testXHRWhenAccessFromFileURLsDisabled");
+ public void testXHRWhenAccessFromFileURLsDisabled() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testXHRWhenAccessFromFileURLsDisabled");
}
@Test
- public void testAllowMixedMode() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAllowMixedMode");
+ public void testAllowMixedMode() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAllowMixedMode");
}
@Test
- public void testEnableSafeBrowsing() throws Exception {
- sdkTester.assertSdkTestRunPasses("testEnableSafeBrowsing");
+ public void testEnableSafeBrowsing() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testEnableSafeBrowsing");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewClientTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewClientTest.java
index 1c184de..bb03bf5 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewClientTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewClientTest.java
@@ -20,159 +20,151 @@
import androidx.test.filters.FlakyTest;
import androidx.test.filters.MediumTest;
-import org.junit.Rule;
+import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
@MediumTest
@RunWith(AndroidJUnit4.class)
public class SdkSandboxWebViewClientTest {
- // TODO(b/266051278): Uncomment this when we work out why preserving
- // the SDK sandbox manager between tests cases {@link testOnRenderProcessGone}
- // to fail.
- //
- // @ClassRule
- // public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- // new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ @ClassRule
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.WebViewClientTest");
@Test
- public void testShouldOverrideUrlLoadingDefault() throws Exception {
- sdkTester.assertSdkTestRunPasses("testShouldOverrideUrlLoadingDefault");
+ public void testShouldOverrideUrlLoadingDefault() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testShouldOverrideUrlLoadingDefault");
}
@Test
- public void testShouldOverrideUrlLoading() throws Exception {
- sdkTester.assertSdkTestRunPasses("testShouldOverrideUrlLoading");
+ public void testShouldOverrideUrlLoading() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testShouldOverrideUrlLoading");
}
@Test
- public void testShouldOverrideUrlLoadingOnCreateWindow() throws Exception {
- sdkTester.assertSdkTestRunPasses("testShouldOverrideUrlLoadingOnCreateWindow");
+ public void testShouldOverrideUrlLoadingOnCreateWindow() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testShouldOverrideUrlLoadingOnCreateWindow");
}
@Test
- public void testLoadPage() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadPage");
+ public void testLoadPage() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testLoadPage");
}
@Test
- public void testOnReceivedLoginRequest() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnReceivedLoginRequest");
+ public void testOnReceivedLoginRequest() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnReceivedLoginRequest");
}
@Test
- public void testOnReceivedError() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnReceivedError");
+ public void testOnReceivedError() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnReceivedError");
}
@Test
- public void testOnReceivedErrorForSubresource() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnReceivedErrorForSubresource");
+ public void testOnReceivedErrorForSubresource() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnReceivedErrorForSubresource");
}
@Test
- public void testOnReceivedHttpError() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnReceivedHttpError");
+ public void testOnReceivedHttpError() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnReceivedHttpError");
}
@Test
- public void testOnFormResubmission() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnFormResubmission");
+ public void testOnFormResubmission() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnFormResubmission");
}
@Test
- public void testDoUpdateVisitedHistory() throws Exception {
- sdkTester.assertSdkTestRunPasses("testDoUpdateVisitedHistory");
+ public void testDoUpdateVisitedHistory() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testDoUpdateVisitedHistory");
}
@Test
- public void testOnReceivedHttpAuthRequest() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnReceivedHttpAuthRequest");
+ public void testOnReceivedHttpAuthRequest() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnReceivedHttpAuthRequest");
}
@Test
- public void testShouldOverrideKeyEvent() throws Exception {
- sdkTester.assertSdkTestRunPasses("testShouldOverrideKeyEvent");
+ public void testShouldOverrideKeyEvent() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testShouldOverrideKeyEvent");
}
@Test
- public void testOnUnhandledKeyEvent() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnUnhandledKeyEvent");
+ public void testOnUnhandledKeyEvent() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnUnhandledKeyEvent");
}
@Test
- public void testOnScaleChanged() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnScaleChanged");
+ public void testOnScaleChanged() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnScaleChanged");
}
@Test
- public void testShouldInterceptRequestParams() throws Exception {
- sdkTester.assertSdkTestRunPasses("testShouldInterceptRequestParams");
+ public void testShouldInterceptRequestParams() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testShouldInterceptRequestParams");
}
@Test
- public void testShouldInterceptRequestResponse() throws Exception {
- sdkTester.assertSdkTestRunPasses("testShouldInterceptRequestResponse");
+ public void testShouldInterceptRequestResponse() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testShouldInterceptRequestResponse");
}
@Test
- public void testOnRenderProcessGoneDefault() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnRenderProcessGoneDefault");
+ public void testOnRenderProcessGoneDefault() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnRenderProcessGoneDefault");
}
@Test
- public void testOnRenderProcessGone() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnRenderProcessGone");
+ public void testOnRenderProcessGone() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnRenderProcessGone");
}
// TODO(crbug/1245351): Remove @FlakyTest once bug fixed
@FlakyTest
@Test
- public void testOnSafeBrowsingHitBackToSafety() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnSafeBrowsingHitBackToSafety");
+ public void testOnSafeBrowsingHitBackToSafety() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnSafeBrowsingHitBackToSafety");
}
// TODO(crbug/1245351): Remove @FlakyTest once bug fixed
@FlakyTest
@Test
- public void testOnSafeBrowsingHitProceed() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnSafeBrowsingHitProceed");
+ public void testOnSafeBrowsingHitProceed() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnSafeBrowsingHitProceed");
}
// TODO(crbug/1245351): Remove @FlakyTest once bug fixed
@FlakyTest
@Test
- public void testOnSafeBrowsingMalwareCode() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnSafeBrowsingMalwareCode");
+ public void testOnSafeBrowsingMalwareCode() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnSafeBrowsingMalwareCode");
}
// TODO(crbug/1245351): Remove @FlakyTest once bug fixed
@FlakyTest
@Test
- public void testOnSafeBrowsingPhishingCode() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnSafeBrowsingPhishingCode");
+ public void testOnSafeBrowsingPhishingCode() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnSafeBrowsingPhishingCode");
}
// TODO(crbug/1245351): Remove @FlakyTest once bug fixed
@FlakyTest
@Test
- public void testOnSafeBrowsingUnwantedSoftwareCode() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnSafeBrowsingUnwantedSoftwareCode");
+ public void testOnSafeBrowsingUnwantedSoftwareCode() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnSafeBrowsingUnwantedSoftwareCode");
}
// TODO(crbug/1245351): Remove @FlakyTest once bug fixed
@FlakyTest
@Test
- public void testOnSafeBrowsingBillingCode() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnSafeBrowsingBillingCode");
+ public void testOnSafeBrowsingBillingCode() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnSafeBrowsingBillingCode");
}
@Test
- public void testOnPageCommitVisibleCalled() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnPageCommitVisibleCalled");
+ public void testOnPageCommitVisibleCalled() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnPageCommitVisibleCalled");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewRenderProcessClientTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewRenderProcessClientTest.java
index 999ad44..2f8201b 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewRenderProcessClientTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewRenderProcessClientTest.java
@@ -16,14 +16,12 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
import android.platform.test.annotations.AppModeFull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,25 +30,21 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxWebViewRenderProcessClientTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.WebViewRenderProcessClientTest");
@Test
- public void testWebViewRenderProcessClientWithoutExecutor() throws Exception {
- sdkTester.assertSdkTestRunPasses("testWebViewRenderProcessClientWithoutExecutor");
+ public void testWebViewRenderProcessClientWithoutExecutor() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testWebViewRenderProcessClientWithoutExecutor");
}
@Test
- public void testWebViewRenderProcessClientWithExecutor() throws Exception {
- sdkTester.assertSdkTestRunPasses("testWebViewRenderProcessClientWithExecutor");
+ public void testWebViewRenderProcessClientWithExecutor() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testWebViewRenderProcessClientWithExecutor");
}
@Test
- public void testSetWebViewRenderProcessClient() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetWebViewRenderProcessClient");
+ public void testSetWebViewRenderProcessClient() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetWebViewRenderProcessClient");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewSslTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewSslTest.java
index ba5975e..931ef51 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewSslTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewSslTest.java
@@ -16,14 +16,12 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
import android.platform.test.annotations.AppModeFull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -31,95 +29,93 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxWebViewSslTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.WebViewSslTest");
@Test
@MediumTest
- public void testInsecureSiteClearsCertificate() throws Exception {
- sdkTester.assertSdkTestRunPasses("testInsecureSiteClearsCertificate");
+ public void testInsecureSiteClearsCertificate() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testInsecureSiteClearsCertificate");
}
@Test
@MediumTest
- public void testSecureSiteSetsCertificate() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSecureSiteSetsCertificate");
+ public void testSecureSiteSetsCertificate() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSecureSiteSetsCertificate");
}
@Test
@MediumTest
- public void testClearSslPreferences() throws Exception {
- sdkTester.assertSdkTestRunPasses("testClearSslPreferences");
+ public void testClearSslPreferences() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testClearSslPreferences");
}
@Test
@MediumTest
- public void testOnReceivedSslError() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnReceivedSslError");
+ public void testOnReceivedSslError() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnReceivedSslError");
}
@Test
@MediumTest
- public void testOnReceivedSslErrorProceed() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnReceivedSslErrorProceed");
+ public void testOnReceivedSslErrorProceed() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnReceivedSslErrorProceed");
}
@Test
@MediumTest
- public void testOnReceivedSslErrorCancel() throws Exception {
- sdkTester.assertSdkTestRunPasses("testOnReceivedSslErrorCancel");
+ public void testOnReceivedSslErrorCancel() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testOnReceivedSslErrorCancel");
}
@Test
@MediumTest
- public void testSslErrorProceedResponseReusedForSameHost() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSslErrorProceedResponseReusedForSameHost");
+ public void testSslErrorProceedResponseReusedForSameHost() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSslErrorProceedResponseReusedForSameHost");
}
@Test
@MediumTest
- public void testSslErrorProceedResponseNotReusedForDifferentHost() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSslErrorProceedResponseNotReusedForDifferentHost");
+ public void testSslErrorProceedResponseNotReusedForDifferentHost() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testSslErrorProceedResponseNotReusedForDifferentHost");
}
@Test
@MediumTest
- public void testSecureServerRequestingClientCertDoesNotCancelRequest() throws Exception {
- sdkTester.assertSdkTestRunPasses(
+ public void testSecureServerRequestingClientCertDoesNotCancelRequest() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
"testSecureServerRequestingClientCertDoesNotCancelRequest");
}
@Test
@MediumTest
- public void testSecureServerRequiringClientCertDoesCancelRequest() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSecureServerRequiringClientCertDoesCancelRequest");
+ public void testSecureServerRequiringClientCertDoesCancelRequest() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testSecureServerRequiringClientCertDoesCancelRequest");
}
@Test
@MediumTest
- public void testProceedClientCertRequest() throws Exception {
- sdkTester.assertSdkTestRunPasses("testProceedClientCertRequest");
+ public void testProceedClientCertRequest() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testProceedClientCertRequest");
}
@Test
@MediumTest
- public void testIgnoreClientCertRequest() throws Exception {
- sdkTester.assertSdkTestRunPasses("testIgnoreClientCertRequest");
+ public void testIgnoreClientCertRequest() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testIgnoreClientCertRequest");
}
@Test
@MediumTest
- public void testCancelClientCertRequest() throws Exception {
- sdkTester.assertSdkTestRunPasses("testCancelClientCertRequest");
+ public void testCancelClientCertRequest() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testCancelClientCertRequest");
}
@Test
@MediumTest
- public void testClientCertIssuersReceivedCorrectly() throws Exception {
- sdkTester.assertSdkTestRunPasses("testClientCertIssuersReceivedCorrectly");
+ public void testClientCertIssuersReceivedCorrectly() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testClientCertIssuersReceivedCorrectly");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewTest.java
index 13395d28..d1ed339 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewTest.java
@@ -16,7 +16,6 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
import android.platform.test.annotations.AppModeFull;
import android.platform.test.annotations.Presubmit;
@@ -24,7 +23,6 @@
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,364 +30,371 @@
@AppModeFull
@RunWith(AndroidJUnit4.class)
public class SdkSandboxWebViewTest {
- @ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ @ClassRule
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.WebViewTest");
@Test
- public void testConstructor() throws Exception {
- sdkTester.assertSdkTestRunPasses("testConstructor");
+ public void testConstructor() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testConstructor");
}
@Test
- public void testCreatingWebViewWithDeviceEncrpytionFails() throws Exception {
- sdkTester.assertSdkTestRunPasses("testCreatingWebViewWithDeviceEncrpytionFails");
+ public void testCreatingWebViewWithDeviceEncrpytionFails() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testCreatingWebViewWithDeviceEncrpytionFails");
}
@Test
- public void testCreatingWebViewWithMultipleEncryptionContext() throws Exception {
- sdkTester.assertSdkTestRunPasses("testCreatingWebViewWithMultipleEncryptionContext");
+ public void testCreatingWebViewWithMultipleEncryptionContext() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testCreatingWebViewWithMultipleEncryptionContext");
}
@Test
- public void testCreatingWebViewCreatesCookieSyncManager() throws Exception {
- sdkTester.assertSdkTestRunPasses("testCreatingWebViewCreatesCookieSyncManager");
+ public void testCreatingWebViewCreatesCookieSyncManager() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testCreatingWebViewCreatesCookieSyncManager");
}
@Test
- public void testFindAddress() throws Exception {
- sdkTester.assertSdkTestRunPasses("testFindAddress");
+ public void testFindAddress() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testFindAddress");
}
@Test
- public void testAccessHttpAuthUsernamePassword() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessHttpAuthUsernamePassword");
+ public void testAccessHttpAuthUsernamePassword() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessHttpAuthUsernamePassword");
}
@Test
- public void testWebViewDatabaseAccessHttpAuthUsernamePassword() throws Exception {
- sdkTester.assertSdkTestRunPasses("testWebViewDatabaseAccessHttpAuthUsernamePassword");
+ public void testWebViewDatabaseAccessHttpAuthUsernamePassword() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testWebViewDatabaseAccessHttpAuthUsernamePassword");
}
@Test
- public void testScrollBarOverlay() throws Exception {
- sdkTester.assertSdkTestRunPasses("testScrollBarOverlay");
+ public void testScrollBarOverlay() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testScrollBarOverlay");
}
@Test
- public void testFlingScroll() throws Exception {
- sdkTester.assertSdkTestRunPasses("testFlingScroll");
+ public void testFlingScroll() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testFlingScroll");
}
@Test
@Presubmit
- public void testLoadUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadUrl");
+ public void testLoadUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testLoadUrl");
}
@Test
- public void testPostUrlWithNetworkUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testPostUrlWithNetworkUrl");
+ public void testPostUrlWithNetworkUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testPostUrlWithNetworkUrl");
}
@Test
- public void testAppInjectedXRequestedWithHeaderIsNotOverwritten() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAppInjectedXRequestedWithHeaderIsNotOverwritten");
+ public void testAppInjectedXRequestedWithHeaderIsNotOverwritten() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testAppInjectedXRequestedWithHeaderIsNotOverwritten");
}
@Test
- public void testAppCanInjectHeadersViaImmutableMap() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAppCanInjectHeadersViaImmutableMap");
+ public void testAppCanInjectHeadersViaImmutableMap() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAppCanInjectHeadersViaImmutableMap");
}
@Test
- public void testCanInjectHeaders() throws Exception {
- sdkTester.assertSdkTestRunPasses("testCanInjectHeaders");
+ public void testCanInjectHeaders() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testCanInjectHeaders");
}
@Test
- public void testGetVisibleTitleHeight() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetVisibleTitleHeight");
+ public void testGetVisibleTitleHeight() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetVisibleTitleHeight");
}
@Test
- public void testGetOriginalUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetOriginalUrl");
+ public void testGetOriginalUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetOriginalUrl");
}
@Test
- public void testStopLoading() throws Exception {
- sdkTester.assertSdkTestRunPasses("testStopLoading");
+ public void testStopLoading() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testStopLoading");
}
@Test
- public void testGoBackAndForward() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGoBackAndForward");
+ public void testGoBackAndForward() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGoBackAndForward");
}
@Test
- public void testAddJavascriptInterface() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAddJavascriptInterface");
+ public void testAddJavascriptInterface() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAddJavascriptInterface");
}
@Test
- public void testAddJavascriptInterfaceNullObject() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAddJavascriptInterfaceNullObject");
+ public void testAddJavascriptInterfaceNullObject() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAddJavascriptInterfaceNullObject");
}
@Test
- public void testRemoveJavascriptInterface() throws Exception {
- sdkTester.assertSdkTestRunPasses("testRemoveJavascriptInterface");
+ public void testRemoveJavascriptInterface() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testRemoveJavascriptInterface");
}
@Test
- public void testUseRemovedJavascriptInterface() throws Exception {
- sdkTester.assertSdkTestRunPasses("testUseRemovedJavascriptInterface");
+ public void testUseRemovedJavascriptInterface() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testUseRemovedJavascriptInterface");
}
@Test
- public void testAddJavascriptInterfaceExceptions() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAddJavascriptInterfaceExceptions");
+ public void testAddJavascriptInterfaceExceptions() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAddJavascriptInterfaceExceptions");
}
@Test
- public void testJavascriptInterfaceCustomPropertiesClearedOnReload() throws Exception {
- sdkTester.assertSdkTestRunPasses("testJavascriptInterfaceCustomPropertiesClearedOnReload");
+ public void testJavascriptInterfaceCustomPropertiesClearedOnReload() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testJavascriptInterfaceCustomPropertiesClearedOnReload");
}
@Test
@MediumTest
- public void testJavascriptInterfaceForClientPopup() throws Exception {
- sdkTester.assertSdkTestRunPasses("testJavascriptInterfaceForClientPopup");
+ public void testJavascriptInterfaceForClientPopup() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testJavascriptInterfaceForClientPopup");
}
@Test
@MediumTest
- public void testLoadDataWithBaseUrl_historyUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadDataWithBaseUrl_historyUrl");
+ public void testLoadDataWithBaseUrl_historyUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testLoadDataWithBaseUrl_historyUrl");
}
@Test
- public void testLoadDataWithBaseUrl_nullHistoryUrlShowsAsAboutBlank() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadDataWithBaseUrl_nullHistoryUrlShowsAsAboutBlank");
+ public void testLoadDataWithBaseUrl_nullHistoryUrlShowsAsAboutBlank() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testLoadDataWithBaseUrl_nullHistoryUrlShowsAsAboutBlank");
}
@Test
- public void testLoadDataWithBaseUrl_dataBaseUrlIgnoresHistoryUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadDataWithBaseUrl_dataBaseUrlIgnoresHistoryUrl");
+ public void testLoadDataWithBaseUrl_dataBaseUrlIgnoresHistoryUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testLoadDataWithBaseUrl_dataBaseUrlIgnoresHistoryUrl");
}
@Test
- public void testLoadDataWithBaseUrl_unencodedContentHttpBaseUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadDataWithBaseUrl_unencodedContentHttpBaseUrl");
+ public void testLoadDataWithBaseUrl_unencodedContentHttpBaseUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testLoadDataWithBaseUrl_unencodedContentHttpBaseUrl");
}
@Test
- public void testLoadDataWithBaseUrl_urlEncodedContentDataBaseUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadDataWithBaseUrl_urlEncodedContentDataBaseUrl");
+ public void testLoadDataWithBaseUrl_urlEncodedContentDataBaseUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testLoadDataWithBaseUrl_urlEncodedContentDataBaseUrl");
}
@Test
- public void testLoadDataWithBaseUrl_nullSafe() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadDataWithBaseUrl_nullSafe");
+ public void testLoadDataWithBaseUrl_nullSafe() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testLoadDataWithBaseUrl_nullSafe");
}
@Test
- public void testSaveWebArchive() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSaveWebArchive");
+ public void testSaveWebArchive() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSaveWebArchive");
}
@Test
- public void testFindAll() throws Exception {
- sdkTester.assertSdkTestRunPasses("testFindAll");
+ public void testFindAll() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testFindAll");
}
@Test
- public void testFindNext() throws Exception {
- sdkTester.assertSdkTestRunPasses("testFindNext");
+ public void testFindNext() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testFindNext");
}
@Test
- public void testPageScroll() throws Exception {
- sdkTester.assertSdkTestRunPasses("testPageScroll");
+ public void testPageScroll() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testPageScroll");
}
@Test
- public void testGetContentHeight() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetContentHeight");
+ public void testGetContentHeight() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetContentHeight");
}
@Test
- public void testPlatformNotifications() throws Exception {
- sdkTester.assertSdkTestRunPasses("testPlatformNotifications");
+ public void testPlatformNotifications() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testPlatformNotifications");
}
@Test
- public void testAccessPluginList() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessPluginList");
+ public void testAccessPluginList() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessPluginList");
}
@Test
- public void testDestroy() throws Exception {
- sdkTester.assertSdkTestRunPasses("testDestroy");
+ public void testDestroy() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testDestroy");
}
@Test
- public void testDebugDump() throws Exception {
- sdkTester.assertSdkTestRunPasses("testDebugDump");
+ public void testDebugDump() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testDebugDump");
}
@Test
- public void testSetInitialScale() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetInitialScale");
+ public void testSetInitialScale() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetInitialScale");
}
@Test
- public void testRequestChildRectangleOnScreen() throws Exception {
- sdkTester.assertSdkTestRunPasses("testRequestChildRectangleOnScreen");
+ public void testRequestChildRectangleOnScreen() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testRequestChildRectangleOnScreen");
}
@Test
- public void testSetLayoutParams() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetLayoutParams");
+ public void testSetLayoutParams() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetLayoutParams");
}
@Test
- public void testSetMapTrackballToArrowKeys() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetMapTrackballToArrowKeys");
+ public void testSetMapTrackballToArrowKeys() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetMapTrackballToArrowKeys");
}
@Test
- public void testPauseResumeTimers() throws Exception {
- sdkTester.assertSdkTestRunPasses("testPauseResumeTimers");
+ public void testPauseResumeTimers() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testPauseResumeTimers");
}
@Test
- public void testEvaluateJavascript() throws Exception {
- sdkTester.assertSdkTestRunPasses("testEvaluateJavascript");
+ public void testEvaluateJavascript() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testEvaluateJavascript");
}
@Test
- public void testPrinting() throws Exception {
- sdkTester.assertSdkTestRunPasses("testPrinting");
+ public void testPrinting() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testPrinting");
}
@Test
- public void testPrintingPagesCount() throws Exception {
- sdkTester.assertSdkTestRunPasses("testPrintingPagesCount");
+ public void testPrintingPagesCount() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testPrintingPagesCount");
}
@Test
- public void testVisualStateCallbackCalled() throws Exception {
- sdkTester.assertSdkTestRunPasses("testVisualStateCallbackCalled");
+ public void testVisualStateCallbackCalled() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testVisualStateCallbackCalled");
}
@Test
- public void testSetSafeBrowsingAllowlistWithMalformedList() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetSafeBrowsingAllowlistWithMalformedList");
+ public void testSetSafeBrowsingAllowlistWithMalformedList() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetSafeBrowsingAllowlistWithMalformedList");
}
@Test
- public void testSetSafeBrowsingAllowlistWithValidList() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetSafeBrowsingAllowlistWithValidList");
+ public void testSetSafeBrowsingAllowlistWithValidList() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetSafeBrowsingAllowlistWithValidList");
}
@Test
- public void testGetWebViewClient() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetWebViewClient");
+ public void testGetWebViewClient() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetWebViewClient");
}
@Test
- public void testGetWebChromeClient() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetWebChromeClient");
+ public void testGetWebChromeClient() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetWebChromeClient");
}
@Test
- public void testSetCustomTextClassifier() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetCustomTextClassifier");
+ public void testSetCustomTextClassifier() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetCustomTextClassifier");
}
@Test
- public void testGetSafeBrowsingPrivacyPolicyUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetSafeBrowsingPrivacyPolicyUrl");
+ public void testGetSafeBrowsingPrivacyPolicyUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetSafeBrowsingPrivacyPolicyUrl");
}
@Test
- public void testWebViewClassLoaderReturnsNonNull() throws Exception {
- sdkTester.assertSdkTestRunPasses("testWebViewClassLoaderReturnsNonNull");
+ public void testWebViewClassLoaderReturnsNonNull() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testWebViewClassLoaderReturnsNonNull");
}
@Test
- public void testCapturePicture() throws Exception {
- sdkTester.assertSdkTestRunPasses("testCapturePicture");
+ public void testCapturePicture() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testCapturePicture");
}
@Test
- public void testSetPictureListener() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetPictureListener");
+ public void testSetPictureListener() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetPictureListener");
}
@Test
- public void testLoadData() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadData");
+ public void testLoadData() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testLoadData");
}
@Test
- public void testLoadDataWithBaseUrl_resolvesRelativeToBaseUrl() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadDataWithBaseUrl_resolvesRelativeToBaseUrl");
+ public void testLoadDataWithBaseUrl_resolvesRelativeToBaseUrl() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testLoadDataWithBaseUrl_resolvesRelativeToBaseUrl");
}
@Test
- public void testLoadDataWithBaseUrl_javascriptCanAccessOrigin() throws Exception {
- sdkTester.assertSdkTestRunPasses("testLoadDataWithBaseUrl_javascriptCanAccessOrigin");
+ public void testLoadDataWithBaseUrl_javascriptCanAccessOrigin() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses(
+ "testLoadDataWithBaseUrl_javascriptCanAccessOrigin");
}
@Test
- public void testDocumentHasImages() throws Exception {
- sdkTester.assertSdkTestRunPasses("testDocumentHasImages");
+ public void testDocumentHasImages() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testDocumentHasImages");
}
@Test
- public void testClearHistory() throws Exception {
- sdkTester.assertSdkTestRunPasses("testClearHistory");
+ public void testClearHistory() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testClearHistory");
}
@Test
- public void testSaveAndRestoreState() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSaveAndRestoreState");
+ public void testSaveAndRestoreState() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSaveAndRestoreState");
}
@Test
- public void testSetDownloadListener() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetDownloadListener");
+ public void testSetDownloadListener() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetDownloadListener");
}
@Test
- public void testSetNetworkAvailable() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetNetworkAvailable");
+ public void testSetNetworkAvailable() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetNetworkAvailable");
}
@Test
- public void testSetWebChromeClient() throws Exception {
- sdkTester.assertSdkTestRunPasses("testSetWebChromeClient");
+ public void testSetWebChromeClient() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testSetWebChromeClient");
}
@Test
- public void testRequestFocusNodeHref() throws Exception {
- sdkTester.assertSdkTestRunPasses("testRequestFocusNodeHref");
+ public void testRequestFocusNodeHref() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testRequestFocusNodeHref");
}
@Test
- public void testRequestImageRef() throws Exception {
- sdkTester.assertSdkTestRunPasses("testRequestImageRef");
+ public void testRequestImageRef() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testRequestImageRef");
}
@Test
- public void testGetHitTestResult() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetHitTestResult");
+ public void testGetHitTestResult() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetHitTestResult");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewTransportTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewTransportTest.java
index a4db755..41d5159 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewTransportTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewTransportTest.java
@@ -16,13 +16,10 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
-
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,15 +27,11 @@
@RunWith(AndroidJUnit4.class)
public class SdkSandboxWebViewTransportTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.WebViewTransportTest");
@Test
- public void testAccessWebView() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAccessWebView");
+ public void testAccessWebView() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAccessWebView");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewZoomTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewZoomTest.java
index 4afee9c..e1a801d81 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewZoomTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkSandboxWebViewZoomTest.java
@@ -15,13 +15,10 @@
*/
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
-
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,55 +27,51 @@
public class SdkSandboxWebViewZoomTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.WebViewZoomTest");
@Test
- public void testZoomIn() throws Exception {
- sdkTester.assertSdkTestRunPasses("testZoomIn");
+ public void testZoomIn() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testZoomIn");
}
@Test
- public void testGetZoomControls() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetZoomControls");
+ public void testGetZoomControls() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetZoomControls");
}
@Test
- public void testInvokeZoomPicker() throws Exception {
- sdkTester.assertSdkTestRunPasses("testInvokeZoomPicker");
+ public void testInvokeZoomPicker() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testInvokeZoomPicker");
}
@Test
- public void testZoom_canNotZoomInPastMaximum() throws Exception {
- sdkTester.assertSdkTestRunPasses("testZoom_canNotZoomInPastMaximum");
+ public void testZoom_canNotZoomInPastMaximum() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testZoom_canNotZoomInPastMaximum");
}
@Test
- public void testZoom_canNotZoomOutPastMinimum() throws Exception {
- sdkTester.assertSdkTestRunPasses("testZoom_canNotZoomOutPastMinimum");
+ public void testZoom_canNotZoomOutPastMinimum() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testZoom_canNotZoomOutPastMinimum");
}
@Test
- public void testCanZoomWhileZoomSupportedFalse() throws Exception {
- sdkTester.assertSdkTestRunPasses("testCanZoomWhileZoomSupportedFalse");
+ public void testCanZoomWhileZoomSupportedFalse() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testCanZoomWhileZoomSupportedFalse");
}
@Test
- public void testZoomByPowerOfTwoIncrements() throws Exception {
- sdkTester.assertSdkTestRunPasses("testZoomByPowerOfTwoIncrements");
+ public void testZoomByPowerOfTwoIncrements() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testZoomByPowerOfTwoIncrements");
}
@Test
- public void testZoomByNonPowerOfTwoIncrements() throws Exception {
- sdkTester.assertSdkTestRunPasses("testZoomByNonPowerOfTwoIncrements");
+ public void testZoomByNonPowerOfTwoIncrements() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testZoomByNonPowerOfTwoIncrements");
}
@Test
- public void testScaleChangeCallbackMatchesGetScale() throws Exception {
- sdkTester.assertSdkTestRunPasses("testScaleChangeCallbackMatchesGetScale");
+ public void testScaleChangeCallbackMatchesGetScale() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testScaleChangeCallbackMatchesGetScale");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkServiceWorkerWebSettingsTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkServiceWorkerWebSettingsTest.java
index e83a333..fc6027f 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkServiceWorkerWebSettingsTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkServiceWorkerWebSettingsTest.java
@@ -16,14 +16,12 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
import android.platform.test.annotations.AppModeFull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,30 +30,26 @@
@RunWith(AndroidJUnit4.class)
public class SdkServiceWorkerWebSettingsTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.ServiceWorkerWebSettingsTest");
@Test
- public void testCacheMode() throws Exception {
- sdkTester.assertSdkTestRunPasses("testCacheMode");
+ public void testCacheMode() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testCacheMode");
}
@Test
- public void testAllowContentAccess() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAllowContentAccess");
+ public void testAllowContentAccess() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAllowContentAccess");
}
@Test
- public void testAllowFileAccess() throws Exception {
- sdkTester.assertSdkTestRunPasses("testAllowFileAccess");
+ public void testAllowFileAccess() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testAllowFileAccess");
}
@Test
- public void testBlockNetworkLoads() throws Exception {
- sdkTester.assertSdkTestRunPasses("testBlockNetworkLoads");
+ public void testBlockNetworkLoads() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testBlockNetworkLoads");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkWebViewRenderProcessTest.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkWebViewRenderProcessTest.java
index 91f3fbe..fa31f8c 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkWebViewRenderProcessTest.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/SdkWebViewRenderProcessTest.java
@@ -16,14 +16,12 @@
package android.sdksandbox.webkit.cts;
-import android.app.sdksandbox.testutils.testscenario.KeepSdkSandboxAliveRule;
import android.platform.test.annotations.AppModeFull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import org.junit.ClassRule;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,15 +30,11 @@
@RunWith(AndroidJUnit4.class)
public class SdkWebViewRenderProcessTest {
@ClassRule
- public static final KeepSdkSandboxAliveRule sSdkTestSuiteSetup =
- new KeepSdkSandboxAliveRule("com.android.emptysdkprovider");
-
- @Rule
- public final WebViewSandboxTestRule sdkTester =
+ public static final WebViewSandboxTestRule sSdkTestSuiteSetup =
new WebViewSandboxTestRule("android.webkit.cts.WebViewRenderProcessTest");
@Test
- public void testGetWebViewRenderProcess() throws Exception {
- sdkTester.assertSdkTestRunPasses("testGetWebViewRenderProcess");
+ public void testGetWebViewRenderProcess() throws Throwable {
+ sSdkTestSuiteSetup.assertSdkTestRunPasses("testGetWebViewRenderProcess");
}
}
diff --git a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/WebViewSandboxTestRule.java b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/WebViewSandboxTestRule.java
index 433b5ce..125c46b 100644
--- a/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/WebViewSandboxTestRule.java
+++ b/tests/tests/sdksandbox/webkit/src/android/sdksandbox/webkit/cts/WebViewSandboxTestRule.java
@@ -15,8 +15,6 @@
*/
package android.sdksandbox.webkit.cts;
-import static android.app.sdksandbox.testutils.testscenario.SdkSandboxScenarioRule.ENABLE_LIFE_CYCLE_ANNOTATIONS;
-
import android.app.sdksandbox.testutils.testscenario.SdkSandboxScenarioRule;
import android.os.Bundle;
import android.webkit.cts.SharedWebViewTest;
@@ -56,8 +54,21 @@
@Override
public Statement apply(final Statement base, final Description description) {
+ // If WebView is not available, simply skip loading the SDK and then throw an assumption
+ // failure for each test run attempt.
+ // We can't throw the assumptions in the apply because WebViewSandboxTestRule can be used as
+ // a class rule.
+ if (!NullWebViewUtils.isWebViewAvailable()) {
+ return base;
+ }
+
+ return super.apply(base, description);
+ }
+
+ @Override
+ public void assertSdkTestRunPasses(String testMethodName, Bundle params) throws Throwable {
// This will prevent shared webview tests from running if a WebView provider does not exist.
Assume.assumeTrue("WebView is not available", NullWebViewUtils.isWebViewAvailable());
- return super.apply(base, description);
+ super.assertSdkTestRunPasses(testMethodName, params);
}
}
diff --git a/tests/tests/secure_element/access_control/AccessControlApp1/Android.bp b/tests/tests/secure_element/access_control/AccessControlApp1/Android.bp
index d0f70cd..e5c5a87 100644
--- a/tests/tests/secure_element/access_control/AccessControlApp1/Android.bp
+++ b/tests/tests/secure_element/access_control/AccessControlApp1/Android.bp
@@ -2,6 +2,7 @@
// Signed Package
package {
+ default_team: "trendy_team_fwk_nfc",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/secure_element/access_control/AccessControlApp2/Android.bp b/tests/tests/secure_element/access_control/AccessControlApp2/Android.bp
index dbd3269..6252f2b 100644
--- a/tests/tests/secure_element/access_control/AccessControlApp2/Android.bp
+++ b/tests/tests/secure_element/access_control/AccessControlApp2/Android.bp
@@ -2,6 +2,7 @@
// Signed Package
package {
+ default_team: "trendy_team_fwk_nfc",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/secure_element/access_control/AccessControlApp3/Android.bp b/tests/tests/secure_element/access_control/AccessControlApp3/Android.bp
index 0689fe3..c5d9055 100644
--- a/tests/tests/secure_element/access_control/AccessControlApp3/Android.bp
+++ b/tests/tests/secure_element/access_control/AccessControlApp3/Android.bp
@@ -2,6 +2,7 @@
// Signed Package
package {
+ default_team: "trendy_team_fwk_nfc",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/secure_element/omapi/Android.bp b/tests/tests/secure_element/omapi/Android.bp
index b56a269..1c25157 100644
--- a/tests/tests/secure_element/omapi/Android.bp
+++ b/tests/tests/secure_element/omapi/Android.bp
@@ -16,6 +16,7 @@
// Signed Package
package {
+ default_team: "trendy_team_fwk_nfc",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/security/Android.bp b/tests/tests/security/Android.bp
index ce63982..7e7bf98 100644
--- a/tests/tests/security/Android.bp
+++ b/tests/tests/security/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/security/SplitBluetoothPermissionTestApp/Android.bp b/tests/tests/security/SplitBluetoothPermissionTestApp/Android.bp
index 09b6683..7f1bfbd2 100644
--- a/tests/tests/security/SplitBluetoothPermissionTestApp/Android.bp
+++ b/tests/tests/security/SplitBluetoothPermissionTestApp/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/security/jni/Android.bp b/tests/tests/security/jni/Android.bp
index d581ce0..5830152 100644
--- a/tests/tests/security/jni/Android.bp
+++ b/tests/tests/security/jni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/security/native/Android.bp b/tests/tests/security/native/Android.bp
index bf840b6..f690f3b 100644
--- a/tests/tests/security/native/Android.bp
+++ b/tests/tests/security/native/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/security/native/encryption/Android.bp b/tests/tests/security/native/encryption/Android.bp
index ebbd1f8..1ec0993 100644
--- a/tests/tests/security/native/encryption/Android.bp
+++ b/tests/tests/security/native/encryption/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/security/native/verified_boot/Android.bp b/tests/tests/security/native/verified_boot/Android.bp
index 0a7e254..b19c1e7 100644
--- a/tests/tests/security/native/verified_boot/Android.bp
+++ b/tests/tests/security/native/verified_boot/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/security/src/android/security/cts/CertificateData.java b/tests/tests/security/src/android/security/cts/CertificateData.java
index 08ff3c3..e0d276c 100644
--- a/tests/tests/security/src/android/security/cts/CertificateData.java
+++ b/tests/tests/security/src/android/security/cts/CertificateData.java
@@ -27,8 +27,10 @@
static final String[] CERTIFICATE_DATA = {
"99:9A:64:C3:7F:F4:7D:9F:AB:95:F1:47:69:89:14:60:EE:C4:C3:C5",
"D1:CB:CA:5D:B2:D5:2A:7F:69:3B:67:4D:E5:F0:5A:1D:0C:95:7D:F0",
+ "57:73:A5:61:5D:80:B2:E6:AC:38:82:FC:68:07:31:AC:9F:B5:92:5A",
"6B:A0:B0:98:E1:71:EF:5A:AD:FE:48:15:80:77:10:F4:BD:6F:0B:28",
"92:5A:8F:8D:2C:6D:04:E0:66:5F:59:6A:FF:22:D8:63:E8:25:6F:3F",
+ "18:52:3B:0D:06:37:E4:D6:3A:DF:23:E4:98:FB:5B:16:FB:86:74:48",
"B4:90:82:DD:45:0C:BE:8B:5B:B1:66:D3:E2:A4:08:26:CD:ED:42:CF",
"53:A2:B0:4B:CA:6B:D6:45:E6:39:8A:8E:C4:0D:D2:BF:77:C3:A2:90",
"58:E8:AB:B0:36:15:33:FB:80:F7:9B:1B:6D:29:D3:FF:8D:5F:00:F0",
@@ -40,14 +42,18 @@
"AD:7E:1C:28:B0:64:EF:8F:60:03:40:20:14:C3:D0:E3:37:0E:B5:8A",
"17:F3:DE:5E:9F:0F:19:E9:8E:F6:1F:32:26:6E:20:C4:07:AE:30:EE",
"1F:24:C6:30:CD:A4:18:EF:20:69:FF:AD:4F:DD:5F:46:3A:1B:69:AA",
+ "EC:2C:83:40:72:AF:26:95:10:FF:0E:F2:03:EE:31:70:F6:78:9D:CA",
+ "9E:BC:75:10:42:B3:02:F3:81:F4:F7:30:62:D4:8F:C3:A7:51:B2:DD",
"DA:FA:F7:FA:66:84:EC:06:8F:14:50:BD:C7:C2:81:A5:BC:A9:64:57",
"2D:0D:52:14:FF:9E:AD:99:24:01:74:20:47:6E:6C:85:27:27:F5:43",
"28:F9:78:16:19:7A:FF:18:25:18:AA:44:FE:C1:A0:CE:5C:B6:4C:8A",
"31:43:64:9B:EC:CE:27:EC:ED:3A:3F:0B:8F:0D:E4:E8:91:DD:EE:CA",
"B7:AB:33:08:D1:EA:44:77:BA:14:80:12:5A:6F:BD:A9:36:49:0C:BB",
+ "3C:3F:EF:57:0F:FE:65:93:86:9E:A0:FE:B0:F6:ED:8E:D1:13:C7:E5",
"2B:8F:1B:57:33:0D:BB:A2:D0:7A:6C:51:F7:0E:E9:0D:DA:B9:AD:8E",
"A8:98:5D:3A:65:E5:E5:C4:B2:D7:D6:6D:40:C6:DD:2F:B1:9C:54:36",
"D4:DE:20:D0:5E:66:FC:53:FE:1A:50:88:2C:78:DB:28:52:CA:E4:74",
+ "EC:8A:39:6C:40:F0:2E:BC:42:75:D4:9F:AB:1C:1A:5B:67:BE:D2:9A",
"D8:C5:38:8A:B7:30:1B:1B:6E:D4:7A:E6:45:25:3A:6F:9F:1A:27:61",
"E0:11:84:5E:34:DE:BE:88:81:B9:9C:F6:16:26:D1:96:1F:C3:B9:31",
"93:05:7A:88:15:C6:4F:CE:88:2F:FA:91:16:52:28:78:BC:53:64:17",
@@ -61,6 +67,7 @@
"1B:8E:EA:57:96:29:1A:C9:39:EA:B8:0A:81:1A:73:73:C0:93:79:67",
"6A:92:E4:A8:EE:1B:EC:96:45:37:E3:29:57:49:CD:96:E3:E5:D2:60",
"74:3A:F0:52:9B:D0:32:A0:F4:4A:83:CD:D4:BA:A9:7B:7C:2E:C4:9A",
+ "07:86:C0:D8:DD:8E:C0:80:98:06:98:D0:58:7A:EF:DE:A6:CC:A2:5D",
"66:31:BF:9E:F7:4F:9E:B6:C9:D5:A6:0C:BA:6A:BE:D1:F7:BD:EF:7B",
"77:D3:03:67:B5:E0:0C:15:F6:0C:38:61:DF:7C:E1:3B:92:46:4D:47",
"F3:73:B3:87:06:5A:28:84:8A:F2:F3:4A:CE:19:2B:DD:C7:8E:9C:AC",
@@ -88,6 +95,7 @@
"FA:B7:EE:36:97:26:62:FB:2D:B0:2A:F6:BF:03:FD:E8:7C:4B:2F:9B",
"C3:19:7C:39:24:E6:54:AF:1B:C4:AB:20:95:7A:E2:C3:0E:13:02:6A",
"9F:74:4E:9F:2B:4D:BA:EC:0F:31:2C:50:B6:56:3B:8E:2D:93:C3:11",
+ "6D:0A:5F:F7:B4:23:06:B4:85:B3:B7:97:64:FC:AC:75:F5:33:F2:93",
"A1:4B:48:D9:43:EE:0A:0E:40:90:4F:3C:E0:A4:C0:91:93:51:5D:3F",
"E2:B8:29:4B:55:84:AB:6B:58:C2:90:46:6C:AC:3F:B8:39:8F:84:83",
"1F:49:14:F7:D8:74:95:1D:DD:AE:02:C0:BE:FD:3A:2D:82:75:51:85",
@@ -97,11 +105,11 @@
"73:A5:E6:4A:3B:FF:83:16:FF:0E:DC:CC:61:8A:90:6E:4E:AE:4D:74",
"07:E0:32:E0:20:B7:2C:3F:19:2F:06:28:A2:59:3A:19:A7:0F:06:9E",
"80:94:64:0E:B5:A7:A1:CA:11:9C:1F:DD:D5:9F:81:02:63:A7:FB:D1",
+ "63:CF:B6:C1:27:2B:56:E4:88:8E:1C:23:9A:B6:2E:81:47:24:C3:C7",
"84:1A:69:FB:F5:CD:1A:25:34:13:3D:E3:F8:FC:B8:99:D0:C9:14:B7",
"E7:F3:A3:C8:CF:6F:C3:04:2E:6D:0E:67:32:C5:9E:68:95:0D:5E:D2",
"67:65:0D:F1:7E:8E:7E:5B:82:40:A4:F4:56:4B:CF:E2:3D:69:C6:F0",
"DD:FB:16:CD:49:31:C9:73:A2:03:7D:3F:C8:3A:4D:7D:77:5D:05:E4",
- "36:B1:2B:49:F9:81:9E:D7:4C:9E:BC:38:0F:C6:56:8F:5D:AC:B2:F7",
"61:DB:8C:21:59:69:03:90:D8:7C:9C:12:86:54:CF:9D:3D:F4:DD:07",
"E2:52:FA:95:3F:ED:DB:24:60:BD:6E:28:F3:9C:CC:CF:5E:B3:3F:DE",
"26:F9:93:B4:ED:3D:28:27:B0:B9:4B:A7:E9:15:1D:A3:8D:92:E5:32",
@@ -126,10 +134,10 @@
"B8:0E:26:A9:BF:D2:B2:3B:C0:EF:46:C9:BA:C7:BB:F6:1D:0D:41:41",
"DF:3C:24:F9:BF:D6:66:76:1B:26:80:73:FE:06:D1:CC:8D:4F:82:A4",
"D3:DD:48:3E:2B:BF:4C:05:E8:AF:10:F5:FA:76:26:CF:D3:DC:30:92",
+ "9F:5F:D9:1A:54:6D:F5:0C:71:F0:EE:7A:BD:17:49:98:84:73:E2:39",
"B8:23:6B:00:2F:1D:16:86:53:01:55:6C:11:A4:37:CA:EB:FF:C3:BB",
"87:82:C6:C3:04:35:3B:CF:D2:96:92:D2:59:3E:7D:44:D9:34:FF:11",
"59:0D:2D:7D:88:4F:40:2E:61:7E:A5:62:32:17:65:CF:17:D8:94:E9",
- "AE:C5:FB:3F:C8:E1:BF:C4:E5:4F:03:07:5A:9A:E8:00:B7:F7:B6:FA",
"0B:BE:C2:27:22:49:CB:39:AA:DB:35:5C:53:E3:8C:AE:78:FF:B6:FE",
"DF:71:7E:AA:4A:D9:4E:C9:55:84:99:60:2D:48:DE:5F:BC:F0:3A:25",
"8F:6B:F2:A9:27:4A:DA:14:A0:C4:F4:8E:61:27:F9:C0:1E:78:5D:D1",
@@ -143,10 +151,12 @@
"E7:2E:F1:DF:FC:B2:09:28:CF:5D:D4:D5:67:37:B1:51:CB:86:4F:01",
"01:0C:06:95:A6:98:19:14:FF:BF:5F:C6:B0:B6:95:EA:29:E9:12:A6",
"0F:F9:40:76:18:D3:D7:6A:4B:98:F0:A8:35:9E:0C:FD:27:AC:CC:ED",
+ "AD:98:F9:F3:E4:7D:75:3B:65:D4:82:B3:A4:52:17:BB:6E:F5:E4:38",
"CF:E9:70:84:0F:E0:73:0F:9D:F6:0C:7F:2C:4B:EE:20:46:34:9C:BB",
"48:12:BD:92:3C:A8:C4:39:06:E7:30:6D:27:96:E6:A4:CF:22:2E:7D",
"F9:B5:B6:32:45:5F:9C:BE:EC:57:5F:80:DC:E9:6E:2C:C7:B2:78:B7",
"39:B4:6C:D5:FE:80:06:EB:E2:2F:4A:BB:08:33:A0:AF:DB:B9:DD:84",
+ "EA:B0:E2:52:1B:89:93:4C:11:68:F2:D8:9A:AC:22:4C:A3:8A:57:AE",
"89:DF:74:FE:5C:F4:0F:4A:80:F9:E3:37:7D:54:DA:91:E1:01:31:8E",
"7E:04:DE:89:6A:3E:66:6D:00:E6:87:D3:3F:FA:D9:3B:E8:3D:34:9E",
"2F:8F:36:4F:E1:58:97:44:21:59:87:A5:2A:9A:D0:69:95:26:7F:B5",
diff --git a/tests/tests/security/testeffect/Android.bp b/tests/tests/security/testeffect/Android.bp
index 381a57b..597d6b8 100644
--- a/tests/tests/security/testeffect/Android.bp
+++ b/tests/tests/security/testeffect/Android.bp
@@ -14,6 +14,7 @@
// Test effect library
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/sensorprivacy/Android.bp b/tests/tests/sensorprivacy/Android.bp
index 486bac6..6f0bf18 100644
--- a/tests/tests/sensorprivacy/Android.bp
+++ b/tests/tests/sensorprivacy/Android.bp
@@ -14,8 +14,8 @@
// limitations under the License.
//
-
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/sensorprivacy/src/android/sensorprivacy/cts/SensorPrivacyBaseTest.kt b/tests/tests/sensorprivacy/src/android/sensorprivacy/cts/SensorPrivacyBaseTest.kt
index 991ba44..0b96ed3 100644
--- a/tests/tests/sensorprivacy/src/android/sensorprivacy/cts/SensorPrivacyBaseTest.kt
+++ b/tests/tests/sensorprivacy/src/android/sensorprivacy/cts/SensorPrivacyBaseTest.kt
@@ -39,6 +39,7 @@
import androidx.test.uiautomator.UiDevice
import com.android.compatibility.common.util.SystemUtil.callWithShellPermissionIdentity
import com.android.compatibility.common.util.SystemUtil.eventually
+import com.android.compatibility.common.util.SystemUtil.getEventually
import com.android.compatibility.common.util.SystemUtil.runShellCommandOrThrow
import com.android.compatibility.common.util.SystemUtil.runWithShellPermissionIdentity
import com.android.compatibility.common.util.UiAutomatorUtils
@@ -53,7 +54,8 @@
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
-import org.junit.Assume
+import org.junit.Assume.assumeFalse
+import org.junit.Assume.assumeTrue
import org.junit.Before
import org.junit.Test
@@ -327,14 +329,13 @@
@AppModeFull(reason = "Instant apps can't manage keyguard")
fun testCantChangeWhenLocked() {
assumeSensorToggleSupport()
- Assume.assumeTrue(packageManager
- .hasSystemFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN))
+ assumeTrue(packageManager.hasSystemFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN))
// TODO use actual test api when it can be added
-// Assume.assumeTrue(callWithShellPermissionIdentity { spm.requiresAuthentication() })
+// assumeTrue(callWithShellPermissionIdentity { spm.requiresAuthentication() })
val packageContext: Context = context.createPackageContext("android", 0)
try {
- Assume.assumeTrue(packageContext.resources.getBoolean(packageContext.resources
+ assumeTrue(packageContext.resources.getBoolean(packageContext.resources
.getIdentifier("config_sensorPrivacyRequiresAuthentication", "bool", "android"))
)
} catch (e: NotFoundException) {
@@ -500,15 +501,15 @@
@Test
@AppModeFull(reason = "Uses secondary app, instant apps have no visibility")
fun testCantEnablePrivacyIfNotSupported() {
- Assume.assumeFalse(spm.supportsSensorToggle(sensor))
- Assume.assumeFalse(spm.supportsSensorToggle(TOGGLE_TYPE_SOFTWARE, sensor))
+ assumeFalse(spm.supportsSensorToggle(sensor))
+ assumeFalse(spm.supportsSensorToggle(TOGGLE_TYPE_SOFTWARE, sensor))
setSensor(true)
assertFalse(isSensorPrivacyEnabled())
}
private fun assumeSensorToggleSupport() {
- Assume.assumeTrue(spm.supportsSensorToggle(sensor))
- Assume.assumeTrue(spm.supportsSensorToggle(TOGGLE_TYPE_SOFTWARE, sensor))
+ assumeTrue(spm.supportsSensorToggle(sensor))
+ assumeTrue(spm.supportsSensorToggle(TOGGLE_TYPE_SOFTWARE, sensor))
}
private fun startTestApp() {
@@ -645,16 +646,16 @@
runWithShellPermissionIdentity {
assertTrue(km.setLock(KeyguardManager.PIN, pin, KeyguardManager.PIN, null))
}
- eventually {
+ getEventually {
uiDevice.pressKeyCode(KeyEvent.KEYCODE_SLEEP)
- assertFalse("Device never slept.", pm.isInteractive)
+ assumeFalse("Device never slept.", pm.isInteractive)
}
- eventually {
+ getEventually {
uiDevice.pressKeyCode(KeyEvent.KEYCODE_WAKEUP)
- assertTrue("Device never woke up.", pm.isInteractive)
+ assumeTrue("Device never woke up.", pm.isInteractive)
}
- eventually {
- assertTrue("Device isn't locked", km.isDeviceLocked)
+ getEventually {
+ assumeTrue("Device isn't locked", km.isDeviceLocked)
}
r.invoke()
@@ -664,17 +665,17 @@
}
// Recycle the screen power in case the keyguard is stuck open
- eventually {
+ getEventually {
uiDevice.pressKeyCode(KeyEvent.KEYCODE_SLEEP)
- assertFalse("Device never slept.", pm.isInteractive)
+ assumeFalse("Device never slept.", pm.isInteractive)
}
- eventually {
+ getEventually {
uiDevice.pressKeyCode(KeyEvent.KEYCODE_WAKEUP)
- assertTrue("Device never woke up.", pm.isInteractive)
+ assumeTrue("Device never woke up.", pm.isInteractive)
}
- eventually {
- assertFalse("Device isn't unlocked", km.isDeviceLocked)
+ getEventually {
+ assumeFalse("Device isn't unlocked", km.isDeviceLocked)
}
}
}
diff --git a/tests/tests/sensorprivacy/test-apps/CtsUseMicOrCameraAndOverlayForSensorPrivacy/Android.bp b/tests/tests/sensorprivacy/test-apps/CtsUseMicOrCameraAndOverlayForSensorPrivacy/Android.bp
index e180e45..3b6cae6 100644
--- a/tests/tests/sensorprivacy/test-apps/CtsUseMicOrCameraAndOverlayForSensorPrivacy/Android.bp
+++ b/tests/tests/sensorprivacy/test-apps/CtsUseMicOrCameraAndOverlayForSensorPrivacy/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/sensorprivacy/test-apps/CtsUseMicOrCameraForSensorPrivacy/Android.bp b/tests/tests/sensorprivacy/test-apps/CtsUseMicOrCameraForSensorPrivacy/Android.bp
index 585da24..e915092 100644
--- a/tests/tests/sensorprivacy/test-apps/CtsUseMicOrCameraForSensorPrivacy/Android.bp
+++ b/tests/tests/sensorprivacy/test-apps/CtsUseMicOrCameraForSensorPrivacy/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/sensorprivacy/test-apps/utils/Android.bp b/tests/tests/sensorprivacy/test-apps/utils/Android.bp
index 9076d22..3104d3f01 100644
--- a/tests/tests/sensorprivacy/test-apps/utils/Android.bp
+++ b/tests/tests/sensorprivacy/test-apps/utils/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_permissions",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -7,7 +8,7 @@
srcs: [
"src/**/*.java",
- "src/**/*.kt"
+ "src/**/*.kt",
],
static_libs: [
diff --git a/tests/tests/settings/Android.bp b/tests/tests/settings/Android.bp
index ecd5637..e9d221d 100644
--- a/tests/tests/settings/Android.bp
+++ b/tests/tests/settings/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_settings_app",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/settings/src/android/settings/cts/SettingsMultiPaneDeepLinkTest.java b/tests/tests/settings/src/android/settings/cts/SettingsMultiPaneDeepLinkTest.java
index c90b885..263920c 100644
--- a/tests/tests/settings/src/android/settings/cts/SettingsMultiPaneDeepLinkTest.java
+++ b/tests/tests/settings/src/android/settings/cts/SettingsMultiPaneDeepLinkTest.java
@@ -64,7 +64,7 @@
boolean isFlagEnabled =
FeatureFlagUtils.isEnabled(targetContext, "settings_support_large_screen");
final boolean shouldEnableLargeScreenOptimization =
- SystemProperties.getBoolean("persist.settings.large_screen_opt.enabled", true);
+ SystemProperties.getBoolean("persist.settings.large_screen_opt.enabled", false);
boolean isSplitSupported = SplitController.getInstance(targetContext)
.getSplitSupportStatus() == SplitController.SplitSupportStatus.SPLIT_AVAILABLE;
mIsSplitSupported = isFlagEnabled && isSplitSupported
diff --git a/tests/tests/sharesheet/Android.bp b/tests/tests/sharesheet/Android.bp
index 92e8c6e..6046cdb 100644
--- a/tests/tests/sharesheet/Android.bp
+++ b/tests/tests/sharesheet/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_system_ui_please_use_a_more_specific_subteam_if_possible_",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/sharesheet/OWNERS b/tests/tests/sharesheet/OWNERS
index 00c4b94..5d0cbcf 100644
--- a/tests/tests/sharesheet/OWNERS
+++ b/tests/tests/sharesheet/OWNERS
@@ -3,5 +3,4 @@
joshtrask@google.com
mrenouf@google.com
mrcasey@google.com
-digman@google.com
-file:platform/frameworks/base:/packages/SystemUI/OWNERS
\ No newline at end of file
+file:platform/frameworks/base:/packages/SystemUI/OWNERS
diff --git a/tests/tests/sharesheet/packages/Android.bp b/tests/tests/sharesheet/packages/Android.bp
index 1ff4003..ccf86cc 100644
--- a/tests/tests/sharesheet/packages/Android.bp
+++ b/tests/tests/sharesheet/packages/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_system_ui_please_use_a_more_specific_subteam_if_possible_",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/soundtrigger/Android.bp b/tests/tests/soundtrigger/Android.bp
index 41649a1..036e2c6 100644
--- a/tests/tests/soundtrigger/Android.bp
+++ b/tests/tests/soundtrigger/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_audio_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/systemui/AndroidManifest.xml b/tests/tests/systemui/AndroidManifest.xml
index 3bcb78e..6fbb682 100644
--- a/tests/tests/systemui/AndroidManifest.xml
+++ b/tests/tests/systemui/AndroidManifest.xml
@@ -39,7 +39,6 @@
android:screenOrientation="portrait"/>
<activity android:name=".WindowInsetsActivity"
android:theme="@android:style/Theme.Material"
- android:screenOrientation="portrait"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
diff --git a/tests/tests/systemui/OWNERS b/tests/tests/systemui/OWNERS
index 660f0b1..a8ac90d 100644
--- a/tests/tests/systemui/OWNERS
+++ b/tests/tests/systemui/OWNERS
@@ -3,7 +3,6 @@
felkachang@google.com
# Owners of the pip tests on atv:
rgl@google.com
-sergeynv@google.com
galinap@google.com
# Owners of sysui/wmshell/insets tests:
lbill@google.com
diff --git a/tests/tests/systemui/src/android/systemui/cts/WindowInsetsBehaviorTests.java b/tests/tests/systemui/src/android/systemui/cts/WindowInsetsBehaviorTests.java
index 681d948..10e63597c 100644
--- a/tests/tests/systemui/src/android/systemui/cts/WindowInsetsBehaviorTests.java
+++ b/tests/tests/systemui/src/android/systemui/cts/WindowInsetsBehaviorTests.java
@@ -25,6 +25,8 @@
import static android.view.View.SYSTEM_UI_FLAG_FULLSCREEN;
import static android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
import static android.view.View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
+import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
+import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
import static android.view.View.SYSTEM_UI_FLAG_VISIBLE;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
@@ -760,7 +762,8 @@
final int swipeCount = 2;
final boolean insideLimit = true;
testSystemGestureExclusionLimit(swipeCount, insideLimit, SYSTEM_UI_FLAG_IMMERSIVE_STICKY
- | SYSTEM_UI_FLAG_FULLSCREEN | SYSTEM_UI_FLAG_HIDE_NAVIGATION);
+ | SYSTEM_UI_FLAG_FULLSCREEN | SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ | SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
assertEquals("Swipe must not be canceled.", 0, mActionCancelPoints.size());
assertEquals("Action up points.", swipeCount, mActionUpPoints.size());
@@ -775,7 +778,8 @@
final int swipeCount = 2;
final boolean insideLimit = false;
testSystemGestureExclusionLimit(swipeCount, insideLimit, SYSTEM_UI_FLAG_IMMERSIVE_STICKY
- | SYSTEM_UI_FLAG_FULLSCREEN | SYSTEM_UI_FLAG_HIDE_NAVIGATION);
+ | SYSTEM_UI_FLAG_FULLSCREEN | SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ | SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
assertEquals("Swipe must not be canceled.", 0, mActionCancelPoints.size());
assertEquals("Action up points.", swipeCount, mActionUpPoints.size());
diff --git a/tests/tests/taskfpscallback/Android.bp b/tests/tests/taskfpscallback/Android.bp
index f4b6b32..f964aee 100644
--- a/tests/tests/taskfpscallback/Android.bp
+++ b/tests/tests/taskfpscallback/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_games",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom-apps/OWNERS b/tests/tests/telecom-apps/OWNERS
new file mode 100644
index 0000000..f4921e0
--- /dev/null
+++ b/tests/tests/telecom-apps/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 20868
+include ../telephony/OWNERS
diff --git a/tests/tests/telecom/Android.bp b/tests/tests/telecom/Android.bp
index 7038455..b02c4fd 100644
--- a/tests/tests/telecom/Android.bp
+++ b/tests/tests/telecom/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/Api29InCallServiceTestApp/Android.bp b/tests/tests/telecom/Api29InCallServiceTestApp/Android.bp
index 0baaeb2..8fad921 100644
--- a/tests/tests/telecom/Api29InCallServiceTestApp/Android.bp
+++ b/tests/tests/telecom/Api29InCallServiceTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/CallRedirectionServiceTestApp/Android.bp b/tests/tests/telecom/CallRedirectionServiceTestApp/Android.bp
index 413066a..3e08c58 100644
--- a/tests/tests/telecom/CallRedirectionServiceTestApp/Android.bp
+++ b/tests/tests/telecom/CallRedirectionServiceTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/CallScreeningServiceTestApp/Android.bp b/tests/tests/telecom/CallScreeningServiceTestApp/Android.bp
index 878eddd..b738d64 100644
--- a/tests/tests/telecom/CallScreeningServiceTestApp/Android.bp
+++ b/tests/tests/telecom/CallScreeningServiceTestApp/Android.bp
@@ -18,6 +18,7 @@
// associated with the CTS InCallService.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/CallStreamingServiceTestApp/Android.bp b/tests/tests/telecom/CallStreamingServiceTestApp/Android.bp
index 941f322..d1a680e 100644
--- a/tests/tests/telecom/CallStreamingServiceTestApp/Android.bp
+++ b/tests/tests/telecom/CallStreamingServiceTestApp/Android.bp
@@ -18,6 +18,7 @@
// impacting the CTS runner.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/CarModeTestApp/Android.bp b/tests/tests/telecom/CarModeTestApp/Android.bp
index 9483bde..764abae 100644
--- a/tests/tests/telecom/CarModeTestApp/Android.bp
+++ b/tests/tests/telecom/CarModeTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/CarModeTestAppSelfManaged/Android.bp b/tests/tests/telecom/CarModeTestAppSelfManaged/Android.bp
index edc9f63..b8aee07 100644
--- a/tests/tests/telecom/CarModeTestAppSelfManaged/Android.bp
+++ b/tests/tests/telecom/CarModeTestAppSelfManaged/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/CarModeTestAppTwo/Android.bp b/tests/tests/telecom/CarModeTestAppTwo/Android.bp
index 55abd0b..8d5f5b9 100644
--- a/tests/tests/telecom/CarModeTestAppTwo/Android.bp
+++ b/tests/tests/telecom/CarModeTestAppTwo/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/SelfManagedCSTestAppOne/Android.bp b/tests/tests/telecom/SelfManagedCSTestAppOne/Android.bp
index 7eb6fb3..3a80937 100644
--- a/tests/tests/telecom/SelfManagedCSTestAppOne/Android.bp
+++ b/tests/tests/telecom/SelfManagedCSTestAppOne/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/ThirdPtyDialerTestApp/Android.bp b/tests/tests/telecom/ThirdPtyDialerTestApp/Android.bp
index 9bdf9cc..c4590a7 100644
--- a/tests/tests/telecom/ThirdPtyDialerTestApp/Android.bp
+++ b/tests/tests/telecom/ThirdPtyDialerTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/ThirdPtyDialerTestAppTwo/Android.bp b/tests/tests/telecom/ThirdPtyDialerTestAppTwo/Android.bp
index c99ef76..6eac3e0 100644
--- a/tests/tests/telecom/ThirdPtyDialerTestAppTwo/Android.bp
+++ b/tests/tests/telecom/ThirdPtyDialerTestAppTwo/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/ThirdPtyInCallServiceTestApp/Android.bp b/tests/tests/telecom/ThirdPtyInCallServiceTestApp/Android.bp
index 363b4ab..8504695 100644
--- a/tests/tests/telecom/ThirdPtyInCallServiceTestApp/Android.bp
+++ b/tests/tests/telecom/ThirdPtyInCallServiceTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom/src/android/telecom/cts/EmergencyCallOnSimCallManagerTest.java b/tests/tests/telecom/src/android/telecom/cts/EmergencyCallOnSimCallManagerTest.java
index 5cc1f70..f29612a 100644
--- a/tests/tests/telecom/src/android/telecom/cts/EmergencyCallOnSimCallManagerTest.java
+++ b/tests/tests/telecom/src/android/telecom/cts/EmergencyCallOnSimCallManagerTest.java
@@ -58,7 +58,8 @@
TEST_SIM_CALL_MANAGER_PHONE_ACCOUNT_HANDLE, ACCOUNT_LABEL)
.setAddress(Uri.parse("tel:555-TEST"))
.setSubscriptionAddress(Uri.parse("tel:555-TEST"))
- .setCapabilities(PhoneAccount.CAPABILITY_CONNECTION_MANAGER)
+ .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER
+ | PhoneAccount.CAPABILITY_CONNECTION_MANAGER)
.setHighlightColor(Color.RED)
.setShortDescription(ACCOUNT_LABEL)
.setSupportedUriSchemes(Arrays.asList("tel"))
diff --git a/tests/tests/telecom/src/android/telecom/cts/TelecomAvailabilityTest.java b/tests/tests/telecom/src/android/telecom/cts/TelecomAvailabilityTest.java
index d218da9c..02e723e 100644
--- a/tests/tests/telecom/src/android/telecom/cts/TelecomAvailabilityTest.java
+++ b/tests/tests/telecom/src/android/telecom/cts/TelecomAvailabilityTest.java
@@ -17,6 +17,7 @@
package android.telecom.cts;
import static android.telecom.cts.TestUtils.shouldTestTelecom;
+import static android.telecom.cts.TestUtils.hasTelephonyFeature;
import android.content.Context;
import android.content.Intent;
@@ -26,6 +27,7 @@
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.telecom.TelecomManager;
+import android.telephony.TelephonyManager;
import android.test.InstrumentationTestCase;
import android.util.Log;
@@ -121,7 +123,10 @@
* Tests that TelecomManager always creates resolvable/actionable emergency dialer intent.
*/
public void testCreateLaunchEmergencyDialerIntent() {
- if (!shouldTestTelecom(mContext)) {
+ TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class);
+ if (!shouldTestTelecom(mContext)
+ || !hasTelephonyFeature(mContext)
+ || !telephonyManager.isVoiceCapable()) {
return;
}
final TelecomManager telecomManager = mContext.getSystemService(TelecomManager.class);
diff --git a/tests/tests/telecom2/Android.bp b/tests/tests/telecom2/Android.bp
index c86b7ae..4da288e 100644
--- a/tests/tests/telecom2/Android.bp
+++ b/tests/tests/telecom2/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telecom3/Android.bp b/tests/tests/telecom3/Android.bp
index 84bcd1b..4b5c00d 100644
--- a/tests/tests/telecom3/Android.bp
+++ b/tests/tests/telecom3/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony/OWNERS b/tests/tests/telephony/OWNERS
index 060c9c6..fa5edce 100644
--- a/tests/tests/telephony/OWNERS
+++ b/tests/tests/telephony/OWNERS
@@ -18,4 +18,4 @@
pmadapurmath@google.com
# Domain Selection code is co-owned, adding additional owners for this code
-per-file *DomainSelection*=hwangoo@google.com,forestchoi@google.com,avinashmp@google.com,mkoon@google.com,seheele@google.com
+per-file *DomainSelection*=hwangoo@google.com,forestchoi@google.com,avinashmp@google.com,mkoon@google.com,seheele@google.com,jdyou@google.com
diff --git a/tests/tests/telephony/TestFinancialSmsApp/Android.bp b/tests/tests/telephony/TestFinancialSmsApp/Android.bp
index 4957a53..d5e5392 100644
--- a/tests/tests/telephony/TestFinancialSmsApp/Android.bp
+++ b/tests/tests/telephony/TestFinancialSmsApp/Android.bp
@@ -13,13 +13,17 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
android_test {
name: "TestFinancialSmsApp",
- srcs: ["src/**/*.kt", "src/**/*.java"],
+ srcs: [
+ "src/**/*.kt",
+ "src/**/*.java",
+ ],
static_libs: [
"compatibility-device-util-axt",
diff --git a/tests/tests/telephony/TestSmsApp/Android.bp b/tests/tests/telephony/TestSmsApp/Android.bp
index 694d835..a0a3da1 100644
--- a/tests/tests/telephony/TestSmsApp/Android.bp
+++ b/tests/tests/telephony/TestSmsApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -20,7 +21,10 @@
name: "TestSmsApp",
sdk_version: "test_current",
- srcs: ["src/**/*.kt", "src/**/*.java"],
+ srcs: [
+ "src/**/*.kt",
+ "src/**/*.java",
+ ],
static_libs: [
"compatibility-device-util-axt",
diff --git a/tests/tests/telephony/TestSmsApp22/Android.bp b/tests/tests/telephony/TestSmsApp22/Android.bp
index 95a0872..7d7a2ac 100644
--- a/tests/tests/telephony/TestSmsApp22/Android.bp
+++ b/tests/tests/telephony/TestSmsApp22/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -20,7 +21,10 @@
name: "TestSmsApp22",
sdk_version: "test_current",
- srcs: ["src/**/*.kt", "src/**/*.java"],
+ srcs: [
+ "src/**/*.kt",
+ "src/**/*.java",
+ ],
static_libs: [
"compatibility-device-util-axt",
diff --git a/tests/tests/telephony/TestSmsRetrieverApp/Android.bp b/tests/tests/telephony/TestSmsRetrieverApp/Android.bp
index 2498bea..09565cc 100644
--- a/tests/tests/telephony/TestSmsRetrieverApp/Android.bp
+++ b/tests/tests/telephony/TestSmsRetrieverApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony/current/Android.bp b/tests/tests/telephony/current/Android.bp
index 8c24f87..a615edd 100644
--- a/tests/tests/telephony/current/Android.bp
+++ b/tests/tests/telephony/current/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony/current/EmbmsMiddlewareTestApp/Android.bp b/tests/tests/telephony/current/EmbmsMiddlewareTestApp/Android.bp
index b112018..3e438a3 100644
--- a/tests/tests/telephony/current/EmbmsMiddlewareTestApp/Android.bp
+++ b/tests/tests/telephony/current/EmbmsMiddlewareTestApp/Android.bp
@@ -15,6 +15,7 @@
// Build the Sample Embms Services
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony/current/LocationAccessingApp/Android.bp b/tests/tests/telephony/current/LocationAccessingApp/Android.bp
index 1807b4f..8a55af6 100644
--- a/tests/tests/telephony/current/LocationAccessingApp/Android.bp
+++ b/tests/tests/telephony/current/LocationAccessingApp/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony/current/LocationAccessingApp/sdk28/Android.bp b/tests/tests/telephony/current/LocationAccessingApp/sdk28/Android.bp
index 1bb3967..6311bcf 100644
--- a/tests/tests/telephony/current/LocationAccessingApp/sdk28/Android.bp
+++ b/tests/tests/telephony/current/LocationAccessingApp/sdk28/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony/current/TestExternalImsServiceApp/Android.bp b/tests/tests/telephony/current/TestExternalImsServiceApp/Android.bp
index 273f358..2b71b7c 100644
--- a/tests/tests/telephony/current/TestExternalImsServiceApp/Android.bp
+++ b/tests/tests/telephony/current/TestExternalImsServiceApp/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -8,11 +9,11 @@
srcs: [
"src/**/*.java",
"aidl/**/I*.aidl",
- ":telephony-cts-ims-common-srcs"
+ ":telephony-cts-ims-common-srcs",
],
static_libs: [
- "compatibility-device-util-axt",
- ],
+ "compatibility-device-util-axt",
+ ],
aidl: {
local_include_dirs: ["aidl/"],
},
@@ -24,5 +25,5 @@
"cts",
"general-tests",
"mts",
- ]
+ ],
}
diff --git a/tests/tests/telephony/current/mockmodem/Android.bp b/tests/tests/telephony/current/mockmodem/Android.bp
index baa4808..5805882 100644
--- a/tests/tests/telephony/current/mockmodem/Android.bp
+++ b/tests/tests/telephony/current/mockmodem/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony/current/mockmodem/src/android/telephony/mockmodem/MockModemServiceConnector.java b/tests/tests/telephony/current/mockmodem/src/android/telephony/mockmodem/MockModemServiceConnector.java
index aa0b3d1..8ee4a20 100644
--- a/tests/tests/telephony/current/mockmodem/src/android/telephony/mockmodem/MockModemServiceConnector.java
+++ b/tests/tests/telephony/current/mockmodem/src/android/telephony/mockmodem/MockModemServiceConnector.java
@@ -41,7 +41,7 @@
private static final String COMMAND_MODEM_SERVICE_UNKNOWN = "unknown";
private static final String COMMAND_MODEM_SERVICE_DEFAULT = "default";
- private static final int BIND_LOCAL_MOCKMODEM_SERVICE_TIMEOUT_MS = 5000;
+ private static final int BIND_LOCAL_MOCKMODEM_SERVICE_TIMEOUT_MS = 25000;
private static final int BIND_RADIO_INTERFACE_READY_TIMEOUT_MS = 5000;
private class MockModemServiceConnection implements ServiceConnection {
diff --git a/tests/tests/telephony/current/preconditions/Android.bp b/tests/tests/telephony/current/preconditions/Android.bp
index bf62f00..9ba68e5 100644
--- a/tests/tests/telephony/current/preconditions/Android.bp
+++ b/tests/tests/telephony/current/preconditions/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony/current/preconditions/cleanerApp/Android.bp b/tests/tests/telephony/current/preconditions/cleanerApp/Android.bp
index 80ef668..9de9bbe 100644
--- a/tests/tests/telephony/current/preconditions/cleanerApp/Android.bp
+++ b/tests/tests/telephony/current/preconditions/cleanerApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony/current/preconditions/preparerApp/Android.bp b/tests/tests/telephony/current/preconditions/preparerApp/Android.bp
index 813802e..4d80936 100644
--- a/tests/tests/telephony/current/preconditions/preparerApp/Android.bp
+++ b/tests/tests/telephony/current/preconditions/preparerApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java b/tests/tests/telephony/current/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java
index af4d164..7f21492 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java
@@ -68,6 +68,10 @@
new ShortCodeTest("al", "55600", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("al", "654321", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ae", "625315", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ae", "6211", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("ae", "6253", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("am", "112", expectedReturnCode("112")),
new ShortCodeTest("am", "101", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("am", "102", SMS_CATEGORY_FREE_SHORT_CODE),
@@ -153,6 +157,14 @@
new ShortCodeTest("cn", "1065123456", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("cn", "1066335588", SMS_CATEGORY_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("co", "4912891", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("co", "491272", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("co", "491289", SMS_CATEGORY_FREE_SHORT_CODE),
+
+ new ShortCodeTest("cr", "4664537", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("cr", "466458", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("cr", "466453", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("cy", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("cy", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("cy", "4321", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
@@ -193,6 +205,14 @@
new ShortCodeTest("dk", "16123", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
new ShortCodeTest("dk", "987654321", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("do", "9128922", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("do", "912898", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("do", "912892", SMS_CATEGORY_FREE_SHORT_CODE),
+
+ new ShortCodeTest("ec", "4664534", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ec", "466499", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("ec", "466453", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("ee", "112", expectedReturnCode("112")),
new ShortCodeTest("ee", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("ee", "123", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
@@ -227,6 +247,7 @@
new ShortCodeTest("fr", "45678", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("fr", "81185", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("fr", "87654321", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("fr", "33033", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("gb", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("gb", "999", SMS_CATEGORY_NOT_SHORT_CODE),
@@ -254,6 +275,10 @@
new ShortCodeTest("gr", "19678", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
new ShortCodeTest("gr", "87654321", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("gt", "4664548", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("gt", "466459", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("gt", "466453", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("hu", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("hu", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("hu", "012", SMS_CATEGORY_NOT_SHORT_CODE),
@@ -269,6 +294,10 @@
new ShortCodeTest("hu", "2345678901", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("hu", "01234567890", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("hn", "4664599", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("hn", "466499", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("hn", "466453", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("ie", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("ie", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("ie", "50123", SMS_CATEGORY_FREE_SHORT_CODE),
@@ -282,7 +311,13 @@
new ShortCodeTest("il", "5432", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
new ShortCodeTest("il", "4422", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("il", "4545", SMS_CATEGORY_PREMIUM_SHORT_CODE),
- new ShortCodeTest("il", "98765", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("il", "987651", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("il", "374771", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("il", "37499", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("il", "37477", SMS_CATEGORY_FREE_SHORT_CODE),
+ new ShortCodeTest("il", "668191", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("il", "6688", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("il", "6681", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("it", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("it", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
@@ -316,6 +351,17 @@
new ShortCodeTest("kz", "7790", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("kz", "98765", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ke", "240889", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ke", "24099", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("ke", "24088", SMS_CATEGORY_FREE_SHORT_CODE),
+ new ShortCodeTest("ke", "230549", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ke", "23059", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("ke", "23054", SMS_CATEGORY_FREE_SHORT_CODE),
+
+ new ShortCodeTest("kw", "509761", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("kw", "50979", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("kw", "50976", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("lt", "112", expectedReturnCode("112")),
new ShortCodeTest("lt", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("lt", "123", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
@@ -341,11 +387,22 @@
new ShortCodeTest("lv", "1874", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("lv", "98765", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ma", "538191", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ma", "53899", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("ma", "53819", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("mx", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("mx", "2345", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
new ShortCodeTest("mx", "7766", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("mx", "23456", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
new ShortCodeTest("mx", "53035", SMS_CATEGORY_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("mx", "5503461", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("mx", "550399", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("mx", "550346", SMS_CATEGORY_FREE_SHORT_CODE),
+
+ new ShortCodeTest("mw", "427611", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("mw", "4279", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("mw", "4276", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("my", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("my", "1234", SMS_CATEGORY_NOT_SHORT_CODE),
@@ -354,6 +411,18 @@
new ShortCodeTest("my", "33776", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("my", "345678", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("mz", "171491", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("mz", "1715", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("mz", "1714", SMS_CATEGORY_FREE_SHORT_CODE),
+
+ new ShortCodeTest("na", "400059", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("na", "40009", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("na", "40005", SMS_CATEGORY_FREE_SHORT_CODE),
+
+ new ShortCodeTest("ni", "4664599", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ni", "466499", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("ni", "466453", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("nl", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("nl", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("nl", "1234", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
@@ -376,6 +445,14 @@
new ShortCodeTest("nz", "8995", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("nz", "23456", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("pe", "3013031", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("pe", "301307", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("pe", "301303", SMS_CATEGORY_FREE_SHORT_CODE),
+
+ new ShortCodeTest("pk", "909234", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("pk", "90958", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("pk", "9092", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("pl", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("pl", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("pl", "7890", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
@@ -386,6 +463,10 @@
new ShortCodeTest("pl", "92525", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("pl", "87654321", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ps", "662134", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ps", "6691", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("ps", "6681", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("pt", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("pt", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("pt", "61000", SMS_CATEGORY_PREMIUM_SHORT_CODE),
@@ -434,6 +515,10 @@
new ShortCodeTest("si", "3838", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("si", "72999", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("sn", "212159", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("sn", "21299", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("sn", "21215", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("sk", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("sk", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("sk", "1234", SMS_CATEGORY_PREMIUM_SHORT_CODE),
@@ -441,6 +526,10 @@
new ShortCodeTest("sk", "7604", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("sk", "72999", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("sv", "4664599", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("sv", "466499", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("sv", "466453", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("tj", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("tj", "5432", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
new ShortCodeTest("tj", "1161", SMS_CATEGORY_PREMIUM_SHORT_CODE),
@@ -449,6 +538,13 @@
new ShortCodeTest("tj", "4449", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("tj", "98765", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("tz", "150467", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("tz", "15049", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("tz", "15046", SMS_CATEGORY_FREE_SHORT_CODE),
+ new ShortCodeTest("tz", "152347", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("tz", "15239", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("tz", "15234", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("ua", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("ua", "5432", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
new ShortCodeTest("ua", "4448", SMS_CATEGORY_PREMIUM_SHORT_CODE),
@@ -456,6 +552,10 @@
new ShortCodeTest("ua", "7540", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("ua", "98765", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ug", "800999", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ug", "8099", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("ug", "8000", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("us", "911", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("us", "+18005551234", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("us", "8005551234", SMS_CATEGORY_NOT_SHORT_CODE),
@@ -466,6 +566,13 @@
new ShortCodeTest("us", "21472", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("us", "23333", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("us", "99807", SMS_CATEGORY_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("us", "9683999", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("us", "968319", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("us", "96831", SMS_CATEGORY_FREE_SHORT_CODE),
+
+ new ShortCodeTest("zw", "336791", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("zw", "33642", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("zw", "33679", SMS_CATEGORY_FREE_SHORT_CODE),
// generic rules for other countries: 5 digits or less considered potential short code
new ShortCodeTest("zz", "2000000", SMS_CATEGORY_NOT_SHORT_CODE),
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTestOnMockModem.java b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTestOnMockModem.java
index 78fb0af..5e4acfd 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTestOnMockModem.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTestOnMockModem.java
@@ -489,6 +489,13 @@
public void testVoiceCallState() throws Throwable {
Log.d(TAG, "TelephonyManagerTestOnMockModem#testVoiceCallState");
+ // Skip the test if it is a data-only device
+ final PackageManager pm = getContext().getPackageManager();
+ if (!pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY_CALLING)) {
+ Log.d(TAG, "Skipping test: Not test on data-only device");
+ return;
+ }
+
assumeTrue(isSimHotSwapCapable());
int slotId = 0;
@@ -558,6 +565,8 @@
//Disable Ims to make sure the call would go thorugh with a CS call
ShellIdentityUtils.invokeMethodWithShellPermissionsNoReturn(
sTelephonyManager, (tm) -> tm.disableIms(slotId));
+ // Sleep 3s to make sure ims is disabled
+ TimeUnit.SECONDS.sleep(3);
// Dial a CS voice call
Log.d(TAG, "Start dialing call");
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/VisualVoicemailServiceTest.java b/tests/tests/telephony/current/src/android/telephony/cts/VisualVoicemailServiceTest.java
index e22db02..630e4bc 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/VisualVoicemailServiceTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/VisualVoicemailServiceTest.java
@@ -43,10 +43,10 @@
import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.net.Uri;
+import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.ParcelFileDescriptor;
-import android.os.SystemProperties;
import android.provider.Telephony.Sms;
import android.provider.Telephony.Sms.Intents;
import android.telecom.PhoneAccount;
@@ -109,7 +109,7 @@
mContext = getInstrumentation().getContext();
assumeTrue(hasFeatureSupported(mContext));
// The tests run on real modem with visual voicemail SMS.
- assumeFalse(isEmulator());
+ assumeFalse(Build.IS_EMULATOR);
mPreviousDefaultDialer = getDefaultDialer(getInstrumentation());
setDefaultDialer(getInstrumentation(), PACKAGE);
@@ -718,9 +718,4 @@
}
}
}
-
- private static boolean isEmulator() {
- return SystemProperties.getBoolean("ro.boot.qemu", false)
- || SystemProperties.getBoolean("ro.kernel.qemu", false);
- }
}
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/util/Android.bp b/tests/tests/telephony/current/src/android/telephony/cts/util/Android.bp
index 723278f..bdae0033 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/util/Android.bp
+++ b/tests/tests/telephony/current/src/android/telephony/cts/util/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony/current/src/android/telephony/satellite/cts/SatelliteManagerTestOnMockService.java b/tests/tests/telephony/current/src/android/telephony/satellite/cts/SatelliteManagerTestOnMockService.java
index 450bd3c..1efe167 100644
--- a/tests/tests/telephony/current/src/android/telephony/satellite/cts/SatelliteManagerTestOnMockService.java
+++ b/tests/tests/telephony/current/src/android/telephony/satellite/cts/SatelliteManagerTestOnMockService.java
@@ -2648,7 +2648,7 @@
if (packageManager.hasSystemFeature(PackageManager.FEATURE_NFC)) {
satelliteModeRadiosList.add(Settings.Global.RADIO_NFC);
- mNfcAdapter = NfcAdapter.getNfcAdapter(getContext().getApplicationContext());
+ mNfcAdapter = NfcAdapter.getDefaultAdapter(getContext().getApplicationContext());
mNfcInitState = mNfcAdapter.isEnabled();
radioStateIntentFilter.addAction(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED);
}
diff --git a/tests/tests/telephony2/Android.bp b/tests/tests/telephony2/Android.bp
index bba2263..a013358 100644
--- a/tests/tests/telephony2/Android.bp
+++ b/tests/tests/telephony2/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony3/Android.bp b/tests/tests/telephony3/Android.bp
index e5697e5..f23ec1b 100644
--- a/tests/tests/telephony3/Android.bp
+++ b/tests/tests/telephony3/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony4/Android.bp b/tests/tests/telephony4/Android.bp
index 4dcc8ce..458d9cd 100644
--- a/tests/tests/telephony4/Android.bp
+++ b/tests/tests/telephony4/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony4/certs/Android.bp b/tests/tests/telephony4/certs/Android.bp
index 4e37f99..338205e0 100644
--- a/tests/tests/telephony4/certs/Android.bp
+++ b/tests/tests/telephony4/certs/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephony5/Android.bp b/tests/tests/telephony5/Android.bp
index 944093a..a66fb15 100644
--- a/tests/tests/telephony5/Android.bp
+++ b/tests/tests/telephony5/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/telephonyprovider/Android.bp b/tests/tests/telephonyprovider/Android.bp
index 22b4641..1ffb482 100644
--- a/tests/tests/telephonyprovider/Android.bp
+++ b/tests/tests/telephonyprovider/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/text/Android.bp b/tests/tests/text/Android.bp
index ea7a2b9..e852647 100644
--- a/tests/tests/text/Android.bp
+++ b/tests/tests/text/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_text",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/text/jni/Android.bp b/tests/tests/text/jni/Android.bp
index 2d32210..911983d 100644
--- a/tests/tests/text/jni/Android.bp
+++ b/tests/tests/text/jni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_text",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/text/resourceApk/Android.bp b/tests/tests/text/resourceApk/Android.bp
index c29d648..a1e6065 100644
--- a/tests/tests/text/resourceApk/Android.bp
+++ b/tests/tests/text/resourceApk/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_text",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/theme/Android.bp b/tests/tests/theme/Android.bp
index 33f5c58..3dadb87 100644
--- a/tests/tests/theme/Android.bp
+++ b/tests/tests/theme/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/tools/processors/view_inspector/Android.bp b/tests/tests/tools/processors/view_inspector/Android.bp
index 1d6d509..5f0c1dd 100644
--- a/tests/tests/tools/processors/view_inspector/Android.bp
+++ b/tests/tests/tools/processors/view_inspector/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -33,5 +34,5 @@
test_suites: [
"cts",
"general-tests",
- ]
+ ],
}
diff --git a/tests/tests/transition/Android.bp b/tests/tests/transition/Android.bp
index 34dcd0c..0f3d0d1 100644
--- a/tests/tests/transition/Android.bp
+++ b/tests/tests/transition/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/tv/src/android/media/tv/tuner/cts/TunerTest.java b/tests/tests/tv/src/android/media/tv/tuner/cts/TunerTest.java
index 72093a9..6f9a7e3 100644
--- a/tests/tests/tv/src/android/media/tv/tuner/cts/TunerTest.java
+++ b/tests/tests/tv/src/android/media/tv/tuner/cts/TunerTest.java
@@ -1936,6 +1936,13 @@
// connect CiCam to Frontend
if (TunerVersionChecker.isHigherOrEqualVersionTo(TunerVersionChecker.TUNER_VERSION_1_1)) {
// TODO: get real CiCam id from MediaCas
+ int res = tunerA.connectFrontendToCiCam(ciCamId);
+ // INVALID_LTS_ID means hal doesn't support CiCam
+ if (res == Tuner.INVALID_LTS_ID) {
+ // Resources cleanup before return
+ tunerA.close();
+ return;
+ }
assertEquals(Tuner.RESULT_SUCCESS, tunerA.connectFrontendToCiCam(ciCamId));
linkCiCamToFrontendSupported = true;
} else {
diff --git a/tests/tests/uiautomation/Android.bp b/tests/tests/uiautomation/Android.bp
index 3fce75f..88c3e1c 100644
--- a/tests/tests/uiautomation/Android.bp
+++ b/tests/tests/uiautomation/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_framework_accessibility",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/uidisolation/Android.bp b/tests/tests/uidisolation/Android.bp
index 5e5593e..495e5fd 100644
--- a/tests/tests/uidisolation/Android.bp
+++ b/tests/tests/uidisolation/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/uidmigration/Android.bp b/tests/tests/uidmigration/Android.bp
index b826fa3..c2de89f 100644
--- a/tests/tests/uidmigration/Android.bp
+++ b/tests/tests/uidmigration/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/uidmigration/DataTestApp/Android.bp b/tests/tests/uidmigration/DataTestApp/Android.bp
index 6779334..756352c 100644
--- a/tests/tests/uidmigration/DataTestApp/Android.bp
+++ b/tests/tests/uidmigration/DataTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/uidmigration/InstallTestApp/Android.bp b/tests/tests/uidmigration/InstallTestApp/Android.bp
index 91620f8..ba80a0f 100644
--- a/tests/tests/uidmigration/InstallTestApp/Android.bp
+++ b/tests/tests/uidmigration/InstallTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/uidmigration/PermissionTestApp/Android.bp b/tests/tests/uidmigration/PermissionTestApp/Android.bp
index 2bdc777..db9b9e8 100644
--- a/tests/tests/uidmigration/PermissionTestApp/Android.bp
+++ b/tests/tests/uidmigration/PermissionTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/uidmigration/lib/Android.bp b/tests/tests/uidmigration/lib/Android.bp
index 79aa69f..ae19eb7 100644
--- a/tests/tests/uidmigration/lib/Android.bp
+++ b/tests/tests/uidmigration/lib/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_responsible_apis",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/uirendering/Android.bp b/tests/tests/uirendering/Android.bp
index c7d30dc..0beb0c8 100644
--- a/tests/tests/uirendering/Android.bp
+++ b/tests/tests/uirendering/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/uirendering/jni/Android.bp b/tests/tests/uirendering/jni/Android.bp
index 78a5bb1..3e7bd1c 100644
--- a/tests/tests/uirendering/jni/Android.bp
+++ b/tests/tests/uirendering/jni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/uirendering/src/android/uirendering/cts/testclasses/RuntimeShaderTests.kt b/tests/tests/uirendering/src/android/uirendering/cts/testclasses/RuntimeShaderTests.kt
index daacc5a..3325f2f 100644
--- a/tests/tests/uirendering/src/android/uirendering/cts/testclasses/RuntimeShaderTests.kt
+++ b/tests/tests/uirendering/src/android/uirendering/cts/testclasses/RuntimeShaderTests.kt
@@ -36,6 +36,7 @@
import androidx.test.filters.MediumTest
import com.android.compatibility.common.util.ApiTest
import org.junit.Assert
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
@@ -225,6 +226,7 @@
}
@Test
+ @Ignore("Evaluating null shaders is undefined (and changing) behavior. b/40045168, b/300305231")
fun testDefaultInputShader() {
val paint = Paint()
paint.color = Color.BLUE
@@ -238,6 +240,7 @@
}
@Test
+ @Ignore("Evaluating null shaders is undefined (and changing) behavior. b/40045168, b/300305231")
fun testDefaultInputShaderWithPaintAlpha() {
val paint = Paint()
paint.color = Color.argb(0.5f, 0.0f, 0.0f, 1.0f)
diff --git a/tests/tests/vcn/Android.bp b/tests/tests/vcn/Android.bp
index 59f15f0..c9cd31d 100644
--- a/tests/tests/vcn/Android.bp
+++ b/tests/tests/vcn/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_enigma",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/view/Android.bp b/tests/tests/view/Android.bp
index 0fdbe87..6f89cba 100644
--- a/tests/tests/view/Android.bp
+++ b/tests/tests/view/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/view/AndroidManifest.xml b/tests/tests/view/AndroidManifest.xml
index 47622f7..d1fa0a5 100644
--- a/tests/tests/view/AndroidManifest.xml
+++ b/tests/tests/view/AndroidManifest.xml
@@ -86,6 +86,7 @@
</activity>
<activity android:name="android.view.cts.ViewTestCtsActivity"
+ android:enableOnBackInvokedCallback="false"
android:screenOrientation="locked"
android:label="ViewTestCtsActivity"
android:exported="true">
@@ -407,6 +408,7 @@
</activity>
<activity android:name="android.view.cts.InputEventInterceptTestActivity"
+ android:enableOnBackInvokedCallback="false"
android:theme="@style/no_starting_window"
android:exported="true">
<intent-filter>
@@ -415,6 +417,7 @@
</activity>
<activity android:name="android.view.cts.input.InputDeviceKeyLayoutMapTestActivity"
+ android:enableOnBackInvokedCallback="false"
android:configChanges="keyboardHidden|navigation|keyboard"
android:exported="true">
<intent-filter>
diff --git a/tests/tests/view/jni/Android.bp b/tests/tests/view/jni/Android.bp
index ddd7e91..d4815b7 100644
--- a/tests/tests/view/jni/Android.bp
+++ b/tests/tests/view/jni/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/view/receivecontent/Android.bp b/tests/tests/view/receivecontent/Android.bp
index dfd4c87..c5b6176 100644
--- a/tests/tests/view/receivecontent/Android.bp
+++ b/tests/tests/view/receivecontent/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/view/sdk28/Android.bp b/tests/tests/view/sdk28/Android.bp
index bc18f2a..ad759f6 100644
--- a/tests/tests/view/sdk28/Android.bp
+++ b/tests/tests/view/sdk28/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/view/src/android/view/cts/DisplayRefreshRateTest.java b/tests/tests/view/src/android/view/cts/DisplayRefreshRateTest.java
index c8f16ef..1cad13a 100644
--- a/tests/tests/view/src/android/view/cts/DisplayRefreshRateTest.java
+++ b/tests/tests/view/src/android/view/cts/DisplayRefreshRateTest.java
@@ -87,7 +87,8 @@
private CountDownLatch mCountDownLatch = new CountDownLatch(1);
void waitForModeToChange(int modeId) throws InterruptedException {
- while (modeId != mDisplay.getMode().getModeId()) {
+ while (modeId != mDisplay.getMode().getModeId()
+ && mDisplay.getMode().getRefreshRate() != mDisplay.getRefreshRate()) {
mCountDownLatch.await(5, TimeUnit.SECONDS);
}
}
@@ -167,9 +168,9 @@
@Test
public void testRefreshRate() {
boolean fpsOk = false;
- float claimedFps = mDisplay.getRefreshRate();
for (int i = 0; i < 3; i++) {
+ float claimedFps = mDisplay.getRefreshRate();
float achievedFps = mFpsResult.waitResult();
Log.d(TAG, "claimed " + claimedFps + " fps, " +
"achieved " + achievedFps + " fps");
diff --git a/tests/tests/view/src/android/view/cts/KeyEventTest.java b/tests/tests/view/src/android/view/cts/KeyEventTest.java
index 9429044..c8af7a7 100644
--- a/tests/tests/view/src/android/view/cts/KeyEventTest.java
+++ b/tests/tests/view/src/android/view/cts/KeyEventTest.java
@@ -812,10 +812,10 @@
assertEquals(KeyEvent.KEYCODE_UNKNOWN, KeyEvent.keyCodeFromString("KEYCODE"));
assertEquals(KeyEvent.KEYCODE_UNKNOWN, KeyEvent.keyCodeFromString("KEYCODE_"));
assertEquals(KeyEvent.KEYCODE_UNKNOWN, KeyEvent.keyCodeFromString(""));
- assertEquals(KeyEvent.LAST_KEYCODE,
- KeyEvent.keyCodeFromString(Integer.toString(KeyEvent.LAST_KEYCODE)));
+ assertEquals(KeyEvent.getMaxKeyCode(),
+ KeyEvent.keyCodeFromString(Integer.toString(KeyEvent.getMaxKeyCode())));
assertEquals(KeyEvent.KEYCODE_UNKNOWN,
- KeyEvent.keyCodeFromString(Integer.toString(KeyEvent.LAST_KEYCODE + 1)));
+ KeyEvent.keyCodeFromString(Integer.toString(KeyEvent.getMaxKeyCode() + 1)));
}
@Test
diff --git a/tests/tests/view/src/android/view/cts/MotionEventTest.java b/tests/tests/view/src/android/view/cts/MotionEventTest.java
index 839a9ab..c1f9073 100644
--- a/tests/tests/view/src/android/view/cts/MotionEventTest.java
+++ b/tests/tests/view/src/android/view/cts/MotionEventTest.java
@@ -311,7 +311,8 @@
// Move to pointer id count.
parcel.setDataPosition(4);
- parcel.writeInt(17);
+ // Use a very large pointer count, which should make this parcel invalid.
+ parcel.writeInt(117);
parcel.setDataPosition(0);
try {
diff --git a/tests/tests/view/src/android/view/cts/ViewTest.java b/tests/tests/view/src/android/view/cts/ViewTest.java
index b3267d2..b2b0b9c 100644
--- a/tests/tests/view/src/android/view/cts/ViewTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewTest.java
@@ -3354,12 +3354,12 @@
MotionEvent downEvent =
MotionEvent.obtain(downTime, downTime, MotionEvent.ACTION_DOWN, x, y, 0);
downEvent.setSource(InputDevice.SOURCE_TOUCHSCREEN);
- mInstrumentation.getUiAutomation().injectInputEvent(downEvent, true);
+ mInstrumentation.sendPointerSync(downEvent);
final long eventTime = SystemClock.uptimeMillis();
MotionEvent upEvent =
MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, x, y, 0);
upEvent.setSource(InputDevice.SOURCE_TOUCHSCREEN);
- mInstrumentation.getUiAutomation().injectInputEvent(upEvent, true);
+ mInstrumentation.sendPointerSync(upEvent);
compareAndRecycleMotionEvents(downEvent, events.poll());
compareAndRecycleMotionEvents(upEvent, events.poll());
@@ -4758,7 +4758,7 @@
SystemClock.uptimeMillis(), SystemClock.uptimeMillis(),
MotionEvent.ACTION_DOWN, size.x / 2, size.y / 2, 1);
event.setSource(InputDevice.SOURCE_TOUCHSCREEN);
- mInstrumentation.getUiAutomation().injectInputEvent(event, true);
+ mInstrumentation.sendPointerSync(event);
return view.startDragAndDrop(ClipData.newPlainText("", ""), shadowBuilder, view, 0);
}
diff --git a/tests/tests/virtualdevice/app/Android.bp b/tests/tests/virtualdevice/app/Android.bp
index 43f2818..482c981 100644
--- a/tests/tests/virtualdevice/app/Android.bp
+++ b/tests/tests/virtualdevice/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_xr_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/virtualdevice/common/Android.bp b/tests/tests/virtualdevice/common/Android.bp
index 5091f63..39486cf 100644
--- a/tests/tests/virtualdevice/common/Android.bp
+++ b/tests/tests/virtualdevice/common/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_xr_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/voiceRecognition/Android.bp b/tests/tests/voiceRecognition/Android.bp
index 45dcb98..f6dff85 100644
--- a/tests/tests/voiceRecognition/Android.bp
+++ b/tests/tests/voiceRecognition/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/voiceRecognition/RecognitionService/Android.bp b/tests/tests/voiceRecognition/RecognitionService/Android.bp
index 8b1c4e1..1911f9b 100644
--- a/tests/tests/voiceRecognition/RecognitionService/Android.bp
+++ b/tests/tests/voiceRecognition/RecognitionService/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -25,7 +26,7 @@
// Tag this module as a cts test artifact
test_suites: [
"cts",
- "general-tests"
+ "general-tests",
],
srcs: ["src/**/*.java"],
resource_dirs: ["res"],
diff --git a/tests/tests/voiceinteraction/Android.bp b/tests/tests/voiceinteraction/Android.bp
index 0105227..863d7a3 100644
--- a/tests/tests/voiceinteraction/Android.bp
+++ b/tests/tests/voiceinteraction/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/voiceinteraction/common/Android.bp b/tests/tests/voiceinteraction/common/Android.bp
index d667329..57fb4ec 100644
--- a/tests/tests/voiceinteraction/common/Android.bp
+++ b/tests/tests/voiceinteraction/common/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/voiceinteraction/common/src/android/voiceinteraction/common/Utils.java b/tests/tests/voiceinteraction/common/src/android/voiceinteraction/common/Utils.java
index 107137c..032d29f 100644
--- a/tests/tests/voiceinteraction/common/src/android/voiceinteraction/common/Utils.java
+++ b/tests/tests/voiceinteraction/common/src/android/voiceinteraction/common/Utils.java
@@ -59,7 +59,7 @@
private static final String TAG = Utils.class.getSimpleName();
- public static final long OPERATION_TIMEOUT_MS = 5000;
+ public static final long OPERATION_TIMEOUT_MS = 10000;
/** CDD restricts the max size of each successful hotword result is 100 bytes. */
public static final int MAX_HOTWORD_DETECTED_RESULT_SIZE = 100;
diff --git a/tests/tests/voiceinteraction/localvoiceinteraction/Android.bp b/tests/tests/voiceinteraction/localvoiceinteraction/Android.bp
index dd97ea8..b1bdf59 100644
--- a/tests/tests/voiceinteraction/localvoiceinteraction/Android.bp
+++ b/tests/tests/voiceinteraction/localvoiceinteraction/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/voiceinteraction/service/Android.bp b/tests/tests/voiceinteraction/service/Android.bp
index 2b962690..967a20d 100644
--- a/tests/tests/voiceinteraction/service/Android.bp
+++ b/tests/tests/voiceinteraction/service/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/voiceinteraction/testapp/Android.bp b/tests/tests/voiceinteraction/testapp/Android.bp
index 3b021d1..4a965ad 100644
--- a/tests/tests/voiceinteraction/testapp/Android.bp
+++ b/tests/tests/voiceinteraction/testapp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/voicesettings/Android.bp b/tests/tests/voicesettings/Android.bp
index f682207..2d2bb37 100644
--- a/tests/tests/voicesettings/Android.bp
+++ b/tests/tests/voicesettings/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/voicesettings/service/Android.bp b/tests/tests/voicesettings/service/Android.bp
index ccbf73d..511e72e 100644
--- a/tests/tests/voicesettings/service/Android.bp
+++ b/tests/tests/voicesettings/service/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_machine_learning",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/webkit/Android.bp b/tests/tests/webkit/Android.bp
index 0b206ff..8beae35 100644
--- a/tests/tests/webkit/Android.bp
+++ b/tests/tests/webkit/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_chromium_webview",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/webkit/assets/webkit/test_imageaccess.html b/tests/tests/webkit/assets/webkit/test_imageaccess.html
index ce76c83..c46c9f3 100644
--- a/tests/tests/webkit/assets/webkit/test_imageaccess.html
+++ b/tests/tests/webkit/assets/webkit/test_imageaccess.html
@@ -16,13 +16,13 @@
<html>
<head>
<title>TEST FAILED</title>
- </head>
- <body>
- <img id='img' src="../images/tomato.png" onload="success()" />
- <script>
+ <script>
function success() {
document.title=document.getElementById('img').naturalHeight;
}
</script>
+ </head>
+ <body>
+ <img id='img' src="../images/tomato.png" onload="success()" />
</body>
</html>
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java b/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java
index d44cbb0..22dc61b 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java
@@ -32,6 +32,7 @@
import android.platform.test.annotations.AppModeFull;
import android.util.Base64;
import android.view.ViewGroup;
+import android.view.ViewParent;
import android.webkit.SslErrorHandler;
import android.webkit.WebChromeClient;
import android.webkit.WebIconDatabase;
@@ -113,6 +114,7 @@
public void tearDown() throws Exception {
if (mWebServer != null) {
mWebServer.shutdown();
+ mWebServer = null;
}
if (mOnUiThread != null) {
mOnUiThread.cleanUp();
@@ -493,33 +495,45 @@
final WebView childWebView = mOnUiThread.createWebView();
final SettableFuture<Void> createWindowFuture = SettableFuture.create();
- mOnUiThread.setWebChromeClient(new WebChromeClient() {
- @Override
- public boolean onCreateWindow(
- WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
- WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
- transport.setWebView(childWebView);
- resultMsg.sendToTarget();
- createWindowFuture.set(null);
- return true;
- }
- });
- mSettings.setJavaScriptCanOpenWindowsAutomatically(false);
- assertFalse(mSettings.getJavaScriptCanOpenWindowsAutomatically());
- mOnUiThread.loadUrl(mWebServer.getAssetUrl(TestHtmlConstants.POPUP_URL));
- new PollingCheck(WebkitUtils.TEST_TIMEOUT_MS) {
- @Override
- protected boolean check() {
- return "Popup blocked".equals(mOnUiThread.getTitle());
- }
- }.run();
- assertFalse("onCreateWindow should not have been called yet", createWindowFuture.isDone());
+ try {
+ mOnUiThread.setWebChromeClient(new WebChromeClient() {
+ @Override
+ public boolean onCreateWindow(
+ WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
+ WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
+ transport.setWebView(childWebView);
+ resultMsg.sendToTarget();
+ createWindowFuture.set(null);
+ return true;
+ }
+ });
- mSettings.setJavaScriptCanOpenWindowsAutomatically(true);
- assertTrue(mSettings.getJavaScriptCanOpenWindowsAutomatically());
- mOnUiThread.loadUrl(mWebServer.getAssetUrl(TestHtmlConstants.POPUP_URL));
- WebkitUtils.waitForFuture(createWindowFuture);
+ mSettings.setJavaScriptCanOpenWindowsAutomatically(false);
+ assertFalse(mSettings.getJavaScriptCanOpenWindowsAutomatically());
+ mOnUiThread.loadUrl(mWebServer.getAssetUrl(TestHtmlConstants.POPUP_URL));
+ new PollingCheck(WebkitUtils.TEST_TIMEOUT_MS) {
+ @Override
+ protected boolean check() {
+ return "Popup blocked".equals(mOnUiThread.getTitle());
+ }
+ }.run();
+ assertFalse("onCreateWindow should not have been called yet",
+ createWindowFuture.isDone());
+
+ mSettings.setJavaScriptCanOpenWindowsAutomatically(true);
+ assertTrue(mSettings.getJavaScriptCanOpenWindowsAutomatically());
+ mOnUiThread.loadUrl(mWebServer.getAssetUrl(TestHtmlConstants.POPUP_URL));
+ WebkitUtils.waitForFuture(createWindowFuture);
+ } finally {
+ WebkitUtils.onMainThreadSync(() -> {
+ ViewParent parent = childWebView.getParent();
+ if (parent instanceof ViewGroup) {
+ ((ViewGroup) parent).removeView(childWebView);
+ }
+ childWebView.destroy();
+ });
+ }
}
@Test
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
index 1b39b27..e7904e7 100755
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
@@ -53,6 +53,7 @@
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.ViewGroup;
+import android.view.ViewParent;
import android.view.textclassifier.TextClassification;
import android.view.textclassifier.TextClassifier;
import android.view.textclassifier.TextSelection;
@@ -797,46 +798,57 @@
final TestJavaScriptInterface obj = new TestJavaScriptInterface();
final WebView childWebView = mOnUiThread.createWebView();
- WebViewOnUiThread childOnUiThread = new WebViewOnUiThread(childWebView);
- childOnUiThread.getSettings().setJavaScriptEnabled(true);
- childOnUiThread.addJavascriptInterface(obj, "interface");
- final SettableFuture<Void> onCreateWindowFuture = SettableFuture.create();
- mOnUiThread.setWebChromeClient(
- new WebViewSyncLoader.WaitForProgressClient(mOnUiThread) {
- @Override
- public boolean onCreateWindow(
- WebView view,
- boolean isDialog,
- boolean isUserGesture,
- Message resultMsg) {
- getTestEnvironment().addContentView(
- childWebView,
- new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT));
- WebView.WebViewTransport transport =
- (WebView.WebViewTransport) resultMsg.obj;
- transport.setWebView(childWebView);
- resultMsg.sendToTarget();
- onCreateWindowFuture.set(null);
- return true;
- }
- });
+ try {
+ WebViewOnUiThread childOnUiThread = new WebViewOnUiThread(childWebView);
+ childOnUiThread.getSettings().setJavaScriptEnabled(true);
+ childOnUiThread.addJavascriptInterface(obj, "interface");
- mWebServer = getTestEnvironment().getSetupWebServer(SslMode.INSECURE);
- mOnUiThread.loadUrlAndWaitForCompletion(
- mWebServer.getAssetUrl(TestHtmlConstants.POPUP_URL));
- WebkitUtils.waitForFuture(onCreateWindowFuture);
+ final SettableFuture<Void> onCreateWindowFuture = SettableFuture.create();
+ mOnUiThread.setWebChromeClient(
+ new WebViewSyncLoader.WaitForProgressClient(mOnUiThread) {
+ @Override
+ public boolean onCreateWindow(
+ WebView view,
+ boolean isDialog,
+ boolean isUserGesture,
+ Message resultMsg) {
+ getTestEnvironment().addContentView(
+ childWebView,
+ new ViewGroup.LayoutParams(
+ ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT));
+ WebView.WebViewTransport transport =
+ (WebView.WebViewTransport) resultMsg.obj;
+ transport.setWebView(childWebView);
+ resultMsg.sendToTarget();
+ onCreateWindowFuture.set(null);
+ return true;
+ }
+ });
- childOnUiThread.loadUrlAndWaitForCompletion("about:blank");
+ mWebServer = getTestEnvironment().getSetupWebServer(SslMode.INSECURE);
+ mOnUiThread.loadUrlAndWaitForCompletion(
+ mWebServer.getAssetUrl(TestHtmlConstants.POPUP_URL));
+ WebkitUtils.waitForFuture(onCreateWindowFuture);
- assertEquals("true", childOnUiThread.evaluateJavascriptSync("'interface' in window"));
+ childOnUiThread.loadUrlAndWaitForCompletion("about:blank");
- assertEquals(
- "The injected object should be functional",
- "42",
- childOnUiThread.evaluateJavascriptSync("interface.test()"));
+ assertEquals("true", childOnUiThread.evaluateJavascriptSync("'interface' in window"));
+
+ assertEquals(
+ "The injected object should be functional",
+ "42",
+ childOnUiThread.evaluateJavascriptSync("interface.test()"));
+ } finally {
+ WebkitUtils.onMainThreadSync(() -> {
+ ViewParent parent = childWebView.getParent();
+ if (parent instanceof ViewGroup) {
+ ((ViewGroup) parent).removeView(childWebView);
+ }
+ childWebView.destroy();
+ });
+ }
}
private final class TestPictureListener implements PictureListener {
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewZoomTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewZoomTest.java
index 6b8ea8d..009b77e 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewZoomTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewZoomTest.java
@@ -86,6 +86,7 @@
}
if (mWebServer != null) {
mWebServer.shutdown();
+ mWebServer = null;
}
mActivity = null;
diff --git a/tests/tests/widget/Android.bp b/tests/tests/widget/Android.bp
index fa41c46..945933f 100644
--- a/tests/tests/widget/Android.bp
+++ b/tests/tests/widget/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/widget/AndroidManifest.xml b/tests/tests/widget/AndroidManifest.xml
index a14568f..eed9762 100644
--- a/tests/tests/widget/AndroidManifest.xml
+++ b/tests/tests/widget/AndroidManifest.xml
@@ -367,6 +367,7 @@
<activity android:name="android.widget.cts.ListPopupWindowCtsActivity"
android:label="ListPopupWindowCtsActivity"
android:windowSoftInputMode="stateAlwaysHidden"
+ android:theme="@style/Theme_NoSwipeDismiss"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
diff --git a/tests/tests/widget/OWNERS b/tests/tests/widget/OWNERS
index 0f25ac1..d34b352 100644
--- a/tests/tests/widget/OWNERS
+++ b/tests/tests/widget/OWNERS
@@ -2,3 +2,5 @@
aelias@google.com
mount@google.com
adamp@google.com
+# RemoteViews related
+include /tests/tests/appwidget/OWNERS
diff --git a/tests/tests/widget/app/Android.bp b/tests/tests/widget/app/Android.bp
index 461fd11..721c5d3 100644
--- a/tests/tests/widget/app/Android.bp
+++ b/tests/tests/widget/app/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/widget/res/layout/horizontal_scrollview.xml b/tests/tests/widget/res/layout/horizontal_scrollview.xml
index d1b5aca3..5be3b3e 100644
--- a/tests/tests/widget/res/layout/horizontal_scrollview.xml
+++ b/tests/tests/widget/res/layout/horizontal_scrollview.xml
@@ -135,7 +135,8 @@
android:id="@+id/horizontal_scroll_view_stretch"
android:layout_width="180px"
android:layout_height="180px"
- android:background="#FFF">
+ android:background="#FFF"
+ android:defaultFocusHighlightEnabled="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/tests/tests/widget/res/layout/scrollview_layout.xml b/tests/tests/widget/res/layout/scrollview_layout.xml
index 7115509..e148746 100644
--- a/tests/tests/widget/res/layout/scrollview_layout.xml
+++ b/tests/tests/widget/res/layout/scrollview_layout.xml
@@ -132,7 +132,8 @@
android:id="@+id/scroll_view_stretch"
android:layout_width="90px"
android:layout_height="90px"
- android:background="#FFF">
+ android:background="#FFF"
+ android:defaultFocusHighlightEnabled="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/tests/tests/widget/res/values/styles.xml b/tests/tests/widget/res/values/styles.xml
index 0239851..a9eae705 100644
--- a/tests/tests/widget/res/values/styles.xml
+++ b/tests/tests/widget/res/values/styles.xml
@@ -375,6 +375,10 @@
<item name="themeTileMode">2</item>
</style>
+ <style name="Theme_NoSwipeDismiss">
+ <item name="android:windowSwipeToDismiss">false</item>
+ </style>
+
<style name="PopupEmptyStyle" />
<style name="TabWidgetCustomStyle" parent="android:Widget.TabWidget">
diff --git a/tests/tests/widget/src/android/widget/cts/RemoteViewsFixedCollectionAdapterTest.java b/tests/tests/widget/src/android/widget/cts/RemoteViewsFixedCollectionAdapterTest.java
index 408f327..b545bac 100644
--- a/tests/tests/widget/src/android/widget/cts/RemoteViewsFixedCollectionAdapterTest.java
+++ b/tests/tests/widget/src/android/widget/cts/RemoteViewsFixedCollectionAdapterTest.java
@@ -474,8 +474,18 @@
assertTrue(adapter.hasStableIds());
assertEquals(2, mListView.getChildCount());
- TextView textView0 = (TextView) mListView.getChildAt(0);
- TextView textView1 = (TextView) mListView.getChildAt(1);
+ TextView textView0;
+ TextView textView1;
+ try {
+ AppWidgetHostView child0 = (AppWidgetHostView) mListView.getChildAt(0);
+ AppWidgetHostView child1 = (AppWidgetHostView) mListView.getChildAt(1);
+ textView0 = (TextView) child0.getChildAt(0);
+ textView1 = (TextView) child1.getChildAt(0);
+ } catch (ClassCastException ce) {
+ textView0 = (TextView) mListView.getChildAt(0);
+ textView1 = (TextView) mListView.getChildAt(1);
+ }
+
assertEquals("Hello", textView0.getText());
assertEquals("World", textView1.getText());
}
@@ -532,10 +542,23 @@
assertTrue(adapter.hasStableIds());
assertEquals(3, listView.getChildCount());
- TextView textView0 = (TextView) listView.getChildAt(0);
- TextView textView1 = (TextView) listView.getChildAt(1);
- CompoundButton checkBox2 =
- (CompoundButton) ((ViewGroup) listView.getChildAt(2)).getChildAt(0);
+
+ TextView textView0;
+ TextView textView1;
+ CompoundButton checkBox2Temp;
+ try {
+ AppWidgetHostView child0 = (AppWidgetHostView) listView.getChildAt(0);
+ AppWidgetHostView child1 = (AppWidgetHostView) listView.getChildAt(1);
+ AppWidgetHostView child2 = (AppWidgetHostView) listView.getChildAt(2);
+ textView0 = (TextView) child0.getChildAt(0);
+ textView1 = (TextView) child1.getChildAt(0);
+ checkBox2Temp = (CompoundButton) ((ViewGroup) child2.getChildAt(0)).getChildAt(0);
+ } catch (ClassCastException ce) {
+ textView0 = (TextView) listView.getChildAt(0);
+ textView1 = (TextView) listView.getChildAt(1);
+ checkBox2Temp = (CompoundButton) ((ViewGroup) listView.getChildAt(2)).getChildAt(0);
+ }
+ final CompoundButton checkBox2 = checkBox2Temp;
assertEquals("Hello", textView0.getText());
assertEquals("World", textView1.getText());
assertEquals("Checkbox", checkBox2.getText());
@@ -601,7 +624,14 @@
runOnMainAndDrawSync(mActivityRule, listView, () -> mRemoteViews.reapply(mActivity, mView));
Adapter initialAdapter = listView.getAdapter();
- TextView initialFirstItemView = (TextView) listView.getChildAt(0);
+ TextView initialFirstItemView;
+ try {
+ AppWidgetHostView child0 = (AppWidgetHostView) listView.getChildAt(0);
+ initialFirstItemView = (TextView) child0.getChildAt(0);
+ } catch (ClassCastException ce) {
+ initialFirstItemView = (TextView) listView.getChildAt(0);
+ }
+
int initialFirstItemViewType = initialAdapter.getItemViewType(0);
items = new RemoteCollectionItems.Builder()
@@ -616,8 +646,16 @@
// layoutId should have been maintained (as 0) and the next view type assigned to the
// checkbox layout. The view for the row should have been recycled without inflating a new
// view.
+
+ TextView secondItemView;
+ try {
+ AppWidgetHostView child1 = (AppWidgetHostView) listView.getChildAt(1);
+ secondItemView = (TextView) child1.getChildAt(0);
+ } catch (ClassCastException ce) {
+ secondItemView = (TextView) listView.getChildAt(1);
+ }
assertSame(initialAdapter, listView.getAdapter());
- assertSame(initialFirstItemView, listView.getChildAt(1));
+ assertSame(initialFirstItemView, secondItemView);
assertEquals(initialFirstItemViewType, listView.getAdapter().getItemViewType(1));
assertNotEquals(initialFirstItemViewType, listView.getAdapter().getItemViewType(0));
}
@@ -634,7 +672,14 @@
runOnMainAndDrawSync(mActivityRule, listView, () -> mRemoteViews.reapply(mActivity, mView));
Adapter initialAdapter = listView.getAdapter();
- TextView initialFirstItemView = (TextView) listView.getChildAt(0);
+
+ TextView initialFirstItemView;
+ try {
+ AppWidgetHostView child0 = (AppWidgetHostView) listView.getChildAt(0);
+ initialFirstItemView = (TextView) child0.getChildAt(0);
+ } catch (ClassCastException ce) {
+ initialFirstItemView = (TextView) listView.getChildAt(0);
+ }
items = new RemoteCollectionItems.Builder()
.addItem(8 /* id= */, new RemoteViews(PACKAGE_NAME, R.layout.checkbox_layout))
@@ -644,9 +689,16 @@
runOnMainAndDrawSync(mActivityRule, listView, () -> mRemoteViews.reapply(mActivity, mView));
// The adapter should have been replaced, which is required when the view type increases.
+ TextView secondItemView;
+ try {
+ AppWidgetHostView child1 = (AppWidgetHostView) listView.getChildAt(1);
+ secondItemView = (TextView) child1.getChildAt(0);
+ } catch (ClassCastException ce) {
+ secondItemView = (TextView) listView.getChildAt(1);
+ }
assertEquals(2, listView.getAdapter().getViewTypeCount());
assertNotSame(initialAdapter, listView.getAdapter());
- assertNotSame(initialFirstItemView, listView.getChildAt(1));
+ assertNotSame(initialFirstItemView, secondItemView);
}
@Test
@@ -663,7 +715,13 @@
runOnMainAndDrawSync(mActivityRule, listView, () -> mRemoteViews.reapply(mActivity, mView));
Adapter initialAdapter = listView.getAdapter();
- TextView initialSecondItemView = (TextView) listView.getChildAt(1);
+ TextView initialSecondItemView;
+ try {
+ AppWidgetHostView child1 = (AppWidgetHostView) listView.getChildAt(1);
+ initialSecondItemView = (TextView) child1.getChildAt(0);
+ } catch (ClassCastException ce) {
+ initialSecondItemView = (TextView) listView.getChildAt(1);
+ }
assertEquals(1, initialAdapter.getItemViewType(1));
items = new RemoteCollectionItems.Builder()
@@ -675,9 +733,16 @@
// The adapter should have been kept, and the second item should have maintained its view
// type of 1 even though its now the only view type.
+ TextView firstItemView;
+ try {
+ AppWidgetHostView child0 = (AppWidgetHostView) listView.getChildAt(0);
+ firstItemView = (TextView) child0.getChildAt(0);
+ } catch (ClassCastException ce) {
+ firstItemView = (TextView) listView.getChildAt(0);
+ }
assertEquals(2, listView.getAdapter().getViewTypeCount());
assertSame(initialAdapter, listView.getAdapter());
- assertSame(initialSecondItemView, listView.getChildAt(0));
+ assertSame(initialSecondItemView, firstItemView);
assertEquals(1, listView.getAdapter().getItemViewType(0));
}
@@ -694,7 +759,13 @@
runOnMainAndDrawSync(mActivityRule, listView, () -> mRemoteViews.reapply(mActivity, mView));
Adapter initialAdapter = listView.getAdapter();
- TextView initialSecondItemView = (TextView) listView.getChildAt(1);
+ TextView initialSecondItemView;
+ try {
+ AppWidgetHostView child1 = (AppWidgetHostView) listView.getChildAt(1);
+ initialSecondItemView = (TextView) child1.getChildAt(0);
+ } catch (ClassCastException ce) {
+ initialSecondItemView = (TextView) listView.getChildAt(1);
+ }
assertEquals(1, initialAdapter.getItemViewType(1));
items = new RemoteCollectionItems.Builder()
@@ -705,9 +776,16 @@
// The adapter should have been kept, and kept its higher view count to allow for views to
// be recycled.
+ TextView firstItemView;
+ try {
+ AppWidgetHostView child0 = (AppWidgetHostView) listView.getChildAt(0);
+ firstItemView = (TextView) child0.getChildAt(0);
+ } catch (ClassCastException ce) {
+ firstItemView = (TextView) listView.getChildAt(0);
+ }
assertEquals(2, listView.getAdapter().getViewTypeCount());
assertSame(initialAdapter, listView.getAdapter());
- assertSame(initialSecondItemView, listView.getChildAt(0));
+ assertSame(initialSecondItemView, firstItemView);
assertEquals(1, listView.getAdapter().getItemViewType(0));
}
@@ -755,10 +833,25 @@
assertEquals(13, adapter.getItemId(3));
assertEquals(4, mGridView.getChildCount());
- TextView textView0 = (TextView) mGridView.getChildAt(0);
- TextView textView1 = (TextView) mGridView.getChildAt(1);
- TextView textView2 = (TextView) mGridView.getChildAt(2);
- TextView textView3 = (TextView) mGridView.getChildAt(3);
+ TextView textView0;
+ TextView textView1;
+ TextView textView2;
+ TextView textView3;
+ try {
+ AppWidgetHostView child0 = (AppWidgetHostView) mGridView.getChildAt(0);
+ AppWidgetHostView child1 = (AppWidgetHostView) mGridView.getChildAt(1);
+ AppWidgetHostView child2 = (AppWidgetHostView) mGridView.getChildAt(2);
+ AppWidgetHostView child3 = (AppWidgetHostView) mGridView.getChildAt(3);
+ textView0 = (TextView) child0.getChildAt(0);
+ textView1 = (TextView) child1.getChildAt(0);
+ textView2 = (TextView) child2.getChildAt(0);
+ textView3 = (TextView) child3.getChildAt(0);
+ } catch (ClassCastException ce) {
+ textView0 = (TextView) mGridView.getChildAt(0);
+ textView1 = (TextView) mGridView.getChildAt(1);
+ textView2 = (TextView) mGridView.getChildAt(2);
+ textView3 = (TextView) mGridView.getChildAt(3);
+ }
assertEquals("Hello", textView0.getText());
assertEquals("World", textView1.getText());
assertEquals("Hola", textView2.getText());
diff --git a/tests/tests/widget/src/android/widget/cts/TextViewTest.java b/tests/tests/widget/src/android/widget/cts/TextViewTest.java
index bc4a2bb..66352e2 100644
--- a/tests/tests/widget/src/android/widget/cts/TextViewTest.java
+++ b/tests/tests/widget/src/android/widget/cts/TextViewTest.java
@@ -5035,7 +5035,6 @@
@UiThreadTest
@Test
public void testSetLineHeightInUnits() {
- assertEquals(1f, mActivity.getResources().getConfiguration().fontScale, /* delta= */ 0.02f);
mTextView = new TextView(mActivity);
mTextView.setText("This is some random text");
diff --git a/tests/tests/widget29/Android.bp b/tests/tests/widget29/Android.bp
index a5e2c4ed3..06bcef8 100644
--- a/tests/tests/widget29/Android.bp
+++ b/tests/tests/widget29/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_ui_toolkit",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/wifi/Android.bp b/tests/tests/wifi/Android.bp
index 1926203..b8eaae9 100644
--- a/tests/tests/wifi/Android.bp
+++ b/tests/tests/wifi/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/wifi/CtsWifiLocationTestApp/Android.bp b/tests/tests/wifi/CtsWifiLocationTestApp/Android.bp
index 824b003..686abf2 100644
--- a/tests/tests/wifi/CtsWifiLocationTestApp/Android.bp
+++ b/tests/tests/wifi/CtsWifiLocationTestApp/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -27,7 +28,7 @@
sdk_version: "test_current",
srcs: [
- "src/**/*.java"
+ "src/**/*.java",
],
static_libs: [
diff --git a/tests/tests/wifi/mockWifi/Android.bp b/tests/tests/wifi/mockWifi/Android.bp
index c6e4baf..5b35ccc 100644
--- a/tests/tests/wifi/mockWifi/Android.bp
+++ b/tests/tests/wifi/mockWifi/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemManager.java b/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemManager.java
index 184bf03..f8c5de6 100644
--- a/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemManager.java
+++ b/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemManager.java
@@ -19,6 +19,8 @@
import android.content.Context;
import android.util.Log;
import android.wifi.mockwifi.nl80211.IClientInterfaceImp;
+import android.wifi.mockwifi.nl80211.IWifiScannerImp;
+import android.wifi.mockwifi.nl80211.WifiNL80211ManagerImp;
import java.util.concurrent.TimeUnit;
@@ -116,4 +118,26 @@
}
return mMockWifiModemService.configureClientInterfaceMock(ifaceName, clientInterfaceMock);
}
+
+ /**
+ * Configures a mock Wifi scanner interface.
+ */
+ public boolean configureWifiScannerInterfaceMock(String ifaceName,
+ IWifiScannerImp.WifiScannerInterfaceMock wifiScannerInterfaceMock) {
+ if (mMockWifiModemService == null) {
+ return false;
+ }
+ return mMockWifiModemService.configureWifiScannerInterfaceMock(ifaceName,
+ wifiScannerInterfaceMock);
+ }
+
+ /**
+ * Returns mocked WifiNl80211Manager.
+ */
+ public WifiNL80211ManagerImp getWifiNL80211ManagerImp() {
+ if (mMockWifiModemService == null) {
+ return null;
+ }
+ return mMockWifiModemService.getWifiNL80211ManagerImp();
+ }
}
diff --git a/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemService.java b/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemService.java
index 8e4a79e..5a576cf 100644
--- a/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemService.java
+++ b/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemService.java
@@ -23,6 +23,7 @@
import android.os.IBinder;
import android.util.Log;
import android.wifi.mockwifi.nl80211.IClientInterfaceImp;
+import android.wifi.mockwifi.nl80211.IWifiScannerImp;
import android.wifi.mockwifi.nl80211.WifiNL80211ManagerImp;
import java.util.concurrent.CountDownLatch;
@@ -41,7 +42,6 @@
public static final String CLASS_IDENTIFIER = "-";
private static final int NUM_MOCKED_INTERFACES = 1; // The number of HAL, now only support
// nl80211 HAL
-
public static final String NL80211_INTERFACE_NAME = "android.wifi.mockwifimodem.nl80211";
private static CountDownLatch[] sLatches;
@@ -121,6 +121,9 @@
return complete;
}
+ /**
+ * Configures a mock client interface.
+ */
public boolean configureClientInterfaceMock(String ifaceName,
IClientInterfaceImp.ClientInterfaceMock clientInterfaceMock) {
if (sWifiNL80211ManagerImp == null) {
@@ -130,10 +133,26 @@
}
/**
+ * Configures a mock Wifi scanner interface.
+ */
+ public boolean configureWifiScannerInterfaceMock(String ifaceName,
+ IWifiScannerImp.WifiScannerInterfaceMock wifiScannerInterfaceMock) {
+ if (sWifiNL80211ManagerImp == null) {
+ return false;
+ }
+ return sWifiNL80211ManagerImp.configureWifiScannerInterfaceMock(ifaceName,
+ wifiScannerInterfaceMock);
+ }
+
+ /**
* Gets all configured methods from all mocked HALs.
*/
public String getAllConfiguredMethods() {
// Get configured methods from all mocked HALs. (Now only supports WifiNL80211ManagerImp).
return sWifiNL80211ManagerImp.getConfiguredMethods();
}
+
+ public WifiNL80211ManagerImp getWifiNL80211ManagerImp() {
+ return sWifiNL80211ManagerImp;
+ }
}
diff --git a/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemServiceConnector.java b/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemServiceConnector.java
index e80ebdc..bddeb50 100644
--- a/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemServiceConnector.java
+++ b/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/MockWifiModemServiceConnector.java
@@ -218,6 +218,7 @@
if (mMockWifiModemServiceConn != null) {
mContext.unbindService(mMockWifiModemServiceConn);
mMockWifiModemService = null;
+ mMockWifiModemServiceConn = null;
}
return isComplete;
diff --git a/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/nl80211/IWifiScannerImp.java b/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/nl80211/IWifiScannerImp.java
index 639ffde..0e0082e 100644
--- a/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/nl80211/IWifiScannerImp.java
+++ b/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/nl80211/IWifiScannerImp.java
@@ -22,30 +22,116 @@
import android.net.wifi.nl80211.NativeScanResult;
import android.net.wifi.nl80211.PnoSettings;
import android.net.wifi.nl80211.SingleScanSettings;
+import android.os.RemoteException;
+import android.util.ArraySet;
import android.util.Log;
+import java.util.Collections;
+import java.util.Set;
+
public class IWifiScannerImp extends IWifiScannerImpl.Stub {
private static final String TAG = "IWifiScannerImp";
private String mIfaceName;
+ private WifiScannerInterfaceMock mWifiScannerInterfaceMock;
+ private IPnoScanEvent mIPnoScanEvent;
+ private IScanEvent mScanEventHandler;
+
+ public interface WifiScannerInterfaceMock {
+ default NativeScanResult[] getScanResults() {
+ return null;
+ }
+ default NativeScanResult[] getPnoScanResults() {
+ return null;
+ }
+ /**
+ * Configures a start Pno scan interface.
+ */
+ default boolean startPnoScan(PnoSettings pnoSettings) {
+ return false;
+ }
+ }
public IWifiScannerImp(String ifaceName) {
mIfaceName = ifaceName;
}
+ private boolean isMethodOverridden(WifiScannerInterfaceMock wifiScannerInterfaceMock,
+ String methodName) throws NoSuchMethodException {
+ if (methodName.equals("startPnoScan")) {
+ return wifiScannerInterfaceMock.getClass().getMethod(
+ methodName, PnoSettings.class).getDeclaringClass().equals(
+ WifiScannerInterfaceMock.class);
+ }
+ if (methodName.equals("subscribePnoScanEvents")) {
+ return !wifiScannerInterfaceMock.getClass().getMethod(
+ methodName, IPnoScanEvent.class).getDeclaringClass().equals(
+ WifiScannerInterfaceMock.class);
+ }
+ return !wifiScannerInterfaceMock.getClass().getMethod(
+ methodName).getDeclaringClass().equals(WifiScannerInterfaceMock.class);
+ }
+
+ /**
+ * Overridden method check.
+ */
+ public Set<String> setWifiScannerInterfaceMock(
+ WifiScannerInterfaceMock wifiScannerInterfaceMock) {
+ if (wifiScannerInterfaceMock == null) {
+ return Collections.emptySet();
+ }
+ Set<String> overriddenMethods = new ArraySet<>();
+ try {
+ if (isMethodOverridden(wifiScannerInterfaceMock, "getScanResults")) {
+ overriddenMethods.add("getScanResults");
+ }
+ if (isMethodOverridden(wifiScannerInterfaceMock, "getPnoScanResults")) {
+ overriddenMethods.add("getPnoScanResults");
+ }
+ if (isMethodOverridden(wifiScannerInterfaceMock, "startPnoScan")) {
+ overriddenMethods.add("startPnoScan");
+ }
+ } catch (NoSuchMethodException e) {
+ Log.e(TAG, "Reflection error: " + e);
+ return Collections.emptySet();
+ }
+ mWifiScannerInterfaceMock = wifiScannerInterfaceMock;
+ return overriddenMethods;
+ }
+
+ /**
+ * Trigger the scan ready event to force frameworks to get scan result again.
+ * Otherwise the mocked scan result may not work because the frameworks keep use cache data
+ * since there is no scan ready event.
+ */
+ public void mockScanResultReadyEvent() {
+ try {
+ if (mScanEventHandler != null) {
+ mScanEventHandler.OnScanResultReady();
+ }
+ } catch (RemoteException re) {
+ Log.e(TAG, "RemoteException when calling OnScanResultRead" + re);
+ }
+ }
// Supported methods in IWifiScannerImpl.aidl
@Override
public NativeScanResult[] getScanResults() {
Log.i(TAG, "getScanResults");
- // TODO: Mock it when we have a use (test) case.
- return null;
+ if (mWifiScannerInterfaceMock == null) {
+ Log.e(TAG, "mWifiScannerInterfaceMock: null!");
+ return null;
+ }
+ return mWifiScannerInterfaceMock.getScanResults();
}
@Override
public NativeScanResult[] getPnoScanResults() {
Log.i(TAG, "getPnoScanResults");
- // TODO: Mock it when we have a use (test) case.
- return null;
+ if (mWifiScannerInterfaceMock == null) {
+ Log.e(TAG, "mWifiScannerInterfaceMock: null!");
+ return null;
+ }
+ return mWifiScannerInterfaceMock.getPnoScanResults();
}
@Override
@@ -65,7 +151,7 @@
@Override
public void subscribeScanEvents(IScanEvent handler) {
Log.i(TAG, "subscribeScanEvents");
- // TODO: Mock it when we have a use (test) case.
+ mScanEventHandler = handler;
}
@Override
@@ -77,7 +163,7 @@
@Override
public void subscribePnoScanEvents(IPnoScanEvent handler) {
Log.i(TAG, "subscribePnoScanEvents");
- // TODO: Mock it when we have a use (test) case.
+ this.mIPnoScanEvent = handler;
}
@Override
@@ -89,8 +175,16 @@
@Override
public boolean startPnoScan(PnoSettings pnoSettings) {
Log.i(TAG, "startPnoScan");
- // TODO: Mock it when we have a use (test) case.
- return false;
+ if (mWifiScannerInterfaceMock == null || mIPnoScanEvent == null) {
+ Log.e(TAG, "startPnoScan: false mock!");
+ return false;
+ }
+ try {
+ mIPnoScanEvent.OnPnoNetworkFound();
+ } catch (RemoteException e) {
+ Log.d(TAG, "Failed to start pno scan due to remote exception");
+ }
+ return true;
}
@Override
diff --git a/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/nl80211/WifiNL80211ManagerImp.java b/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/nl80211/WifiNL80211ManagerImp.java
index 11c1e88..1967d6b 100644
--- a/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/nl80211/WifiNL80211ManagerImp.java
+++ b/tests/tests/wifi/mockWifi/src/android/wifi/mockwifi/nl80211/WifiNL80211ManagerImp.java
@@ -38,6 +38,7 @@
private static Context sContext;
Set<String> mConfiguredMethodSet;
private HashMap<String, IClientInterfaceImp> mMockIClientInterfaces = new HashMap<>();
+ private HashMap<String, IWifiScannerImp> mMockIWifiScanners = new HashMap<>();
public WifiNL80211ManagerImp(Context context) {
sContext = context;
@@ -53,7 +54,10 @@
@Override
public IClientInterface createClientInterface(String ifaceName) {
IClientInterfaceImp mockIClientInterface = new IClientInterfaceImp(ifaceName);
+ IWifiScannerImp mockIWifiScanner = (IWifiScannerImp) mockIClientInterface
+ .getWifiScannerImpl();
mMockIClientInterfaces.put(ifaceName, mockIClientInterface);
+ mMockIWifiScanners.put(ifaceName, mockIWifiScanner);
return mockIClientInterface;
}
@@ -150,6 +154,7 @@
public boolean configureClientInterfaceMock(String ifaceName,
IClientInterfaceImp.ClientInterfaceMock clientInterfaceMock) {
+ if (mMockIClientInterfaces == null) return false;
IClientInterfaceImp clientInterface = mMockIClientInterfaces.get(ifaceName);
if (clientInterface == null) return false;
Set<String> configuredMethods = clientInterface.setClientInterfaceMock(clientInterfaceMock);
@@ -161,6 +166,29 @@
return true;
}
+ /**
+ * Configures a mock Wifi scanner interface.
+ */
+ public boolean configureWifiScannerInterfaceMock(String ifaceName,
+ IWifiScannerImp.WifiScannerInterfaceMock wifiScannerInterfaceMock) {
+ if (mMockIWifiScanners == null) {
+ return false;
+ }
+ IWifiScannerImp wifiscanner = mMockIWifiScanners.get(ifaceName);
+ if (wifiscanner == null || wifiScannerInterfaceMock == null) {
+ Log.e(TAG, "WifiScanner interface mock: Null!");
+ return false;
+ }
+ Set<String> configuredMethods = wifiscanner.setWifiScannerInterfaceMock(
+ wifiScannerInterfaceMock);
+ if (configuredMethods.isEmpty()) {
+ Log.e(TAG, "No methods overridden in the mock WifiScanner!?");
+ return false;
+ }
+ mConfiguredMethodSet.addAll(configuredMethods);
+ return true;
+ }
+
public String getConfiguredMethods() {
StringBuilder sbuf = new StringBuilder();
for (String methodName : mConfiguredMethodSet) {
@@ -169,4 +197,21 @@
}
return sbuf.toString();
}
+
+ /**
+ * Trigger the scan ready event to force frameworks to get scan result again.
+ * Otherwise the mocked scan result may not work because the frameworks keep use cache data
+ * since there is no scan ready event.
+ */
+ public void mockScanResultReadyEvent(String ifaceName) {
+ if (mMockIWifiScanners == null || ifaceName == null) {
+ return;
+ }
+ IWifiScannerImp wifiscanner = mMockIWifiScanners.get(ifaceName);
+ if (wifiscanner == null) {
+ Log.e(TAG, "WifiScanner interface mock: Null!");
+ return;
+ }
+ wifiscanner.mockScanResultReadyEvent();
+ }
}
diff --git a/tests/tests/wifi/src/android/net/wifi/cts/WifiManagerTest.java b/tests/tests/wifi/src/android/net/wifi/cts/WifiManagerTest.java
index 3e497f8..9d0077a 100644
--- a/tests/tests/wifi/src/android/net/wifi/cts/WifiManagerTest.java
+++ b/tests/tests/wifi/src/android/net/wifi/cts/WifiManagerTest.java
@@ -191,6 +191,7 @@
private static final int SCAN_TEST_WAIT_DURATION_MS = 15_000;
private static final int TEST_WAIT_DURATION_MS = 10_000;
private static final int WIFI_CONNECT_TIMEOUT_MILLIS = 30_000;
+ private static final int WIFI_OFF_ON_TIMEOUT_MILLIS = 5_000;
private static final int WIFI_PNO_CONNECT_TIMEOUT_MILLIS = 90_000;
private static final int WAIT_MSEC = 60;
private static final int DURATION_SCREEN_TOGGLE = 2000;
@@ -1149,27 +1150,32 @@
if (!mWifiManager.isPortableHotspotSupported()) {
return;
}
+ runWithScanning(() -> {
+ boolean wifiEnabled = mWifiManager.isWifiEnabled();
+ if (wifiEnabled) {
+ // Re-enabled Wi-Fi as shell for HalDeviceManager legacy LOHS behavior when there's
+ // no STA+AP concurrency.
+ ShellIdentityUtils.invokeWithShellPermissions(() ->
+ mWifiManager.setWifiEnabled(false));
+ PollingCheck.check("Wifi turn off failed!", WIFI_OFF_ON_TIMEOUT_MILLIS,
+ () -> !mWifiManager.isWifiEnabled());
+ SystemUtil.runShellCommand("cmd wifi set-wifi-enabled enabled");
+ PollingCheck.check("Wifi turn on failed!", WIFI_OFF_ON_TIMEOUT_MILLIS,
+ () -> mWifiManager.isWifiEnabled());
+ }
+ TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot();
- boolean wifiEnabled = mWifiManager.isWifiEnabled();
- if (wifiEnabled) {
- // Re-enabled Wi-Fi as shell for HalDeviceManager legacy LOHS behavior when there's no
- // STA+AP concurrency.
- ShellIdentityUtils.invokeWithShellPermissions(() -> mWifiManager.setWifiEnabled(false));
- PollingCheck.check("Wifi turn off failed!", 2_000, () -> !mWifiManager.isWifiEnabled());
- SystemUtil.runShellCommand("cmd wifi set-wifi-enabled enabled");
- PollingCheck.check("Wifi turn on failed!", 2_000, () -> mWifiManager.isWifiEnabled());
- }
- TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot();
+ // add sleep to avoid calling stopLocalOnlyHotspot before TetherController
+ // initialization.
+ // TODO: remove this sleep as soon as b/124330089 is fixed.
+ Log.d(TAG, "Sleeping for 2 seconds");
+ Thread.sleep(2000);
- // add sleep to avoid calling stopLocalOnlyHotspot before TetherController initialization.
- // TODO: remove this sleep as soon as b/124330089 is fixed.
- Log.d(TAG, "Sleeping for 2 seconds");
- Thread.sleep(2000);
+ stopLocalOnlyHotspot(callback, wifiEnabled);
- stopLocalOnlyHotspot(callback, wifiEnabled);
-
- // wifi should either stay on, or come back on
- assertEquals(wifiEnabled, mWifiManager.isWifiEnabled());
+ // wifi should either stay on, or come back on
+ assertEquals(wifiEnabled, mWifiManager.isWifiEnabled());
+ }, false);
}
/**
@@ -2003,48 +2009,55 @@
return;
}
- boolean caughtException = false;
+ runWithScanning(() -> {
+ boolean caughtException = false;
+ boolean wifiEnabled = mWifiManager.isWifiEnabled();
+ if (wifiEnabled) {
+ // Re-enabled Wi-Fi as shell for HalDeviceManager legacy LOHS behavior when there's
+ // no STA+AP concurrency.
+ ShellIdentityUtils.invokeWithShellPermissions(() ->
+ mWifiManager.setWifiEnabled(false));
+ PollingCheck.check("Wifi turn off failed!", WIFI_OFF_ON_TIMEOUT_MILLIS,
+ () -> !mWifiManager.isWifiEnabled());
+ SystemUtil.runShellCommand("cmd wifi set-wifi-enabled enabled");
+ PollingCheck.check("Wifi turn on failed!", WIFI_OFF_ON_TIMEOUT_MILLIS,
+ () -> mWifiManager.isWifiEnabled());
+ }
- boolean wifiEnabled = mWifiManager.isWifiEnabled();
- if (wifiEnabled) {
- // Re-enabled Wi-Fi as shell for HalDeviceManager legacy LOHS behavior when there's no
- // STA+AP concurrency.
- ShellIdentityUtils.invokeWithShellPermissions(() -> mWifiManager.setWifiEnabled(false));
- PollingCheck.check("Wifi turn off failed!", 2_000, () -> !mWifiManager.isWifiEnabled());
- SystemUtil.runShellCommand("cmd wifi set-wifi-enabled enabled");
- PollingCheck.check("Wifi turn on failed!", 2_000, () -> mWifiManager.isWifiEnabled());
- }
+ TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot();
- TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot();
+ // now make a second request - this should fail.
+ TestLocalOnlyHotspotCallback callback2 = new TestLocalOnlyHotspotCallback(mLock);
+ try {
+ mWifiManager.startLocalOnlyHotspot(callback2, null);
+ } catch (IllegalStateException e) {
+ Log.d(TAG, "Caught the IllegalStateException we expected: called startLOHS twice");
+ caughtException = true;
+ }
+ if (!caughtException) {
+ // second start did not fail, should clean up the hotspot.
- // now make a second request - this should fail.
- TestLocalOnlyHotspotCallback callback2 = new TestLocalOnlyHotspotCallback(mLock);
- try {
- mWifiManager.startLocalOnlyHotspot(callback2, null);
- } catch (IllegalStateException e) {
- Log.d(TAG, "Caught the IllegalStateException we expected: called startLOHS twice");
- caughtException = true;
- }
- if (!caughtException) {
- // second start did not fail, should clean up the hotspot.
+ // add sleep to avoid calling stopLocalOnlyHotspot before TetherController
+ // initialization.
+ // TODO: remove this sleep as soon as b/124330089 is fixed.
+ Log.d(TAG, "Sleeping for 2 seconds");
+ Thread.sleep(2000);
- // add sleep to avoid calling stopLocalOnlyHotspot before TetherController initialization.
+ stopLocalOnlyHotspot(callback2, wifiEnabled);
+ }
+ assertTrue(caughtException);
+
+ // add sleep to avoid calling stopLocalOnlyHotspot before TetherController
+ // initialization.
// TODO: remove this sleep as soon as b/124330089 is fixed.
Log.d(TAG, "Sleeping for 2 seconds");
Thread.sleep(2000);
- stopLocalOnlyHotspot(callback2, wifiEnabled);
- }
- assertTrue(caughtException);
-
- // add sleep to avoid calling stopLocalOnlyHotspot before TetherController initialization.
- // TODO: remove this sleep as soon as b/124330089 is fixed.
- Log.d(TAG, "Sleeping for 2 seconds");
- Thread.sleep(2000);
-
- stopLocalOnlyHotspot(callback, wifiEnabled);
+ stopLocalOnlyHotspot(callback, wifiEnabled);
+ }, false);
}
+
private static class TestExecutor implements Executor {
private ConcurrentLinkedQueue<Runnable> tasks = new ConcurrentLinkedQueue<>();
@@ -2584,7 +2597,7 @@
/**
* Verify that the {@link android.Manifest.permission#WIFI_UPDATE_USABILITY_STATS_SCORE}
- * permission is held by at most one application.
+ * permission is held by at most two applications.
*/
public void testUpdateWifiUsabilityStatsScorePermission() {
if (!WifiFeature.isWifiSupported(getContext())) {
@@ -2612,10 +2625,10 @@
uniqueNonSystemPackageNames.add(packageName);
}
- if (uniqueNonSystemPackageNames.size() > 1) {
+ if (uniqueNonSystemPackageNames.size() > 2) {
fail("The WIFI_UPDATE_USABILITY_STATS_SCORE permission must not be held by more than "
- + "one application, but is held by " + uniqueNonSystemPackageNames.size()
- + " applications: " + String.join(", ", uniqueNonSystemPackageNames));
+ + "two applications, but is held by " + uniqueNonSystemPackageNames.size()
+ + " applications: " + String.join(", ", uniqueNonSystemPackageNames));
}
}
@@ -2865,14 +2878,14 @@
Log.d(TAG, "Turn off WiFi");
mWifiManager.setWifiEnabled(false);
PollingCheck.check(
- "Wifi turn off failed!", 2_000,
+ "Wifi turn off failed!", WIFI_OFF_ON_TIMEOUT_MILLIS,
() -> mWifiManager.isWifiEnabled() == false);
}
if (mWifiManager.isWifiApEnabled()) {
mTetheringManager.stopTethering(ConnectivityManager.TETHERING_WIFI);
Log.d(TAG, "Turn off tethered Hotspot");
PollingCheck.check(
- "SoftAp turn off failed!", 2_000,
+ "SoftAp turn off failed!", WIFI_OFF_ON_TIMEOUT_MILLIS,
() -> mWifiManager.isWifiApEnabled() == false);
}
}
@@ -3043,7 +3056,7 @@
turnOffWifiAndTetheredHotspotIfEnabled();
mWifiManager.setWifiEnabled(true);
PollingCheck.check(
- "Wifi turn on failed!", 2_000,
+ "Wifi turn on failed!", WIFI_OFF_ON_TIMEOUT_MILLIS,
() -> mWifiManager.isWifiEnabled() == true);
turnOffWifiAndTetheredHotspotIfEnabled();
verifyRegisterSoftApCallback(executor, callback);
@@ -3112,7 +3125,7 @@
turnOffWifiAndTetheredHotspotIfEnabled();
mWifiManager.setWifiEnabled(true);
PollingCheck.check(
- "Wifi turn on failed!", 2_000,
+ "Wifi turn on failed!", WIFI_OFF_ON_TIMEOUT_MILLIS,
() -> mWifiManager.isWifiEnabled() == true);
turnOffWifiAndTetheredHotspotIfEnabled();
verifyRegisterSoftApCallback(executor, callback);
@@ -3847,29 +3860,32 @@
}
assertTrue(mWifiManager.isWifiEnabled());
- // Re-enabled Wi-Fi as shell for HalDeviceManager legacy LOHS behavior when there's no
- // STA+AP concurrency.
- ShellIdentityUtils.invokeWithShellPermissions(() -> mWifiManager.setWifiEnabled(false));
- PollingCheck.check("Wifi turn off failed!", 2_000, () -> !mWifiManager.isWifiEnabled());
- SystemUtil.runShellCommand("cmd wifi set-wifi-enabled enabled");
- PollingCheck.check("Wifi turn on failed!", 2_000, () -> mWifiManager.isWifiEnabled());
+ runWithScanning(() -> {
+ // Re-enabled Wi-Fi as shell for HalDeviceManager legacy LOHS behavior when there's no
+ // STA+AP concurrency.
+ ShellIdentityUtils.invokeWithShellPermissions(() -> mWifiManager.setWifiEnabled(false));
+ PollingCheck.check("Wifi turn off failed!", 2_000, () -> !mWifiManager.isWifiEnabled());
+ SystemUtil.runShellCommand("cmd wifi set-wifi-enabled enabled");
+ PollingCheck.check("Wifi turn on failed!", WIFI_OFF_ON_TIMEOUT_MILLIS,
+ () -> mWifiManager.isWifiEnabled());
- boolean isStaApConcurrencySupported = mWifiManager.isStaApConcurrencySupported();
- // start local only hotspot.
- TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot();
- try {
- if (isStaApConcurrencySupported) {
- assertTrue(mWifiManager.isWifiEnabled());
- } else {
- // no concurrency, wifi should be disabled.
- assertFalse(mWifiManager.isWifiEnabled());
+ boolean isStaApConcurrencySupported = mWifiManager.isStaApConcurrencySupported();
+ // start local only hotspot.
+ TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot();
+ try {
+ if (isStaApConcurrencySupported) {
+ assertTrue(mWifiManager.isWifiEnabled());
+ } else {
+ // no concurrency, wifi should be disabled.
+ assertFalse(mWifiManager.isWifiEnabled());
+ }
+ } finally {
+ // clean up local only hotspot no matter if assertion passed or failed
+ stopLocalOnlyHotspot(callback, true);
}
- } finally {
- // clean up local only hotspot no matter if assertion passed or failed
- stopLocalOnlyHotspot(callback, true);
- }
- assertTrue(mWifiManager.isWifiEnabled());
+ assertTrue(mWifiManager.isWifiEnabled());
+ }, false);
}
/**
@@ -3967,7 +3983,7 @@
boolean newState = !currState;
mWifiManager.setScanAlwaysAvailable(newState);
PollingCheck.check(
- "Wifi settings toggle failed!",
+ "Wifi scanning toggle failed!",
DURATION_SETTINGS_TOGGLE,
() -> mWifiManager.isScanAlwaysAvailable() == newState);
assertEquals(newState, mWifiManager.isScanAlwaysAvailable());
diff --git a/tests/tests/wifi/src/android/net/wifi/mockwifi/cts/MockWifiTest.java b/tests/tests/wifi/src/android/net/wifi/mockwifi/cts/MockWifiTest.java
index c30249d..68f4fb4 100644
--- a/tests/tests/wifi/src/android/net/wifi/mockwifi/cts/MockWifiTest.java
+++ b/tests/tests/wifi/src/android/net/wifi/mockwifi/cts/MockWifiTest.java
@@ -21,6 +21,7 @@
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
@@ -32,20 +33,28 @@
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.LinkProperties;
+import android.net.MacAddress;
import android.net.Network;
import android.net.NetworkInfo;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
+import android.net.wifi.WifiSsid;
import android.net.wifi.cts.WifiFeature;
+import android.net.wifi.cts.WifiManagerTest.Mutable;
+import android.net.wifi.nl80211.NativeScanResult;
+import android.net.wifi.nl80211.RadioChainInfo;
import android.os.Build;
import android.os.PowerManager;
+import android.os.SystemClock;
import android.platform.test.annotations.AppModeFull;
import android.support.test.uiautomator.UiDevice;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.wifi.mockwifi.MockWifiModemManager;
import android.wifi.mockwifi.nl80211.IClientInterfaceImp;
+import android.wifi.mockwifi.nl80211.IWifiScannerImp;
+import android.wifi.mockwifi.nl80211.WifiNL80211ManagerImp;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SdkSuppress;
@@ -61,7 +70,11 @@
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicReference;
@SmallTest
@RunWith(AndroidJUnit4.class)
@@ -72,6 +85,8 @@
private static final int TEST_WAIT_DURATION_MS = 10_000;
private static final int WAIT_MS = 60;
private static final int WIFI_CONNECT_TIMEOUT_MS = 30_000;
+ private static final int WIFI_DISCONNECT_TIMEOUT_MS = 30_000;
+ private static final int WIFI_PNO_CONNECT_TIMEOUT_MILLIS = 90_000;
private static Context sContext;
private static boolean sShouldRunTest = false;
@@ -95,9 +110,13 @@
private static boolean sWasVerboseLoggingEnabled;
private static boolean sWasScanThrottleEnabled;
private static List<ScanResult> sScanResults = null;
+ private static MockWifiModemManager sMockModemManager;
private static NetworkInfo sNetworkInfo =
new NetworkInfo(ConnectivityManager.TYPE_WIFI, TelephonyManager.NETWORK_TYPE_UNKNOWN,
"wifi", "unknown");
+ private static int sTestAccessPointFrequency = 0;
+
+ private final Object mLock = new Object();
private static void turnScreenOnNoDelay() throws Exception {
if (sWakeLock.isHeld()) sWakeLock.release();
@@ -105,6 +124,10 @@
sUiDevice.executeShellCommand("wm dismiss-keyguard");
}
+ private static void turnScreenOffNoDelay() throws Exception {
+ sUiDevice.executeShellCommand("input keyevent KEYCODE_SLEEP");
+ }
+
private static final BroadcastReceiver sReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
@@ -157,6 +180,8 @@
sWifiManager = sContext.getSystemService(WifiManager.class);
assertThat(sWifiManager).isNotNull();
sConnectivityManager = sContext.getSystemService(ConnectivityManager.class);
+ sMockModemManager = new MockWifiModemManager(sContext);
+ assertNotNull(sMockModemManager);
// turn on verbose logging for tests
sWasVerboseLoggingEnabled = ShellIdentityUtils.invokeWithShellPermissions(
@@ -218,6 +243,12 @@
sWifiManager.startScan();
waitForConnection(); // ensures that there is at-least 1 saved network on the device.
+ if (sTestAccessPointFrequency == 0) {
+ WifiInfo currentNetwork = ShellIdentityUtils.invokeWithShellPermissions(
+ sWifiManager::getConnectionInfo);
+ sTestAccessPointFrequency = currentNetwork.getFrequency();
+ assertNotEquals("Invalid Access-point frequency", sTestAccessPointFrequency, 0);
+ }
}
private static void setWifiEnabled(boolean enable) throws Exception {
@@ -263,26 +294,33 @@
waitForNetworkInfoState(NetworkInfo.State.CONNECTED, WIFI_CONNECT_TIMEOUT_MS);
}
+ private void waitForConnection(int timeoutMillis) throws Exception {
+ waitForNetworkInfoState(NetworkInfo.State.CONNECTED, timeoutMillis);
+ }
+
+ private void waitForDisconnection() throws Exception {
+ waitForNetworkInfoState(NetworkInfo.State.DISCONNECTED, WIFI_DISCONNECT_TIMEOUT_MS);
+ }
+
+ private String getIfaceName() {
+ Network wifiCurrentNetwork = sWifiManager.getCurrentNetwork();
+ assertNotNull(wifiCurrentNetwork);
+ LinkProperties wifiLinkProperties = sConnectivityManager.getLinkProperties(
+ wifiCurrentNetwork);
+ String mIfaceName = wifiLinkProperties.getInterfaceName();
+ return mIfaceName;
+ }
+
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
@Test
public void testMockSignalPollOnMockWifi() throws Exception {
int testRssi = -30;
-
- MockWifiModemManager sMockModemManager = new MockWifiModemManager(sContext);
- assertNotNull(sMockModemManager);
-
UiAutomation uiAutomation = InstrumentationRegistry.getInstrumentation().getUiAutomation();
try {
uiAutomation.adoptShellPermissionIdentity();
- Network wifiCurrentNetwork = sWifiManager.getCurrentNetwork();
- assertNotNull(wifiCurrentNetwork);
- LinkProperties wifiLinkProperties = sConnectivityManager.getLinkProperties(
- wifiCurrentNetwork);
- String ifaceName = wifiLinkProperties.getInterfaceName();
WifiInfo wifiInfo = sWifiManager.getConnectionInfo();
-
assertTrue(sMockModemManager.connectMockWifiModemService(sContext));
- assertTrue(sMockModemManager.configureClientInterfaceMock(ifaceName,
+ assertTrue(sMockModemManager.configureClientInterfaceMock(getIfaceName(),
new IClientInterfaceImp.ClientInterfaceMock() {
@Override
public int[] signalPoll() {
@@ -304,4 +342,173 @@
sMockModemManager.disconnectMockWifiModemService();
}
}
+
+ private NativeScanResult[] getMockNativeResults() {
+ byte[] testSsid =
+ new byte[] {'M', 'o', 'c', 'k', 'T', 'e', 's', 't', 'A', 'P'};
+ byte[] testBssid =
+ new byte[] {(byte) 0x12, (byte) 0xef, (byte) 0xa1,
+ (byte) 0x2c, (byte) 0x97, (byte) 0x8b};
+ byte[] testInfoElement =
+ new byte[] {(byte) 0x01, (byte) 0x03, (byte) 0x12, (byte) 0xbe, (byte) 0xff};
+ int testCapability = (0x1 << 2) | (0x1 << 5);
+ int[] radioChainIds = {0, 1};
+ int[] radioChainLevels = {-56, -65};
+
+ NativeScanResult scanResult = new NativeScanResult();
+ scanResult.ssid = testSsid;
+ scanResult.bssid = testBssid;
+ scanResult.infoElement = testInfoElement;
+ scanResult.frequency = sTestAccessPointFrequency;
+ // Add extra 4 seconds as the scan result timestamp to simulate the real behavior
+ // like scan result will return after scan triggered 4 ~ 6 seconds.
+ // It also avoid the timing issue cause scan result is filtered with old scan time.
+ scanResult.tsf = (SystemClock.elapsedRealtime() + 4) * 1000;
+ scanResult.capability = testCapability;
+ scanResult.radioChainInfos = new ArrayList<>(Arrays.asList(
+ new RadioChainInfo(radioChainIds[0], radioChainLevels[0]),
+ new RadioChainInfo(radioChainIds[1], radioChainLevels[1])));
+
+ NativeScanResult[] nativeScanResults = new NativeScanResult[1];
+ nativeScanResults[0] = scanResult;
+ return nativeScanResults;
+ }
+
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+ @Test
+ public void testMockPnoScanResultsOnMockWifi() throws Exception {
+ if (!sWifiManager.isPreferredNetworkOffloadSupported()) {
+ return;
+ }
+ UiAutomation uiAutomation = InstrumentationRegistry.getInstrumentation().getUiAutomation();
+ try {
+ uiAutomation.adoptShellPermissionIdentity();
+ WifiInfo currentNetwork = sWifiManager.getConnectionInfo();
+ assertTrue(sMockModemManager.connectMockWifiModemService(sContext));
+ assertTrue(sMockModemManager.configureWifiScannerInterfaceMock(getIfaceName(),
+ new IWifiScannerImp.WifiScannerInterfaceMock() {
+ @Override
+ public NativeScanResult[] getPnoScanResults() {
+ return getMockNativeResults();
+ }
+ }));
+
+ sMockModemManager.updateConfiguredMockedMethods();
+ List<WifiSsid> listOfSsids = new ArrayList<WifiSsid>();
+ for (NativeScanResult nativeScan : getMockNativeResults()) {
+ listOfSsids.add(WifiSsid.fromBytes(nativeScan.getSsid()));
+ }
+ AtomicReference<List<ScanResult>> mScanResults = new AtomicReference<>();
+ Mutable<Boolean> isQuerySucceeded = new Mutable<Boolean>(false);
+ sWifiManager.setExternalPnoScanRequest(listOfSsids,
+ null, Executors.newSingleThreadExecutor(),
+ new WifiManager.PnoScanResultsCallback() {
+ @Override
+ public void onScanResultsAvailable(List<ScanResult> scanResults) {
+ synchronized (mLock) {
+ mScanResults.set(scanResults);
+ Log.d(TAG, "Results from callback registered : " + mScanResults);
+ isQuerySucceeded.value = true;
+ mLock.notify();
+ }
+ }
+ @Override
+ public void onRegisterSuccess() {
+ synchronized (mLock) {
+ Log.d(TAG, "onRegisterSuccess");
+ mLock.notify();
+ }
+ }
+ @Override
+ public void onRegisterFailed(int reason) {
+ synchronized (mLock) {
+ mLock.notify();
+ }
+ }
+ @Override
+ public void onRemoved(int reason) {
+ synchronized (mLock) {
+ mLock.notify();
+ }
+ }
+ });
+ synchronized (mLock) {
+ long now = System.currentTimeMillis();
+ long deadline = now + TEST_WAIT_DURATION_MS;
+ while (!isQuerySucceeded.value && now < deadline) {
+ mLock.wait(deadline - now);
+ now = System.currentTimeMillis();
+ }
+ }
+ sWifiManager.disconnect();
+ waitForDisconnection();
+ turnScreenOffNoDelay();
+ sWifiManager.enableNetwork(currentNetwork.getNetworkId(), false);
+ waitForConnection(WIFI_PNO_CONNECT_TIMEOUT_MILLIS);
+ assertTrue(mScanResults.get().stream().allMatch(
+ p -> listOfSsids.contains(p.getWifiSsid())));
+ } finally {
+ turnScreenOnNoDelay();
+ sMockModemManager.disconnectMockWifiModemService();
+ uiAutomation.dropShellPermissionIdentity();
+ }
+ }
+
+ private NativeScanResult[] getMockZeroLengthSubElementIe() {
+ byte[] zeroSubElementIE = new byte[] {
+ (byte) 0xff, (byte) 0x10, (byte) 0x6b,
+ (byte) 0x10, (byte) 0x00, // Control
+ (byte) 0x08, (byte) 0x02, (byte) 0x34, (byte) 0x56, // Common Info
+ (byte) 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0x01,
+ (byte) 0x08, (byte) 0x00, (byte) 0x02, (byte) 0x00, // First Link Info
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, //
+ (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0x00, // Second Link Info
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 //
+ };
+ NativeScanResult[] zeroLengthSubElementIE = getMockNativeResults();
+ zeroLengthSubElementIE[0].infoElement = zeroSubElementIE;
+ return zeroLengthSubElementIE;
+ }
+
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+ @Test
+ public void testZeroLengthSubElementIEOnMockWifi() throws Exception {
+ UiAutomation uiAutomation = InstrumentationRegistry.getInstrumentation().getUiAutomation();
+ try {
+ final NativeScanResult[] mockScanData = getMockZeroLengthSubElementIe();
+ uiAutomation.adoptShellPermissionIdentity();
+ final String currentStaIfaceName = getIfaceName();
+ assertTrue(sMockModemManager.connectMockWifiModemService(sContext));
+ assertTrue(sMockModemManager.configureWifiScannerInterfaceMock(currentStaIfaceName,
+ new IWifiScannerImp.WifiScannerInterfaceMock() {
+ @Override
+ public NativeScanResult[] getScanResults() {
+ return mockScanData;
+ }
+ }));
+ sMockModemManager.updateConfiguredMockedMethods();
+ WifiNL80211ManagerImp mockedWifiNL80211Manager =
+ sMockModemManager.getWifiNL80211ManagerImp();
+ assertNotNull(mockedWifiNL80211Manager);
+ mockedWifiNL80211Manager.mockScanResultReadyEvent(currentStaIfaceName);
+ PollingCheck.check(
+ "getscanResults fail", 4_000,
+ () -> {
+ List<ScanResult> scanResults = sWifiManager.getScanResults();
+ if (scanResults.size() == 0) {
+ return false;
+ }
+ return (scanResults.get(0).getWifiSsid().equals(
+ WifiSsid.fromBytes(mockScanData[0].getSsid()))
+ && MacAddress.fromString(scanResults.get(0).BSSID).equals(
+ mockScanData[0].getBssid())
+ && scanResults.get(0).frequency == mockScanData[0].getFrequencyMhz()
+ && (scanResults.get(0).getApMloLinkId() == -1)
+ && (scanResults.get(0).getApMldMacAddress() == null));
+ });
+ } finally {
+ sMockModemManager.disconnectMockWifiModemService();
+ uiAutomation.dropShellPermissionIdentity();
+ }
+ }
}
diff --git a/tests/video/Android.bp b/tests/video/Android.bp
index b41a32c..2c444b9 100644
--- a/tests/video/Android.bp
+++ b/tests/video/Android.bp
@@ -26,10 +26,6 @@
"ctstestrunner-axt",
"cts-media-common",
],
- libs: [
- "android.test.runner",
- "android.test.base",
- ],
platform_apis: true,
jni_uses_sdk_apis: true,
jni_libs: [
diff --git a/tests/video/AndroidManifest.xml b/tests/video/AndroidManifest.xml
index 8cdc050..9d5b0a8 100644
--- a/tests/video/AndroidManifest.xml
+++ b/tests/video/AndroidManifest.xml
@@ -24,7 +24,6 @@
<application
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true">
- <uses-library android:name="android.test.runner" />
<activity android:name="android.video.cts.CodecTestActivity" />
</application>
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
diff --git a/tests/video/src/android/video/cts/VideoEncoderDecoderTest.java b/tests/video/src/android/video/cts/VideoEncoderDecoderTest.java
index 845a8ec..c456517 100644
--- a/tests/video/src/android/video/cts/VideoEncoderDecoderTest.java
+++ b/tests/video/src/android/video/cts/VideoEncoderDecoderTest.java
@@ -544,12 +544,14 @@
// that results in the SW codecs also running much faster (perhaps they are
// scheduled for the big cores as well)
// TODO: still verify lower bound.
- if ((MediaUtils.onFrankenDevice() || (infoEnc.mIsSoftware && !isPreferredAbi()))
- && error != null) {
- // ensure there is data, but don't insist that it is correct
- assertFalse(error, error.startsWith("Failed to get "));
- } else {
- assertNull(error, error);
+ if (error != null) {
+ if (MediaUtils.onFrankenDevice() || Build.IS_EMULATOR
+ || (infoEnc.mIsSoftware && !isPreferredAbi())) {
+ // ensure there is data, but don't insist that it is correct
+ assertFalse(error, error.startsWith("Failed to get "));
+ } else {
+ fail("encountered error " + error);
+ }
}
}
assertTrue(success);
diff --git a/tests/videocodec/AndroidManifest.xml b/tests/videocodec/AndroidManifest.xml
index 14e2f31..4cbd7bb 100644
--- a/tests/videocodec/AndroidManifest.xml
+++ b/tests/videocodec/AndroidManifest.xml
@@ -25,7 +25,6 @@
android:requestLegacyExternalStorage="true"
android:largeHeap="true"
android:usesCleartextTraffic="true">
- <uses-library android:name="android.test.runner" />
</application>
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="29" />
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
diff --git a/tests/videocodec/AndroidTest.xml b/tests/videocodec/AndroidTest.xml
index cd1ccdf..7bea1e8 100644
--- a/tests/videocodec/AndroidTest.xml
+++ b/tests/videocodec/AndroidTest.xml
@@ -26,7 +26,7 @@
</target_preparer>
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.MediaPreparer">
<option name="push-all" value="true" />
- <option name="media-folder-name" value="CtsVideoCodecTestCases-1.2" />
+ <option name="media-folder-name" value="CtsVideoCodecTestCases-2.1" />
<option name="dynamic-config-module" value="CtsVideoCodecTestCases" />
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
diff --git a/tests/videocodec/DynamicConfig.xml b/tests/videocodec/DynamicConfig.xml
index ad07415..270b1e1 100644
--- a/tests/videocodec/DynamicConfig.xml
+++ b/tests/videocodec/DynamicConfig.xml
@@ -1,5 +1,5 @@
<dynamicConfig>
<entry key="media_files_url">
- <value>https://dl.google.com/android/xts/cts/tests/videocodec/CtsVideoCodecTestCases-1.2.zip</value>
+ <value>https://dl.google.com/android/xts/cts/tests/videocodec/CtsVideoCodecTestCases-2.1.zip</value>
</entry>
</dynamicConfig>
diff --git a/tests/videocodec/README.md b/tests/videocodec/README.md
index 853d304..6bcc703 100644
--- a/tests/videocodec/README.md
+++ b/tests/videocodec/README.md
@@ -1,7 +1,7 @@
## Video Codec CTS Tests
The tests present in this folder are an extension of tests at cts/tests/tests/media/encoder/.
-The test vectors used by the test suite is available at [link](https://dl.google.com/android/xts/cts/tests/videocodec/CtsVideoCodecTestCases-1.2.zip) and is downloaded automatically while running tests. Manual installation of these can be done using copy_media.sh script in this directory.
+The test vectors used by the test suite is available at [link](https://dl.google.com/android/xts/cts/tests/videocodec/CtsVideoCodecTestCases-2.1.zip) and is downloaded automatically while running tests. Manual installation of these can be done using copy_media.sh script in this directory.
### Commands
```sh
diff --git a/tests/videocodec/copy_media.sh b/tests/videocodec/copy_media.sh
index bb8c730..537f22e 100755
--- a/tests/videocodec/copy_media.sh
+++ b/tests/videocodec/copy_media.sh
@@ -17,7 +17,7 @@
## script to install cts video test files manually
adbOptions=" "
-resLabel=CtsVideoCodecTestCases-1.2
+resLabel=CtsVideoCodecTestCases-2.1
srcDir="/tmp/$resLabel"
tgtDir="/sdcard/test"
usage="Usage: $0 [-h] [-s serial]"
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderAdaptiveBitRateTest.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderAdaptiveBitRateTest.java
index fbf2214..23fa8d9 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderAdaptiveBitRateTest.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderAdaptiveBitRateTest.java
@@ -22,30 +22,24 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeNotNull;
import static org.junit.Assume.assumeTrue;
import android.media.MediaCodec;
import android.media.MediaFormat;
import android.mediav2.common.cts.EncoderConfigParams;
-import android.mediav2.common.cts.RawResource;
import android.os.Bundle;
import com.android.compatibility.common.util.ApiTest;
import com.android.compatibility.common.util.CddTest;
-import org.junit.AfterClass;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
/**
@@ -71,9 +65,7 @@
*/
@RunWith(Parameterized.class)
public class VideoEncoderAdaptiveBitRateTest extends VideoEncoderValidationTestBase {
- private static final String LOG_TAG = VideoEncoderAdaptiveBitRateTest.class.getSimpleName();
private static final List<Object[]> exhaustiveArgsList = new ArrayList<>();
- private static final HashMap<String, RawResource> RES_YUV_MAP = new HashMap<>();
private static final int SEGMENT_DURATION = 3;
private static final int[] SEGMENT_BITRATES_FULLHD =
new int[]{5000000, 8000000, 12000000, 8000000, 5000000};
@@ -96,51 +88,33 @@
.build();
}
- private static void addParams(int width, int height, int[] segmentBitRates,
- CompressedResource res) {
+ private static void addParams(int width, int height, int[] segmentBitRates) {
final String[] mediaTypes = new String[]{MediaFormat.MIMETYPE_VIDEO_AVC,
MediaFormat.MIMETYPE_VIDEO_HEVC, MediaFormat.MIMETYPE_VIDEO_AV1};
final int[] bitRateModes = new int[]{BITRATE_MODE_CBR, BITRATE_MODE_VBR};
for (String mediaType : mediaTypes) {
for (int bitRateMode : bitRateModes) {
- // mediaType, cfg, segment bitrates, res, test label
+ // mediaType, cfg, segment bitrates, test label
String label = String.format("%dx%d_%s", width, height,
bitRateModeToString(bitRateMode));
exhaustiveArgsList.add(new Object[]{mediaType, getVideoEncoderCfgParams(mediaType,
- width, height, segmentBitRates[0], bitRateMode), segmentBitRates, res,
- label});
+ width, height, segmentBitRates[0], bitRateMode), segmentBitRates, label});
}
}
}
- @Parameterized.Parameters(name = "{index}_{0}_{1}_{5}")
+ @Parameterized.Parameters(name = "{index}_{0}_{1}_{4}")
public static Collection<Object[]> input() {
- addParams(1920, 1080, SEGMENT_BITRATES_FULLHD, BIRTHDAY_FULLHD_LANDSCAPE);
- addParams(1080, 1920, SEGMENT_BITRATES_FULLHD, SELFIEGROUP_FULLHD_PORTRAIT);
- addParams(1280, 720, SEGMENT_BITRATES_HD, BIRTHDAY_FULLHD_LANDSCAPE);
+ addParams(1920, 1080, SEGMENT_BITRATES_FULLHD);
+ addParams(1080, 1920, SEGMENT_BITRATES_FULLHD);
+ addParams(1280, 720, SEGMENT_BITRATES_HD);
return prepareParamList(exhaustiveArgsList, true, false, true, false, HARDWARE);
}
- @BeforeClass
- public static void decodeResourcesToYuv() {
- ArrayList<CompressedResource> resources = new ArrayList<>();
- for (Object[] arg : exhaustiveArgsList) {
- resources.add((CompressedResource) arg[3]);
- }
- decodeStreamsToYuv(resources, RES_YUV_MAP, LOG_TAG);
- }
-
- @AfterClass
- public static void cleanUpResources() {
- for (RawResource res : RES_YUV_MAP.values()) {
- new File(res.mFileName).delete();
- }
- }
-
public VideoEncoderAdaptiveBitRateTest(String encoder, String mediaType,
- EncoderConfigParams cfg, int[] segmentBitRates, CompressedResource res,
+ EncoderConfigParams cfg, int[] segmentBitRates,
@SuppressWarnings("unused") String testLabel, String allTestParams) {
- super(encoder, mediaType, cfg, res, allTestParams);
+ super(encoder, mediaType, cfg, allTestParams);
mSegmentBitRates = segmentBitRates;
mSegmentSizes = new float[segmentBitRates.length];
}
@@ -190,7 +164,7 @@
}
}
- @CddTest(requirements = "5.2/C-2-1")
+ @CddTest(requirements = {"5.2/C-2-1"})
@ApiTest(apis = "android.media.MediaCodec#PARAMETER_KEY_VIDEO_BITRATE")
@Test
public void testAdaptiveBitRate() throws IOException, InterruptedException,
@@ -206,11 +180,8 @@
assumeTrue("Encoder: " + mCodecName + " doesn't support format: " + format,
areFormatsSupported(mCodecName, mMediaType, formats));
- RawResource res = RES_YUV_MAP.getOrDefault(mCRes.uniqueLabel(), null);
- assumeNotNull("no raw resource found for testing config : " + mEncCfgParams[0] + mTestConfig
- + mTestEnv + DIAGNOSTICS, res);
int limit = mSegmentBitRates.length * SEGMENT_DURATION * mEncCfgParams[0].mFrameRate;
- encodeToMemory(mCodecName, mEncCfgParams[0], res, limit, true, false);
+ encodeToMemory(mCodecName, mEncCfgParams[0], limit, true, false);
assertEquals("encoder did not encode the requested number of frames \n" + mTestConfig
+ mTestEnv, mOutputCount, limit);
passFailCriteria(0, 1);
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderFrameRateTest.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderFrameRateTest.java
index f71867c..1962f01 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderFrameRateTest.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderFrameRateTest.java
@@ -20,27 +20,21 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeNotNull;
import static org.junit.Assume.assumeTrue;
import android.media.MediaFormat;
import android.mediav2.common.cts.EncoderConfigParams;
-import android.mediav2.common.cts.RawResource;
import com.android.compatibility.common.util.ApiTest;
-import org.junit.AfterClass;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
/**
@@ -60,29 +54,11 @@
*/
@RunWith(Parameterized.class)
public class VideoEncoderFrameRateTest extends VideoEncoderValidationTestBase {
- private static final String LOG_TAG = VideoEncoderFrameRateTest.class.getSimpleName();
private static final int KEY_FRAME_INTERVAL = 1;
private static final int FRAME_LIMIT = 300;
private static final int BASE_FRAME_RATE = 30;
private static final int BIT_RATE = 5000000;
private static final List<Object[]> exhaustiveArgsList = new ArrayList<>();
- private static final HashMap<String, RawResource> RES_YUV_MAP = new HashMap<>();
-
- @BeforeClass
- public static void decodeResourcesToYuv() {
- ArrayList<CompressedResource> resources = new ArrayList<>();
- for (Object[] arg : exhaustiveArgsList) {
- resources.add((CompressedResource) arg[2]);
- }
- decodeStreamsToYuv(resources, RES_YUV_MAP, LOG_TAG);
- }
-
- @AfterClass
- public static void cleanUpResources() {
- for (RawResource res : RES_YUV_MAP.values()) {
- new File(res.mFileName).delete();
- }
- }
private static EncoderConfigParams getVideoEncoderCfgParams(String mediaType, int width,
int height, int maxBFrames) {
@@ -96,13 +72,13 @@
.build();
}
- private static void addParams(int width, int height, CompressedResource res) {
+ private static void addParams(int width, int height) {
final String[] mediaTypes = new String[]{MediaFormat.MIMETYPE_VIDEO_AVC,
MediaFormat.MIMETYPE_VIDEO_HEVC, MediaFormat.MIMETYPE_VIDEO_AV1};
final int[] maxBFramesPerSubGop = new int[]{0, 1};
for (String mediaType : mediaTypes) {
for (int maxBFrames : maxBFramesPerSubGop) {
- // mediaType, cfg, resource file, test label
+ // mediaType, cfg, test label
if (!mediaType.equals(MediaFormat.MIMETYPE_VIDEO_AVC)
&& !mediaType.equals((MediaFormat.MIMETYPE_VIDEO_HEVC))
&& maxBFrames != 0) {
@@ -111,22 +87,22 @@
String label = String.format("%dkbps_%dx%d_maxb-%d", BIT_RATE / 1000, width,
height, maxBFrames);
exhaustiveArgsList.add(new Object[]{mediaType, getVideoEncoderCfgParams(mediaType,
- width, height, maxBFrames), res, label});
+ width, height, maxBFrames), label});
}
}
}
- @Parameterized.Parameters(name = "{index}_{0}_{1}_{4}")
+ @Parameterized.Parameters(name = "{index}_{0}_{1}_{3}")
public static Collection<Object[]> input() {
- addParams(1920, 1080, BIRTHDAY_FULLHD_LANDSCAPE);
- addParams(1080, 1920, SELFIEGROUP_FULLHD_PORTRAIT);
+ addParams(1920, 1080);
+ addParams(1080, 1920);
return prepareParamList(exhaustiveArgsList, true, false, true, false, HARDWARE);
}
public VideoEncoderFrameRateTest(String encoder, String mediaType,
- EncoderConfigParams cfgParams, CompressedResource res,
- @SuppressWarnings("unused") String testLabel, String allTestParams) {
- super(encoder, mediaType, cfgParams, res, allTestParams);
+ EncoderConfigParams cfgParams, @SuppressWarnings("unused") String testLabel,
+ String allTestParams) {
+ super(encoder, mediaType, cfgParams, allTestParams);
}
@Before
@@ -142,9 +118,6 @@
float refFactor = -1.0f;
int refSize = -1;
boolean testSkipped = false;
- RawResource res = RES_YUV_MAP.getOrDefault(mCRes.uniqueLabel(), null);
- assumeNotNull("no raw resource found for testing config : " + mEncCfgParams[0] + mTestConfig
- + mTestEnv + DIAGNOSTICS, res);
for (float scaleFactor : scaleFactors) {
EncoderConfigParams cfg = mEncCfgParams[0].getBuilder()
.setFrameRate((int) (BASE_FRAME_RATE * scaleFactor)).build();
@@ -154,7 +127,7 @@
if (!areFormatsSupported(mCodecName, mMediaType, formats)) {
continue;
}
- encodeToMemory(mCodecName, cfg, res, FRAME_LIMIT, true, false);
+ encodeToMemory(mCodecName, cfg, FRAME_LIMIT, true, false);
assertEquals("encoder did not encode the requested number of frames \n" + mTestConfig
+ mTestEnv, FRAME_LIMIT, mOutputCount);
if (refFactor == -1.0) {
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderInput.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderInput.java
new file mode 100644
index 0000000..feeacda
--- /dev/null
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderInput.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2023 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.videocodec.cts;
+
+import android.media.MediaFormat;
+import android.mediav2.common.cts.EncoderConfigParams;
+import android.mediav2.common.cts.RawResource;
+
+import androidx.annotation.NonNull;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Class containing encoder input resources.
+ */
+public class VideoEncoderInput {
+ private static final String MEDIA_DIR = WorkDir.getMediaDirString();
+ public static final HashMap<String, RawResource> RES_YUV_MAP = new HashMap<>();
+
+ public static class CompressedResource {
+ final String mMediaType;
+ final String mResFile;
+
+ CompressedResource(String mediaType, String resFile) {
+ mMediaType = mediaType;
+ mResFile = resFile;
+ }
+
+ @NonNull
+ @Override
+ public String toString() {
+ return "CompressedResource{" + "res file ='" + mResFile + '\'' + '}';
+ }
+
+ public String uniqueLabel() {
+ return mMediaType + mResFile;
+ }
+ }
+
+ public static final CompressedResource BIRTHDAY_FULLHD_LANDSCAPE =
+ new CompressedResource(MediaFormat.MIMETYPE_VIDEO_AVC, MEDIA_DIR
+ + "AVICON-MOBILE-BirthdayHalfway-SI17-CRUW03-L-420-8bit-SDR-1080p-30fps.mp4");
+ public static final CompressedResource SELFIEGROUP_FULLHD_PORTRAIT =
+ new CompressedResource(MediaFormat.MIMETYPE_VIDEO_AVC, MEDIA_DIR
+ + "AVICON-MOBILE-SelfieGroupGarden-SF15-CF01-P-420-8bit-SDR-1080p-30fps.mp4");
+ public static final CompressedResource RIVER_HD_LANDSCAPE =
+ new CompressedResource(MediaFormat.MIMETYPE_VIDEO_AVC, MEDIA_DIR
+ + "AVICON-MOBILE-River-SO03-CRW01-L-420-8bit-SDR-720p-30fps.mp4");
+
+ private static int manhattanDistance(int w1, int h1, int w2, int h2) {
+ return Math.abs(w1 - w2) + Math.abs(h1 - h2);
+ }
+
+ public static RawResource getRawResource(EncoderConfigParams cfg) {
+ String key = null;
+ int closestDistance = Integer.MAX_VALUE;
+ for (Map.Entry<String, RawResource> element : RES_YUV_MAP.entrySet()) {
+ if (element.getValue() == null) continue;
+ int distance = manhattanDistance(cfg.mWidth, cfg.mHeight, element.getValue().mWidth,
+ element.getValue().mHeight);
+ if (distance < closestDistance) {
+ closestDistance = distance;
+ key = element.getKey();
+ }
+ }
+ return RES_YUV_MAP.get(key);
+ }
+
+ public static RawResource getRawResource(CompressedResource cRes) {
+ return RES_YUV_MAP.get(cRes.uniqueLabel());
+ }
+}
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderIntraFrameIntervalTest.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderIntraFrameIntervalTest.java
index 481bc45..29ce50e 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderIntraFrameIntervalTest.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderIntraFrameIntervalTest.java
@@ -25,28 +25,22 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeNotNull;
import android.media.MediaFormat;
import android.mediav2.common.cts.BitStreamUtils;
import android.mediav2.common.cts.EncoderConfigParams;
-import android.mediav2.common.cts.RawResource;
import com.android.compatibility.common.util.ApiTest;
-import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -65,29 +59,11 @@
*/
@RunWith(Parameterized.class)
public class VideoEncoderIntraFrameIntervalTest extends VideoEncoderValidationTestBase {
- private static final String LOG_TAG = VideoEncoderIntraFrameIntervalTest.class.getSimpleName();
private static final int FRAME_LIMIT = 600;
private static final int BIT_RATE = 5000000;
private static final int WIDTH = 1920;
private static final int HEIGHT = 1080;
private static final List<Object[]> exhaustiveArgsList = new ArrayList<>();
- private static final HashMap<String, RawResource> RES_YUV_MAP = new HashMap<>();
-
- @BeforeClass
- public static void decodeResourcesToYuv() {
- ArrayList<CompressedResource> resources = new ArrayList<>();
- for (Object[] arg : exhaustiveArgsList) {
- resources.add((CompressedResource) arg[2]);
- }
- decodeStreamsToYuv(resources, RES_YUV_MAP, LOG_TAG);
- }
-
- @AfterClass
- public static void cleanUpResources() {
- for (RawResource res : RES_YUV_MAP.values()) {
- new File(res.mFileName).delete();
- }
- }
private static EncoderConfigParams getVideoEncoderCfgParams(String mediaType, int bitRateMode,
int maxBFrames, int keyFrameInterval) {
@@ -101,7 +77,7 @@
.build();
}
- @Parameterized.Parameters(name = "{index}_{0}_{1}_{4}")
+ @Parameterized.Parameters(name = "{index}_{0}_{1}_{3}")
public static Collection<Object[]> input() {
final String[] mediaTypes = new String[]{MediaFormat.MIMETYPE_VIDEO_AVC,
MediaFormat.MIMETYPE_VIDEO_HEVC, MediaFormat.MIMETYPE_VIDEO_AV1};
@@ -117,13 +93,13 @@
}
for (int bitRateMode : bitRateModes) {
for (int intraInterval : intraIntervals) {
- // mediaType, cfg, res, test label
+ // mediaType, cfg, test label
String label = String.format("%dkbps_%dx%d_maxb-%d_%s_i-dist-%d",
BIT_RATE / 1000, WIDTH, HEIGHT, maxBFrames,
bitRateModeToString(bitRateMode), intraInterval);
exhaustiveArgsList.add(new Object[]{mediaType,
getVideoEncoderCfgParams(mediaType, bitRateMode, maxBFrames,
- intraInterval), BIRTHDAY_FULLHD_LANDSCAPE, label});
+ intraInterval), label});
}
}
}
@@ -132,9 +108,9 @@
}
public VideoEncoderIntraFrameIntervalTest(String encoder, String mediaType,
- EncoderConfigParams cfgParams, CompressedResource res,
- @SuppressWarnings("unused") String testLabel, String allTestParams) {
- super(encoder, mediaType, cfgParams, res, allTestParams);
+ EncoderConfigParams cfgParams, @SuppressWarnings("unused") String testLabel,
+ String allTestParams) {
+ super(encoder, mediaType, cfgParams, allTestParams);
}
@Before
@@ -151,10 +127,7 @@
formats.add(format);
Assume.assumeTrue("Encoder: " + mCodecName + " doesn't support format: " + format,
areFormatsSupported(mCodecName, mMediaType, formats));
- RawResource res = RES_YUV_MAP.getOrDefault(mCRes.uniqueLabel(), null);
- assumeNotNull("no raw resource found for testing config : " + mEncCfgParams[0] + mTestConfig
- + mTestEnv + DIAGNOSTICS, res);
- encodeToMemory(mCodecName, mEncCfgParams[0], res, FRAME_LIMIT, false, false);
+ encodeToMemory(mCodecName, mEncCfgParams[0], FRAME_LIMIT, false, false);
assertEquals("encoder did not encode the requested number of frames \n"
+ mTestConfig + mTestEnv, FRAME_LIMIT, mOutputCount);
int lastKeyFrameIdx = 0, currFrameIdx = 0, maxKeyFrameDistance = 0;
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderMaxBFrameTest.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderMaxBFrameTest.java
index 825a79d..0223620 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderMaxBFrameTest.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderMaxBFrameTest.java
@@ -23,28 +23,22 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeNotNull;
import android.media.MediaFormat;
import android.mediav2.common.cts.BitStreamUtils;
import android.mediav2.common.cts.EncoderConfigParams;
-import android.mediav2.common.cts.RawResource;
import com.android.compatibility.common.util.ApiTest;
-import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -62,29 +56,11 @@
*/
@RunWith(Parameterized.class)
public class VideoEncoderMaxBFrameTest extends VideoEncoderValidationTestBase {
- private static final String LOG_TAG = VideoEncoderMaxBFrameTest.class.getSimpleName();
private static final int FRAME_LIMIT = 600;
private static final int BIT_RATE = 5000000;
private static final int WIDTH = 1920;
private static final int HEIGHT = 1080;
private static final List<Object[]> exhaustiveArgsList = new ArrayList<>();
- private static final HashMap<String, RawResource> RES_YUV_MAP = new HashMap<>();
-
- @BeforeClass
- public static void decodeResourcesToYuv() {
- ArrayList<CompressedResource> resources = new ArrayList<>();
- for (Object[] arg : exhaustiveArgsList) {
- resources.add((CompressedResource) arg[2]);
- }
- decodeStreamsToYuv(resources, RES_YUV_MAP, LOG_TAG);
- }
-
- @AfterClass
- public static void cleanUpResources() {
- for (RawResource res : RES_YUV_MAP.values()) {
- new File(res.mFileName).delete();
- }
- }
private static EncoderConfigParams getVideoEncoderCfgParams(String mediaType, int maxBFrames) {
return new EncoderConfigParams.Builder(mediaType)
@@ -95,27 +71,31 @@
.build();
}
- @Parameterized.Parameters(name = "{index}_{0}_{1}_{4}")
+ @Parameterized.Parameters(name = "{index}_{0}_{1}_{3}")
public static Collection<Object[]> input() {
final String[] mediaTypesSupportingBFrames = new String[]{MediaFormat.MIMETYPE_VIDEO_AVC,
MediaFormat.MIMETYPE_VIDEO_HEVC};
final int[] maxBFramesPerSubGop = new int[]{0, 1, 4};
for (String mediaType : mediaTypesSupportingBFrames) {
for (int maxBFrames : maxBFramesPerSubGop) {
- // mediaType, cfg, resource file, test label
+ // mediaType, cfg, test label
+ if (!mediaType.equals(MediaFormat.MIMETYPE_VIDEO_AVC)
+ && !mediaType.equals((MediaFormat.MIMETYPE_VIDEO_HEVC))
+ && maxBFrames != 0) {
+ continue;
+ }
String label = String.format("%dkbps_%dx%d_maxb-%d", BIT_RATE / 1000, WIDTH,
HEIGHT, maxBFrames);
exhaustiveArgsList.add(new Object[]{mediaType, getVideoEncoderCfgParams(mediaType,
- maxBFrames), BIRTHDAY_FULLHD_LANDSCAPE, label});
+ maxBFrames), label});
}
}
return prepareParamList(exhaustiveArgsList, true, false, true, false, HARDWARE);
}
public VideoEncoderMaxBFrameTest(String encoder, String mediaType, EncoderConfigParams cfg,
- CompressedResource res, @SuppressWarnings("unused") String testLabel,
- String allTestParams) {
- super(encoder, mediaType, cfg, res, allTestParams);
+ @SuppressWarnings("unused") String testLabel, String allTestParams) {
+ super(encoder, mediaType, cfg, allTestParams);
}
@Before
@@ -132,10 +112,7 @@
formats.add(format);
Assume.assumeTrue("Encoder: " + mCodecName + " doesn't support format: " + format,
areFormatsSupported(mCodecName, mMediaType, formats));
- RawResource res = RES_YUV_MAP.getOrDefault(mCRes.uniqueLabel(), null);
- assumeNotNull("no raw resource found for testing config : " + mEncCfgParams[0] + mTestConfig
- + mTestEnv + DIAGNOSTICS, res);
- encodeToMemory(mCodecName, mEncCfgParams[0], res, FRAME_LIMIT, false, false);
+ encodeToMemory(mCodecName, mEncCfgParams[0], FRAME_LIMIT, false, false);
assertEquals("encoder did not encode the requested number of frames \n"
+ mTestConfig + mTestEnv, FRAME_LIMIT, mOutputCount);
int bFramesInSubGop = 0, maxBFramesFound = -1;
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderMinMaxTest.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderMinMaxTest.java
index 170b5a8..1e8a7c0 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderMinMaxTest.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderMinMaxTest.java
@@ -19,10 +19,11 @@
import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_CBR;
import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_VBR;
import static android.mediav2.common.cts.CodecTestBase.ComponentClass.HARDWARE;
+import static android.videocodec.cts.VideoEncoderInput.getRawResource;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeNotNull;
import static org.junit.Assume.assumeTrue;
import android.media.MediaCodecInfo;
@@ -33,18 +34,14 @@
import com.android.compatibility.common.util.ApiTest;
-import org.junit.AfterClass;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
/**
@@ -65,7 +62,6 @@
*/
@RunWith(Parameterized.class)
public class VideoEncoderMinMaxTest extends VideoEncoderValidationTestBase {
- private static final String LOG_TAG = VideoEncoderMinMaxTest.class.getSimpleName();
private static final float MIN_ACCEPTABLE_QUALITY = 20.0f; // psnr in dB
private static final int FRAME_LIMIT = 300;
private static final int TARGET_WIDTH = 1280;
@@ -73,23 +69,6 @@
private static final int TARGET_FRAME_RATE = 30;
private static final int TARGET_BIT_RATE = 5000000;
private static final List<Object[]> exhaustiveArgsList = new ArrayList<>();
- private static final HashMap<String, RawResource> RES_YUV_MAP = new HashMap<>();
-
- @BeforeClass
- public static void decodeResourcesToYuv() {
- ArrayList<CompressedResource> resources = new ArrayList<>();
- for (Object[] arg : exhaustiveArgsList) {
- resources.add((CompressedResource) arg[2]);
- }
- decodeStreamsToYuv(resources, RES_YUV_MAP, LOG_TAG);
- }
-
- @AfterClass
- public static void cleanUpResources() {
- for (RawResource res : RES_YUV_MAP.values()) {
- new File(res.mFileName).delete();
- }
- }
private static EncoderConfigParams getVideoEncoderCfgParams(String mediaType, int bitRateMode,
int maxBFrames, int intraInterval) {
@@ -114,11 +93,10 @@
for (int maxBFrames : maxBFramesPerSubGop) {
for (int intraInterval : intraIntervals) {
for (int bitRateMode : bitRateModes) {
- // mediaType, cfg, resource file
+ // mediaType, cfg
exhaustiveArgsList.add(
new Object[]{mediaType, getVideoEncoderCfgParams(mediaType,
- bitRateMode, maxBFrames,
- intraInterval), BIRTHDAY_FULLHD_LANDSCAPE});
+ bitRateMode, maxBFrames, intraInterval)});
}
}
}
@@ -260,7 +238,7 @@
return newParamList;
}
- @Parameterized.Parameters(name = "{index}_{0}_{1}_{4}")
+ @Parameterized.Parameters(name = "{index}_{0}_{1}_{3}")
public static Collection<Object[]> input() throws CloneNotSupportedException {
addParams();
return updateParamList(prepareParamList(exhaustiveArgsList, true, false, true, false,
@@ -268,9 +246,8 @@
}
public VideoEncoderMinMaxTest(String encoder, String mediaType, EncoderConfigParams cfgParams,
- CompressedResource res, @SuppressWarnings("unused") String testLabel,
- String allTestParams) {
- super(encoder, mediaType, cfgParams, res, allTestParams);
+ @SuppressWarnings("unused") String testLabel, String allTestParams) {
+ super(encoder, mediaType, cfgParams, allTestParams);
}
@Before
@@ -300,9 +277,9 @@
formats.add(format);
assertTrue("Encoder: " + mCodecName + " doesn't support format: " + format,
areFormatsSupported(mCodecName, mMediaType, formats));
- RawResource res = RES_YUV_MAP.getOrDefault(mCRes.uniqueLabel(), null);
- assumeNotNull("no raw resource found for testing config : " + mEncCfgParams[0]
- + mTestConfig + mTestEnv + DIAGNOSTICS, res);
+ RawResource res = getRawResource(mEncCfgParams[0]);
+ assertNotNull("no raw resource found for testing config : " + mEncCfgParams[0] + mTestConfig
+ + mTestEnv + DIAGNOSTICS, res);
encodeToMemory(mCodecName, mEncCfgParams[0], res, FRAME_LIMIT, false, true);
CompareStreams cs = null;
StringBuilder msg = new StringBuilder();
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderMultiResTest.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderMultiResTest.java
index f95ac49..e6a301e 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderMultiResTest.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderMultiResTest.java
@@ -19,10 +19,11 @@
import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_CBR;
import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_VBR;
import static android.mediav2.common.cts.CodecTestBase.ComponentClass.HARDWARE;
+import static android.videocodec.cts.VideoEncoderInput.getRawResource;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeNotNull;
import android.media.MediaFormat;
import android.mediav2.common.cts.CompareStreams;
@@ -31,19 +32,15 @@
import com.android.compatibility.common.util.ApiTest;
-import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
/**
@@ -62,28 +59,10 @@
*/
@RunWith(Parameterized.class)
public class VideoEncoderMultiResTest extends VideoEncoderValidationTestBase {
- private static final String LOG_TAG = VideoEncoderMultiResTest.class.getSimpleName();
private static final float MIN_ACCEPTABLE_QUALITY = 20.0f; // psnr in dB
private static final int FRAME_LIMIT = 30;
private static final int BIT_RATE = 5000000;
private static final List<Object[]> exhaustiveArgsList = new ArrayList<>();
- private static final HashMap<String, RawResource> RES_YUV_MAP = new HashMap<>();
-
- @BeforeClass
- public static void decodeResourcesToYuv() {
- ArrayList<CompressedResource> resources = new ArrayList<>();
- for (Object[] arg : exhaustiveArgsList) {
- resources.add((CompressedResource) arg[2]);
- }
- decodeStreamsToYuv(resources, RES_YUV_MAP, FRAME_LIMIT, LOG_TAG);
- }
-
- @AfterClass
- public static void cleanUpResources() {
- for (RawResource res : RES_YUV_MAP.values()) {
- new File(res.mFileName).delete();
- }
- }
private static EncoderConfigParams getVideoEncoderCfgParams(String mediaType, int width,
int height, int frameRate, int bitRateMode, int maxBFrames, int intraFrameInterval) {
@@ -113,21 +92,20 @@
}
for (int bitRateMode : bitRateModes) {
for (int intraInterval : intraIntervals) {
- // mediaType, cfg, res, label
+ // mediaType, cfg, label
String label = String.format("%dx%d_%dfps_maxb-%d_%s_i-dist-%d", width,
height, frameRate, maxBFrames, bitRateModeToString(bitRateMode),
intraInterval);
exhaustiveArgsList.add(new Object[]{mediaType,
getVideoEncoderCfgParams(mediaType, width, height, frameRate,
- bitRateMode, maxBFrames, intraInterval),
- BIRTHDAY_FULLHD_LANDSCAPE, label});
+ bitRateMode, maxBFrames, intraInterval), label});
}
}
}
}
}
- @Parameterized.Parameters(name = "{index}_{0}_{1}_{4}")
+ @Parameterized.Parameters(name = "{index}_{0}_{1}_{3}")
public static Collection<Object[]> input() {
addParams(1080, 1920, 30);
addParams(720, 1280, 30);
@@ -164,10 +142,9 @@
return prepareParamList(exhaustiveArgsList, true, false, true, false, HARDWARE);
}
- public VideoEncoderMultiResTest(String encoder, String mediaType,
- EncoderConfigParams cfgParams, CompressedResource res,
+ public VideoEncoderMultiResTest(String encoder, String mediaType, EncoderConfigParams cfgParams,
@SuppressWarnings("unused") String testLabel, String allTestParams) {
- super(encoder, mediaType, cfgParams, res, allTestParams);
+ super(encoder, mediaType, cfgParams, allTestParams);
}
@Before
@@ -185,8 +162,8 @@
formats.add(format);
Assume.assumeTrue("Encoder: " + mCodecName + " doesn't support format: " + format,
areFormatsSupported(mCodecName, mMediaType, formats));
- RawResource res = RES_YUV_MAP.getOrDefault(mCRes.uniqueLabel(), null);
- assumeNotNull("no raw resource found for testing config : " + mEncCfgParams[0] + mTestConfig
+ RawResource res = getRawResource(mEncCfgParams[0]);
+ assertNotNull("no raw resource found for testing config : " + mEncCfgParams[0] + mTestConfig
+ mTestEnv + DIAGNOSTICS, res);
encodeToMemory(mCodecName, mEncCfgParams[0], res, FRAME_LIMIT, false, true);
assertEquals("Output width is different from configured width \n" + mTestConfig
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderPsnrTest.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderPsnrTest.java
index 3f0086b..3cfe87d 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderPsnrTest.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderPsnrTest.java
@@ -19,10 +19,11 @@
import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_CBR;
import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_VBR;
import static android.mediav2.common.cts.CodecTestBase.ComponentClass.HARDWARE;
+import static android.videocodec.cts.VideoEncoderInput.getRawResource;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeNotNull;
import android.media.MediaFormat;
import android.mediav2.common.cts.CompareStreams;
@@ -31,19 +32,15 @@
import com.android.compatibility.common.util.ApiTest;
-import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
/**
@@ -61,29 +58,11 @@
*/
@RunWith(Parameterized.class)
public class VideoEncoderPsnrTest extends VideoEncoderValidationTestBase {
- private static final String LOG_TAG = VideoEncoderPsnrTest.class.getSimpleName();
private static final float MIN_ACCEPTABLE_QUALITY = 30.0f; // dB
private static final float AVG_ACCEPTABLE_QUALITY = 35.0f; // dB
private static final int KEY_FRAME_INTERVAL = 1;
private static final int FRAME_LIMIT = 300;
private static final List<Object[]> exhaustiveArgsList = new ArrayList<>();
- private static final HashMap<String, RawResource> RES_YUV_MAP = new HashMap<>();
-
- @BeforeClass
- public static void decodeResourcesToYuv() {
- ArrayList<CompressedResource> resources = new ArrayList<>();
- for (Object[] arg : exhaustiveArgsList) {
- resources.add((CompressedResource) arg[2]);
- }
- decodeStreamsToYuv(resources, RES_YUV_MAP, LOG_TAG);
- }
-
- @AfterClass
- public static void cleanUpResources() {
- for (RawResource res : RES_YUV_MAP.values()) {
- new File(res.mFileName).delete();
- }
- }
private static EncoderConfigParams getVideoEncoderCfgParams(String mediaType, int width,
int height, int bitRate, int bitRateMode) {
@@ -96,34 +75,33 @@
.build();
}
- private static void addParams(int bitRate, int width, int height, CompressedResource res) {
+ private static void addParams(int bitRate, int width, int height) {
final String[] mediaTypes = new String[]{MediaFormat.MIMETYPE_VIDEO_AVC,
MediaFormat.MIMETYPE_VIDEO_HEVC, MediaFormat.MIMETYPE_VIDEO_AV1};
final int[] bitRateModes = new int[]{BITRATE_MODE_CBR, BITRATE_MODE_VBR};
for (String mediaType : mediaTypes) {
for (int bitRateMode : bitRateModes) {
- // mediaType, cfg, resource file, test label
+ // mediaType, cfg, test label
String label = String.format("%.1fmbps_%dx%d_%s", bitRate / 1000000.f, width,
height, bitRateModeToString(bitRateMode));
exhaustiveArgsList.add(new Object[]{mediaType, getVideoEncoderCfgParams(mediaType,
- width, height, bitRate, bitRateMode), res, label});
+ width, height, bitRate, bitRateMode), label});
}
}
}
- @Parameterized.Parameters(name = "{index}_{0}_{1}_{4}")
+ @Parameterized.Parameters(name = "{index}_{0}_{1}_{3}")
public static Collection<Object[]> input() {
- addParams(25000000, 1920, 1080, BIRTHDAY_FULLHD_LANDSCAPE);
- addParams(25000000, 1080, 1920, SELFIEGROUP_FULLHD_PORTRAIT);
- addParams(15000000, 1280, 720, BIRTHDAY_FULLHD_LANDSCAPE);
- addParams(15000000, 720, 1280, SELFIEGROUP_FULLHD_PORTRAIT);
+ addParams(25000000, 1920, 1080);
+ addParams(25000000, 1080, 1920);
+ addParams(15000000, 1280, 720);
+ addParams(15000000, 720, 1280);
return prepareParamList(exhaustiveArgsList, true, false, true, false, HARDWARE);
}
- public VideoEncoderPsnrTest(String encoder, String mediaType,
- EncoderConfigParams cfgParams, CompressedResource res,
+ public VideoEncoderPsnrTest(String encoder, String mediaType, EncoderConfigParams cfgParams,
@SuppressWarnings("unused") String testLabel, String allTestParams) {
- super(encoder, mediaType, cfgParams, res, allTestParams);
+ super(encoder, mediaType, cfgParams, allTestParams);
}
@Before
@@ -140,8 +118,8 @@
formats.add(format);
Assume.assumeTrue("Encoder: " + mCodecName + " doesn't support format: " + format,
areFormatsSupported(mCodecName, mMediaType, formats));
- RawResource res = RES_YUV_MAP.getOrDefault(mCRes.uniqueLabel(), null);
- assumeNotNull("no raw resource found for testing config : " + mEncCfgParams[0] + mTestConfig
+ RawResource res = getRawResource(mEncCfgParams[0]);
+ assertNotNull("no raw resource found for testing config : " + mEncCfgParams[0] + mTestConfig
+ mTestEnv + DIAGNOSTICS, res);
encodeToMemory(mCodecName, mEncCfgParams[0], res, FRAME_LIMIT, false, true);
CompareStreams cs = null;
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionBFrameTest.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionBFrameTest.java
index 8e7f47d..d8cbecb 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionBFrameTest.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionBFrameTest.java
@@ -16,13 +16,18 @@
package android.videocodec.cts;
+import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_CBR;
+import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_VBR;
import static android.mediav2.common.cts.CodecTestBase.ComponentClass.HARDWARE;
import static android.mediav2.common.cts.CodecTestBase.areFormatsSupported;
import static android.mediav2.common.cts.CodecTestBase.prepareParamList;
+import static android.videocodec.cts.VideoEncoderInput.BIRTHDAY_FULLHD_LANDSCAPE;
+import static android.videocodec.cts.VideoEncoderInput.getRawResource;
import android.media.MediaFormat;
import android.mediav2.common.cts.CodecEncoderTestBase;
import android.mediav2.common.cts.EncoderConfigParams;
+import android.mediav2.common.cts.RawResource;
import com.android.compatibility.common.util.ApiTest;
@@ -35,6 +40,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.function.Predicate;
/**
* This test is to ensure no quality regression is seen from '0' b frames to '1' b frame.
@@ -50,13 +56,26 @@
public class VideoEncoderQualityRegressionBFrameTest extends VideoEncoderQualityRegressionTestBase {
private static final String[] MEDIA_TYPES =
{MediaFormat.MIMETYPE_VIDEO_AVC, MediaFormat.MIMETYPE_VIDEO_HEVC};
+ private static final VideoEncoderInput.CompressedResource RES = BIRTHDAY_FULLHD_LANDSCAPE;
+ private static final int WIDTH = 1920;
+ private static final int HEIGHT = 1080;
+ protected static final int[] BIT_RATES =
+ {2000000, 4000000, 6000000, 8000000, 10000000, 12000000};
+ protected static final int[] BIT_RATE_MODES = {BITRATE_MODE_CBR, BITRATE_MODE_VBR};
+ protected static final int[] B_FRAMES = {0, 1};
+ private static final int FRAME_RATE = 30;
+ private static final int KEY_FRAME_INTERVAL = 1;
+ private static final int FRAME_LIMIT = 300;
private static final List<Object[]> exhaustiveArgsList = new ArrayList<>();
- @Parameterized.Parameters(name = "{index}_{0}_{2}")
+ private final int mBitRateMode;
+
+ @Parameterized.Parameters(name = "{index}_{0}_{4}")
public static Collection<Object[]> input() {
+ RESOURCES.add(RES);
for (String mediaType : MEDIA_TYPES) {
for (int bitRateMode : BIT_RATE_MODES) {
- exhaustiveArgsList.add(new Object[]{mediaType, bitRateMode,
+ exhaustiveArgsList.add(new Object[]{mediaType, RES, bitRateMode,
CodecEncoderTestBase.bitRateModeToString(bitRateMode)});
}
}
@@ -64,27 +83,36 @@
}
public VideoEncoderQualityRegressionBFrameTest(String encoder, String mediaType,
- int bitRateMode, @SuppressWarnings("unused") String testLabel, String allTestParams) {
- super(encoder, mediaType, bitRateMode, allTestParams);
+ VideoEncoderInput.CompressedResource cRes, int bitRateMode,
+ @SuppressWarnings("unused") String testLabel, String allTestParams) {
+ super(encoder, mediaType, cRes, allTestParams);
+ mBitRateMode = bitRateMode;
}
void qualityRegressionOverBFrames() throws IOException, InterruptedException {
+ RawResource res = getRawResource(mCRes);
+ VideoEncoderValidationTestBase[] testInstances =
+ new VideoEncoderValidationTestBase[B_FRAMES.length];
String[] encoderNames = new String[B_FRAMES.length];
List<EncoderConfigParams[]> cfgsUnion = new ArrayList<>();
for (int i = 0; i < B_FRAMES.length; i++) {
+ testInstances[i] = new VideoEncoderValidationTestBase(null, mMediaType, null,
+ mAllTestParams);
EncoderConfigParams[] cfgs = new EncoderConfigParams[BIT_RATES.length];
cfgsUnion.add(cfgs);
ArrayList<MediaFormat> fmts = new ArrayList<>();
for (int j = 0; j < cfgs.length; j++) {
- cfgs[j] = getVideoEncoderCfgParams(mMediaType, BIT_RATES[j], mBitRateMode,
- B_FRAMES[i]);
+ cfgs[j] = getVideoEncoderCfgParams(mMediaType, WIDTH, HEIGHT, BIT_RATES[j],
+ mBitRateMode, KEY_FRAME_INTERVAL, FRAME_RATE, B_FRAMES[i]);
fmts.add(cfgs[j].getFormat());
}
Assume.assumeTrue("Encoder: " + mCodecName + " doesn't support formats.",
areFormatsSupported(mCodecName, mMediaType, fmts));
encoderNames[i] = mCodecName;
}
- getQualityRegressionForCfgs(cfgsUnion, encoderNames, 0.000001d);
+ Predicate<Double> predicate = bdRate -> bdRate < 0.000001d;
+ getQualityRegressionForCfgs(cfgsUnion, testInstances, encoderNames, res, FRAME_LIMIT,
+ FRAME_RATE, true, predicate);
}
@ApiTest(apis = {"android.media.MediaFormat#KEY_BITRATE",
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionCodecTest.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionCodecTest.java
index 7967845..599fda1 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionCodecTest.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionCodecTest.java
@@ -16,14 +16,19 @@
package android.videocodec.cts;
+import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_CBR;
+import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_VBR;
import static android.mediav2.common.cts.CodecTestBase.ComponentClass.HARDWARE;
import static android.mediav2.common.cts.CodecTestBase.areFormatsSupported;
import static android.mediav2.common.cts.CodecTestBase.prepareParamList;
+import static android.videocodec.cts.VideoEncoderInput.BIRTHDAY_FULLHD_LANDSCAPE;
+import static android.videocodec.cts.VideoEncoderInput.getRawResource;
import android.media.MediaFormat;
import android.mediav2.common.cts.CodecEncoderTestBase;
import android.mediav2.common.cts.CodecTestBase;
import android.mediav2.common.cts.EncoderConfigParams;
+import android.mediav2.common.cts.RawResource;
import com.android.compatibility.common.util.ApiTest;
@@ -36,6 +41,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.function.Predicate;
/**
* This test is to ensure no quality regression is seen from avc to hevc.
@@ -49,36 +55,56 @@
*/
@RunWith(Parameterized.class)
public class VideoEncoderQualityRegressionCodecTest extends VideoEncoderQualityRegressionTestBase {
+ private static final VideoEncoderInput.CompressedResource RES = BIRTHDAY_FULLHD_LANDSCAPE;
+ private static final int WIDTH = 1920;
+ private static final int HEIGHT = 1080;
+ protected static final int[] BIT_RATES =
+ {2000000, 4000000, 6000000, 8000000, 10000000, 12000000};
+ protected static final int[] BIT_RATE_MODES = {BITRATE_MODE_CBR, BITRATE_MODE_VBR};
+ protected static final int[] B_FRAMES = {0, 1};
+ private static final int FRAME_RATE = 30;
+ private static final int KEY_FRAME_INTERVAL = 1;
+ private static final int FRAME_LIMIT = 300;
private static final List<Object[]> exhaustiveArgsList = new ArrayList<>();
- @Parameterized.Parameters(name = "{index}_{0}_{2}")
+ private final int mBitRateMode;
+
+ @Parameterized.Parameters(name = "{index}_{0}_{4}")
public static Collection<Object[]> input() {
+ RESOURCES.add(RES);
for (int bitRateMode : BIT_RATE_MODES) {
- exhaustiveArgsList.add(new Object[]{MediaFormat.MIMETYPE_VIDEO_HEVC, bitRateMode,
+ exhaustiveArgsList.add(new Object[]{MediaFormat.MIMETYPE_VIDEO_HEVC, RES, bitRateMode,
CodecEncoderTestBase.bitRateModeToString(bitRateMode)});
}
return prepareParamList(exhaustiveArgsList, true, false, true, false, HARDWARE);
}
- public VideoEncoderQualityRegressionCodecTest(String encoder, String mediaType, int bitRateMode,
+ public VideoEncoderQualityRegressionCodecTest(String encoder, String mediaType,
+ VideoEncoderInput.CompressedResource cRes, int bitRateMode,
@SuppressWarnings("unused") String testLabel, String allTestParams) {
- super(encoder, mediaType, bitRateMode, allTestParams);
+ super(encoder, mediaType, cRes, allTestParams);
+ mBitRateMode = bitRateMode;
}
@ApiTest(apis = {"android.media.MediaFormat#KEY_BITRATE",
"android.media.MediaFormat#KEY_BITRATE_MODE"})
@Test
public void testQualityRegressionWrtAvc() throws IOException, InterruptedException {
+ RawResource res = getRawResource(mCRes);
String[] mediaTypes = new String[]{MediaFormat.MIMETYPE_VIDEO_AVC, mMediaType};
+ VideoEncoderValidationTestBase[] testInstances =
+ new VideoEncoderValidationTestBase[mediaTypes.length];
String[] encoderNames = new String[mediaTypes.length];
List<EncoderConfigParams[]> cfgsUnion = new ArrayList<>();
for (int i = 0; i < mediaTypes.length; i++) {
+ testInstances[i] = new VideoEncoderValidationTestBase(null, mediaTypes[i], null,
+ mAllTestParams);
EncoderConfigParams[] cfgsOfMediaType = new EncoderConfigParams[BIT_RATES.length];
cfgsUnion.add(cfgsOfMediaType);
ArrayList<MediaFormat> fmts = new ArrayList<>();
for (int j = 0; j < cfgsOfMediaType.length; j++) {
- cfgsOfMediaType[j] = getVideoEncoderCfgParams(mediaTypes[i], BIT_RATES[j],
- mBitRateMode, 0);
+ cfgsOfMediaType[j] = getVideoEncoderCfgParams(mediaTypes[i], WIDTH, HEIGHT,
+ BIT_RATES[j], mBitRateMode, KEY_FRAME_INTERVAL, FRAME_RATE, B_FRAMES[0]);
fmts.add(cfgsOfMediaType[j].getFormat());
}
if (mediaTypes[i].equals(mMediaType)) {
@@ -93,6 +119,8 @@
encoderNames[i] = encoders.get(0);
}
}
- getQualityRegressionForCfgs(cfgsUnion, encoderNames, 0);
+ Predicate<Double> predicate = bdRate -> bdRate < 0d;
+ getQualityRegressionForCfgs(cfgsUnion, testInstances, encoderNames, res, FRAME_LIMIT,
+ FRAME_RATE, true, predicate);
}
}
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionTestBase.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionTestBase.java
index d538add..4b768ee 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionTestBase.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderQualityRegressionTestBase.java
@@ -16,11 +16,8 @@
package android.videocodec.cts;
-import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_CBR;
-import static android.media.MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_VBR;
-import static android.videocodec.cts.VideoEncoderValidationTestBase.BIRTHDAY_FULLHD_LANDSCAPE;
-import static android.videocodec.cts.VideoEncoderValidationTestBase.DIAGNOSTICS;
-import static android.videocodec.cts.VideoEncoderValidationTestBase.logAllFilesInCacheDir;
+import static android.videocodec.cts.VideoEncoderInput.RES_YUV_MAP;
+import static android.videocodec.cts.VideoEncoderInput.getRawResource;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -29,7 +26,6 @@
import static org.junit.Assume.assumeTrue;
import android.mediav2.common.cts.CompareStreams;
-import android.mediav2.common.cts.DecodeStreamToYuv;
import android.mediav2.common.cts.EncoderConfigParams;
import android.mediav2.common.cts.RawResource;
import android.util.Log;
@@ -43,40 +39,32 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
+import java.util.function.Predicate;
/**
* Wrapper class for testing quality regression.
*/
public class VideoEncoderQualityRegressionTestBase {
- private static final String LOG_TAG =
- VideoEncoderQualityRegressionTestBase.class.getSimpleName();
- private static final VideoEncoderValidationTestBase.CompressedResource RES =
- BIRTHDAY_FULLHD_LANDSCAPE;
- private static final int WIDTH = 1920;
- private static final int HEIGHT = 1080;
- protected static final int[] BIT_RATES =
- {2000000, 4000000, 6000000, 8000000, 10000000, 12000000};
- protected static final int[] BIT_RATE_MODES = {BITRATE_MODE_CBR, BITRATE_MODE_VBR};
- protected static final int[] B_FRAMES = {0, 1};
- private static final int FRAME_RATE = 30;
- private static final int KEY_FRAME_INTERVAL = 1;
- private static final int FRAME_LIMIT = 300;
- protected static RawResource sActiveRawRes = null;
+ private static final String TAG = VideoEncoderQualityRegressionTestBase.class.getSimpleName();
+ private static final ArrayList<String> mTmpFiles = new ArrayList<>();
+ protected static ArrayList<VideoEncoderInput.CompressedResource> RESOURCES = new ArrayList<>();
+
protected final String mCodecName;
protected final String mMediaType;
- protected final int mBitRateMode;
-
- protected final ArrayList<String> mTmpFiles = new ArrayList<>();
+ protected final VideoEncoderInput.CompressedResource mCRes;
+ protected final String mAllTestParams;
static {
System.loadLibrary("ctsvideoqualityutils_jni");
}
- VideoEncoderQualityRegressionTestBase(String encoder, String mediaType, int bitRateMode,
- String allTestParams) {
+ VideoEncoderQualityRegressionTestBase(String encoder, String mediaType,
+ VideoEncoderInput.CompressedResource cRes, String allTestParams) {
mCodecName = encoder;
mMediaType = mediaType;
- mBitRateMode = bitRateMode;
+ mCRes = cRes;
+ mAllTestParams = allTestParams;
}
/**
@@ -84,17 +72,8 @@
* in the cache.
*/
@BeforeClass
- public static void decodeResourceToYuv() {
- logAllFilesInCacheDir(true);
- try {
- DecodeStreamToYuv yuv = new DecodeStreamToYuv(RES.mMediaType, RES.mResFile,
- FRAME_LIMIT, LOG_TAG);
- sActiveRawRes = yuv.getDecodedYuv();
- } catch (Exception e) {
- DIAGNOSTICS.append(String.format("\nWhile decoding the resource : %s,"
- + " encountered exception : %s was thrown", RES, e));
- logAllFilesInCacheDir(false);
- }
+ public static void decodeResourcesToYuv() {
+ VideoEncoderValidationTestBase.decodeStreamsToYuv(RESOURCES, RES_YUV_MAP, TAG);
}
/**
@@ -102,15 +81,13 @@
*/
@AfterClass
public static void cleanUpResources() {
- if (sActiveRawRes != null) {
- new File(sActiveRawRes.mFileName).delete();
- sActiveRawRes = null;
- }
+ VideoEncoderValidationTestBase.cleanUpResources();
}
@Before
public void setUp() {
- assumeNotNull("no raw resource found for testing : ", sActiveRawRes);
+ assumeNotNull("no raw resource found for testing : "
+ + VideoEncoderValidationTestBase.DIAGNOSTICS, getRawResource(mCRes));
}
@After
@@ -122,15 +99,16 @@
mTmpFiles.clear();
}
- protected static EncoderConfigParams getVideoEncoderCfgParams(String mediaType, int bitRate,
- int bitRateMode, int maxBFrames) {
+ protected static EncoderConfigParams getVideoEncoderCfgParams(String mediaType, int width,
+ int height, int bitRate, int bitRateMode, int keyFrameInterval, int frameRate,
+ int maxBFrames) {
return new EncoderConfigParams.Builder(mediaType)
- .setWidth(WIDTH)
- .setHeight(HEIGHT)
+ .setWidth(width)
+ .setHeight(height)
.setBitRate(bitRate)
.setBitRateMode(bitRateMode)
- .setKeyFrameInterval(KEY_FRAME_INTERVAL)
- .setFrameRate(FRAME_RATE)
+ .setKeyFrameInterval(keyFrameInterval)
+ .setFrameRate(frameRate)
.setMaxBFrames(maxBFrames)
.build();
}
@@ -139,28 +117,30 @@
double[] ratesB, boolean selBdSnr, StringBuilder retMsg);
protected void getQualityRegressionForCfgs(List<EncoderConfigParams[]> cfgsUnion,
- String[] encoderNames,
- double minGain) throws IOException, InterruptedException {
+ VideoEncoderValidationTestBase[] testInstances, String[] encoderNames, RawResource res,
+ int frameLimit, int frameRate, boolean setLoopBack, Predicate<Double> predicate)
+ throws IOException, InterruptedException {
+ assertEquals("Quality comparison is done between two sets", 2, cfgsUnion.size());
+ assertTrue("Minimum of 4 points are required for polynomial curve fitting",
+ cfgsUnion.get(0).length >= 4);
double[][] psnrs = new double[cfgsUnion.size()][cfgsUnion.get(0).length];
double[][] rates = new double[cfgsUnion.size()][cfgsUnion.get(0).length];
for (int i = 0; i < cfgsUnion.size(); i++) {
EncoderConfigParams[] cfgs = cfgsUnion.get(i);
String mediaType = cfgs[0].mMediaType;
- VideoEncoderValidationTestBase vevtb = new VideoEncoderValidationTestBase(null,
- mediaType, null, null, "");
- vevtb.setLoopBack(true);
+ testInstances[i].setLoopBack(setLoopBack);
for (int j = 0; j < cfgs.length; j++) {
- vevtb.encodeToMemory(encoderNames[i], cfgs[j], sActiveRawRes, FRAME_LIMIT, true,
+ testInstances[i].encodeToMemory(encoderNames[i], cfgs[j], res, frameLimit, true,
true);
- mTmpFiles.add(vevtb.getMuxedOutputFilePath());
- assertEquals("encoder did not encode the requested number of frames \n",
- FRAME_LIMIT, vevtb.getOutputCount());
- int outSize = vevtb.getOutputManager().getOutStreamSize();
- double achievedBitRate = ((double) outSize * 8 * FRAME_RATE) / (1000 * FRAME_LIMIT);
+ mTmpFiles.add(testInstances[i].getMuxedOutputFilePath());
+ assertEquals("encoder did not encode the requested number of frames \n", frameLimit,
+ testInstances[i].getOutputCount());
+ int outSize = testInstances[i].getOutputManager().getOutStreamSize();
+ double achievedBitRate = ((double) outSize * 8 * frameRate) / (1000 * frameLimit);
CompareStreams cs = null;
try {
- cs = new CompareStreams(sActiveRawRes, mediaType,
- vevtb.getMuxedOutputFilePath(), true, true);
+ cs = new CompareStreams(res, mediaType,
+ testInstances[i].getMuxedOutputFilePath(), true, true);
final double[] globalPSNR = cs.getGlobalPSNR();
double weightedPSNR = (6 * globalPSNR[0] + globalPSNR[1] + globalPSNR[2]) / 8;
psnrs[i][j] = weightedPSNR;
@@ -168,7 +148,7 @@
} finally {
if (cs != null) cs.cleanUp();
}
- vevtb.deleteMuxedFile();
+ testInstances[i].deleteMuxedFile();
}
}
StringBuilder retMsg = new StringBuilder();
@@ -180,9 +160,8 @@
retMsg.append(String.format("{%f, %f},\n", rates[i][j], psnrs[i][j]));
}
}
- retMsg.append(String.format("bd rate %f not < %f", bdRate, minGain));
- Log.d(LOG_TAG, retMsg.toString());
- // assuming set B encoding is superior to set A,
- assumeTrue(retMsg.toString(), bdRate < minGain);
+ retMsg.append(String.format(Locale.getDefault(), "bd rate: %f", bdRate));
+ Log.d(TAG, retMsg.toString());
+ assumeTrue(retMsg.toString(), predicate.test(bdRate));
}
}
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderTargetBitrateTest.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderTargetBitrateTest.java
index 1b6763b..aa7c1b6 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderTargetBitrateTest.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderTargetBitrateTest.java
@@ -21,29 +21,23 @@
import static android.mediav2.common.cts.CodecTestBase.ComponentClass.HARDWARE;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assume.assumeNotNull;
import android.media.MediaCodec;
import android.media.MediaFormat;
import android.mediav2.common.cts.EncoderConfigParams;
-import android.mediav2.common.cts.RawResource;
import com.android.compatibility.common.util.ApiTest;
import com.android.compatibility.common.util.CddTest;
-import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
@@ -66,33 +60,14 @@
*/
@RunWith(Parameterized.class)
public class VideoEncoderTargetBitrateTest extends VideoEncoderValidationTestBase {
- private static final String LOG_TAG = VideoEncoderTargetBitrateTest.class.getSimpleName();
private static final int KEY_FRAME_INTERVAL = 1;
private static final int FRAME_LIMIT = 300;
private static final List<Object[]> exhaustiveArgsList = new ArrayList<>();
- private static final HashMap<String, RawResource> RES_YUV_MAP = new HashMap<>();
-
private final float mThreshold;
private final Queue<Integer> mBufferSize = new LinkedList<>();
private int mTotalOvershoots = 0;
private final StringBuilder mMsg = new StringBuilder();
- @BeforeClass
- public static void decodeResourcesToYuv() {
- ArrayList<CompressedResource> resources = new ArrayList<>();
- for (Object[] arg : exhaustiveArgsList) {
- resources.add((CompressedResource) arg[2]);
- }
- decodeStreamsToYuv(resources, RES_YUV_MAP, LOG_TAG);
- }
-
- @AfterClass
- public static void cleanUpResources() {
- for (RawResource res : RES_YUV_MAP.values()) {
- new File(res.mFileName).delete();
- }
- }
-
private static EncoderConfigParams getVideoEncoderCfgParams(String mediaType, int width,
int height, int bitRate, int bitRateMode, int maxBFrames) {
return new EncoderConfigParams.Builder(mediaType)
@@ -105,7 +80,7 @@
.build();
}
- private static void addParams(int width, int height, CompressedResource res) {
+ private static void addParams(int width, int height) {
final String[] mediaTypes = new String[]{MediaFormat.MIMETYPE_VIDEO_AVC,
MediaFormat.MIMETYPE_VIDEO_HEVC, MediaFormat.MIMETYPE_VIDEO_AV1};
final int[] bitRates = new int[]{5000000, 8000000, 10000000};
@@ -120,29 +95,29 @@
continue;
}
for (int bitRateMode : bitRateModes) {
- // mediaType, cfg, resource file, test label
+ // mediaType, cfg, test label
String label = String.format("%dkbps_%dx%d_maxb-%d_%s", bitRate / 1000,
width, height, maxBFrames, bitRateModeToString(bitRateMode));
exhaustiveArgsList.add(new Object[]{mediaType,
getVideoEncoderCfgParams(mediaType, width, height, bitRate,
- bitRateMode, maxBFrames), res, label});
+ bitRateMode, maxBFrames), label});
}
}
}
}
}
- @Parameterized.Parameters(name = "{index}_{0}_{1}_{4}")
+ @Parameterized.Parameters(name = "{index}_{0}_{1}_{3}")
public static Collection<Object[]> input() {
- addParams(1920, 1080, BIRTHDAY_FULLHD_LANDSCAPE);
- addParams(1080, 1920, SELFIEGROUP_FULLHD_PORTRAIT);
+ addParams(1920, 1080);
+ addParams(1080, 1920);
return prepareParamList(exhaustiveArgsList, true, false, true, false, HARDWARE);
}
public VideoEncoderTargetBitrateTest(String encoder, String mediaType,
- EncoderConfigParams cfgParams, CompressedResource res,
- @SuppressWarnings("unused") String testLabel, String allTestParams) {
- super(encoder, mediaType, cfgParams, res, allTestParams);
+ EncoderConfigParams cfgParams, @SuppressWarnings("unused") String testLabel,
+ String allTestParams) {
+ super(encoder, mediaType, cfgParams, allTestParams);
float sf = 1.f;
if (cfgParams.mBitRateMode == BITRATE_MODE_VBR) {
sf = 2.f;
@@ -181,10 +156,7 @@
formats.add(format);
Assume.assumeTrue("Encoder: " + mCodecName + " doesn't support format: " + format,
areFormatsSupported(mCodecName, mMediaType, formats));
- RawResource res = RES_YUV_MAP.getOrDefault(mCRes.uniqueLabel(), null);
- assumeNotNull("no raw resource found for testing config : " + mEncCfgParams[0] + mTestConfig
- + mTestEnv + DIAGNOSTICS, res);
- encodeToMemory(mCodecName, mEncCfgParams[0], res, FRAME_LIMIT, true, false);
+ encodeToMemory(mCodecName, mEncCfgParams[0], FRAME_LIMIT, true, false);
assertEquals("encoder did not encode the requested number of frames \n"
+ mTestConfig + mTestEnv, FRAME_LIMIT, mOutputCount);
Assume.assumeTrue(mMsg.toString() + mTestConfig + mTestEnv, mTotalOvershoots == 0);
diff --git a/tests/videocodec/src/android/videocodec/cts/VideoEncoderValidationTestBase.java b/tests/videocodec/src/android/videocodec/cts/VideoEncoderValidationTestBase.java
index d6fdcf0..b57c6cb 100644
--- a/tests/videocodec/src/android/videocodec/cts/VideoEncoderValidationTestBase.java
+++ b/tests/videocodec/src/android/videocodec/cts/VideoEncoderValidationTestBase.java
@@ -18,6 +18,11 @@
import static android.media.MediaFormat.PICTURE_TYPE_I;
import static android.media.MediaFormat.PICTURE_TYPE_UNKNOWN;
+import static android.videocodec.cts.VideoEncoderInput.BIRTHDAY_FULLHD_LANDSCAPE;
+import static android.videocodec.cts.VideoEncoderInput.RES_YUV_MAP;
+import static android.videocodec.cts.VideoEncoderInput.RIVER_HD_LANDSCAPE;
+import static android.videocodec.cts.VideoEncoderInput.SELFIEGROUP_FULLHD_PORTRAIT;
+import static android.videocodec.cts.VideoEncoderInput.getRawResource;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -33,16 +38,18 @@
import android.mediav2.common.cts.RawResource;
import android.util.Log;
-import androidx.annotation.NonNull;
-
import com.android.compatibility.common.util.Preconditions;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Objects;
import java.util.TreeMap;
@@ -51,12 +58,10 @@
*/
public class VideoEncoderValidationTestBase extends CodecEncoderTestBase {
private static final String LOG_TAG = VideoEncoderValidationTestBase.class.getSimpleName();
- private static final String MEDIA_DIR = WorkDir.getMediaDirString();
protected static final boolean ENABLE_LOGS = false;
protected static final StringBuilder DIAGNOSTICS = new StringBuilder();
- protected final CompressedResource mCRes;
protected BitStreamUtils.ParserBase mParser;
final TreeMap<Long, Integer> mPtsPicTypeMap = new TreeMap<>();
@@ -65,32 +70,6 @@
long mFileReadOffset;
long mFileLength;
- public static class CompressedResource {
- final String mMediaType;
- final String mResFile;
-
- CompressedResource(String mediaType, String resFile) {
- mMediaType = mediaType;
- mResFile = resFile;
- }
-
- @NonNull
- @Override
- public String toString() {
- return "CompressedResource{" + "res file ='" + mResFile + '\'' + '}';
- }
-
- public String uniqueLabel() {
- return mMediaType + mResFile;
- }
- }
-
- public static final CompressedResource BIRTHDAY_FULLHD_LANDSCAPE =
- new CompressedResource(MediaFormat.MIMETYPE_VIDEO_AVC, MEDIA_DIR
- + "AVICON-MOBILE-BirthdayHalfway-SI17-CRUW03-L-420-8bit-SDR-1080p-30fps.mp4");
- public static final CompressedResource SELFIEGROUP_FULLHD_PORTRAIT =
- new CompressedResource(MediaFormat.MIMETYPE_VIDEO_AVC, MEDIA_DIR
- + "AVICON-MOBILE-SelfieGroupGarden-SF15-CF01-P-420-8bit-SDR-1080p-30fps.mp4");
static void logAllFilesInCacheDir(boolean isStartOfTest) {
if (isStartOfTest) DIAGNOSTICS.setLength(0);
@@ -107,34 +86,57 @@
}
}
- static void decodeStreamsToYuv(ArrayList<CompressedResource> resources,
+ static void decodeStreamsToYuv(List<VideoEncoderInput.CompressedResource> resources,
HashMap<String, RawResource> streamYuvMap, String prefix) {
decodeStreamsToYuv(resources, streamYuvMap, Integer.MAX_VALUE, prefix);
}
- static void decodeStreamsToYuv(ArrayList<CompressedResource> resources,
+ static void decodeStreamsToYuv(List<VideoEncoderInput.CompressedResource> resources,
HashMap<String, RawResource> streamYuvMap, int frameLimit, String prefix) {
logAllFilesInCacheDir(true);
- for (CompressedResource res : resources) {
- if (!(streamYuvMap.containsKey(res.uniqueLabel()))) {
- try {
- DecodeStreamToYuv yuv = new DecodeStreamToYuv(res.mMediaType, res.mResFile,
- frameLimit, prefix);
- streamYuvMap.put(res.uniqueLabel(), yuv.getDecodedYuv());
- } catch (Exception e) {
- streamYuvMap.put(res.uniqueLabel(), null);
- DIAGNOSTICS.append(String.format("\nWhile decoding the resource : %s,"
- + " encountered exception : %s was thrown", res, e));
- logAllFilesInCacheDir(false);
- }
+ for (VideoEncoderInput.CompressedResource res : resources) {
+ decodeStreamsToYuv(res, streamYuvMap, frameLimit, prefix);
+ }
+ if (streamYuvMap.values().stream().allMatch(Objects::isNull)) {
+ decodeStreamsToYuv(RIVER_HD_LANDSCAPE, streamYuvMap, frameLimit, prefix);
+ }
+ }
+
+ static void decodeStreamsToYuv(VideoEncoderInput.CompressedResource res,
+ HashMap<String, RawResource> streamYuvMap, int frameLimit, String prefix) {
+ if (!(streamYuvMap.containsKey(res.uniqueLabel()))) {
+ try {
+ DecodeStreamToYuv yuv = new DecodeStreamToYuv(res.mMediaType, res.mResFile,
+ frameLimit, prefix);
+ streamYuvMap.put(res.uniqueLabel(), yuv.getDecodedYuv());
+ } catch (Exception e) {
+ streamYuvMap.put(res.uniqueLabel(), null);
+ DIAGNOSTICS.append(String.format("\nWhile decoding the resource : %s,"
+ + " encountered exception : %s was thrown", res, e));
+ logAllFilesInCacheDir(false);
}
}
}
+ @BeforeClass
+ public static void decodeResourcesToYuv() {
+ ArrayList<VideoEncoderInput.CompressedResource> resources = new ArrayList<>();
+ resources.add(BIRTHDAY_FULLHD_LANDSCAPE);
+ resources.add(SELFIEGROUP_FULLHD_PORTRAIT);
+ decodeStreamsToYuv(resources, RES_YUV_MAP, LOG_TAG);
+ }
+
+ @AfterClass
+ public static void cleanUpResources() {
+ for (RawResource res : RES_YUV_MAP.values()) {
+ new File(res.mFileName).delete();
+ }
+ RES_YUV_MAP.clear();
+ }
+
VideoEncoderValidationTestBase(String encoder, String mediaType,
- EncoderConfigParams encCfgParams, CompressedResource res, String allTestParams) {
+ EncoderConfigParams encCfgParams, String allTestParams) {
super(encoder, mediaType, new EncoderConfigParams[]{encCfgParams}, allTestParams);
- mCRes = res;
}
protected void setUpSource(String inpPath) throws IOException {
@@ -150,6 +152,14 @@
mPtsPicTypeMap.clear();
}
+ protected void encodeToMemory(String encoder, EncoderConfigParams cfg, int frameLimit,
+ boolean saveToMem, boolean muxOutput) throws IOException, InterruptedException {
+ RawResource res = getRawResource(cfg);
+ assertNotNull("no raw resource found for testing config : " + mEncCfgParams[0]
+ + mTestConfig + mTestEnv + DIAGNOSTICS, res);
+ super.encodeToMemory(encoder, cfg, res, frameLimit, saveToMem, muxOutput);
+ }
+
protected void enqueueInput(int bufferIndex) {
int frmSize = 3 * mActiveRawRes.mBytesPerSample * mActiveRawRes.mWidth
* mActiveRawRes.mHeight / 2;
diff --git a/tests/videocodec/src/android/videocodec/cts/WorkDir.java b/tests/videocodec/src/android/videocodec/cts/WorkDir.java
index 4729742..a48bf25 100644
--- a/tests/videocodec/src/android/videocodec/cts/WorkDir.java
+++ b/tests/videocodec/src/android/videocodec/cts/WorkDir.java
@@ -23,6 +23,6 @@
*/
class WorkDir extends WorkDirBase {
static final String getMediaDirString() {
- return getMediaDirString("CtsVideoCodecTestCases-1.2");
+ return getMediaDirString("CtsVideoCodecTestCases-2.1");
}
}
diff --git a/tests/wearable/src/android/wearable/cts/WearableSensingManagerTest.java b/tests/wearable/src/android/wearable/cts/WearableSensingManagerTest.java
index 32b19b9d..7aa9cd3 100644
--- a/tests/wearable/src/android/wearable/cts/WearableSensingManagerTest.java
+++ b/tests/wearable/src/android/wearable/cts/WearableSensingManagerTest.java
@@ -18,8 +18,6 @@
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
-import static com.google.common.truth.Truth.assertThat;
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
@@ -59,22 +57,13 @@
}
@Test
- public void noAccessForNoneSystemComponent() {
- assertEquals(PackageManager.PERMISSION_DENIED, mContext.checkCallingOrSelfPermission(
- Manifest.permission.MANAGE_WEARABLE_SENSING_SERVICE));
-
- // Cts test runner is a non-system apk.
- assertThat(mWearableSensingManager).isNull();
- }
-
- @Test
public void noAccessWhenAttemptingprovideDataStream() {
assertEquals(PackageManager.PERMISSION_DENIED, mContext.checkCallingOrSelfPermission(
Manifest.permission.MANAGE_WEARABLE_SENSING_SERVICE));
- // Test non system app throws NullPointerException
+ // Test non system app throws SecurityException
assertThrows("no access to provideDataStream from non system component",
- NullPointerException.class,
+ SecurityException.class,
() -> mWearableSensingManager.provideDataStream(
mPipe[0], EXECUTOR, (result) -> {}));
}
@@ -84,9 +73,9 @@
assertEquals(PackageManager.PERMISSION_DENIED, mContext.checkCallingOrSelfPermission(
Manifest.permission.MANAGE_WEARABLE_SENSING_SERVICE));
- // Test non system app throws NullPointerException
+ // Test non system app throws SecurityException
assertThrows("no access to provideData from non system component",
- NullPointerException.class,
+ SecurityException.class,
() -> mWearableSensingManager.provideData(new PersistableBundle(), null,
EXECUTOR, (result) -> {}));
}
diff --git a/tools/cts-dynamic-config/DynamicConfig.xml b/tools/cts-dynamic-config/DynamicConfig.xml
index 5916f42..4f1a1b0 100644
--- a/tools/cts-dynamic-config/DynamicConfig.xml
+++ b/tools/cts-dynamic-config/DynamicConfig.xml
@@ -17,4 +17,43 @@
<entry key="media_files_url">
<value>https://dl.google.com/dl/android/cts/android-cts-media-1.4.zip</value>
</entry>
+
+ <!-- Required by BusinessLogic. -->
+ <entry key="business_logic_device_features">
+ <value>android.hardware.type.automotive</value>
+ <value>android.hardware.type.television</value>
+ <value>android.hardware.type.watch</value>
+ <value>android.hardware.type.embedded</value>
+ <value>android.hardware.type.pc</value>
+ <value>android.software.leanback</value>
+ <value>com.google.android.feature.PIXEL_EXPERIENCE</value>
+ <value>android.hardware.telephony</value>
+ <value>android.hardware.vr.high_performance</value>
+ <value>cn.google.services</value>
+ <value>com.google.android.feature.RU</value>
+ <value>android.hardware.ram.low</value>
+ <value>com.google.android.feature.EEA_DEVICE</value>
+ <value>com.google.android.paid.chrome</value>
+ <value>com.google.android.paid.search</value>
+ </entry>
+ <entry key="business_logic_device_properties">
+ <value>ro.build.fingerprint</value>
+ <value>ro.build.version.sdk</value>
+ <value>ro.product.brand</value>
+ <value>ro.product.first_api_level</value>
+ <value>ro.product.manufacturer</value>
+ <value>ro.product.model</value>
+ <value>ro.product.name</value>
+ </entry>
+ <entry key="business_logic_device_packages">
+ <value>com.google.android.gms</value>
+ <value>com.android.vending</value>
+ </entry>
+ <entry key="business_logic_extended_device_info">
+ <!-- Name of extended device info file and a key stored in there.
+ The name must be subclass name of DeviceInfo under compatibility/common/deviceinfo
+ and key of the value stored in the subclass. See each class what keys are used.
+ -->
+ <value>MemoryDeviceInfo:total_memory</value>
+ </entry>
</dynamicConfig>
diff --git a/tools/cts-tradefed/Android.bp b/tools/cts-tradefed/Android.bp
index 9fa7ac2..2ac1225 100644
--- a/tools/cts-tradefed/Android.bp
+++ b/tools/cts-tradefed/Android.bp
@@ -34,7 +34,7 @@
wrapper: "etc/cts-tradefed",
short_name: "CTS",
full_name: "Compatibility Test Suite",
- version: "14_r3",
+ version: "14_r4",
static_libs: ["cts-tradefed-harness"],
required: ["compatibility-host-util"],
}
diff --git a/tools/cts-tradefed/DynamicConfig.xml b/tools/cts-tradefed/DynamicConfig.xml
index 60b0e98..0395420 100644
--- a/tools/cts-tradefed/DynamicConfig.xml
+++ b/tools/cts-tradefed/DynamicConfig.xml
@@ -13,9 +13,48 @@
limitations under the License.
-->
-<!--TODO(b/117957288): Remove dynamic config from suite-level.-->
<dynamicConfig>
<entry key="media_files_url">
<value>https://dl.google.com/dl/android/cts/android-cts-media-1.4.zip</value>
</entry>
+
+
+ <!-- Required by BusinessLogic. -->
+ <entry key="business_logic_device_features">
+ <value>android.hardware.type.automotive</value>
+ <value>android.hardware.type.television</value>
+ <value>android.hardware.type.watch</value>
+ <value>android.hardware.type.embedded</value>
+ <value>android.hardware.type.pc</value>
+ <value>android.software.leanback</value>
+ <value>com.google.android.feature.PIXEL_EXPERIENCE</value>
+ <value>android.hardware.telephony</value>
+ <value>android.hardware.vr.high_performance</value>
+ <value>cn.google.services</value>
+ <value>com.google.android.feature.RU</value>
+ <value>android.hardware.ram.low</value>
+ <value>com.google.android.feature.EEA_DEVICE</value>
+ <value>com.google.android.paid.chrome</value>
+ <value>com.google.android.paid.search</value>
+ </entry>
+ <entry key="business_logic_device_properties">
+ <value>ro.build.fingerprint</value>
+ <value>ro.build.version.sdk</value>
+ <value>ro.product.brand</value>
+ <value>ro.product.first_api_level</value>
+ <value>ro.product.manufacturer</value>
+ <value>ro.product.model</value>
+ <value>ro.product.name</value>
+ </entry>
+ <entry key="business_logic_device_packages">
+ <value>com.google.android.gms</value>
+ <value>com.android.vending</value>
+ </entry>
+ <entry key="business_logic_extended_device_info">
+ <!-- Name of extended device info file and a key stored in there.
+ The name must be subclass name of DeviceInfo under compatibility/common/deviceinfo
+ and key of the value stored in the subclass. See each class what keys are used.
+ -->
+ <value>MemoryDeviceInfo:total_memory</value>
+ </entry>
</dynamicConfig>
diff --git a/tools/cts-tradefed/etc/cts-tradefed b/tools/cts-tradefed/etc/cts-tradefed
index 524b8c5..f25dded 100755
--- a/tools/cts-tradefed/etc/cts-tradefed
+++ b/tools/cts-tradefed/etc/cts-tradefed
@@ -40,9 +40,14 @@
# get OS
HOST=`uname`
-if [ "$HOST" == "Linux" ]; then
+HOST_ARCH=`uname -sm`
+if [ "$HOST_ARCH" == "Linux x86_64" ]; then
OS="linux-x86"
-elif [ "$HOST" == "Darwin" ]; then
+elif [ "$HOST_ARCH" == "Linux aarch64" ]; then
+ OS="linux-arm64"
+ # Bundled java is for linux-x86 so use host JDK on linux-arm64
+ JAVA_BINARY=java
+elif [ "$HOST_ARCH" == "Darwin x86_64" ]; then
OS="darwin-x86"
# Bundled java is for linux so use host JDK on Darwin
JAVA_BINARY=java
@@ -51,17 +56,6 @@
exit
fi
-if [ -z ${JAVA_BINARY} ]; then
- JAVA_BINARY=${CTS_ROOT}/android-cts/jdk/bin/java
-fi;
-
-if [ ! -f "${JAVA_BINARY}" ]; then
- JAVA_BINARY=java
-fi
-
-checkPath ${JAVA_BINARY}
-checkJavaVersion ${JAVA_BINARY}
-
# check if in Android build env
if [ ! -z "${ANDROID_BUILD_TOP}" ]; then
if [ ! -z "${ANDROID_HOST_OUT}" ]; then
@@ -80,6 +74,17 @@
CTS_ROOT="$(dirname $(realpath $0))/../.."
fi;
+if [ -z ${JAVA_BINARY} ]; then
+ JAVA_BINARY=${CTS_ROOT}/android-cts/jdk/bin/java
+fi;
+
+if [ ! -f "${JAVA_BINARY}" ]; then
+ JAVA_BINARY=java
+fi
+
+checkPath ${JAVA_BINARY}
+checkJavaVersion ${JAVA_BINARY}
+
JAR_DIR=${CTS_ROOT}/android-cts/tools
for JAR in ${JAR_DIR}/*.jar; do
@@ -90,8 +95,7 @@
JAR_PATH="${TRADEFED_JAR}${JAR_PATH/$TRADEFED_JAR}"
JAR_PATH=${JAR_PATH:1} # Strip off leading ':'
-LIB_DIR=${CTS_ROOT}/android-cts/lib
-loadSharedLibraries "$HOST" "$LIB_DIR"
+loadSharedLibraries "$HOST"
# include any host-side test jars
for j in $(find ${CTS_ROOT}/android-cts/testcases -name '*.jar'); do
diff --git a/tools/cts-tradefed/res/config/cts-known-failures.xml b/tools/cts-tradefed/res/config/cts-known-failures.xml
index ee57f28..75a985c 100644
--- a/tools/cts-tradefed/res/config/cts-known-failures.xml
+++ b/tools/cts-tradefed/res/config/cts-known-failures.xml
@@ -315,9 +315,60 @@
<option name="compatibility:exclude-filter" value="CtsWindowManagerDeviceTestCases android.server.wm.SurfaceControlViewHostTests#testFocusWithTouchCrossProcess" />
<option name="compatibility:exclude-filter" value="CtsWindowManagerDeviceTestCases android.server.wm.SurfaceControlViewHostTests#testChildWindowFocusable" />
+ <!-- b/305161422 -->
+ <option name="compatibility:exclude-filter" value="CtsAdServicesEndToEndTests com.android.adservices.tests.cts.topics.TopicsManagerTest#testTopicsManager_runOnDeviceClassifier" />
+ <option name="compatibility:exclude-filter" value="CtsAdServicesEndToEndTests com.android.adservices.tests.cts.topics.TopicsManagerTest#testTopicsManager_runDefaultClassifier_usingGetMethodToCreateManager" />
+ <option name="compatibility:exclude-filter" value="CtsAdServicesEndToEndTests com.android.adservices.tests.cts.topics.TopicsManagerTest#testTopicsManager_runOnDeviceClassifier_usingGetMethodToCreateManager" />
+ <option name="compatibility:exclude-filter" value="CtsAdServicesEndToEndTests com.android.adservices.tests.cts.topics.TopicsManagerTest#testTopicsManager_runDefaultClassifier" />
+
+ <!-- b/305161175 -->
+ <option name="compatibility:exclude-filter" value="CtsAdServicesMddTests com.android.adservices.tests.cts.topics.TopicsManagerMddTest#testTopicsManager_downloadModelViaMdd_runPrecomputedClassifier" />
+
<!-- b/294253316 -->
<option name="compatibility:exclude-filter" value="CtsWindowManagerDeviceTestCases android.server.wm.WindowUntrustedTouchTest#testWhenOneCustomToastWindowAndOneSawWindowBelowThreshold_blocksTouch" />
<!-- b/307489638 -->
<option name="compatibility:exclude-filter" value="CtsTelephonyTestCases android.telephony.satellite.cts.SatelliteManagerTestOnMockService" />
+
+ <!-- b/312075535 -->
+ <option name="compatibility:exclude-filter" value="CtsAdServicesTopicsAppUpdateTests com.android.adservices.tests.cts.topics.appupdate.AppUpdateTest#testAppUpdate" />
+
+ <!-- b/305609163 -->
+ <option name="compatibility:exclude-filter" value="CtsSandboxedTopicsManagerTests com.android.tests.sandbox.topics.SandboxedTopicsManagerTest#loadSdkAndRunTopicsApi" />
+
+ <!-- b/310063797 -->
+ <option name="compatibility:exclude-filter" value="CtsAdServicesPermissionsNoPermEndToEndTests com.android.adservices.tests.permissions.PermissionsNoPermTest#testPermissionNotRequested_fledgeRemoveCustomAudienceRemoteInfoOverride" />
+ <option name="compatibility:exclude-filter" value="CtsAdServicesPermissionsNoPermEndToEndTests com.android.adservices.tests.permissions.PermissionsNoPermTest#testPermissionNotRequested_fledgeResetAllAdSelectionConfigRemoteOverrides" />
+ <option name="compatibility:exclude-filter" value="CtsAdServicesPermissionsNoPermEndToEndTests com.android.adservices.tests.permissions.PermissionsNoPermTest#testPermissionNotRequested_fledgeRemoveAdSelectionConfigRemoteInfo" />
+ <option name="compatibility:exclude-filter" value="CtsAdServicesPermissionsNoPermEndToEndTests com.android.adservices.tests.permissions.PermissionsNoPermTest#testPermissionNotRequested_fledgeOverrideCustomAudienceRemoteInfo" />
+ <option name="compatibility:exclude-filter" value="CtsAdServicesPermissionsNoPermEndToEndTests com.android.adservices.tests.permissions.PermissionsNoPermTest#testPermissionNotRequested_fledgeResetAllCustomAudienceOverrides" />
+ <option name="compatibility:exclude-filter" value="CtsAdServicesPermissionsNoPermEndToEndTests com.android.adservices.tests.permissions.PermissionsNoPermTest#testPermissionNotRequested_fledgeOverrideAdSelectionConfigRemoteInfo" />
+
+ <!-- b/301216478 -->
+ <option name="compatibility:exclude-filter" value="CtsSandboxedFledgeManagerTests com.android.tests.sandbox.fledge.SandboxedFledgeManagerTest#loadSdkAndRunFledgeFlow" />
+
+ <!-- b/320761239 -->
+ <option name="compatibility:exclude-filter" value="CtsAppOpsTestCases android.app.appops.cts.AttributionTest#cannotUseTooManyAttributions" />
+ <option name="compatibility:exclude-filter" value="CtsAppOpsTestCases android.app.appops.cts.AppOpEventCollectionTest#noteFromTwoProxiesAndVerifyProxyInfo" />
+ <option name="compatibility:exclude-filter" value="CtsAppOpsTestCases android.app.appops.cts.AppOpEventCollectionTest#startStopTrustedProxyVerifyRunningAndTime" />
+ <option name="compatibility:exclude-filter" value="CtsAppOpsTestCases android.app.appops.cts.AppOpEventCollectionTest#startStopTrustedAndUntrustedProxyVerifyProxyInfo" />
+ <option name="compatibility:exclude-filter" value="CtsAttributionSourceTestCases android.attributionsource.cts.RuntimePermissionsAppOpTrackingTest#testTrustedAccessSmsAttributeToAnother" />
+ <option name="compatibility:exclude-filter" value="CtsAttributionSourceTestCases android.attributionsource.cts.RuntimePermissionsAppOpTrackingTest#testTrustedAccessCallLogAttributeToAnother" />
+ <option name="compatibility:exclude-filter" value="CtsAttributionSourceTestCases android.attributionsource.cts.RuntimePermissionsAppOpTrackingTest#testTrustedAccessContactsAttributeToAnother" />
+ <option name="compatibility:exclude-filter" value="CtsAttributionSourceTestCases android.attributionsource.cts.RuntimePermissionsAppOpTrackingTest#testTrustedAccessCalendarAttributeToAnother" />
+
+ <!-- b/318756444 -->
+ <option name="compatibility:exclude-filter" value="CtsSettingsTestCases android.settings.cts.SettingsMultiPaneDeepLinkTest#deepLinkHomeActivity_splitNotSupported_deepLinkHomeDisabled" />
+
+ <!-- b/326655855 -->
+ <option name="compatibility:exclude-filter" value="CtsShortcutManagerTestCases android.content.pm.cts.shortcutmanager.ShortcutManagerUsageTest#testReportShortcutUsed" />
+
+ <!-- b/326656256 -->
+ <option name="compatibility:exclude-filter" value="CtsShortcutHostTestCases android.content.pm.cts.shortcuthost.ShortcutManagerBackupTest#testBackupAndRestore_downgrade" />
+ <option name="compatibility:exclude-filter" value="CtsShortcutHostTestCases android.content.pm.cts.shortcuthost.ShortcutManagerBackupTest#testBackupAndRestore_noManifestOnOldVersion" />
+ <option name="compatibility:exclude-filter" value="CtsShortcutHostTestCases android.content.pm.cts.shortcuthost.ShortcutManagerBackupTest#testBackupAndRestore_invisibleIgnored" />
+
+ <!-- b/328010720 -->
+ <option name="compatibility:exclude-filter" value="CtsMediaAudioTestCases android.media.audio.cts.AudioHalVersionInfoTest#test_VERSIONS_not_contains" />
+ <option name="compatibility:exclude-filter" value="CtsMediaAudioTestCases android.media.audio.cts.AudioHalVersionInfoTest#test_VERSIONS_contains" />
</configuration>
diff --git a/tools/cts-tradefed/res/config/cts-on-gsi-exclude.xml b/tools/cts-tradefed/res/config/cts-on-gsi-exclude.xml
index 8b0cc08..f6d0b93 100644
--- a/tools/cts-tradefed/res/config/cts-on-gsi-exclude.xml
+++ b/tools/cts-tradefed/res/config/cts-on-gsi-exclude.xml
@@ -122,6 +122,8 @@
<option name="compatibility:exclude-filter" value="CtsHdmiCecHostTestCases android.hdmicec.cts.tv.HdmiCecRoutingControlTest" />
<option name="compatibility:exclude-filter" value="CtsHdmiCecHostTestCases android.hdmicec.cts.tv.HdmiCecTvOneTouchPlayTest" />
<option name="compatibility:exclude-filter" value="CtsHdmiCecHostTestCases android.hdmicec.cts.common.HdmiCecInvalidMessagesTest#cect_IgnoreBroadcastedFromSameSource" />
+ <option name="compatibility:exclude-filter" value="CtsHdmiCecHostTestCases android.hdmicec.cts.tv.HdmiCecGeneralProtocolTest#cectIgnoreAdditionalParamsAsMessage" />
+ <option name="compatibility:exclude-filter" value="CtsHdmiCecHostTestCases android.hdmicec.cts.tv.HdmiCecGeneralProtocolTest#cect_hf_ignoreAdditionalParams" />
<!-- b/192113622, b/203031609, b/204402327, b/204615046, b/204860049 Remove tests for S "optional" algorithms for GRF devices -->
<option name="compatibility:exclude-filter" value="CtsNetTestCases android.net.cts.IpSecAlgorithmImplTest#testChaCha20Poly1305" />
@@ -167,4 +169,9 @@
<option name="compatibility:exclude-filter" value="CtsKeystoreTestCases android.keystore.cts.KeyAttestationTest#testAttestationKmVersionMatchesFeatureVersionStrongBox" />
<option name="compatibility:exclude-filter" value="CtsKeystoreTestCases android.keystore.cts.DeviceOwnerKeyManagementTest#testAllVariationsOfDeviceIdAttestationUsingStrongBox" />
+ <!-- b/318588433 Remove CtsAppTestCases android.app.cts.SystemFeaturesTest#testNfcFeatures from cts-on-gsi -->
+ <option name="compatibility:exclude-filter" value="CtsAppTestCases android.app.cts.SystemFeaturesTest#testNfcFeatures" />
+
+ <!-- b/319046794 -->
+ <option name="compatibility:exclude-filter" value="CtsAppCloningHostTest" />
</configuration>
diff --git a/tools/cts-tradefed/res/config/cts-on-gsi-on-r.xml b/tools/cts-tradefed/res/config/cts-on-gsi-on-r.xml
index 64143b0..d8e749b 100644
--- a/tools/cts-tradefed/res/config/cts-on-gsi-on-r.xml
+++ b/tools/cts-tradefed/res/config/cts-on-gsi-on-r.xml
@@ -77,4 +77,13 @@
<!-- CtsSecurityHostTestCases: b/256140333 -->
<option name="compatibility:exclude-filter" value="CtsSecurityHostTestCases android.security.cts.FileSystemPermissionTest" />
+
+ <!-- CtsMediaV2TestCases: b/298410971 -->
+ <option name="compatibility:exclude-filter" value="CtsMediaV2TestCases android.mediav2.cts.EncoderProfileLevelTest#testValidateProfileLevel" />
+
+ <!-- CtsMediaCodecTestCases: b/298483255 -->
+ <option name="compatibility:exclude-filter" value="CtsMediaCodecTestCases android.media.codec.cts.MediaCodecInstancesTest#testGetMaxSupportedInstances" />
+
+ <!-- CtsVideoCodecTestCases: b/302293100 -->
+ <option name="compatibility:exclude-filter" value="CtsVideoCodecTestCases android.videocodec.cts.VideoEncoderMultiResTest#testMultiRes" />
</configuration>
diff --git a/tools/cts-tradefed/res/config/cts-on-gsi-on-s.xml b/tools/cts-tradefed/res/config/cts-on-gsi-on-s.xml
index df3b548..3a11565 100644
--- a/tools/cts-tradefed/res/config/cts-on-gsi-on-s.xml
+++ b/tools/cts-tradefed/res/config/cts-on-gsi-on-s.xml
@@ -72,4 +72,7 @@
<!-- CtsMediaDecoderTestCases: b/284409693 -->
<option name="compatibility:exclude-filter" value="CtsMediaDecoderTestCases android.media.decoder.cts.VideoDecoderPerfTest" />
+ <!-- CtsMediaV2TestCases: b/298410971 -->
+ <option name="compatibility:exclude-filter" value="CtsMediaV2TestCases android.mediav2.cts.EncoderProfileLevelTest#testValidateProfileLevel" />
+
</configuration>
diff --git a/tools/cts-tradefed/res/config/cts-on-gsi-on-t.xml b/tools/cts-tradefed/res/config/cts-on-gsi-on-t.xml
index 5f7ff35..702609e8 100644
--- a/tools/cts-tradefed/res/config/cts-on-gsi-on-t.xml
+++ b/tools/cts-tradefed/res/config/cts-on-gsi-on-t.xml
@@ -51,6 +51,9 @@
<option name="compatibility:exclude-filter" value="CtsMediaMiscTestCases android.media.misc.cts.ResourceManagerTest#testAVCVideoCodecReclaimHighResolution" />
<option name="compatibility:exclude-filter" value="CtsMediaMiscTestCases android.media.misc.cts.ResourceManagerTest#testHEVCVideoCodecReclaimHighResolution" />
+ <!-- CtsMediaV2TestCases: b/298410971 -->
+ <option name="compatibility:exclude-filter" value="CtsMediaV2TestCases android.mediav2.cts.EncoderProfileLevelTest#testValidateProfileLevel" />
+
<!-- CtsVideoCodecTestCases: b/288527955 -->
<option name="compatibility:exclude-filter" value="CtsVideoCodecTestCases android.videocodec.cts.VideoEncoderMinMaxTest" />
diff --git a/tools/cts-tradefed/res/config/cts-validation-exclude.xml b/tools/cts-tradefed/res/config/cts-validation-exclude.xml
index 1cdf400..1d077a3 100644
--- a/tools/cts-tradefed/res/config/cts-validation-exclude.xml
+++ b/tools/cts-tradefed/res/config/cts-validation-exclude.xml
@@ -526,4 +526,8 @@
<option name="compatibility:exclude-filter" value="CtsDomainVerificationDeviceMultiUserTestCases com.android.cts.packagemanager.verify.domain.device.multiuser.DomainVerificationWorkProfileAllowParentLinkingTests#inPersonal_verifiedInBothProfiles" />
<option name="compatibility:exclude-filter" value="CtsDomainVerificationDeviceMultiUserTestCases com.android.cts.packagemanager.verify.domain.device.multiuser.DomainVerificationWorkProfileAllowParentLinkingTests#inPersonal_verifiedInCurrentProfile" />
+ <!-- b/323332123 -->
+ <option name="compatibility:exclude-filter" value="CtsAppCloningHostTest com.android.cts.appcloning.contacts.ManagedProfileContactsAccessTest#testClonedAppsAccessManagedProfileContacts_contactReadsBlocked" />
+ <option name="compatibility:exclude-filter" value="CtsAppCloningHostTest com.android.cts.appcloning.contacts.ManagedProfileContactsAccessTest#testClonedAppsAccessManagedProfileContacts_contactReadSuccessfully" />
+
</configuration>
diff --git a/tools/cts-tradefed/tests/src/com/android/compatibility/common/tradefed/presubmit/ValidateTestsAbi.java b/tools/cts-tradefed/tests/src/com/android/compatibility/common/tradefed/presubmit/ValidateTestsAbi.java
index 0d35e32..1a7a3e4 100644
--- a/tools/cts-tradefed/tests/src/com/android/compatibility/common/tradefed/presubmit/ValidateTestsAbi.java
+++ b/tools/cts-tradefed/tests/src/com/android/compatibility/common/tradefed/presubmit/ValidateTestsAbi.java
@@ -116,6 +116,9 @@
BINARY_EXCEPTIONS.add("mk_payload");
BINARY_EXCEPTIONS.add("sign_virt_apex");
BINARY_EXCEPTIONS.add("simg2img");
+ BINARY_EXCEPTIONS.add("dtdiff");
+ BINARY_EXCEPTIONS.add("dtc");
+ BINARY_EXCEPTIONS.add("lz4");
/**
* These binaries are testing components with no 32-bit variant, which
diff --git a/tools/selinux/Android.bp b/tools/selinux/Android.bp
index c3bee29..5120cce 100644
--- a/tools/selinux/Android.bp
+++ b/tools/selinux/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_platform_security",
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}