am b9d9f023: am c161d679: am 1b41a7a9: am 2aa67439: Merge "Fix ClonedSecureRandomTest on single core devices" into jb-dev
* commit 'b9d9f0230ce34cd499ab6263180709678f5d2365':
Fix ClonedSecureRandomTest on single core devices
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index 2b61134..b874af0 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -32,6 +32,7 @@
CtsAccelerationTestStubs \
CtsDelegatingAccessibilityService \
CtsDeviceAdmin \
+ CtsHoloDeviceApp \
CtsMonkeyApp \
CtsMonkeyApp2 \
CtsSomeAccessibilityServices \
@@ -109,6 +110,7 @@
# Host side only tests
cts_host_libraries := \
CtsAppSecurityTests \
+ CtsHoloHostTestCases \
CtsMonkeyTestCases
# Native test executables that need to have associated test XMLs.
diff --git a/apps/CtsVerifier/AndroidManifest.xml b/apps/CtsVerifier/AndroidManifest.xml
index 83e23b6..219116f 100644
--- a/apps/CtsVerifier/AndroidManifest.xml
+++ b/apps/CtsVerifier/AndroidManifest.xml
@@ -18,10 +18,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.cts.verifier"
android:versionCode="1"
- android:versionName="4.2_r4">
+ android:versionName="4.2_r6">
- <!-- Using 10 for more complete NFC support... -->
- <uses-sdk android:minSdkVersion="10"></uses-sdk>
+ <!-- Using 10+ for more complete NFC support... -->
+ <uses-sdk android:minSdkVersion="12"></uses-sdk>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
@@ -52,7 +52,6 @@
android:debuggable="true"
android:largeHeap="true">
- <uses-library android:name="com.android.future.usb.accessory" />
<meta-data android:name="com.google.android.backup.api_key"
android:value="AEdPqrEAAAAIbK6ldcOzoeRtQ1u1dFVJ1A7KetRhit-a1Xa82Q" />
@@ -364,7 +363,7 @@
</intent-filter>
<meta-data android:name="test_category" android:value="@string/test_category_camera" />
<meta-data android:name="test_required_features" android:value="android.hardware.sensor.gyroscope" />
- <meta-data android:name="test_required_features" android:value="android.hardware.camera.any"/>
+ <meta-data android:name="test_required_features" android:value="android.hardware.camera"/>
</activity>
<activity
android:name=".camera.fov.DetermineFovActivity"
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 ca3c2a9..84d64cf 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
@@ -154,7 +154,7 @@
public static final Feature[] ALL_HONEYCOMB_MR1_FEATURES = {
new Feature("android.hardware.usb.host", false),
- new Feature("android.hardware.usb.accessory", true),
+ new Feature("android.hardware.usb.accessory", false),
};
public static final Feature[] ALL_HONEYCOMB_MR2_FEATURES = {
diff --git a/hostsidetests/holo/Android.mk b/hostsidetests/holo/Android.mk
new file mode 100644
index 0000000..4f0c3e8
--- /dev/null
+++ b/hostsidetests/holo/Android.mk
@@ -0,0 +1,34 @@
+# 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.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_JAVA_RESOURCE_DIRS := assets/$(PLATFORM_SDK_VERSION)/
+
+LOCAL_MODULE_TAGS := optional
+
+# Must match the package name in CtsTestCaseList.mk
+LOCAL_MODULE := CtsHoloHostTestCases
+
+LOCAL_JAVA_LIBRARIES := cts-tradefed ddmlib-prebuilt tradefed-prebuilt
+
+LOCAL_CTS_TEST_PACKAGE := android.host.holo
+
+include $(BUILD_CTS_HOST_JAVA_LIBRARY)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/holo/app/Android.mk b/hostsidetests/holo/app/Android.mk
new file mode 100644
index 0000000..a5a7bf1
--- /dev/null
+++ b/hostsidetests/holo/app/Android.mk
@@ -0,0 +1,37 @@
+# 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.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+# Don't include this package in any target.
+LOCAL_MODULE_TAGS := optional
+
+# When built, explicitly put it in the data partition.
+LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
+# and because it is in data, do not strip classes.dex
+LOCAL_DEX_PREOPT := false
+
+LOCAL_PROGUARD_ENABLED := disabled
+
+LOCAL_JAVA_LIBRARIES := android.test.runner
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := CtsHoloDeviceApp
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/holo/app/AndroidManifest.xml b/hostsidetests/holo/app/AndroidManifest.xml
new file mode 100755
index 0000000..70e908c
--- /dev/null
+++ b/hostsidetests/holo/app/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<?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.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="android.holo.app">
+
+ <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <application>
+ <uses-library android:name="android.test.runner" />
+ <activity android:name=".HoloDeviceActivity" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".DisplayInfoActivity"
+ android:label="@string/display_info" />
+ <activity android:name=".CaptureActivity" />
+ </application>
+
+ <!-- self-instrumenting test package. -->
+ <instrumentation android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="android.holo.app"
+ android:label="Generates Holo reference images"/>
+
+</manifest>
+
diff --git a/hostsidetests/holo/app/res/drawable-400dpi/display_info.png b/hostsidetests/holo/app/res/drawable-400dpi/display_info.png
new file mode 100644
index 0000000..e5f1f96
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-400dpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-hdpi/display_info.png b/hostsidetests/holo/app/res/drawable-hdpi/display_info.png
new file mode 100644
index 0000000..10b3950
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-hdpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-land-400dpi/display_info.png b/hostsidetests/holo/app/res/drawable-land-400dpi/display_info.png
new file mode 100644
index 0000000..1b74e01
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-land-400dpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-land-hdpi/display_info.png b/hostsidetests/holo/app/res/drawable-land-hdpi/display_info.png
new file mode 100644
index 0000000..a665018
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-land-hdpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-land-ldpi/display_info.png b/hostsidetests/holo/app/res/drawable-land-ldpi/display_info.png
new file mode 100644
index 0000000..64c8f3a
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-land-ldpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-land-mdpi/display_info.png b/hostsidetests/holo/app/res/drawable-land-mdpi/display_info.png
new file mode 100644
index 0000000..f3e6765
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-land-mdpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-land-tvdpi/display_info.png b/hostsidetests/holo/app/res/drawable-land-tvdpi/display_info.png
new file mode 100644
index 0000000..99de970
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-land-tvdpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-land-xhdpi/display_info.png b/hostsidetests/holo/app/res/drawable-land-xhdpi/display_info.png
new file mode 100644
index 0000000..4c0c2b4
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-land-xhdpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-land-xxhdpi/display_info.png b/hostsidetests/holo/app/res/drawable-land-xxhdpi/display_info.png
new file mode 100644
index 0000000..c6f7fd8
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-land-xxhdpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-ldpi/display_info.png b/hostsidetests/holo/app/res/drawable-ldpi/display_info.png
new file mode 100644
index 0000000..af1fda5
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-ldpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-mdpi/display_info.png b/hostsidetests/holo/app/res/drawable-mdpi/display_info.png
new file mode 100644
index 0000000..4378b14
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-mdpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-tvdpi/display_info.png b/hostsidetests/holo/app/res/drawable-tvdpi/display_info.png
new file mode 100644
index 0000000..d9825fb
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-tvdpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-xhdpi/display_info.png b/hostsidetests/holo/app/res/drawable-xhdpi/display_info.png
new file mode 100644
index 0000000..585af2f
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-xhdpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/drawable-xxhdpi/display_info.png b/hostsidetests/holo/app/res/drawable-xxhdpi/display_info.png
new file mode 100644
index 0000000..255c28f
--- /dev/null
+++ b/hostsidetests/holo/app/res/drawable-xxhdpi/display_info.png
Binary files differ
diff --git a/hostsidetests/holo/app/res/layout/button.xml b/hostsidetests/holo/app/res/layout/button.xml
new file mode 100644
index 0000000..75c480c
--- /dev/null
+++ b/hostsidetests/holo/app/res/layout/button.xml
@@ -0,0 +1,20 @@
+<?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.
+-->
+<Button xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/button"
+ />
diff --git a/hostsidetests/holo/app/res/layout/checkbox.xml b/hostsidetests/holo/app/res/layout/checkbox.xml
new file mode 100644
index 0000000..8eeac39
--- /dev/null
+++ b/hostsidetests/holo/app/res/layout/checkbox.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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.
+-->
+<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
+ android:text="@string/checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+
diff --git a/hostsidetests/holo/app/res/layout/chronometer.xml b/hostsidetests/holo/app/res/layout/chronometer.xml
new file mode 100644
index 0000000..c4ad8d3
--- /dev/null
+++ b/hostsidetests/holo/app/res/layout/chronometer.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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.
+-->
+<Chronometer xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
diff --git a/hostsidetests/holo/app/res/layout/display_info.xml b/hostsidetests/holo/app/res/layout/display_info.xml
new file mode 100644
index 0000000..167d935
--- /dev/null
+++ b/hostsidetests/holo/app/res/layout/display_info.xml
@@ -0,0 +1,32 @@
+<?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.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ >
+ <ImageView
+ android:src="@drawable/display_info"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ />
+ <TextView
+ android:id="@+id/text"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ />
+</LinearLayout>
+
diff --git a/hostsidetests/holo/app/res/layout/holo_test.xml b/hostsidetests/holo/app/res/layout/holo_test.xml
new file mode 100644
index 0000000..0ae6953
--- /dev/null
+++ b/hostsidetests/holo/app/res/layout/holo_test.xml
@@ -0,0 +1,21 @@
+<?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.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/base_view">
+</LinearLayout>
diff --git a/hostsidetests/holo/app/res/values/strings.xml b/hostsidetests/holo/app/res/values/strings.xml
new file mode 100644
index 0000000..02b4080
--- /dev/null
+++ b/hostsidetests/holo/app/res/values/strings.xml
@@ -0,0 +1,79 @@
+<?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>
+ <string name="holo_test_utilities">Holo Test Utilities</string>
+
+ <string name="display_info">Display Info</string>
+ <string name="display_info_text">Density DPI: %1$d\nDensity Bucket: %2$s\nWidth DP: %3$d\nHeight DP: %4$d</string>
+
+ <string name="button">Button</string>
+ <string name="checkbox">CheckBox</string>
+ <string name="chronometer">Chronometer</string>
+ <string name="datepicker">DatePicker</string>
+ <string name="edittext">EditText</string>
+ <string name="progressbar">ProgressBar</string>
+ <string name="progressbar_small">ProgressBar Small</string>
+ <string name="progressbar_large">ProgressBar Large</string>
+ <string name="progressbar_horizontal_0">ProgressBar Horizontal 0%</string>
+ <string name="progressbar_horizontal_50">ProgressBar Horizontal 50%</string>
+ <string name="progressbar_horizontal_100">ProgressBar Horizontal 100%</string>
+ <string name="radiobutton">RadioButton</string>
+ <string name="radiobutton_checked">RadioButton Checked</string>
+ <string name="radiogroup_horizontal">RadioGroup Horizontal</string>
+ <string name="radiogroup_vertical">RadioGroup Vertical</string>
+ <string name="ratingbar_0">RatingBar 0 Stars</string>
+ <string name="ratingbar_2point5">RatingBar 2.5 Stars</string>
+ <string name="ratingbar_5">RatingBar 5 Stars</string>
+ <string name="ratingbar_0_pressed">RatingBar 0 Stars Pressed</string>
+ <string name="ratingbar_2point5_pressed">RatingBar 2.5 Stars Pressed</string>
+ <string name="ratingbar_5_pressed">RatingBar 5 Stars Pressed</string>
+ <string name="searchview">SearchView</string>
+ <string name="searchview_query">SearchView Query</string>
+ <string name="searchview_query_hint">SearchView Query Hint</string>
+ <string name="seekbar_0">SeekBar 0%</string>
+ <string name="seekbar_50">SeekBar 50%</string>
+ <string name="seekbar_100">SeekBar 100%</string>
+ <string name="spinner">Spinner</string>
+ <string name="switch_button">Switch</string>
+ <string name="switch_button_checked">Switch Checked</string>
+ <string name="tabhost">TabHost</string>
+ <string name="textview">TextView</string>
+ <string name="timepicker">TimePicker</string>
+ <string name="togglebutton">ToggleButton</string>
+ <string name="togglebutton_checked">ToggleButton Checked</string>
+ <string name="zoomcontrols">ZoomControls</string>
+
+ <string name="alertdialog_onebutton">AlertDialog One Button</string>
+ <string name="alertdialog_twobuttons">AlertDialog Two Buttons</string>
+ <string name="alertdialog_threebuttons">AlertDialog Three Buttons</string>
+ <string name="alertdialog_list">AlertDialog List</string>
+ <string name="alertdialog_singlechoice">AlertDialog Single Choice</string>
+ <string name="alertdialog_multichoice">AlertDialog Multiple Choice</string>
+ <string name="progressdialog_spinner">ProgressDialog Spinner</string>
+ <string name="progressdialog_horizontal">ProgressDialog Horizontal</string>
+
+ <string name="color_blue_bright">Bright Blue Color</string>
+ <string name="color_blue_dark">Dark Blue Color</string>
+ <string name="color_blue_light">Light Blue Color</string>
+ <string name="color_green_dark">Dark Green Color</string>
+ <string name="color_green_light">Light Green Color</string>
+ <string name="color_orange_dark">Dark Orange Color</string>
+ <string name="color_orange_light">Light Orange Color</string>
+ <string name="color_purple">Purple Color</string>
+ <string name="color_red_dark">Dark Red Color</string>
+ <string name="color_red_light">Light Red Color</string>
+
+</resources>
diff --git a/hostsidetests/holo/app/src/android/holo/app/CaptureActivity.java b/hostsidetests/holo/app/src/android/holo/app/CaptureActivity.java
new file mode 100644
index 0000000..9551877
--- /dev/null
+++ b/hostsidetests/holo/app/src/android/holo/app/CaptureActivity.java
@@ -0,0 +1,87 @@
+/*
+ * 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.
+ */
+
+package android.holo.app;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * Iterates through all themes and all layouts, starting the Activity to capture the images.
+ */
+public class CaptureActivity extends Activity {
+
+ private static final int REQUEST_CODE = 1;
+
+ private static final int NUM_THEMES = 24;
+
+ private static final int NUM_LAYOUTS = 5;
+
+ private final CountDownLatch mLatch = new CountDownLatch(1);
+
+ private int mCurrentTheme = 0;
+
+ private int mCurrentLayout = 0;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ generateNextImage();
+ }
+
+ /**
+ * Starts the activity to generate the next image.
+ */
+ private void generateNextImage() {
+ Intent intent = new Intent(this, HoloDeviceActivity.class);
+ intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
+ intent.putExtra(HoloDeviceActivity.EXTRA_THEME, mCurrentTheme);
+ intent.putExtra(HoloDeviceActivity.EXTRA_LAYOUT, mCurrentLayout);
+ startActivityForResult(intent, REQUEST_CODE);
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (requestCode == REQUEST_CODE) {
+ if (resultCode == RESULT_OK) {
+ mCurrentLayout++;
+ if (mCurrentLayout >= NUM_LAYOUTS) {
+ mCurrentLayout = 0;
+ mCurrentTheme++;
+ }
+ if (mCurrentTheme < NUM_THEMES) {
+ generateNextImage();
+ } else {
+ finish();
+ }
+ } else {
+ finish();
+ }
+ }
+ }
+
+ public void finish() {
+ mLatch.countDown();
+ super.finish();
+ }
+
+ public void waitForCompletion() throws InterruptedException {
+ mLatch.await();
+ }
+}
diff --git a/hostsidetests/holo/app/src/android/holo/app/CaptureHolo.java b/hostsidetests/holo/app/src/android/holo/app/CaptureHolo.java
new file mode 100644
index 0000000..228cd9c
--- /dev/null
+++ b/hostsidetests/holo/app/src/android/holo/app/CaptureHolo.java
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+package android.holo.app;
+
+import android.app.KeyguardManager;
+import android.content.Context;
+import android.test.ActivityInstrumentationTestCase2;
+
+public class CaptureHolo extends ActivityInstrumentationTestCase2<CaptureActivity> {
+
+ public CaptureHolo() {
+ super(CaptureActivity.class);
+ }
+
+ public void testCaptureHolo() throws Exception {
+ setActivityInitialTouchMode(true);
+ CaptureActivity activity = getActivity();
+ KeyguardManager keyguardManager =
+ (KeyguardManager) activity.getSystemService(Context.KEYGUARD_SERVICE);
+ keyguardManager.newKeyguardLock("holo_capture").disableKeyguard();
+ activity.waitForCompletion();
+ }
+}
diff --git a/hostsidetests/holo/app/src/android/holo/app/DisplayInfoActivity.java b/hostsidetests/holo/app/src/android/holo/app/DisplayInfoActivity.java
new file mode 100644
index 0000000..4c40d01
--- /dev/null
+++ b/hostsidetests/holo/app/src/android/holo/app/DisplayInfoActivity.java
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+
+package android.holo.app;
+
+import android.app.Activity;
+import android.holo.app.R;
+import android.os.Bundle;
+import android.util.DisplayMetrics;
+import android.view.Display;
+import android.view.WindowManager;
+import android.widget.TextView;
+
+/**
+ * An activity to display information about the device, including density bucket and dimensions.
+ */
+public class DisplayInfoActivity extends Activity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.display_info);
+
+ WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
+ Display display = windowManager.getDefaultDisplay();
+ DisplayMetrics metrics = new DisplayMetrics();
+ display.getMetrics(metrics);
+
+ DisplayMetrics dm = getResources().getDisplayMetrics();
+ int width = Math.round(dm.widthPixels / dm.density);
+ int height = Math.round(dm.heightPixels / dm.density);
+
+ TextView text = (TextView) findViewById(R.id.text);
+ text.setText(getString(R.string.display_info_text, metrics.densityDpi,
+ getScreenDensityBucket(metrics), width, height));
+ }
+
+ private static String getScreenDensityBucket(DisplayMetrics metrics) {
+ switch (metrics.densityDpi) {
+ case DisplayMetrics.DENSITY_LOW:
+ return "ldpi";
+
+ case DisplayMetrics.DENSITY_MEDIUM:
+ return "mdpi";
+
+ case DisplayMetrics.DENSITY_HIGH:
+ return "hdpi";
+
+ case DisplayMetrics.DENSITY_XHIGH:
+ return "xhdpi";
+
+ case DisplayMetrics.DENSITY_XXHIGH:
+ return "xxhdpi";
+
+ case DisplayMetrics.DENSITY_TV:
+ return "tvdpi";
+
+ default:
+ return "" + metrics.densityDpi;
+ }
+ }
+}
diff --git a/hostsidetests/holo/app/src/android/holo/app/HoloDeviceActivity.java b/hostsidetests/holo/app/src/android/holo/app/HoloDeviceActivity.java
new file mode 100644
index 0000000..bfaf865
--- /dev/null
+++ b/hostsidetests/holo/app/src/android/holo/app/HoloDeviceActivity.java
@@ -0,0 +1,261 @@
+/*
+ * 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.
+ */
+
+package android.holo.app;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.Bitmap.CompressFormat;
+import android.graphics.Canvas;
+import android.holo.app.R;
+import android.os.AsyncTask;
+import android.os.Environment;
+import android.os.Bundle;
+import android.os.Handler;
+import android.util.Log;
+import android.view.View;
+import android.widget.CheckBox;
+import android.widget.LinearLayout;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.lang.Override;
+
+/**
+ * A activity which display various UI elements with Holo theme.
+ */
+public class HoloDeviceActivity extends Activity {
+
+ public static final String EXTRA_THEME = "holo_theme_extra";
+
+ public static final String EXTRA_LAYOUT = "holo_layout_extra";
+
+ public static final String EXTRA_TIMEOUT = "holo_timeout_extra";
+
+ private static final String TAG = HoloDeviceActivity.class.getSimpleName();
+
+ private static final int TIMEOUT = 1 * 1000;//1 sec
+
+ private View mView;
+
+ private String mName;
+
+ private Bitmap mBitmap;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setUpUi(getIntent());
+ }
+
+ @Override
+ public void onNewIntent(Intent intent) {
+ super.onNewIntent(intent);
+ setUpUi(intent);
+ }
+
+ /**
+ * Configures the UI with the given intent
+ */
+ private void setUpUi(Intent intent) {
+ final Theme theme = themes[intent.getIntExtra(EXTRA_THEME, 0)];
+ final Layout layout = layouts[intent.getIntExtra(EXTRA_LAYOUT, 0)];
+ final int timeout = intent.getIntExtra(EXTRA_TIMEOUT, TIMEOUT);
+
+ setTheme(theme.mId);
+ setContentView(R.layout.holo_test);
+
+ final LinearLayout baseView = (LinearLayout) findViewById(R.id.base_view);
+
+ mView = getLayoutInflater().inflate(layout.mId, baseView, false);
+ baseView.addView(mView);
+ if (layout.mModifier != null) {
+ layout.mModifier.modify(mView);
+ }
+ mView.setFocusable(false);
+ mName = String.format("%s_%s", theme.mName, layout.mName);
+
+ final Handler handler = new Handler();
+ handler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ new GenerateBitmapTask().execute();
+ }
+ }, timeout);
+ setResult(RESULT_CANCELED);//On success will be changed to OK
+ }
+
+ /**
+ * A task which gets the UI element to render to a bitmap and then saves that as a png
+ * asynchronously
+ */
+ private class GenerateBitmapTask extends AsyncTask<Void, Void, Boolean> {
+
+ @Override
+ protected void onPreExecute() {
+ final View v = mView;
+ mBitmap = Bitmap.createBitmap(v.getWidth(), v.getHeight(), Bitmap.Config.ARGB_8888);
+ final Canvas canvas = new Canvas(mBitmap);
+ v.draw(canvas);
+ }
+
+ @Override
+ protected Boolean doInBackground(Void... ignored) {
+ if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+ Log.i(TAG, "External storage for saving bitmaps is not mounted");
+ return false;
+ }
+ final File dir = new File(Environment.getExternalStorageDirectory(), "cts-holo-assets");
+ dir.mkdirs();
+ boolean success = false;
+ try {
+ final File file = new File(dir, mName + ".png");
+ FileOutputStream stream = null;
+ try {
+ stream = new FileOutputStream(file);
+ mBitmap.compress(CompressFormat.PNG, 100, stream);
+ } finally {
+ if (stream != null) {
+ stream.close();
+ }
+ }
+ success = true;
+ } catch (Exception e) {
+ Log.e(TAG, e.getMessage());
+ } finally {
+ mBitmap.recycle();
+ mBitmap = null;
+ }
+ return success;
+ }
+
+ @Override
+ protected void onPostExecute(Boolean success) {
+ Log.i(TAG, success ? "OKAY" : "ERROR");
+ setResult(RESULT_OK);
+ finish();
+ }
+ }
+
+ /**
+ * A class to encapsulate information about a holo theme.
+ */
+ private static class Theme {
+
+ public final int mId;
+
+ public final String mName;
+
+ private Theme(int id, String name) {
+ mId = id;
+ mName = name;
+ }
+ }
+
+ private static final Theme[] themes = {
+ new Theme(android.R.style.Theme_Holo,
+ "holo"),
+ new Theme(android.R.style.Theme_Holo_Dialog,
+ "holo_dialog"),
+ new Theme(android.R.style.Theme_Holo_Dialog_MinWidth,
+ "holo_dialog_minwidth"),
+ new Theme(android.R.style.Theme_Holo_Dialog_NoActionBar,
+ "holo_dialog_noactionbar"),
+ new Theme(android.R.style.Theme_Holo_Dialog_NoActionBar_MinWidth,
+ "holo_dialog_noactionbar_minwidth"),
+ new Theme(android.R.style.Theme_Holo_DialogWhenLarge,
+ "holo_dialogwhenlarge"),
+ new Theme(android.R.style.Theme_Holo_DialogWhenLarge_NoActionBar,
+ "holo_dialogwhenlarge_noactionbar"),
+ new Theme(android.R.style.Theme_Holo_InputMethod,
+ "holo_inputmethod"),
+ new Theme(android.R.style.Theme_Holo_Light,
+ "holo_light"),
+ new Theme(android.R.style.Theme_Holo_Light_DarkActionBar,
+ "holo_light_darkactionbar"),
+ new Theme(android.R.style.Theme_Holo_Light_Dialog,
+ "holo_light_dialog"),
+ new Theme(android.R.style.Theme_Holo_Light_Dialog_MinWidth,
+ "holo_light_dialog_minwidth"),
+ new Theme(android.R.style.Theme_Holo_Light_Dialog_NoActionBar,
+ "holo_light_dialog_noactionbar"),
+ new Theme(android.R.style.Theme_Holo_Light_Dialog_NoActionBar_MinWidth,
+ "holo_light_dialog_noactionbar_minwidth"),
+ new Theme(android.R.style.Theme_Holo_Light_DialogWhenLarge,
+ "holo_light_dialogwhenlarge"),
+ new Theme(android.R.style.Theme_Holo_Light_DialogWhenLarge_NoActionBar,
+ "holo_light_dialogwhenlarge_noactionbar"),
+ new Theme(android.R.style.Theme_Holo_Light_NoActionBar,
+ "holo_light_noactionbar"),
+ new Theme(android.R.style.Theme_Holo_Light_NoActionBar_Fullscreen,
+ "holo_light_noactionbar_fullscreen"),
+ new Theme(android.R.style.Theme_Holo_Light_Panel,
+ "holo_light_panel"),
+ new Theme(android.R.style.Theme_Holo_NoActionBar,
+ "holo_noactionbar"),
+ new Theme(android.R.style.Theme_Holo_NoActionBar_Fullscreen,
+ "holo_noactionbar_fullscreen"),
+ new Theme(android.R.style.Theme_Holo_Panel,
+ "holo_panel"),
+ new Theme(android.R.style.Theme_Holo_Wallpaper,
+ "holo_wallpaper"),
+ new Theme(android.R.style.Theme_Holo_Wallpaper_NoTitleBar,
+ "holo_wallpaper_notitlebar")
+ };
+
+ /**
+ * A class to encapsulate information about a holo layout.
+ */
+ private static class Layout {
+
+ public final int mId;
+
+ public final String mName;
+
+ public final Modifier mModifier;
+
+ private Layout(int id, String name, Modifier modifier) {
+ mId = id;
+ mName = name;
+ mModifier = modifier;
+ }
+ }
+
+ private static interface Modifier {
+
+ public void modify(View v);
+ }
+
+ private static final Layout[] layouts = {
+ new Layout(R.layout.button, "button", null),
+ new Layout(R.layout.button, "button_pressed", new Modifier() {
+ @Override
+ public void modify(View v) {
+ v.setPressed(true);
+ }
+ }),
+ new Layout(R.layout.checkbox, "checkbox", null),
+ new Layout(R.layout.checkbox, "checkbox_checked", new Modifier() {
+ @Override
+ public void modify(View v) {
+ ((CheckBox) v).setChecked(true);
+ }
+ }),
+ new Layout(R.layout.chronometer, "chronometer", null)
+ };
+}
diff --git a/hostsidetests/holo/assets/17/hdpi.zip b/hostsidetests/holo/assets/17/hdpi.zip
new file mode 100644
index 0000000..dec6ed0
--- /dev/null
+++ b/hostsidetests/holo/assets/17/hdpi.zip
Binary files differ
diff --git a/hostsidetests/holo/assets/17/ldpi.zip b/hostsidetests/holo/assets/17/ldpi.zip
new file mode 100644
index 0000000..5b706fc
--- /dev/null
+++ b/hostsidetests/holo/assets/17/ldpi.zip
Binary files differ
diff --git a/hostsidetests/holo/assets/17/mdpi.zip b/hostsidetests/holo/assets/17/mdpi.zip
new file mode 100644
index 0000000..9390873
--- /dev/null
+++ b/hostsidetests/holo/assets/17/mdpi.zip
Binary files differ
diff --git a/hostsidetests/holo/assets/17/tvdpi.zip b/hostsidetests/holo/assets/17/tvdpi.zip
new file mode 100644
index 0000000..1e2ccc60
--- /dev/null
+++ b/hostsidetests/holo/assets/17/tvdpi.zip
Binary files differ
diff --git a/hostsidetests/holo/assets/17/xhdpi.zip b/hostsidetests/holo/assets/17/xhdpi.zip
new file mode 100644
index 0000000..fdf1ae7
--- /dev/null
+++ b/hostsidetests/holo/assets/17/xhdpi.zip
Binary files differ
diff --git a/hostsidetests/holo/assets/17/xxhdpi.zip b/hostsidetests/holo/assets/17/xxhdpi.zip
new file mode 100644
index 0000000..ab5bc6b
--- /dev/null
+++ b/hostsidetests/holo/assets/17/xxhdpi.zip
Binary files differ
diff --git a/hostsidetests/holo/src/android/holo/cts/ComparisonTask.java b/hostsidetests/holo/src/android/holo/cts/ComparisonTask.java
new file mode 100644
index 0000000..36f3759
--- /dev/null
+++ b/hostsidetests/holo/src/android/holo/cts/ComparisonTask.java
@@ -0,0 +1,150 @@
+/*
+ * 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.
+ */
+
+package android.holo.cts;
+
+import com.android.ddmlib.Log;
+import com.android.ddmlib.Log.LogLevel;
+import com.android.tradefed.device.ITestDevice;
+
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.lang.String;
+import java.util.concurrent.Callable;
+
+import javax.imageio.ImageIO;
+
+/**
+ * Compares the images generated by the device with the reference images.
+ */
+public class ComparisonTask implements Callable<Boolean> {
+
+ private static final String TAG = ComparisonTask.class.getSimpleName();
+
+ private static final String DEVICE_PATH = "/storage/emulated/legacy/cts-holo-assets/%s.png";
+
+ private static final int IMAGE_THRESHOLD = 2;
+
+ private final ITestDevice mDevice;
+
+ private final File mReference;
+
+ private final String mName;
+
+ public ComparisonTask(ITestDevice device, File reference, String name) {
+ mDevice = device;
+ mReference = reference;
+ mName = name;
+ }
+
+ public Boolean call() {
+ boolean success = false;
+ File generated = null;
+ try {
+ generated = File.createTempFile("gen_" + mName, ".png");
+
+ mDevice.pullFile(String.format(DEVICE_PATH, mName), generated);
+
+ final BufferedImage ref = ImageIO.read(mReference);
+ final BufferedImage gen = ImageIO.read(generated);
+ if (compare(ref, gen, IMAGE_THRESHOLD)) {
+ success = true;
+ } else {
+ File diff = File.createTempFile("diff_" + mName, ".png");
+ createDiff(ref, gen, diff);
+ Log.logAndDisplay(LogLevel.INFO, TAG, "Diff created: " + diff.getPath());
+ }
+ } catch (Exception e) {
+ Log.logAndDisplay(LogLevel.ERROR, TAG, e.toString());
+ } finally {
+ if (generated != null) {
+ generated.delete();
+ }
+ }
+ return success;
+ }
+
+ private static boolean compare(BufferedImage reference, BufferedImage generated, int threshold) {
+ final int w = generated.getWidth();
+ final int h = generated.getHeight();
+ if (w != reference.getWidth() || h != reference.getHeight()) {
+ return false;
+ }
+
+ for (int i = 0; i < w; i++) {
+ for (int j = 0; j < h; j++) {
+ final int p1 = reference.getRGB(i, j);
+ final int p2 = generated.getRGB(i, j);
+ final int dr = (p1 & 0x000000FF) - (p2 & 0x000000FF);
+ final int dg = ((p1 & 0x0000FF00) - (p2 & 0x0000FF00)) >> 8;
+ final int db = ((p1 & 0x00FF0000) - (p2 & 0x00FF0000)) >> 16;
+ final int da = ((p1 & 0xFF000000) - (p2 & 0xFF000000)) >> 24;
+
+ if (Math.abs(db) > threshold ||
+ Math.abs(dg) > threshold ||
+ Math.abs(dr) > threshold ||
+ Math.abs(da) > threshold) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ private static void createDiff(BufferedImage image1, BufferedImage image2, File out)
+ throws Exception {
+ final int w1 = image1.getWidth();
+ final int h1 = image1.getHeight();
+ final int w2 = image2.getWidth();
+ final int h2 = image2.getHeight();
+ final int width = Math.max(w1, w2);
+ final int height = Math.max(h1, h2);
+ // The diff will contain image1, image2 and the difference between the two.
+ final BufferedImage diff = new BufferedImage(width * 3, height, BufferedImage.TYPE_INT_ARGB);
+
+ for (int i = 0; i < width; i++) {
+ for (int j = 0; j < height; j++) {
+ final boolean inBounds1 = i < w1 && j < h1;
+ final boolean inBounds2 = i < w2 && j < h2;
+ int color1 = Color.WHITE.getRGB();
+ int color2 = Color.WHITE.getRGB();
+ int color3;
+ if (inBounds1 && inBounds2) {
+ color1 = image1.getRGB(i, j);
+ color2 = image2.getRGB(i, j);
+ color3 = color1 == color2 ? color1 : Color.RED.getRGB();
+ } else if (inBounds1 && !inBounds2) {
+ color1 = image1.getRGB(i, j);
+ color3 = Color.BLUE.getRGB();
+ } else if (!inBounds1 && inBounds2) {
+ color2 = image2.getRGB(i, j);
+ color3 = Color.GREEN.getRGB();
+ } else {
+ color3 = Color.MAGENTA.getRGB();
+ }
+ int x = i;
+ diff.setRGB(x, j, color1);
+ x += width;
+ diff.setRGB(x, j, color2);
+ x += width;
+ diff.setRGB(x, j, color3);
+ }
+ }
+ ImageIO.write(diff, "png", out);
+ }
+
+}
diff --git a/hostsidetests/holo/src/android/holo/cts/HoloHostTest.java b/hostsidetests/holo/src/android/holo/cts/HoloHostTest.java
new file mode 100644
index 0000000..5de3030
--- /dev/null
+++ b/hostsidetests/holo/src/android/holo/cts/HoloHostTest.java
@@ -0,0 +1,274 @@
+/*
+ * 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.
+ */
+
+package android.holo.cts;
+
+import com.android.cts.tradefed.build.CtsBuildHelper;
+import com.android.ddmlib.Log;
+import com.android.ddmlib.Log.LogLevel;
+import com.android.ddmlib.IShellOutputReceiver;
+import com.android.tradefed.build.IBuildInfo;
+import com.android.tradefed.device.ITestDevice;
+import com.android.tradefed.testtype.DeviceTestCase;
+import com.android.tradefed.testtype.IBuildReceiver;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.lang.String;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Scanner;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ExecutorCompletionService;
+import java.util.concurrent.ExecutorService;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+/**
+ * Test to check the Holo theme has not been changed.
+ */
+public class HoloHostTest extends DeviceTestCase implements IBuildReceiver {
+
+ private static final String TAG = HoloHostTest.class.getSimpleName();
+
+ private static final int CAPTURE_TIMEOUT = 1 * 1000;//1sec in ms
+
+ private static final int ADB_TIMEOUT = 10 * 60 * 1000;//10mins in ms
+
+ /** The package name of the APK. */
+ private static final String PACKAGE = "android.holo.app";
+
+ /** The file name of the APK. */
+ private static final String APK = "CtsHoloDeviceApp.apk";
+
+ /** The class name of the main activity in the APK. */
+ private static final String CLASS = "HoloDeviceActivity";
+
+ /** The command to launch the main activity. */
+ private static final String START_CMD = String.format(
+ "am start -W -a android.intent.action.MAIN -n %s/%s.%s", PACKAGE, PACKAGE, CLASS);
+
+ private static final String STOP_CMD = String.format("am force-stop %s", PACKAGE);
+
+ private static final String DENSITY_PROP = "ro.sf.lcd_density";
+
+ // Intent extras
+ protected final static String INTENT_STRING_EXTRA = " --es %s %s";
+
+ protected final static String INTENT_BOOLEAN_EXTRA = " --ez %s %b";
+
+ protected final static String INTENT_INTEGER_EXTRA = " --ei %s %d";
+
+ // Intent extra keys
+ private static final String EXTRA_THEME = "holo_theme_extra";
+
+ private static final String EXTRA_LAYOUT = "holo_layout_extra";
+
+ private static final String EXTRA_TIMEOUT = "holo_timeout_extra";
+
+ private static final String[] THEMES = {
+ "holo",
+ "holo_dialog",
+ "holo_dialog_minwidth",
+ "holo_dialog_noactionbar",
+ "holo_dialog_noactionbar_minwidth",
+ "holo_dialogwhenlarge",
+ "holo_dialogwhenlarge_noactionbar",
+ "holo_inputmethod",
+ "holo_light",
+ "holo_light_darkactionbar",
+ "holo_light_dialog",
+ "holo_light_dialog_minwidth",
+ "holo_light_dialog_noactionbar",
+ "holo_light_dialog_noactionbar_minwidth",
+ "holo_light_dialogwhenlarge",
+ "holo_light_dialogwhenlarge_noactionbar",
+ "holo_light_noactionbar",
+ "holo_light_noactionbar_fullscreen",
+ "holo_light_panel",
+ "holo_noactionbar",
+ "holo_noactionbar_fullscreen",
+ "holo_panel",
+ "holo_wallpaper",
+ "holo_wallpaper_notitlebar"
+ };
+
+ private final int NUM_THEMES = THEMES.length;
+
+ private static final String[] LAYOUTS = {
+ "button",
+ "button_pressed",
+ "checkbox",
+ "checkbox_checked",
+ "chronometer"
+ };
+
+ private final int NUM_LAYOUTS = LAYOUTS.length;
+
+ private final HashMap<String, File> mReferences = new HashMap<String, File>();
+
+ /** A reference to the build. */
+ private CtsBuildHelper mBuild;
+
+ /** A reference to the device under test. */
+ private ITestDevice mDevice;
+
+ private ExecutorService mExecutionService;
+
+ private ExecutorCompletionService<Boolean> mCompletionService;
+
+ @Override
+ public void setBuild(IBuildInfo buildInfo) {
+ // Get the build, this is used to access the APK.
+ mBuild = CtsBuildHelper.createBuildHelper(buildInfo);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ // Get the device, this gives a handle to run commands and install APKs.
+ mDevice = getDevice();
+ // Remove any previously installed versions of this APK.
+ mDevice.uninstallPackage(PACKAGE);
+ // Get the APK from the build.
+ File app = mBuild.getTestApp(APK);
+ // Install the APK on the device.
+ mDevice.installPackage(app, false);
+
+ final String zip = String.format("/%s.zip",
+ getDensityBucket(Integer.parseInt(mDevice.getProperty(DENSITY_PROP))));
+ Log.logAndDisplay(LogLevel.INFO, TAG, "Loading resources from " + zip);
+
+ final ZipInputStream in = new ZipInputStream(this.getClass().getResourceAsStream(zip));
+ try {
+ ZipEntry ze;
+ final byte[] buffer = new byte[1024];
+ while ((ze = in.getNextEntry()) != null) {
+ final String name = ze.getName();
+ final File tmp = File.createTempFile("ref_" + name, ".png");
+ final FileOutputStream out = new FileOutputStream(tmp);
+ int count;
+ while ((count = in.read(buffer)) != -1) {
+ out.write(buffer, 0, count);
+ }
+ out.flush();
+ out.close();
+ mReferences.put(name, tmp);
+ }
+ } finally {
+ in.close();
+ }
+
+ mExecutionService = Executors.newFixedThreadPool(2);// 2 worker threads
+ mCompletionService = new ExecutorCompletionService<Boolean>(mExecutionService);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ // Delete the temp files
+ for (File ref : mReferences.values()) {
+ ref.delete();
+ }
+ mExecutionService.shutdown();
+ super.tearDown();
+ }
+
+ public void testHoloThemes() throws Exception {
+ int numTasks = 0;
+ for (int i = 0; i < NUM_THEMES; i++) {
+ final String themeName = THEMES[i];
+ for (int j = 0; j < NUM_LAYOUTS; j++) {
+ final String name = String.format("%s_%s", themeName, LAYOUTS[j]);
+ if (runCapture(i, j)) {
+ final File ref = mReferences.get(name + ".png");
+ mCompletionService.submit(new ComparisonTask(mDevice, ref, name));
+ numTasks++;
+ } else {
+ Log.logAndDisplay(LogLevel.ERROR, TAG, "Capture failed: " + name);
+ }
+ }
+ }
+ boolean success = true;
+ for (int i = 0; i < numTasks; i++) {
+ success = mCompletionService.take().get() && success;
+ }
+ assertTrue("Failures in Holo test", success);
+ }
+
+ private boolean runCapture(int themeId, int layoutId) throws Exception {
+ final StringBuilder sb = new StringBuilder(START_CMD);
+ sb.append(String.format(INTENT_INTEGER_EXTRA, EXTRA_THEME, themeId));
+ sb.append(String.format(INTENT_INTEGER_EXTRA, EXTRA_LAYOUT, layoutId));
+ sb.append(String.format(INTENT_INTEGER_EXTRA, EXTRA_TIMEOUT, CAPTURE_TIMEOUT));
+ final String startCommand = sb.toString();
+ // Clear logcat
+ mDevice.executeAdbCommand("logcat", "-c");
+ // Stop any existing instances
+ mDevice.executeShellCommand(STOP_CMD);
+ // Start activity
+ mDevice.executeShellCommand(startCommand);
+
+ boolean success = false;
+ boolean waiting = true;
+ while (waiting) {
+ // Dump logcat.
+ final String logs = mDevice.executeAdbCommand("logcat", "-d", CLASS + ":I", "*:S");
+ // Search for string.
+ final Scanner in = new Scanner(logs);
+ while (in.hasNextLine()) {
+ final String line = in.nextLine();
+ if (line.startsWith("I/" + CLASS)) {
+ final String s = line.split(":")[1].trim();
+ if (s.equals("OKAY")) {
+ success = true;
+ waiting = false;
+ } else if (s.equals("ERROR")) {
+ success = false;
+ waiting = false;
+ }
+ }
+ }
+ }
+
+ return success;
+ }
+
+ private static String getDensityBucket(int density) {
+ switch (density) {
+ case 120:
+ return "ldpi";
+ case 160:
+ return "mdpi";
+ case 213:
+ return "tvdpi";
+ case 240:
+ return "hdpi";
+ case 320:
+ return "xhdpi";
+ case 400:
+ return "400dpi";
+ case 480:
+ return "xxhdpi";
+ case 640:
+ return "xxxhdpi";
+ default:
+ return "" + density;
+ }
+ }
+}
diff --git a/hostsidetests/monkey/src/com/android/cts/monkey/AbstractMonkeyTest.java b/hostsidetests/monkey/src/com/android/cts/monkey/AbstractMonkeyTest.java
index 3930ea4..8580a9d 100644
--- a/hostsidetests/monkey/src/com/android/cts/monkey/AbstractMonkeyTest.java
+++ b/hostsidetests/monkey/src/com/android/cts/monkey/AbstractMonkeyTest.java
@@ -17,7 +17,7 @@
/**
* Base monkey command with flags to avoid side effects like airplane mode.
*/
- static final String MONKEY_CMD = "monkey --pct-majornav 0 --pct-syskeys 0 --pct-anyevent 0";
+ static final String MONKEY_CMD = "monkey --pct-touch 0 --pct-motion 0 --pct-majornav 0 --pct-syskeys 0 --pct-anyevent 0";
CtsBuildHelper mBuild;
ITestDevice mDevice;
diff --git a/hostsidetests/monkey/test-apps/CtsMonkeyApp/AndroidManifest.xml b/hostsidetests/monkey/test-apps/CtsMonkeyApp/AndroidManifest.xml
index a3dfc83..849d6a4 100644
--- a/hostsidetests/monkey/test-apps/CtsMonkeyApp/AndroidManifest.xml
+++ b/hostsidetests/monkey/test-apps/CtsMonkeyApp/AndroidManifest.xml
@@ -18,14 +18,14 @@
<application android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
- <activity android:name=".MonkeyActivity">
+ <activity android:name=".MonkeyActivity" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
- <activity android:name=".BaboonActivity">
+ <activity android:name=".BaboonActivity" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.MONKEY" />
diff --git a/tests/accessibilityservice/res/xml/accessibilityservice.xml b/tests/accessibilityservice/res/xml/accessibilityservice.xml
index 395d022..1d3e313 100644
--- a/tests/accessibilityservice/res/xml/accessibilityservice.xml
+++ b/tests/accessibilityservice/res/xml/accessibilityservice.xml
@@ -18,6 +18,6 @@
android:accessibilityFeedbackType="feedbackGeneric"
android:accessibilityFlags="flagDefault"
android:canRetrieveWindowContent="true"
- android:notificationTimeout="50"
+ android:notificationTimeout="0"
android:settingsActivity="android.accessibilityservice.delegate.SomeActivity"
android:description="@string/title_delegating_accessibility_service" />
diff --git a/tests/src/android/view/inputmethod/cts/InputMethodInfoStub.java b/tests/src/android/view/inputmethod/cts/InputMethodSettingsActivityStub.java
similarity index 84%
rename from tests/src/android/view/inputmethod/cts/InputMethodInfoStub.java
rename to tests/src/android/view/inputmethod/cts/InputMethodSettingsActivityStub.java
index 0eeefbe..58aa364 100644
--- a/tests/src/android/view/inputmethod/cts/InputMethodInfoStub.java
+++ b/tests/src/android/view/inputmethod/cts/InputMethodSettingsActivityStub.java
@@ -16,8 +16,8 @@
package android.view.inputmethod.cts;
-import android.inputmethodservice.InputMethodService;
+import android.preference.PreferenceActivity;
-public class InputMethodInfoStub extends InputMethodService {
+public class InputMethodSettingsActivityStub extends PreferenceActivity {
}
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityActivityTestCase.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityActivityTestCase.java
index a5d92ee..affc9ec 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityActivityTestCase.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityActivityTestCase.java
@@ -66,7 +66,7 @@
/**
* The timeout after the last accessibility event to consider the device idle.
*/
- public static final long TIMEOUT_ACCESSIBILITY_STATE_IDLE = 100;
+ public static final long TIMEOUT_ACCESSIBILITY_STATE_IDLE = 200;
/**
* Instance for detecting the next accessibility event.
@@ -130,9 +130,12 @@
public boolean accept(AccessibilityEvent event) {
final int eventType = event.getEventType();
CharSequence packageName = event.getPackageName();
- Context targetContext = getInstrumentation().getTargetContext();
- return (eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
- && targetContext.getPackageName().equals(packageName));
+ // Do not check the package name since an event of this type may
+ // come concurrently from the app and from the IME (since input
+ // focus goes to the first focusable) but we dispatch one event
+ // of each type within a timeout. Hence, sometimes the window
+ // change event from the IME may override the one from the app.
+ return (eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
},
TIMEOUT_ASYNC_PROCESSING);
@@ -520,6 +523,8 @@
mEventQueue.clear();
// Prepare to wait for an event.
mWaitingForEventDelivery = true;
+ // We will ignore events from previous interactions.
+ final long executionStartTimeMillis = SystemClock.uptimeMillis();
// Execute the command.
command.run();
try {
@@ -529,11 +534,16 @@
// Drain the event queue
while (!mEventQueue.isEmpty()) {
AccessibilityEvent event = mEventQueue.remove(0);
+
+ // Ignore events from previous interactions.
+ if (event.getEventTime() < executionStartTimeMillis) {
+ continue;
+ }
if (filter.accept(event)) {
return event;
- } else {
- event.recycle();
}
+
+ event.recycle();
}
// Check if timed out and if not wait.
final long elapsedTimeMillis = SystemClock.uptimeMillis() - startTimeMillis;
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityServiceInfoTest.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityServiceInfoTest.java
index 0f687d0..750460b 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityServiceInfoTest.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityServiceInfoTest.java
@@ -111,7 +111,7 @@
assertSame(AccessibilityEvent.TYPES_ALL_MASK, speakingService.eventTypes);
assertSame(AccessibilityServiceInfo.FEEDBACK_GENERIC, speakingService.feedbackType);
assertSame(AccessibilityServiceInfo.DEFAULT, speakingService.flags);
- assertSame(50l, speakingService.notificationTimeout);
+ assertSame(0l, speakingService.notificationTimeout);
assertEquals("Delegating Accessibility Service", speakingService.getDescription());
assertNull(speakingService.packageNames /*all packages*/);
assertNotNull(speakingService.getId());
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java
index 517b71a..e7f8823 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java
@@ -903,6 +903,261 @@
}
@MediumTest
+ public void testActionNextAndPreviousAtGranularityWordOverEditTextWithContentDescription()
+ throws Exception {
+
+ final EditText editText = (EditText) getActivity().findViewById(R.id.edit);
+
+ getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ editText.setText(getString(R.string.foo_bar_baz));
+ editText.setContentDescription(getString(R.string.android_wiki));
+ }
+ });
+
+ final AccessibilityNodeInfo text = getInteractionBridge()
+ .findAccessibilityNodeInfoByTextFromRoot(getString(R.string.foo_bar_baz));
+
+ final int granularities = text.getMovementGranularities();
+ assertEquals(granularities, AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER
+ | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD
+ | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE
+ | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH
+ | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
+
+ final Bundle arguments = new Bundle();
+ arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT,
+ AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD);
+
+ // Move to the next word and wait for an event.
+ AccessibilityEvent firstExpected = getInteractionBridge()
+ .executeCommandAndWaitForAccessibilityEvent(new Runnable() {
+ @Override
+ public void run() {
+ getInteractionBridge().performAction(text,
+ AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments);
+ }
+ }, new AccessibilityEventFilter() {
+ @Override
+ public boolean accept(AccessibilityEvent event) {
+ return
+ (event.getEventType() ==
+ AccessibilityEvent.TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
+ && event.getAction() ==
+ AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY
+ && event.getPackageName().equals(getActivity().getPackageName())
+ && event.getClassName().equals(EditText.class.getName())
+ && event.getText().size() > 0
+ && event.getText().get(0).toString().equals(getString(R.string.foo_bar_baz))
+ && event.getContentDescription().equals(getString(R.string.android_wiki))
+ && event.getFromIndex() == 0
+ && event.getToIndex() == 3
+ && event.getMovementGranularity() ==
+ AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD);
+ }
+ }, TIMEOUT_ASYNC_PROCESSING);
+
+ // Make sure we got the expected event.
+ assertNotNull(firstExpected);
+
+ // Verify the selection position.
+ assertEquals(3, editText.getSelectionStart());
+ assertEquals(3, editText.getSelectionEnd());
+
+ // Move to the next word and wait for an event.
+ AccessibilityEvent secondExpected = getInteractionBridge()
+ .executeCommandAndWaitForAccessibilityEvent(new Runnable() {
+ @Override
+ public void run() {
+ getInteractionBridge().performAction(text,
+ AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments);
+ }
+ }, new AccessibilityEventFilter() {
+ @Override
+ public boolean accept(AccessibilityEvent event) {
+ return
+ (event.getEventType() ==
+ AccessibilityEvent.TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
+ && event.getAction() ==
+ AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY
+ && event.getPackageName().equals(getActivity().getPackageName())
+ && event.getClassName().equals(EditText.class.getName())
+ && event.getText().size() > 0
+ && event.getText().get(0).toString().equals(getString(R.string.foo_bar_baz))
+ && event.getContentDescription().equals(getString(R.string.android_wiki))
+ && event.getFromIndex() == 4
+ && event.getToIndex() == 7
+ && event.getMovementGranularity() ==
+ AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD);
+ }
+ }, TIMEOUT_ASYNC_PROCESSING);
+
+ // Make sure we got the expected event.
+ assertNotNull(secondExpected);
+
+ // Verify the selection position.
+ assertEquals(7, editText.getSelectionStart());
+ assertEquals(7, editText.getSelectionEnd());
+
+ // Move to the next word and wait for an event.
+ AccessibilityEvent thirdExpected = getInteractionBridge()
+ .executeCommandAndWaitForAccessibilityEvent(new Runnable() {
+ @Override
+ public void run() {
+ getInteractionBridge().performAction(text,
+ AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments);
+ }
+ }, new AccessibilityEventFilter() {
+ @Override
+ public boolean accept(AccessibilityEvent event) {
+ return
+ (event.getEventType() ==
+ AccessibilityEvent.TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
+ && event.getAction() ==
+ AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY
+ && event.getPackageName().equals(getActivity().getPackageName())
+ && event.getClassName().equals(EditText.class.getName())
+ && event.getText().size() > 0
+ && event.getText().get(0).toString().equals(getString(R.string.foo_bar_baz))
+ && event.getContentDescription().equals(getString(R.string.android_wiki))
+ && event.getFromIndex() == 8
+ && event.getToIndex() == 11
+ && event.getMovementGranularity() ==
+ AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD);
+ }
+ }, TIMEOUT_ASYNC_PROCESSING);
+
+ // Make sure we got the expected event.
+ assertNotNull(thirdExpected);
+
+ // Verify the selection position.
+ assertEquals(11, editText.getSelectionStart());
+ assertEquals(11, editText.getSelectionEnd());
+
+ // Make sure there is no next.
+ assertFalse(getInteractionBridge().performAction(text,
+ AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments));
+
+ // Verify the selection position.
+ assertEquals(11, editText.getSelectionStart());
+ assertEquals(11, editText.getSelectionEnd());
+
+ // Move to the next word and wait for an event.
+ AccessibilityEvent fourthExpected = getInteractionBridge()
+ .executeCommandAndWaitForAccessibilityEvent(new Runnable() {
+ @Override
+ public void run() {
+ getInteractionBridge().performAction(text,
+ AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, arguments);
+ }
+ }, new AccessibilityEventFilter() {
+ @Override
+ public boolean accept(AccessibilityEvent event) {
+ return
+ (event.getEventType() ==
+ AccessibilityEvent.TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
+ && event.getAction() ==
+ AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY
+ && event.getPackageName().equals(getActivity().getPackageName())
+ && event.getClassName().equals(EditText.class.getName())
+ && event.getText().size() > 0
+ && event.getText().get(0).toString().equals(getString(R.string.foo_bar_baz))
+ && event.getContentDescription().equals(getString(R.string.android_wiki))
+ && event.getFromIndex() == 8
+ && event.getToIndex() == 11
+ && event.getMovementGranularity() ==
+ AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD);
+ }
+ }, TIMEOUT_ASYNC_PROCESSING);
+
+ // Make sure we got the expected event.
+ assertNotNull(fourthExpected);
+
+ // Verify the selection position.
+ assertEquals(8, editText.getSelectionStart());
+ assertEquals(8, editText.getSelectionEnd());
+
+ // Move to the next word and wait for an event.
+ AccessibilityEvent fifthExpected = getInteractionBridge()
+ .executeCommandAndWaitForAccessibilityEvent(new Runnable() {
+ @Override
+ public void run() {
+ getInteractionBridge().performAction(text,
+ AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, arguments);
+ }
+ }, new AccessibilityEventFilter() {
+ @Override
+ public boolean accept(AccessibilityEvent event) {
+ return
+ (event.getEventType() ==
+ AccessibilityEvent.TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
+ && event.getAction() ==
+ AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY
+ && event.getPackageName().equals(getActivity().getPackageName())
+ && event.getClassName().equals(EditText.class.getName())
+ && event.getText().size() > 0
+ && event.getText().get(0).toString().equals(getString(R.string.foo_bar_baz))
+ && event.getContentDescription().equals(getString(R.string.android_wiki))
+ && event.getFromIndex() == 4
+ && event.getToIndex() == 7
+ && event.getMovementGranularity() ==
+ AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD);
+ }
+ }, TIMEOUT_ASYNC_PROCESSING);
+
+ // Make sure we got the expected event.
+ assertNotNull(fifthExpected);
+
+ // Verify the selection position.
+ assertEquals(4, editText.getSelectionStart());
+ assertEquals(4, editText.getSelectionEnd());
+
+ // Move to the next character and wait for an event.
+ AccessibilityEvent sixthExpected = getInteractionBridge()
+ .executeCommandAndWaitForAccessibilityEvent(new Runnable() {
+ @Override
+ public void run() {
+ getInteractionBridge().performAction(text,
+ AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, arguments);
+ }
+ }, new AccessibilityEventFilter() {
+ @Override
+ public boolean accept(AccessibilityEvent event) {
+ return
+ (event.getEventType() ==
+ AccessibilityEvent.TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
+ && event.getAction() ==
+ AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY
+ && event.getPackageName().equals(getActivity().getPackageName())
+ && event.getClassName().equals(EditText.class.getName())
+ && event.getText().size() > 0
+ && event.getText().get(0).toString().equals(getString(R.string.foo_bar_baz))
+ && event.getContentDescription().equals(getString(R.string.android_wiki))
+ && event.getFromIndex() == 0
+ && event.getToIndex() == 3
+ && event.getMovementGranularity() ==
+ AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD);
+ }
+ }, TIMEOUT_ASYNC_PROCESSING);
+
+ // Make sure we got the expected event.
+ assertNotNull(sixthExpected);
+
+ // Verify the selection position.
+ assertEquals(0, editText.getSelectionStart());
+ assertEquals(0, editText.getSelectionEnd());
+
+ // Make sure there is no previous.
+ assertFalse(getInteractionBridge().performAction(text,
+ AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, arguments));
+
+ // Verify the selection position.
+ assertEquals(0, editText.getSelectionStart());
+ assertEquals(0, editText.getSelectionEnd());
+ }
+
+ @MediumTest
public void testActionNextAndPreviousAtGranularityLineOverText() throws Exception {
final TextView textView = (TextView) getActivity().findViewById(R.id.text);
diff --git a/tests/tests/app/src/android/app/cts/ActivityManagerMemoryClassTest.java b/tests/tests/app/src/android/app/cts/ActivityManagerMemoryClassTest.java
index 1db04ea..622055c 100644
--- a/tests/tests/app/src/android/app/cts/ActivityManagerMemoryClassTest.java
+++ b/tests/tests/app/src/android/app/cts/ActivityManagerMemoryClassTest.java
@@ -90,6 +90,10 @@
expectedMinimumMemory = isXLarge ? 128 : 64;
break;
+ case DisplayMetrics.DENSITY_XXHIGH:
+ expectedMinimumMemory = isXLarge ? 256 : 128;
+ break;
+
default:
throw new IllegalArgumentException("No memory requirement specified "
+ " for screen density " + screenDensity);
diff --git a/tests/tests/dpi/src/android/dpi/cts/AspectRatioTest.java b/tests/tests/dpi/src/android/dpi/cts/AspectRatioTest.java
index 74a9f22..572c3f4 100644
--- a/tests/tests/dpi/src/android/dpi/cts/AspectRatioTest.java
+++ b/tests/tests/dpi/src/android/dpi/cts/AspectRatioTest.java
@@ -40,46 +40,27 @@
}
/**
- * Get all the aspect rations in different orientations. They could be
- * different due to the system bar being different sizes. Test that
- * one of the aspect ratios is within the range.
+ * Get the full screen size directly (including system bar) to calculate
+ * aspect ratio. With this, the screen orientation doesn't affect the aspect
+ * ratio value anymore. Test that the aspect ratio is within the range.
*/
public void testAspectRatio() throws Exception {
- List<Double> aspectRatios = getAllAspectRatios();
- for (double aspectRatio : aspectRatios) {
- if (aspectRatio >= 1.333 && aspectRatio <= 1.86) {
- return;
- }
+ double aspectRatio = getRealAspectRatio(getActivity());
+ if (aspectRatio >= 1.333 && aspectRatio <= 1.86) {
+ return;
}
- fail("Aspect ratios were not between 1.333 and 1.86: " + aspectRatios);
+ fail("Aspect ratio was not between 1.333 and 1.86: " + aspectRatio);
}
- private List<Double> getAllAspectRatios() throws Exception {
- List<Double> aspectRatios = new ArrayList<Double>();
- for (int i = 0; i < ORIENTATIONS.length; i++) {
- Activity activity = startOrientationActivity(ORIENTATIONS[i]);
- aspectRatios.add(getAspectRatio(activity));
- tearDown();
- }
- return aspectRatios;
- }
-
- private double getAspectRatio(Context context) {
+ private double getRealAspectRatio(Context context) {
WindowManager windowManager =
(WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display display = windowManager.getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
- display.getMetrics(metrics);
+ display.getRealMetrics(metrics);
int max = Math.max(metrics.widthPixels, metrics.heightPixels);
int min = Math.min(metrics.widthPixels, metrics.heightPixels);
return (double) max / min;
}
-
- private Activity startOrientationActivity(int orientation) {
- Intent intent = new Intent();
- intent.putExtra(OrientationActivity.EXTRA_ORIENTATION, orientation);
- setActivityIntent(intent);
- return getActivity();
- }
}
diff --git a/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java b/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
index 937d8f8..6f26b6e 100644
--- a/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
+++ b/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
@@ -52,6 +52,7 @@
allowedDensities.add(DisplayMetrics.DENSITY_TV);
allowedDensities.add(DisplayMetrics.DENSITY_HIGH);
allowedDensities.add(DisplayMetrics.DENSITY_XHIGH);
+ allowedDensities.add(DisplayMetrics.DENSITY_XXHIGH);
assertTrue("DisplayMetrics#densityDpi must be one of the DisplayMetrics.DENSITY_* values: "
+ allowedDensities, allowedDensities.contains(metrics.densityDpi));
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_calendar_view.png
index aea9b8d..52959f1 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_calendar_view_feb.png
index 5093067..6a0feb3 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_dialog_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_dialog_calendar_view.png
index c199329..aea9b8d 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_dialog_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_dialog_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_dialog_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_dialog_calendar_view_feb.png
index dea6b40..5093067 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_dialog_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_dialog_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_dialog_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_dialog_minwidth_calendar_view.png
index c199329..aea9b8d 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_dialog_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_dialog_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_dialog_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_dialog_minwidth_calendar_view_feb.png
index dea6b40..5093067 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_dialog_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_dialog_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_calendar_view.png
index aea9b8d..52959f1 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_calendar_view_feb.png
index 5093067..6a0feb3 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_minwidth_calendar_view.png
index aea9b8d..52959f1 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
index 5093067..6a0feb3 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_dialogwhenlarge_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_dialogwhenlarge_calendar_view.png
index aea9b8d..52959f1 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_dialogwhenlarge_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_dialogwhenlarge_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_dialogwhenlarge_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_dialogwhenlarge_calendar_view_feb.png
index 5093067..6a0feb3 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_dialogwhenlarge_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_dialogwhenlarge_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_light_calendar_view.png
index df79dc4..0874ee52 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_light_calendar_view_feb.png
index c4365ae..617dd44 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_darkactionbar_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_light_darkactionbar_calendar_view.png
index df79dc4..0874ee52 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_darkactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_darkactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_darkactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_light_darkactionbar_calendar_view_feb.png
index c4365ae..617dd44 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_darkactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_darkactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_calendar_view.png
index 3935ca1..df79dc4 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_calendar_view_feb.png
index 5a11a6c..c4365ae 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_minwidth_calendar_view.png
index 3935ca1..df79dc4 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_minwidth_calendar_view_feb.png
index 5a11a6c..c4365ae 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_calendar_view.png
index df79dc4..0874ee52 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_calendar_view_feb.png
index c4365ae..617dd44 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
index df79dc4..0874ee52 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
index c4365ae..617dd44 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_dialogwhenlarge_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_light_dialogwhenlarge_calendar_view.png
index df79dc4..0874ee52 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_dialogwhenlarge_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_dialogwhenlarge_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_dialogwhenlarge_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_light_dialogwhenlarge_calendar_view_feb.png
index c4365ae..617dd44 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_dialogwhenlarge_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_dialogwhenlarge_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_noactionbar_fullscreen_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_light_noactionbar_fullscreen_calendar_view.png
index 0874ee52..0c7df4f 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_noactionbar_fullscreen_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_noactionbar_fullscreen_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_noactionbar_fullscreen_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_light_noactionbar_fullscreen_calendar_view_feb.png
index 617dd44..026c73c 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_noactionbar_fullscreen_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_noactionbar_fullscreen_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_panel_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_light_panel_calendar_view.png
index 0874ee52..0c7df4f 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_panel_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_panel_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_light_panel_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_light_panel_calendar_view_feb.png
index 617dd44..026c73c 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_light_panel_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_light_panel_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_noactionbar_fullscreen_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_noactionbar_fullscreen_calendar_view.png
index 52959f1..e790c06 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_noactionbar_fullscreen_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_noactionbar_fullscreen_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_noactionbar_fullscreen_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_noactionbar_fullscreen_calendar_view_feb.png
index 6a0feb3..8899deb 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_noactionbar_fullscreen_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_noactionbar_fullscreen_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_wallpaper_calendar_view.png b/tests/tests/holo/res/drawable-hdpi/holo_wallpaper_calendar_view.png
index aea9b8d..52959f1 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_wallpaper_calendar_view.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_wallpaper_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-hdpi/holo_wallpaper_calendar_view_feb.png b/tests/tests/holo/res/drawable-hdpi/holo_wallpaper_calendar_view_feb.png
index 5093067..6a0feb3 100644
--- a/tests/tests/holo/res/drawable-hdpi/holo_wallpaper_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-hdpi/holo_wallpaper_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_calendar_view.png
index 7149aeb..6d5b173 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_calendar_view_feb.png
index e77a2fb..e9d5de9 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_dialog_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_dialog_calendar_view.png
index 867a1c7..7149aeb 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_dialog_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_dialog_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_dialog_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_dialog_calendar_view_feb.png
index 9ea8c1d..e77a2fb 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_dialog_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_dialog_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_dialog_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_dialog_minwidth_calendar_view.png
index 867a1c7..7149aeb 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_dialog_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_dialog_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_dialog_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_dialog_minwidth_calendar_view_feb.png
index 9ea8c1d..e77a2fb 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_dialog_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_dialog_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_calendar_view.png
index 7149aeb..6d5b173 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_calendar_view_feb.png
index e77a2fb..e9d5de9 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_minwidth_calendar_view.png
index 7149aeb..6d5b173 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
index e77a2fb..e9d5de9 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_dialogwhenlarge_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_dialogwhenlarge_calendar_view.png
index 7149aeb..6d5b173 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_dialogwhenlarge_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_dialogwhenlarge_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_dialogwhenlarge_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_dialogwhenlarge_calendar_view_feb.png
index e77a2fb..e9d5de9 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_dialogwhenlarge_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_dialogwhenlarge_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_light_calendar_view.png
index 20f587c..c8b76c8 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_light_calendar_view_feb.png
index c85dad2..ef2b2d6 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_darkactionbar_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_light_darkactionbar_calendar_view.png
index 20f587c..c8b76c8 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_darkactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_darkactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_darkactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_light_darkactionbar_calendar_view_feb.png
index c85dad2..ef2b2d6 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_darkactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_darkactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_calendar_view.png
index 3d30ded..20f587c 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_calendar_view_feb.png
index 6de8708..c85dad2 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_minwidth_calendar_view.png
index 3d30ded..20f587c 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_minwidth_calendar_view_feb.png
index 6de8708..c85dad2 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_calendar_view.png
index 20f587c..c8b76c8 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_calendar_view_feb.png
index c85dad2..ef2b2d6 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
index 20f587c..c8b76c8 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
index c85dad2..ef2b2d6 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_dialogwhenlarge_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_light_dialogwhenlarge_calendar_view.png
index 20f587c..c8b76c8 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_dialogwhenlarge_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_dialogwhenlarge_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_dialogwhenlarge_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_light_dialogwhenlarge_calendar_view_feb.png
index c85dad2..ef2b2d6 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_dialogwhenlarge_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_dialogwhenlarge_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_noactionbar_fullscreen_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_light_noactionbar_fullscreen_calendar_view.png
index c8b76c8..e8dea77 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_noactionbar_fullscreen_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_noactionbar_fullscreen_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_light_noactionbar_fullscreen_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_light_noactionbar_fullscreen_calendar_view_feb.png
index ef2b2d6..26756a2 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_light_noactionbar_fullscreen_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_light_noactionbar_fullscreen_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_noactionbar_fullscreen_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_noactionbar_fullscreen_calendar_view.png
index 6d5b173..a0e3eef 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_noactionbar_fullscreen_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_noactionbar_fullscreen_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_noactionbar_fullscreen_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_noactionbar_fullscreen_calendar_view_feb.png
index e9d5de9..3231fd6 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_noactionbar_fullscreen_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_noactionbar_fullscreen_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_panel_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_panel_calendar_view.png
index 6d5b173..a0e3eef 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_panel_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_panel_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_panel_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_panel_calendar_view_feb.png
index e9d5de9..3231fd6 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_panel_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_panel_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_wallpaper_calendar_view.png b/tests/tests/holo/res/drawable-ldpi/holo_wallpaper_calendar_view.png
index 7149aeb..6d5b173 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_wallpaper_calendar_view.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_wallpaper_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-ldpi/holo_wallpaper_calendar_view_feb.png b/tests/tests/holo/res/drawable-ldpi/holo_wallpaper_calendar_view_feb.png
index e77a2fb..e9d5de9 100644
--- a/tests/tests/holo/res/drawable-ldpi/holo_wallpaper_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-ldpi/holo_wallpaper_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-mdpi/holo_wallpaper_calendar_view.png b/tests/tests/holo/res/drawable-mdpi/holo_wallpaper_calendar_view.png
index 191128d..ce2791f 100644
--- a/tests/tests/holo/res/drawable-mdpi/holo_wallpaper_calendar_view.png
+++ b/tests/tests/holo/res/drawable-mdpi/holo_wallpaper_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_calendar_view.png
index 0beff09..643b5e0 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_calendar_view_feb.png
index 568bb25..9c505f8 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_minwidth_calendar_view.png
index 0beff09..643b5e0 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_minwidth_calendar_view_feb.png
index 568bb25..9c505f8 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_calendar_view.png
index 643b5e0..5c257cb 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_calendar_view_feb.png
index 9c505f8..f61d7b7 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_minwidth_calendar_view.png
index 643b5e0..5c257cb 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
index 9c505f8..f61d7b7 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_dialogwhenlarge_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_dialogwhenlarge_noactionbar_calendar_view.png
index 643b5e0..5c257cb 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_dialogwhenlarge_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_dialogwhenlarge_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_dialogwhenlarge_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_dialogwhenlarge_noactionbar_calendar_view_feb.png
index 9c505f8..f61d7b7 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_dialogwhenlarge_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_dialogwhenlarge_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_inputmethod_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_inputmethod_calendar_view.png
index 8990fed..dde6d9e 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_inputmethod_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_inputmethod_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_inputmethod_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_inputmethod_calendar_view_feb.png
index 8fd6b84..c57376b 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_inputmethod_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_inputmethod_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_calendar_view.png
index 9b0c1cd..8990fed 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_calendar_view_feb.png
index f95740f..8fd6b84 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_minwidth_calendar_view.png
index 9b0c1cd..8990fed 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_minwidth_calendar_view_feb.png
index f95740f..8fd6b84 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_calendar_view.png
index 8990fed..dde6d9e 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_calendar_view_feb.png
index 8fd6b84..c57376b 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
index 8990fed..dde6d9e 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
index 8fd6b84..c57376b 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view.png
index 8990fed..dde6d9e 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view_feb.png
index 8fd6b84..c57376b 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_noactionbar_calendar_view.png
index 8990fed..dde6d9e 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_noactionbar_calendar_view_feb.png
index 8fd6b84..c57376b 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_light_panel_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_light_panel_calendar_view_feb.png
index 8fd6b84..c57376b 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_light_panel_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_light_panel_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_noactionbar_calendar_view_feb.png
index 9c505f8..f61d7b7 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_wallpaper_notitlebar_calendar_view.png b/tests/tests/holo/res/drawable-tvdpi/holo_wallpaper_notitlebar_calendar_view.png
index 643b5e0..5c257cb 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_wallpaper_notitlebar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_wallpaper_notitlebar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-tvdpi/holo_wallpaper_notitlebar_calendar_view_feb.png b/tests/tests/holo/res/drawable-tvdpi/holo_wallpaper_notitlebar_calendar_view_feb.png
index 9c505f8..f61d7b7 100644
--- a/tests/tests/holo/res/drawable-tvdpi/holo_wallpaper_notitlebar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-tvdpi/holo_wallpaper_notitlebar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_calendar_view.png
index f2918d8..617f66d 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_calendar_view_feb.png
index dfe29b1..5a41e89 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_minwidth_calendar_view.png
index f2918d8..617f66d 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_minwidth_calendar_view_feb.png
index dfe29b1..5a41e89 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_calendar_view.png
index 617f66d..f1a3471 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_calendar_view_feb.png
index 5a41e89..8048081 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_minwidth_calendar_view.png
index 617f66d..f1a3471 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
index 5a41e89..8048081 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_dialog_noactionbar_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_dialogwhenlarge_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_dialogwhenlarge_noactionbar_calendar_view.png
index 617f66d..f1a3471 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_dialogwhenlarge_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_dialogwhenlarge_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_dialogwhenlarge_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_dialogwhenlarge_noactionbar_calendar_view_feb.png
index 5a41e89..8048081 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_dialogwhenlarge_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_dialogwhenlarge_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_inputmethod_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_inputmethod_calendar_view.png
index 6bb8c7b..4a7d2ae 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_inputmethod_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_inputmethod_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_inputmethod_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_inputmethod_calendar_view_feb.png
index 6a32add..02a117c 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_inputmethod_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_inputmethod_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_calendar_view.png
index 78d05e2..6bb8c7b 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_calendar_view_feb.png
index d11f86f..6a32add 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_minwidth_calendar_view.png
index 78d05e2..6bb8c7b 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_minwidth_calendar_view_feb.png
index d11f86f..6a32add 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_calendar_view.png
index 6bb8c7b..4a7d2ae 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_calendar_view_feb.png
index 6a32add..02a117c 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
index 6bb8c7b..4a7d2ae 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_minwidth_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
index 6a32add..02a117c 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialog_noactionbar_minwidth_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view.png
index 6bb8c7b..4a7d2ae 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view_feb.png
index 6a32add..02a117c 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_dialogwhenlarge_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_noactionbar_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_noactionbar_calendar_view.png
index 6bb8c7b..4a7d2ae 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_noactionbar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_noactionbar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_light_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_light_noactionbar_calendar_view_feb.png
index 6a32add..02a117c 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_light_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_light_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_noactionbar_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_noactionbar_calendar_view_feb.png
index 5a41e89..8048081 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_noactionbar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_noactionbar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_wallpaper_notitlebar_calendar_view.png b/tests/tests/holo/res/drawable-xhdpi/holo_wallpaper_notitlebar_calendar_view.png
index 617f66d..f1a3471 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_wallpaper_notitlebar_calendar_view.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_wallpaper_notitlebar_calendar_view.png
Binary files differ
diff --git a/tests/tests/holo/res/drawable-xhdpi/holo_wallpaper_notitlebar_calendar_view_feb.png b/tests/tests/holo/res/drawable-xhdpi/holo_wallpaper_notitlebar_calendar_view_feb.png
index 5a41e89..8048081 100644
--- a/tests/tests/holo/res/drawable-xhdpi/holo_wallpaper_notitlebar_calendar_view_feb.png
+++ b/tests/tests/holo/res/drawable-xhdpi/holo_wallpaper_notitlebar_calendar_view_feb.png
Binary files differ
diff --git a/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java b/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java
index 283f63b..213dc17 100644
--- a/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java
+++ b/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java
@@ -407,6 +407,10 @@
* To pass this CTS test, a connected WiFi link is required.
*/
public void testWifiWatchdog() throws Exception {
+ if (!WifiFeature.isWifiSupported(getContext())) {
+ // skip the test if WiFi is not supported
+ return;
+ }
// Make sure WiFi is enabled
if (!mWifiManager.isWifiEnabled()) {
setWifiEnabled(true);
diff --git a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
index e606f85..fab26b5 100644
--- a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
@@ -538,15 +538,49 @@
}
}
- private static final Set<File> SYS_EXCEPTIONS = new HashSet<File>(
+ // This set contains all exceptions for writable sysfs, if it is a
+ // directory, all files below that directory are included, so be
+ // careful.
+ private static final Set<String> SYS_EXCEPTIONS = new HashSet<String>(
Arrays.asList(
- new File("/sys/kernel/debug/tracing/trace_marker")
+ "/sys/kernel/debug/tracing/trace_marker",
+ "/sys/fs/selinux"
));
+ private static Set <File> getIgnorablesFromPaths(Set <String> paths) {
+
+ Set <File> ignorable = new HashSet <File> ();
+
+ for(String ignore : paths) {
+ File tmp = new File(ignore);
+
+ File[] files = null;
+ if(tmp.isDirectory()) {
+ files = tmp.listFiles(new FileFilter() {
+ @Override public boolean accept(File pathname) {
+ return pathname.isFile();
+ }
+ });
+ }
+ else if(tmp.isFile()){
+ files = new File[1];
+ files [0] = tmp;
+ }
+ else {
+ // Should this be an Exception?
+ continue;
+ }
+ ignorable.addAll(Arrays.asList(files));
+ }
+ return ignorable;
+ }
+
@LargeTest
public void testAllFilesInSysAreNotWritable() throws Exception {
Set<File> writable = getAllWritableFilesInDirAndSubDir(new File("/sys"));
- writable.removeAll(SYS_EXCEPTIONS);
+ Set<File> ignorables = getIgnorablesFromPaths(SYS_EXCEPTIONS);
+
+ writable.removeAll(ignorables);
assertTrue("Found writable: " + writable.toString(),
writable.isEmpty());
}
@@ -664,6 +698,12 @@
getAllInsecureBlockDevicesInDirAndSubdir(File dir) throws Exception {
assertTrue(dir.isDirectory());
Set<File> retval = new HashSet<File>();
+
+ if (isSymbolicLink(dir)) {
+ // don't examine symbolic links.
+ return retval;
+ }
+
File[] subDirectories = dir.listFiles(new FileFilter() {
@Override public boolean accept(File pathname) {
return pathname.isDirectory();
diff --git a/tests/tests/provider/src/android/provider/cts/CalendarTest.java b/tests/tests/provider/src/android/provider/cts/CalendarTest.java
index e460453..cbefa9d 100644
--- a/tests/tests/provider/src/android/provider/cts/CalendarTest.java
+++ b/tests/tests/provider/src/android/provider/cts/CalendarTest.java
@@ -1946,6 +1946,10 @@
assertTrue(eventId >= 0);
return eventValues;
}
+
+ public long getCalendarId() {
+ return mCalendarId;
+ }
}
/**
@@ -1981,7 +1985,8 @@
CalendarContract.Instances.CONTENT_BY_DAY_URI, julianStart + "/" + julianEnd);
// Query the range, sorting by event start time
- Cursor c = mContentResolver.query(uri, null, null, null, Events.DTSTART);
+ Cursor c = mContentResolver.query(uri, null, Instances.CALENDAR_ID + "="
+ + helper.getCalendarId(), null, Events.DTSTART);
// Assert that two events are returned
assertEquals(c.getCount(), 2);
diff --git a/tests/tests/provider/src/android/provider/cts/ContactsContract_DumpFileProviderTest.java b/tests/tests/provider/src/android/provider/cts/ContactsContract_DumpFileProviderTest.java
new file mode 100644
index 0000000..5c5afaa
--- /dev/null
+++ b/tests/tests/provider/src/android/provider/cts/ContactsContract_DumpFileProviderTest.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.provider.cts;
+
+import android.content.ContentResolver;
+import android.net.Uri;
+import android.test.AndroidTestCase;
+
+import java.io.FileNotFoundException;
+
+public class ContactsContract_DumpFileProviderTest extends AndroidTestCase {
+
+ private static final String URI_PREFIX = "content://com.android.contacts.dumpfile/";
+
+ private static final String[] NOT_ALLOWED_FILES = {
+ "not_allowed.txt",
+ "../A-contacts-db.zip", // ".." is not allowed.
+ "/A-contacts-db.zip", // "/" is not allowed
+ "-contacts-db.zip", // no name prefix
+ "asdf-contacts-db.zip"};
+
+ private static final String[] ALLOWED_FILES = {
+ "1234567890abcdefABCDEF-contacts-db.zip",
+ "a-contacts-db.zip",
+ "0-contacts-db.zip",
+ "A-contacts-db.zip",
+ "abcdefabcdefabcdefabcdef-contacts-db.zip"};
+
+ private ContentResolver mResolver;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mResolver = getContext().getContentResolver();
+ }
+
+ public void testOpenFileDescriptor_throwsErrorWithIllegalFileName() {
+ for (String fileName : NOT_ALLOWED_FILES) {
+ Uri uri = Uri.parse(URI_PREFIX + fileName);
+ assertOpenFileDescriptorThrowsError(uri);
+ }
+ }
+
+ public void testOpenFileDescriptor_worksWithValidFileName() {
+ for (String fileName : ALLOWED_FILES) {
+ final Uri uri = Uri.parse(URI_PREFIX + fileName);
+ try {
+ mResolver.openFileDescriptor(uri, "r");
+ } catch (FileNotFoundException e) {
+
+ }
+ }
+ }
+
+ public void testQuery_throwsErrorWithIllegalFileName() {
+ for (String fileName : NOT_ALLOWED_FILES) {
+ final Uri uri = Uri.parse(URI_PREFIX + fileName);
+ assertQueryThrowsError(uri);
+ }
+ }
+
+ public void testQuery_worksWithValidFileName() {
+ for (String fileName : ALLOWED_FILES) {
+ final Uri uri = Uri.parse(URI_PREFIX + fileName);
+ mResolver.query(uri, null, null, null, null);
+ }
+ }
+
+ private void assertQueryThrowsError(Uri uri) {
+ try {
+ mResolver.query(uri, null, null, null, null);
+ } catch (IllegalArgumentException e) {
+ // pass
+ return;
+ }
+
+ fail("IllegalArgumentException expected but not thrown.");
+ }
+
+ private void assertOpenFileDescriptorThrowsError(Uri uri) {
+ try {
+ mResolver.openFileDescriptor(uri, "r");
+ } catch (IllegalArgumentException e) {
+ // pass
+ return;
+ } catch (FileNotFoundException e) {
+
+ }
+
+ fail("IllegalArgumentException expected but not thrown.");
+ }
+}
diff --git a/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java b/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java
index 821bb09..d7c1895 100644
--- a/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java
+++ b/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java
@@ -37,8 +37,8 @@
assertEquals(0, outMetrics.widthPixels);
assertEquals(0, outMetrics.heightPixels);
// according to Android enmulator doc UI -scale confine density should between 0.1 to 3
- assertTrue((0.1 < outMetrics.density) && (outMetrics.density < 3));
- assertTrue((0.1 < outMetrics.scaledDensity) && (outMetrics.scaledDensity < 3));
+ assertTrue((0.1 <= outMetrics.density) && (outMetrics.density <= 3));
+ assertTrue((0.1 <= outMetrics.scaledDensity) && (outMetrics.scaledDensity <= 3));
assertTrue(0 < outMetrics.xdpi);
assertTrue(0 < outMetrics.ydpi);
@@ -49,8 +49,8 @@
assertEquals(display.getHeight(), metrics.heightPixels);
assertEquals(display.getWidth(), metrics.widthPixels);
// according to Android enmulator doc UI -scale confine density should between 0.1 to 3
- assertTrue((0.1 < metrics.density) && (metrics.density < 3));
- assertTrue((0.1 < metrics.scaledDensity) && (metrics.scaledDensity < 3));
+ assertTrue((0.1 <= metrics.density) && (metrics.density <= 3));
+ assertTrue((0.1 <= metrics.scaledDensity) && (metrics.scaledDensity <= 3));
assertTrue(0 < metrics.xdpi);
assertTrue(0 < metrics.ydpi);
}
diff --git a/tests/tests/view/src/android/view/cts/ViewTest.java b/tests/tests/view/src/android/view/cts/ViewTest.java
index 888bb73..0af3f21 100644
--- a/tests/tests/view/src/android/view/cts/ViewTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewTest.java
@@ -247,10 +247,11 @@
Rect rect = new Rect();
final Button button = new Button(mActivity);
final int WRAP_CONTENT = ViewGroup.LayoutParams.WRAP_CONTENT;
+ final int btnHeight = view.getHeight()/3;
runTestOnUiThread(new Runnable() {
public void run() {
mActivity.addContentView(button,
- new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
+ new LinearLayout.LayoutParams(WRAP_CONTENT, btnHeight));
}
});
getInstrumentation().waitForIdleSync();
diff --git a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodInfoTest.java b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodInfoTest.java
index 00a8dea..722c1b3 100644
--- a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodInfoTest.java
+++ b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodInfoTest.java
@@ -16,7 +16,6 @@
package android.view.inputmethod.cts;
-
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -27,6 +26,7 @@
import android.util.Printer;
import android.view.inputmethod.InputMethod;
import android.view.inputmethod.InputMethodInfo;
+import android.view.inputmethod.InputMethodSubtype;
import org.xmlpull.v1.XmlPullParserException;
@@ -40,14 +40,40 @@
private CharSequence mLabel;
private String mSettingsActivity;
+ private int mSubtypeNameResId;
+ private int mSubtypeIconResId;
+ private String mSubtypeLocale;
+ private String mSubtypeMode;
+ private String mSubtypeExtraValue_key;
+ private String mSubtypeExtraValue_value;
+ private String mSubtypeExtraValue;
+ private boolean mSubtypeIsAuxiliary;
+ private boolean mSubtypeOverridesImplicitlyEnabledSubtype;
+ private int mSubtypeId;
+ private InputMethodSubtype mInputMethodSubtype;
+
@Override
protected void setUp() throws Exception {
super.setUp();
mPackageName = mContext.getPackageName();
- mClassName = InputMethodInfoStub.class.getName();
+ mClassName = InputMethodSettingsActivityStub.class.getName();
mLabel = "test";
- mSettingsActivity = "android.view.inputmethod.cts.InputMethodInfoStub";
+ mSettingsActivity = "android.view.inputmethod.cts.InputMethodSettingsActivityStub";
mInputMethodInfo = new InputMethodInfo(mPackageName, mClassName, mLabel, mSettingsActivity);
+
+ mSubtypeNameResId = 0;
+ mSubtypeIconResId = 0;
+ mSubtypeLocale = "en_US";
+ mSubtypeMode = "keyboard";
+ mSubtypeExtraValue_key = "key1";
+ mSubtypeExtraValue_value = "value1";
+ mSubtypeExtraValue = "tag," + mSubtypeExtraValue_key + "=" + mSubtypeExtraValue_value;
+ mSubtypeIsAuxiliary = false;
+ mSubtypeOverridesImplicitlyEnabledSubtype = false;
+ mSubtypeId = 99;
+ mInputMethodSubtype = new InputMethodSubtype(mSubtypeNameResId, mSubtypeIconResId,
+ mSubtypeLocale, mSubtypeMode, mSubtypeExtraValue, mSubtypeIsAuxiliary,
+ mSubtypeOverridesImplicitlyEnabledSubtype, mSubtypeId);
}
public void testInputMethodInfoProperties() throws XmlPullParserException, IOException {
@@ -58,7 +84,7 @@
assertEquals(0, mInputMethodInfo.getIsDefaultResourceId());
Intent intent = new Intent(InputMethod.SERVICE_INTERFACE);
- intent.setClass(mContext, InputMethodInfoStub.class);
+ intent.setClass(mContext, InputMethodSettingsActivityStub.class);
PackageManager pm = mContext.getPackageManager();
List<ResolveInfo> ris = pm.queryIntentServices(intent, PackageManager.GET_META_DATA);
for (int i = 0; i < ris.size(); i++) {
@@ -69,6 +95,22 @@
}
}
+ public void testInputMethodSubtypeProperties() {
+ // TODO: Test InputMethodSubtype.getDisplayName()
+ assertEquals(mSubtypeNameResId, mInputMethodSubtype.getNameResId());
+ assertEquals(mSubtypeIconResId, mInputMethodSubtype.getIconResId());
+ assertEquals(mSubtypeLocale, mInputMethodSubtype.getLocale());
+ assertEquals(mSubtypeMode, mInputMethodSubtype.getMode());
+ assertEquals(mSubtypeExtraValue, mInputMethodSubtype.getExtraValue());
+ assertTrue(mInputMethodSubtype.containsExtraValueKey(mSubtypeExtraValue_key));
+ assertEquals(mSubtypeExtraValue_value,
+ mInputMethodSubtype.getExtraValueOf(mSubtypeExtraValue_key));
+ assertEquals(mSubtypeIsAuxiliary, mInputMethodSubtype.isAuxiliary());
+ assertEquals(mSubtypeOverridesImplicitlyEnabledSubtype,
+ mInputMethodSubtype.overridesImplicitlyEnabledSubtype());
+ assertEquals(mSubtypeId, mInputMethodSubtype.hashCode());
+ }
+
private void assertService(ServiceInfo expected, ServiceInfo actual) {
assertEquals(expected.getIconResource(), actual.getIconResource());
assertEquals(expected.labelRes, actual.labelRes);
@@ -110,19 +152,39 @@
assertEquals(expected.toString(), mInputMethodInfo.loadLabel(pm).toString());
}
- public void testWriteToParcel() {
- Parcel p = Parcel.obtain();
+ public void testInputMethodInfoWriteToParcel() {
+ final Parcel p = Parcel.obtain();
mInputMethodInfo.writeToParcel(p, 0);
p.setDataPosition(0);
- InputMethodInfo inputMethodInfo = InputMethodInfo.CREATOR.createFromParcel(p);
+ final InputMethodInfo imi = InputMethodInfo.CREATOR.createFromParcel(p);
- assertEquals(mInputMethodInfo.getPackageName(), inputMethodInfo.getPackageName());
- assertEquals(mInputMethodInfo.getServiceName(), inputMethodInfo.getServiceName());
- assertEquals(mInputMethodInfo.getSettingsActivity(), inputMethodInfo.getSettingsActivity());
- assertEquals(mInputMethodInfo.getId(), inputMethodInfo.getId());
- assertEquals(mInputMethodInfo.getIsDefaultResourceId(), inputMethodInfo
- .getIsDefaultResourceId());
- assertService(mInputMethodInfo.getServiceInfo(), inputMethodInfo.getServiceInfo());
+ assertEquals(mInputMethodInfo.getPackageName(), imi.getPackageName());
+ assertEquals(mInputMethodInfo.getServiceName(), imi.getServiceName());
+ assertEquals(mInputMethodInfo.getSettingsActivity(), imi.getSettingsActivity());
+ assertEquals(mInputMethodInfo.getId(), imi.getId());
+ assertEquals(mInputMethodInfo.getIsDefaultResourceId(), imi.getIsDefaultResourceId());
+ assertService(mInputMethodInfo.getServiceInfo(), imi.getServiceInfo());
+ }
+
+ public void testInputMethodSubtypeWriteToParcel() {
+ final Parcel p = Parcel.obtain();
+ mInputMethodSubtype.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ final InputMethodSubtype subtype = InputMethodSubtype.CREATOR.createFromParcel(p);
+
+ assertEquals(mInputMethodSubtype.containsExtraValueKey(mSubtypeExtraValue_key),
+ subtype.containsExtraValueKey(mSubtypeExtraValue_key));
+ assertEquals(mInputMethodSubtype.getExtraValue(), subtype.getExtraValue());
+ assertEquals(mInputMethodSubtype.getExtraValueOf(mSubtypeExtraValue_key),
+ subtype.getExtraValueOf(mSubtypeExtraValue_key));
+ assertEquals(mInputMethodSubtype.getIconResId(), subtype.getIconResId());
+ assertEquals(mInputMethodSubtype.getLocale(), subtype.getLocale());
+ assertEquals(mInputMethodSubtype.getMode(), subtype.getMode());
+ assertEquals(mInputMethodSubtype.getNameResId(), subtype.getNameResId());
+ assertEquals(mInputMethodSubtype.hashCode(), subtype.hashCode());
+ assertEquals(mInputMethodSubtype.isAuxiliary(), subtype.isAuxiliary());
+ assertEquals(mInputMethodSubtype.overridesImplicitlyEnabledSubtype(),
+ subtype.overridesImplicitlyEnabledSubtype());
}
class MockPrinter implements Printer {
diff --git a/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java b/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java
index 5de9805..5885315 100644
--- a/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java
+++ b/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java
@@ -787,6 +787,12 @@
* @throws UiObjectNotFoundException
*/
private void openTest(String name) throws UiObjectNotFoundException {
+ try {
+ UiDevice.getInstance().setOrientationNatural();
+ } catch (RemoteException e) {
+ // will catch it in its own test. For now try to put the device
+ // in its natural orientation prior to each test
+ }
UiScrollable listView = new UiScrollable(
new UiSelector().className(android.widget.ListView.class.getName()));
diff --git a/tests/uiautomator/test-apps/CtsUiAutomatorApp/res/layout-land/test5_detail_fragment.xml b/tests/uiautomator/test-apps/CtsUiAutomatorApp/res/layout-land/test5_detail_fragment.xml
new file mode 100644
index 0000000..123ebde
--- /dev/null
+++ b/tests/uiautomator/test-apps/CtsUiAutomatorApp/res/layout-land/test5_detail_fragment.xml
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:contentDescription="@string/test_5_Widgets_collection"
+ android:orientation="horizontal" >
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <CheckBox
+ android:id="@+id/test_5_checkBox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/test5_CheckBox" />
+
+ <Spinner
+ android:id="@+id/test_5_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <ProgressBar
+ android:id="@+id/test_5_progressBar"
+ style="?android:attr/progressBarStyleLarge"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <GridLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:columnCount="3" >
+
+ <ImageButton
+ android:id="@+id/test_5_imageButton"
+ android:layout_column="0"
+ android:layout_gravity="left"
+ android:layout_row="0"
+ android:src="@drawable/ic_launcher" />
+
+ <RatingBar
+ android:id="@+id/test_5_ratingBar"
+ android:layout_column="1"
+ android:layout_columnSpan="2"
+ android:layout_gravity="left|bottom"
+ android:layout_row="0" />
+
+ <Button
+ android:id="@+id/test_5_button2"
+ style="?android:attr/buttonStyleSmall"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="left|bottom"
+ android:enabled="false"
+ android:layout_row="0"
+ android:text="@string/test5_Button_Disabled" />
+
+ <Space
+ android:layout_width="21dp"
+ android:layout_height="1dp"
+ android:layout_column="1"
+ android:layout_row="0" />
+
+ <Space
+ android:layout_width="1dp"
+ android:layout_height="21dp"
+ android:layout_column="0"
+ android:layout_row="0" />
+
+ <Space
+ android:layout_width="221dp"
+ android:layout_height="15dp"
+ android:layout_column="2"
+ android:layout_row="1" />
+
+ <ToggleButton
+ android:id="@+id/test_5_toggleButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_column="2"
+ android:text="@string/test5_ToggleButton" />
+ </GridLayout>
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <SeekBar
+ android:id="@+id/test_5_seekBar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+
+ <Button
+ android:id="@+id/test_5_button1"
+ style="?android:attr/buttonStyleSmall"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:contentDescription="@string/test5_Button_Description"
+ android:text="@string/test5_Button" />
+
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoConstants.java b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoConstants.java
index c06c21e..f251360 100644
--- a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoConstants.java
+++ b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoConstants.java
@@ -23,11 +23,14 @@
*/
public interface DeviceInfoConstants {
+ public static final String OPEN_GL_EXTENSIONS = "openGlExtensions";
public static final String OPEN_GL_COMPRESSED_TEXTURE_FORMATS =
"openGlCompressedTextureFormats";
public static final String SYS_LIBRARIES = "systemlibraries";
public static final String PARTITIONS = "partitions";
public static final String OPEN_GL_ES_VERSION = "openGlEsVersion";
+ public static final String GRAPHICS_VENDOR = "graphicsVendor";
+ public static final String GRAPHICS_RENDERER = "graphicsRenderer";
public static final String PROCESSES = "processes";
public static final String FEATURES = "features";
public static final String PHONE_NUMBER = "subscriberId";
diff --git a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/GLESSurfaceView.java b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/GLESSurfaceView.java
index 0ec11b7..792a5f2 100644
--- a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/GLESSurfaceView.java
+++ b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/GLESSurfaceView.java
@@ -55,17 +55,27 @@
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
String extensions;
+ String vendor;
+ String renderer;
if (mUseGL20) {
extensions = GLES20.glGetString(GLES20.GL_EXTENSIONS);
+ vendor = GLES20.glGetString(GLES20.GL_VENDOR);
+ renderer = GLES20.glGetString(GLES20.GL_RENDERER);
} else {
extensions = gl.glGetString(GL10.GL_EXTENSIONS);
+ vendor = gl.glGetString(GL10.GL_VENDOR);
+ renderer = gl.glGetString(GL10.GL_RENDERER);
}
Log.i(TAG, "extensions : " + extensions);
+ Log.i(TAG, "vendor : " + vendor);
+ Log.i(TAG, "renderer : " + renderer);
Scanner scanner = new Scanner(extensions);
scanner.useDelimiter(" ");
+ StringBuilder extensionsBuilder = new StringBuilder();
StringBuilder builder = new StringBuilder();
while (scanner.hasNext()) {
String ext = scanner.next();
+ extensionsBuilder.append(ext).append(";");
if (ext.contains("texture")) {
if (ext.contains("compression") || ext.contains("compressed")) {
Log.i(TAG, "Compression supported: " + ext);
@@ -78,6 +88,15 @@
DeviceInfoInstrument.addResult(
DeviceInfoConstants.OPEN_GL_COMPRESSED_TEXTURE_FORMATS,
builder.toString());
+ DeviceInfoInstrument.addResult(
+ DeviceInfoConstants.OPEN_GL_EXTENSIONS,
+ extensionsBuilder.toString());
+ DeviceInfoInstrument.addResult(
+ DeviceInfoConstants.GRAPHICS_VENDOR,
+ vendor);
+ DeviceInfoInstrument.addResult(
+ DeviceInfoConstants.GRAPHICS_RENDERER,
+ renderer);
mDone.countDown();
}
@@ -93,4 +112,4 @@
}
}
-}
\ No newline at end of file
+}
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 6674bdf..d9baf81 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 @@
@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 = "4.2_r1";
+ public static final String CTS_BUILD_VERSION = "4.2_r5";
/**
* {@inheritDoc}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/result/DeviceInfoResult.java b/tools/tradefed-host/src/com/android/cts/tradefed/result/DeviceInfoResult.java
index 56b3913..ce228c7 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/result/DeviceInfoResult.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/result/DeviceInfoResult.java
@@ -53,6 +53,10 @@
private static final String OPENGL_TEXTURE_FORMAT_TAG = "TextureFormat";
private static final String OPENGL_TEXTURE_FORMAT_DELIM = ";";
+ private static final String OPENGL_EXTENSIONS_TAG = "OpenGlExtensions";
+ private static final String OPENGL_EXTENSION_TAG = "OpenGlExtension";
+ private static final String OPENGL_EXTENSION_DELIM = ";";
+
private static final String SYSLIB_INFO_TAG = "SystemLibrariesInfo";
private static final String SYSLIB_TAG = "Library";
private static final String SYSLIB_DELIM = ";";
@@ -73,47 +77,50 @@
public void serialize(KXmlSerializer serializer) throws IOException {
serializer.startTag(ns, TAG);
- if (!mMetrics.isEmpty()) {
-
- // Extract metrics that need extra handling, and then dump the remainder into BuildInfo
- Map<String, String> metricsCopy = new HashMap<String, String>(mMetrics);
- serializer.startTag(ns, SCREEN_TAG);
- serializer.attribute(ns, DeviceInfoConstants.RESOLUTION,
- getMetric(metricsCopy, DeviceInfoConstants.RESOLUTION));
- serializer.attribute(ns, DeviceInfoConstants.SCREEN_DENSITY,
- getMetric(metricsCopy, DeviceInfoConstants.SCREEN_DENSITY));
- serializer.attribute(ns, DeviceInfoConstants.SCREEN_DENSITY_BUCKET,
- getMetric(metricsCopy, DeviceInfoConstants.SCREEN_DENSITY_BUCKET));
- serializer.attribute(ns, DeviceInfoConstants.SCREEN_SIZE,
- getMetric(metricsCopy, DeviceInfoConstants.SCREEN_SIZE));
- serializer.endTag(ns, SCREEN_TAG);
-
- serializer.startTag(ns, PHONE_TAG);
- serializer.attribute(ns, DeviceInfoConstants.PHONE_NUMBER,
- getMetric(metricsCopy, DeviceInfoConstants.PHONE_NUMBER));
- serializer.endTag(ns, PHONE_TAG);
-
- String featureData = getMetric(metricsCopy, DeviceInfoConstants.FEATURES);
- String processData = getMetric(metricsCopy, DeviceInfoConstants.PROCESSES);
- String sysLibData = getMetric(metricsCopy, DeviceInfoConstants.SYS_LIBRARIES);
- String textureData = getMetric(metricsCopy,
- DeviceInfoConstants.OPEN_GL_COMPRESSED_TEXTURE_FORMATS);
-
- // dump the remaining metrics without translation
- serializer.startTag(ns, BUILD_TAG);
- for (Map.Entry<String, String> metricEntry : metricsCopy.entrySet()) {
- serializer.attribute(ns, metricEntry.getKey(), metricEntry.getValue());
- }
- serializer.endTag(ns, BUILD_TAG);
-
- serializeFeatureInfo(serializer, featureData);
- serializeProcessInfo(serializer, processData);
- serializeSystemLibrariesInfo(serializer, sysLibData);
- serializeOpenGLCompressedTextureFormatsInfo(serializer, textureData);
- } else {
+ if (mMetrics.isEmpty()) {
// this might be expected, if device info collection was turned off
CLog.d("Could not find device info");
+ serializer.endTag(ns, TAG);
+ return;
}
+
+ // Extract metrics that need extra handling, and then dump the remainder into BuildInfo
+ Map<String, String> metricsCopy = new HashMap<String, String>(mMetrics);
+ serializer.startTag(ns, SCREEN_TAG);
+ serializer.attribute(ns, DeviceInfoConstants.RESOLUTION,
+ getMetric(metricsCopy, DeviceInfoConstants.RESOLUTION));
+ serializer.attribute(ns, DeviceInfoConstants.SCREEN_DENSITY,
+ getMetric(metricsCopy, DeviceInfoConstants.SCREEN_DENSITY));
+ serializer.attribute(ns, DeviceInfoConstants.SCREEN_DENSITY_BUCKET,
+ getMetric(metricsCopy, DeviceInfoConstants.SCREEN_DENSITY_BUCKET));
+ serializer.attribute(ns, DeviceInfoConstants.SCREEN_SIZE,
+ getMetric(metricsCopy, DeviceInfoConstants.SCREEN_SIZE));
+ serializer.endTag(ns, SCREEN_TAG);
+
+ serializer.startTag(ns, PHONE_TAG);
+ serializer.attribute(ns, DeviceInfoConstants.PHONE_NUMBER,
+ getMetric(metricsCopy, DeviceInfoConstants.PHONE_NUMBER));
+ serializer.endTag(ns, PHONE_TAG);
+
+ String featureData = getMetric(metricsCopy, DeviceInfoConstants.FEATURES);
+ String processData = getMetric(metricsCopy, DeviceInfoConstants.PROCESSES);
+ String sysLibData = getMetric(metricsCopy, DeviceInfoConstants.SYS_LIBRARIES);
+ String textureData = getMetric(metricsCopy,
+ DeviceInfoConstants.OPEN_GL_COMPRESSED_TEXTURE_FORMATS);
+ String openGlExtensionData = getMetric(metricsCopy,
+ DeviceInfoConstants.OPEN_GL_EXTENSIONS);
+ // dump the remaining metrics without translation
+ serializer.startTag(ns, BUILD_TAG);
+ for (Map.Entry<String, String> metricEntry : metricsCopy.entrySet()) {
+ serializer.attribute(ns, metricEntry.getKey(), metricEntry.getValue());
+ }
+ serializer.endTag(ns, BUILD_TAG);
+
+ serializeFeatureInfo(serializer, featureData);
+ serializeProcessInfo(serializer, processData);
+ serializeSystemLibrariesInfo(serializer, sysLibData);
+ serializeOpenGLCompressedTextureFormatsInfo(serializer, textureData);
+ serializeOpenGLExtensions(serializer, openGlExtensionData);
serializer.endTag(ns, TAG);
}
@@ -148,6 +155,12 @@
OPENGL_TEXTURE_FORMAT_DELIM, null, formats, "name");
}
+ private void serializeOpenGLExtensions(KXmlSerializer serializer, String extensions)
+ throws IOException {
+ serialize(serializer, OPENGL_EXTENSIONS_TAG, OPENGL_EXTENSION_TAG,
+ OPENGL_EXTENSION_DELIM, null, extensions, "name");
+ }
+
private void serializeSystemLibrariesInfo(KXmlSerializer serializer, String libs)
throws IOException {
serialize(serializer, SYSLIB_INFO_TAG, SYSLIB_TAG, SYSLIB_DELIM, null, libs, "name");