Skip to content

Instantly share code, notes, and snippets.

@cybojenix cybojenix/r5_r6.diff
Last active Aug 29, 2015

Embed
What would you like to do?
#
##
# diffing platform/build
##
#
diff --git a/core/build_id.mk b/core/build_id.mk
index f404c81..73a3313 100644
--- a/core/build_id.mk
+++ b/core/build_id.mk
@@ -18,4 +18,4 @@
# (like "CRB01"). It must be a single word, and is
# capitalized by convention.
-export BUILD_ID=LRX21Q
+export BUILD_ID=LRX21T
#
##
# diffing platform/cts
##
#
diff --git a/apps/CtsVerifier/AndroidManifest.xml b/apps/CtsVerifier/AndroidManifest.xml
index a5c2a22..b6abe30 100644
--- a/apps/CtsVerifier/AndroidManifest.xml
+++ b/apps/CtsVerifier/AndroidManifest.xml
@@ -17,8 +17,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.cts.verifier"
- android:versionCode="3"
- android:versionName="5.0_r0.5">
+ android:versionCode="4"
+ android:versionName="5.0_r1">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="21"/>
@@ -94,6 +94,8 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_device_admin" />
+ <meta-data android:name="test_required_features"
+ android:value="android.software.device_admin" />
</activity>
<!-- A generic activity for intent based tests -->
@@ -108,7 +110,7 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_device_admin" />
<meta-data android:name="test_excluded_features"
- android:value="android.hardware.type.television:android.software.leanback" />
+ android:value="android.hardware.type.television:android.software.leanback:android.hardware.type.watch" />
</activity>
<receiver android:name=".admin.TestDeviceAdminReceiver"
@@ -125,6 +127,8 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
+ <meta-data android:name="test_required_features"
+ android:value="android.software.backup" />
</activity>
<activity android:name=".bluetooth.BluetoothTestActivity"
@@ -147,6 +151,7 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/bt_control" />
<meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BluetoothTestActivity" />
+ <meta-data android:name="test_excluded_features" android:value="android.software.leanback" />
</activity>
<activity android:name=".bluetooth.SecureServerActivity"
@@ -229,7 +234,8 @@
<service android:name=".bluetooth.BleScannerService"
android:label="@string/ble_scanner_service_name" />
- <activity android:name=".bluetooth.BleClientTestActivity"
+ <!-- TODO: Enable when test quality issues listed in b/18283088 is resolved -->
+ <!-- activity android:name=".bluetooth.BleClientTestActivity"
android:label="@string/ble_client_test_name"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
@@ -238,7 +244,9 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/bt_le" />
<meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BluetoothTestActivity" />
- </activity>
+ <meta-data android:name="test_required_features"
+ android:value="android.hardware.bluetooth_le"/>
+ </activity -->
<activity android:name=".bluetooth.BleClientConnectActivity"
android:label="@string/ble_client_connect_name"
@@ -328,7 +336,8 @@
<meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BleClientTestActivity" />
</activity>
- <activity android:name=".bluetooth.BleServerStartActivity"
+ <!-- TODO: Enable when test quality issues listed in b/18283088 is resolved -->
+ <!-- activity android:name=".bluetooth.BleServerStartActivity"
android:label="@string/ble_server_start_name"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
@@ -337,9 +346,12 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/bt_le" />
<meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BluetoothTestActivity" />
- </activity>
+ <meta-data android:name="test_required_features"
+ android:value="android.hardware.bluetooth_le"/>
+ </activity -->
- <activity android:name=".bluetooth.BleScannerTestActivity"
+ <!-- TODO: Enable when test quality issues listed in b/18282549 is resolved -->
+ <!-- activity android:name=".bluetooth.BleScannerTestActivity"
android:label="@string/ble_scanner_test_name"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
@@ -348,7 +360,9 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/bt_le" />
<meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BluetoothTestActivity" />
- </activity>
+ <meta-data android:name="test_required_features"
+ android:value="android.hardware.bluetooth_le"/>
+ </activity -->
<activity android:name=".bluetooth.BleScannerPowerLevelActivity"
android:label="@string/ble_power_level_name"
@@ -372,7 +386,8 @@
<meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BleScannerTestActivity" />
</activity>
- <activity android:name=".bluetooth.BleAdvertiserTestActivity"
+ <!-- TODO: Enable when test quality issues listed in b/18282549 is resolved -->
+ <!-- activity android:name=".bluetooth.BleAdvertiserTestActivity"
android:label="@string/ble_advertiser_test_name"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
@@ -381,7 +396,9 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/bt_le" />
<meta-data android:name="test_parent" android:value="com.android.cts.verifier.bluetooth.BluetoothTestActivity" />
- </activity>
+ <meta-data android:name="test_required_features"
+ android:value="android.hardware.bluetooth_le"/>
+ </activity -->
<activity android:name=".bluetooth.BleAdvertiserPowerLevelActivity"
android:label="@string/ble_power_level_name"
@@ -424,7 +441,7 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_security" />
<meta-data android:name="test_excluded_features"
- android:value="android.hardware.type.television:android.software.leanback" />
+ android:value="android.hardware.type.television:android.software.leanback:android.hardware.type.watch" />
</activity>
<activity android:name=".streamquality.StreamingVideoActivity"
@@ -435,6 +452,8 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_streaming" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.watch" />
</activity>
<activity android:name=".streamquality.PlayVideoActivity"
@@ -779,8 +798,14 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_sensors" />
- <meta-data android:name="test_required_features"
- android:value="android.hardware.sensor.accelerometer" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.stepcounter" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.stepdetector" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.proximity" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.light" />
</activity>
<!-- TODO: enable when a more reliable way to identify time synchronization is available -->
@@ -804,6 +829,14 @@
<category android:name="android.cts.intent.category.MANUAL_TEST"/>
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_sensors"/>
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.accelerometer" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.compass" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.gyroscope" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.barometer" />
</activity>
<activity android:name=".sensors.SensorBatchingTestsActivity"
@@ -814,8 +847,14 @@
<category android:name="android.cts.intent.category.MANUAL_TEST"/>
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_sensors"/>
- <meta-data android:name="test_excluded_features"
- android:value="android.hardware.type.television:android.software.leanback" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.accelerometer" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.compass" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.gyroscope" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.barometer" />
</activity>
<activity android:name=".sensors.SensorIntegrationTestsActivity"
@@ -826,6 +865,12 @@
<category android:name="android.cts.intent.category.MANUAL_TEST"/>
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_sensors"/>
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.accelerometer" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.compass" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.gyroscope" />
</activity>
<activity android:name=".sensors.SensorTestActivity"
@@ -836,6 +881,18 @@
<category android:name="android.cts.intent.category.MANUAL_TEST"/>
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_sensors"/>
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.accelerometer" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.stepcounter" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.stepdetector" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.heartrate" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.compass" />
+ <meta-data android:name="test_applicable_features"
+ android:value="android.hardware.sensor.ambient_temperature" />
</activity>
<!-- End sensor tests definitions -->
@@ -847,6 +904,10 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_location" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.television" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.software.leanback" />
</activity>
<activity android:name=".location.LocationModeHighAccuracyTestActivity"
android:label="@string/location_mode_high_accuracy_test">
@@ -855,8 +916,12 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_location" />
+ <meta-data android:name="test_required_features"
+ android:value="android.hardware.location.network:android.hardware.location.gps" />
<meta-data android:name="test_excluded_features"
- android:value="android.hardware.type.television:android.software.leanback" />
+ android:value="android.hardware.type.television" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.software.leanback" />
</activity>
<activity android:name=".location.LocationModeBatterySavingTestActivity"
android:label="@string/location_mode_battery_saving_test">
@@ -865,6 +930,11 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_location" />
+ <meta-data android:name="test_required_features" android:value="android.hardware.location.network" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.television" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.software.leanback" />
</activity>
<activity android:name=".location.LocationModeDeviceOnlyTestActivity"
android:label="@string/location_mode_device_only_test">
@@ -873,8 +943,11 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_location" />
+ <meta-data android:name="test_required_features" android:value="android.hardware.location.gps" />
<meta-data android:name="test_excluded_features"
- android:value="android.hardware.type.television:android.software.leanback" />
+ android:value="android.hardware.type.television" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.software.leanback" />
</activity>
<activity android:name=".camera.formats.CameraFormatsActivity"
@@ -976,6 +1049,8 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_hardware" />
<meta-data android:name="test_required_features" android:value="android.hardware.usb.accessory" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.watch" />
</activity>
<!-- Turned off Sensor Power Test in initial L release
<activity android:name=".sensors.SensorPowerTestActivity"
@@ -1036,6 +1111,12 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_notifications" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.watch" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.television" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.software.leanback" />
</activity>
<activity android:name=".security.CANotifyOnBootActivity"
android:label="@string/caboot_test">
@@ -1044,6 +1125,12 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_notifications" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.watch" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.television" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.software.leanback" />
</activity>
<activity android:name=".p2p.GoNegRequesterTestListActivity"
@@ -1091,14 +1178,15 @@
</intent-filter>
</activity-alias>
- <activity android:name=".sample.SampleTestActivity"
+ <!-- remove comment from the next activity to see the sample test surfacing in the app -->
+ <!-- activity android:name=".sample.SampleTestActivity"
android:label="@string/sample_framework_test">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_other" />
- </activity>
+ </activity -->
<activity android:name=".widget.WidgetTestActivity"
android:label="@string/widget_framework_test">
@@ -1107,6 +1195,8 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_other" />
+ <meta-data android:name="test_required_features"
+ android:value="android.software.app_widgets" />
</activity>
<activity android:name=".deskclock.DeskClockTestsActivity"
@@ -1116,6 +1206,10 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_deskclock" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.television" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.software.leanback" />
</activity>
<!-- TODO: enable when not requiring to tap the screen and timeouts are tuned -->
@@ -1147,8 +1241,8 @@
<meta-data
android:name="test_category"
android:value="@string/test_category_sensors" />
- <meta-data android:name="test_excluded_features"
- android:value="android.hardware.type.television:android.software.leanback" />
+ <meta-data android:name="test_required_features"
+ android:value="android.hardware.sensor.accelerometer" />
</activity>
<receiver android:name=".widget.WidgetCtsProvider">
@@ -1203,6 +1297,8 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_projection" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.watch" />
</activity>
<activity android:name=".projection.touch.ProjectionTouchActivity"
@@ -1242,7 +1338,8 @@
</activity>
- <activity android:name=".managedprovisioning.ByodFlowTestActivity"
+ <!-- TODO: enable when the test can be executed without leaving marks -->
+ <!-- activity android:name=".managedprovisioning.ByodFlowTestActivity"
android:launchMode="singleTask"
android:label="@string/provisioning_byod">
<intent-filter>
@@ -1255,7 +1352,7 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_managed_provisioning" />
<meta-data android:name="test_required_features" android:value="android.software.managed_users:android.software.device_admin" />
- </activity>
+ </activity-->
<activity android:name=".managedprovisioning.ByodHelperActivity">
<intent-filter>
@@ -1289,6 +1386,10 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_jobscheduler" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.television" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.software.leanback" />
</activity>
<activity android:name=".jobscheduler.ChargingConstraintTestActivity" android:label="@string/js_charging_test">
@@ -1297,6 +1398,10 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_jobscheduler" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.television" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.software.leanback" />
</activity>
<activity android:name=".jobscheduler.ConnectivityConstraintTestActivity" android:label="@string/js_connectivity_test">
@@ -1305,6 +1410,10 @@
<category android:name="android.cts.intent.category.MANUAL_TEST" />
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_jobscheduler" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.hardware.type.television" />
+ <meta-data android:name="test_excluded_features"
+ android:value="android.software.leanback" />
</activity>
<service android:name=".jobscheduler.MockJobService"
diff --git a/apps/CtsVerifier/res/values-television/strings.xml b/apps/CtsVerifier/res/values-television/strings.xml
new file mode 100644
index 0000000..1042fa8
--- /dev/null
+++ b/apps/CtsVerifier/res/values-television/strings.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+<resources>
+ <!-- Don't test these features on televisions. -->
+ <string-array name="disabled_tests">
+ <item>com.android.cts.verifier.notifications.NotificationAttentionManagementVerifierActivity</item>
+ <item>com.android.cts.verifier.notifications.NotificationListenerVerifierActivity</item>
+ </string-array>
+</resources>
\ No newline at end of file
diff --git a/apps/CtsVerifier/res/values-watch/strings.xml b/apps/CtsVerifier/res/values-watch/strings.xml
new file mode 100644
index 0000000..1f25b04
--- /dev/null
+++ b/apps/CtsVerifier/res/values-watch/strings.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+<resources>
+ <!-- Don't test these features on watches. -->
+ <string-array name="disabled_tests">
+ <item>com.android.cts.verifier.notifications.NotificationAttentionManagementVerifierActivity</item>
+ <item>com.android.cts.verifier.notifications.NotificationListenerVerifierActivity</item>
+ </string-array>
+</resources>
\ No newline at end of file
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index fa86474..cb35c3d 100644
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -260,7 +260,7 @@
<string name="ble_scanner_power_level_instruction">Count: Ultra low &lt; low &lt; medium &lt; high\nRssi: Ultra low &lt; low &lt; medium &lt; high\nDistance to see count freezing: Ultra low &lt; low &lt; medium &lt; high\nA common error is ultra low, low and medium behave similarly, with similar rssi, freeze at similar distance.\n\n All power level receive a different mac address. After 15 mins, a green text "Get a new Mac address" will show up.</string>
<string name="ble_scanner_scan_filter_name">BLE Hardware Scan Filter</string>
<string name="ble_scanner_scan_filter_info">Lock the screen of scanner, and connect to monsoon. It will not wake up when advertiser is advertising unscannable, and scanner is scanning with filter.</string>
- <string name="ble_scanner_scan_filter_instruction">For monsoon test:\n\tClick scan with filter, lock the screen, connect to monsoon. It will not wake up when advertiser is advertising unscannable data packets, but will show a peak in power usage when advertiser is advertising scannable data.\nFor logcat test:\n\tClick scan with filter, logcat the scanner. No data will be received by GattService when advertiser is advertising unscannable data.</string>
+ <string name="ble_scanner_scan_filter_instruction">Scan filter is to scan data with service UUID = 0x6666 only. If you scan without scan filter, data with service UUID = 0x5555 and 0x6666 will show up on screen.\nFor monsoon test:\n\tClick scan with filter, lock the screen, connect to monsoon. It will not wake up when advertiser is advertising unscannable data packets, but will show a peak in power usage when advertiser is advertising scannable data.\nFor logcat test:\n\tClick scan with filter, logcat the scanner. No data will be received by GattService when advertiser is advertising unscannable data.</string>
<string name="ble_scan_with_filter">Scan with filter</string>
<string name="ble_scan_without_filter">Scan without filter</string>
@@ -1264,7 +1264,7 @@
<string name="device_owner_provisioning_tests_info">The device owner provisioning tests verify that setting up a corporate owned device can only be done on a factory reset device.</string>
<string name="device_owner_provisioning_category">Device Owner Provisioning</string>
<string name="device_owner_negative_test">Device owner negative test</string>
- <string name="device_owner_negative_test_info">Device owner provisioning should only work on new or factory reset devices. Please click on the "Start provisioning" button and verify that you get a warning dialog telling you that the device is already set up. If that is the case, this test has passed.</string>
+ <string name="device_owner_negative_test_info">Please click the "Start provisioning" button, and when you see a warning dialog telling the device is already set up, select "pass". Otherwise, select "fail".</string>
<string name="start_device_owner_provisioning_button">Start provisioning</string>
<!-- Strings for JobScheduler Tests -->
@@ -1290,4 +1290,8 @@
<string name="js_unmetered_connectivity_test">Device with no connectivity will not execute a job with an unmetered connectivity constraint.</string>
<string name="js_any_connectivity_test">Device with no connectivity will not execute a job with an unmetered connectivity constraint.</string>
<string name="js_no_connectivity_test">Device with no connectivity will still execute a job with no connectivity constraints.</string>
+
+ <!-- A list of fully-qualified test classes that should not be run. -->
+ <string-array name="disabled_tests" />
+
</resources>
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java b/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
index 2f42e81..0b73642 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
@@ -22,12 +22,14 @@ import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
+import android.util.Log;
import android.widget.ListView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -75,6 +77,13 @@ import java.util.Map;
* <meta-data android:name="test_excluded_features" android:value="android.hardware.type.television" />
* </pre>
* </li>
+ * <li>OPTIONAL: Add a meta data attribute to indicate features such that, if any present,
+ * the test is applicable to run. If the device has any of the applicable features then
+ * the test will appear in the test list. Use a colon (:) to specify multiple features
+ * <pre>
+ * <meta-data android:name="test_applicable_features" android:value="android.hardware.sensor.compass" />
+ * </pre>
+ * </li>
*
* </ol>
*/
@@ -88,6 +97,10 @@ public class ManifestTestListAdapter extends TestListAdapter {
private static final String TEST_EXCLUDED_FEATURES_META_DATA = "test_excluded_features";
+ private static final String TEST_APPLICABLE_FEATURES_META_DATA = "test_applicable_features";
+
+ private final HashSet<String> mDisabledTests;
+
private Context mContext;
private String mTestParent;
@@ -96,6 +109,12 @@ public class ManifestTestListAdapter extends TestListAdapter {
super(context);
mContext = context;
mTestParent = testParent;
+
+ String[] disabledTestArray = context.getResources().getStringArray(R.array.disabled_tests);
+ mDisabledTests = new HashSet<>(disabledTestArray.length);
+ for (int i = 0; i < disabledTestArray.length; i++) {
+ mDisabledTests.add(disabledTestArray[i]);
+ }
}
@Override
@@ -158,13 +177,18 @@ public class ManifestTestListAdapter extends TestListAdapter {
int size = list.size();
for (int i = 0; i < size; i++) {
ResolveInfo info = list.get(i);
+ if (info.activityInfo == null || mDisabledTests.contains(info.activityInfo.name)) {
+ Log.w("CtsVerifier", "ignoring disabled test: " + info.activityInfo.name);
+ continue;
+ }
String title = getTitle(mContext, info.activityInfo);
String testName = info.activityInfo.name;
Intent intent = getActivityIntent(info.activityInfo);
String[] requiredFeatures = getRequiredFeatures(info.activityInfo.metaData);
String[] excludedFeatures = getExcludedFeatures(info.activityInfo.metaData);
- TestListItem item = TestListItem.newTest(title, testName, intent,
- requiredFeatures, excludedFeatures);
+ String[] applicableFeatures = getApplicableFeatures(info.activityInfo.metaData);
+ TestListItem item = TestListItem.newTest(title, testName, intent, requiredFeatures,
+ excludedFeatures, applicableFeatures);
String testCategory = getTestCategory(mContext, info.activityInfo.metaData);
addTestToCategory(testsByCategory, testCategory, item);
@@ -215,6 +239,19 @@ public class ManifestTestListAdapter extends TestListAdapter {
}
}
+ static String[] getApplicableFeatures(Bundle metaData) {
+ if (metaData == null) {
+ return null;
+ } else {
+ String value = metaData.getString(TEST_APPLICABLE_FEATURES_META_DATA);
+ if (value == null) {
+ return null;
+ } else {
+ return value.split(":");
+ }
+ }
+ }
+
static String getTitle(Context context, ActivityInfo activityInfo) {
if (activityInfo.labelRes != 0) {
return context.getString(activityInfo.labelRes);
@@ -270,8 +307,11 @@ public class ManifestTestListAdapter extends TestListAdapter {
for (TestListItem test : tests) {
String[] excludedFeatures = test.excludedFeatures;
String[] requiredFeatures = test.requiredFeatures;
+ String[] applicableFeatures = test.applicableFeatures;
if (!hasAnyFeature(excludedFeatures) && hasAllFeatures(requiredFeatures)) {
- filteredTests.add(test);
+ if (hasAnyFeature(applicableFeatures) || hasAllFeatures(applicableFeatures)) {
+ filteredTests.add(test);
+ }
}
}
return filteredTests;
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java b/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java
index 0d9985c..afe3a73 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java
@@ -86,26 +86,43 @@ public abstract class TestListAdapter extends BaseAdapter {
/** Features such that, if any present, the test gets excluded from being shown. */
final String[] excludedFeatures;
+ /** If any of of the features are present the test is meaningful to run. */
+ final String[] applicableFeatures;
+
+ public static TestListItem newTest(Context context, int titleResId, String testName,
+ Intent intent, String[] requiredFeatures, String[] excludedFeatures,
+ String[] applicableFeatures) {
+ return newTest(context.getString(titleResId), testName, intent, requiredFeatures,
+ excludedFeatures, applicableFeatures);
+ }
+
public static TestListItem newTest(Context context, int titleResId, String testName,
Intent intent, String[] requiredFeatures, String[] excludedFeatures) {
- return newTest(context.getString(titleResId), testName, intent,
- requiredFeatures, excludedFeatures);
+ return newTest(context.getString(titleResId), testName, intent, requiredFeatures,
+ excludedFeatures, null);
}
public static TestListItem newTest(Context context, int titleResId, String testName,
Intent intent, String[] requiredFeatures) {
- return newTest(context.getString(titleResId), testName, intent,
- requiredFeatures, null);
+ return newTest(context.getString(titleResId), testName, intent, requiredFeatures, null,
+ null);
+ }
+
+ public static TestListItem newTest(String title, String testName, Intent intent,
+ String[] requiredFeatures, String[] excludedFeatures, String[] applicableFeatures) {
+ return new TestListItem(title, testName, intent, requiredFeatures, excludedFeatures,
+ applicableFeatures);
}
public static TestListItem newTest(String title, String testName, Intent intent,
String[] requiredFeatures, String[] excludedFeatures) {
- return new TestListItem(title, testName, intent, requiredFeatures, excludedFeatures);
+ return new TestListItem(title, testName, intent, requiredFeatures, excludedFeatures,
+ null);
}
public static TestListItem newTest(String title, String testName, Intent intent,
String[] requiredFeatures) {
- return new TestListItem(title, testName, intent, requiredFeatures, null);
+ return new TestListItem(title, testName, intent, requiredFeatures, null, null);
}
public static TestListItem newCategory(Context context, int titleResId) {
@@ -113,16 +130,17 @@ public abstract class TestListAdapter extends BaseAdapter {
}
public static TestListItem newCategory(String title) {
- return new TestListItem(title, null, null, null, null);
+ return new TestListItem(title, null, null, null, null, null);
}
private TestListItem(String title, String testName, Intent intent,
- String[] requiredFeatures, String[] excludedFeatures) {
+ String[] requiredFeatures, String[] excludedFeatures, String[] applicableFeatures) {
this.title = title;
this.testName = testName;
this.intent = intent;
this.requiredFeatures = requiredFeatures;
this.excludedFeatures = excludedFeatures;
+ this.applicableFeatures = applicableFeatures;
}
boolean isTest() {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserHardwareScanFilterActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserHardwareScanFilterActivity.java
index 242bb08..be2fef9 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserHardwareScanFilterActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserHardwareScanFilterActivity.java
@@ -83,6 +83,7 @@ public class BleAdvertiserHardwareScanFilterActivity extends PassFailButtons.Act
public void onResume() {
super.onResume();
IntentFilter filter = new IntentFilter();
+ filter.addAction(BleAdvertiserService.BLE_ADV_NOT_SUPPORT);
filter.addAction(BleAdvertiserService.BLE_START_SCANNABLE);
filter.addAction(BleAdvertiserService.BLE_START_UNSCANNABLE);
filter.addAction(BleAdvertiserService.BLE_STOP_SCANNABLE);
@@ -106,6 +107,10 @@ public class BleAdvertiserHardwareScanFilterActivity extends PassFailButtons.Act
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
}
+ private void pass() {
+ this.setTestResultAndFinish(true);
+ }
+
private void stopAdvertising() {
Intent intent = new Intent(BleAdvertiserHardwareScanFilterActivity.this,
BleAdvertiserService.class);
@@ -130,6 +135,9 @@ public class BleAdvertiserHardwareScanFilterActivity extends PassFailButtons.Act
case BleAdvertiserService.BLE_STOP_UNSCANNABLE:
showMessage("Stop advertising");
break;
+ case BleAdvertiserService.BLE_ADV_NOT_SUPPORT:
+ pass();
+ break;
}
}
};
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserPowerLevelActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserPowerLevelActivity.java
index 3568002..1cc9206 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserPowerLevelActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserPowerLevelActivity.java
@@ -67,6 +67,7 @@ public class BleAdvertiserPowerLevelActivity extends PassFailButtons.Activity {
IntentFilter filter = new IntentFilter();
filter.addAction(BleAdvertiserService.BLE_START_POWER_LEVEL);
filter.addAction(BleAdvertiserService.BLE_STOP_POWER_LEVEL);
+ filter.addAction(BleAdvertiserService.BLE_ADV_NOT_SUPPORT);
registerReceiver(onBroadcast, filter);
}
@@ -94,6 +95,10 @@ public class BleAdvertiserPowerLevelActivity extends PassFailButtons.Activity {
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
}
+ private void pass() {
+ this.setTestResultAndFinish(true);
+ }
+
private BroadcastReceiver onBroadcast = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
@@ -104,6 +109,9 @@ public class BleAdvertiserPowerLevelActivity extends PassFailButtons.Activity {
case BleAdvertiserService.BLE_STOP_POWER_LEVEL:
showMessage("Stop advertising");
break;
+ case BleAdvertiserService.BLE_ADV_NOT_SUPPORT:
+ pass();
+ break;
}
}
};
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserService.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserService.java
index 7b4235b..281b2e8 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserService.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserService.java
@@ -53,6 +53,8 @@ public class BleAdvertiserService extends Service {
public static final int COMMAND_START_UNSCANNABLE = 6;
public static final int COMMAND_STOP_UNSCANNABLE = 7;
+ public static final String BLE_ADV_NOT_SUPPORT =
+ "com.android.cts.verifier.bluetooth.BLE_ADV_NOT_SUPPORT";
public static final String BLE_START_ADVERTISE =
"com.android.cts.verifier.bluetooth.BLE_START_ADVERTISE";
public static final String BLE_STOP_ADVERTISE =
@@ -147,11 +149,15 @@ public class BleAdvertiserService extends Service {
public void onDestroy() {
super.onDestroy();
if (mAdvertiser != null) {
- mAdvertiser.stopAdvertising(mCallback);
+ stopAdvertiser();
}
}
private void stopAdvertiser() {
+ if (mAdvertiser == null) {
+ mAdvertiserStatus = 0;
+ return;
+ }
if ((mAdvertiserStatus & (1 << COMMAND_START_ADVERTISE)) > 0) {
mAdvertiser.stopAdvertising(mCallback);
}
@@ -186,8 +192,12 @@ public class BleAdvertiserService extends Service {
}
private void handleIntent(Intent intent) {
- if (mAdvertiser == null) {
- showMessage("Multi advertising not supported on this device");
+ if (mBluetoothAdapter != null && !mBluetoothAdapter.isMultipleAdvertisementSupported()) {
+ showMessage("Multiple advertisement is not supported.");
+ sendBroadcast(new Intent(BLE_ADV_NOT_SUPPORT));
+ return;
+ } else if (mAdvertiser == null) {
+ showMessage("Cannot start advertising on this device.");
return;
}
int command = intent.getIntExtra(EXTRA_COMMAND, -1);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientConnectActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientConnectActivity.java
old mode 100644
new mode 100755
index a3a9830..fb351b1
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientConnectActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientConnectActivity.java
@@ -63,19 +63,15 @@ public class BleClientConnectActivity extends PassFailButtons.Activity {
}
}
});
- }
- @Override
- public void onResume() {
- super.onResume();
IntentFilter filter = new IntentFilter();
filter.addAction(BleClientService.BLE_BLUETOOTH_CONNECTED);
registerReceiver(onBroadcast, filter);
}
@Override
- public void onPause() {
- super.onPause();
+ protected void onDestroy(){
+ super.onDestroy();
unregisterReceiver(onBroadcast);
}
@@ -90,4 +86,4 @@ public class BleClientConnectActivity extends PassFailButtons.Activity {
getPassButton().setEnabled(true);
}
};
-}
\ No newline at end of file
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java
index eea1b76..e5af6ba 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java
@@ -77,6 +77,8 @@ public class PhotoCaptureActivity extends Activity
private int mResolutionSpinnerIndex = -1;
private WakeLock mWakeLock;
private long shutterStartTime;
+ private int mPreviewOrientation;
+ private int mJpegOrientation;
private ArrayList<Integer> mPreviewSizeCamerasToProcess = new ArrayList<Integer>();
@@ -410,6 +412,8 @@ public class PhotoCaptureActivity extends Activity
Toast.makeText(this, t.getMessage(), Toast.LENGTH_LONG).show();
return;
}
+
+ calculateOrientations(this, mSelectedResolution.cameraId, mCamera);
Camera.Parameters params = setCameraParams(mCamera);
// Either use chosen preview size for current camera or automatically
@@ -429,7 +433,7 @@ public class PhotoCaptureActivity extends Activity
private void startPreview() {
if (mCameraInitialized && mCamera != null) {
- setCameraDisplayOrientation(this, mSelectedResolution.cameraId, mCamera);
+ mCamera.setDisplayOrientation(mPreviewOrientation);
mCamera.startPreview();
mPreviewActive = true;
}
@@ -479,6 +483,7 @@ public class PhotoCaptureActivity extends Activity
Camera.Parameters params = camera.getParameters();
params.setJpegThumbnailSize(0, 0);
params.setJpegQuality(100);
+ params.setRotation(mJpegOrientation);
params.setFocusMode(getFocusMode(camera));
params.setZoom(0);
params.setPictureSize(mSelectedResolution.width, mSelectedResolution.height);
@@ -506,7 +511,7 @@ public class PhotoCaptureActivity extends Activity
return result;
}
- public static void setCameraDisplayOrientation(Activity activity,
+ private void calculateOrientations(Activity activity,
int cameraId, android.hardware.Camera camera) {
android.hardware.Camera.CameraInfo info =
new android.hardware.Camera.CameraInfo();
@@ -521,13 +526,12 @@ public class PhotoCaptureActivity extends Activity
case Surface.ROTATION_270: degrees = 270; break;
}
- int result;
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
- result = (info.orientation + degrees) % 360;
- result = (360 - result) % 360; // compensate the mirror
+ mJpegOrientation = (info.orientation + degrees) % 360;
+ mPreviewOrientation = (360 - mJpegOrientation) % 360; // compensate the mirror
} else { // back-facing
- result = (info.orientation - degrees + 360) % 360;
+ mJpegOrientation = (info.orientation - degrees + 360) % 360;
+ mPreviewOrientation = mJpegOrientation;
}
- camera.setDisplayOrientation(result);
}
}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java
index 97c0521..0a0e830 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java
@@ -70,6 +70,7 @@ public class CameraVideoActivity extends PassFailButtons.Activity
private int mPreviewTexWidth;
private int mPreviewTexHeight;
private int mPreviewRotation;
+ private int mVideoRotation;
private VideoView mPlaybackView;
@@ -162,7 +163,10 @@ public class CameraVideoActivity extends PassFailButtons.Activity
// Step 5: set preview output
// This is not necessary since preview has been taken care of
- // Step 6: prepare configured MediaRecorder
+ // Step 6: set orientation hint
+ mMediaRecorder.setOrientationHint(mVideoRotation);
+
+ // Step 7: prepare configured MediaRecorder
try {
mMediaRecorder.prepare();
} catch (IOException e) {
@@ -644,10 +648,11 @@ public class CameraVideoActivity extends PassFailButtons.Activity
}
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
- mPreviewRotation = (info.orientation + degrees) % 360;
- mPreviewRotation = (360 - mPreviewRotation) % 360; // compensate the mirror
+ mVideoRotation = (info.orientation + degrees) % 360;
+ mPreviewRotation = (360 - mVideoRotation) % 360; // compensate the mirror
} else { // back-facing
- mPreviewRotation = (info.orientation - degrees + 360) % 360;
+ mVideoRotation = (info.orientation - degrees + 360) % 360;
+ mPreviewRotation = mVideoRotation;
}
if (mPreviewRotation != 0 && mPreviewRotation != 180) {
Log.w(TAG,
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
index 032442b..74a5317 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
@@ -169,6 +169,10 @@ public class FeatureSummaryActivity extends PassFailButtons.ListActivity {
};
public static final Feature[] ALL_JELLY_BEAN_FEATURES = {
+ // Required features in prior releases that became optional
+ new Feature(PackageManager.FEATURE_FAKETOUCH, false),
+
+ //new feature in JB
new Feature(PackageManager.FEATURE_TELEVISION, false),
};
@@ -190,13 +194,37 @@ public class FeatureSummaryActivity extends PassFailButtons.ListActivity {
public static final Feature[] ALL_KITKAT_WATCH_FEATURES = {
new Feature(PackageManager.FEATURE_SENSOR_HEART_RATE, false),
+ new Feature(PackageManager.FEATURE_BACKUP, false),
+ new Feature(PackageManager.FEATURE_PRINTING, false),
+ new Feature(PackageManager.FEATURE_WATCH, false),
+ new Feature(PackageManager.FEATURE_WEBVIEW, false),
+ new Feature(PackageManager.FEATURE_CAMERA_EXTERNAL, false),
};
- public static final Feature[] ALL_LMP_FEATURES = {
+ public static final Feature[] ALL_LOLLIPOP_FEATURES = {
+ // New features in L
+ new Feature(PackageManager.FEATURE_AUDIO_OUTPUT, false),
+ new Feature(PackageManager.FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING, false),
+ new Feature(PackageManager.FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR, false),
+ new Feature(PackageManager.FEATURE_CAMERA_CAPABILITY_RAW, false),
+ new Feature(PackageManager.FEATURE_CAMERA_LEVEL_FULL, false),
+ new Feature(PackageManager.FEATURE_CONNECTION_SERVICE, false),
+ new Feature(PackageManager.FEATURE_GAMEPAD, false),
+ new Feature(PackageManager.FEATURE_LEANBACK, false),
+ new Feature(PackageManager.FEATURE_LIVE_TV, false),
+ new Feature(PackageManager.FEATURE_MANAGED_USERS, false),
+ new Feature(PackageManager.FEATURE_OPENGLES_EXTENSION_PACK, false),
+ new Feature(PackageManager.FEATURE_SECURELY_REMOVES_USERS, false),
+ new Feature(PackageManager.FEATURE_SENSOR_AMBIENT_TEMPERATURE, false),
new Feature(PackageManager.FEATURE_SENSOR_HEART_RATE_ECG, false),
+ new Feature(PackageManager.FEATURE_SENSOR_RELATIVE_HUMIDITY, false),
+ new Feature(PackageManager.FEATURE_VERIFIED_BOOT, false),
+
+ // New hidden features in L
new Feature("android.hardware.ethernet", false),
- new Feature("android.software.backup", false),
- new Feature("android.software.print", false),
+ new Feature("android.hardware.hdmi.cec", false),
+ new Feature("android.software.leanback_only", false),
+ new Feature("android.software.voice_recognizers", false),
};
@Override
@@ -230,7 +258,7 @@ public class FeatureSummaryActivity extends PassFailButtons.ListActivity {
// add features from latest to last so that the latest requirements are put in the set first
int apiVersion = Build.VERSION.SDK_INT;
if (apiVersion >= Build.VERSION_CODES.LOLLIPOP) {
- Collections.addAll(features, ALL_LMP_FEATURES);
+ Collections.addAll(features, ALL_LOLLIPOP_FEATURES);
}
if (apiVersion >= Build.VERSION_CODES.KITKAT_WATCH) {
Collections.addAll(features, ALL_KITKAT_WATCH_FEATURES);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationAttentionManagementVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationAttentionManagementVerifierActivity.java
index e355b07..b4e348f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationAttentionManagementVerifierActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationAttentionManagementVerifierActivity.java
@@ -82,6 +82,7 @@ public class NotificationAttentionManagementVerifierActivity
createAutoItem(R.string.nls_service_started);
createAutoItem(R.string.attention_create_contacts);
createRetryItem(R.string.attention_filter_none);
+ createAutoItem(R.string.attention_all_are_filtered);
createRetryItem(R.string.attention_filter_all);
createAutoItem(R.string.attention_none_are_filtered);
createAutoItem(R.string.attention_default_order);
@@ -114,42 +115,45 @@ public class NotificationAttentionManagementVerifierActivity
testModeNone(mState);
break;
case 4:
- testModeAll(mState);
+ testNoneInterceptsAll(mState);
break;
case 5:
- testALLInterceptsNothing(mState);
+ testModeAll(mState);
break;
case 6:
- testDefaultOrder(mState);
+ testAllInterceptsNothing(mState);
break;
case 7:
- testInterruptionOrder(mState);
+ testDefaultOrder(mState);
break;
case 8:
- testPrioritytOrder(mState);
+ testInterruptionOrder(mState);
break;
case 9:
- testAmbientBits(mState);
+ testPrioritytOrder(mState);
break;
case 10:
- testLookupUriOrder(mState);
+ testAmbientBits(mState);
break;
case 11:
- testEmailOrder(mState);
+ testLookupUriOrder(mState);
break;
case 12:
- testPhoneOrder(mState);
+ testEmailOrder(mState);
break;
case 13:
- testModePriority(mState);
+ testPhoneOrder(mState);
break;
case 14:
- testPriorityInterceptsSome(mState);
+ testModePriority(mState);
break;
case 15:
- testDeleteContacts(mState);
+ testPriorityInterceptsSome(mState);
break;
case 16:
+ testDeleteContacts(mState);
+ break;
+ case 17:
getPassButton().setEnabled(true);
mNm.cancelAll();
break;
@@ -678,7 +682,7 @@ public class NotificationAttentionManagementVerifierActivity
}
// Nothing should be filtered when mode is ALL
- private void testALLInterceptsNothing(final int i) {
+ private void testAllInterceptsNothing(final int i) {
if (mStatus[i] == SETUP) {
mNm.cancelAll();
MockListener.resetListenerData(this);
@@ -783,6 +787,59 @@ public class NotificationAttentionManagementVerifierActivity
}
}
+ // Nothing should get through when mode is None.
+ private void testNoneInterceptsAll(final int i) {
+ if (mStatus[i] == SETUP) {
+ mNm.cancelAll();
+ MockListener.resetListenerData(this);
+ mStatus[i] = CLEARED;
+ // wait for intent to move through the system
+ delay();
+ } else if (mStatus[i] == CLEARED) {
+ sendNotifications(MODE_URI, false, false);
+ mStatus[i] = READY;
+ // wait for notifications to move through the system
+ delay();
+ } else {
+ MockListener.probeListenerPayloads(mContext,
+ new MockListener.StringListResultCatcher() {
+ @Override
+ public void accept(List<String> result) {
+ boolean pass = false;
+ Set<String> found = new HashSet<String>();
+ if (result != null && result.size() > 0) {
+ pass = true;
+ for (String payloadData : result) {
+ try {
+ JSONObject payload = new JSONObject(payloadData);
+ String tag = payload.getString(JSON_TAG);
+ if (found.contains(tag)) {
+ // multiple entries for same notification!
+ pass = false;
+ } else if (ALICE.equals(tag)) {
+ found.add(ALICE);
+ pass &= !payload.getBoolean(JSON_MATCHES_ZEN_FILTER);
+ } else if (BOB.equals(tag)) {
+ found.add(BOB);
+ pass &= !payload.getBoolean(JSON_MATCHES_ZEN_FILTER);
+ } else if (CHARLIE.equals(tag)) {
+ found.add(CHARLIE);
+ pass &= !payload.getBoolean(JSON_MATCHES_ZEN_FILTER);
+ }
+ } catch (JSONException e) {
+ pass = false;
+ Log.e(TAG, "failed to unpack data from mocklistener", e);
+ }
+ }
+ }
+ pass &= found.size() == 3;
+ mStatus[i] = pass ? PASS : FAIL;
+ next();
+ }
+ });
+ }
+ }
+
/** Search a list of notification keys for a givcen tag. */
private int findTagInKeys(String tag, List<String> orderedKeys) {
for (int i = 0; i < orderedKeys.size(); i++) {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/projection/list/ListPresentation.java b/apps/CtsVerifier/src/com/android/cts/verifier/projection/list/ListPresentation.java
index dad4945..5dddf5c 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/projection/list/ListPresentation.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/projection/list/ListPresentation.java
@@ -50,7 +50,7 @@ public class ListPresentation extends ProjectedPresentation {
setContentView(view);
for (int i = 0; i < NUM_ITEMS; ++i) {
- mItemList.add("Item #" + i);
+ mItemList.add("Item #" + 1 + i);
}
ListView listView = (ListView) view.findViewById(R.id.pla_list);
diff --git a/libs/commonutil/src/com/android/cts/util/AbiUtils.java b/libs/commonutil/src/com/android/cts/util/AbiUtils.java
index 6f47d52..42336f3 100644
--- a/libs/commonutil/src/com/android/cts/util/AbiUtils.java
+++ b/libs/commonutil/src/com/android/cts/util/AbiUtils.java
@@ -157,6 +157,22 @@ public class AbiUtils {
}
/**
+ * @return the test name portion of the test id.
+ * e.g. armeabi-v7a android.mytest = android.mytest
+ */
+ public static String parseTestName(String id) {
+ return parseId(id)[1];
+ }
+
+ /**
+ * @return the abi portion of the test id.
+ * e.g. armeabi-v7a android.mytest = armeabi-v7a
+ */
+ public static String parseAbi(String id) {
+ return parseId(id)[0];
+ }
+
+ /**
* @param name The name of the ABI.
* @return The bitness of the ABI with the given name
*/
diff --git a/tests/expectations/knownfailures.txt b/tests/expectations/knownfailures.txt
index ff3f921..dd8660f 100644
--- a/tests/expectations/knownfailures.txt
+++ b/tests/expectations/knownfailures.txt
@@ -1,5 +1,19 @@
[
{
+ description: "the UsageStats is not yet stable enough",
+ names: [
+ "android.app.usage.cts.UsageStatsTest"
+ ],
+ bug: 17536113
+},
+{
+ description: "the ConnectivityConstraintTest are not yet stable",
+ names: [
+ "android.jobscheduler.cts.ConnectivityConstraintTest"
+ ],
+ bug: 18117279
+},
+{
description: "tests a fragile by nature as they rely on hardcoded behavior",
names: [
"android.accessibilityservice.cts.AccessibilityTextTraversalTest#testActionNextAndPreviousAtGranularityPageOverText",
diff --git a/tests/expectations/unsupportedabis.txt b/tests/expectations/unsupportedabis.txt
index 817179b..7ad3682 100644
--- a/tests/expectations/unsupportedabis.txt
+++ b/tests/expectations/unsupportedabis.txt
@@ -9,11 +9,7 @@
"android.renderscriptlegacy.cts.LeakTest",
"android.renderscriptlegacy.cts.RSBase",
"android.renderscriptlegacy.cts.RSBaseCompute",
- "android.renderscriptlegacy.cts.VersionTest",
- "android.sample.cts.SampleDeviceResultTest",
- "android.sample.cts.SampleDeviceTest",
- "android.sample.cts.SampleHostResultTest",
- "android.sample.cts.SampleHostTest"
+ "android.renderscriptlegacy.cts.VersionTest"
]
}
]
diff --git a/tests/tests/hardware/src/android/hardware/camera2/cts/helpers/StaticMetadata.java b/tests/tests/hardware/src/android/hardware/camera2/cts/helpers/StaticMetadata.java
index fb2001f..a5c7083 100644
--- a/tests/tests/hardware/src/android/hardware/camera2/cts/helpers/StaticMetadata.java
+++ b/tests/tests/hardware/src/android/hardware/camera2/cts/helpers/StaticMetadata.java
@@ -57,7 +57,7 @@ public class StaticMetadata {
private static final long SENSOR_INFO_EXPOSURE_TIME_RANGE_MIN_AT_MOST = 100000L; // 100us
private static final long SENSOR_INFO_EXPOSURE_TIME_RANGE_MAX_AT_LEAST = 100000000; // 100ms
private static final int SENSOR_INFO_SENSITIVITY_RANGE_MIN_AT_MOST = 100;
- private static final int SENSOR_INFO_SENSITIVITY_RANGE_MAX_AT_LEAST = 1600;
+ private static final int SENSOR_INFO_SENSITIVITY_RANGE_MAX_AT_LEAST = 800;
private static final int STATISTICS_INFO_MAX_FACE_COUNT_MIN_AT_LEAST = 4;
private static final int TONEMAP_MAX_CURVE_POINTS_AT_LEAST = 64;
private static final int CONTROL_AE_COMPENSATION_RANGE_DEFAULT_MIN = -2;
diff --git a/tests/tests/rscpp/src/android/cts/rscpp/RSCppTest.java b/tests/tests/rscpp/src/android/cts/rscpp/RSCppTest.java
index 6cbb9bc..9b09cc7 100644
--- a/tests/tests/rscpp/src/android/cts/rscpp/RSCppTest.java
+++ b/tests/tests/rscpp/src/android/cts/rscpp/RSCppTest.java
@@ -91,6 +91,7 @@ public class RSCppTest extends AndroidTestCase {
mRS = RenderScript.create(mCtx);
mRS.setMessageHandler(mRsMessage);
mVerify = new ScriptC_verify(mRS);
+ mVerify.set_gAllowedIntError(3);
}
@Override
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java b/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
index 27f9135..e0cfee1 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
@@ -31,7 +31,7 @@ public class CtsBuildProvider implements IBuildProvider {
@Option(name="cts-install-path", description="the path to the cts installation to use")
private String mCtsRootDirPath = System.getProperty("CTS_ROOT");
- public static final String CTS_BUILD_VERSION = "5.0_r0.5";
+ public static final String CTS_BUILD_VERSION = "5.0_r1";
/**
* {@inheritDoc}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/command/CtsConsole.java b/tools/tradefed-host/src/com/android/cts/tradefed/command/CtsConsole.java
index 7333de2..ca4e050 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/command/CtsConsole.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/command/CtsConsole.java
@@ -80,7 +80,7 @@ public class CtsConsole extends Console {
public void run() {
CtsBuildHelper ctsBuild = getCtsBuild();
if (ctsBuild != null) {
- listPackages(ctsBuild, AbiUtils.getAbisSupportedByCts());
+ listPackages(ctsBuild);
}
}
}, LIST_PATTERN, "packages");
@@ -193,8 +193,8 @@ public class CtsConsole extends Console {
}
}
- private void listPackages(CtsBuildHelper ctsBuild, Set<String> abis) {
- ITestPackageRepo testCaseRepo = new TestPackageRepo(ctsBuild.getTestCasesDir(), abis, false);
+ private void listPackages(CtsBuildHelper ctsBuild) {
+ ITestPackageRepo testCaseRepo = new TestPackageRepo(ctsBuild.getTestCasesDir(), false);
for (String packageName : testCaseRepo.getPackageNames()) {
printLine(packageName);
}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/result/PlanCreator.java b/tools/tradefed-host/src/com/android/cts/tradefed/result/PlanCreator.java
index 713e8fa..3881c0e 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/result/PlanCreator.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/result/PlanCreator.java
@@ -116,8 +116,8 @@ public class PlanCreator {
public ITestPlan createDerivedPlan(CtsBuildHelper build, Set<String> abis)
throws ConfigurationException {
checkFields(build);
- ITestPackageRepo pkgDefRepo = new TestPackageRepo(build.getTestCasesDir(),
- abis, mIncludeKnownFailures);
+ ITestPackageRepo pkgDefRepo =
+ new TestPackageRepo(build.getTestCasesDir(), mIncludeKnownFailures);
ITestPlan derivedPlan = new TestPlan(mPlanName, abis);
for (TestPackageResult pkg : mResult.getPackages()) {
Collection<TestIdentifier> filteredTests = pkg.getTestsWithStatus(mResultFilter);
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
index a16e1c4..ce48664 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
@@ -57,13 +57,13 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Queue;
import java.util.Set;
@@ -87,8 +87,6 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
public static final String PACKAGE_ABI_METRIC = "packageAbi";
public static final String PACKAGE_DIGEST_METRIC = "packageDigest";
- private ITestDevice mDevice;
-
@Option(name = PLAN_OPTION, description = "the test plan to run.",
importance = Importance.IF_UNSET)
private String mPlanName = null;
@@ -182,19 +180,34 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
"Collect dEQP logs from the device.")
private boolean mCollectDeqpLogs = false;
- private long mPrevRebootTime; // last reboot time
+ @Option(name = "min-pre-reboot-package-count", description =
+ "The minimum number of packages to require a pre test reboot")
+
+ private int mMinPreRebootPackageCount = 2;
+ private final int mShardAssignment;
+ private final int mTotalShards;
+ private ITestDevice mDevice = null;
+ private CtsBuildHelper mCtsBuild = null;
+ private IBuildInfo mBuildInfo = null;
+ // last reboot time
+ private long mPrevRebootTime;
+ // The list of packages to run. populated in {@code setupTestPackageList}
+ // This is a member variable so that run can be called more than once
+ // and the test run is resumed.
+ private List<TestPackage> mTestPackageList = new ArrayList<>();
+ // The index in the pacakge list of the last test to complete
+ private int mLastTestPackageIndex = 0;
/** data structure for a {@link IRemoteTest} and its known tests */
- class TestPackage {
+ static class TestPackage {
private final IRemoteTest mTestForPackage;
private final ITestPackageDef mPackageDef;
private final Collection<TestIdentifier> mKnownTests;
- TestPackage(ITestPackageDef packageDef, IRemoteTest testForPackage,
- Collection<TestIdentifier> knownTests) {
+ TestPackage(ITestPackageDef packageDef, IRemoteTest testForPackage) {
mPackageDef = packageDef;
mTestForPackage = testForPackage;
- mKnownTests = knownTests;
+ mKnownTests = packageDef.getTests();
}
IRemoteTest getTestForPackage() {
@@ -301,11 +314,28 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
}
}
- /** list of remaining tests to execute */
- private List<TestPackage> mRemainingTestPkgs = null;
+ /**
+ * Create a new {@link CtsTest} that will run the default list of {@link TestPackage}s.
+ */
+ public CtsTest() {
+ this(0 /*shardAssignment*/, 1 /*totalShards*/);
+ }
- private CtsBuildHelper mCtsBuild = null;
- private IBuildInfo mBuildInfo = null;
+ /**
+ * Create a new {@link CtsTest} that will run the given {@link List} of {@link TestPackage}s.
+ */
+ public CtsTest(int shardAssignment, int totalShards) {
+ if (shardAssignment < 0) {
+ throw new IllegalArgumentException(
+ "shardAssignment cannot be negative. found:" + shardAssignment);
+ }
+ if (totalShards < 1) {
+ throw new IllegalArgumentException(
+ "shardAssignment must be at least 1. found:" + totalShards);
+ }
+ this.mShardAssignment = shardAssignment;
+ this.mTotalShards = totalShards;
+ }
/**
* {@inheritDoc}
@@ -416,8 +446,6 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
* Set the CTS build container.
* <p/>
* Exposed so unit tests can mock the provided build.
- *
- * @param buildHelper
*/
void setBuildHelper(CtsBuildHelper buildHelper) {
mCtsBuild = buildHelper;
@@ -432,57 +460,62 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
throw new IllegalArgumentException("missing device");
}
- if (mRemainingTestPkgs == null) {
- checkFields();
- mRemainingTestPkgs = buildTestsToRun();
+ Set<String> abiSet = getAbis();
+ if (abiSet == null || abiSet.isEmpty()) {
+ throw new IllegalArgumentException("could not get device's ABIs");
}
+ Log.logAndDisplay(LogLevel.INFO, LOG_TAG, "ABIs: " + abiSet);
+
+ checkFields();
+ setupTestPackageList(abiSet);
if (mBugreport) {
- FailedTestBugreportGenerator bugListener = new FailedTestBugreportGenerator(listener,
- getDevice());
- listener = bugListener;
+ listener = new FailedTestBugreportGenerator(listener, getDevice());
}
if (mScreenshotOnFailures) {
- FailedTestScreenshotGenerator screenListener = new FailedTestScreenshotGenerator(
- listener, getDevice());
- listener = screenListener;
+ listener = new FailedTestScreenshotGenerator(listener, getDevice());
}
if (mLogcatOnFailures) {
- FailedTestLogcatGenerator logcatListener = new FailedTestLogcatGenerator(
- listener, getDevice(), mMaxLogcatBytes);
- listener = logcatListener;
+ listener = new FailedTestLogcatGenerator(listener, getDevice(), mMaxLogcatBytes);
}
- // Only run test packages on ABIs which this device supports.
- Set<String> abis = getAbis();
- if (abis == null || abis.isEmpty()) {
- throw new IllegalArgumentException("could not get device's ABIs");
+ // Setup the a map of Test id to ResultFilter
+ Map<String, ResultFilter> filterMap = new HashMap<>();
+ int totalTestCount = 0;
+ for (TestPackage testPackage : mTestPackageList) {
+ ResultFilter resultFilter = new ResultFilter(listener, testPackage);
+ totalTestCount += resultFilter.getKnownTestCount();
+ filterMap.put(testPackage.getPackageDef().getId(), resultFilter);
}
- List<TestPackage> packages = filterTestPackagesByAbi(mRemainingTestPkgs, abis);
// collect and install the prerequisiteApks first, to save time when multiple test
- // packages are using the same prerequisite apk (I'm looking at you, CtsTestStubs!)
- Collection<String> prerequisiteApks = getPrerequisiteApks(packages);
- Collection<String> uninstallPackages = getPrerequisitePackageNames(packages);
- List<ResultFilter> filters = new ArrayList<ResultFilter>(packages.size());
+ // packages are using the same prerequisite apk
+ Map<String, Set<String>> prerequisiteApks = getPrerequisiteApks(mTestPackageList, abiSet);
+ Collection<String> uninstallPackages = getPrerequisitePackageNames(mTestPackageList);
try {
- installPrerequisiteApks(prerequisiteApks);
-
// always collect the device info, even for resumed runs, since test will likely be
// running on a different device
collectDeviceInfo(getDevice(), mCtsBuild, listener);
- if (packages.size() > 1 && !mDisableReboot) {
- Log.i(LOG_TAG, "Initial reboot for multiple packages");
- rebootDevice();
- }
- mPrevRebootTime = System.currentTimeMillis();
+ preRebootIfNecessary(mTestPackageList);
- while (!packages.isEmpty()) {
- TestPackage knownTests = packages.get(0);
- ResultFilter filter = new ResultFilter(listener, knownTests);
- filters.add(filter);
+ mPrevRebootTime = System.currentTimeMillis();
+ int remainingPackageCount = mTestPackageList.size();
+ Log.logAndDisplay(LogLevel.INFO, LOG_TAG,
+ String.format("Start test run of %,d packages, containing %,d tests",
+ remainingPackageCount, totalTestCount));
+ IAbi currentAbi = null;
+
+ for (int i = mLastTestPackageIndex; i < mTestPackageList.size(); i++) {
+ TestPackage testPackage = mTestPackageList.get(i);
+
+ if (currentAbi == null ||
+ !currentAbi.getName().equals(testPackage.getAbi().getName())) {
+ currentAbi = testPackage.getAbi();
+ installPrerequisiteApks(
+ prerequisiteApks.get(currentAbi.getName()), currentAbi);
+ }
- IRemoteTest test = knownTests.getTestForPackage();
+ IRemoteTest test = testPackage.getTestForPackage();
if (test instanceof IBuildReceiver) {
((IBuildReceiver) test).setBuild(mBuildInfo);
}
@@ -493,15 +526,15 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
((DeqpTestRunner)test).setCollectLogs(mCollectDeqpLogs);
}
- forwardPackageDetails(knownTests.getPackageDef(), listener);
- test.run(filter);
- packages.remove(0);
- if (packages.size() > 0) {
- rebootIfNecessary(knownTests, packages.get(0));
- // remove artifacts like status bar from the previous test.
- // But this cannot dismiss dialog popped-up.
+ forwardPackageDetails(testPackage.getPackageDef(), listener);
+ test.run(filterMap.get(testPackage.getPackageDef().getId()));
+ if (i < mTestPackageList.size() - 1) {
+ TestPackage nextPackage = mTestPackageList.get(i + 1);
+ rebootIfNecessary(testPackage, nextPackage);
changeToHomeScreen();
}
+ // Track of the last complete test package index for resume
+ mLastTestPackageIndex = i;
}
if (mScreenshot) {
@@ -522,26 +555,52 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
CLog.e(e);
throw e;
} finally {
- for (ResultFilter filter : filters) {
+ for (ResultFilter filter : filterMap.values()) {
filter.reportUnexecutedTests();
}
}
}
/**
- * @param packages The package list to filter
- * @param abis The ABIs to test on
- * @return A list of {@link TestPackage} which test one of the given ABIs
+ * @param allTestPackageDefList The package list to filter
+ * @param deviceAbiSet The ABIs supported by the device being tested
+ * @return A {@link List} of {@link ITestPackageDef}s that should be tested
*/
- private static List<TestPackage> filterTestPackagesByAbi(
- List<TestPackage> packages, Set<String> abis){
- List<TestPackage> testPackages = new LinkedList<>();
- for (TestPackage test : packages) {
- if (abis.contains(test.getAbi().getName())) {
- testPackages.add(test);
+ private static List<ITestPackageDef> filterByAbi(
+ List<ITestPackageDef> allTestPackageDefList, Set<String> deviceAbiSet) {
+ List<ITestPackageDef> filteredTestPackageDefList = new LinkedList<>();
+ for (ITestPackageDef testPackageDef : allTestPackageDefList) {
+ if (deviceAbiSet.contains(testPackageDef.getAbi().getName())) {
+ // We only need test packages that are not empty and of matching ABIs
+ filteredTestPackageDefList.add(testPackageDef);
}
}
- return testPackages;
+ return filteredTestPackageDefList;
+ }
+
+ /** Reboot then the device iff the list of packages exceeds the minimum */
+ private void preRebootIfNecessary(List<TestPackage> testPackageList)
+ throws DeviceNotAvailableException {
+ if (mDisableReboot) {
+ return;
+ }
+
+ Set<String> packageNameSet = new HashSet<>();
+ for (TestPackage testPackage : testPackageList) {
+ // Parse the package name
+ packageNameSet.add(AbiUtils.parseTestName(testPackage.getPackageDef().getId()));
+ }
+ if (packageNameSet.size() < mMinPreRebootPackageCount) {
+ // There is actually only one unique package name. No need to reboot.
+ return;
+ }
+
+ // Reboot is needed
+ Log.logAndDisplay(LogLevel.INFO, LOG_TAG,
+ String.format("Pre-test reboot (%,d packages). Use --disable-reboot to skip",
+ packageNameSet.size()));
+
+ rebootDevice();
}
private void rebootIfNecessary(TestPackage testFinished, TestPackage testToRun)
@@ -598,6 +657,10 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
}
}
+ /**
+ * Remove artifacts like status bar from the previous test.
+ * But this cannot dismiss dialog popped-up.
+ */
private void changeToHomeScreen() throws DeviceNotAvailableException {
final String homeCmd = "input keyevent 3";
@@ -608,84 +671,94 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
//ignore
}
}
+
/**
- * Build the list of test packages to run
+ * Set {@code mTestPackageList} to the list of test packages to run filtered by ABI.
*/
- private List<TestPackage> buildTestsToRun() {
- List<TestPackage> testPkgList = new LinkedList<TestPackage>();
+ private void setupTestPackageList(Set<String> abis) throws DeviceNotAvailableException {
+ if (!mTestPackageList.isEmpty()) {
+ Log.logAndDisplay(LogLevel.INFO, LOG_TAG, "Resume tests using existing package list");
+ return;
+ }
try {
+ // Collect ALL tests
ITestPackageRepo testRepo = createTestCaseRepo();
- Collection<ITestPackageDef> testPkgDefs = getTestPackagesToRun(testRepo);
- for (ITestPackageDef testPkgDef : testPkgDefs) {
- addTestPackage(testPkgList, testPkgDef);
+ List<ITestPackageDef> testPkgDefs = new ArrayList<>(getAvailableTestPackages(testRepo));
+ testPkgDefs = filterByAbi(testPkgDefs, abis);
+ // Note: run() relies on the fact that the list is reliably sorted for sharding purposes
+ Collections.sort(testPkgDefs);
+ // Create test package list.
+ List<TestPackage> testPackageList = new ArrayList<>();
+ for (ITestPackageDef testPackageDef : testPkgDefs) {
+ // Note: createTest filters the test list inside of testPackageDef by exclusion list
+ IRemoteTest testForPackage = testPackageDef.createTest(mCtsBuild.getTestCasesDir());
+ if (testPackageDef.getTests().size() > 0) {
+ testPackageList.add(new TestPackage(testPackageDef, testForPackage));
+ }
}
- if (testPkgList.isEmpty()) {
- Log.logAndDisplay(LogLevel.WARN, LOG_TAG, "No tests to run");
+
+ // Filter by shard
+ int numTestPackages = testPackageList.size();
+ int totalShards = Math.min(mTotalShards, numTestPackages);
+
+ List<TestPackage> shardTestPackageList = new ArrayList<>();
+ for (int i = mShardAssignment; i < numTestPackages; i += totalShards) {
+ shardTestPackageList.add(testPackageList.get(i));
}
+ mTestPackageList.addAll(shardTestPackageList);
} catch (FileNotFoundException e) {
- throw new IllegalArgumentException("failed to find CTS plan file", e);
+ throw new IllegalArgumentException("failed to find XTS plan file", e);
} catch (ParseException e) {
- throw new IllegalArgumentException("failed to parse CTS plan file", e);
+ throw new IllegalArgumentException("failed to parse XTS plan file", e);
} catch (ConfigurationException e) {
throw new IllegalArgumentException("failed to process arguments", e);
}
- return testPkgList;
- }
-
- /**
- * Adds a test package to the list of packages to test
- *
- * @param testList
- * @param testPkgDef
- */
- private void addTestPackage(List<TestPackage> testList, ITestPackageDef testPkgDef) {
- IRemoteTest testForPackage = testPkgDef.createTest(mCtsBuild.getTestCasesDir());
- if (testForPackage != null) {
- Collection<TestIdentifier> knownTests = testPkgDef.getTests();
- testList.add(new TestPackage(testPkgDef, testForPackage, knownTests));
- }
}
/**
- * Return the list of test package defs to run
+ * Return the {@link Set} of {@link ITestPackageDef}s to run unfiltered by ABI
*
- * @return the list of test package defs to run
+ * @return the {@link Set} of {@link ITestPackageDef}s to run
* @throws ParseException
* @throws FileNotFoundException
* @throws ConfigurationException
*/
- private Collection<ITestPackageDef> getTestPackagesToRun(ITestPackageRepo testRepo)
- throws ParseException, FileNotFoundException, ConfigurationException {
+ private Set<ITestPackageDef> getAvailableTestPackages(ITestPackageRepo testRepo)
+ throws ParseException, FileNotFoundException, ConfigurationException {
// use LinkedHashSet to have predictable iteration order
- Set<ITestPackageDef> testPkgDefs = new LinkedHashSet<ITestPackageDef>();
+ Set<ITestPackageDef> testPkgDefs = new LinkedHashSet<>();
if (mPlanName != null) {
Log.i(LOG_TAG, String.format("Executing CTS test plan %s", mPlanName));
File ctsPlanFile = mCtsBuild.getTestPlanFile(mPlanName);
ITestPlan plan = createPlan(mPlanName);
plan.parse(createXmlStream(ctsPlanFile));
- for (String id : plan.getTestIds()) {
- if (!mExcludedPackageNames.contains(AbiUtils.parseId(id)[1])) {
- ITestPackageDef testPackageDef = testRepo.getTestPackage(id);
- if (testPackageDef != null) {
- testPackageDef.setTestFilter(plan.getTestFilter(id));
- testPkgDefs.add(testPackageDef);
- } else {
- CLog.e("Could not find test package id %s referenced in plan %s", id,
- mPlanName);
- }
+
+ for (String testId : plan.getTestIds()) {
+ if (mExcludedPackageNames.contains(AbiUtils.parseTestName(testId))) {
+ continue;
}
+ ITestPackageDef testPackageDef = testRepo.getTestPackage(testId);
+ if (testPackageDef == null) {
+ CLog.e("Could not find test id %s referenced in plan %s", testId, mPlanName);
+ continue;
+ }
+
+ testPackageDef.setTestFilter(plan.getTestFilter(testId));
+ testPkgDefs.add(testPackageDef);
}
} else if (mPackageNames.size() > 0){
- Log.i(LOG_TAG, String.format("Executing CTS test packages %s", mPackageNames));
+ Log.i(LOG_TAG, String.format("Executing XTS test packages %s", mPackageNames));
+
+ Map<String, List<ITestPackageDef>> testPackageDefMap =
+ testRepo.getTestPackageDefsByName();
+
for (String name : mPackageNames) {
- Set<ITestPackageDef> testPackages = testRepo.getTestPackages(name);
- if (!testPackages.isEmpty()) {
- testPkgDefs.addAll(testPackages);
- } else {
+ if (!testPackageDefMap.containsKey(name)) {
throw new IllegalArgumentException(String.format(
"Could not find test package %s. " +
- "Use 'list packages' to see available packages." , name));
+ "Use 'list packages' to see available packages.", name));
}
+ testPkgDefs.addAll(testPackageDefMap.get(name));
}
} else if (mClassName != null) {
Log.i(LOG_TAG, String.format("Executing CTS test class %s", mClassName));
@@ -708,14 +781,18 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
PlanCreator planCreator = new PlanCreator(uniquePlanName, mContinueSessionId,
CtsTestStatus.NOT_EXECUTED);
ITestPlan plan = createPlan(planCreator);
- for (String id : plan.getTestIds()) {
- if (!mExcludedPackageNames.contains(AbiUtils.parseId(id)[1])) {
- ITestPackageDef testPackageDef = testRepo.getTestPackage(id);
- if (testPackageDef != null) {
- testPackageDef.setTestFilter(plan.getTestFilter(id));
- testPkgDefs.add(testPackageDef);
- }
+ for (String testId : plan.getTestIds()) {
+ if (mExcludedPackageNames.contains(AbiUtils.parseTestName(testId))) {
+ continue;
+ }
+ ITestPackageDef testPackageDef = testRepo.getTestPackage(testId);
+ if (testPackageDef == null) {
+ CLog.e("Could not find test id %s referenced in plan %s", testId, mPlanName);
+ continue;
}
+
+ testPackageDef.setTestFilter(plan.getTestFilter(testId));
+ testPkgDefs.add(testPackageDef);
}
} else {
// should never get here - was checkFields() not called?
@@ -726,10 +803,11 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
/**
* Return the list of unique prerequisite Android package names
- * @param testPackages
+ *
+ * @param testPackages The {@link TestPackage}s that contain prerequisites
*/
private Collection<String> getPrerequisitePackageNames(List<TestPackage> testPackages) {
- Set<String> pkgNames = new HashSet<String>();
+ Set<String> pkgNames = new HashSet<>();
for (TestPackage testPkg : testPackages) {
String pkgName = testPkg.mPackageDef.getTargetPackageName();
if (pkgName != null) {
@@ -740,12 +818,12 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
}
/**
- * @return a {@link Set} containing {@ITestPackageDef}s pertaining to the given
+ * @return a {@link Set} containing {@link ITestPackageDef}s pertaining to the given
* {@code className} and {@code methodName}.
*/
private static Set<ITestPackageDef> buildTestPackageDefSet(
ITestPackageRepo testRepo, String className, String methodName) {
- Set<ITestPackageDef> testPkgDefs = new LinkedHashSet<ITestPackageDef>();
+ Set<ITestPackageDef> testPkgDefs = new LinkedHashSet<>();
// try to find packages to run from class name
List<String> packageIds = testRepo.findPackageIdsForTest(className);
if (packageIds.isEmpty()) {
@@ -763,18 +841,33 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
}
/**
- * Return the list of unique prerequisite apks to install
- * @param testPackages
+ * Return the list (by abi) of unique prerequisite apks to install
+ *
+ * @param testPackages The {@link List} of {@link TestPackage} that contain prerequisite APKs
*/
- private Collection<String> getPrerequisiteApks(List<TestPackage> testPackages) {
- Set<String> apkNames = new HashSet<String>();
+ private Map<String, Set<String>> getPrerequisiteApks(
+ List<TestPackage> testPackages, Set<String> abiSet) {
+ Map<String, Set<String>> abiToApkMap = new HashMap<>();
for (TestPackage testPkg : testPackages) {
+ if (testPkg.getKnownTests().size() == 0) {
+ // No tests, no point in installing pre-reqs
+ continue;
+ }
String apkName = testPkg.mPackageDef.getTargetApkName();
- if (apkName != null) {
- apkNames.add(apkName);
+ if (apkName == null) {
+ continue;
}
+ String abiName = testPkg.getAbi().getName();
+ if (!abiSet.contains(abiName)) {
+ continue;
+ }
+
+ if (!abiToApkMap.containsKey(abiName)) {
+ abiToApkMap.put(abiName, new HashSet<String>());
+ }
+ abiToApkMap.get(abiName).add(apkName);
}
- return apkNames;
+ return abiToApkMap;
}
/**
@@ -783,31 +876,22 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
*
* Install the collection of test apk file names
*
- * @param prerequisiteApks
+ * @param prerequisiteApks The APKs that must be installed
* @throws DeviceNotAvailableException
*/
- private void installPrerequisiteApks(Collection<String> prerequisiteApks)
+ private void installPrerequisiteApks(Collection<String> prerequisiteApks, IAbi abi)
throws DeviceNotAvailableException {
+ if (prerequisiteApks == null) {
+ return;
+ }
Log.logAndDisplay(LogLevel.INFO, LOG_TAG, "Installing prerequisites");
- Set<String> supportedAbiSet = getAbis();
for (String apkName : prerequisiteApks) {
try {
File apkFile = mCtsBuild.getTestApp(apkName);
- // As a workaround for multi arch support, try to install the APK
- // for all device supported ABIs. This will generate warning messages
- // until the above FIXME is resolved.
- int installFailCount = 0;
- for (String abi : supportedAbiSet) {
- String[] options = {AbiUtils.createAbiFlag(abi)};
- String errorCode = getDevice().installPackage(apkFile, true, options);
- if (errorCode != null) {
- installFailCount++;
- CLog.w("Failed to install %s. Reason: %s", apkName, errorCode);
- }
-
- }
- if (installFailCount >= supportedAbiSet.size()) {
- CLog.e("Failed to install %s. See warning messages.", apkName);
+ String[] options = {AbiUtils.createAbiFlag(abi.getName())};
+ String errorCode = getDevice().installPackage(apkFile, true, options);
+ if (errorCode != null) {
+ CLog.e("Failed to install %s. Reason: %s", apkName, errorCode);
}
} catch (FileNotFoundException e) {
CLog.e("Could not find test apk %s", apkName);
@@ -818,7 +902,7 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
/**
* Uninstalls the collection of android package names from device.
*
- * @param uninstallPackages
+ * @param uninstallPackages The packages that must be uninstalled
*/
private void uninstallPrequisiteApks(Collection<String> uninstallPackages)
throws DeviceNotAvailableException {
@@ -836,29 +920,17 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
return null;
}
checkFields();
- List<TestPackage> allTests = buildTestsToRun();
- if (allTests == null || allTests.size() <= 1) {
- Log.w(LOG_TAG, "no tests to shard!");
- return null;
+ List<IRemoteTest> shardQueue = new LinkedList<>();
+ for (int shardAssignment = 0; shardAssignment < mShards; shardAssignment++) {
+ CtsTest ctsTest = new CtsTest(shardAssignment, mShards /* totalShards */);
+ OptionCopier.copyOptionsNoThrow(this, ctsTest);
+ // Set the shard count because the copy option on the previous line copies
+ // over the mShard value
+ ctsTest.mShards = 0;
+ shardQueue.add(ctsTest);
}
- // treat shardQueue as a circular queue, to sequentially distribute tests among shards
- Queue<IRemoteTest> shardQueue = new LinkedList<IRemoteTest>();
- // don't create more shards than the number of tests we have!
- for (int i = 0; i < mShards && i < allTests.size(); i++) {
- CtsTest shard = new CtsTest();
- OptionCopier.copyOptionsNoThrow(this, shard);
- shard.mShards = 0;
- shard.mRemainingTestPkgs = new LinkedList<TestPackage>();
- shardQueue.add(shard);
- }
- while (!allTests.isEmpty()) {
- TestPackage testPair = allTests.remove(0);
- CtsTest shard = (CtsTest)shardQueue.poll();
- shard.mRemainingTestPkgs.add(testPair);
- shardQueue.add(shard);
- }
return shardQueue;
}
@@ -884,8 +956,7 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
* Exposed for unit testing
*/
ITestPackageRepo createTestCaseRepo() {
- return new TestPackageRepo(mCtsBuild.getTestCasesDir(), AbiUtils.getAbisSupportedByCts(),
- mIncludeKnownFailures);
+ return new TestPackageRepo(mCtsBuild.getTestCasesDir(), mIncludeKnownFailures);
}
/**
@@ -906,13 +977,12 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
*/
Set<String> getAbis() throws DeviceNotAvailableException {
String bitness = (mForceAbi == null) ? "" : mForceAbi;
- Set<String> abis = new HashSet<String>();
+ Set<String> abis = new HashSet<>();
for (String abi : AbiFormatter.getSupportedAbis(mDevice, bitness)) {
if (AbiUtils.isAbiSupportedByCts(abi)) {
abis.add(abi);
}
}
- Log.logAndDisplay(LogLevel.INFO, LOG_TAG, "ABIs: " + abis);
return abis;
}
@@ -964,7 +1034,7 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
* @return <code>true</code> if one and only one of <var>args</code> is <code>true</code>.
* Otherwise return <code>false</code>.
*/
- private boolean xor(boolean... args) {
+ private static boolean xor(boolean... args) {
boolean currentVal = args[0];
for (int i=1; i < args.length; i++) {
if (currentVal && args[i]) {
@@ -978,10 +1048,10 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
/**
* Forward the digest and package name to the listener as a metric
*
- * @param listener
+ * @param listener Handles test results
*/
- private void forwardPackageDetails(ITestPackageDef def, ITestInvocationListener listener) {
- Map<String, String> metrics = new HashMap<String, String>(3);
+ private static void forwardPackageDetails(ITestPackageDef def, ITestInvocationListener listener) {
+ Map<String, String> metrics = new HashMap<>(3);
metrics.put(PACKAGE_NAME_METRIC, def.getName());
metrics.put(PACKAGE_ABI_METRIC, def.getAbi().getName());
metrics.put(PACKAGE_DIGEST_METRIC, def.getDigest());
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPackageDef.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPackageDef.java
index ea01535..8a5c822 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPackageDef.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPackageDef.java
@@ -28,7 +28,7 @@ import java.util.Collection;
* <p/>
* Knows how to translate this info into a runnable {@link IRemoteTest}.
*/
-public interface ITestPackageDef {
+public interface ITestPackageDef extends Comparable<ITestPackageDef> {
/**
* Get the id of the test package.
@@ -37,12 +37,6 @@ public interface ITestPackageDef {
public String getId();
/**
- * Get the appPackageName of the test package.
- * @return the {@link String} appPackageName
- */
- public String getAppPackageName();
-
- /**
* Creates a runnable {@link IRemoteTest} from info stored in this definition.
*
* @param testCaseDir {@link File} representing directory of test case data
@@ -52,22 +46,6 @@ public interface ITestPackageDef {
public IRemoteTest createTest(File testCaseDir);
/**
- * Determine if given test is defined in this package.
- *
- * @param testDef the {@link TestIdentifier}
- * @return <code>true</code> if test is defined
- */
- public boolean isKnownTest(TestIdentifier testDef);
-
- /**
- * Determine if given test class is defined in this package.
- *
- * @param testClassName the fully qualified test class name
- * @return <code>true</code> if test class is defined
- */
- public boolean isKnownTestClass(String testClassName);
-
- /**
* Get the collection of tests in this test package.
*/
public Collection<TestIdentifier> getTests();
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPackageRepo.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPackageRepo.java
index d1d4111..234f437 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPackageRepo.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPackageRepo.java
@@ -19,7 +19,7 @@ package com.android.cts.tradefed.testtype;
import com.android.cts.util.AbiUtils;
import java.util.List;
-import java.util.Set;
+import java.util.Map;
/**
* Interface for accessing tests from the CTS repository.
@@ -36,29 +36,25 @@ public interface ITestPackageRepo {
public ITestPackageDef getTestPackage(String id);
/**
- * Get a {@link Set} of {@link TestPackageDef} given a name
- *
- * @param name the string package name
- * @return a {@link Set} of {@link TestPackageDef}
+ * @return a sorted {@link List} of all package ids found in repo.
*/
- public Set<ITestPackageDef> getTestPackages(String name);
+ public List<String> getPackageIds();
/**
- * Attempt to find the package ids for a given test class name
- *
- * @param testClassName the test class name
- * @return a {@link List} of package ids.
+ * @return a sorted {@link List} of test package names
*/
- public List<String> findPackageIdsForTest(String testClassName);
+ public List<String> getPackageNames();
/**
- * @return a sorted {@link List} of all package ids found in repo.
+ * @return A {@link Map} of test package name to a {@link List} of {@link ITestPackageDef}s.
*/
- public List<String> getPackageIds();
+ public Map<String, List<ITestPackageDef>> getTestPackageDefsByName();
/**
- * @return a sorted {@link List} of all package names found in repo.
+ * Attempt to find the package ids for a given test class name
+ *
+ * @param testClassName the test class name
+ * @return a {@link List} of package ids.
*/
- public List<String> getPackageNames();
-
+ public List<String> findPackageIdsForTest(String testClassName);
}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPlan.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPlan.java
index 21b2d0a..2d5f4a7 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPlan.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ITestPlan.java
@@ -23,6 +23,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collection;
+import java.util.List;
/**
* Interface for accessing test plan data.
@@ -42,6 +43,11 @@ public interface ITestPlan {
public Collection<String> getTestIds();
/**
+ * Gets a sorted {@link List} of test names contained in this plan.
+ */
+ public List<String> getTestNames();
+
+ /**
* Gets the {@link TestFilter} that should be used to filter tests from given package.
*/
public TestFilter getTestFilter(String id);
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ResultFilter.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ResultFilter.java
index 7931660..f4f2f5d 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ResultFilter.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ResultFilter.java
@@ -24,9 +24,7 @@ import com.android.tradefed.result.ResultForwarder;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -135,4 +133,9 @@ class ResultFilter extends ResultForwarder {
}
super.testRunEnded(0, new HashMap<String, String>());
}
+
+ /** @return the number of known tests */
+ public int getKnownTestCount() {
+ return mKnownTests.size();
+ }
}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java
index 2eccb50..9ef6257 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java
@@ -112,11 +112,7 @@ class TestPackageDef implements ITestPackageDef {
mAppPackageName = appPackageName;
}
- /**
- * {@inheritDoc}
- */
- @Override
- public String getAppPackageName() {
+ String getAppPackageName() {
return mAppPackageName;
}
@@ -124,10 +120,6 @@ class TestPackageDef implements ITestPackageDef {
mRunTimeArgs = runTimeArgs;
}
- String getRunTimeArgs() {
- return mRunTimeArgs;
- }
-
void setAppNameSpace(String appNameSpace) {
mAppNameSpace = appNameSpace;
}
@@ -374,19 +366,7 @@ class TestPackageDef implements ITestPackageDef {
return mTestFilter.filter(mTests);
}
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isKnownTest(TestIdentifier testDef) {
- return mTests.contains(testDef);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isKnownTestClass(String className) {
+ boolean isKnownTestClass(String className) {
return mTestClasses.contains(className);
}
@@ -471,10 +451,15 @@ class TestPackageDef implements ITestPackageDef {
* @return The hex encoded string.
*/
private String toHexString(byte[] arr) {
- StringBuffer buf = new StringBuffer(arr.length * 2);
+ StringBuilder buf = new StringBuilder(arr.length * 2);
for (byte b : arr) {
buf.append(String.format("%02x", b & 0xFF));
}
return buf.toString();
}
+
+ @Override
+ public int compareTo(ITestPackageDef testPackageDef) {
+ return getId().compareTo(testPackageDef.getId());
+ }
}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageRepo.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageRepo.java
index c1f168d..aea6613 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageRepo.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageRepo.java
@@ -40,31 +40,21 @@ public class TestPackageRepo implements ITestPackageRepo {
private static final String LOG_TAG = "TestCaseRepo";
- private final File mTestCaseDir;
-
/** mapping of ABI to a mapping of appPackageName to test definition */
private final Map<String, Map<String, TestPackageDef>> mTestMap;
- /** set of ABIs */
- private final Set<String> mAbis;
private final boolean mIncludeKnownFailures;
/**
* Creates a {@link TestPackageRepo}, initialized from provided repo files
*
* @param testCaseDir directory containing all test case definition xml and build files
- * @param abis Holds the ABIs which the test must be run against. This must be a subset of the
* ABIs supported by the device under test.
* @param includeKnownFailures Whether to run tests which are known to fail.
*/
- public TestPackageRepo(File testCaseDir, Set<String> abis, boolean includeKnownFailures) {
- mTestCaseDir = testCaseDir;
- mTestMap = new HashMap<String, Map<String, TestPackageDef>>();
- mAbis = abis;
- for (String abi : abis) {
- mTestMap.put(abi, new HashMap<String, TestPackageDef>());
- }
+ public TestPackageRepo(File testCaseDir, boolean includeKnownFailures) {
+ mTestMap = new HashMap<>();
mIncludeKnownFailures = includeKnownFailures;
- parse(mTestCaseDir);
+ parse(testCaseDir);
}
/**
@@ -78,25 +68,22 @@ public class TestPackageRepo implements ITestPackageRepo {
}
private void parseTestFromXml(File xmlFile) {
- TestPackageXmlParser parser = new TestPackageXmlParser(mAbis, mIncludeKnownFailures);
+ TestPackageXmlParser parser = new TestPackageXmlParser(mIncludeKnownFailures);
try {
parser.parse(createStreamFromFile(xmlFile));
Set<TestPackageDef> defs = parser.getTestPackageDefs();
- if (!defs.isEmpty()) {
- for (TestPackageDef def : defs) {
- String name = def.getAppPackageName();
- String abi = def.getAbi().getName();
- if (def.getTests().size() > 0) {
- mTestMap.get(abi).put(name, def);
- } else {
- Log.d(LOG_TAG, String.format("No tests in %s for %s, skipping",
- name, abi));
- }
- }
- } else {
+ if (defs.isEmpty()) {
Log.w(LOG_TAG, String.format("Could not find test package info in xml file %s",
xmlFile.getAbsolutePath()));
}
+ for (TestPackageDef def : defs) {
+ String name = def.getAppPackageName();
+ String abi = def.getAbi().getName();
+ if (!mTestMap.containsKey(abi)) {
+ mTestMap.put(abi, new HashMap<String, TestPackageDef>());
+ }
+ mTestMap.get(abi).put(name, def);
+ }
} catch (FileNotFoundException e) {
Log.e(LOG_TAG, String.format("Could not find test case xml file %s",
xmlFile.getAbsolutePath()));
@@ -113,7 +100,7 @@ public class TestPackageRepo implements ITestPackageRepo {
* <p/>
* Exposed for unit testing
*
- * @param xmlFile
+ * @param xmlFile The file containing the xml description of the package
* @return stream to read data
*
*/
@@ -150,61 +137,71 @@ public class TestPackageRepo implements ITestPackageRepo {
* {@inheritDoc}
*/
@Override
- public Set<ITestPackageDef> getTestPackages(String appPackageName) {
- Set<ITestPackageDef> defs = new HashSet<ITestPackageDef>();
- for (String abi : mAbis) {
- if (mTestMap.get(abi).containsKey(appPackageName)) {
- defs.add(mTestMap.get(abi).get(appPackageName));
+ public List<String> getPackageIds() {
+ Set<String> ids = new HashSet<>();
+ for (String abi : mTestMap.keySet()) {
+ Map<String, TestPackageDef> testNameMap = mTestMap.get(abi);
+ for (TestPackageDef testPackageDef : testNameMap.values()) {
+ ids.add(testPackageDef.getId());
}
}
- return defs;
+ List<String> idList = new ArrayList<>(ids);
+ Collections.sort(idList);
+ return idList;
}
/**
* {@inheritDoc}
*/
@Override
- public List<String> findPackageIdsForTest(String testClassName) {
- Set<String> ids = new HashSet<String>();
+ public List<String> getPackageNames() {
+ Set<String> nameSet = new HashSet<String>();
for (String abi : mTestMap.keySet()) {
- for (String name : mTestMap.get(abi).keySet()) {
- if (mTestMap.get(abi).get(name).isKnownTestClass(testClassName)) {
- ids.add(AbiUtils.createId(abi, name));
- }
+ Map<String, TestPackageDef> testNameMap = mTestMap.get(abi);
+ for (TestPackageDef testPackageDef : testNameMap.values()) {
+ nameSet.add(AbiUtils.parseTestName(testPackageDef.getId()));
}
}
- List<String> idList = new ArrayList<String>(ids);
- Collections.sort(idList);
- return idList;
+ List<String> nameList = new ArrayList<>(nameSet);
+ Collections.sort(nameList);
+ return nameList;
}
/**
* {@inheritDoc}
*/
@Override
- public List<String> getPackageIds() {
- Set<String> ids = new HashSet<String>();
- for (String abi : mAbis) {
- for (String name : mTestMap.get(abi).keySet()) {
- ids.add(AbiUtils.createId(abi, name));
+ public Map<String, List<ITestPackageDef>> getTestPackageDefsByName() {
+ Map<String, List<ITestPackageDef>> packageDefMap =
+ new HashMap<String, List<ITestPackageDef>>();
+
+ for (String abi : mTestMap.keySet()) {
+ Map<String, TestPackageDef> testNameMap = mTestMap.get(abi);
+ for (String packageName : testNameMap.keySet()) {
+ if (!packageDefMap.containsKey(packageName)) {
+ packageDefMap.put(packageName, new ArrayList<ITestPackageDef>());
+ }
+ packageDefMap.get(packageName).add(testNameMap.get(packageName));
}
}
- List<String> idList = new ArrayList<String>(ids);
- Collections.sort(idList);
- return idList;
+ return packageDefMap;
}
/**
* {@inheritDoc}
*/
@Override
- public List<String> getPackageNames() {
- Set<String> names = new HashSet<String>();
- for (String abi : mAbis) {
- names.addAll(mTestMap.get(abi).keySet());
+ public List<String> findPackageIdsForTest(String testClassName) {
+ Set<String> ids = new HashSet<String>();
+ for (String abi : mTestMap.keySet()) {
+ for (String name : mTestMap.get(abi).keySet()) {
+ if (mTestMap.get(abi).get(name).isKnownTestClass(testClassName)) {
+ ids.add(AbiUtils.createId(abi, name));
+ }
+ }
}
- List<String> packageNames = new ArrayList<String>(names);
- Collections.sort(packageNames);
- return packageNames;
+ List<String> idList = new ArrayList<String>(ids);
+ Collections.sort(idList);
+ return idList;
}
}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageXmlParser.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageXmlParser.java
index 8f4f1b0..baceb8b 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageXmlParser.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageXmlParser.java
@@ -40,18 +40,14 @@ public class TestPackageXmlParser extends AbstractXmlParser {
private static final String LOG_TAG = "TestPackageXmlParser";
- private final Set<String> mAbis;
private final boolean mIncludeKnownFailures;
private Map<String, TestPackageDef> mPackageDefs = new HashMap<String, TestPackageDef>();
/**
- * @param abis Holds the ABIs which the test must be run against. This must be a subset of the
- * ABIs supported by the device under test.
* @param includeKnownFailures Whether to run tests which are known to fail.
*/
- public TestPackageXmlParser(Set<String> abis, boolean includeKnownFailures) {
- mAbis = abis;
+ public TestPackageXmlParser(boolean includeKnownFailures) {
mIncludeKnownFailures = includeKnownFailures;
}
@@ -88,7 +84,7 @@ public class TestPackageXmlParser extends AbstractXmlParser {
final String runTimeArgs = attributes.getValue("runtimeArgs");
final String testType = getTestType(attributes);
- for (String abiName : mAbis) {
+ for (String abiName : AbiUtils.getAbisSupportedByCts()) {
Abi abi = new Abi(abiName, AbiUtils.getBitness(abiName));
TestPackageDef packageDef = new TestPackageDef();
packageDef.setAppPackageName(appPackageName);
@@ -154,13 +150,11 @@ public class TestPackageXmlParser extends AbstractXmlParser {
Set<String> abis = new HashSet<String>();
if (abiList == null) {
// If no specification, add all supported abis
- abis.addAll(mAbis);
+ abis.addAll(AbiUtils.getAbisSupportedByCts());
} else {
- for (String abi : abiList.split(", ")) {
- if (mAbis.contains(abi)) {
- // Else only add the abi which are supported
- abis.add(abi);
- }
+ for (String abi : abiList.split(",")) {
+ // Else only add the abi which are supported
+ abis.add(abi.trim());
}
}
for (String abi : abis) {
@@ -206,9 +200,9 @@ public class TestPackageXmlParser extends AbstractXmlParser {
}
/**
- * @returns the set of {@link TestPackageDef} containing data parsed from xml
+ * @return the set of {@link TestPackageDef} containing data parsed from xml
*/
public Set<TestPackageDef> getTestPackageDefs() {
- return new HashSet<TestPackageDef>(mPackageDefs.values());
+ return new HashSet<>(mPackageDefs.values());
}
}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPlan.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPlan.java
index 8737db6..2419784 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPlan.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPlan.java
@@ -35,6 +35,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.TreeSet;
/**
* Implementation of {@link TestPlan}.
@@ -150,6 +151,18 @@ public class TestPlan extends AbstractXmlParser implements ITestPlan {
* {@inheritDoc}
*/
@Override
+ public List<String> getTestNames() {
+ TreeSet<String> testNameSet = new TreeSet<>();
+ for (String id : mIdFilterMap.keySet()) {
+ testNameSet.add(AbiUtils.parseTestName(id));
+ }
+ return new ArrayList<>(testNameSet);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public TestFilter getTestFilter(String id) {
return mIdFilterMap.get(id);
}
diff --git a/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/CtsTestTest.java b/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/CtsTestTest.java
index 9915309..30e2ba8 100644
--- a/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/CtsTestTest.java
+++ b/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/CtsTestTest.java
@@ -35,8 +35,10 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
/**
@@ -47,11 +49,16 @@ public class CtsTestTest extends TestCase {
private static final String PLAN_NAME = "CTS";
private static final String PACKAGE_NAME = "test-name";
private static final String ID = AbiUtils.createId(UnitTests.ABI.getName(), PACKAGE_NAME);
+ private static final TestIdentifier TEST_IDENTIFIER =
+ new TestIdentifier("CLASS_NAME", "TEST_NAME");
private static final List<String> NAMES = new ArrayList<>();
private static final List<String> IDS = new ArrayList<>();
+ private static final List<TestIdentifier> TEST_IDENTIFIER_LIST = new ArrayList<>();
+
static {
NAMES.add(PACKAGE_NAME);
IDS.add(ID);
+ TEST_IDENTIFIER_LIST.add(TEST_IDENTIFIER);
}
/** the test fixture under test, with all external dependencies mocked out */
@@ -76,7 +83,7 @@ public class CtsTestTest extends TestCase {
mMockDevice = EasyMock.createMock(ITestDevice.class);
mMockListener = EasyMock.createNiceMock(ITestInvocationListener.class);
mStubBuildHelper = new StubCtsBuildHelper();
- mMockPackageDefs = new HashSet<ITestPackageDef>();
+ mMockPackageDefs = new HashSet<>();
mMockPackageDef = EasyMock.createMock(ITestPackageDef.class);
mMockPackageDefs.add(mMockPackageDef);
EasyMock.expect(mMockPackageDef.getTargetApkName()).andStubReturn(null);
@@ -110,8 +117,8 @@ public class CtsTestTest extends TestCase {
// turn off device collection for simplicity
mCtsTest.setSkipDeviceInfo(true);
// only run tests on one ABI
- EasyMock.expect(mMockDevice.getProperty("ro.product.cpu.abilist")).andReturn(
- UnitTests.ABI.getName()).anyTimes();
+ EasyMock.expect(mMockDevice.getProperty("ro.product.cpu.abilist"))
+ .andReturn(UnitTests.ABI.getName()).anyTimes();
}
/**
@@ -119,7 +126,7 @@ public class CtsTestTest extends TestCase {
*/
@SuppressWarnings("unchecked")
public void testRun_plan() throws DeviceNotAvailableException, ParseException {
- setParsePlanExceptations();
+ setParsePlanExpectations();
setCreateAndRunTestExpectations();
@@ -134,6 +141,12 @@ public class CtsTestTest extends TestCase {
@SuppressWarnings("unchecked")
public void testRun_package() throws DeviceNotAvailableException {
mCtsTest.addPackageName(PACKAGE_NAME);
+ Map<String, List<ITestPackageDef>> nameMap = new HashMap<>();
+ List<ITestPackageDef> testPackageDefList = new ArrayList<>();
+ testPackageDefList.add(mMockPackageDef);
+ nameMap.put(PACKAGE_NAME, testPackageDefList);
+
+ EasyMock.expect(mMockRepo.getTestPackageDefsByName()).andReturn(nameMap);
setCreateAndRunTestExpectations();
@@ -148,7 +161,12 @@ public class CtsTestTest extends TestCase {
@SuppressWarnings("unchecked")
public void testRun_resume() throws DeviceNotAvailableException {
mCtsTest.addPackageName(PACKAGE_NAME);
+ Map<String, List<ITestPackageDef>> nameMap = new HashMap<>();
+ List<ITestPackageDef> testPackageDefList = new ArrayList<>();
+ testPackageDefList.add(mMockPackageDef);
+ nameMap.put(PACKAGE_NAME, testPackageDefList);
+ EasyMock.expect(mMockRepo.getTestPackageDefsByName()).andReturn(nameMap);
setCreateAndRunTestExpectations();
// abort the first run
EasyMock.expectLastCall().andThrow(new DeviceNotAvailableException());
@@ -245,7 +263,7 @@ public class CtsTestTest extends TestCase {
/**
* Set EasyMock expectations for parsing {@link #PLAN_NAME}
*/
- private void setParsePlanExceptations() throws ParseException {
+ private void setParsePlanExpectations() throws ParseException {
mCtsTest.setPlanName(PLAN_NAME);
mMockPlan.parse((InputStream) EasyMock.anyObject());
EasyMock.expect(mMockPlan.getTestIds()).andReturn(IDS);
@@ -260,10 +278,9 @@ public class CtsTestTest extends TestCase {
private void setCreateAndRunTestExpectations() throws DeviceNotAvailableException {
EasyMock.expect(mMockRepo.getPackageNames()).andReturn(NAMES).anyTimes();
EasyMock.expect(mMockRepo.getPackageIds()).andReturn(IDS).anyTimes();
- EasyMock.expect(mMockRepo.getTestPackages(PACKAGE_NAME)).andReturn(mMockPackageDefs).anyTimes();
EasyMock.expect(mMockRepo.getTestPackage(ID)).andReturn(mMockPackageDef).anyTimes();
EasyMock.expect(mMockPackageDef.createTest((File) EasyMock.anyObject())).andReturn(mMockTest);
- EasyMock.expect(mMockPackageDef.getTests()).andReturn(new ArrayList<TestIdentifier>());
+ EasyMock.expect(mMockPackageDef.getTests()).andReturn(TEST_IDENTIFIER_LIST).times(2);
EasyMock.expect(mMockPackageDef.getName()).andReturn(PACKAGE_NAME).atLeastOnce();
EasyMock.expect(mMockPackageDef.getAbi()).andReturn(UnitTests.ABI).atLeastOnce();
EasyMock.expect(mMockPackageDef.getId()).andReturn(ID).atLeastOnce();
diff --git a/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/TestPackageXmlParserTest.java b/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/TestPackageXmlParserTest.java
index 5591b65..6d87a61 100644
--- a/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/TestPackageXmlParserTest.java
+++ b/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/TestPackageXmlParserTest.java
@@ -16,29 +16,28 @@
package com.android.cts.tradefed.testtype;
-import com.android.cts.tradefed.command.CtsConsole;
import com.android.cts.util.AbiUtils;
import com.android.ddmlib.testrunner.TestIdentifier;
import com.android.tradefed.util.xml.AbstractXmlParser.ParseException;
+import junit.framework.TestCase;
+
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Iterator;
-import junit.framework.TestCase;
-
/**
* Unit tests for {@link TestPackageXmlParser}.
*/
public class TestPackageXmlParserTest extends TestCase {
- private static String INSTR_TEST_DATA =
+ private static final String INSTR_TEST_DATA =
"<TestPackage AndroidFramework=\"Android 1.0\" appNameSpace=\"com.example\" " +
"appPackageName=\"android.example\" name=\"CtsExampleTestCases\" " +
"runner=\"android.test.InstrumentationTestRunner\" version=\"1.0\">" +
"</TestPackage>";
- private static String HOST_TEST_DATA =
+ private static final String HOST_TEST_DATA =
"<TestPackage hostSideOnly=\"true\" >\n" +
" <TestSuite name=\"com\" >\n" +
" <TestSuite name=\"example\" >\n" +
@@ -55,23 +54,22 @@ public class TestPackageXmlParserTest extends TestCase {
" </TestSuite>\n" +
"</TestPackage>";
- private static String BAD_HOST_TEST_DATA =
+ private static final String BAD_HOST_TEST_DATA =
"<TestPackage hostSideOnly=\"blah\" >" +
"</TestPackage>";
- private static String VM_HOST_TEST_XML = "<TestPackage vmHostTest=\"true\"></TestPackage>";
+ private static final String VM_HOST_TEST_XML =
+ "<TestPackage vmHostTest=\"true\"></TestPackage>";
- private static String NATIVE_TEST_XML = "<TestPackage testType=\"native\"></TestPackage>";
+ private static final String NATIVE_TEST_XML = "<TestPackage testType=\"native\"></TestPackage>";
- private static String NO_TEST_DATA =
- "<invalid />";
+ private static final String NO_TEST_DATA = "<invalid />";
/**
* Test parsing test case xml containing an instrumentation test definition.
*/
public void testParse_instrPackage() throws ParseException {
- TestPackageXmlParser parser = new TestPackageXmlParser(AbiUtils.getAbisSupportedByCts(),
- true);
+ TestPackageXmlParser parser = new TestPackageXmlParser(true);
parser.parse(getStringAsStream(INSTR_TEST_DATA));
for (TestPackageDef def : parser.getTestPackageDefs()) {
assertEquals("com.example", def.getAppNameSpace());
@@ -85,8 +83,7 @@ public class TestPackageXmlParserTest extends TestCase {
* Test parsing test case xml containing an host test attribute and test data.
*/
public void testParse_hostTest() throws ParseException {
- TestPackageXmlParser parser = new TestPackageXmlParser(AbiUtils.getAbisSupportedByCts(),
- true);
+ TestPackageXmlParser parser = new TestPackageXmlParser(true);
parser.parse(getStringAsStream(HOST_TEST_DATA));
for (TestPackageDef def : parser.getTestPackageDefs()) {
assertEquals(TestPackageDef.HOST_SIDE_ONLY_TEST, def.getTestType());
@@ -110,8 +107,7 @@ public class TestPackageXmlParserTest extends TestCase {
}
public void testParse_hostTest_noKnownFailures() throws ParseException {
- TestPackageXmlParser parser = new TestPackageXmlParser(AbiUtils.getAbisSupportedByCts(),
- false);
+ TestPackageXmlParser parser = new TestPackageXmlParser(false);
parser.parse(getStringAsStream(HOST_TEST_DATA));
for (TestPackageDef def : parser.getTestPackageDefs()) {
assertEquals(TestPackageDef.HOST_SIDE_ONLY_TEST, def.getTestType());
@@ -134,8 +130,7 @@ public class TestPackageXmlParserTest extends TestCase {
* Test parsing test case xml containing an invalid host test attribute.
*/
public void testParse_badHostTest() throws ParseException {
- TestPackageXmlParser parser = new TestPackageXmlParser(AbiUtils.getAbisSupportedByCts(),
- true);
+ TestPackageXmlParser parser = new TestPackageXmlParser(true);
parser.parse(getStringAsStream(BAD_HOST_TEST_DATA));
for (TestPackageDef def : parser.getTestPackageDefs()) {
assertFalse(TestPackageDef.HOST_SIDE_ONLY_TEST.equals(def.getTestType()));
@@ -151,8 +146,7 @@ public class TestPackageXmlParserTest extends TestCase {
}
private void assertTestType(String expectedType, String xml) throws ParseException {
- TestPackageXmlParser parser = new TestPackageXmlParser(AbiUtils.getAbisSupportedByCts(),
- true);
+ TestPackageXmlParser parser = new TestPackageXmlParser(true);
parser.parse(getStringAsStream(xml));
for (TestPackageDef def : parser.getTestPackageDefs()) {
assertEquals(expectedType, def.getTestType());
@@ -163,8 +157,7 @@ public class TestPackageXmlParserTest extends TestCase {
* Test parsing a test case xml with no test package data.
*/
public void testParse_noData() throws ParseException {
- TestPackageXmlParser parser = new TestPackageXmlParser(AbiUtils.getAbisSupportedByCts(),
- true);
+ TestPackageXmlParser parser = new TestPackageXmlParser(true);
parser.parse(getStringAsStream(NO_TEST_DATA));
assertTrue(parser.getTestPackageDefs().isEmpty());
}
diff --git a/tools/utils/buildCts.py b/tools/utils/buildCts.py
index 9d0a5ff..486a494 100755
--- a/tools/utils/buildCts.py
+++ b/tools/utils/buildCts.py
@@ -357,6 +357,7 @@ def BuildAospSmallSizeTestList():
def BuildCtsVettedNewPackagesList():
""" Construct a defaultdict that maps package names that is vetted for L. """
return {
+ 'android.JobScheduler' : [],
'android.core.tests.libcore.package.harmony_annotation' : [],
'android.core.tests.libcore.package.harmony_beans' : [],
'android.core.tests.libcore.package.harmony_java_io' : [],
@@ -383,6 +384,7 @@ def BuildCtsVettedNewPackagesList():
'android.uiautomation' : [],
'android.uirendering' : [],
'android.webgl' : [],
+ 'com.drawelements.deqp.gles3' : [],
'com.drawelements.deqp.gles31' : []}
def BuildCtsFlakyTestList():
#
##
# diffing device/lge/mako
##
#
diff --git a/init.mako.rc b/init.mako.rc
index f84c0a9..73edc13 100644
--- a/init.mako.rc
+++ b/init.mako.rc
@@ -395,7 +395,7 @@ service qcamerasvr /system/bin/mm-qcamera-daemon
group camera system inet input
service wcnss_init /system/bin/sh /system/etc/init.mako.wifi.sh
- class main
+ class late_start
user system
group system wifi
seclabel u:r:conn_init:s0
#
##
# diffing platform/external/deqp
##
#
diff --git a/android/cts/com.drawelements.deqp.gles3.xml b/android/cts/com.drawelements.deqp.gles3.xml
index 6af073a..abf40d1 100644
--- a/android/cts/com.drawelements.deqp.gles3.xml
+++ b/android/cts/com.drawelements.deqp.gles3.xml
@@ -17066,7 +17066,6 @@
</TestCase>
<TestCase name="highp_vertex">
<Test name="vec3" />
-<Test name="vec4" />
</TestCase>
<TestCase name="highp_fragment">
<Test name="vec3" />
@@ -27838,7 +27837,6 @@
<Test name="rgba16f" />
<Test name="depth24_stencil8" />
<Test name="r11f_g11f_b10f" />
-<Test name="srgb_unsigned_byte" />
<Test name="srgb_alpha_unsigned_byte" />
<Test name="srgb8_alpha8" />
<Test name="depth_component32f" />
diff --git a/doc/testspecs/GLES31/functional.blend_equation_advanced.txt b/doc/testspecs/GLES31/functional.blend_equation_advanced.txt
index 72d06ff..cc7822d 100644
--- a/doc/testspecs/GLES31/functional.blend_equation_advanced.txt
+++ b/doc/testspecs/GLES31/functional.blend_equation_advanced.txt
@@ -32,6 +32,7 @@ Includes:
Excludes (will be added later):
+ Use of blend_support_all qualifier
+ Interaction with other per-fragment operations
+ + Non-premultiplied / invalid color inputs
+ Negative tests
Description:
diff --git a/framework/platform/android/tcuAndroidRenderActivity.cpp b/framework/platform/android/tcuAndroidRenderActivity.cpp
index 142435e..ddbf40e 100644
--- a/framework/platform/android/tcuAndroidRenderActivity.cpp
+++ b/framework/platform/android/tcuAndroidRenderActivity.cpp
@@ -291,7 +291,6 @@ RenderActivity::~RenderActivity (void)
void RenderActivity::setThread (RenderThread* thread)
{
- DE_ASSERT(!m_thread && thread);
m_thread = thread;
}
diff --git a/framework/platform/android/tcuTestLogParserJNI.cpp b/framework/platform/android/tcuTestLogParserJNI.cpp
index 59a4edb..e436b97 100644
--- a/framework/platform/android/tcuTestLogParserJNI.cpp
+++ b/framework/platform/android/tcuTestLogParserJNI.cpp
@@ -107,12 +107,12 @@ TestLogListener::~TestLogListener (void)
void TestLogListener::beginSession (void)
{
- m_env->CallObjectMethod(m_object, m_beginSessionID);
+ m_env->CallVoidMethod(m_object, m_beginSessionID);
}
void TestLogListener::endSession (void)
{
- m_env->CallObjectMethod(m_object, m_endSessionID);
+ m_env->CallVoidMethod(m_object, m_endSessionID);
}
void TestLogListener::sessionInfo (const char* name, const char* value)
@@ -120,26 +120,30 @@ void TestLogListener::sessionInfo (const char* name, const char* value)
jstring jName = m_env->NewStringUTF(name);
jstring jValue = m_env->NewStringUTF(value);
- m_env->CallObjectMethod(m_object, m_sessionInfoID, jName, jValue);
+ m_env->CallVoidMethod(m_object, m_sessionInfoID, jName, jValue);
+ m_env->DeleteLocalRef(jName);
+ m_env->DeleteLocalRef(jValue);
}
void TestLogListener::beginTestCase (const char* testCasePath)
{
jstring jTestCasePath = m_env->NewStringUTF(testCasePath);
- m_env->CallObjectMethod(m_object, m_beginTestCaseID, jTestCasePath);
+ m_env->CallVoidMethod(m_object, m_beginTestCaseID, jTestCasePath);
+ m_env->DeleteLocalRef(jTestCasePath);
}
void TestLogListener::endTestCase (void)
{
- m_env->CallObjectMethod(m_object, m_endTestCaseID);
+ m_env->CallVoidMethod(m_object, m_endTestCaseID);
}
void TestLogListener::terminateTestCase (const char* reason)
{
jstring jReason = m_env->NewStringUTF(reason);
- m_env->CallObjectMethod(m_object, m_terminateTestCaseID, jReason);
+ m_env->CallVoidMethod(m_object, m_terminateTestCaseID, jReason);
+ m_env->DeleteLocalRef(jReason);
}
void TestLogListener::testCaseResult (const char* statusCode, const char* details)
@@ -147,14 +151,17 @@ void TestLogListener::testCaseResult (const char* statusCode, const char* detail
jstring jStatusCode = m_env->NewStringUTF(statusCode);
jstring jDetails = m_env->NewStringUTF(details);
- m_env->CallObjectMethod(m_object, m_testCaseResultID, jStatusCode, jDetails);
+ m_env->CallVoidMethod(m_object, m_testCaseResultID, jStatusCode, jDetails);
+ m_env->DeleteLocalRef(jStatusCode);
+ m_env->DeleteLocalRef(jDetails);
}
void TestLogListener::testLogData (const char* data)
{
jstring logData = m_env->NewStringUTF(data);
- m_env->CallObjectMethod(m_object, m_testLogData, logData);
+ m_env->CallVoidMethod(m_object, m_testLogData, logData);
+ m_env->DeleteLocalRef(logData);
}
class TestLogParser
diff --git a/modules/gles2/functional/es2fFboCompletenessTests.cpp b/modules/gles2/functional/es2fFboCompletenessTests.cpp
index 24882aa..5a67f8d 100644
--- a/modules/gles2/functional/es2fFboCompletenessTests.cpp
+++ b/modules/gles2/functional/es2fFboCompletenessTests.cpp
@@ -96,6 +96,12 @@ static const FormatKey s_oesTextureHalfFloatFormats[] =
GLS_UNSIZED_FORMATKEY(GL_RGB, GL_HALF_FLOAT_OES),
};
+// GL_EXT_sRGB_write_control
+static const FormatKey s_extSrgbWriteControlFormats[] =
+{
+ GL_SRGB8_ALPHA8
+};
+
static const FormatExtEntry s_es2ExtFormats[] =
{
// The extension does not specify these to be color-renderable.
@@ -109,6 +115,13 @@ static const FormatExtEntry s_es2ExtFormats[] =
TEXTURE_VALID,
GLS_ARRAY_RANGE(s_oesTextureHalfFloatFormats)
},
+
+ // GL_EXT_sRGB_write_control makes SRGB8_ALPHA8 color-renderable
+ {
+ "GL_EXT_sRGB_write_control",
+ REQUIRED_RENDERABLE | TEXTURE_VALID | COLOR_RENDERABLE | RENDERBUFFER_VALID,
+ GLS_ARRAY_RANGE(s_extSrgbWriteControlFormats)
+ },
};
class ES2Checker : public Checker
diff --git a/modules/gles3/functional/es3fFboCompletenessTests.cpp b/modules/gles3/functional/es3fFboCompletenessTests.cpp
index c594e4c..b392f51 100644
--- a/modules/gles3/functional/es3fFboCompletenessTests.cpp
+++ b/modules/gles3/functional/es3fFboCompletenessTests.cpp
@@ -93,6 +93,14 @@ static const FormatKey s_es3TextureFloatFormats[] =
GL_RGBA16F, GL_RGB16F, GL_RG16F, GL_R16F,
};
+static const FormatKey s_es3NotRenderableTextureFormats[] =
+{
+ GL_R8_SNORM, GL_RG8_SNORM, GL_RGB8_SNORM, GL_RGBA8_SNORM,
+ GL_RGB9_E5, GL_SRGB8,
+ GL_RGB8I, GL_RGB16I, GL_RGB32I,
+ GL_RGB8UI, GL_RGB16UI,GL_RGB32UI,
+};
+
static const FormatEntry s_es3Formats[] =
{
// Renderbuffers don't support unsized formats
@@ -106,6 +114,8 @@ static const FormatEntry s_es3Formats[] =
GLS_ARRAY_RANGE(s_es3StencilRboRenderables) },
{ REQUIRED_RENDERABLE | STENCIL_RENDERABLE | RENDERBUFFER_VALID | TEXTURE_VALID,
GLS_ARRAY_RANGE(s_es3StencilRenderables) },
+ { TEXTURE_VALID,
+ GLS_ARRAY_RANGE(s_es3NotRenderableTextureFormats) },
// These are not color-renderable in vanilla ES3, but we need to mark them
// as valid for textures, since EXT_color_buffer_(half_)float brings in
diff --git a/modules/gles31/functional/es31fAdvancedBlendTests.cpp b/modules/gles31/functional/es31fAdvancedBlendTests.cpp
index dcde00f..aed9395 100644
--- a/modules/gles31/functional/es31fAdvancedBlendTests.cpp
+++ b/modules/gles31/functional/es31fAdvancedBlendTests.cpp
@@ -419,10 +419,15 @@ AdvancedBlendCase::IterateResult AdvancedBlendCase::iterate (void)
GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to set render state");
+ gl.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
+
gl.disable(GL_BLEND);
gl.drawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, DE_NULL);
gl.enable(GL_BLEND);
+ if (!m_coherentBlending)
+ gl.blendBarrierKHR();
+
if (m_coherentBlending)
{
gl.drawElements(GL_TRIANGLES, 6*(numQuads-1), GL_UNSIGNED_SHORT, (const void*)(deUintptr)(6*sizeof(deUint16)));
diff --git a/modules/gles31/functional/es31fNegativeBufferApiTests.cpp b/modules/gles31/functional/es31fNegativeBufferApiTests.cpp
index 3c9e27b..9f63623 100644
--- a/modules/gles31/functional/es31fNegativeBufferApiTests.cpp
+++ b/modules/gles31/functional/es31fNegativeBufferApiTests.cpp
@@ -1396,8 +1396,11 @@ void renderbuffer_storage_multisample (NegativeTestContext& ctx)
{
deUint32 rbo = 0x1234;
int maxSamplesSupportedRGBA4 = -1;
+ int maxSamplesSupportedRGBA8UI = -1;
ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA4, GL_SAMPLES, 1, &maxSamplesSupportedRGBA4);
+ ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA8UI, GL_SAMPLES, 1, &maxSamplesSupportedRGBA8UI);
+
ctx.glGenRenderbuffers (1, &rbo);
ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo);
@@ -1427,8 +1430,8 @@ void renderbuffer_storage_multisample (NegativeTestContext& ctx)
ctx.expectError (GL_INVALID_ENUM);
ctx.endSection();
- ctx.beginSection("GL_INVALID_OPERATION is generated if internalformat is a signed or unsigned integer format and samples is greater than 0.");
- ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 1, GL_RGBA8UI, 1, 1);
+ ctx.beginSection("GL_INVALID_OPERATION is generated if samples is greater than the maximum number of samples supported for internalformat. (Unsigned integer format)");
+ ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, maxSamplesSupportedRGBA8UI+1, GL_RGBA8UI, 1, 1);
ctx.expectError (GL_INVALID_OPERATION);
ctx.endSection();
diff --git a/modules/gles31/functional/es31fProgramInterfaceDefinitionUtil.cpp b/modules/gles31/functional/es31fProgramInterfaceDefinitionUtil.cpp
index ccc0d80..5dca33b 100644
--- a/modules/gles31/functional/es31fProgramInterfaceDefinitionUtil.cpp
+++ b/modules/gles31/functional/es31fProgramInterfaceDefinitionUtil.cpp
@@ -893,6 +893,35 @@ static int getNumMaxXFBOutputComponents (const ProgramInterfaceDefinition::Progr
return numComponents;
}
+static int getFragmentOutputMaxLocation (const ProgramInterfaceDefinition::Shader* shader)
+{
+ DE_ASSERT(shader->getType() == glu::SHADERTYPE_FRAGMENT);
+
+ int maxOutputLocation = -1;
+
+ for (int ndx = 0; ndx < (int)shader->getDefaultBlock().variables.size(); ++ndx)
+ {
+ if (shader->getDefaultBlock().variables[ndx].storage == glu::STORAGE_OUT)
+ {
+ // missing location qualifier means location == 0
+ const int outputLocation = (shader->getDefaultBlock().variables[ndx].layout.location == -1)
+ ? (0)
+ : (shader->getDefaultBlock().variables[ndx].layout.location);
+
+ // only basic types or arrays of basic types possible
+ DE_ASSERT(!shader->getDefaultBlock().variables[ndx].varType.isStructType());
+
+ const int locationSlotsTaken = (shader->getDefaultBlock().variables[ndx].varType.isArrayType())
+ ? (shader->getDefaultBlock().variables[ndx].varType.getArraySize())
+ : (1);
+
+ maxOutputLocation = de::max(maxOutputLocation, outputLocation + locationSlotsTaken - 1);
+ }
+ }
+
+ return maxOutputLocation;
+}
+
} // anonymous
std::vector<std::string> getProgramInterfaceBlockMemberResourceList (const glu::InterfaceBlock& interfaceBlock)
@@ -1315,27 +1344,28 @@ ProgramInterfaceDefinition::ProgramResourceUsage getCombinedProgramResourceUsage
{
ProgramInterfaceDefinition::ProgramResourceUsage retVal;
- retVal.uniformBufferMaxBinding = 0;
+ retVal.uniformBufferMaxBinding = -1; // max binding is inclusive upper bound. Allow 0 bindings by using negative value
retVal.uniformBufferMaxSize = 0;
retVal.numUniformBlocks = 0;
retVal.numCombinedVertexUniformComponents = 0;
retVal.numCombinedFragmentUniformComponents = 0;
- retVal.shaderStorageBufferMaxBinding = 0;
+ retVal.shaderStorageBufferMaxBinding = -1; // see above
retVal.shaderStorageBufferMaxSize = 0;
retVal.numShaderStorageBlocks = 0;
retVal.numVaryingComponents = 0;
retVal.numVaryingVectors = 0;
retVal.numCombinedSamplers = 0;
- retVal.atomicCounterBufferMaxBinding = 0;
+ retVal.atomicCounterBufferMaxBinding = -1; // see above
retVal.atomicCounterBufferMaxSize = 0;
retVal.numAtomicCounterBuffers = 0;
retVal.numAtomicCounters = 0;
- retVal.maxImageBinding = 0;
+ retVal.maxImageBinding = -1; // see above
retVal.numCombinedImages = 0;
retVal.numCombinedOutputResources = 0;
retVal.numXFBInterleavedComponents = 0;
retVal.numXFBSeparateAttribs = 0;
retVal.numXFBSeparateComponents = 0;
+ retVal.fragmentOutputMaxBinding = -1; // see above
for (int shaderNdx = 0; shaderNdx < (int)program->getShaders().size(); ++shaderNdx)
{
@@ -1372,8 +1402,12 @@ ProgramInterfaceDefinition::ProgramResourceUsage getCombinedProgramResourceUsage
retVal.numCombinedOutputResources += getNumTypeInstances(shader, glu::STORAGE_UNIFORM, glu::isDataTypeImage);
retVal.numCombinedOutputResources += getNumShaderBlocks(shader, glu::STORAGE_BUFFER);
+
if (shader->getType() == glu::SHADERTYPE_FRAGMENT)
+ {
retVal.numCombinedOutputResources += getNumVectors(shader, glu::STORAGE_OUT);
+ retVal.fragmentOutputMaxBinding = de::max(retVal.fragmentOutputMaxBinding, getFragmentOutputMaxLocation(shader));
+ }
}
if (program->getTransformFeedbackMode() == GL_INTERLEAVED_ATTRIBS)
diff --git a/modules/gles31/functional/es31fProgramInterfaceDefinitionUtil.hpp b/modules/gles31/functional/es31fProgramInterfaceDefinitionUtil.hpp
index 0117013..ac24fce 100644
--- a/modules/gles31/functional/es31fProgramInterfaceDefinitionUtil.hpp
+++ b/modules/gles31/functional/es31fProgramInterfaceDefinitionUtil.hpp
@@ -147,6 +147,7 @@ struct ProgramResourceUsage
int numXFBInterleavedComponents;
int numXFBSeparateAttribs;
int numXFBSeparateComponents;
+ int fragmentOutputMaxBinding;
};
} // ProgramInterfaceDefinition
diff --git a/modules/gles31/functional/es31fProgramInterfaceQueryTestCase.cpp b/modules/gles31/functional/es31fProgramInterfaceQueryTestCase.cpp
index 728d13a..a8a86e9 100644
--- a/modules/gles31/functional/es31fProgramInterfaceQueryTestCase.cpp
+++ b/modules/gles31/functional/es31fProgramInterfaceQueryTestCase.cpp
@@ -2117,7 +2117,7 @@ static bool checkProgramCombinedResourceUsage (const ProgramInterfaceDefinition:
{ GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE, usage.atomicCounterBufferMaxSize },
{ GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS, usage.numAtomicCounterBuffers },
{ GL_MAX_COMBINED_ATOMIC_COUNTERS, usage.numAtomicCounters },
- { GL_MAX_IMAGE_UNITS, usage.maxImageBinding },
+ { GL_MAX_IMAGE_UNITS, usage.maxImageBinding+1 },
{ GL_MAX_COMBINED_IMAGE_UNIFORMS, usage.numCombinedImages },
{ GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, usage.shaderStorageBufferMaxBinding+1 },
{ GL_MAX_SHADER_STORAGE_BLOCK_SIZE, usage.shaderStorageBufferMaxSize },
@@ -2125,6 +2125,7 @@ static bool checkProgramCombinedResourceUsage (const ProgramInterfaceDefinition:
{ GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, usage.numXFBInterleavedComponents },
{ GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, usage.numXFBSeparateAttribs },
{ GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, usage.numXFBSeparateComponents },
+ { GL_MAX_DRAW_BUFFERS, usage.fragmentOutputMaxBinding+1 },
};
bool allOk = true;
diff --git a/modules/gles31/functional/es31fProgramInterfaceQueryTests.cpp b/modules/gles31/functional/es31fProgramInterfaceQueryTests.cpp
index cf22cb1..1df5f89 100644
--- a/modules/gles31/functional/es31fProgramInterfaceQueryTests.cpp
+++ b/modules/gles31/functional/es31fProgramInterfaceQueryTests.cpp
@@ -4839,7 +4839,7 @@ static void generateProgramOutputLocationBlockContents (Context& context, const
}
// .var_array_explicit_location
{
- const ResourceDefinition::Node::SharedPtr layout (new ResourceDefinition::LayoutQualifier(output, glu::Layout(2)));
+ const ResourceDefinition::Node::SharedPtr layout (new ResourceDefinition::LayoutQualifier(output, glu::Layout(1)));
const ResourceDefinition::Node::SharedPtr arrayElem (new ResourceDefinition::ArrayElement(layout));
const ResourceDefinition::Node::SharedPtr variable (new ResourceDefinition::Variable(arrayElem, glu::TYPE_FLOAT_VEC4));
targetGroup->addChild(new ResourceTestCase(context, variable, ProgramResourceQueryTestTarget(PROGRAMINTERFACE_PROGRAM_OUTPUT, PROGRAMRESOURCEPROP_LOCATION), "var_array_explicit_location"));
diff --git a/modules/gles31/functional/es31fShaderImageLoadStoreTests.cpp b/modules/gles31/functional/es31fShaderImageLoadStoreTests.cpp
index ea23ab2..f993654 100644
--- a/modules/gles31/functional/es31fShaderImageLoadStoreTests.cpp
+++ b/modules/gles31/functional/es31fShaderImageLoadStoreTests.cpp
@@ -2874,10 +2874,21 @@ public:
TESTTYPE_LAST
};
- EarlyFragmentTestsCase (Context& context, const char* name, const char* description, TestType type, bool useEarlyTests)
+ enum RenderTargetType
+ {
+ RENDERTARGET_DEFAULT = 0,
+ RENDERTARGET_FBO,
+ RENDERTARGET_FBO_WITHOUT_TEST_ATTACHMENT,
+
+ RENDERTARGET_LAST
+ };
+
+
+ EarlyFragmentTestsCase (Context& context, const char* name, const char* description, TestType type, bool useEarlyTests, RenderTargetType renderTarget)
: TestCase (context, name, description)
, m_type (type)
, m_useEarlyTests (useEarlyTests)
+ , m_renderTarget (renderTarget)
{
}
@@ -2889,33 +2900,53 @@ public:
if (!m_context.getContextInfo().isExtensionSupported("GL_OES_shader_image_atomic"))
throw tcu::NotSupportedError("Test requires OES_shader_image_atomic extension");
- if (m_context.getRenderTarget().getWidth() < RENDER_SIZE || m_context.getRenderTarget().getHeight() < RENDER_SIZE)
+ if (m_type == TESTTYPE_DEPTH &&
+ m_renderTarget == RENDERTARGET_DEFAULT &&
+ m_context.getRenderTarget().getDepthBits() == 0)
+ {
+ throw tcu::NotSupportedError("Test requires depth buffer");
+ }
+
+ if (m_type == TESTTYPE_STENCIL &&
+ m_renderTarget == RENDERTARGET_DEFAULT &&
+ m_context.getRenderTarget().getStencilBits() == 0)
+ {
+ throw tcu::NotSupportedError("Test requires stencil buffer");
+ }
+
+ if (m_renderTarget == RENDERTARGET_DEFAULT &&
+ (m_context.getRenderTarget().getWidth() < RENDER_SIZE || m_context.getRenderTarget().getHeight() < RENDER_SIZE))
throw tcu::NotSupportedError("Render target must have at least " + toString(RENDER_SIZE) + " width and height");
}
IterateResult iterate (void);
private:
- static const int RENDER_SIZE;
+ static const int RENDER_SIZE;
- const TestType m_type;
- const bool m_useEarlyTests;
+ const TestType m_type;
+ const bool m_useEarlyTests;
+ const RenderTargetType m_renderTarget;
};
const int EarlyFragmentTestsCase::RENDER_SIZE = 32;
EarlyFragmentTestsCase::IterateResult EarlyFragmentTestsCase::iterate (void)
{
- const RenderContext& renderCtx = m_context.getRenderContext();
- TestLog& log (m_testCtx.getLog());
- glu::CallLogWrapper glLog (renderCtx.getFunctions(), log);
- de::Random rnd (deStringHash(getName()));
- const int viewportWidth = RENDER_SIZE;
- const int viewportHeight = RENDER_SIZE;
- const int viewportX = rnd.getInt(0, renderCtx.getRenderTarget().getWidth() - viewportWidth);
- const int viewportY = rnd.getInt(0, renderCtx.getRenderTarget().getHeight() - viewportHeight);
- const IVec3 imageSize = defaultImageSize(TEXTURETYPE_2D);
- const glu::Texture texture (renderCtx);
+ const RenderContext& renderCtx = m_context.getRenderContext();
+ TestLog& log (m_testCtx.getLog());
+ glu::CallLogWrapper glLog (renderCtx.getFunctions(), log);
+ de::Random rnd (deStringHash(getName()));
+ const bool expectPartialResult = m_useEarlyTests && m_renderTarget != RENDERTARGET_FBO_WITHOUT_TEST_ATTACHMENT;
+ const int viewportWidth = RENDER_SIZE;
+ const int viewportHeight = RENDER_SIZE;
+ const int viewportX = (m_renderTarget == RENDERTARGET_DEFAULT) ? (rnd.getInt(0, renderCtx.getRenderTarget().getWidth() - viewportWidth)) : (0);
+ const int viewportY = (m_renderTarget == RENDERTARGET_DEFAULT) ? (rnd.getInt(0, renderCtx.getRenderTarget().getHeight() - viewportHeight)) : (0);
+ const IVec3 imageSize = defaultImageSize(TEXTURETYPE_2D);
+ const glu::Texture texture (renderCtx);
+ de::MovePtr<glu::Framebuffer> fbo;
+ de::MovePtr<glu::Renderbuffer> colorAttachment;
+ de::MovePtr<glu::Renderbuffer> testAttachment;
glLog.enableLogging(true);
@@ -2934,6 +2965,46 @@ EarlyFragmentTestsCase::IterateResult EarlyFragmentTestsCase::iterate (void)
glLog.glBindImageTexture(0, *texture, 0, GL_TRUE, 0, GL_READ_WRITE, GL_R32UI);
GLU_EXPECT_NO_ERROR(renderCtx.getFunctions().getError(), "glBindImageTexture");
+ // Set up framebuffer
+ if (m_renderTarget == RENDERTARGET_FBO ||
+ m_renderTarget == RENDERTARGET_FBO_WITHOUT_TEST_ATTACHMENT)
+ {
+ fbo = de::MovePtr<glu::Framebuffer>(new glu::Framebuffer(renderCtx));
+ colorAttachment = de::MovePtr<glu::Renderbuffer>(new glu::Renderbuffer(renderCtx));
+ testAttachment = de::MovePtr<glu::Renderbuffer>(new glu::Renderbuffer(renderCtx));
+
+ glLog.glBindRenderbuffer(GL_RENDERBUFFER, **colorAttachment);
+ glLog.glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, RENDER_SIZE, RENDER_SIZE);
+ GLU_EXPECT_NO_ERROR(renderCtx.getFunctions().getError(), "gen color attachment rb");
+
+ glLog.glBindFramebuffer(GL_FRAMEBUFFER, **fbo);
+ glLog.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, **colorAttachment);
+ GLU_EXPECT_NO_ERROR(renderCtx.getFunctions().getError(), "set fbo color attachment");
+
+ if (m_renderTarget == RENDERTARGET_FBO && m_type == TESTTYPE_DEPTH)
+ {
+ glLog.glBindRenderbuffer(GL_RENDERBUFFER, **testAttachment);
+ glLog.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, RENDER_SIZE, RENDER_SIZE);
+ GLU_EXPECT_NO_ERROR(renderCtx.getFunctions().getError(), "gen depth attachment rb");
+
+ glLog.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, **testAttachment);
+ GLU_EXPECT_NO_ERROR(renderCtx.getFunctions().getError(), "set fbo depth attachment");
+ }
+ else if (m_renderTarget == RENDERTARGET_FBO && m_type == TESTTYPE_STENCIL)
+ {
+ glLog.glBindRenderbuffer(GL_RENDERBUFFER, **testAttachment);
+ glLog.glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, RENDER_SIZE, RENDER_SIZE);
+ GLU_EXPECT_NO_ERROR(renderCtx.getFunctions().getError(), "gen stencil attachment rb");
+
+ glLog.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, **testAttachment);
+ GLU_EXPECT_NO_ERROR(renderCtx.getFunctions().getError(), "set fbo stencil attachment");
+ }
+
+ glLog.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, **colorAttachment);
+ GLU_EXPECT_NO_ERROR(renderCtx.getFunctions().getError(), "setup fbo");
+ TCU_CHECK(glLog.glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
+ }
+
// Set up appropriate conditions for the test.
glLog.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
@@ -3040,8 +3111,8 @@ EarlyFragmentTestsCase::IterateResult EarlyFragmentTestsCase::iterate (void)
// Read counter value and check.
{
const int numSamples = de::max(1, renderCtx.getRenderTarget().getNumSamples());
- const int expectedCounter = m_useEarlyTests ? viewportWidth*viewportHeight/2 : viewportWidth*viewportHeight;
- const int tolerance = m_useEarlyTests ? de::max(viewportWidth, viewportHeight)*3 : 0;
+ const int expectedCounter = expectPartialResult ? viewportWidth*viewportHeight/2 : viewportWidth*viewportHeight;
+ const int tolerance = expectPartialResult ? de::max(viewportWidth, viewportHeight)*3 : 0;
const int expectedMin = de::max(0, expectedCounter - tolerance);
const int expectedMax = (expectedCounter + tolerance) * numSamples;
@@ -3252,25 +3323,31 @@ void ShaderImageLoadStoreTests::init (void)
TestCaseGroup* const earlyTestsGroup = new TestCaseGroup(m_context, "early_fragment_tests", "");
addChild(earlyTestsGroup);
+ for (int testRenderTargetI = 0; testRenderTargetI < EarlyFragmentTestsCase::RENDERTARGET_LAST; testRenderTargetI++)
for (int useEarlyTestsI = 0; useEarlyTestsI <= 1; useEarlyTestsI++)
+ for (int testTypeI = 0; testTypeI < EarlyFragmentTestsCase::TESTTYPE_LAST; testTypeI++)
{
- const bool useEarlyTests = useEarlyTestsI != 0;
+ const EarlyFragmentTestsCase::RenderTargetType targetType = (EarlyFragmentTestsCase::RenderTargetType)testRenderTargetI;
+ const bool useEarlyTests = useEarlyTestsI != 0;
+ const EarlyFragmentTestsCase::TestType testType = (EarlyFragmentTestsCase::TestType)testTypeI;
- for (int testTypeI = 0; testTypeI < EarlyFragmentTestsCase::TESTTYPE_LAST; testTypeI++)
- {
- const EarlyFragmentTestsCase::TestType testType = (EarlyFragmentTestsCase::TestType)testTypeI;
+ const string testTypeName = testType == EarlyFragmentTestsCase::TESTTYPE_DEPTH ? "depth"
+ : testType == EarlyFragmentTestsCase::TESTTYPE_STENCIL ? "stencil"
+ : DE_NULL;
- const string testTypeName = testType == EarlyFragmentTestsCase::TESTTYPE_DEPTH ? "depth"
- : testType == EarlyFragmentTestsCase::TESTTYPE_STENCIL ? "stencil"
- : DE_NULL;
+ const string targetName = targetType == EarlyFragmentTestsCase::RENDERTARGET_FBO ? (std::string("_fbo"))
+ : targetType == EarlyFragmentTestsCase::RENDERTARGET_FBO_WITHOUT_TEST_ATTACHMENT ? (std::string("_fbo_with_no_") + testTypeName)
+ : std::string("");
- const string caseName = string(useEarlyTests ? "" : "no_") + "early_fragment_tests_" + testTypeName;
+ const string caseName = string(useEarlyTests ? "" : "no_") + "early_fragment_tests_" + testTypeName + targetName;
- const string caseDesc = string(useEarlyTests ? "Specify" : "Don't specify")
- + " early_fragment_tests, target the " + testTypeName + " test";
+ const string caseDesc = string(useEarlyTests ? "Specify" : "Don't specify")
+ + " early_fragment_tests, use the " + testTypeName + " test"
+ + ((targetType == EarlyFragmentTestsCase::RENDERTARGET_FBO) ? (", render to fbo")
+ : (targetType == EarlyFragmentTestsCase::RENDERTARGET_FBO_WITHOUT_TEST_ATTACHMENT) ? (", render to fbo without relevant buffer")
+ : (""));
- earlyTestsGroup->addChild(new EarlyFragmentTestsCase(m_context, caseName.c_str(), caseDesc.c_str(), testType, useEarlyTests));
- }
+ earlyTestsGroup->addChild(new EarlyFragmentTestsCase(m_context, caseName.c_str(), caseDesc.c_str(), testType, useEarlyTests, targetType));
}
}
}
diff --git a/modules/glshared/glsFboCompletenessTests.cpp b/modules/glshared/glsFboCompletenessTests.cpp
index 498f1fd..80d5e6c 100644
--- a/modules/glshared/glsFboCompletenessTests.cpp
+++ b/modules/glshared/glsFboCompletenessTests.cpp
@@ -175,12 +175,22 @@ static const FormatKey s_extSrgbRboFormats[] =
GL_SRGB8_ALPHA8,
};
-static const FormatKey s_extSrgbTexFormats[] =
+static const FormatKey s_extSrgbRenderableTexFormats[] =
{
- GLS_UNSIZED_FORMATKEY(GL_SRGB, GL_UNSIGNED_BYTE),
GLS_UNSIZED_FORMATKEY(GL_SRGB_ALPHA, GL_UNSIGNED_BYTE),
};
+static const FormatKey s_extSrgbNonRenderableTexFormats[] =
+{
+ GLS_UNSIZED_FORMATKEY(GL_SRGB, GL_UNSIGNED_BYTE),
+ GL_SRGB8,
+};
+
+static const FormatKey s_nvSrgbFormatsFormats[] =
+{
+ GL_SRGB8,
+};
+
static const FormatKey s_oesRgb8Rgba8TexFormats[] =
{
GLS_UNSIZED_FORMATKEY(GL_RGB, GL_UNSIGNED_BYTE),
@@ -282,13 +292,23 @@ static const FormatExtEntry s_esExtFormats[] =
{
"GL_EXT_sRGB",
COLOR_RENDERABLE | TEXTURE_VALID,
- GLS_ARRAY_RANGE(s_extSrgbTexFormats)
+ GLS_ARRAY_RANGE(s_extSrgbRenderableTexFormats)
+ },
+ {
+ "GL_EXT_sRGB",
+ TEXTURE_VALID,
+ GLS_ARRAY_RANGE(s_extSrgbNonRenderableTexFormats)
},
{
"GL_EXT_sRGB",
REQUIRED_RENDERABLE | COLOR_RENDERABLE | RENDERBUFFER_VALID,
GLS_ARRAY_RANGE(s_extSrgbRboFormats)
},
+ {
+ "GL_NV_sRGB_formats",
+ REQUIRED_RENDERABLE | COLOR_RENDERABLE | TEXTURE_VALID | RENDERBUFFER_VALID,
+ GLS_ARRAY_RANGE(s_nvSrgbFormatsFormats)
+ },
// In Khronos bug 7333 discussion, the consensus is that these texture
// formats, at least, should be color-renderable. Still, that cannot be
#
##
# diffing platform/frameworks/av
##
#
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index e443476..71a6a73 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -4660,7 +4660,11 @@ void AudioFlinger::DuplicatingThread::threadLoop_mix()
if (outputsReady(outputTracks)) {
mAudioMixer->process(AudioBufferProvider::kInvalidPTS);
} else {
- memset(mSinkBuffer, 0, mSinkBufferSize);
+ if (mMixerBufferValid) {
+ memset(mMixerBuffer, 0, mMixerBufferSize);
+ } else {
+ memset(mSinkBuffer, 0, mSinkBufferSize);
+ }
}
sleepTime = 0;
writeFrames = mNormalFrameCount;
#
##
# logging platform/build
##
#
commit 14bb1521d72eb543c81aa65d55b0504070959c4d
Author: The Android Automerger <android-build@google.com>
Date: Mon Nov 10 11:06:55 2014 -0800
"LRX21T"
commit 3676c2f1de679e753bb7e5fe28e359c6782df880
Author: The Android Automerger <android-build@google.com>
Date: Fri Nov 7 17:40:50 2014 -0800
"LRX21S"
commit 4b41e8db14b9049faa9ce189b73b7a5eeb3b6f4b
Author: The Android Automerger <android-build@google.com>
Date: Fri Nov 7 13:56:45 2014 -0800
"LRX21R"
#
##
# logging platform/cts
##
#
commit c472edb4b7573a45df97395cb3150c363672d9dc
Author: Unsuk Jung <unsuk@google.com>
Date: Fri Nov 7 21:38:09 2014 +0000
Revert "CTS Verifier: hide AID prefix reader test if no support"
This reverts commit 965de72e268037b53930215c8413c912a921265e.
Change-Id: Ifd9ba30820c4b9c23300b3dff60e12ac2d541262
commit c1f2e70ea4c8d0d4f58067c45549c52fc5d68caf
Author: Unsuk Jung <unsuk@google.com>
Date: Fri Nov 7 09:30:14 2014 -0800
Bump CTS verifier to 5.0_r1
Critical issues on CTS verifier resolved
BUg: 17927282
Change-Id: I112c68218a1c9647765fd2a981d7208b43a71840
commit 4c70656e3ed3363fa5836a631ee1749535eac7fd
Author: Unsuk Jung <unsuk@google.com>
Date: Fri Nov 7 09:16:17 2014 -0800
CTS Verifier: hide AID prefix reader test if no support
The reader side of the AID prefix test works also on devices
without AID prefix registration support. However to some
it seems confusing as this makes them look for the emulator
side tests.
Hence removing also the test on the reader side when the
device denies the capability via supportsAidPrefixRegistration()
Bug: 18147492
Change-Id: I0da2ebd56045104d46b363c43b1d2397b472fb99
commit fcd236f1b2efc6c7cdd4323dbcd89590d4c15bf7
Author: Unsuk Jung <unsuk@google.com>
Date: Fri Nov 7 09:09:53 2014 -0800
Hide sample test from the test list