am 93db35d2: am d86b2b73: Merge "Fix for NullPointerException in CTS media test." into eclair
Merge commit '93db35d207dfc43e45bd2388548d432cb85ab81f'
* commit '93db35d207dfc43e45bd2388548d432cb85ab81f':
Fix for NullPointerException in CTS media test.
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index ddc6797..5d858b3 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -85,6 +85,7 @@
<uses-permission android:name="android.permission.READ_USER_DICTIONARY" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.READ_LOGS" />
<!-- content sync tests -->
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
diff --git a/tests/SignatureTest/Android.mk b/tests/SignatureTest/Android.mk
index 39884c8..18c7cea 100644
--- a/tests/SignatureTest/Android.mk
+++ b/tests/SignatureTest/Android.mk
@@ -74,11 +74,17 @@
$(copied_res_stamp): PRIVATE_PATH := $(LOCAL_PATH)
$(copied_res_stamp): PRIVATE_MODULE := $(LOCAL_MODULE)
$(copied_res_stamp): PRIVATE_RES_DIR := $(signature_res_dir)
+$(copied_res_stamp): FAKE_RESOURCE_DIR := $(dir $(fake_resource_check))
+$(copied_res_stamp): FAKE_RESOURCE_CHECK := $(fake_resource_check)
$(copied_res_stamp): $(foreach res,$(static_res_deps),$(LOCAL_PATH)/res/${res}) | $(ACP)
@echo "Copy resources: $(PRIVATE_MODULE)"
@rm -f $@
@rm -rf $(PRIVATE_RES_DIR)
@mkdir -p $(PRIVATE_RES_DIR)
+ @if [ ! -f $(FAKE_RESOURCE_CHECK) ]; \
+ then mkdir -p $(FAKE_RESOURCE_DIR); \
+ touch $(FAKE_RESOURCE_CHECK); \
+ fi
$(hide) $(ACP) -rd $(PRIVATE_PATH)/res/* $(PRIVATE_RES_DIR)/
$(hide) touch $@
diff --git a/tests/assets/alter-footer.zip b/tests/assets/alter-footer.zip
new file mode 100644
index 0000000..f497ec0
--- /dev/null
+++ b/tests/assets/alter-footer.zip
Binary files differ
diff --git a/tests/assets/alter-metadata.zip b/tests/assets/alter-metadata.zip
new file mode 100644
index 0000000..1c71fbc
--- /dev/null
+++ b/tests/assets/alter-metadata.zip
Binary files differ
diff --git a/tests/assets/fake-eocd.zip b/tests/assets/fake-eocd.zip
new file mode 100644
index 0000000..15dc0a9
--- /dev/null
+++ b/tests/assets/fake-eocd.zip
Binary files differ
diff --git a/tests/assets/jarsigned.zip b/tests/assets/jarsigned.zip
new file mode 100644
index 0000000..8b1ef8b
--- /dev/null
+++ b/tests/assets/jarsigned.zip
Binary files differ
diff --git a/tests/assets/otacerts.zip b/tests/assets/otacerts.zip
new file mode 100644
index 0000000..937a128
--- /dev/null
+++ b/tests/assets/otacerts.zip
Binary files differ
diff --git a/tests/assets/otasigned.zip b/tests/assets/otasigned.zip
new file mode 100644
index 0000000..a6bc53e
--- /dev/null
+++ b/tests/assets/otasigned.zip
Binary files differ
diff --git a/tests/assets/random.zip b/tests/assets/random.zip
new file mode 100644
index 0000000..18c0b3b
--- /dev/null
+++ b/tests/assets/random.zip
Binary files differ
diff --git a/tests/assets/unsigned.zip b/tests/assets/unsigned.zip
new file mode 100644
index 0000000..24e3ead
--- /dev/null
+++ b/tests/assets/unsigned.zip
Binary files differ
diff --git a/tests/core/archive/Android.mk b/tests/core/archive/Android.mk
index 3a74941..83cc40b 100644
--- a/tests/core/archive/Android.mk
+++ b/tests/core/archive/Android.mk
@@ -25,7 +25,7 @@
LOCAL_SRC_FILES := $(call all-java-files-under,../../../../dalvik/libcore/archive/src/test/java) \
$(call all-java-files-under,../../../../dalvik/libcore/luni/src/test/java/junit) \
- $(call all-java-files-under,../../../../dalvik/libcore/support/src/test/java/tests/support) \
+ $(call all-java-files-under,../../../../dalvik/libcore/support/src/test/java) \
../../../../dalvik/libcore/luni/src/test/java/tests/TestSuiteFactory.java
LOCAL_PACKAGE_NAME := android.core.tests.archive
diff --git a/tests/core/ctscore.mk b/tests/core/ctscore.mk
index 8ae73d9..f9edaf0 100644
--- a/tests/core/ctscore.mk
+++ b/tests/core/ctscore.mk
@@ -17,7 +17,7 @@
# and when built explicitly put them in the data partition
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner caliper
include $(BUILD_PACKAGE)
diff --git a/tests/core/xml/Android.mk b/tests/core/xml/Android.mk
index 6209841..ba784b9 100644
--- a/tests/core/xml/Android.mk
+++ b/tests/core/xml/Android.mk
@@ -24,6 +24,7 @@
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-java-files-under,../../../../dalvik/libcore/xml/src/test/java) \
+ $(call all-java-files-under,../../../../dalvik/libcore/dom/src/test) \
$(call all-java-files-under,../../../../dalvik/libcore/luni/src/test/java/junit) \
$(call all-java-files-under,../../../../dalvik/libcore/support/src/test/java) \
../../../../dalvik/libcore/luni/src/test/java/tests/TestSuiteFactory.java
diff --git a/tests/res/layout/abslistview_layout.xml b/tests/res/layout/abslistview_layout.xml
index fcbf785..a090ce3 100644
--- a/tests/res/layout/abslistview_layout.xml
+++ b/tests/res/layout/abslistview_layout.xml
@@ -20,7 +20,7 @@
android:layout_height="25px" >
<GridView
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ListView>
diff --git a/tests/res/layout/absolute_layout.xml b/tests/res/layout/absolute_layout.xml
index 767d7d3..6cec61b 100644
--- a/tests/res/layout/absolute_layout.xml
+++ b/tests/res/layout/absolute_layout.xml
@@ -15,13 +15,13 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<AbsoluteLayout
android:id="@+id/absolute_view"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_x="1dip"
android:layout_y="2dip">
diff --git a/tests/res/layout/adapterview_layout.xml b/tests/res/layout/adapterview_layout.xml
index 7c1ab67..e118500 100644
--- a/tests/res/layout/adapterview_layout.xml
+++ b/tests/res/layout/adapterview_layout.xml
@@ -16,6 +16,6 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/adapterview_tv"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content" />
diff --git a/tests/res/layout/alert_dialog_text_entry.xml b/tests/res/layout/alert_dialog_text_entry.xml
index 71f9de3..8b87a5d 100644
--- a/tests/res/layout/alert_dialog_text_entry.xml
+++ b/tests/res/layout/alert_dialog_text_entry.xml
@@ -15,7 +15,7 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
@@ -32,7 +32,7 @@
<EditText
android:id="@+id/username_edit"
android:layout_height="wrap_content"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:scrollHorizontally="true"
@@ -54,7 +54,7 @@
<EditText
android:id="@+id/password_edit"
android:layout_height="wrap_content"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:scrollHorizontally="true"
diff --git a/tests/res/layout/alert_dialog_text_entry_2.xml b/tests/res/layout/alert_dialog_text_entry_2.xml
index cbbed03..848b342 100644
--- a/tests/res/layout/alert_dialog_text_entry_2.xml
+++ b/tests/res/layout/alert_dialog_text_entry_2.xml
@@ -15,7 +15,7 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
@@ -31,7 +31,7 @@
<EditText
android:id="@+id/username_edit"
android:layout_height="wrap_content"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:scrollHorizontally="true"
diff --git a/tests/res/layout/alertdialog_custom_title.xml b/tests/res/layout/alertdialog_custom_title.xml
index 9b29f30..ff36f2a 100644
--- a/tests/res/layout/alertdialog_custom_title.xml
+++ b/tests/res/layout/alertdialog_custom_title.xml
@@ -16,8 +16,8 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/alertdialog_custom_title"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:gravity="center_vertical|center_horizontal"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/hello_world"/>
diff --git a/tests/res/layout/alertdialog_custom_title2.xml b/tests/res/layout/alertdialog_custom_title2.xml
index 0900445..51c154d 100644
--- a/tests/res/layout/alertdialog_custom_title2.xml
+++ b/tests/res/layout/alertdialog_custom_title2.xml
@@ -17,7 +17,7 @@
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/alertdialog_custom_title"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:gravity="center_vertical|center_horizontal"
android:text="@string/hello_android"/>
diff --git a/tests/res/layout/anim_layout.xml b/tests/res/layout/anim_layout.xml
index 75b56f2..b6aa906 100644
--- a/tests/res/layout/anim_layout.xml
+++ b/tests/res/layout/anim_layout.xml
@@ -15,8 +15,8 @@
* limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:id="@+id/anim_window_parent">
<TextView android:id="@+id/anim_window"
diff --git a/tests/res/layout/animation_layout.xml b/tests/res/layout/animation_layout.xml
index 7508eeb..13228d1 100644
--- a/tests/res/layout/animation_layout.xml
+++ b/tests/res/layout/animation_layout.xml
@@ -16,7 +16,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageButton android:id="@+id/scenery"
diff --git a/tests/res/layout/app_activity.xml b/tests/res/layout/app_activity.xml
index 419301f..8b7206f 100644
--- a/tests/res/layout/app_activity.xml
+++ b/tests/res/layout/app_activity.xml
@@ -20,10 +20,10 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="4dip"
android:gravity="center_horizontal"
- android:layout_width="fill_parent" android:layout_height="fill_parent">
+ android:layout_width="match_parent" android:layout_height="match_parent">
<TextView
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingBottom="4dip"
android:text="@string/forwarding"/>
diff --git a/tests/res/layout/app_another.xml b/tests/res/layout/app_another.xml
index cc7bd6c..f4574a2 100644
--- a/tests/res/layout/app_another.xml
+++ b/tests/res/layout/app_another.xml
@@ -20,10 +20,10 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="4dip"
android:gravity="center_horizontal"
- android:layout_width="fill_parent" android:layout_height="fill_parent">
+ android:layout_width="match_parent" android:layout_height="match_parent">
<TextView
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingBottom="4dip"
android:text="@string/forwarding"/>
diff --git a/tests/res/layout/autocompletetextview_layout.xml b/tests/res/layout/autocompletetextview_layout.xml
index 89b74d8..be1d284 100644
--- a/tests/res/layout/autocompletetextview_layout.xml
+++ b/tests/res/layout/autocompletetextview_layout.xml
@@ -16,7 +16,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/autocompletetv_title"
@@ -27,6 +27,6 @@
<AutoCompleteTextView android:id="@+id/autocompletetv_edit"
android:completionThreshold="1"
android:completionHint="@string/tabs_1"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
diff --git a/tests/res/layout/available_intents_layout.xml b/tests/res/layout/available_intents_layout.xml
index 99a5557..5415657 100644
--- a/tests/res/layout/available_intents_layout.xml
+++ b/tests/res/layout/available_intents_layout.xml
@@ -15,7 +15,7 @@
* limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
diff --git a/tests/res/layout/checkbox_layout.xml b/tests/res/layout/checkbox_layout.xml
index f3ae5e8..a1f1718 100644
--- a/tests/res/layout/checkbox_layout.xml
+++ b/tests/res/layout/checkbox_layout.xml
@@ -15,7 +15,7 @@
* limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
diff --git a/tests/res/layout/checkedtextview_layout.xml b/tests/res/layout/checkedtextview_layout.xml
index 75c6d8a..f8085a3 100644
--- a/tests/res/layout/checkedtextview_layout.xml
+++ b/tests/res/layout/checkedtextview_layout.xml
@@ -15,19 +15,19 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView android:id="@+id/checkedtextview_listview"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
</ListView>
<CheckedTextView android:id="@+id/checkedtextview_test"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
</CheckedTextView>
</LinearLayout>
diff --git a/tests/res/layout/chronometer_stub_layout.xml b/tests/res/layout/chronometer_stub_layout.xml
index e9a76b2..487f2f8 100644
--- a/tests/res/layout/chronometer_stub_layout.xml
+++ b/tests/res/layout/chronometer_stub_layout.xml
@@ -16,15 +16,15 @@
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/screen"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
+ android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/chronometer_view_group"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
+ android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical">
<Chronometer
android:id="@+id/test_chronometer"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/chronometer_text"
/>
diff --git a/tests/res/layout/context_layout.xml b/tests/res/layout/context_layout.xml
index 4b964ef..6ec6c76 100644
--- a/tests/res/layout/context_layout.xml
+++ b/tests/res/layout/context_layout.xml
@@ -16,8 +16,8 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<DatePicker
android:id="@+id/contextdatepicker_dp"
android:layout_width="wrap_content"
diff --git a/tests/res/layout/cursoradapter_host.xml b/tests/res/layout/cursoradapter_host.xml
index 9ce9af3..82ac72b 100644
--- a/tests/res/layout/cursoradapter_host.xml
+++ b/tests/res/layout/cursoradapter_host.xml
@@ -16,7 +16,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:id="@+id/cursorAdapter_host">
</LinearLayout>
diff --git a/tests/res/layout/datepicker_layout.xml b/tests/res/layout/datepicker_layout.xml
index 3e532f4..925674c 100644
--- a/tests/res/layout/datepicker_layout.xml
+++ b/tests/res/layout/datepicker_layout.xml
@@ -16,8 +16,8 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<DatePicker
android:id="@+id/datePicker_dp"
android:layout_width="wrap_content"
diff --git a/tests/res/layout/dialerfilter_layout.xml b/tests/res/layout/dialerfilter_layout.xml
index 8d048e6..46edbd7 100644
--- a/tests/res/layout/dialerfilter_layout.xml
+++ b/tests/res/layout/dialerfilter_layout.xml
@@ -16,16 +16,16 @@
<DialerFilter android:id="@+id/dialer_filter"
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<EditText android:id="@android:id/hint"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"/>
<EditText android:id="@android:id/primary"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@android:id/hint"/>
diff --git a/tests/res/layout/dialog_stub_layout.xml b/tests/res/layout/dialog_stub_layout.xml
index af2840b..11b502f 100644
--- a/tests/res/layout/dialog_stub_layout.xml
+++ b/tests/res/layout/dialog_stub_layout.xml
@@ -15,64 +15,64 @@
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/screen"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
+ android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
- android:layout_width="fill_parent" android:layout_height="fill_parent"
+ android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical">
<Button android:id="@+id/dialog_test_button_1"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button1"/>
<Button android:id="@+id/dialog_test_button_2"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button2"/>
<Button android:id="@+id/dialog_test_button_3"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button3"/>
<Button android:id="@+id/dialog_test_button_4"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button4"/>
<Button android:id="@+id/dialog_test_button_5"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button5"/>
<Button android:id="@+id/dialog_test_button_6"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button6"/>
<Button android:id="@+id/dialog_test_button_7"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button7"/>
<Button android:id="@+id/dialog_test_button_8"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button8"/>
<Button android:id="@+id/dialog_test_button_9"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button9"/>
<Button android:id="@+id/dialog_test_button_10"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button10"/>
<Button android:id="@+id/dialog_test_button_11"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button11"/>
<Button android:id="@+id/dialog_test_button_12"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button12"/>
<Button android:id="@+id/dialog_test_button_13"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button13"/>
<Button android:id="@+id/dialog_test_button_14"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button14"/>
<Button android:id="@+id/dialog_test_button_15"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button15"/>
<Button android:id="@+id/dialog_test_button_16"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button16"/>
<Button android:id="@+id/dialog_test_button_17"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button17"/>
<Button android:id="@+id/dialog_test_button_18"
- android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="@string/dialog_stub_dialog_test_button18"/>
</LinearLayout>
</ScrollView>
diff --git a/tests/res/layout/digitalclock_simplelayout.xml b/tests/res/layout/digitalclock_simplelayout.xml
index 23032f4..16f7b45 100644
--- a/tests/res/layout/digitalclock_simplelayout.xml
+++ b/tests/res/layout/digitalclock_simplelayout.xml
@@ -17,6 +17,6 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/digitalclock_root"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
</LinearLayout>
diff --git a/tests/res/layout/edittext_layout.xml b/tests/res/layout/edittext_layout.xml
index db636e9..398d3be 100644
--- a/tests/res/layout/edittext_layout.xml
+++ b/tests/res/layout/edittext_layout.xml
@@ -15,18 +15,18 @@
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
<LinearLayout android:id="@+id/edit_text"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:orientation="vertical">
<EditText android:id="@+id/edittext1"
style="@android:style/Widget.EditText"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_marginTop="10dip"
android:scrollHorizontally="true"
android:capitalize="sentences"
diff --git a/tests/res/layout/expandablelistview_layout.xml b/tests/res/layout/expandablelistview_layout.xml
index 372f5ce..3a3ebb7 100644
--- a/tests/res/layout/expandablelistview_layout.xml
+++ b/tests/res/layout/expandablelistview_layout.xml
@@ -16,7 +16,7 @@
-->
<ExpandableListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/expandablelistview_test"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:drawSelectorOnTop="false" />
diff --git a/tests/res/layout/focus_handling_layout.xml b/tests/res/layout/focus_handling_layout.xml
index 3a7c8b5..84c8e6a 100644
--- a/tests/res/layout/focus_handling_layout.xml
+++ b/tests/res/layout/focus_handling_layout.xml
@@ -16,8 +16,8 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<View
android:id="@+id/view1"
diff --git a/tests/res/layout/framelayout_layout.xml b/tests/res/layout/framelayout_layout.xml
index 2870624..1048d1b 100644
--- a/tests/res/layout/framelayout_layout.xml
+++ b/tests/res/layout/framelayout_layout.xml
@@ -17,8 +17,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/framelayout_container"
android:background="@drawable/red"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_gravity="bottom"
android:orientation="vertical">
diff --git a/tests/res/layout/gallery_test.xml b/tests/res/layout/gallery_test.xml
index 6ceb783..03f0e60 100644
--- a/tests/res/layout/gallery_test.xml
+++ b/tests/res/layout/gallery_test.xml
@@ -16,13 +16,13 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<android.widget.cts.MyGallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gallery_test"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
</android.widget.cts.MyGallery>
</LinearLayout>
diff --git a/tests/res/layout/gridlayout_anim_controller_layout.xml b/tests/res/layout/gridlayout_anim_controller_layout.xml
index fdc1033..4fe4237 100644
--- a/tests/res/layout/gridlayout_anim_controller_layout.xml
+++ b/tests/res/layout/gridlayout_anim_controller_layout.xml
@@ -16,8 +16,8 @@
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridlayout_anim_gridview"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:padding="10dp"
android:verticalSpacing="20dp"
android:horizontalSpacing="20dp"
diff --git a/tests/res/layout/gridview_layout.xml b/tests/res/layout/gridview_layout.xml
index 05e7217..c7774a3 100644
--- a/tests/res/layout/gridview_layout.xml
+++ b/tests/res/layout/gridview_layout.xml
@@ -16,7 +16,7 @@
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
/>
diff --git a/tests/res/layout/imageswitcher_test.xml b/tests/res/layout/imageswitcher_test.xml
index 6e9f7df..496b2ba 100644
--- a/tests/res/layout/imageswitcher_test.xml
+++ b/tests/res/layout/imageswitcher_test.xml
@@ -16,12 +16,12 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<ImageSwitcher android:id="@+id/switcher"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
/>
diff --git a/tests/res/layout/imageview_layout.xml b/tests/res/layout/imageview_layout.xml
index 1840a62..d1e17fa 100644
--- a/tests/res/layout/imageview_layout.xml
+++ b/tests/res/layout/imageview_layout.xml
@@ -19,8 +19,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<ImageView
android:id="@+id/imageview"
diff --git a/tests/res/layout/inflater_layout.xml b/tests/res/layout/inflater_layout.xml
index 5c345ad..cff224e 100644
--- a/tests/res/layout/inflater_layout.xml
+++ b/tests/res/layout/inflater_layout.xml
@@ -15,52 +15,52 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/numeric_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:editable="true"/>
<TextView android:id="@+id/numeric_integer"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="integer"/>
<TextView android:id="@+id/numeric_signed"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="signed"/>
<TextView android:id="@+id/numeric_decimal"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="decimal"/>
<TextView android:id="@+id/numeric_signed_integer"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="signed|integer"/>
<TextView android:id="@+id/numeric_integer_decimal"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="integer|decimal"/>
<TextView android:id="@+id/numeric_signed_decimal"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="signed|decimal"/>
<TextView android:id="@+id/numeric_signed_decimal_integer"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="signed|integer|decimal"/>
<android.view.cts.MockViewStub class="android.view.cts.MockViewStub"
android:id="@+id/autotext_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
diff --git a/tests/res/layout/linearlayout_layout.xml b/tests/res/layout/linearlayout_layout.xml
index 58edcaf..c70937d 100644
--- a/tests/res/layout/linearlayout_layout.xml
+++ b/tests/res/layout/linearlayout_layout.xml
@@ -15,7 +15,7 @@
* limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
diff --git a/tests/res/layout/list_activity_layout.xml b/tests/res/layout/list_activity_layout.xml
index 88b6005..0486cf0 100644
--- a/tests/res/layout/list_activity_layout.xml
+++ b/tests/res/layout/list_activity_layout.xml
@@ -17,6 +17,6 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
diff --git a/tests/res/layout/listview_layout.xml b/tests/res/layout/listview_layout.xml
index bf5e261..ee8b6de 100644
--- a/tests/res/layout/listview_layout.xml
+++ b/tests/res/layout/listview_layout.xml
@@ -16,7 +16,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/headerview1"
@@ -30,7 +30,7 @@
android:text="@string/header_view" />
<ListView android:id="@+id/listview_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/footerview1"
diff --git a/tests/res/layout/local_sample.xml b/tests/res/layout/local_sample.xml
index 992beb7..6f02e78 100644
--- a/tests/res/layout/local_sample.xml
+++ b/tests/res/layout/local_sample.xml
@@ -19,11 +19,11 @@
android:orientation="vertical"
android:padding="4dip"
android:gravity="center_horizontal"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<TextView
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingBottom="4dip"
diff --git a/tests/res/layout/mediacontroller_layout.xml b/tests/res/layout/mediacontroller_layout.xml
index 7a4ddd6..871adf4 100644
--- a/tests/res/layout/mediacontroller_layout.xml
+++ b/tests/res/layout/mediacontroller_layout.xml
@@ -16,8 +16,8 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<VideoView
android:id="@+id/mediacontroller_videoview"
diff --git a/tests/res/layout/mediaplayer.xml b/tests/res/layout/mediaplayer.xml
index 8d7160c..31ef492 100644
--- a/tests/res/layout/mediaplayer.xml
+++ b/tests/res/layout/mediaplayer.xml
@@ -16,8 +16,8 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<SurfaceView android:id="@+id/surface"
android:layout_width="wrap_content"
diff --git a/tests/res/layout/multi_auto_complete_text_view_layout.xml b/tests/res/layout/multi_auto_complete_text_view_layout.xml
index 38ef783..50109c8 100644
--- a/tests/res/layout/multi_auto_complete_text_view_layout.xml
+++ b/tests/res/layout/multi_auto_complete_text_view_layout.xml
@@ -16,7 +16,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
@@ -25,7 +25,7 @@
android:text="@string/text_country" />
<MultiAutoCompleteTextView android:id="@+id/country_edit"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
@@ -34,7 +34,7 @@
android:text="@string/text_name" />
<MultiAutoCompleteTextView android:id="@+id/name_edit"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
diff --git a/tests/res/layout/popupwindow.xml b/tests/res/layout/popupwindow.xml
index c3e02cb..c9cefdf 100644
--- a/tests/res/layout/popupwindow.xml
+++ b/tests/res/layout/popupwindow.xml
@@ -15,29 +15,29 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:orientation="vertical">
<TextView android:id="@+id/anchor_upper"
android:layout_width="wrap_content"
- android:layout_height="fill_parent"
+ android:layout_height="match_parent"
android:text="@string/text_view_hint"
android:layout_weight="1"/>
- <LinearLayout android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ <LinearLayout android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_weight="1">
<TextView android:id="@+id/anchor_middle_left"
android:layout_width="wrap_content"
- android:layout_height="fill_parent"
+ android:layout_height="match_parent"
android:text="@string/text_view_hint"
android:layout_weight="1"/>
<TextView android:id="@+id/anchor_middle_right"
android:layout_width="wrap_content"
- android:layout_height="fill_parent"
+ android:layout_height="match_parent"
android:text="@string/text_view_hint"
android:layout_weight="1"/>
@@ -45,7 +45,7 @@
<TextView android:id="@+id/anchor_lower"
android:layout_width="wrap_content"
- android:layout_height="fill_parent"
+ android:layout_height="match_parent"
android:text="@string/text_view_hint"
android:layout_weight="1"/>
diff --git a/tests/res/layout/radiogroup.xml b/tests/res/layout/radiogroup.xml
index b526a83..7f55387 100644
--- a/tests/res/layout/radiogroup.xml
+++ b/tests/res/layout/radiogroup.xml
@@ -15,8 +15,8 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:orientation="vertical">
<RadioGroup android:id="@+id/radioGroup_checkedButton_default"
diff --git a/tests/res/layout/radiogroup_1.xml b/tests/res/layout/radiogroup_1.xml
index 88c485d..1e9db83 100644
--- a/tests/res/layout/radiogroup_1.xml
+++ b/tests/res/layout/radiogroup_1.xml
@@ -15,8 +15,8 @@
-->
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.5"
android:layout_gravity="bottom"
diff --git a/tests/res/layout/ratingbar_layout.xml b/tests/res/layout/ratingbar_layout.xml
index 50c192b..acc7fa8 100644
--- a/tests/res/layout/ratingbar_layout.xml
+++ b/tests/res/layout/ratingbar_layout.xml
@@ -15,8 +15,8 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:orientation="vertical">
<RatingBar android:id="@+id/ratingbar_constructor"
diff --git a/tests/res/layout/relative_layout.xml b/tests/res/layout/relative_layout.xml
index b67fc0c..669e86e 100644
--- a/tests/res/layout/relative_layout.xml
+++ b/tests/res/layout/relative_layout.xml
@@ -15,14 +15,14 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/relative_sublayout_attrs"
android:background="@drawable/blue"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<!-- view1, centered within its parent. -->
<TextView
@@ -114,8 +114,8 @@
<RelativeLayout
android:id="@+id/relative_sublayout_gravity"
android:background="@drawable/yellow"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<!-- view10 -->
<TextView
@@ -136,8 +136,8 @@
<RelativeLayout
android:id="@+id/relative_sublayout_ignore_gravity"
android:background="@drawable/red"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:ignoreGravity="@+id/relative_view12"
android:gravity="right">
@@ -158,8 +158,8 @@
<Spinner
android:id="@+id/spinner1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:prompt="@string/text_view_hello"/>
</RelativeLayout>
diff --git a/tests/res/layout/remote_view_test_bad_1.xml b/tests/res/layout/remote_view_test_bad_1.xml
index fb1690e..a65a5ec 100644
--- a/tests/res/layout/remote_view_test_bad_1.xml
+++ b/tests/res/layout/remote_view_test_bad_1.xml
@@ -21,8 +21,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linear"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<EditText android:id="@+id/edit"
android:layout_width="wrap_content"
diff --git a/tests/res/layout/remote_view_test_bad_2.xml b/tests/res/layout/remote_view_test_bad_2.xml
index f55992b..92623d8 100644
--- a/tests/res/layout/remote_view_test_bad_2.xml
+++ b/tests/res/layout/remote_view_test_bad_2.xml
@@ -21,8 +21,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linear"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<WebView android:id="@+id/web"
android:layout_width="wrap_content"
diff --git a/tests/res/layout/remote_view_test_good.xml b/tests/res/layout/remote_view_test_good.xml
index fd752ea..3df9d62 100644
--- a/tests/res/layout/remote_view_test_good.xml
+++ b/tests/res/layout/remote_view_test_good.xml
@@ -21,8 +21,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linear"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
diff --git a/tests/res/layout/remoteviews_good.xml b/tests/res/layout/remoteviews_good.xml
index beade9c..8fdbc64 100644
--- a/tests/res/layout/remoteviews_good.xml
+++ b/tests/res/layout/remoteviews_good.xml
@@ -17,8 +17,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/remoteViews_good"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout android:id="@+id/remoteView_linear"
android:layout_width="10dip"
diff --git a/tests/res/layout/remoteviews_host.xml b/tests/res/layout/remoteviews_host.xml
index 340a091..ace5903 100644
--- a/tests/res/layout/remoteviews_host.xml
+++ b/tests/res/layout/remoteviews_host.xml
@@ -16,7 +16,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:id="@+id/remoteView_host">
</LinearLayout>
diff --git a/tests/res/layout/seekbar.xml b/tests/res/layout/seekbar.xml
index 7ab4a56..c6f5246 100644
--- a/tests/res/layout/seekbar.xml
+++ b/tests/res/layout/seekbar.xml
@@ -15,11 +15,11 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<SeekBar android:id="@+id/seekBar"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="100"
android:progress="50"
diff --git a/tests/res/layout/simple_dropdown_item_1line.xml b/tests/res/layout/simple_dropdown_item_1line.xml
index 3fdeeb7..9a044b1 100644
--- a/tests/res/layout/simple_dropdown_item_1line.xml
+++ b/tests/res/layout/simple_dropdown_item_1line.xml
@@ -19,5 +19,5 @@
style="?android:attr/dropDownItemStyle"
android:textAppearance="?android:attr/textAppearanceLargeInverse"
android:singleLine="true"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight" />
diff --git a/tests/res/layout/simple_spinner_item.xml b/tests/res/layout/simple_spinner_item.xml
index af4cd04..247bffa 100644
--- a/tests/res/layout/simple_spinner_item.xml
+++ b/tests/res/layout/simple_spinner_item.xml
@@ -17,5 +17,5 @@
android:id="@android:id/text1"
style="?android:attr/spinnerItemStyle"
android:singleLine="true"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content" />
diff --git a/tests/res/layout/sliding_drawer_layout.xml b/tests/res/layout/sliding_drawer_layout.xml
index df70c92..3f84d46 100644
--- a/tests/res/layout/sliding_drawer_layout.xml
+++ b/tests/res/layout/sliding_drawer_layout.xml
@@ -15,13 +15,13 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<SlidingDrawer
android:id="@+id/drawer"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:animateOnClick="false"
android:handle="@+id/handle"
@@ -36,8 +36,8 @@
<TextView
android:id="@id/content"
android:background="#FF0000FF"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:text="@string/hello_world" />
</SlidingDrawer>
diff --git a/tests/res/layout/surface_view.xml b/tests/res/layout/surface_view.xml
index 3162b18..f410544 100644
--- a/tests/res/layout/surface_view.xml
+++ b/tests/res/layout/surface_view.xml
@@ -16,8 +16,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<SurfaceView
android:id="@+id/surface_view"
diff --git a/tests/res/layout/tabhost_layout.xml b/tests/res/layout/tabhost_layout.xml
index 23bc336..1bae57a 100644
--- a/tests/res/layout/tabhost_layout.xml
+++ b/tests/res/layout/tabhost_layout.xml
@@ -20,7 +20,7 @@
android:layout_height="wrap_content">
<TabWidget android:id="@android:id/tabs"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="68dip"
android:paddingLeft="1dip"
android:paddingRight="1dip"
@@ -28,7 +28,7 @@
/>
<FrameLayout android:id="@android:id/tabcontent"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1">
diff --git a/tests/res/layout/table_layout_1.xml b/tests/res/layout/table_layout_1.xml
index b56d2db..0896cd2 100644
--- a/tests/res/layout/table_layout_1.xml
+++ b/tests/res/layout/table_layout_1.xml
@@ -16,8 +16,8 @@
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/table1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:collapseColumns="0"
android:stretchColumns="2">
diff --git a/tests/res/layout/table_layout_2.xml b/tests/res/layout/table_layout_2.xml
index b334a9f..84750fc 100644
--- a/tests/res/layout/table_layout_2.xml
+++ b/tests/res/layout/table_layout_2.xml
@@ -16,8 +16,8 @@
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/table2"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:shrinkColumns="1">
<TableRow>
diff --git a/tests/res/layout/textview_autolink.xml b/tests/res/layout/textview_autolink.xml
index b0ca396..53d89f3 100644
--- a/tests/res/layout/textview_autolink.xml
+++ b/tests/res/layout/textview_autolink.xml
@@ -15,7 +15,7 @@
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/autolink_default"
diff --git a/tests/res/layout/textview_autotext.xml b/tests/res/layout/textview_autotext.xml
index 6f95a6f..9a1e9ef 100644
--- a/tests/res/layout/textview_autotext.xml
+++ b/tests/res/layout/textview_autotext.xml
@@ -15,20 +15,20 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/autotext_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/autotext_false"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoText="false"/>
<TextView android:id="@+id/autotext_true"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoText="true"/>
diff --git a/tests/res/layout/textview_buffertype.xml b/tests/res/layout/textview_buffertype.xml
index 6462fd2..33b0d20 100644
--- a/tests/res/layout/textview_buffertype.xml
+++ b/tests/res/layout/textview_buffertype.xml
@@ -15,25 +15,25 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/buffertype_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/buffertype_normal"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:bufferType="normal"/>
<TextView android:id="@+id/buffertype_spannable"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:bufferType="spannable"/>
<TextView android:id="@+id/buffertype_editable"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:bufferType="editable"/>
diff --git a/tests/res/layout/textview_capitalize.xml b/tests/res/layout/textview_capitalize.xml
index 057da8c..4b80ce0 100644
--- a/tests/res/layout/textview_capitalize.xml
+++ b/tests/res/layout/textview_capitalize.xml
@@ -15,31 +15,31 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/capitalize_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:editable="true"/>
<TextView android:id="@+id/capitalize_none"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:capitalize="none"/>
<TextView android:id="@+id/capitalize_sentences"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:capitalize="sentences"/>
<TextView android:id="@+id/capitalize_words"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:capitalize="words"/>
<TextView android:id="@+id/capitalize_characters"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:capitalize="characters"/>
diff --git a/tests/res/layout/textview_content.xml b/tests/res/layout/textview_content.xml
index 8ab916d..189f812 100644
--- a/tests/res/layout/textview_content.xml
+++ b/tests/res/layout/textview_content.xml
@@ -15,15 +15,15 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/text_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/text_resid"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/text_view_hello"/>
diff --git a/tests/res/layout/textview_digits.xml b/tests/res/layout/textview_digits.xml
index 4356034..2a0d470 100644
--- a/tests/res/layout/textview_digits.xml
+++ b/tests/res/layout/textview_digits.xml
@@ -15,21 +15,21 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/digits_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:editable="true"/>
<TextView android:id="@+id/digits_hex"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="0123456789ABCDEFabcdef.-"/>
<TextView android:id="@+id/digits_blank"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits=""/>
diff --git a/tests/res/layout/textview_ellipsize.xml b/tests/res/layout/textview_ellipsize.xml
index 0f9297f..0fc5779 100644
--- a/tests/res/layout/textview_ellipsize.xml
+++ b/tests/res/layout/textview_ellipsize.xml
@@ -15,30 +15,30 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/ellipsize_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/ellipsize_none"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="none"/>
<TextView android:id="@+id/ellipsize_start"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="start"/>
<TextView android:id="@+id/ellipsize_middle"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="middle"/>
<TextView android:id="@+id/ellipsize_end"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"/>
diff --git a/tests/res/layout/textview_ems.xml b/tests/res/layout/textview_ems.xml
index 3cacbf8..a169cb0 100644
--- a/tests/res/layout/textview_ems.xml
+++ b/tests/res/layout/textview_ems.xml
@@ -15,7 +15,7 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/ems_default"
diff --git a/tests/res/layout/textview_gravity.xml b/tests/res/layout/textview_gravity.xml
index 05d97b2..a4a7592 100644
--- a/tests/res/layout/textview_gravity.xml
+++ b/tests/res/layout/textview_gravity.xml
@@ -15,35 +15,35 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/gravity_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/gravity_bottom"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"/>
<TextView android:id="@+id/gravity_right"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"/>
<TextView android:id="@+id/gravity_fill"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="fill"/>
<TextView android:id="@+id/gravity_center"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"/>
<TextView android:id="@+id/gravity_center_vertical_right"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|right"/>
diff --git a/tests/res/layout/textview_hint_linksclickable_freezestext.xml b/tests/res/layout/textview_hint_linksclickable_freezestext.xml
index ac668af..a22e429 100644
--- a/tests/res/layout/textview_hint_linksclickable_freezestext.xml
+++ b/tests/res/layout/textview_hint_linksclickable_freezestext.xml
@@ -15,45 +15,45 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/hint_linksClickable_freezesText_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/hint_blank"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint=""/>
<TextView android:id="@+id/hint_string"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_view_simple_hint"/>
<TextView android:id="@+id/hint_resid"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_view_hint"/>
<TextView android:id="@+id/linksClickable_true"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:linksClickable="true"/>
<TextView android:id="@+id/linksClickable_false"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:linksClickable="false"/>
<TextView android:id="@+id/freezesText_true"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:freezesText="true"/>
<TextView android:id="@+id/freezesText_false"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:freezesText="false"/>
diff --git a/tests/res/layout/textview_inputmethod_blank.xml b/tests/res/layout/textview_inputmethod_blank.xml
index 74cfbfe..4420611 100644
--- a/tests/res/layout/textview_inputmethod_blank.xml
+++ b/tests/res/layout/textview_inputmethod_blank.xml
@@ -15,10 +15,10 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
- <TextView android:layout_width="fill_parent"
+ <TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputMethod=""/>
diff --git a/tests/res/layout/textview_inputmethod_builtin.xml b/tests/res/layout/textview_inputmethod_builtin.xml
index 63c3ca4..e09a0ea 100644
--- a/tests/res/layout/textview_inputmethod_builtin.xml
+++ b/tests/res/layout/textview_inputmethod_builtin.xml
@@ -15,16 +15,16 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/inputMethod_builtIn_digits"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputMethod="android.text.method.DigitsKeyListener"/>
<TextView android:id="@+id/inputMethod_builtIn_datetime"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputMethod="android.text.method.DateTimeKeyListener"/>
diff --git a/tests/res/layout/textview_inputmethod_notexist.xml b/tests/res/layout/textview_inputmethod_notexist.xml
index bf21171..9030b62 100644
--- a/tests/res/layout/textview_inputmethod_notexist.xml
+++ b/tests/res/layout/textview_inputmethod_notexist.xml
@@ -15,10 +15,10 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
- <TextView android:layout_width="fill_parent"
+ <TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputMethod="android.text.method.NotExistKeyListener"/>
diff --git a/tests/res/layout/textview_layout.xml b/tests/res/layout/textview_layout.xml
index bba88db..5689bc5 100644
--- a/tests/res/layout/textview_layout.xml
+++ b/tests/res/layout/textview_layout.xml
@@ -16,8 +16,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<TextView android:id="@+id/textview_textAttr"
android:text="@string/text_view_hello"
diff --git a/tests/res/layout/textview_numeric.xml b/tests/res/layout/textview_numeric.xml
index 4d33139..e60cb26 100644
--- a/tests/res/layout/textview_numeric.xml
+++ b/tests/res/layout/textview_numeric.xml
@@ -15,46 +15,46 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/numeric_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:editable="true"/>
<TextView android:id="@+id/numeric_integer"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="integer"/>
<TextView android:id="@+id/numeric_signed"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="signed"/>
<TextView android:id="@+id/numeric_decimal"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="decimal"/>
<TextView android:id="@+id/numeric_signed_integer"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="signed|integer"/>
<TextView android:id="@+id/numeric_integer_decimal"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="integer|decimal"/>
<TextView android:id="@+id/numeric_signed_decimal"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="signed|decimal"/>
<TextView android:id="@+id/numeric_signed_decimal_integer"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numeric="signed|integer|decimal"/>
diff --git a/tests/res/layout/textview_phonenumber.xml b/tests/res/layout/textview_phonenumber.xml
index 7df42c8..d0975c6 100644
--- a/tests/res/layout/textview_phonenumber.xml
+++ b/tests/res/layout/textview_phonenumber.xml
@@ -15,21 +15,21 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/phoneNumber_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:editable="true"/>
<TextView android:id="@+id/phoneNumber_true"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:phoneNumber="true"/>
<TextView android:id="@+id/phoneNumber_false"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:phoneNumber="false"
android:editable="true"/>
diff --git a/tests/res/layout/textview_selectallonfocus.xml b/tests/res/layout/textview_selectallonfocus.xml
index 2b2084c..b1c3682 100644
--- a/tests/res/layout/textview_selectallonfocus.xml
+++ b/tests/res/layout/textview_selectallonfocus.xml
@@ -15,28 +15,28 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/selectAllOnFocus_default"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"/>
<TextView android:id="@+id/selectAllOnFocus_true"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:selectAllOnFocus="true"
android:focusable="true"/>
<TextView android:id="@+id/selectAllOnFocus_false"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:selectAllOnFocus="false"
android:focusable="true"/>
<TextView android:id="@+id/selectAllOnFocus_dummy"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"/>
diff --git a/tests/res/layout/togglebutton_layout.xml b/tests/res/layout/togglebutton_layout.xml
index 277b1f3..bb8a07d 100644
--- a/tests/res/layout/togglebutton_layout.xml
+++ b/tests/res/layout/togglebutton_layout.xml
@@ -17,12 +17,12 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<ToggleButton android:id="@+id/toggle1"
diff --git a/tests/res/layout/twolinelistitem.xml b/tests/res/layout/twolinelistitem.xml
index 1f71e40..ec256c1 100644
--- a/tests/res/layout/twolinelistitem.xml
+++ b/tests/res/layout/twolinelistitem.xml
@@ -15,7 +15,7 @@
-->
<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/twoLineListItem">
diff --git a/tests/res/layout/urlspan_layout.xml b/tests/res/layout/urlspan_layout.xml
index ed99487..2ca95ac 100644
--- a/tests/res/layout/urlspan_layout.xml
+++ b/tests/res/layout/urlspan_layout.xml
@@ -15,7 +15,7 @@
* limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
diff --git a/tests/res/layout/using_views_layout.xml b/tests/res/layout/using_views_layout.xml
index a06b72d..b35aa08 100644
--- a/tests/res/layout/using_views_layout.xml
+++ b/tests/res/layout/using_views_layout.xml
@@ -16,18 +16,18 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<TextView
android:id="@+id/country"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/country"/>
<EditText
android:id="@+id/entry"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_below="@id/country"/>
@@ -51,21 +51,21 @@
<TextView
android:id="@+id/symbol"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ok"
android:text="@string/symbol"/>
<TextView
android:id="@+id/symbolball"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/symbol"
android:layout_marginLeft="20dip"/>
<TextView
android:id="@+id/warning"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#aa0000"
android:layout_below="@id/symbolball"
diff --git a/tests/res/layout/videoview_layout.xml b/tests/res/layout/videoview_layout.xml
index e68a419..9b042cb 100644
--- a/tests/res/layout/videoview_layout.xml
+++ b/tests/res/layout/videoview_layout.xml
@@ -16,8 +16,8 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<VideoView
android:id="@+id/videoview"
diff --git a/tests/res/layout/view_layout.xml b/tests/res/layout/view_layout.xml
index 727b497..f63e03c 100644
--- a/tests/res/layout/view_layout.xml
+++ b/tests/res/layout/view_layout.xml
@@ -20,8 +20,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/viewlayout_root"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<android.view.cts.MockView
android:id="@+id/mock_view"
diff --git a/tests/res/layout/view_layout_position.xml b/tests/res/layout/view_layout_position.xml
index 654a681..bf4c84e 100644
--- a/tests/res/layout/view_layout_position.xml
+++ b/tests/res/layout/view_layout_position.xml
@@ -19,8 +19,8 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
android:id="@+id/testparent"
@@ -29,8 +29,8 @@
android:layout_marginRight = "3dip"
android:layout_marginBottom = "4dip"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<View
android:id="@+id/testview"
@@ -38,8 +38,8 @@
android:layout_marginTop = "6dip"
android:layout_marginRight = "7dip"
android:layout_marginBottom = "8dip"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"/>
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
</LinearLayout>
</LinearLayout>
diff --git a/tests/res/layout/view_visibility_layout.xml b/tests/res/layout/view_visibility_layout.xml
index e4ca919..92d22ed 100644
--- a/tests/res/layout/view_visibility_layout.xml
+++ b/tests/res/layout/view_visibility_layout.xml
@@ -16,25 +16,25 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:orientation="vertical">
<View
android:id="@+id/textview1"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"/>
<View
android:id="@+id/textview2"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"/>
<View
android:id="@+id/textview3"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"/>
</LinearLayout>
diff --git a/tests/res/layout/viewanimator_layout.xml b/tests/res/layout/viewanimator_layout.xml
index a69dc9f..96b2483 100644
--- a/tests/res/layout/viewanimator_layout.xml
+++ b/tests/res/layout/viewanimator_layout.xml
@@ -17,20 +17,20 @@
<!-- Demonstrates using a relative layout to create a form -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:background="@drawable/blue">
<TextView android:id="@+id/label"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:text="@string/viewanimator_test"/>
<EditText android:id="@+id/entry"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_below="@id/label"/>
diff --git a/tests/res/layout/viewflipper_layout.xml b/tests/res/layout/viewflipper_layout.xml
index fc34092..6480379 100644
--- a/tests/res/layout/viewflipper_layout.xml
+++ b/tests/res/layout/viewflipper_layout.xml
@@ -17,23 +17,23 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:padding="10dip"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<ViewFlipper android:id="@+id/viewflipper_test"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:flipInterval="1000"
android:layout_marginBottom="20dip" >
<TextView android:id="@+id/viewflipper_textview1"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textSize="26sp"
android:visibility="gone"
android:text="@string/hello_world"/>
<TextView android:id="@+id/viewflipper_textview2"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textSize="26sp"
diff --git a/tests/res/layout/viewgrouptest_stub.xml b/tests/res/layout/viewgrouptest_stub.xml
index 7eb3263..ee59126 100644
--- a/tests/res/layout/viewgrouptest_stub.xml
+++ b/tests/res/layout/viewgrouptest_stub.xml
@@ -18,14 +18,14 @@
<android.widget.cts.MockLinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:id="@+id/mocklinearlayout">
<!-- view1 goes on top -->
<TextView
android:id="@+id/viewgrouptest_stub"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
diff --git a/tests/res/layout/viewstub_layout.xml b/tests/res/layout/viewstub_layout.xml
index 5c6c000..5c7ff22 100644
--- a/tests/res/layout/viewstub_layout.xml
+++ b/tests/res/layout/viewstub_layout.xml
@@ -16,8 +16,8 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<ViewStub android:id="@+id/viewstub"
android:inflatedId="@+id/inflated_id"
diff --git a/tests/res/layout/viewswitcher_layout.xml b/tests/res/layout/viewswitcher_layout.xml
index 028624b..933dc32 100644
--- a/tests/res/layout/viewswitcher_layout.xml
+++ b/tests/res/layout/viewswitcher_layout.xml
@@ -16,11 +16,11 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<ViewSwitcher android:id="@+id/viewswitcher_test"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
</LinearLayout>
diff --git a/tests/res/layout/viewtreeobserver_layout.xml b/tests/res/layout/viewtreeobserver_layout.xml
index 699dc79..88112ec 100644
--- a/tests/res/layout/viewtreeobserver_layout.xml
+++ b/tests/res/layout/viewtreeobserver_layout.xml
@@ -16,15 +16,15 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearlayout"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView android:id="@+id/listview1"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<ListView android:id="@+id/listview2"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Button android:id="@+id/button1"
diff --git a/tests/res/layout/webview_layout.xml b/tests/res/layout/webview_layout.xml
index 37bffef..7a0ed0d 100644
--- a/tests/res/layout/webview_layout.xml
+++ b/tests/res/layout/webview_layout.xml
@@ -16,7 +16,7 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<WebView android:id="@+id/web_page"
diff --git a/tests/res/layout/windowstub_addlayout.xml b/tests/res/layout/windowstub_addlayout.xml
index 21939ec..0d6399e 100644
--- a/tests/res/layout/windowstub_addlayout.xml
+++ b/tests/res/layout/windowstub_addlayout.xml
@@ -17,8 +17,8 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<TextView android:id="@+id/listview_addwindow"
android:layout_width="wrap_content"
diff --git a/tests/res/layout/windowstub_layout.xml b/tests/res/layout/windowstub_layout.xml
index 1135942..0cf7d6d 100644
--- a/tests/res/layout/windowstub_layout.xml
+++ b/tests/res/layout/windowstub_layout.xml
@@ -17,6 +17,6 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/listview_window"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content" >
</TextView>
diff --git a/tests/res/layout/xml_test.xml b/tests/res/layout/xml_test.xml
index a0834b1..4702281 100644
--- a/tests/res/layout/xml_test.xml
+++ b/tests/res/layout/xml_test.xml
@@ -15,6 +15,6 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
</LinearLayout>
diff --git a/tests/res/xml/base_attributes.xml b/tests/res/xml/base_attributes.xml
index fc3bec0..adb44de 100644
--- a/tests/res/xml/base_attributes.xml
+++ b/tests/res/xml/base_attributes.xml
@@ -22,7 +22,7 @@
</base_attr_pixel>
<base_attr_fillwrap>
<Attributes xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</base_attr_fillwrap>
<base_attr_noheight>
diff --git a/tests/src/android/graphics/drawable/cts/DrawableTestUtils.java b/tests/src/android/graphics/drawable/cts/DrawableTestUtils.java
index 8745bd3..c068aa3 100644
--- a/tests/src/android/graphics/drawable/cts/DrawableTestUtils.java
+++ b/tests/src/android/graphics/drawable/cts/DrawableTestUtils.java
@@ -22,7 +22,7 @@
import java.io.IOException;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
diff --git a/tests/src/android/view/cts/FocusFinderStubActivity.java b/tests/src/android/view/cts/FocusFinderStubActivity.java
index 20150f1..b73ed7f 100644
--- a/tests/src/android/view/cts/FocusFinderStubActivity.java
+++ b/tests/src/android/view/cts/FocusFinderStubActivity.java
@@ -71,8 +71,8 @@
mLayout.setOrientation(LinearLayout.VERTICAL);
mLayout.setHorizontalGravity(Gravity.LEFT);
mLayout.setLayoutParams(new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.FILL_PARENT));
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
mTopWide = makeWide(mTopWideLable);
mLayout.addView(mTopWide);
@@ -104,7 +104,7 @@
Button button = new MyButton(this);
button.setText(label);
button.setLayoutParams(new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
return button;
}
@@ -135,7 +135,7 @@
LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.HORIZONTAL);
ll.setLayoutParams(new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
if (atRight) {
diff --git a/tests/src/android/widget/cts/util/ExpandableListScenario.java b/tests/src/android/widget/cts/util/ExpandableListScenario.java
index bc122f1..1b2eb15 100644
--- a/tests/src/android/widget/cts/util/ExpandableListScenario.java
+++ b/tests/src/android/widget/cts/util/ExpandableListScenario.java
@@ -255,7 +255,7 @@
result.setHeight(desiredHeight);
result.setText(getValueAtPosition(packedPosition));
final ViewGroup.LayoutParams lp = new AbsListView.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
result.setLayoutParams(lp);
result.setGravity(Gravity.CENTER_VERTICAL);
diff --git a/tests/src/android/widget/cts/util/ListItemFactory.java b/tests/src/android/widget/cts/util/ListItemFactory.java
index a60a4ee..f6f8db3 100644
--- a/tests/src/android/widget/cts/util/ListItemFactory.java
+++ b/tests/src/android/widget/cts/util/ListItemFactory.java
@@ -50,7 +50,7 @@
final LinearLayout.LayoutParams buttonLp =
new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
50);
final Button topButton = new Button(context);
@@ -61,7 +61,7 @@
final TextView middleFiller = new TextView(context);
middleFiller.setLayoutParams(new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
desiredHeight - 100));
middleFiller.setText("filler");
ll.addView(middleFiller);
@@ -156,7 +156,7 @@
result.setHeight(desiredHeight);
result.setText(text);
final ViewGroup.LayoutParams lp = new AbsListView.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
result.setLayoutParams(lp);
result.setId(position);
@@ -196,7 +196,7 @@
result.setHeight(desiredHeight);
result.setText(text);
final ViewGroup.LayoutParams lp = new AbsListView.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
result.setLayoutParams(lp);
result.setId(position);
@@ -238,7 +238,7 @@
final AbsListView.LayoutParams lp =
new AbsListView.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
desiredHeight);
ll.setLayoutParams(lp);
ll.setId(position);
diff --git a/tests/src/android/widget/cts/util/ListScenario.java b/tests/src/android/widget/cts/util/ListScenario.java
index 26ef36f..11d670d 100644
--- a/tests/src/android/widget/cts/util/ListScenario.java
+++ b/tests/src/android/widget/cts/util/ListScenario.java
@@ -314,8 +314,8 @@
mListView = createListView();
mListView.setLayoutParams(new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.FILL_PARENT));
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
mListView.setDrawSelectorOnTop(false);
for (int i=0; i<mHeaderViewCount; i++) {
@@ -374,16 +374,16 @@
mHeaderTextView = new TextView(this);
mHeaderTextView.setText("hi");
mHeaderTextView.setLayoutParams(new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
mLinearLayout.addView(mHeaderTextView);
mLinearLayout.setOrientation(LinearLayout.VERTICAL);
mLinearLayout.setLayoutParams(new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.FILL_PARENT));
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
mListView.setLayoutParams((new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
0,
1f)));
@@ -393,10 +393,10 @@
mLinearLayout = new LinearLayout(this);
mLinearLayout.setOrientation(LinearLayout.VERTICAL);
mLinearLayout.setLayoutParams(new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.FILL_PARENT));
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
mListView.setLayoutParams((new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
0,
1f)));
mLinearLayout.addView(mListView);
diff --git a/tests/tests/app/src/android/app/cts/DialogTest.java b/tests/tests/app/src/android/app/cts/DialogTest.java
index 12b213e..2b5e36b 100644
--- a/tests/tests/app/src/android/app/cts/DialogTest.java
+++ b/tests/tests/app/src/android/app/cts/DialogTest.java
@@ -953,7 +953,7 @@
runTestOnUiThread(new Runnable() {
public void run() {
d.addContentView(parent, new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
d.registerForContextMenu(v);
d.openContextMenu(v);
diff --git a/tests/tests/content/src/android/content/cts/ContentResolverTest.java b/tests/tests/content/src/android/content/cts/ContentResolverTest.java
index c6cb7ac..f28b6f0 100644
--- a/tests/tests/content/src/android/content/cts/ContentResolverTest.java
+++ b/tests/tests/content/src/android/content/cts/ContentResolverTest.java
@@ -227,7 +227,9 @@
)
})
public void testOpenOutputStream() throws IOException {
- Uri uri = Uri.parse(ContentResolver.SCHEME_FILE + ":///sqlite_stmt_journals/temp.jpg");
+ Uri uri = Uri.parse(ContentResolver.SCHEME_FILE + "://" +
+ getContext().getCacheDir().getAbsolutePath() +
+ "/temp.jpg");
OutputStream os = mContentResolver.openOutputStream(uri);
assertNotNull(os);
os.close();
@@ -303,7 +305,9 @@
args = {android.net.Uri.class, java.lang.String.class}
)
public void testOpenFileDescriptor() throws IOException {
- Uri uri = Uri.parse(ContentResolver.SCHEME_FILE + ":///sqlite_stmt_journals/temp.jpg");
+ Uri uri = Uri.parse(ContentResolver.SCHEME_FILE + "://" +
+ getContext().getCacheDir().getAbsolutePath() +
+ "/temp.jpg");
ParcelFileDescriptor pfd = mContentResolver.openFileDescriptor(uri, "w");
assertNotNull(pfd);
pfd.close();
diff --git a/tests/tests/content/src/android/content/cts/ContextTest.java b/tests/tests/content/src/android/content/cts/ContextTest.java
index 3eac36a..0b9b4a3 100644
--- a/tests/tests/content/src/android/content/cts/ContextTest.java
+++ b/tests/tests/content/src/android/content/cts/ContextTest.java
@@ -29,7 +29,7 @@
import android.util.Xml;
import com.android.cts.stub.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestTargets;
import dalvik.annotation.TestLevel;
diff --git a/tests/tests/content/src/android/content/cts/IntentFilterTest.java b/tests/tests/content/src/android/content/cts/IntentFilterTest.java
index 4c050e3..d58682c 100644
--- a/tests/tests/content/src/android/content/cts/IntentFilterTest.java
+++ b/tests/tests/content/src/android/content/cts/IntentFilterTest.java
@@ -51,7 +51,7 @@
import android.util.Printer;
import android.util.StringBuilderPrinter;
-import com.android.internal.util.FastXmlSerializer;
+import com.android.common.FastXmlSerializer;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
diff --git a/tests/tests/content/src/android/content/cts/IntentTest.java b/tests/tests/content/src/android/content/cts/IntentTest.java
index 8507e68..2be87ac 100644
--- a/tests/tests/content/src/android/content/cts/IntentTest.java
+++ b/tests/tests/content/src/android/content/cts/IntentTest.java
@@ -46,7 +46,7 @@
import android.util.Xml;
import com.android.internal.app.ResolverActivity;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
diff --git a/tests/tests/content/src/android/content/res/cts/AssetManagerTest.java b/tests/tests/content/src/android/content/res/cts/AssetManagerTest.java
index 6aa7297..9dd2884 100644
--- a/tests/tests/content/src/android/content/res/cts/AssetManagerTest.java
+++ b/tests/tests/content/src/android/content/res/cts/AssetManagerTest.java
@@ -31,7 +31,7 @@
import android.util.TypedValue;
import com.android.cts.stub.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
diff --git a/tests/tests/content/src/android/content/res/cts/ResourcesTest.java b/tests/tests/content/src/android/content/res/cts/ResourcesTest.java
index 1ea5edb..a35fba7 100644
--- a/tests/tests/content/src/android/content/res/cts/ResourcesTest.java
+++ b/tests/tests/content/src/android/content/res/cts/ResourcesTest.java
@@ -17,7 +17,7 @@
package android.content.res.cts;
import com.android.cts.stub.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
diff --git a/tests/tests/content/src/android/content/res/cts/TypedArrayTest.java b/tests/tests/content/src/android/content/res/cts/TypedArrayTest.java
index 40d959d..a85b09e 100644
--- a/tests/tests/content/src/android/content/res/cts/TypedArrayTest.java
+++ b/tests/tests/content/src/android/content/res/cts/TypedArrayTest.java
@@ -28,7 +28,7 @@
import android.view.ContextThemeWrapper;
import com.android.cts.stub.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
diff --git a/tests/tests/database/src/android/database/cts/AbstractCursorTest.java b/tests/tests/database/src/android/database/cts/AbstractCursorTest.java
index bc404fe..e20bee1 100644
--- a/tests/tests/database/src/android/database/cts/AbstractCursorTest.java
+++ b/tests/tests/database/src/android/database/cts/AbstractCursorTest.java
@@ -22,6 +22,7 @@
import dalvik.annotation.TestTargets;
import dalvik.annotation.ToBeFixed;
+import android.content.Context;
import android.database.AbstractCursor;
import android.database.CharArrayBuffer;
import android.database.ContentObserver;
@@ -67,6 +68,15 @@
mTestAbstractCursor = new TestAbstractCursor(COLUMN_NAMES, list);
}
+ @Override
+ protected void tearDown() throws Exception {
+ mDatabaseCursor.close();
+ mTestAbstractCursor.close();
+ mDatabase.close();
+ mDatabaseFile.delete();
+ super.tearDown();
+ }
+
@TestTargetNew(
level = TestLevel.COMPLETE,
method = "AbstractCursor",
@@ -642,7 +652,9 @@
}
private void setupDatabase() {
- mDatabaseFile = new File("/sqlite_stmt_journals", "database_test.db");
+ File dbDir = getInstrumentation().getTargetContext().getDir("tests",
+ Context.MODE_WORLD_WRITEABLE);
+ mDatabaseFile = new File(dbDir, "database_test.db");
if (mDatabaseFile.exists()) {
mDatabaseFile.delete();
}
diff --git a/tests/tests/database/src/android/database/cts/AbstractWindowedCursorTest.java b/tests/tests/database/src/android/database/cts/AbstractWindowedCursorTest.java
index bcce519..3dfaa53 100644
--- a/tests/tests/database/src/android/database/cts/AbstractWindowedCursorTest.java
+++ b/tests/tests/database/src/android/database/cts/AbstractWindowedCursorTest.java
@@ -47,6 +47,13 @@
mWindow = new CursorWindow(false);
}
+ @Override
+ protected void tearDown() throws Exception {
+ mCursor.close();
+ mWindow.close();
+ super.tearDown();
+ }
+
@TestTargetNew(
level = TestLevel.COMPLETE,
method = "isNull",
diff --git a/tests/tests/database/src/android/database/cts/CursorJoinerTest.java b/tests/tests/database/src/android/database/cts/CursorJoinerTest.java
index b76c23b..b54cd35 100644
--- a/tests/tests/database/src/android/database/cts/CursorJoinerTest.java
+++ b/tests/tests/database/src/android/database/cts/CursorJoinerTest.java
@@ -21,6 +21,7 @@
import dalvik.annotation.TestTargetNew;
import dalvik.annotation.TestTargets;
+import android.content.Context;
import android.database.Cursor;
import android.database.CursorJoiner;
import android.database.CursorJoiner.Result;
@@ -243,7 +244,8 @@
}
private void setupDatabase() {
- mDatabaseFile = new File("/sqlite_stmt_journals", "database_test.db");
+ File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE);
+ mDatabaseFile = new File(dbDir, "database_test.db");
if (mDatabaseFile.exists()) {
mDatabaseFile.delete();
}
diff --git a/tests/tests/database/src/android/database/cts/CursorWindowTest.java b/tests/tests/database/src/android/database/cts/CursorWindowTest.java
index eff2db8..5b6db60 100644
--- a/tests/tests/database/src/android/database/cts/CursorWindowTest.java
+++ b/tests/tests/database/src/android/database/cts/CursorWindowTest.java
@@ -16,7 +16,7 @@
package android.database.cts;
-import com.android.internal.database.ArrayListCursor;
+import com.android.common.ArrayListCursor;
import com.google.android.collect.Lists;
import dalvik.annotation.TestLevel;
diff --git a/tests/tests/database/src/android/database/cts/CursorWrapperTest.java b/tests/tests/database/src/android/database/cts/CursorWrapperTest.java
index c32cd89..1373db8 100644
--- a/tests/tests/database/src/android/database/cts/CursorWrapperTest.java
+++ b/tests/tests/database/src/android/database/cts/CursorWrapperTest.java
@@ -300,6 +300,7 @@
assertEquals(DEFAULT_COLUMN_COUNT, cursorWrapper.getColumnCount());
assertEquals("_id", columnNames[0]);
assertEquals("number", columnNames[1]);
+ cursorWrapper.close();
}
@TestTargets({
@@ -444,6 +445,7 @@
assertTrue(cursorWrapper.moveToFirst());
assertEquals(0, cursorWrapper.getPosition());
assertTrue(cursorWrapper.isFirst());
+ cursorWrapper.close();
}
@TestTargets({
@@ -619,6 +621,7 @@
string = new String(charArrayBuffer.data);
assertTrue(charArrayBuffer.sizeCopied > 0);
assertEquals(SECOND_NUMBER, string.substring(0, charArrayBuffer.sizeCopied));
+ cursorWrapper.close();
}
@TestTargetNew(
@@ -632,6 +635,7 @@
CursorWrapper cursorWrapper = new CursorWrapper(getCursor());
Bundle bundle = cursorWrapper.respond(b);
assertSame(Bundle.EMPTY, bundle);
+ cursorWrapper.close();
}
@TestTargetNew(
@@ -643,6 +647,7 @@
public void testGetWantsAllOnMoveCalls() {
CursorWrapper cursorWrapper = new CursorWrapper(getCursor());
assertFalse(cursorWrapper.getWantsAllOnMoveCalls());
+ cursorWrapper.close();
}
@TestTargets({
@@ -691,6 +696,7 @@
fail("testUnregisterContentObserver failed");
}catch(IllegalStateException e){
}
+ cursorWrapper.close();
}
@TestTargetNew(
@@ -743,7 +749,8 @@
}
private void setupDatabase() {
- mDatabaseFile = new File("/sqlite_stmt_journals", "database_test.db");
+ File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE);
+ mDatabaseFile = new File(dbDir, "database_test.db");
if (mDatabaseFile.exists()) {
mDatabaseFile.delete();
}
diff --git a/tests/tests/database/src/android/database/cts/DatabaseCursorTest.java b/tests/tests/database/src/android/database/cts/DatabaseCursorTest.java
index 241dd26..9000972 100644
--- a/tests/tests/database/src/android/database/cts/DatabaseCursorTest.java
+++ b/tests/tests/database/src/android/database/cts/DatabaseCursorTest.java
@@ -24,6 +24,7 @@
import junit.framework.TestCase;
import android.content.ContentValues;
+import android.content.Context;
import android.database.Cursor;
import android.database.CursorIndexOutOfBoundsException;
import android.database.CursorWrapper;
@@ -35,13 +36,14 @@
import android.database.sqlite.SQLiteQuery;
import android.database.sqlite.SQLiteStatement;
import android.os.Looper;
+import android.test.AndroidTestCase;
import android.test.PerformanceTestCase;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.Suppress;
import android.util.Log;
-public class DatabaseCursorTest extends TestCase implements PerformanceTestCase {
+public class DatabaseCursorTest extends AndroidTestCase implements PerformanceTestCase {
private static final String sString1 = "this is a test";
private static final String sString2 = "and yet another test";
private static final String sString3 = "this string is a little longer, but still a test";
@@ -56,7 +58,8 @@
@Override
protected void setUp() throws Exception {
super.setUp();
- mDatabaseFile = new File("/sqlite_stmt_journals", "database_test.db");
+ File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE);
+ mDatabaseFile = new File(dbDir, "database_test.db");
if (mDatabaseFile.exists()) {
mDatabaseFile.delete();
}
diff --git a/tests/tests/database/src/android/database/cts/DatabaseUtilsTest.java b/tests/tests/database/src/android/database/cts/DatabaseUtilsTest.java
index ad89d5f..c67002c 100644
--- a/tests/tests/database/src/android/database/cts/DatabaseUtilsTest.java
+++ b/tests/tests/database/src/android/database/cts/DatabaseUtilsTest.java
@@ -23,6 +23,7 @@
import dalvik.annotation.ToBeFixed;
import android.content.ContentValues;
+import android.content.Context;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.database.DatabaseUtils.InsertHelper;
@@ -53,7 +54,8 @@
@Override
protected void setUp() throws Exception {
super.setUp();
- mDatabaseFile = new File("/sqlite_stmt_journals", "database_test.db");
+ File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE);
+ mDatabaseFile = new File(dbDir, "database_test.db");
if (mDatabaseFile.exists()) {
mDatabaseFile.delete();
}
diff --git a/tests/tests/database/src/android/database/cts/MergeCursorTest.java b/tests/tests/database/src/android/database/cts/MergeCursorTest.java
index 25e6aec..33e2a5c 100644
--- a/tests/tests/database/src/android/database/cts/MergeCursorTest.java
+++ b/tests/tests/database/src/android/database/cts/MergeCursorTest.java
@@ -21,6 +21,7 @@
import dalvik.annotation.TestTargetNew;
import dalvik.annotation.TestTargets;
+import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.database.DataSetObserver;
@@ -450,7 +451,8 @@
}
private void setupDatabase() {
- mDatabaseFile = new File("/sqlite_stmt_journals", "database_test.db");
+ File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE);
+ mDatabaseFile = new File(dbDir, "database_test.db");
if (mDatabaseFile.exists()) {
mDatabaseFile.delete();
}
diff --git a/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java b/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java
index 0791bcd..49df6b2 100644
--- a/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java
+++ b/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java
@@ -34,6 +34,7 @@
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteQuery;
import android.database.sqlite.SQLiteStatement;
+import android.database.sqlite.SQLiteTransactionListener;
import android.test.AndroidTestCase;
import android.test.MoreAsserts;
import dalvik.annotation.TestTargets;
@@ -49,6 +50,10 @@
private String mDatabaseFilePath;
private String mDatabaseDir;
+ private boolean mTransactionListenerOnBeginCalled;
+ private boolean mTransactionListenerOnCommitCalled;
+ private boolean mTransactionListenerOnRollbackCalled;
+
private static final String DATABASE_FILE_NAME = "database_test.db";
private static final String TABLE_NAME = "test";
private static final int COLUMN_ID_INDEX = 0;
@@ -73,6 +78,10 @@
mDatabaseFile.getParentFile().mkdirs(); // directory may not exist
mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile, null);
assertNotNull(mDatabase);
+
+ mTransactionListenerOnBeginCalled = false;
+ mTransactionListenerOnCommitCalled = false;
+ mTransactionListenerOnRollbackCalled = false;
}
@Override
@@ -648,6 +657,31 @@
fail("should throw SQLException.");
} catch (SQLException e) {
}
+
+ // make sure execSQL can't be used to execute more than 1 sql statement at a time
+ mDatabase.execSQL("UPDATE test SET age = 40 WHERE name = 'Mike';" +
+ "UPDATE test SET age = 50 WHERE name = 'Mike';");
+ // age should be updated to 40 not to 50
+ cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null);
+ assertNotNull(cursor);
+ assertEquals(1, cursor.getCount());
+ cursor.moveToFirst();
+ assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX));
+ assertEquals(40, cursor.getInt(COLUMN_AGE_INDEX));
+ assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX));
+ cursor.close();
+
+ // make sure sql injection is NOT allowed or has no effect when using query()
+ String harmfulQuery = "name = 'Mike';UPDATE test SET age = 50 WHERE name = 'Mike'";
+ cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, harmfulQuery, null, null, null, null);
+ assertNotNull(cursor);
+ assertEquals(1, cursor.getCount());
+ cursor.moveToFirst();
+ assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX));
+ // row's age column SHOULD NOT be 50
+ assertEquals(40, cursor.getInt(COLUMN_AGE_INDEX));
+ assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX));
+ cursor.close();;
}
@TestTargetNew(
@@ -1241,4 +1275,307 @@
mDatabase.releaseReference();
assertFalse(mDatabase.isOpen());
}
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ notes = "Test transaction with SQLTransactionListener()",
+ method = "beginTransactionWithListener",
+ args = {SQLiteTransactionListener.class}
+ )
+ public void testTransactionWithSQLiteTransactionListener() {
+ mDatabase.execSQL("CREATE TABLE test (num INTEGER);");
+ mDatabase.execSQL("INSERT INTO test (num) VALUES (0)");
+
+ assertEquals(mTransactionListenerOnBeginCalled, false);
+ assertEquals(mTransactionListenerOnCommitCalled, false);
+ assertEquals(mTransactionListenerOnRollbackCalled, false);
+ mDatabase.beginTransactionWithListener(new TestSQLiteTransactionListener());
+
+ // Assert that the transcation has started
+ assertEquals(mTransactionListenerOnBeginCalled, true);
+ assertEquals(mTransactionListenerOnCommitCalled, false);
+ assertEquals(mTransactionListenerOnRollbackCalled, false);
+
+ setNum(1);
+
+ // State shouldn't have changed
+ assertEquals(mTransactionListenerOnBeginCalled, true);
+ assertEquals(mTransactionListenerOnCommitCalled, false);
+ assertEquals(mTransactionListenerOnRollbackCalled, false);
+
+ // commit the transaction
+ mDatabase.setTransactionSuccessful();
+ mDatabase.endTransaction();
+
+ // the listener should have been told that commit was called
+ assertEquals(mTransactionListenerOnBeginCalled, true);
+ assertEquals(mTransactionListenerOnCommitCalled, true);
+ assertEquals(mTransactionListenerOnRollbackCalled, false);
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ notes = "Test transaction w/rollback with SQLTransactionListener()",
+ method = "beginTransactionWithListener",
+ args = {SQLiteTransactionListener.class}
+ )
+ public void testRollbackTransactionWithSQLiteTransactionListener() {
+ mDatabase.execSQL("CREATE TABLE test (num INTEGER);");
+ mDatabase.execSQL("INSERT INTO test (num) VALUES (0)");
+
+ assertEquals(mTransactionListenerOnBeginCalled, false);
+ assertEquals(mTransactionListenerOnCommitCalled, false);
+ assertEquals(mTransactionListenerOnRollbackCalled, false);
+ mDatabase.beginTransactionWithListener(new TestSQLiteTransactionListener());
+
+ // Assert that the transcation has started
+ assertEquals(mTransactionListenerOnBeginCalled, true);
+ assertEquals(mTransactionListenerOnCommitCalled, false);
+ assertEquals(mTransactionListenerOnRollbackCalled, false);
+
+ setNum(1);
+
+ // State shouldn't have changed
+ assertEquals(mTransactionListenerOnBeginCalled, true);
+ assertEquals(mTransactionListenerOnCommitCalled, false);
+ assertEquals(mTransactionListenerOnRollbackCalled, false);
+
+ // commit the transaction
+ mDatabase.endTransaction();
+
+ // the listener should have been told that commit was called
+ assertEquals(mTransactionListenerOnBeginCalled, true);
+ assertEquals(mTransactionListenerOnCommitCalled, false);
+ assertEquals(mTransactionListenerOnRollbackCalled, true);
+ }
+
+ private class TestSQLiteTransactionListener implements SQLiteTransactionListener {
+ public void onBegin() {
+ mTransactionListenerOnBeginCalled = true;
+ }
+
+ public void onCommit() {
+ mTransactionListenerOnCommitCalled = true;
+ }
+
+ public void onRollback() {
+ mTransactionListenerOnRollbackCalled = true;
+ }
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ notes = "removed the android-provided group_concat built-in function." +
+ "Instead we are now using the sqlite3.c provided group_concat function." +
+ "and it returns NULL if the columnds to be concatenated have null values" +
+ " in them",
+ method = "sqlite3::group_concat built-in function",
+ args = {java.lang.String.class}
+ )
+ public void testGroupConcat() {
+ mDatabase.execSQL("CREATE TABLE test (i INT, j TEXT);");
+
+ // insert 2 rows
+ String sql = "INSERT INTO test (i) VALUES (?);";
+ SQLiteStatement insertStatement = mDatabase.compileStatement(sql);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 1, 1);
+ insertStatement.execute();
+ DatabaseUtils.bindObjectToProgram(insertStatement, 1, 2);
+ insertStatement.execute();
+ insertStatement.close();
+
+ // make sure there are 2 rows in the table
+ Cursor cursor = mDatabase.rawQuery("SELECT count(*) FROM test", null);
+ assertNotNull(cursor);
+ assertEquals(1, cursor.getCount());
+ cursor.moveToNext();
+ assertEquals(2, cursor.getInt(0));
+ cursor.close();
+
+ // concatenate column j from all the rows. should return NULL
+ cursor = mDatabase.rawQuery("SELECT group_concat(j, ' ') FROM test", null);
+ assertNotNull(cursor);
+ assertEquals(1, cursor.getCount());
+ cursor.moveToNext();
+ assertNull(cursor.getString(0));
+ cursor.close();
+
+ // drop the table
+ mDatabase.execSQL("DROP TABLE test;");
+ // should get no exceptions
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ notes = "test schema changes - change existing table.",
+ method = "compileStatement",
+ args = {java.lang.String.class}
+ )
+ public void testSchemaChanges() {
+ mDatabase.execSQL("CREATE TABLE test (i INT, j INT);");
+
+ // at the beginning, there is no record in the database.
+ Cursor cursor = mDatabase.rawQuery("SELECT * FROM test", null);
+ assertNotNull(cursor);
+ assertEquals(0, cursor.getCount());
+ cursor.close();
+
+ String sql = "INSERT INTO test VALUES (?, ?);";
+ SQLiteStatement insertStatement = mDatabase.compileStatement(sql);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 1, 1);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 2, 2);
+ insertStatement.execute();
+ insertStatement.close();
+
+ // read the data from the table and make sure it is correct
+ cursor = mDatabase.rawQuery("SELECT i,j FROM test", null);
+ assertNotNull(cursor);
+ assertEquals(1, cursor.getCount());
+ cursor.moveToNext();
+ assertEquals(1, cursor.getInt(0));
+ assertEquals(2, cursor.getInt(1));
+ cursor.close();
+
+ // alter the table and execute another statement
+ mDatabase.execSQL("ALTER TABLE test ADD COLUMN k int;");
+ sql = "INSERT INTO test VALUES (?, ?, ?);";
+ insertStatement = mDatabase.compileStatement(sql);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 1, 3);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 2, 4);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 3, 5);
+ insertStatement.execute();
+ insertStatement.close();
+
+ // read the data from the table and make sure it is correct
+ cursor = mDatabase.rawQuery("SELECT i,j,k FROM test", null);
+ assertNotNull(cursor);
+ assertEquals(2, cursor.getCount());
+ cursor.moveToNext();
+ assertEquals(1, cursor.getInt(0));
+ assertEquals(2, cursor.getInt(1));
+ assertNull(cursor.getString(2));
+ cursor.moveToNext();
+ assertEquals(3, cursor.getInt(0));
+ assertEquals(4, cursor.getInt(1));
+ assertEquals(5, cursor.getInt(2));
+ cursor.close();
+
+ // make sure the old statement - which should *try to reuse* cached query plan -
+ // still works
+ cursor = mDatabase.rawQuery("SELECT i,j FROM test", null);
+ assertNotNull(cursor);
+ assertEquals(2, cursor.getCount());
+ cursor.moveToNext();
+ assertEquals(1, cursor.getInt(0));
+ assertEquals(2, cursor.getInt(1));
+ cursor.moveToNext();
+ assertEquals(3, cursor.getInt(0));
+ assertEquals(4, cursor.getInt(1));
+ cursor.close();
+
+ SQLiteStatement deleteStatement = mDatabase.compileStatement("DELETE FROM test");
+ deleteStatement.execute();
+ deleteStatement.close();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ notes = "test schema changes - add new table.",
+ method = "compileStatement",
+ args = {java.lang.String.class}
+ )
+ public void testSchemaChangesNewTable() {
+ mDatabase.execSQL("CREATE TABLE test (i INT, j INT);");
+
+ // at the beginning, there is no record in the database.
+ Cursor cursor = mDatabase.rawQuery("SELECT * FROM test", null);
+ assertNotNull(cursor);
+ assertEquals(0, cursor.getCount());
+ cursor.close();
+
+ String sql = "INSERT INTO test VALUES (?, ?);";
+ SQLiteStatement insertStatement = mDatabase.compileStatement(sql);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 1, 1);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 2, 2);
+ insertStatement.execute();
+ insertStatement.close();
+
+ // read the data from the table and make sure it is correct
+ cursor = mDatabase.rawQuery("SELECT i,j FROM test", null);
+ assertNotNull(cursor);
+ assertEquals(1, cursor.getCount());
+ cursor.moveToNext();
+ assertEquals(1, cursor.getInt(0));
+ assertEquals(2, cursor.getInt(1));
+ cursor.close();
+
+ // alter the table and execute another statement
+ mDatabase.execSQL("CREATE TABLE test_new (i INT, j INT, k INT);");
+ sql = "INSERT INTO test_new VALUES (?, ?, ?);";
+ insertStatement = mDatabase.compileStatement(sql);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 1, 3);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 2, 4);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 3, 5);
+ insertStatement.execute();
+ insertStatement.close();
+
+ // read the data from the table and make sure it is correct
+ cursor = mDatabase.rawQuery("SELECT i,j,k FROM test_new", null);
+ assertNotNull(cursor);
+ assertEquals(1, cursor.getCount());
+ cursor.moveToNext();
+ assertEquals(3, cursor.getInt(0));
+ assertEquals(4, cursor.getInt(1));
+ assertEquals(5, cursor.getInt(2));
+ cursor.close();
+
+ // make sure the old statement - which should *try to reuse* cached query plan -
+ // still works
+ cursor = mDatabase.rawQuery("SELECT i,j FROM test", null);
+ assertNotNull(cursor);
+ assertEquals(1, cursor.getCount());
+ cursor.moveToNext();
+ assertEquals(1, cursor.getInt(0));
+ assertEquals(2, cursor.getInt(1));
+ cursor.close();
+
+ SQLiteStatement deleteStatement = mDatabase.compileStatement("DELETE FROM test");
+ deleteStatement.execute();
+ deleteStatement.close();
+
+ SQLiteStatement deleteStatement2 = mDatabase.compileStatement("DELETE FROM test_new");
+ deleteStatement2.execute();
+ deleteStatement2.close();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ notes = "test schema changes - drop existing table.",
+ method = "compileStatement",
+ args = {java.lang.String.class}
+ )
+ public void testSchemaChangesDropTable() {
+ mDatabase.execSQL("CREATE TABLE test (i INT, j INT);");
+
+ // at the beginning, there is no record in the database.
+ Cursor cursor = mDatabase.rawQuery("SELECT * FROM test", null);
+ assertNotNull(cursor);
+ assertEquals(0, cursor.getCount());
+ cursor.close();
+
+ String sql = "INSERT INTO test VALUES (?, ?);";
+ SQLiteStatement insertStatement = mDatabase.compileStatement(sql);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 1, 1);
+ DatabaseUtils.bindObjectToProgram(insertStatement, 2, 2);
+ insertStatement.execute();
+ insertStatement.close();
+
+ // read the data from the table and make sure it is correct
+ cursor = mDatabase.rawQuery("SELECT i,j FROM test", null);
+ assertNotNull(cursor);
+ assertEquals(1, cursor.getCount());
+ cursor.moveToNext();
+ assertEquals(1, cursor.getInt(0));
+ assertEquals(2, cursor.getInt(1));
+ }
}
diff --git a/tests/tests/database/src/android/database/sqlite/cts/SQLiteProgramTest.java b/tests/tests/database/src/android/database/sqlite/cts/SQLiteProgramTest.java
index a321dad..a1e0181 100644
--- a/tests/tests/database/src/android/database/sqlite/cts/SQLiteProgramTest.java
+++ b/tests/tests/database/src/android/database/sqlite/cts/SQLiteProgramTest.java
@@ -69,9 +69,58 @@
final String statement = "DELETE FROM test WHERE _id=?;";
SQLiteStatement statementOne = mDatabase.compileStatement(statement);
SQLiteStatement statementTwo = mDatabase.compileStatement(statement);
- assertTrue(statementOne.getUniqueId() != statementTwo.getUniqueId());
+ // both the statements should have the same uniqueId because they both should refer to
+ // the same compiled-sql statement in cache
+ assertTrue(statementOne.getUniqueId() == statementTwo.getUniqueId());
statementOne.close();
statementTwo.close();
+
+ // now try to compile 2 different statements and they should have different uniquerIds.
+ SQLiteStatement statement1 = mDatabase.compileStatement("DELETE FROM test WHERE _id=1;");
+ SQLiteStatement statement2 = mDatabase.compileStatement("DELETE FROM test WHERE _id=2;");
+ assertTrue(statement1.getUniqueId() != statement2.getUniqueId());
+ statement1.close();
+ statement2.close();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ notes = "Test onAllReferencesReleased(). Since sql statements are always cached in " +
+ "SQLiteDatabase, compiledSql should NOT be released " +
+ "when onAllReferencesReleased() is called",
+ method = "onAllReferencesReleased",
+ args = {}
+ )
+ public void testOnAllReferencesReleased() {
+ mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, text1 TEXT, text2 TEXT, " +
+ "num1 INTEGER, num2 INTEGER, image BLOB);");
+ final String statement = "DELETE FROM test WHERE _id=?;";
+ SQLiteStatement statementOne = mDatabase.compileStatement(statement);
+ assertTrue(statementOne.getUniqueId() > 0);
+ int nStatement = statementOne.getUniqueId();
+ statementOne.releaseReference();
+ assertTrue(statementOne.getUniqueId() == nStatement);
+ statementOne.close();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ notes = "Test onAllReferencesReleasedFromContainer(). " +
+ "Since sql statements are always cached in " +
+ "SQLiteDatabase, compiledSql should NOT be released " +
+ "when onAllReferencesReleasedFromContainer() is called",
+ args = {}
+ )
+ public void testOnAllReferencesReleasedFromContainer() {
+ mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, text1 TEXT, text2 TEXT, " +
+ "num1 INTEGER, num2 INTEGER, image BLOB);");
+ final String statement = "DELETE FROM test WHERE _id=?;";
+ SQLiteStatement statementOne = mDatabase.compileStatement(statement);
+ assertTrue(statementOne.getUniqueId() > 0);
+ int nStatement = statementOne.getUniqueId();
+ statementOne.releaseReferenceFromContainer();
+ assertTrue(statementOne.getUniqueId() == nStatement);
+ statementOne.close();
}
@TestTargets({
@@ -295,4 +344,16 @@
public void testProtectedMethods() {
// cannot test
}
+
+ private void closeDatabaseWithOrphanedStatement(){
+ try {
+ mDatabase.close();
+ } catch (SQLiteException e) {
+ // A SQLiteException is thrown if there are some unfinialized exceptions
+ // This is expected as some tests explicitly leave statements in this state
+ if (!e.getMessage().equals("Unable to close due to unfinalised statements")) {
+ throw e;
+ }
+ }
+ }
}
diff --git a/tests/tests/graphics/src/android/graphics/cts/MovieTest.java b/tests/tests/graphics/src/android/graphics/cts/MovieTest.java
index 56421fd..ab875bb 100644
--- a/tests/tests/graphics/src/android/graphics/cts/MovieTest.java
+++ b/tests/tests/graphics/src/android/graphics/cts/MovieTest.java
@@ -24,6 +24,7 @@
import java.io.OutputStream;
import android.app.cts.MockActivity;
+import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Movie;
import android.graphics.Paint;
@@ -85,7 +86,9 @@
@BrokenTest("mMovie is null")
public void testDecodeFile() throws Exception {
mMovie = null;
- File imagefile = new File("/sqlite_stmt_journals", "animated.gif");
+ File dbDir = getInstrumentation().getTargetContext().getDir("tests",
+ Context.MODE_PRIVATE);
+ File imagefile = new File(dbDir, "animated.gif");
if (imagefile.exists()) {
imagefile.delete();
}
diff --git a/tests/tests/graphics/src/android/graphics/drawable/cts/PaintDrawableTest.java b/tests/tests/graphics/src/android/graphics/drawable/cts/PaintDrawableTest.java
index 05472b2..f2a924d 100644
--- a/tests/tests/graphics/src/android/graphics/drawable/cts/PaintDrawableTest.java
+++ b/tests/tests/graphics/src/android/graphics/drawable/cts/PaintDrawableTest.java
@@ -212,7 +212,7 @@
IOException {
int type;
// FIXME: this come from
- // com.android.internal.util.XmlUtils.beginDocument. It's better put
+ // com.android.common.XmlUtils.beginDocument. It's better put
// it up as a utility method of CTS test cases.
type = parser.next();
while (type != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) {
diff --git a/tests/tests/hardware/src/android/hardware/cts/CameraTest.java b/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
index 593ffdb..b3217e3 100644
--- a/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
+++ b/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
@@ -22,6 +22,8 @@
import dalvik.annotation.TestTargetNew;
import dalvik.annotation.TestTargets;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.hardware.Camera.AutoFocusCallback;
@@ -31,6 +33,8 @@
import android.hardware.Camera.PreviewCallback;
import android.hardware.Camera.Size;
import android.hardware.Camera.ShutterCallback;
+import android.media.ExifInterface;
+import android.os.ConditionVariable;
import android.os.Looper;
import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
@@ -49,6 +53,7 @@
private String TAG = "CameraTest";
private static final String PACKAGE = "com.android.cts.stub";
private static final boolean LOGV = false;
+ private final String JPEG_PATH = "/sdcard/test.jpg";
private boolean mRawPreviewCallbackResult = false;
private boolean mShutterCallbackResult = false;
@@ -69,8 +74,7 @@
private TestAutoFocusCallback mAutoFocusCallback = new TestAutoFocusCallback();
private Looper mLooper = null;
- private final Object mLock = new Object();
- private final Object mPreviewDone = new Object();
+ private final ConditionVariable mPreviewDone = new ConditionVariable();
Camera mCamera;
@@ -92,6 +96,7 @@
*/
private void initializeMessageLooper() {
if (LOGV) Log.v(TAG, "start looper");
+ final ConditionVariable startDone = new ConditionVariable();
new Thread() {
@Override
public void run() {
@@ -102,13 +107,15 @@
// after we are done with it.
mLooper = Looper.myLooper();
mCamera = Camera.open();
- synchronized (mLock) {
- mLock.notify();
- }
+ startDone.open();
Looper.loop(); // Blocks forever until Looper.quit() is called.
if (LOGV) Log.v(TAG, "initializeMessageLooper: quit.");
}
}.start();
+
+ if (!startDone.block(WAIT_FOR_COMMAND_TO_COMPLETE)) {
+ fail("initializeMessageLooper: start timeout");
+ }
}
/*
@@ -133,11 +140,8 @@
mRawPreviewCallbackResult = false;
}
mCamera.stopPreview();
- synchronized (mPreviewDone) {
- if (LOGV) Log.v(TAG, "notify the preview callback");
- mPreviewDone.notify();
- }
-
+ if (LOGV) Log.v(TAG, "notify the preview callback");
+ mPreviewDone.open();
if (LOGV) Log.v(TAG, "Preview callback stop");
}
}
@@ -170,7 +174,7 @@
mJpegPictureCallbackResult = true;
// try to store the picture on the SD card
- File rawoutput = new File("/sdcard/test.bmp");
+ File rawoutput = new File(JPEG_PATH);
FileOutputStream outStream = new FileOutputStream(rawoutput);
outStream.write(rawData);
outStream.close();
@@ -222,16 +226,12 @@
}
private void waitForPreviewDone() {
- synchronized (mPreviewDone) {
- try {
- mPreviewDone.wait(WAIT_FOR_COMMAND_TO_COMPLETE);
- if (LOGV)
- Log.v(TAG, "Wait for preview callback");
- } catch (Exception e) {
- if (LOGV)
- Log.v(TAG, "wait was interrupted.");
- }
+ if (LOGV) Log.v(TAG, "Wait for preview callback");
+ if (!mPreviewDone.block(WAIT_FOR_COMMAND_TO_COMPLETE)) {
+ // timeout could be expected or unexpected. The caller will decide.
+ if (LOGV) Log.v(TAG, "waitForPreviewDone: timeout");
}
+ mPreviewDone.close();
}
private void checkPreviewCallback() throws Exception {
@@ -291,7 +291,6 @@
// There is some problems in testing autoFocus, setErrorCallback
public void testTakePicture() throws Exception {
initializeMessageLooper();
- syncLock();
checkTakePicture();
terminateMessageLooper();
assertTrue(mShutterCallbackResult);
@@ -346,7 +345,6 @@
@BrokenTest("Flaky test. Occasionally fails without a stack trace.")
public void testCheckPreview() throws Exception {
initializeMessageLooper();
- syncLock();
mCamera.setPreviewCallback(mRawPreviewCallback);
mCamera.setErrorCallback(mErrorCallback);
checkPreviewCallback();
@@ -361,7 +359,6 @@
)
public void testSetOneShotPreviewCallback() throws Exception {
initializeMessageLooper();
- syncLock();
mCamera.setOneShotPreviewCallback(mRawPreviewCallback);
checkPreviewCallback();
terminateMessageLooper();
@@ -369,7 +366,6 @@
mRawPreviewCallbackResult = false;
initializeMessageLooper();
- syncLock();
checkPreviewCallback();
terminateMessageLooper();
assertFalse(mRawPreviewCallbackResult);
@@ -384,7 +380,6 @@
SurfaceHolder mSurfaceHolder;
mSurfaceHolder = CameraStubActivity.mSurfaceView.getHolder();
initializeMessageLooper();
- syncLock();
// Check the order: startPreview->setPreviewDisplay.
mCamera.setOneShotPreviewCallback(mRawPreviewCallback);
@@ -396,7 +391,6 @@
// Check the order: setPreviewDisplay->startPreview.
initializeMessageLooper();
- syncLock();
mRawPreviewCallbackResult = false;
mCamera.setOneShotPreviewCallback(mRawPreviewCallback);
mCamera.setPreviewDisplay(mSurfaceHolder);
@@ -417,6 +411,45 @@
assertTrue(mRawPreviewCallbackResult);
}
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "setDisplayOrientation",
+ args = {int.class}
+ )
+ public void testDisplayOrientation() throws Exception {
+ initializeMessageLooper();
+
+ // Check valid arguments.
+ mCamera.setDisplayOrientation(0);
+ mCamera.setDisplayOrientation(90);
+ mCamera.setDisplayOrientation(180);
+ mCamera.setDisplayOrientation(270);
+
+ // Check invalid arguments.
+ try {
+ mCamera.setDisplayOrientation(45);
+ fail("Should throw exception for invalid arguments");
+ } catch (RuntimeException ex) {
+ // expected
+ }
+
+ // Start preview.
+ SurfaceHolder mSurfaceHolder;
+ mSurfaceHolder = CameraStubActivity.mSurfaceView.getHolder();
+ mCamera.setPreviewDisplay(mSurfaceHolder);
+ mCamera.startPreview();
+
+ // Check setting orientation during preview is not allowed.
+ try {
+ mCamera.setDisplayOrientation(90);
+ fail("Should throw exception for setting orientation during preview.");
+ } catch (RuntimeException ex) {
+ // expected
+ }
+
+ terminateMessageLooper();
+ }
+
@TestTargets({
@TestTargetNew(
level = TestLevel.COMPLETE,
@@ -431,16 +464,10 @@
})
public void testAccessParameters() throws Exception {
initializeMessageLooper();
- syncLock();
// we can get parameters just by getxxx method due to the private constructor
Parameters pSet = mCamera.getParameters();
assertParameters(pSet);
- }
-
- private void syncLock() throws Exception {
- synchronized (mLock) {
- mLock.wait(WAIT_FOR_COMMAND_TO_COMPLETE);
- }
+ terminateMessageLooper();
}
// Also test Camera.Parameters
@@ -480,12 +507,18 @@
List<Integer> pictureFormats = parameters.getSupportedPictureFormats();
List<String> focusModes = parameters.getSupportedFocusModes();
String focusMode = parameters.getFocusMode();
+ float focalLength = parameters.getFocalLength();
+ float horizontalViewAngle = parameters.getHorizontalViewAngle();
+ float verticalViewAngle = parameters.getVerticalViewAngle();
assertTrue(previewSizes != null && previewSizes.size() != 0);
assertTrue(pictureSizes != null && pictureSizes.size() != 0);
assertTrue(previewFormats != null && previewFormats.size() != 0);
assertTrue(pictureFormats != null && pictureFormats.size() != 0);
assertTrue(focusModes != null && focusModes.size() != 0);
assertTrue(focusMode != null);
+ assertTrue(focalLength > 0);
+ assertTrue(horizontalViewAngle > 0 && horizontalViewAngle <= 360);
+ assertTrue(verticalViewAngle > 0 && verticalViewAngle <= 360);
Size previewSize = previewSizes.get(0);
Size pictureSize = pictureSizes.get(0);
@@ -520,4 +553,103 @@
return (format == PixelFormat.RGB_565) || (format == PixelFormat.YCbCr_420_SP)
|| (format == PixelFormat.JPEG) || (format == PixelFormat.YCbCr_422_I);
}
+
+ @TestTargets({
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "setJpegThumbnailSize",
+ args = {android.hardware.Camera.Size.class}
+ ),
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "getJpegThumbnailSize",
+ args = {}
+ ),
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "getJpegSupportedThumbnailSizes",
+ args = {}
+ )
+ })
+ public void testJpegThumbnailSize() throws Exception {
+ initializeMessageLooper();
+ // Thumbnail size parameters should have valid values.
+ Parameters p = mCamera.getParameters();
+ Size size = p.getJpegThumbnailSize();
+ assertTrue(size.width > 0 && size.height > 0);
+ List<Size> sizes = p.getSupportedJpegThumbnailSizes();
+ assertTrue(sizes.size() >= 2);
+ assertTrue(sizes.contains(size));
+ assertTrue(sizes.contains(mCamera.new Size(0, 0)));
+
+ // Test if the thumbnail size matches the setting.
+ SurfaceHolder mSurfaceHolder;
+ mSurfaceHolder = CameraStubActivity.mSurfaceView.getHolder();
+ mCamera.setPreviewDisplay(mSurfaceHolder);
+ mCamera.startPreview();
+ mCamera.takePicture(null, null, mJpegPictureCallback);
+ Thread.sleep(WAIT_LONG);
+ ExifInterface exif = new ExifInterface(JPEG_PATH);
+ assertTrue(exif.hasThumbnail());
+ byte[] thumb = exif.getThumbnail();
+ Bitmap b = BitmapFactory.decodeByteArray(thumb, 0, thumb.length);
+ assertEquals(b.getWidth(), size.width);
+ assertEquals(b.getHeight(), size.height);
+
+ // Test no thumbnail case.
+ p.setJpegThumbnailSize(0, 0);
+ mCamera.setParameters(p);
+ mCamera.startPreview();
+ mCamera.takePicture(null, null, mJpegPictureCallback);
+ Thread.sleep(WAIT_LONG);
+ exif = new ExifInterface(JPEG_PATH);
+ assertTrue(!exif.hasThumbnail());
+
+ terminateMessageLooper();
+ }
+
+ public void testJpegExif() throws Exception {
+ initializeMessageLooper();
+ Camera.Parameters parameters = mCamera.getParameters();
+ SurfaceHolder mSurfaceHolder;
+ mSurfaceHolder = CameraStubActivity.mSurfaceView.getHolder();
+ mCamera.setPreviewDisplay(mSurfaceHolder);
+ mCamera.startPreview();
+ double focalLength = (double)parameters.getFocalLength();
+ mCamera.takePicture(mShutterCallback, mRawPictureCallback, mJpegPictureCallback);
+ Thread.sleep(WAIT_LONG);
+ ExifInterface exif = new ExifInterface(JPEG_PATH);
+ assertTrue(exif.getAttribute(ExifInterface.TAG_MAKE) != null);
+ assertTrue(exif.getAttribute(ExifInterface.TAG_MODEL) != null);
+ assertTrue(exif.getAttribute(ExifInterface.TAG_DATETIME) != null);
+ assertTrue(exif.getAttributeInt(ExifInterface.TAG_IMAGE_WIDTH, 0) != 0);
+ assertTrue(exif.getAttributeInt(ExifInterface.TAG_IMAGE_LENGTH, 0) != 0);
+ assertEquals(exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE), null);
+ assertEquals(exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE), null);
+ assertEquals(exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF), null);
+ assertEquals(exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF), null);
+ assertEquals(exif.getAttribute(ExifInterface.TAG_GPS_TIMESTAMP), null);
+ assertEquals(exif.getAttribute(ExifInterface.TAG_GPS_DATESTAMP), null);
+ double exifFocalLength = (double)exif.getAttributeDouble(
+ ExifInterface.TAG_FOCAL_LENGTH, -1);
+ assertEquals(focalLength, exifFocalLength, 0.001);
+
+ // Test gps exif tags.
+ mCamera.startPreview();
+ parameters.setGpsLatitude(37.736071);
+ parameters.setGpsLongitude(-122.441983);
+ parameters.setGpsAltitude(21);
+ parameters.setGpsTimestamp(1199145600);
+ mCamera.setParameters(parameters);
+ mCamera.takePicture(mShutterCallback, mRawPictureCallback, mJpegPictureCallback);
+ Thread.sleep(WAIT_LONG);
+ exif = new ExifInterface(JPEG_PATH);
+ assertTrue(exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) != null);
+ assertTrue(exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE) != null);
+ assertTrue(exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF) != null);
+ assertTrue(exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF) != null);
+ assertTrue(exif.getAttribute(ExifInterface.TAG_GPS_TIMESTAMP) != null);
+ assertTrue(exif.getAttribute(ExifInterface.TAG_GPS_DATESTAMP) != null);
+ terminateMessageLooper();
+ }
}
diff --git a/tests/tests/os/src/android/os/cts/RecoverySystemTest.java b/tests/tests/os/src/android/os/cts/RecoverySystemTest.java
new file mode 100644
index 0000000..d7c6acc
--- /dev/null
+++ b/tests/tests/os/src/android/os/cts/RecoverySystemTest.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2010 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.os.cts;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.GeneralSecurityException;
+
+import android.content.Context;
+import android.content.res.AssetManager;
+import android.os.RecoverySystem;
+import android.test.AndroidTestCase;
+import android.test.suitebuilder.annotation.MediumTest;
+
+import android.util.Log;
+
+public class RecoverySystemTest extends AndroidTestCase {
+ private static final String TAG = "RecoverySystemTest";
+
+ private AssetManager mAssets;
+
+ @Override
+ protected void setUp() throws Exception {
+ Log.v(TAG, "setup");
+ super.setUp();
+ mAssets = mContext.getAssets();
+ }
+
+ /** Write the given asset to a file of the same name and return a File. */
+ private File getAsset(String name) throws Exception {
+ FileOutputStream fos = mContext.openFileOutput(name, 0);
+ InputStream is = mAssets.open(name);
+ byte[] b = new byte[4096];
+ int read;
+ while ((read = is.read(b)) != -1) {
+ fos.write(b, 0, read);
+ }
+ is.close();
+ fos.close();
+ return mContext.getFileStreamPath(name);
+ }
+
+ @MediumTest
+ public void testVerify() throws Exception {
+ File otacerts = getAsset("otacerts.zip");
+ File packageFile;
+
+ // This is the only package for which verification should succeed.
+ Log.v(TAG, "testing otasigned.zip");
+ packageFile = getAsset("otasigned.zip");
+ RecoverySystem.verifyPackage(packageFile, null, otacerts);
+ packageFile.delete();
+
+ expectVerifyFail("alter-footer.zip", otacerts);
+ expectVerifyFail("alter-metadata.zip", otacerts);
+ expectVerifyFail("fake-eocd.zip", otacerts);
+ expectVerifyFail("jarsigned.zip", otacerts);
+ expectVerifyFail("random.zip", otacerts);
+ expectVerifyFail("unsigned.zip", otacerts);
+
+ otacerts.delete();
+ }
+
+ /**
+ * Try verifying the given file against the given otacerts,
+ * expecting verification to fail.
+ */
+ private void expectVerifyFail(String name, File otacerts)
+ throws Exception {
+ Log.v(TAG, "testing " + name);
+ File packageFile = getAsset(name);
+ try {
+ RecoverySystem.verifyPackage(packageFile, null, otacerts);
+ fail("verification of " + name + " succeeded when it shouldn't have");
+ } catch (GeneralSecurityException e) {
+ // expected
+ }
+ packageFile.delete();
+ }
+}
diff --git a/tests/tests/permission/src/android/permission/cts/NoNetworkStatePermissionTest.java b/tests/tests/permission/src/android/permission/cts/NoNetworkStatePermissionTest.java
index f2d6541..80a7575 100644
--- a/tests/tests/permission/src/android/permission/cts/NoNetworkStatePermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/NoNetworkStatePermissionTest.java
@@ -16,8 +16,6 @@
package android.permission.cts;
-import dalvik.annotation.KnownFailure;
-
import android.content.Context;
import android.net.ConnectivityManager;
import android.test.AndroidTestCase;
@@ -141,7 +139,7 @@
* <p>Requires Permission:
* {@link android.Manifest.permission#CHANGE_NETWORK_STATE}.
*/
- @KnownFailure("will be fixed in future release")
+ @SmallTest
public void testStopUsingNetworkFeature() {
try {
mConnectivityManager.stopUsingNetworkFeature(TEST_NETWORK_TYPE, TEST_FEATURE);
diff --git a/tests/tests/telephony/src/android/telephony/cts/PhoneNumberUtilsTest.java b/tests/tests/telephony/src/android/telephony/cts/PhoneNumberUtilsTest.java
index 10310fd..69612fa 100644
--- a/tests/tests/telephony/src/android/telephony/cts/PhoneNumberUtilsTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/PhoneNumberUtilsTest.java
@@ -186,6 +186,11 @@
assertFalse(PhoneNumberUtils.compare("+44 207 792 3490", "010 44 207 792 3490", strict));
assertFalse(PhoneNumberUtils.compare("+44 207 792 3490", "0011 44 207 792 3490", strict));
assertTrue(PhoneNumberUtils.compare("+444 207 792 3490", "0 207 792 3490", strict));
+
+ // make sure SMS short code comparison for numbers less than 7 digits work correctly.
+ // For example, "404-04" and "40404" should match because the dialable portion for both
+ // numbers are the same.
+ assertTrue(PhoneNumberUtils.compare("404-04", "40404", strict));
}
@TestTargetNew(
diff --git a/tests/tests/text/src/android/text/cts/LoginFilterTest.java b/tests/tests/text/src/android/text/cts/LoginFilterTest.java
index 67b615e..ed86d52 100644
--- a/tests/tests/text/src/android/text/cts/LoginFilterTest.java
+++ b/tests/tests/text/src/android/text/cts/LoginFilterTest.java
@@ -75,7 +75,7 @@
dest1, 0, dest1.length()));
assertTrue(loginFilter.isStarted());
assertTrue(loginFilter.isStopped());
- assertEquals(4, loginFilter.getInvalidCharacterCount());
+ assertEquals(3, loginFilter.getInvalidCharacterCount());
loginFilter.reset();
assertNull(loginFilter.filter(spannedSource, 0, spannedSource.length(),
@@ -87,10 +87,10 @@
loginFilter = new MockLoginFilter(false);
result = loginFilter.filter(source2, 0, source2.length(), dest1, 0, dest1.length());
assertFalse(result instanceof SpannableString);
- assertEquals("source_with_invalid_char", result.toString());
+ assertEquals("+source_with_invalid_char", result.toString());
assertTrue(loginFilter.isStarted());
assertTrue(loginFilter.isStopped());
- assertEquals(4, loginFilter.getInvalidCharacterCount());
+ assertEquals(3, loginFilter.getInvalidCharacterCount());
loginFilter.reset();
result = loginFilter.filter(spannedSource, 0, spannedSource.length(),
diff --git a/tests/tests/text/src/android/text/method/cts/PasswordTransformationMethodTest.java b/tests/tests/text/src/android/text/method/cts/PasswordTransformationMethodTest.java
index ba89c23..5445d3c 100644
--- a/tests/tests/text/src/android/text/method/cts/PasswordTransformationMethodTest.java
+++ b/tests/tests/text/src/android/text/method/cts/PasswordTransformationMethodTest.java
@@ -78,9 +78,9 @@
Button button = new Button(mActicity);
LinearLayout layout = new LinearLayout(mActicity);
layout.setOrientation(LinearLayout.VERTICAL);
- layout.addView(editText, new LayoutParams(LayoutParams.FILL_PARENT,
+ layout.addView(editText, new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT));
- layout.addView(button, new LayoutParams(LayoutParams.FILL_PARENT,
+ layout.addView(button, new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT));
mActicity.setContentView(layout);
editText.requestFocus();
diff --git a/tests/tests/text/src/android/text/method/cts/ScrollingMovementMethodTest.java b/tests/tests/text/src/android/text/method/cts/ScrollingMovementMethodTest.java
index 8e6ddde..907b522 100644
--- a/tests/tests/text/src/android/text/method/cts/ScrollingMovementMethodTest.java
+++ b/tests/tests/text/src/android/text/method/cts/ScrollingMovementMethodTest.java
@@ -230,7 +230,7 @@
public void run() {
mTextView.setLines(1);
getActivity().setContentView(mTextView,
- new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
+ new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
}
});
assertNotNull(mTextView.getLayout());
@@ -596,7 +596,7 @@
public void run() {
mTextView.setLines(1);
getActivity().setContentView(mTextView,
- new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
+ new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
}
});
assertNotNull(mTextView.getLayout());
@@ -833,7 +833,7 @@
runActionOnUiThread(new Runnable() {
public void run() {
getActivity().setContentView(mTextView,
- new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
+ new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
LITTLE_SPACE));
}
});
diff --git a/tests/tests/util/src/android/util/cts/EventLogTagsTest.java b/tests/tests/util/src/android/util/cts/EventLogTagsTest.java
deleted file mode 100644
index 291bc7b..0000000
--- a/tests/tests/util/src/android/util/cts/EventLogTagsTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2008 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.util.cts;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-
-import android.test.AndroidTestCase;
-import android.util.EventLogTags;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
-/**
- * Test class android.util.EventLogTags.
- */
-@TestTargetClass(EventLogTags.class)
-public class EventLogTagsTest extends AndroidTestCase {
-
- private final static String TAGS_FILE = "/etc/event-log-tags";
-
- @TestTargets({
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "EventLogTags",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "EventLogTags",
- args = {BufferedReader.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "get",
- args = {int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "get",
- args = {String.class}
- )
- })
- public void testEventLogTagsOp() throws Exception {
- EventLogTags tags = new EventLogTags();
- assertEquals(42, tags.get("answer").mTag);
- assertEquals(314, tags.get("pi").mTag);
- assertEquals(2718, tags.get("e").mTag);
- assertEquals("answer", tags.get(42).mName);
- assertEquals("pi", tags.get(314).mName);
- assertEquals("e", tags.get(2718).mName);
-
- tags = new EventLogTags(new BufferedReader(new FileReader(TAGS_FILE), 256));
- assertEquals(42, tags.get("answer").mTag);
- assertEquals(314, tags.get("pi").mTag);
- assertEquals(2718, tags.get("e").mTag);
- assertEquals("answer", tags.get(42).mName);
- assertEquals("pi", tags.get(314).mName);
- assertEquals("e", tags.get(2718).mName);
- }
-}
diff --git a/tests/tests/util/src/android/util/cts/EventLogTest.java b/tests/tests/util/src/android/util/cts/EventLogTest.java
new file mode 100644
index 0000000..c803174
--- /dev/null
+++ b/tests/tests/util/src/android/util/cts/EventLogTest.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright (C) 2009 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.util.cts;
+
+import android.os.Process;
+import android.util.EventLog;
+
+import java.io.IOException;
+import java.util.ArrayList;
+
+import junit.framework.TestCase;
+
+public class EventLogTest extends TestCase {
+ private static final int ANSWER_TAG = 42;
+ private static final int PI_TAG = 314;
+ private static final int E_TAG = 2718;
+
+ public void testWriteEvent() throws Exception {
+ long t0 = getTime();
+ EventLog.writeEvent(ANSWER_TAG, 12345);
+ EventLog.writeEvent(ANSWER_TAG, 23456L);
+ EventLog.writeEvent(ANSWER_TAG, "Test");
+ EventLog.writeEvent(ANSWER_TAG, 12345, 23456L, "Test");
+
+ ArrayList<EventLog.Event> events = getEventsSince(t0, new int[] {ANSWER_TAG});
+ assertEquals(4, events.size());
+ assertEquals(ANSWER_TAG, events.get(0).getTag());
+ assertEquals(12345, events.get(0).getData());
+ assertEquals(23456L, events.get(1).getData());
+ assertEquals("Test", events.get(2).getData());
+
+ Object[] arr = (Object[]) events.get(3).getData();
+ assertEquals(3, arr.length);
+ assertEquals(12345, arr[0]);
+ assertEquals(23456L, arr[1]);
+ assertEquals("Test", arr[2]);
+ }
+
+ public void testWriteEventWithOversizeValue() throws Exception {
+ StringBuilder longString = new StringBuilder();
+ for (int i = 0; i < 1000; i++) longString.append("xyzzy");
+
+ Object[] longArray = new Object[1000];
+ for (int i = 0; i < 1000; i++) longArray[i] = 12345;
+
+ long t0 = getTime();
+ EventLog.writeEvent(ANSWER_TAG, longString.toString());
+ EventLog.writeEvent(ANSWER_TAG, "hi", longString.toString());
+ EventLog.writeEvent(ANSWER_TAG, 12345, longString.toString());
+ EventLog.writeEvent(ANSWER_TAG, 12345L, longString.toString());
+ EventLog.writeEvent(ANSWER_TAG, longString.toString(), longString.toString());
+ EventLog.writeEvent(ANSWER_TAG, longArray);
+
+ ArrayList<EventLog.Event> events = getEventsSince(t0, new int[] {ANSWER_TAG});
+ assertEquals(6, events.size());
+
+ // subtract: log header, type byte, final newline
+ final int max = 4096 - 20 - 4 - 1;
+
+ // subtract: string header (type + length)
+ String val0 = (String) events.get(0).getData();
+ assertEquals(max - 5, val0.length());
+
+ // subtract: array header, "hi" header, "hi", string header
+ Object[] arr1 = (Object[]) events.get(1).getData();
+ assertEquals(2, arr1.length);
+ assertEquals("hi", arr1[0]);
+ assertEquals(max - 2 - 5 - 2 - 5, ((String) arr1[1]).length());
+
+ // subtract: array header, int (type + value), string header
+ Object[] arr2 = (Object[]) events.get(2).getData();
+ assertEquals(2, arr2.length);
+ assertEquals(12345, arr2[0]);
+ assertEquals(max - 2 - 5 - 5, ((String) arr2[1]).length());
+
+ // subtract: array header, long, string header
+ Object[] arr3 = (Object[]) events.get(3).getData();
+ assertEquals(2, arr3.length);
+ assertEquals(12345L, arr3[0]);
+ assertEquals(max - 2 - 9 - 5, ((String) arr3[1]).length());
+
+ // subtract: array header, string header (second string is dropped entirely)
+ Object[] arr4 = (Object[]) events.get(4).getData();
+ assertEquals(1, arr4.length);
+ assertEquals(max - 2 - 5, ((String) arr4[0]).length());
+
+ Object[] arr5 = (Object[]) events.get(5).getData();
+ assertEquals(255, arr5.length);
+ assertEquals(12345, arr5[0]);
+ assertEquals(12345, arr5[arr5.length - 1]);
+ }
+
+ public void testWriteNullEvent() throws Exception {
+ long t0 = getTime();
+ EventLog.writeEvent(ANSWER_TAG, (String) null);
+ EventLog.writeEvent(ANSWER_TAG, 12345, (String) null);
+
+ ArrayList<EventLog.Event> events = getEventsSince(t0, new int[] {ANSWER_TAG});
+ assertEquals(2, events.size());
+ assertEquals("NULL", events.get(0).getData());
+
+ Object[] arr = (Object[]) events.get(1).getData();
+ assertEquals(2, arr.length);
+ assertEquals(12345, arr[0]);
+ assertEquals("NULL", arr[1]);
+ }
+
+ public void testReadEvents() throws Exception {
+ long t0 = getTime();
+ EventLog.writeEvent(ANSWER_TAG, 0);
+ long t1 = getTime();
+ EventLog.writeEvent(PI_TAG, "1");
+ long t2 = getTime();
+ EventLog.writeEvent(E_TAG, 2);
+ long t3 = getTime();
+
+ // Exclude E_TAG
+ ArrayList<EventLog.Event> events = getEventsSince(t0, new int[] {ANSWER_TAG, PI_TAG});
+ assertEquals(2, events.size());
+
+ assertEquals(Process.myPid(), events.get(0).getProcessId());
+ assertEquals(Process.myTid(), events.get(0).getThreadId());
+ assertTrue(events.get(0).getTimeNanos() >= t0 * 1000000L);
+ assertTrue(events.get(0).getTimeNanos() <= t1 * 1000000L);
+ assertEquals(ANSWER_TAG, events.get(0).getTag());
+ assertEquals(0, events.get(0).getData());
+
+ assertEquals(Process.myPid(), events.get(1).getProcessId());
+ assertEquals(Process.myTid(), events.get(1).getThreadId());
+ assertTrue(events.get(1).getTimeNanos() >= t1 * 1000000L);
+ assertTrue(events.get(1).getTimeNanos() <= t2 * 1000000L);
+ assertEquals(PI_TAG, events.get(1).getTag());
+ assertEquals("1", events.get(1).getData());
+ }
+
+ public void testGetTagName() throws Exception {
+ assertEquals("answer", EventLog.getTagName(ANSWER_TAG));
+ assertEquals("pi", EventLog.getTagName(PI_TAG));
+ assertEquals("e", EventLog.getTagName(E_TAG));
+ assertEquals(null, EventLog.getTagName(999999999));
+ }
+
+ public void testGetTagCode() throws Exception {
+ assertEquals(ANSWER_TAG, EventLog.getTagCode("answer"));
+ assertEquals(PI_TAG, EventLog.getTagCode("pi"));
+ assertEquals(E_TAG, EventLog.getTagCode("e"));
+ assertEquals(-1, EventLog.getTagCode("does_not_exist"));
+ }
+
+ private long getTime() throws InterruptedException {
+ // The precision of currentTimeMillis is poor compared to event timestamps
+ Thread.sleep(20);
+ return System.currentTimeMillis() - 10;
+ }
+
+ private ArrayList<EventLog.Event> getEventsSince(long since, int[] tags) throws IOException {
+ ArrayList<EventLog.Event> tmp = new ArrayList<EventLog.Event>();
+ EventLog.readEvents(tags, tmp);
+
+ ArrayList<EventLog.Event> out = new ArrayList<EventLog.Event>();
+ for (EventLog.Event event : tmp) {
+ if (event.getTimeNanos() / 1000000 >= since) {
+ out.add(event);
+ }
+ }
+ return out;
+ }
+}
diff --git a/tests/tests/util/src/android/util/cts/PrintWriterPrinterTest.java b/tests/tests/util/src/android/util/cts/PrintWriterPrinterTest.java
index ea9d3d2..3c36bf3 100644
--- a/tests/tests/util/src/android/util/cts/PrintWriterPrinterTest.java
+++ b/tests/tests/util/src/android/util/cts/PrintWriterPrinterTest.java
@@ -24,6 +24,7 @@
import java.io.InputStreamReader;
import java.io.PrintWriter;
+import android.content.Context;
import android.test.AndroidTestCase;
import android.util.PrintWriterPrinter;
import dalvik.annotation.TestTargets;
@@ -37,7 +38,8 @@
@Override
protected void setUp() throws Exception {
super.setUp();
- mFile = new File("sqlite_stmt_journals","print.log");
+ File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE);
+ mFile = new File(dbDir,"print.log");
if (!mFile.exists())
mFile.createNewFile();
}
diff --git a/tests/tests/view/src/android/view/animation/cts/GridLayoutAnimationControllerTest.java b/tests/tests/view/src/android/view/animation/cts/GridLayoutAnimationControllerTest.java
index d6f6377..0392366 100644
--- a/tests/tests/view/src/android/view/animation/cts/GridLayoutAnimationControllerTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/GridLayoutAnimationControllerTest.java
@@ -393,7 +393,7 @@
animationParams.index = index;
animationParams.count = 9;
final AbsListView.LayoutParams layoutParams = new AbsListView.LayoutParams(
- LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
+ LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
layoutParams.layoutAnimationParameters = animationParams;
return layoutParams;
}
diff --git a/tests/tests/view/src/android/view/animation/cts/LayoutAnimationControllerTest.java b/tests/tests/view/src/android/view/animation/cts/LayoutAnimationControllerTest.java
index 3a7cdd8..c736bf8 100644
--- a/tests/tests/view/src/android/view/animation/cts/LayoutAnimationControllerTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/LayoutAnimationControllerTest.java
@@ -461,7 +461,7 @@
animationParams.index = index;
animationParams.count = 3;
final AbsListView.LayoutParams layoutParams = new AbsListView.LayoutParams(
- LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
+ LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
layoutParams.layoutAnimationParameters = animationParams;
return layoutParams;
}
diff --git a/tests/tests/view/src/android/view/cts/LayoutInflaterTest.java b/tests/tests/view/src/android/view/cts/LayoutInflaterTest.java
index ef46db2..6fbd953 100644
--- a/tests/tests/view/src/android/view/cts/LayoutInflaterTest.java
+++ b/tests/tests/view/src/android/view/cts/LayoutInflaterTest.java
@@ -37,7 +37,7 @@
import android.widget.LinearLayout;
import com.android.cts.stub.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestTargets;
import dalvik.annotation.TestTargetNew;
@@ -304,8 +304,8 @@
mLayout.setOrientation(LinearLayout.VERTICAL);
mLayout.setHorizontalGravity(Gravity.LEFT);
mLayout.setLayoutParams(new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.FILL_PARENT));
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
assertEquals(0, mLayout.getChildCount());
view = mLayoutInflater.inflate(R.layout.inflater_layout,
mLayout);
@@ -343,8 +343,8 @@
mLayout.setOrientation(LinearLayout.VERTICAL);
mLayout.setHorizontalGravity(Gravity.LEFT);
mLayout.setLayoutParams(new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.FILL_PARENT));
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
assertEquals(0, mLayout.getChildCount());
view = mLayoutInflater.inflate(R.layout.inflater_layout,
mLayout, false);
@@ -388,8 +388,8 @@
mLayout.setOrientation(LinearLayout.VERTICAL);
mLayout.setHorizontalGravity(Gravity.LEFT);
mLayout.setLayoutParams(new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.FILL_PARENT));
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
assertEquals(0, mLayout.getChildCount());
try {
@@ -447,8 +447,8 @@
mLayout.setOrientation(LinearLayout.VERTICAL);
mLayout.setHorizontalGravity(Gravity.LEFT);
mLayout.setLayoutParams(new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.FILL_PARENT));
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
assertEquals(0, mLayout.getChildCount());
try {
diff --git a/tests/tests/view/src/android/view/cts/ViewGroupTest.java b/tests/tests/view/src/android/view/cts/ViewGroupTest.java
index 6936f7c..df503a8 100644
--- a/tests/tests/view/src/android/view/cts/ViewGroupTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewGroupTest.java
@@ -55,7 +55,7 @@
import android.widget.TextView;
import android.widget.cts.ViewGroupStubActivity;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestTargets;
import dalvik.annotation.TestLevel;
@@ -1018,7 +1018,7 @@
public void testGenerateLayoutParams() {
MockViewGroup vg = new MockViewGroup(mContext);
LayoutParams p = new LayoutParams(LayoutParams.WRAP_CONTENT,
- LayoutParams.FILL_PARENT);
+ LayoutParams.MATCH_PARENT);
assertSame(p, vg.generateLayoutParams(p));
}
diff --git a/tests/tests/view/src/android/view/cts/ViewGroup_LayoutParamsTest.java b/tests/tests/view/src/android/view/cts/ViewGroup_LayoutParamsTest.java
index f38b899..e677ee6 100644
--- a/tests/tests/view/src/android/view/cts/ViewGroup_LayoutParamsTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewGroup_LayoutParamsTest.java
@@ -29,7 +29,7 @@
import android.view.ViewGroup.LayoutParams;
import com.android.cts.stub.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestTargets;
import dalvik.annotation.TestLevel;
diff --git a/tests/tests/view/src/android/view/cts/ViewGroup_MarginLayoutParamsTest.java b/tests/tests/view/src/android/view/cts/ViewGroup_MarginLayoutParamsTest.java
index b395fc7..c1a7801 100644
--- a/tests/tests/view/src/android/view/cts/ViewGroup_MarginLayoutParamsTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewGroup_MarginLayoutParamsTest.java
@@ -24,7 +24,7 @@
import android.view.ViewGroup.LayoutParams;
import android.view.ViewGroup.MarginLayoutParams;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import com.android.cts.stub.R;
import dalvik.annotation.TestTargets;
diff --git a/tests/tests/view/src/android/view/cts/WindowTest.java b/tests/tests/view/src/android/view/cts/WindowTest.java
index f65c30b..527f444 100644
--- a/tests/tests/view/src/android/view/cts/WindowTest.java
+++ b/tests/tests/view/src/android/view/cts/WindowTest.java
@@ -203,8 +203,8 @@
// default attributes
WindowManager.LayoutParams attr = mWindow.getAttributes();
- assertEquals(WindowManager.LayoutParams.FILL_PARENT, attr.width);
- assertEquals(WindowManager.LayoutParams.FILL_PARENT, attr.height);
+ assertEquals(WindowManager.LayoutParams.MATCH_PARENT, attr.width);
+ assertEquals(WindowManager.LayoutParams.MATCH_PARENT, attr.height);
assertEquals(WindowManager.LayoutParams.TYPE_APPLICATION, attr.type);
assertEquals(PixelFormat.OPAQUE, attr.format);
@@ -975,7 +975,7 @@
/**
* Set the width and height layout parameters of the window.
- * 1.The default for both of these is FILL_PARENT;
+ * 1.The default for both of these is MATCH_PARENT;
* 2.You can change them to WRAP_CONTENT to make a window that is not full-screen.
*/
@TestTargetNew(
@@ -986,8 +986,8 @@
public void testSetLayout() throws Exception {
mWindow = new MockWindow(mContext);
WindowManager.LayoutParams attrs = mWindow.getAttributes();
- assertEquals(WindowManager.LayoutParams.FILL_PARENT, attrs.width);
- assertEquals(WindowManager.LayoutParams.FILL_PARENT, attrs.height);
+ assertEquals(WindowManager.LayoutParams.MATCH_PARENT, attrs.width);
+ assertEquals(WindowManager.LayoutParams.MATCH_PARENT, attrs.height);
MockWindowCallback callback = new MockWindowCallback();
mWindow.setCallback(callback);
diff --git a/tests/tests/webkit/src/android/webkit/cts/DateSorterTest.java b/tests/tests/webkit/src/android/webkit/cts/DateSorterTest.java
index 82bb402..180336f 100644
--- a/tests/tests/webkit/src/android/webkit/cts/DateSorterTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/DateSorterTest.java
@@ -16,7 +16,6 @@
package android.webkit.cts;
-import dalvik.annotation.BrokenTest;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
import dalvik.annotation.TestTargetNew;
@@ -84,15 +83,15 @@
args = {long.class}
)
})
- @BrokenTest(value="time-based test, fixed in next release. bug 2361382")
public void testGetIndex() {
DateSorter dateSorter = new DateSorter(mContext);
for (int i = 0; i < DateSorter.DAY_COUNT; i++) {
long boundary = dateSorter.getBoundary(i);
- int nextIndex = Math.min(i + 1, DateSorter.DAY_COUNT - 1);
+ int nextIndex = i + 1;
assertEquals(i, dateSorter.getIndex(boundary + 1));
+ if (i == DateSorter.DAY_COUNT - 1) break;
assertEquals(nextIndex, dateSorter.getIndex(boundary));
assertEquals(nextIndex, dateSorter.getIndex(boundary-1));
}
@@ -105,7 +104,6 @@
args = {int.class}
)
})
- @BrokenTest(value="time-based test, fixed in next release. bug 2361382")
public void testGetBoundary() {
DateSorter dateSorter = new DateSorter(mContext);
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
index dffec7e..49d68c6 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
@@ -118,28 +118,6 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- method = "onTooManyRedirects",
- args = {WebView.class, Message.class, Message.class}
- )
- @ToBeFixed(explanation="onTooManyRedirects() is never called")
- public void testOnTooManyRedirects() throws Exception {
- final MockWebViewClient webViewClient = new MockWebViewClient();
- mWebView.setWebViewClient(webViewClient);
- mWebServer = new CtsTestServer(getActivity());
-
- assertFalse(webViewClient.hasOnTooManyRedirectsCalled());
- assertEquals(0, webViewClient.hasOnReceivedErrorCode());
- String url = mWebServer.getRedirectingAssetUrl(TestHtmlConstants.HELLO_WORLD_URL, 100);
- assertLoadUrlSuccessfully(mWebView, url);
- // ToBeFixed: onTooManyRedirects() is meant to give the application the choice of continuing
- // to follow the redirects, but never gets called. onReceivedError() shadows the callback
- // and aborts unconditionally.
- assertEquals(WebViewClient.ERROR_REDIRECT_LOOP, webViewClient.hasOnReceivedErrorCode());
- assertFalse(webViewClient.hasOnTooManyRedirectsCalled());
- }
-
- @TestTargetNew(
- level = TestLevel.COMPLETE,
method = "onReceivedError",
args = {WebView.class, int.class, String.class, String.class}
)
@@ -292,7 +270,6 @@
private boolean mOnPageStartedCalled;
private boolean mOnPageFinishedCalled;
private boolean mOnLoadResourceCalled;
- private boolean mOnTooManyRedirectsCalled;
private int mOnReceivedErrorCode;
private boolean mOnFormResubmissionCalled;
private boolean mDoUpdateVisitedHistoryCalled;
@@ -312,10 +289,6 @@
return mOnLoadResourceCalled;
}
- public boolean hasOnTooManyRedirectsCalled() {
- return mOnTooManyRedirectsCalled;
- }
-
public int hasOnReceivedErrorCode() {
return mOnReceivedErrorCode;
}
@@ -362,12 +335,6 @@
}
@Override
- public void onTooManyRedirects(WebView view, Message cancelMsg, Message continueMsg) {
- mOnTooManyRedirectsCalled = true;
- continueMsg.sendToTarget();
- }
-
- @Override
public void onReceivedError(WebView view, int errorCode,
String description, String failingUrl) {
super.onReceivedError(view, errorCode, description, failingUrl);
diff --git a/tests/tests/widget/src/android/widget/cts/AbsListViewTest.java b/tests/tests/widget/src/android/widget/cts/AbsListViewTest.java
index a70aec6..ffd57df 100644
--- a/tests/tests/widget/src/android/widget/cts/AbsListViewTest.java
+++ b/tests/tests/widget/src/android/widget/cts/AbsListViewTest.java
@@ -684,13 +684,13 @@
assertTrue(res instanceof AbsListView.LayoutParams);
MyListView listView = new MyListView(mActivity);
- ViewGroup.LayoutParams p = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams p = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
res = listView.generateLayoutParams(p);
assertNotNull(res);
assertTrue(res instanceof AbsListView.LayoutParams);
- assertEquals(ViewGroup.LayoutParams.FILL_PARENT, res.width);
+ assertEquals(ViewGroup.LayoutParams.MATCH_PARENT, res.width);
assertEquals(ViewGroup.LayoutParams.WRAP_CONTENT, res.height);
}
diff --git a/tests/tests/widget/src/android/widget/cts/AbsListView_LayoutParamsTest.java b/tests/tests/widget/src/android/widget/cts/AbsListView_LayoutParamsTest.java
index 7d43a4f..7403614 100644
--- a/tests/tests/widget/src/android/widget/cts/AbsListView_LayoutParamsTest.java
+++ b/tests/tests/widget/src/android/widget/cts/AbsListView_LayoutParamsTest.java
@@ -76,15 +76,15 @@
assertEquals(TEST_WIDTH, layoutParams.width);
assertEquals(TEST_HEIGHT, layoutParams.height);
- layoutParams = new AbsListView.LayoutParams(LayoutParams.FILL_PARENT,
- LayoutParams.FILL_PARENT);
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.width);
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.height);
+ layoutParams = new AbsListView.LayoutParams(LayoutParams.MATCH_PARENT,
+ LayoutParams.MATCH_PARENT);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.width);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.height);
- layoutParams = new AbsListView.LayoutParams(LayoutParams.FILL_PARENT,
- LayoutParams.FILL_PARENT, 0);
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.width);
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.height);
+ layoutParams = new AbsListView.LayoutParams(LayoutParams.MATCH_PARENT,
+ LayoutParams.MATCH_PARENT, 0);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.width);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.height);
AbsListView.LayoutParams tmpParams = new AbsListView.LayoutParams(TEST_WIDTH, TEST_HEIGHT2);
layoutParams = new AbsListView.LayoutParams(tmpParams);
diff --git a/tests/tests/widget/src/android/widget/cts/AbsSpinnerTest.java b/tests/tests/widget/src/android/widget/cts/AbsSpinnerTest.java
index 3b9954b..aa65111 100644
--- a/tests/tests/widget/src/android/widget/cts/AbsSpinnerTest.java
+++ b/tests/tests/widget/src/android/widget/cts/AbsSpinnerTest.java
@@ -369,7 +369,7 @@
public void testGenerateDefaultLayoutParams() {
// final MockSpinner absSpinner = new MockSpinner(mContext);
// LayoutParams layoutParams = (LayoutParams) absSpinner.generateDefaultLayoutParams();
-// assertEquals(LayoutParams.FILL_PARENT, layoutParams.width);
+// assertEquals(LayoutParams.MATCH_PARENT, layoutParams.width);
// assertEquals(LayoutParams.WRAP_CONTENT, layoutParams.height);
}
diff --git a/tests/tests/widget/src/android/widget/cts/AbsoluteLayoutTest.java b/tests/tests/widget/src/android/widget/cts/AbsoluteLayoutTest.java
index 28f074e..e1db2ca 100644
--- a/tests/tests/widget/src/android/widget/cts/AbsoluteLayoutTest.java
+++ b/tests/tests/widget/src/android/widget/cts/AbsoluteLayoutTest.java
@@ -159,8 +159,8 @@
LayoutParams params = (LayoutParams) layout.generateLayoutParams(getAttributeSet());
assertNotNull(params);
- assertEquals(LayoutParams.FILL_PARENT, params.width);
- assertEquals(LayoutParams.FILL_PARENT, params.height);
+ assertEquals(LayoutParams.MATCH_PARENT, params.width);
+ assertEquals(LayoutParams.MATCH_PARENT, params.height);
assertEquals(0, params.x);
assertEquals(0, params.y);
diff --git a/tests/tests/widget/src/android/widget/cts/AlphabetIndexerTest.java b/tests/tests/widget/src/android/widget/cts/AlphabetIndexerTest.java
index 50a9472..59b940c 100644
--- a/tests/tests/widget/src/android/widget/cts/AlphabetIndexerTest.java
+++ b/tests/tests/widget/src/android/widget/cts/AlphabetIndexerTest.java
@@ -16,7 +16,7 @@
package android.widget.cts;
-import com.android.internal.database.ArrayListCursor;
+import com.android.common.ArrayListCursor;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
diff --git a/tests/tests/widget/src/android/widget/cts/AutoCompleteTextViewTest.java b/tests/tests/widget/src/android/widget/cts/AutoCompleteTextViewTest.java
index 614e81a..5bfce3a 100644
--- a/tests/tests/widget/src/android/widget/cts/AutoCompleteTextViewTest.java
+++ b/tests/tests/widget/src/android/widget/cts/AutoCompleteTextViewTest.java
@@ -859,8 +859,8 @@
mAutoCompleteTextView.setDropDownWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
assertEquals(ViewGroup.LayoutParams.WRAP_CONTENT, mAutoCompleteTextView.getDropDownWidth());
- mAutoCompleteTextView.setDropDownWidth(ViewGroup.LayoutParams.FILL_PARENT);
- assertEquals(ViewGroup.LayoutParams.FILL_PARENT, mAutoCompleteTextView.getDropDownWidth());
+ mAutoCompleteTextView.setDropDownWidth(ViewGroup.LayoutParams.MATCH_PARENT);
+ assertEquals(ViewGroup.LayoutParams.MATCH_PARENT, mAutoCompleteTextView.getDropDownWidth());
}
private static class MockOnItemClickListener implements AdapterView.OnItemClickListener {
diff --git a/tests/tests/widget/src/android/widget/cts/CursorAdapterTest.java b/tests/tests/widget/src/android/widget/cts/CursorAdapterTest.java
index 1798a84..9627b6f 100644
--- a/tests/tests/widget/src/android/widget/cts/CursorAdapterTest.java
+++ b/tests/tests/widget/src/android/widget/cts/CursorAdapterTest.java
@@ -66,7 +66,8 @@
@Override
protected void setUp() throws Exception {
super.setUp();
- mDatabaseFile = new File("/sqlite_stmt_journals", "database_test.db");
+ File dbDir = getContext().getDir("tests", Context.MODE_WORLD_WRITEABLE);
+ mDatabaseFile = new File(dbDir, "database_test.db");
if (mDatabaseFile.exists()) {
mDatabaseFile.delete();
}
diff --git a/tests/tests/widget/src/android/widget/cts/CursorTreeAdapterTest.java b/tests/tests/widget/src/android/widget/cts/CursorTreeAdapterTest.java
index 93b2e90..0927b61 100644
--- a/tests/tests/widget/src/android/widget/cts/CursorTreeAdapterTest.java
+++ b/tests/tests/widget/src/android/widget/cts/CursorTreeAdapterTest.java
@@ -91,7 +91,8 @@
@Override
protected void setUp() throws Exception {
super.setUp();
- mDatabaseFile = new File("/sqlite_stmt_journals", "database_test.db");
+ File dbDir = getContext().getDir("tests", Context.MODE_WORLD_WRITEABLE);
+ mDatabaseFile = new File(dbDir, "database_test.db");
if (mDatabaseFile.exists()) {
mDatabaseFile.delete();
}
diff --git a/tests/tests/widget/src/android/widget/cts/DatePickerTest.java b/tests/tests/widget/src/android/widget/cts/DatePickerTest.java
index 1de4f42..a08f638 100644
--- a/tests/tests/widget/src/android/widget/cts/DatePickerTest.java
+++ b/tests/tests/widget/src/android/widget/cts/DatePickerTest.java
@@ -17,7 +17,7 @@
package android.widget.cts;
import com.android.cts.stub.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
diff --git a/tests/tests/widget/src/android/widget/cts/DigitalClockTest.java b/tests/tests/widget/src/android/widget/cts/DigitalClockTest.java
index cf23382..52cae16 100644
--- a/tests/tests/widget/src/android/widget/cts/DigitalClockTest.java
+++ b/tests/tests/widget/src/android/widget/cts/DigitalClockTest.java
@@ -31,7 +31,7 @@
import android.widget.LinearLayout;
import com.android.cts.stub.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestTargets;
import dalvik.annotation.TestLevel;
diff --git a/tests/tests/widget/src/android/widget/cts/FrameLayoutTest.java b/tests/tests/widget/src/android/widget/cts/FrameLayoutTest.java
index 72ebcf1..1d5d925 100644
--- a/tests/tests/widget/src/android/widget/cts/FrameLayoutTest.java
+++ b/tests/tests/widget/src/android/widget/cts/FrameLayoutTest.java
@@ -276,13 +276,13 @@
)
public void testGenerateLayoutParams1() {
MyFrameLayout myFrameLayout = new MyFrameLayout(mActivity);
- ViewGroup.LayoutParams p = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams p = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
ViewGroup.LayoutParams params = myFrameLayout.generateLayoutParams(p);
assertNotNull(params);
assertTrue(params instanceof FrameLayout.LayoutParams);
- assertEquals(ViewGroup.LayoutParams.FILL_PARENT, params.width);
+ assertEquals(ViewGroup.LayoutParams.MATCH_PARENT, params.width);
assertEquals(ViewGroup.LayoutParams.WRAP_CONTENT, params.height);
}
@@ -296,8 +296,8 @@
FrameLayout.LayoutParams params = mFrameLayout.generateLayoutParams(attrs);
assertNotNull(params);
- assertEquals(ViewGroup.LayoutParams.FILL_PARENT, params.width);
- assertEquals(ViewGroup.LayoutParams.FILL_PARENT, params.height);
+ assertEquals(ViewGroup.LayoutParams.MATCH_PARENT, params.width);
+ assertEquals(ViewGroup.LayoutParams.MATCH_PARENT, params.height);
assertEquals(Gravity.BOTTOM, params.gravity);
}
@@ -339,8 +339,8 @@
FrameLayout.LayoutParams params = frameLayout.generateDefaultLayoutParams();
assertNotNull(params);
- assertEquals(LayoutParams.FILL_PARENT, params.width);
- assertEquals(LayoutParams.FILL_PARENT, params.height);
+ assertEquals(LayoutParams.MATCH_PARENT, params.width);
+ assertEquals(LayoutParams.MATCH_PARENT, params.height);
}
@TestTargetNew(
diff --git a/tests/tests/widget/src/android/widget/cts/FrameLayout_LayoutParamsTest.java b/tests/tests/widget/src/android/widget/cts/FrameLayout_LayoutParamsTest.java
index 6eeeb43..c40c984 100644
--- a/tests/tests/widget/src/android/widget/cts/FrameLayout_LayoutParamsTest.java
+++ b/tests/tests/widget/src/android/widget/cts/FrameLayout_LayoutParamsTest.java
@@ -78,7 +78,7 @@
AttributeSet attrs = getAttributeSet();
new LayoutParams(mContext, attrs);
- new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
+ new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 0);
new LayoutParams(new ViewGroup.LayoutParams(mContext, attrs));
new LayoutParams(new LayoutParams(mContext, attrs));
diff --git a/tests/tests/widget/src/android/widget/cts/GalleryTest.java b/tests/tests/widget/src/android/widget/cts/GalleryTest.java
index b58be62..9923ec8 100644
--- a/tests/tests/widget/src/android/widget/cts/GalleryTest.java
+++ b/tests/tests/widget/src/android/widget/cts/GalleryTest.java
@@ -295,8 +295,8 @@
mGallery = new Gallery(mContext, attrs);
layoutParams = mGallery.generateLayoutParams(attrs);
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.width);
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.height);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.width);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.height);
}
@TestTargets({
diff --git a/tests/tests/widget/src/android/widget/cts/GridViewTest.java b/tests/tests/widget/src/android/widget/cts/GridViewTest.java
index 661466d..65045d8 100644
--- a/tests/tests/widget/src/android/widget/cts/GridViewTest.java
+++ b/tests/tests/widget/src/android/widget/cts/GridViewTest.java
@@ -658,7 +658,7 @@
public void testScroll() throws Throwable {
final MockGridView mockGridView= new MockGridView(mActivity);
final ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
+ ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
// this test case can not be ran in UI thread.
runTestOnUiThread(new Runnable() {
public void run() {
diff --git a/tests/tests/widget/src/android/widget/cts/ImageSwitcherTest.java b/tests/tests/widget/src/android/widget/cts/ImageSwitcherTest.java
index 7357ad3..67aa005 100644
--- a/tests/tests/widget/src/android/widget/cts/ImageSwitcherTest.java
+++ b/tests/tests/widget/src/android/widget/cts/ImageSwitcherTest.java
@@ -26,6 +26,7 @@
import org.xmlpull.v1.XmlPullParser;
+import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -131,9 +132,8 @@
ImageView iv1 = new ImageView(getContext());
imageSwitcher.addView(iv1);
- // because I can not write file in /data/data/com.android, it will throw IOException.
- // I just write the image file into database test path.
- File imagefile = new File("/sqlite_stmt_journals", "tempimage.jpg");
+ File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE);
+ File imagefile = new File(dbDir, "tempimage.jpg");
if (imagefile.exists()) {
imagefile.delete();
}
diff --git a/tests/tests/widget/src/android/widget/cts/ImageViewTest.java b/tests/tests/widget/src/android/widget/cts/ImageViewTest.java
index 295ac93..2bf064c 100644
--- a/tests/tests/widget/src/android/widget/cts/ImageViewTest.java
+++ b/tests/tests/widget/src/android/widget/cts/ImageViewTest.java
@@ -264,9 +264,9 @@
mImageView.setImageURI(null);
assertNull(mImageView.getDrawable());
- // because I can not write file in /data/data/com.android, it will throw IOException.
- // I just write the image file into database test path.
- File imagefile = new File("/sqlite_stmt_journals", "tempimage.jpg");
+ File dbDir = getInstrumentation().getTargetContext().getDir("tests",
+ Context.MODE_PRIVATE);
+ File imagefile = new File(dbDir, "tempimage.jpg");
if (imagefile.exists()) {
imagefile.delete();
}
diff --git a/tests/tests/widget/src/android/widget/cts/LinearLayoutTest.java b/tests/tests/widget/src/android/widget/cts/LinearLayoutTest.java
index 64f4779..7abd6d2 100644
--- a/tests/tests/widget/src/android/widget/cts/LinearLayoutTest.java
+++ b/tests/tests/widget/src/android/widget/cts/LinearLayoutTest.java
@@ -250,7 +250,7 @@
@ToBeFixed(bug="1417734", explanation="generateLayoutParams(AttributeSet)" +
" will throw a RuntimeException:" +
" Binary XML file line #-1: You must supply a layout_width attribute." +
- " But 'layout_width' attribute have been assigned to be 'fill_parent'.")
+ " But 'layout_width' attribute have been assigned to be 'match_parent'.")
public void testGenerateLayoutParams() {
ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(320, 240);
MockLinearLayout mockLinearLayout = new MockLinearLayout(mContext);
@@ -263,7 +263,7 @@
// AttributeSet attrs = Xml.asAttributeSet(parser);
// LinearLayout linearLayout = new LinearLayout(mContext, attrs);
// LayoutParams layoutParams2 = linearLayout.generateLayoutParams(attrs);
-// assertEquals(LayoutParams.FILL_PARENT, layoutParams2.width);
+// assertEquals(LayoutParams.MATCH_PARENT, layoutParams2.width);
// assertEquals(LayoutParams.WRAP_CONTENT, layoutParams2.height);
}
@@ -303,7 +303,7 @@
param = mockLinearLayout.generateDefaultLayoutParams();
assertNotNull(param);
assertTrue(param instanceof LinearLayout.LayoutParams);
- assertEquals(ViewGroup.LayoutParams.FILL_PARENT, param.width);
+ assertEquals(ViewGroup.LayoutParams.MATCH_PARENT, param.width);
assertEquals(ViewGroup.LayoutParams.WRAP_CONTENT, param.height);
mockLinearLayout.setOrientation(-1);
diff --git a/tests/tests/widget/src/android/widget/cts/LinearLayout_LayoutParamsTest.java b/tests/tests/widget/src/android/widget/cts/LinearLayout_LayoutParamsTest.java
index 4b6257a..3354d59 100644
--- a/tests/tests/widget/src/android/widget/cts/LinearLayout_LayoutParamsTest.java
+++ b/tests/tests/widget/src/android/widget/cts/LinearLayout_LayoutParamsTest.java
@@ -17,7 +17,7 @@
package android.widget.cts;
import com.android.cts.stub.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
diff --git a/tests/tests/widget/src/android/widget/cts/PopupWindowTest.java b/tests/tests/widget/src/android/widget/cts/PopupWindowTest.java
index 7f65a2e..c94e86f 100644
--- a/tests/tests/widget/src/android/widget/cts/PopupWindowTest.java
+++ b/tests/tests/widget/src/android/widget/cts/PopupWindowTest.java
@@ -1002,7 +1002,7 @@
assertEquals(0, p.width);
assertEquals(0, p.height);
- mPopupWindow.setWindowLayoutMode(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT);
+ mPopupWindow.setWindowLayoutMode(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
mInstrumentation.runOnMainSync(new Runnable() {
public void run() {
mPopupWindow.update(20, 50, 50, 50);
@@ -1010,7 +1010,7 @@
});
assertEquals(LayoutParams.WRAP_CONTENT, p.width);
- assertEquals(LayoutParams.FILL_PARENT, p.height);
+ assertEquals(LayoutParams.MATCH_PARENT, p.height);
}
/**
diff --git a/tests/tests/widget/src/android/widget/cts/RadioGroupTest.java b/tests/tests/widget/src/android/widget/cts/RadioGroupTest.java
index fa2dd7d..d01d538 100644
--- a/tests/tests/widget/src/android/widget/cts/RadioGroupTest.java
+++ b/tests/tests/widget/src/android/widget/cts/RadioGroupTest.java
@@ -382,8 +382,8 @@
assertEquals(5, layoutParams.topMargin);
assertEquals(5, layoutParams.rightMargin);
assertEquals(5, layoutParams.bottomMargin);
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.width);
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.height);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.width);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.height);
}
@TestTargetNew(
@@ -398,15 +398,15 @@
assertFalse(mRadioGroupWrapper.checkLayoutParams(null));
RelativeLayout.LayoutParams relativeParams = new RelativeLayout.LayoutParams(
- RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT);
+ RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
assertFalse(mRadioGroupWrapper.checkLayoutParams(relativeParams));
LinearLayout.LayoutParams linearParams = new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT);
+ LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
assertFalse(mRadioGroupWrapper.checkLayoutParams(linearParams));
RadioGroup.LayoutParams radioParams = new RadioGroup.LayoutParams(
- RadioGroup.LayoutParams.FILL_PARENT, RadioGroup.LayoutParams.FILL_PARENT);
+ RadioGroup.LayoutParams.MATCH_PARENT, RadioGroup.LayoutParams.MATCH_PARENT);
assertTrue(mRadioGroupWrapper.checkLayoutParams(radioParams));
}
diff --git a/tests/tests/widget/src/android/widget/cts/RadioGroup_LayoutParamsTest.java b/tests/tests/widget/src/android/widget/cts/RadioGroup_LayoutParamsTest.java
index a08dd16..eda95c0 100644
--- a/tests/tests/widget/src/android/widget/cts/RadioGroup_LayoutParamsTest.java
+++ b/tests/tests/widget/src/android/widget/cts/RadioGroup_LayoutParamsTest.java
@@ -167,8 +167,8 @@
assertEquals(5, mLayoutParams.topMargin);
assertEquals(5, mLayoutParams.rightMargin);
assertEquals(5, mLayoutParams.bottomMargin);
- assertEquals(LayoutParams.FILL_PARENT, mLayoutParams.width);
- assertEquals(LayoutParams.FILL_PARENT, mLayoutParams.height);
+ assertEquals(LayoutParams.MATCH_PARENT, mLayoutParams.width);
+ assertEquals(LayoutParams.MATCH_PARENT, mLayoutParams.height);
mLayoutParams = new RadioGroup.LayoutParams(getContext(), null);
assertEquals(RadioGroup.LayoutParams.WRAP_CONTENT, mLayoutParams.width);
@@ -199,8 +199,8 @@
R.styleable.ViewGroup_MarginLayout_layout_width,
R.styleable.ViewGroup_MarginLayout_layout_height);
// check the attributes from the layout file
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.width);
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.height);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.width);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.height);
}
private AttributeSet getAttributeSet(int resId) {
diff --git a/tests/tests/widget/src/android/widget/cts/RelativeLayoutTest.java b/tests/tests/widget/src/android/widget/cts/RelativeLayoutTest.java
index 943e58e..34a5038 100644
--- a/tests/tests/widget/src/android/widget/cts/RelativeLayoutTest.java
+++ b/tests/tests/widget/src/android/widget/cts/RelativeLayoutTest.java
@@ -17,7 +17,7 @@
package android.widget.cts;
import com.android.cts.stub.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
@@ -325,8 +325,8 @@
XmlResourceParser parser = mActivity.getResources().getLayout(R.layout.relative_layout);
XmlUtils.beginDocument(parser, "RelativeLayout");
LayoutParams layoutParams = relativeLayout.generateLayoutParams(parser);
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.width);
- assertEquals(LayoutParams.FILL_PARENT, layoutParams.height);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.width);
+ assertEquals(LayoutParams.MATCH_PARENT, layoutParams.height);
// exceptional value
try {
diff --git a/tests/tests/widget/src/android/widget/cts/ResourceCursorAdapterTest.java b/tests/tests/widget/src/android/widget/cts/ResourceCursorAdapterTest.java
index 6f87c61..38ec995 100644
--- a/tests/tests/widget/src/android/widget/cts/ResourceCursorAdapterTest.java
+++ b/tests/tests/widget/src/android/widget/cts/ResourceCursorAdapterTest.java
@@ -17,7 +17,7 @@
package android.widget.cts;
import com.android.cts.stub.R;
-import com.android.internal.database.ArrayListCursor;
+import com.android.common.ArrayListCursor;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
diff --git a/tests/tests/widget/src/android/widget/cts/ResourceCursorTreeAdapterTest.java b/tests/tests/widget/src/android/widget/cts/ResourceCursorTreeAdapterTest.java
index 7788437..716104d 100644
--- a/tests/tests/widget/src/android/widget/cts/ResourceCursorTreeAdapterTest.java
+++ b/tests/tests/widget/src/android/widget/cts/ResourceCursorTreeAdapterTest.java
@@ -17,7 +17,7 @@
package android.widget.cts;
import com.android.cts.stub.R;
-import com.android.internal.database.ArrayListCursor;
+import com.android.common.ArrayListCursor;
import dalvik.annotation.TestTargets;
import dalvik.annotation.TestLevel;
diff --git a/tests/tests/widget/src/android/widget/cts/SimpleCursorAdapterTest.java b/tests/tests/widget/src/android/widget/cts/SimpleCursorAdapterTest.java
index bde16eb..8f32228 100644
--- a/tests/tests/widget/src/android/widget/cts/SimpleCursorAdapterTest.java
+++ b/tests/tests/widget/src/android/widget/cts/SimpleCursorAdapterTest.java
@@ -17,7 +17,7 @@
package android.widget.cts;
import com.android.cts.stub.R;
-import com.android.internal.database.ArrayListCursor;
+import com.android.common.ArrayListCursor;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
diff --git a/tests/tests/widget/src/android/widget/cts/SimpleCursorTreeAdapterTest.java b/tests/tests/widget/src/android/widget/cts/SimpleCursorTreeAdapterTest.java
index c140af2..7295e75 100644
--- a/tests/tests/widget/src/android/widget/cts/SimpleCursorTreeAdapterTest.java
+++ b/tests/tests/widget/src/android/widget/cts/SimpleCursorTreeAdapterTest.java
@@ -17,7 +17,7 @@
package android.widget.cts;
import com.android.cts.stub.R;
-import com.android.internal.database.ArrayListCursor;
+import com.android.common.ArrayListCursor;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
diff --git a/tests/tests/widget/src/android/widget/cts/TabWidgetTest.java b/tests/tests/widget/src/android/widget/cts/TabWidgetTest.java
index f09219f..2327965 100644
--- a/tests/tests/widget/src/android/widget/cts/TabWidgetTest.java
+++ b/tests/tests/widget/src/android/widget/cts/TabWidgetTest.java
@@ -228,7 +228,7 @@
LayoutParams defaultLayoutParam = mockTabWidget.generateDefaultLayoutParams();
if (mockTabWidget.getOrientation() == LinearLayout.VERTICAL) {
assertEquals(defaultLayoutParam.height, LayoutParams.WRAP_CONTENT);
- assertEquals(defaultLayoutParam.width, LayoutParams.FILL_PARENT);
+ assertEquals(defaultLayoutParam.width, LayoutParams.MATCH_PARENT);
} else if (mockTabWidget.getOrientation() == LinearLayout.HORIZONTAL) {
assertEquals(defaultLayoutParam.height, LayoutParams.WRAP_CONTENT);
assertEquals(defaultLayoutParam.width, LayoutParams.WRAP_CONTENT);
diff --git a/tests/tests/widget/src/android/widget/cts/TableLayout_LayoutParamsTest.java b/tests/tests/widget/src/android/widget/cts/TableLayout_LayoutParamsTest.java
index a838476..c389d00 100644
--- a/tests/tests/widget/src/android/widget/cts/TableLayout_LayoutParamsTest.java
+++ b/tests/tests/widget/src/android/widget/cts/TableLayout_LayoutParamsTest.java
@@ -22,12 +22,10 @@
import android.test.InstrumentationTestCase;
import android.util.AttributeSet;
import android.util.Xml;
-import android.view.ViewGroup;
-import android.view.ViewGroup.MarginLayoutParams;
import android.widget.TableLayout;
import com.android.internal.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestTargets;
import dalvik.annotation.TestTargetNew;
@@ -92,12 +90,12 @@
new TableLayout.LayoutParams(mTargetContext, null);
TableLayout.LayoutParams layoutParams = new TableLayout.LayoutParams(200, 300);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, layoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, layoutParams.width);
assertEquals(300, layoutParams.height);
TableLayout.LayoutParams oldParams = layoutParams;
layoutParams = new TableLayout.LayoutParams(200, 300, 1.2f);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, layoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, layoutParams.width);
assertEquals(300, layoutParams.height);
assertEquals(1.2f, layoutParams.weight);
TableLayout.LayoutParams oldMarginParams = layoutParams;
@@ -105,11 +103,11 @@
new TableLayout.LayoutParams();
layoutParams = new TableLayout.LayoutParams(oldParams);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, layoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, layoutParams.width);
assertEquals(300, layoutParams.height);
layoutParams = new TableLayout.LayoutParams(oldMarginParams);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, layoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, layoutParams.width);
assertEquals(300, layoutParams.height);
}
@@ -122,7 +120,7 @@
@ToBeFixed( bug = "1417734", explanation = "NullPointerException issue")
public void testSetBaseAttributes() {
MockTableLayout_LayoutParams mockLayoutParams = new MockTableLayout_LayoutParams(200, 300);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.width);
assertEquals(300, mockLayoutParams.height);
// base_attr_pixel: layout_width = 400px, layout_height = 600px
@@ -131,28 +129,28 @@
mockLayoutParams.setBaseAttributes(a, R.styleable.ViewGroup_Layout_layout_width,
R.styleable.ViewGroup_Layout_layout_height);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.width);
assertEquals(600, mockLayoutParams.height);
mockLayoutParams.setBaseAttributes(a, R.styleable.ViewGroup_Layout_layout_height,
R.styleable.ViewGroup_Layout_layout_width);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.width);
assertEquals(400, mockLayoutParams.height);
a.recycle();
- // base_attr_fillwrap: layout_width = "fill_parent", layout_height = "wrap_content"
+ // base_attr_fillwrap: layout_width = "match_parent", layout_height = "wrap_content"
attrs = getAttrs("base_attr_fillwrap");
a = mTargetContext.obtainStyledAttributes(attrs, R.styleable.ViewGroup_Layout);
mockLayoutParams.setBaseAttributes(a, R.styleable.ViewGroup_Layout_layout_width,
R.styleable.ViewGroup_Layout_layout_height);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.width);
assertEquals(TableLayout.LayoutParams.WRAP_CONTENT, mockLayoutParams.height);
mockLayoutParams.setBaseAttributes(a, R.styleable.ViewGroup_Layout_layout_height,
R.styleable.ViewGroup_Layout_layout_width);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.width);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.height);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.height);
a.recycle();
// base_attr_noheight: layout_width = 600px, no layout_height.
@@ -161,12 +159,12 @@
mockLayoutParams.setBaseAttributes(a, R.styleable.ViewGroup_Layout_layout_width,
R.styleable.ViewGroup_Layout_layout_height);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.width);
assertEquals(TableLayout.LayoutParams.WRAP_CONTENT, mockLayoutParams.height);
mockLayoutParams.setBaseAttributes(a, R.styleable.ViewGroup_Layout_layout_height,
R.styleable.ViewGroup_Layout_layout_width);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.width);
assertEquals(600, mockLayoutParams.height);
try {
@@ -177,7 +175,7 @@
}
mockLayoutParams.setBaseAttributes(a, -1, R.styleable.ViewGroup_Layout_layout_height);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.width);
assertEquals(TableLayout.LayoutParams.WRAP_CONTENT, mockLayoutParams.height);
try {
diff --git a/tests/tests/widget/src/android/widget/cts/TableRow_LayoutParamsTest.java b/tests/tests/widget/src/android/widget/cts/TableRow_LayoutParamsTest.java
index 8ec8c34..9de15c0 100644
--- a/tests/tests/widget/src/android/widget/cts/TableRow_LayoutParamsTest.java
+++ b/tests/tests/widget/src/android/widget/cts/TableRow_LayoutParamsTest.java
@@ -30,7 +30,7 @@
import android.widget.TableRow;
import com.android.internal.R;
-import com.android.internal.util.XmlUtils;
+import com.android.common.XmlUtils;
import dalvik.annotation.TestTargets;
import dalvik.annotation.TestTargetNew;
@@ -188,19 +188,19 @@
assertEquals(400, mockLayoutParams.height);
a.recycle();
- // base_attr_fillwrap: layout_width = "fill_parent", layout_height = "wrap_content"
+ // base_attr_fillwrap: layout_width = "match_parent", layout_height = "wrap_content"
attrs = getAttrs("base_attr_fillwrap");
a = mTargetContext.obtainStyledAttributes(attrs, R.styleable.ViewGroup_Layout);
mockLayoutParams.setBaseAttributes(a, R.styleable.ViewGroup_Layout_layout_width,
R.styleable.ViewGroup_Layout_layout_height);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.width);
assertEquals(TableLayout.LayoutParams.WRAP_CONTENT, mockLayoutParams.height);
mockLayoutParams.setBaseAttributes(a, R.styleable.ViewGroup_Layout_layout_height,
R.styleable.ViewGroup_Layout_layout_width);
assertEquals(TableLayout.LayoutParams.WRAP_CONTENT, mockLayoutParams.width);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.height);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.height);
a.recycle();
// base_attr_noheight: layout_width = 600px, no layout_height.
@@ -214,7 +214,7 @@
mockLayoutParams.setBaseAttributes(a, R.styleable.ViewGroup_Layout_layout_height,
R.styleable.ViewGroup_Layout_layout_width);
- assertEquals(TableLayout.LayoutParams.FILL_PARENT, mockLayoutParams.width);
+ assertEquals(TableLayout.LayoutParams.MATCH_PARENT, mockLayoutParams.width);
assertEquals(600, mockLayoutParams.height);
try {
diff --git a/tests/tests/widget/src/android/widget/cts/ViewAnimatorTest.java b/tests/tests/widget/src/android/widget/cts/ViewAnimatorTest.java
index e8e5dcf..8d7bd43 100644
--- a/tests/tests/widget/src/android/widget/cts/ViewAnimatorTest.java
+++ b/tests/tests/widget/src/android/widget/cts/ViewAnimatorTest.java
@@ -391,7 +391,7 @@
assertEquals(0, mViewAnimator.getChildCount());
LayoutParams p =
- new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
+ new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
mViewAnimator.addView(v1, 0, p);
assertEquals(1, mViewAnimator.getChildCount());
assertEquals(0, mViewAnimator.indexOfChild(v1));
diff --git a/tools/vm-tests/Android.mk b/tools/vm-tests/Android.mk
index 84673a8..9c8051e 100644
--- a/tools/vm-tests/Android.mk
+++ b/tools/vm-tests/Android.mk
@@ -73,15 +73,16 @@
# generated and compile the host side junit tests
$(hide) java -cp $(subst $(space),$(colon),$^):$(HOST_JDK_TOOLS_JAR) util.build.BuildDalvikSuite $(PRIVATE_SRC_FOLDER) $(PRIVATE_INTERMEDIATES) $<:$(PRIVATE_LIB_FOLDER)/junit.jar $(PRIVATE_INTERMEDIATES_MAIN_FILES) $(BUILD_UTIL_INTERMEDIATES_CLASSES) $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES) $$RUN_VM_TESTS_RTO
@echo "wrote generated Main_*.java files to $(PRIVATE_INTERMEDIATES_MAIN_FILES)"
-INSTALLED_TESTS := $(dir $(LOCAL_INSTALLED_MODULE))/../cts_dalviktests
+INSTALLED_TESTS := $(dir $(LOCAL_INSTALLED_MODULE))../cts_dalviktests/timestamp
-$(LOCAL_INSTALLED_MODULE): $(INSTALLED_TESTS)
+$(LOCAL_BUILT_MODULE): $(INSTALLED_TESTS)
$(INSTALLED_TESTS): PRIVATE_INTERMEDIATES := $(intermediates)/tests
$(INSTALLED_TESTS): $(GENERATED_FILES) $(GENERATED_FILES)/dot/junit/dexcore.jar
- $(hide) mkdir -p $@/tests
- $(hide) $(ACP) -r $(PRIVATE_INTERMEDIATES)/dot $@/tests
- $(hide) $(ACP) -r $(PRIVATE_INTERMEDIATES)/data $@/
+ $(hide) mkdir -p $(dir $@)tests
+ $(hide) $(ACP) -r $(PRIVATE_INTERMEDIATES)/dot $(dir $@)tests
+ $(hide) $(ACP) -r $(PRIVATE_INTERMEDIATES)/data $(dir $@)
+ @touch $@
$(intermediates)/android.core.vm-tests.jar: PRIVATE_INTERMEDIATES := $(intermediates)
$(intermediates)/android.core.vm-tests.jar: $(INSTALLED_TESTS)