am bef0d290: Merge "Disable 64-bit registers alignment of Dx"

* commit 'bef0d290eb9e7ead4ec6e1f6c19b5988435d5c2b':
  Disable 64-bit registers alignment of Dx
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index 3b30e0d..ce12fff 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -88,7 +88,6 @@
     CtsGraphicsTestCases \
     CtsGraphics2TestCases \
     CtsHardwareTestCases \
-    CtsHoloTestCases \
     CtsJniTestCases \
     CtsKeystoreTestCases \
     CtsLocationTestCases \
@@ -130,7 +129,6 @@
 cts_host_libraries := \
     CtsAdbTests \
     CtsAppSecurityTests \
-    CtsHoloHostTestCases \
     CtsHostJank \
     CtsHostUi \
     CtsMonkeyTestCases \
diff --git a/apps/CtsVerifier/AndroidManifest.xml b/apps/CtsVerifier/AndroidManifest.xml
index 8f50535..db88c50 100644
--- a/apps/CtsVerifier/AndroidManifest.xml
+++ b/apps/CtsVerifier/AndroidManifest.xml
@@ -17,8 +17,8 @@
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
       package="com.android.cts.verifier"
-      android:versionCode="1"
-      android:versionName="4.4_r1.95">
+      android:versionCode="3"
+      android:versionName="4.4_r3">
 
     <!-- Using 10+ for more complete NFC support... -->
     <uses-sdk android:minSdkVersion="12"></uses-sdk>
@@ -27,6 +27,7 @@
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
     <uses-permission android:name="android.permission.BLUETOOTH" />
     <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
+    <uses-permission android:name="android.permission.BODY_SENSORS"/>
     <uses-permission android:name="android.permission.CAMERA" />
     <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
@@ -573,10 +574,22 @@
                 <category android:name="android.cts.intent.category.MANUAL_TEST"/>
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_sensors"/>
-            <meta-data android:name="test_require_features"
+            <meta-data android:name="test_required_features"
                        android:value="android.hardware.sensor.gyroscope"/>
         </activity>
 
+        <activity android:name=".sensors.HeartRateMonitorTestActivity"
+                  android:label="@string/snsr_heartrate_test"
+                  android:screenOrientation="nosensor">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.cts.intent.category.MANUAL_TEST" />
+            </intent-filter>
+            <meta-data android:name="test_category" android:value="@string/test_category_sensors" />
+            <meta-data android:name="test_required_features"
+                       android:value="android.hardware.sensor.heartrate" />
+        </activity>
+
         <!-- Disable the test until calibration routine is verified -->
         <!--activity android:name=".sensors.MagneticFieldMeasurementTestActivity"
                   android:label="@string/snsr_mag_m_test"
diff --git a/apps/CtsVerifier/res/layout/ca_boot_notify.xml b/apps/CtsVerifier/res/layout/ca_boot_notify.xml
index 29fa549..e9309d4 100644
--- a/apps/CtsVerifier/res/layout/ca_boot_notify.xml
+++ b/apps/CtsVerifier/res/layout/ca_boot_notify.xml
@@ -19,47 +19,51 @@
   android:orientation="vertical" android:layout_width="fill_parent"
   android:layout_height="fill_parent">
 
+  <ScrollView
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:layout_alignParentTop="true" >
 
-  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content">
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+      android:orientation="vertical"
+      android:layout_width="fill_parent"
+      android:layout_height="wrap_content">
 
-    <TextView
-        android:id="@+id/check_cert_desc"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/caboot_check_cert_installed"/>
+      <TextView
+          android:id="@+id/check_cert_desc"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:text="@string/caboot_check_cert_installed"/>
 
-    <Button android:id="@+id/check_creds"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/caboot_check_creds" />
+      <Button android:id="@+id/check_creds"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:text="@string/caboot_check_creds" />
 
-     <TextView
-        android:id="@+id/need_to_install_cert"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/caboot_if_not_installed"/>
+      <TextView
+          android:id="@+id/need_to_install_cert"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:text="@string/caboot_if_not_installed"/>
 
-    <Button android:id="@+id/install"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/caboot_install_cert" />
+      <Button android:id="@+id/install"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:text="@string/caboot_install_cert" />
 
-     <TextView
-        android:id="@+id/reboot"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/caboot_reboot_desc"/>
+      <TextView
+          android:id="@+id/reboot"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:text="@string/caboot_reboot_desc"/>
 
-    <TextView
-        android:id="@+id/after_reboot"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/caboot_after_boot"/>
-  </LinearLayout>
+      <TextView
+          android:id="@+id/after_reboot"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:text="@string/caboot_after_boot"/>
 
-  <include layout="@layout/pass_fail_buttons" />
-
+      <include layout="@layout/pass_fail_buttons" />
+    </LinearLayout>
+  </ScrollView>
 </LinearLayout>
diff --git a/apps/CtsVerifier/res/layout/intent_driven_test.xml b/apps/CtsVerifier/res/layout/intent_driven_test.xml
index 225ad01..00c1cf6 100644
--- a/apps/CtsVerifier/res/layout/intent_driven_test.xml
+++ b/apps/CtsVerifier/res/layout/intent_driven_test.xml
@@ -1,27 +1,30 @@
 <?xml version="1.0" encoding="utf-8"?>
 
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-          android:layout_width="match_parent"
-          android:layout_height="match_parent"
-          android:orientation="vertical" >
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
 
-  <LinearLayout
+  <ScrollView
       android:layout_width="match_parent"
-      android:layout_height="wrap_content" >
+      android:layout_height="0dp"
+      android:layout_weight="1">
     <TextView android:id="@+id/info"
-              android:layout_width="match_parent"
-              android:layout_height="wrap_content"
-              android:textSize="18sp"
-              android:padding="5dp"
-              android:text="@string/dc_start_alarm_test_info" />
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:textSize="18sp"
+        android:padding="5dp"
+        android:text="@string/dc_start_alarm_test_info"/>
+  </ScrollView>
 
-    <LinearLayout android:id="@+id/buttons"
-                  android:orientation="horizontal"
-                  android:layout_width="wrap_content"
-                  android:layout_height="wrap_content"
-                  android:layout_alignParentTop="true"/>
+  <LinearLayout android:id="@+id/buttons"
+      android:orientation="horizontal"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"/>
 
-    <include layout="@layout/pass_fail_buttons"/>
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+      <include layout="@layout/pass_fail_buttons"/>
   </LinearLayout>
-
-</ScrollView>
+</LinearLayout>
diff --git a/apps/CtsVerifier/res/layout/snsr_hrm.xml b/apps/CtsVerifier/res/layout/snsr_hrm.xml
new file mode 100644
index 0000000..506ba9f
--- /dev/null
+++ b/apps/CtsVerifier/res/layout/snsr_hrm.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2014 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License
+  -->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+    <include android:id="@+id/pass_fail_buttons"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            layout="@layout/pass_fail_buttons" />
+
+    <TextView android:id="@+id/sensor_value"
+              android:background="@drawable/gray_bubble"
+              android:drawablePadding="10dip"
+              android:layout_above="@+id/sensor_accuracy_value"
+              android:layout_centerInParent="true"
+              android:layout_width="wrap_content"
+              android:layout_height="wrap_content"
+              android:layout_marginBottom="10dip"
+              android:paddingLeft="10dip"
+              android:paddingRight="10dip"
+              android:paddingTop="5dip"
+              android:paddingBottom="5dip"
+              android:textSize="28dip"
+        />
+
+    <TextView android:id="@+id/sensor_accuracy_value"
+              android:background="@drawable/gray_bubble"
+              android:drawablePadding="10dip"
+              android:layout_above="@+id/pass_fail_buttons"
+              android:layout_centerInParent="true"
+              android:layout_width="wrap_content"
+              android:layout_height="wrap_content"
+              android:layout_marginBottom="10dip"
+              android:paddingLeft="10dip"
+              android:paddingRight="10dip"
+              android:paddingTop="5dip"
+              android:paddingBottom="5dip"
+              android:textSize="28dip"
+        />
+
+</RelativeLayout>
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index 00ff965..d93649e 100644
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -410,6 +410,12 @@
     <string name="snsr_gyro_test_degrees_message">These values looks like degrees per second. These should be radians per second!</string>
     <string name="snsr_gyro_m_test">Gyroscope Measurement Test</string>
 
+    <!-- Heart Rate -->
+    <string name="snsr_heartrate_test">Heart Rate Test</string>
+    <string name="snsr_heartrate_test_info">This test verifies that the heart rate monitor is working properly.\n\nWait for at least 1 minute before verifying.\n\nVerify that the resting heart rate is between 0 and 100.</string>
+    <string name="snsr_heartrate_test_no_heartrate_title">No heart rate monitor?</string>
+    <string name="snsr_heartrate_test_no_heartrate_message">It doesn\'t seem like you have a heart rate monitor, so you don\'t need to run this test.</string>
+
     <!-- Magnetic Field -->
     <string name="snsr_mag_m_test">Magnetic Field Measurement Tests</string>
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java b/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java
index e7bf70d..ef80b5d 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java
@@ -23,8 +23,11 @@
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.DialogInterface.OnCancelListener;
+import android.content.pm.PackageManager;
 import android.database.Cursor;
 import android.os.Bundle;
+import android.os.PowerManager;
+import android.os.PowerManager.WakeLock;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View.OnClickListener;
@@ -86,6 +89,25 @@
     }
 
     public static class Activity extends android.app.Activity implements PassFailActivity {
+        private WakeLock mWakeLock;
+
+        @Override
+        protected void onResume() {
+            super.onResume();
+            if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) {
+                mWakeLock = ((PowerManager) getSystemService(Context.POWER_SERVICE))
+                        .newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "PassFailButtons");
+                mWakeLock.acquire();
+            }
+        }
+
+        @Override
+        protected void onPause() {
+            super.onPause();
+            if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) {
+                mWakeLock.release();
+            }
+        }
 
         @Override
         public void setPassFailButtonClickListeners() {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java
index 22f1813..b010f79 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java
@@ -445,6 +445,7 @@
                 CamcorderProfile.QUALITY_LOW,
                 CamcorderProfile.QUALITY_HIGH,
                 CamcorderProfile.QUALITY_QCIF,
+                CamcorderProfile.QUALITY_QVGA,
                 CamcorderProfile.QUALITY_CIF,
                 CamcorderProfile.QUALITY_480P,
                 CamcorderProfile.QUALITY_720P,
@@ -455,6 +456,7 @@
                 "LOW",
                 "HIGH",
                 "QCIF",
+                "QVGA",
                 "CIF",
                 "480P",
                 "720P",
@@ -488,45 +490,25 @@
         }
     }
 
-    private Size findRecordSize() {
+    private Size findRecordSize(int cameraId) {
         int[] possibleQuality = {
+                CamcorderProfile.QUALITY_LOW,
+                CamcorderProfile.QUALITY_HIGH,
                 CamcorderProfile.QUALITY_QCIF,
+                CamcorderProfile.QUALITY_QVGA,
                 CamcorderProfile.QUALITY_CIF,
                 CamcorderProfile.QUALITY_480P,
                 CamcorderProfile.QUALITY_720P,
                 CamcorderProfile.QUALITY_1080P
         };
 
-        Size[] sizes = new Size[] {
-                mCamera.new Size(176, 144),
-                mCamera.new Size(352, 288),
-                mCamera.new Size(720, 480),
-                mCamera.new Size(1280, 720),
-                mCamera.new Size(1920, 1080)
-        };
-
-        Size minSize = mCamera.new Size(Integer.MAX_VALUE, Integer.MAX_VALUE);
-        Size maxSize = mCamera.new Size(0, 0);
-
-        for (int i = 0; i < possibleQuality.length; i++) {
-            if (mVideoSizeIds.contains(possibleQuality[i])) {
-                if (sizes[i].height < minSize.height) {
-                    minSize = sizes[i];
-                }
-                if (sizes[i].height > maxSize.height) {
-                    maxSize = sizes[i];
-                }
-            }
-        }
-
         ArrayList<ResolutionQuality> qualityList = new ArrayList<ResolutionQuality>();
-        qualityList.add(new ResolutionQuality(CamcorderProfile.QUALITY_LOW, minSize.width,
-                minSize.height));
-        qualityList.add(new ResolutionQuality(CamcorderProfile.QUALITY_HIGH, maxSize.width,
-                maxSize.height));
         for (int i = 0; i < possibleQuality.length; i++) {
-            qualityList.add(new ResolutionQuality(possibleQuality[i], sizes[i].width,
-                    sizes[i].height));
+            if (CamcorderProfile.hasProfile(cameraId, possibleQuality[i])) {
+                CamcorderProfile profile = CamcorderProfile.get(cameraId, possibleQuality[i]);
+                qualityList.add(new ResolutionQuality(possibleQuality[i],
+                        profile.videoFrameWidth, profile.videoFrameHeight));
+            }
         }
 
         Size recordSize = null;
@@ -547,7 +529,7 @@
 
     // Match preview size with current recording size mCurrentVideoSizeId
     private Size matchPreviewRecordSize() {
-        Size recordSize = findRecordSize();
+        Size recordSize = findRecordSize(mCurrentCameraId);
 
         Size matchedSize = null;
         // First try to find exact match in size
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
index 6b87261..581121e 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
@@ -188,6 +188,10 @@
             new Feature(PackageManager.FEATURE_SENSOR_STEP_DETECTOR, false),
     };
 
+    public static final Feature[] ALL_KITKAT_WATCH_FEATURES = {
+            new Feature(PackageManager.FEATURE_SENSOR_HEART_RATE, false),
+    };
+
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -218,6 +222,9 @@
 
         // add features from latest to last so that the latest requirements are put in the set first
         int apiVersion = Build.VERSION.SDK_INT;
+        if (apiVersion >= Build.VERSION_CODES.KITKAT_WATCH) {
+            Collections.addAll(features, ALL_KITKAT_WATCH_FEATURES);
+        }
         if (apiVersion >= Build.VERSION_CODES.KITKAT) {
             Collections.addAll(features, ALL_KITKAT_FEATURES);
         }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/HeartRateMonitorTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/HeartRateMonitorTestActivity.java
new file mode 100644
index 0000000..3a48e3c
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/HeartRateMonitorTestActivity.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.cts.verifier.sensors;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.hardware.Sensor;
+import android.hardware.SensorEvent;
+import android.hardware.SensorEventListener;
+import android.hardware.SensorManager;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+
+import com.android.cts.verifier.PassFailButtons;
+import com.android.cts.verifier.R;
+
+/**
+ * CTS Verifier case for verifying correct integration of heart rate monitor.
+ * If a user is wearing a device with an HRM, the value is between <> and <>
+ */
+public class HeartRateMonitorTestActivity extends PassFailButtons.Activity {
+    private SensorManager mSensorManager;
+    private Sensor mSensor;
+    private SensorListener mSensorListener;
+    private AlertDialog mNoHeartRateWarningDialog;
+    private TextView mSensorText;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.snsr_hrm);
+        setInfoResources(R.string.snsr_heartrate_test, R.string.snsr_heartrate_test_info, 0);
+        setPassFailButtonClickListeners();
+
+        mSensorText = (TextView) findViewById(R.id.sensor_value);
+
+        mSensorManager = (SensorManager) getApplicationContext().getSystemService(
+                Context.SENSOR_SERVICE);
+        mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE);
+        mSensorListener = new SensorListener();
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (!mSensorManager.registerListener(mSensorListener, mSensor,
+                SensorManager.SENSOR_DELAY_UI)) {
+            showNoHeartRateWarningDialog();
+            PassFailButtons.setTestResultAndFinish(this, getTestId(), getTestDetails(), true);
+        }
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        mSensorManager.unregisterListener(mSensorListener, mSensor);
+    }
+
+    private void showNoHeartRateWarningDialog() {
+        if (mNoHeartRateWarningDialog == null) {
+            mNoHeartRateWarningDialog = new AlertDialog.Builder(this)
+                    .setIcon(android.R.drawable.ic_dialog_alert)
+                    .setTitle(R.string.snsr_heartrate_test_no_heartrate_title)
+                    .setMessage(R.string.snsr_heartrate_test_no_heartrate_message)
+                    .setPositiveButton(android.R.string.ok, null)
+                    .create();
+        }
+        if (!mNoHeartRateWarningDialog.isShowing()) {
+            mNoHeartRateWarningDialog.show();
+        }
+    }
+
+    private class SensorListener implements SensorEventListener {
+        private static final double MIN_HEART_RATE = 40;
+        private static final double MAX_HEART_RATE = 200;
+        @Override
+        public void onSensorChanged(SensorEvent sensorEvent) {
+            float value = sensorEvent.values[0];
+            if (value > MAX_HEART_RATE || value < MIN_HEART_RATE) {
+                updateWidgets(value, sensorEvent.accuracy, R.drawable.fs_error);
+            } else {
+                updateWidgets(value, sensorEvent.accuracy, R.drawable.fs_good);
+            }
+        }
+
+        void updateWidgets(float value, float accuracy, int icon) {
+            TextView sensorText = (TextView) findViewById(R.id.sensor_value);
+            TextView sensorAccuracyText = (TextView) findViewById(R.id.sensor_accuracy_value);
+
+            sensorText.setText(String.format("%+.2f", value));
+            sensorText.setCompoundDrawablesWithIntrinsicBounds(0, 0, icon, 0);
+            sensorAccuracyText.setText(String.format("%+.2f", accuracy));
+        }
+
+        @Override
+        public void onAccuracyChanged(Sensor sensor, int i) {
+        }
+    }
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/streamquality/StreamingVideoActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/streamquality/StreamingVideoActivity.java
index d575e5f..6d12747 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/streamquality/StreamingVideoActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/streamquality/StreamingVideoActivity.java
@@ -22,12 +22,24 @@
 import com.android.cts.verifier.TestListAdapter;
 import com.android.cts.verifier.TestListAdapter.TestListItem;
 
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.content.DialogInterface.OnClickListener;
 import android.content.Intent;
 import android.database.DataSetObserver;
+import android.os.AsyncTask;
 import android.os.Bundle;
+import android.util.Log;
 import android.widget.TextView;
 
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
 import java.io.Serializable;
+import java.net.HttpURLConnection;
+import java.net.URL;
 
 /**
  * Tests for verifying the quality of streaming videos.  Plays streams of different formats over
@@ -85,41 +97,51 @@
         }
     }
 
-    private static final Stream[] RTSP_STREAMS = {
-        new Stream("H263 Video, AMR Audio", "rtsp_h263_amr",
-                "rtsp://v2.cache7.c.youtube.com/video.3gp?"
-               + "cid=0x271de9756065677e&fmt=13&user=android-device-test"),
-        new Stream("MPEG4 SP Video, AAC Audio", "rtsp_mpeg4_aac",
-                "rtsp://v2.cache7.c.youtube.com/video.3gp?"
-                + "cid=0x271de9756065677e&fmt=13&user=android-device-test"),
-        new Stream("H264 Base Video, AAC Audio", "rtsp_h264_aac",
-                "rtsp://v2.cache7.c.youtube.com/video.3gp?"
-                + "cid=0x271de9756065677e&fmt=13&user=android-device-test"),
-    };
+    private static final String TAG = StreamingVideoActivity.class.getName();
+    private static final int RTSP_URL_ERROR = 1;
+    private static final String ITAG_13_SIGNATURE =
+            "53A3A3A46DAB71E3C599DE8FA6A1484593DFACE3" +
+            ".9476B91AD5035D88C3895CC2A4703B6DD442E972";
+    private static final String ITAG_17_SIGNATURE =
+            "10D6D263112C41DA98822D74821DF47340F1A361" +
+            ".803649A2258E26BF40E76A95E646FBAE4009CEE8";
+    private static final String ITAG_18_SIGNATURE =
+            "618FBB112E1B2FBB66DA9F203AE8CC7DF93C7400" +
+            ".20498AA006E999F42BE69D66E3596F2C7CA18114";
+    private static final String RTSP_LOOKUP_URI_TEMPLATE =
+            "http://redirector.c.youtube.com/videoplayback?id=271de9756065677e" +
+            "&source=youtube&protocol=rtsp&sparams=ip,ipbits,expire,id,itag,source" +
+            "&ip=0.0.0.0&ipbits=0&expire=19000000000&key=ik0&alr=yes" +
+            "&itag=%d" +
+            "&signature=%s";
 
     private static final Stream[] HTTP_STREAMS = {
-        new Stream("H263 Video, AMR Audio", "http_h263_amr", "http://v20.lscache8.c.youtube.com/"
+        new Stream("H263 Video, AMR Audio", "http_h263_amr",
+                "http://redirector.c.play.google.com/"
                 + "videoplayback?id=271de9756065677e"
                 + "&itag=13&ip=0.0.0.0&ipbits=0&expire=999999999999999999"
                 + "&sparams=ip,ipbits,expire,ip,ipbits,expire,id,itag"
                 + "&signature=372FA4C532AA49D14EAF049BCDA66460EEE161E9"
                 + ".6D8BF096B73B7A68A7032CA8685053CFB498D30A"
+                + "&source=youtube"
                 + "&key=test_key1&user=android-device-test"),
         new Stream("MPEG4 SP Video, AAC Audio", "http_mpeg4_aac",
-                "http://v20.lscache8.c.youtube.com/"
+                "http://redirector.c.play.google.com/"
                 + "videoplayback?id=271de9756065677e"
                 + "&itag=17&ip=0.0.0.0&ipbits=0&expire=999999999999999999"
                 + "&sparams=ip,ipbits,expire,ip,ipbits,expire,id,itag"
                 + "&signature=3DCD3F79E045F95B6AF661765F046FB0440FF016"
                 + ".06A42661B3AF6BAF046F012549CC9BA34EBC80A9"
+                + "&source=youtube"
                 + "&key=test_key1&user=android-device-test"),
         new Stream("H264 Base Video, AAC Audio", "http_h264_aac",
-                "http://v20.lscache8.c.youtube.com/"
+                "http://redirector.c.play.google.com/"
                 + "videoplayback?id=271de9756065677e"
                 + "&itag=18&ip=0.0.0.0&ipbits=0&expire=999999999999999999"
                 + "&sparams=ip,ipbits,expire,ip,ipbits,expire,id,itag"
                 + "&signature=1219C2B07AF0638C27916307A6093C0E43CB894E"
                 + ".126B6B916BD57157782738AA7C03E59F21DBC168"
+                + "&source=youtube"
                 + "&key=test_key1&user=android-device-test"),
     };
 
@@ -137,13 +159,35 @@
         setTestListAdapter(getStreamAdapter());
     }
 
+    @Override
+    public Dialog onCreateDialog(int id, Bundle args) {
+        switch (id) {
+            case RTSP_URL_ERROR:
+                return new AlertDialog.Builder(this)
+                        .setTitle(getString(R.string.sv_failed_title))
+                        .setMessage(getString(R.string.sv_failed_message))
+                        .setNegativeButton("Close", new OnClickListener() {
+                            @Override
+                            public void onClick(DialogInterface dialog, int which) {
+                                PassFailButtons.setTestResultAndFinish(StreamingVideoActivity.this,
+                                        getTestId(), null, false);
+                            }
+                        }).show();
+            default:
+                return super.onCreateDialog(id, args);
+        }
+    }
+
     private TestListAdapter getStreamAdapter() {
         ArrayTestListAdapter adapter = new ArrayTestListAdapter(this);
 
         adapter.add(TestListItem.newCategory("RTSP"));
-        for (Stream stream : RTSP_STREAMS) {
-            addStreamToTests(adapter, stream);
-        }
+        addRtspStreamToTest(
+                adapter, "H263 Video, AMR Audio", "rtsp_h263_amr", 13, ITAG_13_SIGNATURE);
+        addRtspStreamToTest(
+                adapter, "MPEG4 SP Video, AAC Audio", "rtsp_mpeg4_aac", 17, ITAG_17_SIGNATURE);
+        addRtspStreamToTest(
+                adapter, "H264 Base Video, AAC Audio", "rtsp_h264_aac", 18, ITAG_18_SIGNATURE);
 
         adapter.add(TestListItem.newCategory("HTTP Progressive"));
         for (Stream stream : HTTP_STREAMS) {
@@ -160,6 +204,16 @@
         return adapter;
     }
 
+    private void addRtspStreamToTest(
+            ArrayTestListAdapter adapter, String name, String code, int itag, String signature) {
+        String rtspUrl = lookupRtspUrl(itag, signature);
+        if (rtspUrl == null) {
+            showDialog(RTSP_URL_ERROR);
+        }
+        Stream stream = new Stream(name, code, rtspUrl);
+        addStreamToTests(adapter, stream);
+    }
+
     private void addStreamToTests(ArrayTestListAdapter streams, Stream stream) {
         Intent i = new Intent(StreamingVideoActivity.this, PlayVideoActivity.class);
         i.putExtra(PlayVideoActivity.EXTRA_STREAM, stream);
@@ -170,4 +224,41 @@
     private void updatePassButton() {
         getPassButton().setEnabled(mAdapter.allTestsPassed());
     }
+
+    /** @returns the appropriate RTSP url, or null in case of failure */
+    private String lookupRtspUrl(int itag, String signature) {
+        String rtspLookupUri = String.format(RTSP_LOOKUP_URI_TEMPLATE, itag, signature);
+        try {
+            return new LookupRtspUrlTask().execute(rtspLookupUri).get();
+        } catch (Exception e) {
+            Log.e(TAG, "RTSP URL lookup time out.", e);
+            showDialog(RTSP_URL_ERROR);
+            return null;
+        }
+    }
+
+    /** Retrieve the URL for an RTSP stream */
+    private class LookupRtspUrlTask extends AsyncTask<String, Void, String> {
+        protected String doInBackground(String... rtspLookupUri) {
+            HttpURLConnection urlConnection = null;
+            try {
+                URL url = new URL(rtspLookupUri[0]);
+                urlConnection = (HttpURLConnection) url.openConnection();
+                if (urlConnection.getResponseCode() != 200) {
+                    throw new IOException("unable to get rtsp uri. Response Code:"
+                            + urlConnection.getResponseCode());
+                }
+                BufferedReader reader = new BufferedReader(
+                        new InputStreamReader(urlConnection.getInputStream()));
+                return reader.readLine();
+            } catch (Exception e) {
+                Log.e(TAG, "RTSP URL lookup failed.", e);
+                return null;
+            } finally {
+                if (urlConnection != null) {
+                    urlConnection.disconnect();
+                }
+            }
+        }
+    }
 }
diff --git a/common/Android.mk b/common/Android.mk
new file mode 100644
index 0000000..a8b6af7
--- /dev/null
+++ b/common/Android.mk
@@ -0,0 +1,15 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+include $(call all-subdir-makefiles)
diff --git a/common/device-side/Android.mk b/common/device-side/Android.mk
new file mode 100644
index 0000000..a8b6af7
--- /dev/null
+++ b/common/device-side/Android.mk
@@ -0,0 +1,15 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+include $(call all-subdir-makefiles)
diff --git a/common/device-side/device-setup/Android.mk b/common/device-side/device-setup/Android.mk
new file mode 100644
index 0000000..bc7c504
--- /dev/null
+++ b/common/device-side/device-setup/Android.mk
@@ -0,0 +1,43 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_MODULE := compatibility-device-setup_v2
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+###############################################################################
+# Build the tests
+###############################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, tests/src)
+
+LOCAL_JAVA_LIBRARIES := junit
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_MODULE := compatibility-device-setup-tests_v2
+
+include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/common/device-side/device-setup/src/com/android/compatibility/common/devicesetup/DeviceInfoConstants.java b/common/device-side/device-setup/src/com/android/compatibility/common/devicesetup/DeviceInfoConstants.java
new file mode 100644
index 0000000..7b19b00
--- /dev/null
+++ b/common/device-side/device-setup/src/com/android/compatibility/common/devicesetup/DeviceInfoConstants.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.devicesetup;
+
+/**
+ * Constants for device info attributes to be sent as instrumentation keys.
+ */
+public interface DeviceInfoConstants {
+
+    public static final String BUILD_ABI = "buildAbi";
+    public static final String BUILD_ABI2 = "buildAbi2";
+    public static final String BUILD_BOARD = "buildBoard";
+    public static final String BUILD_BRAND = "buildBrand";
+    public static final String BUILD_DEVICE = "buildDevice";
+    public static final String BUILD_FINGERPRINT = "buildFingerprint";
+    public static final String BUILD_ID = "buildId";
+    public static final String BUILD_MANUFACTURER = "buildManufacturer";
+    public static final String BUILD_MODEL = "buildModel";
+    public static final String BUILD_TAGS = "buildTags";
+    public static final String BUILD_TYPE = "buildType";
+    public static final String BUILD_VERSION = "buildVersion";
+
+    public static final String FEATURES = "features";
+
+    public static final String GRAPHICS_RENDERER = "graphicsRenderer";
+    public static final String GRAPHICS_VENDOR = "graphicsVendor";
+
+    public static final String IMEI = "imei";
+    public static final String IMSI = "imsi";
+
+    public static final String KEYPAD = "keypad";
+
+    public static final String LOCALES = "locales";
+
+    public static final String MULTI_USER = "multiUser";
+
+    public static final String NAVIGATION = "navigation";
+    public static final String NETWORK = "network";
+
+    public static final String OPEN_GL_ES_VERSION = "openGlEsVersion";
+    public static final String OPEN_GL_EXTENSIONS = "openGlExtensions";
+    public static final String OPEN_GL_COMPRESSED_TEXTURE_FORMATS =
+            "openGlCompressedTextureFormats";
+
+    public static final String PARTITIONS = "partitions";
+    public static final String PHONE_NUMBER = "phoneNumber";
+    public static final String PROCESSES = "processes";
+    public static final String PRODUCT_NAME = "productName";
+
+    public static final String RESOLUTION = "resolution";
+
+    public static final String SCREEN_DENSITY = "screenDensity";
+    public static final String SCREEN_DENSITY_BUCKET = "screenDensityBucket";
+    public static final String SCREEN_DENSITY_X = "screenDensityX";
+    public static final String SCREEN_DENSITY_Y = "screenDensityY";
+    public static final String SCREEN_SIZE = "screenSize";
+    public static final String SERIAL_NUMBER = "deviceId";
+    public static final String STORAGE_DEVICES = "storageDevices";
+    public static final String SYS_LIBRARIES = "systemLibraries";
+
+    public static final String TOUCH = "touch";
+
+    public static final String VERSION_RELEASE = "versionRelease";
+    public static final String VERSION_SDK_INT = "versionSdkInt";
+}
diff --git a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl b/common/device-side/device-setup/tests/src/com/android/compatibility/common/devicesetup/DeviceSetupTest.java
similarity index 67%
copy from tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
copy to common/device-side/device-setup/tests/src/com/android/compatibility/common/devicesetup/DeviceSetupTest.java
index af264c9..ee55a66 100644
--- a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
+++ b/common/device-side/device-setup/tests/src/com/android/compatibility/common/devicesetup/DeviceSetupTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 The Android Open Source Project
+ * Copyright (C) 2014 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,12 @@
  * limitations under the License.
  */
 
-package android.security.cts.activity;
+package com.android.compatibility.common.devicesetup;
 
-interface ISecureRandomService {
-    int getRandomBytesAndPid(inout byte[] randomBytes);
+import junit.framework.TestCase;
+
+public class DeviceSetupTest extends TestCase {
+
+    // TODO(stuartscott): Add tests when there is something to test.
+
 }
diff --git a/common/device-side/util/Android.mk b/common/device-side/util/Android.mk
new file mode 100644
index 0000000..c8104bf
--- /dev/null
+++ b/common/device-side/util/Android.mk
@@ -0,0 +1,45 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_STATIC_JAVA_LIBRARIES := compatibility-common-util-devicesidelib_v2
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_MODULE := compatibility-device-util_v2
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+################################################################################
+# Build the tests
+###############################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, tests/src)
+
+LOCAL_JAVA_LIBRARIES := junit
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_MODULE := compatibility-device-util-tests_v2
+
+include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/common/device-side/util/src/com/android/compatibility/common/util/DeviceReportLog.java b/common/device-side/util/src/com/android/compatibility/common/util/DeviceReportLog.java
new file mode 100644
index 0000000..273cdf5
--- /dev/null
+++ b/common/device-side/util/src/com/android/compatibility/common/util/DeviceReportLog.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+import android.app.Instrumentation;
+import android.os.Bundle;
+import android.util.Log;
+
+import com.android.compatibility.common.util.ReportLog;
+
+/**
+ * Handles adding results to the report for device side tests.
+ *
+ * NOTE: tests MUST call {@link #submit(Instrumentation)} if and only if the test passes in order to
+ * send the results to the runner.
+ */
+public class DeviceReportLog extends ReportLog {
+    private static final String TAG = DeviceReportLog.class.getSimpleName();
+    private static final String RESULT = "RESULT";
+    private static final int INST_STATUS_IN_PROGRESS = 2;
+
+    public void submit(Instrumentation instrumentation) {
+        Log.i(TAG, "submit");
+        Bundle output = new Bundle();
+        output.putSerializable(RESULT, this);
+        instrumentation.sendStatus(INST_STATUS_IN_PROGRESS, output);
+    }
+}
diff --git a/common/device-side/util/src/com/android/compatibility/common/util/EvaluateJsResultPollingCheck.java b/common/device-side/util/src/com/android/compatibility/common/util/EvaluateJsResultPollingCheck.java
new file mode 100644
index 0000000..521dc40
--- /dev/null
+++ b/common/device-side/util/src/com/android/compatibility/common/util/EvaluateJsResultPollingCheck.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+import android.webkit.ValueCallback;
+
+public class EvaluateJsResultPollingCheck  extends PollingCheck
+        implements ValueCallback<String> {
+    private String mActualResult;
+    private String mExpectedResult;
+
+    public EvaluateJsResultPollingCheck(String expected) {
+        mExpectedResult = expected;
+    }
+
+    @Override
+    public synchronized boolean check() {
+        return mExpectedResult.equals(mActualResult);
+    }
+
+    @Override
+    public synchronized void onReceiveValue(String result) {
+        mActualResult = result;
+    }
+}
diff --git a/common/device-side/util/src/com/android/compatibility/common/util/FileCopyHelper.java b/common/device-side/util/src/com/android/compatibility/common/util/FileCopyHelper.java
new file mode 100644
index 0000000..02be372
--- /dev/null
+++ b/common/device-side/util/src/com/android/compatibility/common/util/FileCopyHelper.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+import android.content.Context;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+
+/**
+ * FileCopyHelper is used to copy files from resources to the application directory and responsible
+ * for deleting the files.
+ *
+ * @see MediaStore_VideoTest
+ * @see MediaStore_Images_MediaTest
+ * @see MediaStore_Images_ThumbnailsTest
+ */
+public class FileCopyHelper {
+    /** The context. */
+    private Context mContext;
+
+    /** The files added. */
+    private ArrayList<String> mFilesList;
+
+    /**
+     * Instantiates a new file copy helper.
+     *
+     * @param context the context
+     */
+    public FileCopyHelper(Context context) {
+        mContext = context;
+        mFilesList = new ArrayList<String>();
+    }
+
+    /**
+     * Copy the file from the resources with a filename.
+     *
+     * @param resId the res id
+     * @param fileName the file name
+     *
+     * @return the absolute path of the destination file
+     * @throws IOException
+     */
+    public String copy(int resId, String fileName) throws IOException {
+        InputStream source = mContext.getResources().openRawResource(resId);
+        OutputStream target = mContext.openFileOutput(fileName, Context.MODE_WORLD_READABLE);
+        copyFile(source, target);
+        mFilesList.add(fileName);
+        return mContext.getFileStreamPath(fileName).getAbsolutePath();
+    }
+
+    public void copyToExternalStorage(int resId, File path) throws IOException {
+        InputStream source = mContext.getResources().openRawResource(resId);
+        OutputStream target = new FileOutputStream(path);
+        copyFile(source, target);
+    }
+
+    private void copyFile(InputStream source, OutputStream target) throws IOException {
+        try {
+            byte[] buffer = new byte[1024];
+            for (int len = source.read(buffer); len > 0; len = source.read(buffer)) {
+                target.write(buffer, 0, len);
+            }
+        } finally {
+            if (source != null) {
+                source.close();
+            }
+            if (target != null) {
+                target.close();
+            }
+        }
+    }
+
+    /**
+     * Delete all the files copied by the helper.
+     */
+    public void clear(){
+        for (String path : mFilesList) {
+            mContext.deleteFile(path);
+        }
+    }
+}
diff --git a/common/device-side/util/src/com/android/compatibility/common/util/PollingCheck.java b/common/device-side/util/src/com/android/compatibility/common/util/PollingCheck.java
new file mode 100644
index 0000000..a976a92
--- /dev/null
+++ b/common/device-side/util/src/com/android/compatibility/common/util/PollingCheck.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+import java.util.concurrent.Callable;
+
+import junit.framework.Assert;
+
+public abstract class PollingCheck {
+
+    private static final long TIME_SLICE = 50;
+    private long mTimeoutMs = 3000;
+
+    public PollingCheck() {
+    }
+
+    public PollingCheck(long timeoutMs) {
+        mTimeoutMs = timeoutMs;
+    }
+
+    protected abstract boolean check();
+
+    public void run() {
+        if (check()) {
+            return;
+        }
+
+        long timeoutMs = mTimeoutMs;
+        while (timeoutMs > 0) {
+            try {
+                Thread.sleep(TIME_SLICE);
+            } catch (InterruptedException e) {
+                Assert.fail("unexpected InterruptedException");
+            }
+
+            if (check()) {
+                return;
+            }
+
+            timeoutMs -= TIME_SLICE;
+        }
+
+        Assert.fail("unexpected timeout");
+    }
+
+    public static void check(CharSequence message, long timeoutMs, Callable<Boolean> condition)
+            throws Exception {
+        while (timeoutMs > 0) {
+            if (condition.call()) {
+                return;
+            }
+
+            Thread.sleep(TIME_SLICE);
+            timeoutMs -= TIME_SLICE;
+        }
+
+        Assert.fail(message.toString());
+    }
+}
diff --git a/common/device-side/util/src/com/android/compatibility/common/util/Result.java b/common/device-side/util/src/com/android/compatibility/common/util/Result.java
new file mode 100644
index 0000000..0d8a29a
--- /dev/null
+++ b/common/device-side/util/src/com/android/compatibility/common/util/Result.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.android.compatibility.common.util;
+
+/**
+ * Represents the result of a test.
+ */
+public interface Result {
+    public static final int RESULT_OK = 1;
+    public static final int RESULT_FAIL = 2;
+    /**
+     * Sets the test result of this object.
+     *
+     * @param resultCode The test result, either {@code RESULT_OK} or {@code RESULT_FAIL}.
+     */
+    void setResult(int resultCode);
+}
diff --git a/common/device-side/util/src/com/android/compatibility/common/util/SystemUtil.java b/common/device-side/util/src/com/android/compatibility/common/util/SystemUtil.java
new file mode 100644
index 0000000..2ec9bef
--- /dev/null
+++ b/common/device-side/util/src/com/android/compatibility/common/util/SystemUtil.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+import android.app.ActivityManager;
+import android.app.ActivityManager.MemoryInfo;
+import android.content.Context;
+import android.os.StatFs;
+
+public class SystemUtil {
+    public static long getFreeDiskSize(Context context) {
+        final StatFs statFs = new StatFs(context.getFilesDir().getAbsolutePath());
+        return (long)statFs.getAvailableBlocks() * statFs.getBlockSize();
+    }
+
+    public static long getFreeMemory(Context context) {
+        final MemoryInfo info = new MemoryInfo();
+        ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryInfo(info);
+        return info.availMem;
+    }
+
+    public static long getTotalMemory(Context context) {
+        final MemoryInfo info = new MemoryInfo();
+        ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryInfo(info);
+        return info.totalMem;
+    }
+}
diff --git a/common/device-side/util/src/com/android/compatibility/common/util/WatchDog.java b/common/device-side/util/src/com/android/compatibility/common/util/WatchDog.java
new file mode 100644
index 0000000..4862323
--- /dev/null
+++ b/common/device-side/util/src/com/android/compatibility/common/util/WatchDog.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.compatibility.common.util;
+
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
+import android.util.Log;
+
+import junit.framework.Assert;
+
+/**
+ * Used to fail a test if a function takes more than a certain amount of time.
+ */
+public class WatchDog implements Runnable {
+    private static final String TAG = WatchDog.class.getSimpleName();
+    private Thread mThread;
+    private Semaphore mSemaphore;
+    private volatile boolean mStopRequested;
+    private final long mTimeoutInMilliSecs;
+    private TimeoutCallback mCallback = null;
+
+    public WatchDog(long timeoutInMilliSecs) {
+        mTimeoutInMilliSecs = timeoutInMilliSecs;
+    }
+
+    public WatchDog(long timeoutInMilliSecs, TimeoutCallback callback) {
+        this(timeoutInMilliSecs);
+        mCallback = callback;
+    }
+
+    /** start watch-dog */
+    public void start() {
+        Log.i(TAG, "start");
+        mStopRequested = false;
+        mSemaphore = new Semaphore(0);
+        mThread = new Thread(this);
+        mThread.start();
+    }
+
+    /** stop watch-dog */
+    public void stop() {
+        Log.i(TAG, "stop");
+        if (mThread == null) {
+            return; // already finished
+        }
+        mStopRequested = true;
+        mSemaphore.release();
+        try {
+            mThread.join();
+        } catch (InterruptedException e) {
+            // ignore
+        }
+        mThread = null;
+        mSemaphore = null;
+    }
+
+    /** resets watch-dog, thus prevent it from panic */
+    public void reset() {
+        if (!mStopRequested) { // stop requested, but rendering still on-going
+            mSemaphore.release();
+        }
+    }
+
+    @Override
+    public void run() {
+        while (!mStopRequested) {
+            try {
+                boolean success = mSemaphore.tryAcquire(mTimeoutInMilliSecs, TimeUnit.MILLISECONDS);
+                if (mCallback == null) {
+                    Assert.assertTrue("Watchdog timed-out", success);
+                } else if (!success) {
+                    mCallback.onTimeout();
+                }
+            } catch (InterruptedException e) {
+                // this thread will not be interrupted,
+                // but if it happens, just check the exit condition.
+            }
+        }
+    }
+
+    /**
+     * Called by the Watchdog when it has timed out.
+     */
+    public interface TimeoutCallback {
+
+        public void onTimeout();
+    }
+}
diff --git a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl b/common/device-side/util/tests/src/com/android/compatibility/common/util/DeviceUtilTest.java
similarity index 74%
rename from tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
rename to common/device-side/util/tests/src/com/android/compatibility/common/util/DeviceUtilTest.java
index af264c9..a7e81d7 100644
--- a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
+++ b/common/device-side/util/tests/src/com/android/compatibility/common/util/DeviceUtilTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 The Android Open Source Project
+ * Copyright (C) 2014 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,10 @@
  * limitations under the License.
  */
 
-package android.security.cts.activity;
+package com.android.compatibility.common.util;
 
-interface ISecureRandomService {
-    int getRandomBytesAndPid(inout byte[] randomBytes);
+import junit.framework.TestCase;
+
+public class DeviceUtilTest extends TestCase {
+
 }
diff --git a/common/host-side/Android.mk b/common/host-side/Android.mk
new file mode 100644
index 0000000..a8b6af7
--- /dev/null
+++ b/common/host-side/Android.mk
@@ -0,0 +1,15 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+include $(call all-subdir-makefiles)
diff --git a/common/host-side/java-scanner/Android.mk b/common/host-side/java-scanner/Android.mk
new file mode 100644
index 0000000..7c101ff
--- /dev/null
+++ b/common/host-side/java-scanner/Android.mk
@@ -0,0 +1,47 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_JAVA_LIBRARIES := compatibility-common-util-hostsidelib_v2
+
+LOCAL_JAR_MANIFEST := MANIFEST.mf
+
+LOCAL_CLASSPATH := $(HOST_JDK_TOOLS_JAR)
+
+LOCAL_MODULE := compatibility-java-scanner_v2
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_HOST_JAVA_LIBRARY)
+
+################################################################################
+# Build the tests
+###############################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, tests/src)
+
+LOCAL_JAVA_LIBRARIES := compatibility-tradefed_v2 compatibility-java-scanner_v2 junit
+
+LOCAL_MODULE := compatibility-java-scanner-tests_v2
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/common/host-side/java-scanner/MANIFEST.mf b/common/host-side/java-scanner/MANIFEST.mf
new file mode 100644
index 0000000..975b1ef
--- /dev/null
+++ b/common/host-side/java-scanner/MANIFEST.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: com.android.compatibility.common.scanner.JavaScanner
+Class-Path: compatibility-common-util-hostsidelib_v2.jar
diff --git a/common/host-side/java-scanner/src/com/android/compatibility/common/scanner/JavaScanner.java b/common/host-side/java-scanner/src/com/android/compatibility/common/scanner/JavaScanner.java
new file mode 100644
index 0000000..f3f8a49
--- /dev/null
+++ b/common/host-side/java-scanner/src/com/android/compatibility/common/scanner/JavaScanner.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.scanner;
+
+import com.android.compatibility.common.util.KeyValueArgsParser;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * Scans a source directory for java tests and outputs a list of test classes and methods.
+ */
+public class JavaScanner {
+
+    static final String[] SOURCE_PATHS = {
+        "./frameworks/base/core/java",
+        "./frameworks/base/test-runner/src",
+        "./external/junit/src",
+        "./development/tools/hosttestlib/src",
+        "./libcore/dalvik/src/main/java",
+        "./common/device-side/util/src",
+        "./common/host-side/tradefed/src",
+        "./common/util/src"
+    };
+    static final String[] CLASS_PATHS = {
+        "./prebuilts/misc/common/tradefed/tradefed-prebuilt.java",
+        "./prebuilts/misc/common/ub-uiautomator/ub-uiautomator.java"
+    };
+    private final File mSourceDir;
+    private final File mDocletDir;
+
+    /**
+     * @param sourceDir The directory holding the source to scan.
+     * @param docletDir The directory holding the doclet (or its jar).
+     */
+    JavaScanner(File sourceDir, File docletDir) {
+        this.mSourceDir = sourceDir;
+        this.mDocletDir = docletDir;
+    }
+
+    int scan() throws Exception {
+        final ArrayList<String> args = new ArrayList<String>();
+        args.add("javadoc");
+        args.add("-doclet");
+        args.add("com.android.compatibility.common.scanner.JavaScannerDoclet");
+        args.add("-sourcepath");
+        args.add(getSourcePath(mSourceDir));
+        args.add("-classpath");
+        args.add(getClassPath());
+        args.add("-docletpath");
+        args.add(mDocletDir.toString());
+        args.addAll(getSourceFiles(mSourceDir));
+
+        // Dont want p to get blocked due to a full pipe.
+        final Process p = new ProcessBuilder(args).redirectErrorStream(true).start();
+        final BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
+        try {
+            String line = null;
+            while ((line = in.readLine()) != null) {
+                if (line.startsWith("suite:") ||
+                    line.startsWith("case:") ||
+                    line.startsWith("test:")) {
+                    System.out.println(line);
+                }
+            }
+        } finally {
+          if (in != null) {
+              in.close();
+          }
+        }
+
+        return p.waitFor();
+    }
+
+    private static String getSourcePath(File sourceDir) {
+        final ArrayList<String> sourcePath = new ArrayList<String>(Arrays.asList(SOURCE_PATHS));
+        sourcePath.add(sourceDir.toString());
+        return join(sourcePath, ":");
+    }
+
+    private static String getClassPath() {
+        return join(Arrays.asList(CLASS_PATHS), ":");
+    }
+
+    private static ArrayList<String> getSourceFiles(File sourceDir) {
+        final ArrayList<String> sourceFiles = new ArrayList<String>();
+        final File[] files = sourceDir.listFiles(new FileFilter() {
+            public boolean accept(File pathname) {
+                return pathname.isDirectory() || pathname.toString().endsWith(".java");
+            }
+        });
+        for (File f : files) {
+            if (f.isDirectory()) {
+                sourceFiles.addAll(getSourceFiles(f));
+            } else {
+                sourceFiles.add(f.toString());
+            }
+        }
+        return sourceFiles;
+    }
+
+    private static String join(List<String> list, String delimiter) {
+        final StringBuilder builder = new StringBuilder();
+        for (String s : list) {
+            builder.append(s);
+            builder.append(delimiter);
+        }
+        // Adding the delimiter each time and then removing the last one at the end is more
+        // efficient than doing a check in each iteration of the loop.
+        return builder.substring(0, builder.length() - delimiter.length());
+    }
+
+    public static void main(String[] args) throws Exception {
+        final HashMap<String, String> argsMap = KeyValueArgsParser.parse(args);
+        final String sourcePath = argsMap.get("-s");
+        final String docletPath = argsMap.get("-d");
+        if (sourcePath == null || docletPath == null) {
+            usage(args);
+        }
+        System.exit(new JavaScanner(new File(sourcePath), new File(docletPath)).scan());
+    }
+
+    private static void usage(String[] args) {
+        System.err.println("Arguments: " + Arrays.toString(args));
+        System.err.println("Usage: javascanner -s SOURCE_DIR -d DOCLET_PATH");
+        System.exit(1);
+    }
+}
diff --git a/common/host-side/java-scanner/src/com/android/compatibility/common/scanner/JavaScannerDoclet.java b/common/host-side/java-scanner/src/com/android/compatibility/common/scanner/JavaScannerDoclet.java
new file mode 100644
index 0000000..94eccd0
--- /dev/null
+++ b/common/host-side/java-scanner/src/com/android/compatibility/common/scanner/JavaScannerDoclet.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.scanner;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.Doclet;
+import com.sun.javadoc.MethodDoc;
+import com.sun.javadoc.RootDoc;
+
+import java.io.PrintWriter;
+
+/**
+ * Doclet that scans java files looking for tests.
+ *
+ * Sample Ouput;
+ * suite:com.android.sample.cts
+ * case:SampleDeviceTest
+ * test:testSharedPreferences
+ */
+public class JavaScannerDoclet extends Doclet {
+
+    private static final String JUNIT_TEST_CASE_CLASS_NAME = "junit.framework.testcase";
+
+    public static boolean start(RootDoc root) {
+        ClassDoc[] classes = root.classes();
+        if (classes == null) {
+            return false;
+        }
+
+        PrintWriter writer = new PrintWriter(System.out);
+
+        for (ClassDoc clazz : classes) {
+            if (clazz.isAbstract() || !isValidJUnitTestCase(clazz)) {
+                continue;
+            }
+            writer.append("suite:").println(clazz.containingPackage().name());
+            writer.append("case:").println(clazz.name());
+            for (; clazz != null; clazz = clazz.superclass()) {
+                for (MethodDoc method : clazz.methods()) {
+                    if (method.name().startsWith("test")) {
+                        writer.append("test:").println(method.name());
+                    }
+                }
+            }
+        }
+
+        writer.close();
+        return true;
+    }
+
+    private static boolean isValidJUnitTestCase(ClassDoc clazz) {
+        while ((clazz = clazz.superclass()) != null) {
+            if (JUNIT_TEST_CASE_CLASS_NAME.equals(clazz.qualifiedName().toLowerCase())) {
+                return true;
+            }
+        }
+        return false;
+    }
+}
diff --git a/common/host-side/java-scanner/tests/src/com/android/compatibility/common/scanner/JavaScannerTest.java b/common/host-side/java-scanner/tests/src/com/android/compatibility/common/scanner/JavaScannerTest.java
new file mode 100644
index 0000000..4159f0e
--- /dev/null
+++ b/common/host-side/java-scanner/tests/src/com/android/compatibility/common/scanner/JavaScannerTest.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.scanner;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+
+import junit.framework.TestCase;
+
+public class JavaScannerTest extends TestCase {
+
+    private static final String JAR = "out/host/linux-x86/framework/compatibility-java-scanner_v2.jar";
+    private static final String VALID_RESULT =
+        "suite:com.android.test" +
+        "case:ValidTest" +
+        "test:testA";
+
+    private static final String VALID_FILENAME = "ValidTest";
+    private static final String VALID =
+        "package com.android.test;" +
+        "import junit.framework.TestCase;" +
+        "public class ValidTest extends TestCase {" +
+        "  public void testA() throws Exception {" +
+        "    helper();" +
+        "  }" +
+        "  public void helper() {" +
+        "    fail();" +
+        "  }" +
+        "}";
+
+    // TestCases must have TestCase in their hierarchy
+    private static final String INVALID_A_FILENAME = "NotTestCase";
+    private static final String INVALID_A =
+        "package com.android.test;" +
+        "public class NotTestCase {" +
+        "  public void testA() throws Exception {" +
+        "    helper();" +
+        "  }" +
+        "  public void helper() {" +
+        "    fail();" +
+        "  }" +
+        "}";
+
+    // TestCases cant be abstract classes
+    private static final String INVALID_B_FILENAME = "AbstractClass";
+    private static final String INVALID_B =
+        "package com.android.test;" +
+        "import junit.framework.TestCase;" +
+        "public abstract class AbstractClass extends TestCase {" +
+        "  public void testA() throws Exception {" +
+        "    helper();" +
+        "  }" +
+        "  public void helper() {" +
+        "    fail();" +
+        "  }" +
+        "}";
+
+    public void testValidFile() throws Exception {
+        String result = runScanner(VALID_FILENAME, VALID);
+        assertEquals(VALID_RESULT, result);
+    }
+
+    public void testInvalidFileA() throws Exception {
+        assertEquals("", runScanner(INVALID_A_FILENAME, INVALID_A));
+    }
+
+    public void testInvalidFileB() throws Exception {
+        assertEquals("", runScanner(INVALID_B_FILENAME, INVALID_B));
+    }
+
+    private static String runScanner(String filename, String content) throws Exception {
+        final File parent0 = new File(System.getProperty("java.io.tmpdir"));
+        final File parent1 = new File(parent0, "tmp" + System.currentTimeMillis());
+        final File parent2 = new File(parent1, "com");
+        final File parent3 = new File(parent2, "android");
+        final File parent4 = new File(parent3, "test");
+        File f = null;
+        try {
+            parent4.mkdirs();
+            f = new File(parent4, filename + ".java");
+            final PrintWriter out = new PrintWriter(f);
+            out.print(content);
+            out.flush();
+            out.close();
+            ArrayList<String> args = new ArrayList<String>();
+            args.add("java");
+            args.add("-jar");
+            args.add(JAR);
+            args.add("-s");
+            args.add(parent1.toString());
+            args.add("-d");
+            args.add(JAR);
+
+            final Process p = new ProcessBuilder(args).start();
+            final StringBuilder output = new StringBuilder();
+            final BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
+            String line = null;
+            while ((line = in.readLine()) != null) {
+                output.append(line);
+            }
+            int ret = p.waitFor();
+            if (ret == 0) {
+                return output.toString();
+            }
+        } finally {
+            if (f != null) {
+                f.delete();
+            }
+            parent4.delete();
+            parent3.delete();
+            parent2.delete();
+            parent1.delete();
+        }
+        return null;
+    }
+}
diff --git a/common/host-side/native-scanner/Android.mk b/common/host-side/native-scanner/Android.mk
new file mode 100644
index 0000000..184cdc0
--- /dev/null
+++ b/common/host-side/native-scanner/Android.mk
@@ -0,0 +1,47 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_JAR_MANIFEST := MANIFEST.mf
+
+LOCAL_CLASSPATH := $(HOST_JDK_TOOLS_JAR)
+
+LOCAL_JAVA_LIBRARIES := compatibility-common-util-hostsidelib_v2
+
+LOCAL_MODULE := compatibility-native-scanner_v2
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_HOST_JAVA_LIBRARY)
+
+################################################################################
+# Build the tests
+###############################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, tests/src)
+
+LOCAL_JAVA_LIBRARIES := compatibility-tradefed_v2 compatibility-native-scanner_v2 junit
+
+LOCAL_MODULE := compatibility-native-scanner-tests_v2
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/common/host-side/native-scanner/MANIFEST.mf b/common/host-side/native-scanner/MANIFEST.mf
new file mode 100644
index 0000000..c5641ca
--- /dev/null
+++ b/common/host-side/native-scanner/MANIFEST.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: com.android.compatibility.common.scanner.NativeScanner
+Class-Path: compatibility-common-util-hostsidelib_v2.jar
diff --git a/common/host-side/native-scanner/src/com/android/compatibility/common/scanner/NativeScanner.java b/common/host-side/native-scanner/src/com/android/compatibility/common/scanner/NativeScanner.java
new file mode 100644
index 0000000..7b9e447
--- /dev/null
+++ b/common/host-side/native-scanner/src/com/android/compatibility/common/scanner/NativeScanner.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.scanner;
+
+import com.android.compatibility.common.util.KeyValueArgsParser;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+/**
+ * Passes the gtest output and outputs a list of test classes and methods.
+ */
+public final class NativeScanner {
+
+    private static final String TEST_SUITE_ARG = "t";
+    private static final String USAGE = "Usage: compatibility-native-scanner -t TEST_SUITE"
+        + "  This code reads from stdin the list of tests."
+        + "  The format expected:"
+        + "    TEST_CASE_NAME."
+        + "      TEST_NAME";
+
+    /**
+     * @return An {@link ArrayList} of suites, classes and method names.
+     */
+    static ArrayList<String> getTestNames(BufferedReader reader, String testSuite)
+            throws IOException {
+        ArrayList<String> testNames = new ArrayList<String>();
+        testNames.add("suite:" + testSuite);
+
+        String testCaseName = null;
+        String line;
+        while ((line = reader.readLine()) != null) {
+            if (line.length() == 0) {
+                continue;
+            }
+            if (line.charAt(0) == ' ') {
+                if (testCaseName == null) {
+                    throw new RuntimeException("TEST_CASE_NAME not defined before first test.");
+                }
+                testNames.add("test:" + line.trim());
+            } else {
+                testCaseName = line.trim();
+                if (testCaseName.endsWith(".")) {
+                    testCaseName = testCaseName.substring(0, testCaseName.length()-1);
+                }
+                testNames.add("case:" + testCaseName);
+            }
+        }
+        return testNames;
+    }
+
+    /** Lookup test suite argument and scan {@code System.in} for test cases */
+    public static void main(String[] args) throws IOException {
+        HashMap<String, String> argMap = KeyValueArgsParser.parse(args);
+        if (!argMap.containsKey(TEST_SUITE_ARG)) {
+            System.err.println(USAGE);
+            System.exit(1);
+        }
+
+        String testSuite = argMap.get(TEST_SUITE_ARG);
+
+        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
+        for (String name : getTestNames(reader, testSuite)) {
+            System.out.println(name);
+        }
+    }
+}
diff --git a/common/host-side/native-scanner/tests/src/com/android/compatibility/common/scanner/NativeScannerTest.java b/common/host-side/native-scanner/tests/src/com/android/compatibility/common/scanner/NativeScannerTest.java
new file mode 100644
index 0000000..c5d3157
--- /dev/null
+++ b/common/host-side/native-scanner/tests/src/com/android/compatibility/common/scanner/NativeScannerTest.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.scanner;
+
+import com.android.compatibility.common.scanner.NativeScanner;
+
+import junit.framework.TestCase;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.List;
+import java.util.Iterator;
+
+public class NativeScannerTest extends TestCase {
+
+    public void testSingleTestNamesCase() throws Exception {
+        StringReader singleTestString = new StringReader("FakeTestCase.\n  FakeTestName\n");
+        BufferedReader reader = new BufferedReader(singleTestString);
+
+        List<String> names = NativeScanner.getTestNames(reader, "TestSuite");
+        Iterator<String> it = names.iterator();
+        assertEquals("suite:TestSuite", it.next());
+        assertEquals("case:FakeTestCase", it.next());
+        assertEquals("test:FakeTestName", it.next());
+        assertFalse(it.hasNext());
+    }
+
+    public void testMultipleTestNamesCase() throws Exception {
+        StringReader singleTestString = new StringReader(
+          "Case1.\n  Test1\n  Test2\nCase2.\n  Test3\n Test4\n");
+        BufferedReader reader = new BufferedReader(singleTestString);
+
+        List<String> names = NativeScanner.getTestNames(reader, "TestSuite");
+
+        Iterator<String> it = names.iterator();
+        assertEquals("suite:TestSuite", it.next());
+        assertEquals("case:Case1", it.next());
+        assertEquals("test:Test1", it.next());
+        assertEquals("test:Test2", it.next());
+        assertEquals("case:Case2", it.next());
+        assertEquals("test:Test3", it.next());
+        assertEquals("test:Test4", it.next());
+        assertFalse(it.hasNext());
+    }
+
+    public void testMissingTestCaseNameCase() throws IOException {
+        StringReader singleTestString = new StringReader("  Test1\n");
+        BufferedReader reader = new BufferedReader(singleTestString);
+
+        try {
+            NativeScanner.getTestNames(reader, "TestSuite");
+            fail("Expected RuntimeException");
+        } catch (RuntimeException expected) {}
+    }
+}
diff --git a/common/host-side/scripts/compatibility-tests_v2 b/common/host-side/scripts/compatibility-tests_v2
new file mode 100755
index 0000000..797909e
--- /dev/null
+++ b/common/host-side/scripts/compatibility-tests_v2
@@ -0,0 +1,61 @@
+#!/bin/bash
+#
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+checkFile() {
+    if [ ! -f "$1" ]; then
+        echo "Unable to locate $1"
+        exit
+    fi;
+}
+
+HOST_JAR_DIR=${ANDROID_HOST_OUT}/framework
+HOST_JARS="ddmlib-prebuilt tradefed-prebuilt hosttestlib\
+    compatibility-tradefed_v2 compatibility-tradefed-tests_v2\
+    compatibility-java-scanner_v2 compatibility-java-scanner-tests_v2\
+    compatibility-native-scanner_v2 compatibility-native-scanner-tests_v2\
+    compatibility-xml-plan-generator_v2 compatibility-xml-plan-generator-tests_v2\
+    compatibility-device-util-tests_v2 compatibility-device-setup-tests_v2\
+    compatibility-common-util-hostsidelib_v2 compatibility-common-util-tests_v2"
+
+for JAR in ${HOST_JARS}; do
+    checkFile ${HOST_JAR_DIR}/${JAR}.jar
+    JAR_PATH=${JAR_PATH}:${HOST_JAR_DIR}/${JAR}.jar
+done
+
+DEVICE_LIBS_DIR=${ANDROID_PRODUCT_OUT}/obj/JAVA_LIBRARIES
+DEVICE_LIBS="compatibility-common-util-devicesidelib_v2 compatibility-device-util_v2\
+    compatibility-device-setup_v2"
+
+for LIB in ${DEVICE_LIBS}; do
+    checkFile ${DEVICE_LIBS_DIR}/${LIB}_intermediates/javalib.jar
+    JAR_PATH=${JAR_PATH}:${DEVICE_LIBS_DIR}/${LIB}_intermediates/javalib.jar
+done
+
+# TODO(stuartscott): Currently the test classes are explicitly set here, but
+# once our wrappers for tradefed are in place we can make it scan and generate
+# the list of test at runtime.
+TEST_CLASSES="com.android.compatibility.common.devicesetup.DeviceSetupTest\
+    com.android.compatibility.common.scanner.JavaScannerTest\
+    com.android.compatibility.common.scanner.NativeScannerTest\
+    com.android.compatibility.common.tradefed.TradefedTest\
+    com.android.compatibility.common.util.DeviceUtilTest\
+    com.android.compatibility.common.util.CommonUtilTest\
+    com.android.compatibility.common.xmlgenerator.XmlPlanGeneratorTest"
+
+for CLASS in ${TEST_CLASSES}; do
+    java $RDBG_FLAG -cp ${JAR_PATH} com.android.compatibility.common.tradefed.command.CompatibilityConsole run\
+            singleCommand host -n --class ${CLASS} "$@"
+done
diff --git a/common/host-side/scripts/compatibility-tradefed_v2 b/common/host-side/scripts/compatibility-tradefed_v2
new file mode 100755
index 0000000..f64e273
--- /dev/null
+++ b/common/host-side/scripts/compatibility-tradefed_v2
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+echo "TODO(stuartscott): Add the wrapper to launch the executable. This will be done in the next CL"
diff --git a/common/host-side/tradefed/Android.mk b/common/host-side/tradefed/Android.mk
new file mode 100644
index 0000000..2cb559a
--- /dev/null
+++ b/common/host-side/tradefed/Android.mk
@@ -0,0 +1,51 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+###############################################################################
+# Builds the compatibility tradefed host library
+###############################################################################
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+#LOCAL_JAVA_RESOURCE_DIRS := res
+
+LOCAL_MODULE := compatibility-tradefed_v2
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_JAVA_LIBRARIES := ddmlib-prebuilt tradefed-prebuilt hosttestlib compatibility-common-util-hostsidelib_v2
+
+include $(BUILD_HOST_JAVA_LIBRARY)
+
+###############################################################################
+# Build the compatibility tradefed tests
+###############################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, tests/src)
+
+LOCAL_MODULE := compatibility-tradefed-tests_v2
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_JAVA_LIBRARIES := ddmlib-prebuilt tradefed-prebuilt compatibility-tradefed_v2 junit
+
+LOCAL_STATIC_JAVA_LIBRARIES := easymock
+
+include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/command/CompatibilityConsole.java b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/command/CompatibilityConsole.java
new file mode 100644
index 0000000..dfd1c71
--- /dev/null
+++ b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/command/CompatibilityConsole.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.tradefed.command;
+
+import com.android.tradefed.command.Console;
+import com.android.tradefed.config.ConfigurationException;
+
+/**
+ * An extension of Tradefed's console which adds features specific to compatibility testing.
+ */
+public class CompatibilityConsole extends Console {
+
+    public static void main(String[] args) throws InterruptedException, ConfigurationException {
+        CompatibilityConsole console = new CompatibilityConsole();
+        Console.startConsole(console, args);
+    }
+}
diff --git a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl b/common/host-side/tradefed/tests/src/com/android/compatibility/common/tradefed/TradefedTest.java
similarity index 68%
copy from tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
copy to common/host-side/tradefed/tests/src/com/android/compatibility/common/tradefed/TradefedTest.java
index af264c9..ab19369 100644
--- a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
+++ b/common/host-side/tradefed/tests/src/com/android/compatibility/common/tradefed/TradefedTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 The Android Open Source Project
+ * Copyright (C) 2014 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,12 @@
  * limitations under the License.
  */
 
-package android.security.cts.activity;
+package com.android.compatibility.common.tradefed;
 
-interface ISecureRandomService {
-    int getRandomBytesAndPid(inout byte[] randomBytes);
+import junit.framework.TestCase;
+
+public class TradefedTest extends TestCase {
+
+    // TODO(stuartscott): Add tests when there is something to test.
+
 }
diff --git a/common/host-side/xml-plan-generator/Android.mk b/common/host-side/xml-plan-generator/Android.mk
new file mode 100644
index 0000000..53718e5
--- /dev/null
+++ b/common/host-side/xml-plan-generator/Android.mk
@@ -0,0 +1,49 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_JAVA_LIBRARIES := compatibility-common-util-hostsidelib_v2
+
+LOCAL_STATIC_JAVA_LIBRARIES := vogarexpectlib
+
+LOCAL_JAR_MANIFEST := MANIFEST.mf
+
+LOCAL_CLASSPATH := $(HOST_JDK_TOOLS_JAR)
+
+LOCAL_MODULE := compatibility-xml-plan-generator_v2
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_HOST_JAVA_LIBRARY)
+
+###############################################################################
+# Build the tests
+###############################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, tests/src)
+
+LOCAL_JAVA_LIBRARIES := compatibility-tradefed_v2 compatibility-xml-plan-generator_v2 junit
+
+LOCAL_MODULE := compatibility-xml-plan-generator-tests_v2
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/common/host-side/xml-plan-generator/MANIFEST.mf b/common/host-side/xml-plan-generator/MANIFEST.mf
new file mode 100644
index 0000000..95aee0d
--- /dev/null
+++ b/common/host-side/xml-plan-generator/MANIFEST.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: com.android.compatibility.common.xmlgenerator.XmlPlanGenerator
+Class-Path: compatibility-common-util-hostsidelib_v2.jar
diff --git a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl b/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/Test.java
similarity index 66%
copy from tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
copy to common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/Test.java
index af264c9..d3e1d88 100644
--- a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
+++ b/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/Test.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 The Android Open Source Project
+ * Copyright (C) 2014 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,17 @@
  * limitations under the License.
  */
 
-package android.security.cts.activity;
+package com.android.compatibility.common.xmlgenerator;
 
-interface ISecureRandomService {
-    int getRandomBytesAndPid(inout byte[] randomBytes);
+public class Test {
+
+    private final String mName;
+
+    public Test(String name) {
+        mName = name;
+    }
+
+    public String getName() {
+        return mName;
+    }
 }
diff --git a/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/TestCase.java b/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/TestCase.java
new file mode 100644
index 0000000..65b4aa3
--- /dev/null
+++ b/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/TestCase.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.xmlgenerator;
+
+import java.util.ArrayList;
+
+public class TestCase {
+
+    private final String mName;
+    private final ArrayList<Test> mTests = new ArrayList<Test>();
+
+    public TestCase(String name) {
+        mName = name;
+    }
+
+    public void addTest(Test test) {
+        mTests.add(test);
+    }
+
+    public String getName() {
+        return mName;
+    }
+
+    public ArrayList<Test> getTests() {
+        return mTests;
+    }
+}
diff --git a/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/TestListParser.java b/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/TestListParser.java
new file mode 100644
index 0000000..6880440
--- /dev/null
+++ b/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/TestListParser.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.xmlgenerator;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Scanner;
+
+/**
+ * Parser of test lists in the form;
+ *
+ * suite:android.sample
+ * case:SampleTest
+ * test:testA
+ * test:testB
+ * suite:android.sample.ui
+ * case:SampleUiTest
+ * test:testA
+ * test:testB
+ */
+public class TestListParser {
+
+    private TestListParser() {}
+
+    public static HashMap<String, TestSuite> parse(InputStream input) {
+        final HashMap<String, TestSuite> suites = new HashMap<String, TestSuite>();
+        TestSuite currentSuite = null;
+        TestCase currentCase = null;
+        Scanner in = null;
+        try {
+            in = new Scanner(input);
+            while (in.hasNextLine()) {
+                final String line = in.nextLine();
+                final String[] parts = line.split(":");
+                if (parts.length != 2) {
+                    throw new RuntimeException("Invalid Format: " + line);
+                }
+                final String key = parts[0];
+                final String value = parts[1];
+                if (currentSuite == null) {
+                    if (!"suite".equals(key)) {
+                        throw new RuntimeException("TestSuite Expected");
+                    }
+                    final String[] names = value.split("\\.");
+                    for (int i = 0; i < names.length; i++) {
+                        final String name = names[i];
+                        if (currentSuite != null) {
+                            if (currentSuite.hasTestSuite(name)) {
+                                currentSuite = currentSuite.getTestSuite(name);
+                            } else {
+                                final TestSuite newSuite = new TestSuite(name);
+                                currentSuite.addTestSuite(newSuite);
+                                currentSuite = newSuite;
+                            }
+                        } else if (suites.containsKey(name)) {
+                            currentSuite = suites.get(name);
+                        } else {
+                            currentSuite = new TestSuite(name);
+                            suites.put(name, currentSuite);
+                        }
+                    }
+                } else if (currentCase == null) {
+                    if (!"case".equals(key)) {
+                        throw new RuntimeException("TestCase Expected");
+                    }
+                    currentCase = new TestCase(value);
+                    currentSuite.addTestCase(currentCase);
+                } else {
+                    if (!"test".equals(key)) {
+                        throw new RuntimeException("Test Expected");
+                    }
+                    currentCase.addTest(new Test(value));
+                }
+            }
+        } finally {
+            if (in != null) {
+                in.close();
+            }
+        }
+        return suites;
+    }
+}
diff --git a/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/TestSuite.java b/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/TestSuite.java
new file mode 100644
index 0000000..db4fd07
--- /dev/null
+++ b/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/TestSuite.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.xmlgenerator;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+public class TestSuite {
+
+    private final String mName;
+    private final HashMap<String, TestSuite> mTestSuites = new HashMap<String, TestSuite>();
+    private final ArrayList<TestCase> mTestCases = new ArrayList<TestCase>();
+
+    public TestSuite(String name) {
+        mName = name;
+    }
+
+    public boolean hasTestSuite(String name) {
+        return mTestSuites.containsKey(name);
+    }
+
+    public TestSuite getTestSuite(String name) {
+        return mTestSuites.get(name);
+    }
+
+    public void addTestSuite(TestSuite testSuite) {
+        mTestSuites.put(testSuite.getName(), testSuite);
+    }
+
+    public void addTestCase(TestCase testCase) {
+        mTestCases.add(testCase);
+    }
+
+    public String getName() {
+        return mName;
+    }
+
+    public HashMap<String, TestSuite> getTestSuites() {
+        return mTestSuites;
+    }
+
+    public ArrayList<TestCase> getTestCases() {
+        return mTestCases;
+    }
+}
diff --git a/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/XmlPlanGenerator.java b/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/XmlPlanGenerator.java
new file mode 100644
index 0000000..d0a3a37
--- /dev/null
+++ b/common/host-side/xml-plan-generator/src/com/android/compatibility/common/xmlgenerator/XmlPlanGenerator.java
@@ -0,0 +1,217 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.xmlgenerator;
+
+import com.android.compatibility.common.util.KeyValueArgsParser;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import vogar.Expectation;
+import vogar.ExpectationStore;
+import vogar.ModeId;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * Passes the scanner output and outputs an xml description of the tests.
+ */
+public class XmlPlanGenerator {
+
+    private final ExpectationStore mExpectations;
+    private final String mAppNameSpace;
+    private final String mAppPackageName;
+    private final String mName;
+    private final String mRunner;
+    private final String mTargetBinaryName;
+    private final String mTargetNameSpace;
+    private final String mJarPath;
+    private final String mTestType;
+    private final String mOutput;
+
+    private XmlPlanGenerator(ExpectationStore expectations, String appNameSpace,
+            String appPackageName, String name, String runner, String targetBinaryName,
+            String targetNameSpace, String jarPath, String testType, String output) {
+        mExpectations = expectations;
+        mAppNameSpace = appNameSpace;
+        mAppPackageName = appPackageName;
+        mName = name;
+        mRunner = runner;
+        mTargetBinaryName = targetBinaryName;
+        mTargetNameSpace = targetNameSpace;
+        mJarPath = jarPath;
+        mTestType = testType;
+        mOutput = output;
+    }
+
+    private void writePackageXml() throws IOException {
+        OutputStream out = System.out;
+        if (mOutput != null) {
+            out = new FileOutputStream(mOutput);
+        }
+        PrintWriter writer = null;
+        try {
+            writer = new PrintWriter(out);
+            writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+            writeTestPackage(writer);
+        } finally {
+            if (writer != null) {
+                writer.close();
+            }
+        }
+    }
+
+    private void writeTestPackage(PrintWriter writer) {
+        writer.append("<TestPackage");
+        if (mAppNameSpace != null) {
+            writer.append(" appNameSpace=\"").append(mAppNameSpace).append("\"");
+        }
+
+        writer.append(" appPackageName=\"").append(mAppPackageName).append("\"");
+        writer.append(" name=\"").append(mName).append("\"");
+
+        if (mRunner != null) {
+            writer.append(" runner=\"").append(mRunner).append("\"");
+        }
+
+        if (mAppNameSpace != null && mTargetNameSpace != null
+                && !mAppNameSpace.equals(mTargetNameSpace)) {
+            writer.append(" targetBinaryName=\"").append(mTargetBinaryName).append("\"");
+            writer.append(" targetNameSpace=\"").append(mTargetNameSpace).append("\"");
+        }
+
+        if (mTestType != null && !mTestType.isEmpty()) {
+            writer.append(" testType=\"").append(mTestType).append("\"");
+        }
+
+        if (mJarPath != null) {
+            writer.append(" jarPath=\"").append(mJarPath).append("\"");
+        }
+
+        writer.println(" version=\"1.0\">");
+
+        final HashMap<String, TestSuite> suites = TestListParser.parse(System.in);
+        if (suites.isEmpty()) {
+            throw new RuntimeException("No TestSuites Found");
+        }
+        writeTestSuites(writer, suites, "");
+        writer.println("</TestPackage>");
+    }
+
+    private void writeTestSuites(PrintWriter writer, HashMap<String, TestSuite> suites, String name) {
+        for (String suiteName : suites.keySet()) {
+            final TestSuite suite = suites.get(suiteName);
+            writer.append("<TestSuite name=\"").append(suiteName).println("\">");
+            final String fullname = name + suiteName + ".";
+            writeTestSuites(writer, suite.getTestSuites(), fullname);
+            writeTestCases(writer, suite.getTestCases(), fullname);
+            writer.println("</TestSuite>");
+        }
+    }
+
+    private void writeTestCases(PrintWriter writer, ArrayList<TestCase> cases, String name) {
+        for (TestCase testCase : cases) {
+            final String caseName = testCase.getName();
+            writer.append("<TestCase name=\"").append(caseName).println("\">");
+            final String fullname = name + caseName;
+            writeTests(writer, testCase.getTests(), fullname);
+            writer.println("</TestCase>");
+        }
+    }
+
+    private void writeTests(PrintWriter writer, ArrayList<Test> tests, String name) {
+        if (tests.isEmpty()) {
+            throw new RuntimeException("No Tests Found");
+        }
+        for (Test test : tests) {
+            final String testName = test.getName();
+            writer.append("<Test name=\"").append(testName).append("\"");
+            final String fullname = name + "#" + testName;
+            if (isKnownFailure(mExpectations, fullname)) {
+                writer.append(" expectation=\"failure\"");
+            }
+            writer.println(" />");
+        }
+    }
+
+    public static boolean isKnownFailure(ExpectationStore store, String fullname) {
+        return store != null && store.get(fullname) != Expectation.SUCCESS;
+    }
+
+    public static void main(String[] args) throws Exception {
+        final HashMap<String, String> argsMap = KeyValueArgsParser.parse(args);
+        final String packageName = argsMap.get("-p");
+        final String name = argsMap.get("-n");
+        final String testType = argsMap.get("-t");
+        final String jarPath = argsMap.get("-j");
+        final String instrumentation = argsMap.get("-i");
+        final String manifest = argsMap.get("-m");
+        final String expectations = argsMap.get("-e");
+        final String output = argsMap.get("-o");
+        String appNameSpace = argsMap.get("-a");
+        String targetNameSpace = argsMap.get("-r");
+        if (packageName == null || name == null) {
+            usage(args);
+        }
+        String runner = null;
+        if (manifest != null) {
+            Document m = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(manifest);
+            Element elem = m.getDocumentElement();
+            appNameSpace = elem.getAttribute("package");
+            runner = getElementAttribute(elem, "instrumentation", "android:name");
+            targetNameSpace = getElementAttribute(elem, "instrumentation", "android:targetPackage");
+        }
+
+        final HashSet<File> expectationFiles = new HashSet<File>();
+        if (expectations != null) {
+            expectationFiles.add(new File(expectations));
+        }
+        final ExpectationStore store = ExpectationStore.parse(expectationFiles, ModeId.DEVICE);
+        XmlPlanGenerator generator = new XmlPlanGenerator(store, appNameSpace, packageName, name,
+            runner, instrumentation, targetNameSpace, jarPath, testType, output);
+        generator.writePackageXml();
+    }
+
+    private static String getElementAttribute(Element parent, String elem, String name) {
+        NodeList nodeList = parent.getElementsByTagName(elem);
+        if (nodeList.getLength() > 0) {
+             Element element = (Element) nodeList.item(0);
+             return element.getAttribute(name);
+        }
+        return null;
+    }
+
+    private static void usage(String[] args) {
+        System.err.println("Arguments: " + Arrays.toString(args));
+        System.err.println("Usage: compatibility-xml-plan-generator -p PACKAGE_NAME -n NAME" +
+            "[-t TEST_TYPE] [-j JAR_PATH] [-i INSTRUMENTATION] [-m MANIFEST] [-e EXPECTATIONS]" +
+            "[-o OUTPUT]");
+        System.exit(1);
+    }
+}
diff --git a/common/host-side/xml-plan-generator/tests/src/com/android/compatibility/common/xmlgenerator/XmlPlanGeneratorTest.java b/common/host-side/xml-plan-generator/tests/src/com/android/compatibility/common/xmlgenerator/XmlPlanGeneratorTest.java
new file mode 100644
index 0000000..082af17
--- /dev/null
+++ b/common/host-side/xml-plan-generator/tests/src/com/android/compatibility/common/xmlgenerator/XmlPlanGeneratorTest.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.xmlgenerator;
+
+import junit.framework.TestCase;
+
+import java.io.ByteArrayInputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Scanner;
+
+public class XmlPlanGeneratorTest extends TestCase {
+
+    private static final String JAR = "out/host/linux-x86/framework/compatibility-xml-plan-generator_v2.jar";
+    private static final String PACKAGE_NAME = "com.android.test";
+    private static final String NAME = "ValidTest";
+    private static final String VALID_RESULT =
+        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+        "<TestPackage appPackageName=\"com.android.test\" name=\"ValidTest\" version=\"1.0\">" +
+        "<TestSuite name=\"com\">" +
+        "<TestSuite name=\"android\">" +
+        "<TestSuite name=\"test\">" +
+        "<TestCase name=\"ValidTest\">" +
+        "<Test name=\"testA\" />" +
+        "</TestCase>" +
+        "</TestSuite>" +
+        "</TestSuite>" +
+        "</TestSuite>" +
+        "</TestPackage>";
+
+    private static final String VALID =
+        "suite:com.android.test\n" +
+        "case:ValidTest\n" +
+        "test:testA\n";
+
+    private static final String INVALID_A = "";
+
+    private static final String INVALID_B =
+        "suite:com.android.test\n" +
+        "case:InvalidTest\n";
+
+    private static final String INVALID_C =
+        "uh oh";
+
+    private static final String INVALID_D =
+        "test:testA\n" +
+        "case:InvalidTest\n" +
+        "suite:com.android.test\n";
+
+    private static final String INVALID_E =
+        "suite:com.android.test\n" +
+        "test:testA\n" +
+        "case:InvalidTest\n";
+
+    public void testValid() throws Exception {
+        assertEquals(VALID_RESULT, runGenerator(VALID));
+    }
+
+    public void testInvalidA() throws Exception {
+        assertNull(runGenerator(INVALID_A));
+    }
+
+    public void testInvalidB() throws Exception {
+        assertNull(runGenerator(INVALID_B));
+    }
+
+    public void testTestListParserInvalidFormat() throws Exception {
+        runTestListParser(INVALID_C);
+    }
+
+    public void testTestListParserSuiteExpected() throws Exception {
+        runTestListParser(INVALID_D);
+    }
+
+    public void testTestListParserCaseExpected() throws Exception {
+        runTestListParser(INVALID_E);
+    }
+
+    private static String runGenerator(String input) throws Exception {
+        ArrayList<String> args = new ArrayList<String>();
+        args.add("java");
+        args.add("-jar");
+        args.add(JAR);
+        args.add("-p");
+        args.add(PACKAGE_NAME);
+        args.add("-n");
+        args.add(NAME);
+
+        final Process p = new ProcessBuilder(args).start();
+        final PrintWriter out = new PrintWriter(p.getOutputStream());
+        out.print(input);
+        out.flush();
+        out.close();
+        final StringBuilder output = new StringBuilder();
+        final Scanner in = new Scanner(p.getInputStream());
+        while (in.hasNextLine()) {
+            output.append(in.nextLine());
+        }
+        int ret = p.waitFor();
+        if (ret == 0) {
+            return output.toString();
+        }
+        return null;
+    }
+
+    private static void runTestListParser(String input) throws Exception {
+        try {
+            final ByteArrayInputStream in = new ByteArrayInputStream(input.getBytes());
+            final HashMap<String, TestSuite> suites = TestListParser.parse(in);
+            fail();
+        } catch (RuntimeException e) {}
+    }
+}
diff --git a/common/util/Android.mk b/common/util/Android.mk
new file mode 100644
index 0000000..b7842559
--- /dev/null
+++ b/common/util/Android.mk
@@ -0,0 +1,61 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+###############################################################################
+# Build the common utility library for use device-side
+###############################################################################
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_MODULE := compatibility-common-util-devicesidelib_v2
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+###############################################################################
+# Build the common utility library for use host-side
+###############################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_MODULE := compatibility-common-util-hostsidelib_v2
+
+include $(BUILD_HOST_JAVA_LIBRARY)
+
+###############################################################################
+# Build the tests
+###############################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, tests/src)
+
+LOCAL_JAVA_LIBRARIES := junit
+
+LOCAL_MODULE := compatibility-common-util-tests_v2
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/common/util/src/com/android/compatibility/common/util/KeyValueArgsParser.java b/common/util/src/com/android/compatibility/common/util/KeyValueArgsParser.java
new file mode 100644
index 0000000..92a2b18
--- /dev/null
+++ b/common/util/src/com/android/compatibility/common/util/KeyValueArgsParser.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+import java.util.HashMap;
+
+/**
+ * Parses an array of arguments into a HashMap.
+ *
+ * This class assumed the arguments are in the form "-<key> <value> ..."
+ */
+public class KeyValueArgsParser {
+
+    private KeyValueArgsParser() {}
+
+    public static HashMap<String, String> parse(String[] args) {
+        final HashMap<String, String> map = new HashMap<String, String>();
+        String key = null;
+        for (String s : args) {
+            if (key == null) {
+                if (!s.startsWith("-")) {
+                    throw new RuntimeException("Invalid Key: " + s);
+                }
+                key = s;
+            } else {
+                map.put(key, s);
+                key = null;
+            }
+        }
+        if (key != null) {
+            throw new RuntimeException("Left over key");
+        }
+        return map;
+    }
+}
diff --git a/common/util/src/com/android/compatibility/common/util/MeasureRun.java b/common/util/src/com/android/compatibility/common/util/MeasureRun.java
new file mode 100644
index 0000000..d58b8d4
--- /dev/null
+++ b/common/util/src/com/android/compatibility/common/util/MeasureRun.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+/**
+ * Interface for measuring time for each run.
+ */
+public abstract class MeasureRun {
+    /**
+     *  Called before each run. not included in time measurement.
+     */
+    public void prepare(int i) throws Exception {
+        // default empty implementation
+    };
+
+    abstract public void run(int i) throws Exception;
+}
diff --git a/common/util/src/com/android/compatibility/common/util/MeasureTime.java b/common/util/src/com/android/compatibility/common/util/MeasureTime.java
new file mode 100644
index 0000000..102b96a
--- /dev/null
+++ b/common/util/src/com/android/compatibility/common/util/MeasureTime.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+/**
+ * Provides a mechanism to measure the time taken to run a piece of code.
+ *
+ * The code will be run multiple times and the time taken by each run will returned.
+ */
+public class MeasureTime {
+    /**
+     * measure time taken for each run for given count
+     * @param count
+     * @param run
+     * @return array of time taken in each run in msec.
+     * @throws Exception
+     */
+    public static double[] measure(int count, MeasureRun run) throws Exception {
+        double[] result = new double[count];
+
+        for (int i = 0; i < count; i++) {
+            run.prepare(i);
+            long start = System.currentTimeMillis();
+            run.run(i);
+            long end =  System.currentTimeMillis();
+            result[i] = end - start;
+        }
+        return result;
+    }
+}
diff --git a/common/util/src/com/android/compatibility/common/util/ReportLog.java b/common/util/src/com/android/compatibility/common/util/ReportLog.java
new file mode 100644
index 0000000..9e733e4
--- /dev/null
+++ b/common/util/src/com/android/compatibility/common/util/ReportLog.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Utility class to add results to the report.
+ */
+public abstract class ReportLog implements Serializable {
+
+    private Result mSummary;
+    private final List<Result> mDetails = new ArrayList<Result>();
+
+    private class Result implements Serializable {
+        private static final int BASE_DEPTH = 2;// 0:constructor, 1:addValues/setSummary, 2:caller
+        private String mLocation;
+        private String mMessage;
+        private double[] mValues;
+        private ResultType mType;
+        private ResultUnit mUnit;
+
+        /**
+         * Creates a result object to be included in the report. Each object has a message
+         * describing its values and enums to interpret them. In addition, each result also includes
+         * class, method and line number information about the test which added this result which is
+         * collected by looking at the stack trace.
+         *
+         * @param message A string describing the values
+         * @param values An array of the values
+         * @param type Represents how to interpret the values (eg. A lower score is better)
+         * @param unit Represents the unit in which the values are (eg. Milliseconds)
+         * @param depth A number used to increase the depth the stack is queried. This should only
+         * be given in the case that the report is populated by a helper function, in which case it
+         * would be 1, or else 0.
+         */
+        private Result(String message, double[] values, ResultType type,
+                ResultUnit unit, int depth) {
+            final StackTraceElement[] trace = Thread.currentThread().getStackTrace();
+            final StackTraceElement e = trace[Math.min(BASE_DEPTH + depth, trace.length - 1)];
+            mLocation = String.format("%s#%s:%d",
+                    e.getClassName(), e.getMethodName(), e.getLineNumber());
+            mMessage = message;
+            mValues = values;
+            mType = type;
+            mUnit = unit;
+        }
+
+    }
+
+    /**
+     * Adds an array of values to the report.
+     */
+    public void addValues(String message, double[] values, ResultType type, ResultUnit unit) {
+        mDetails.add(new Result(message, values, type, unit, 0));
+    }
+
+    /**
+     * Adds an array of values to the report.
+     */
+    public void addValues(String message, double[] values, ResultType type,
+            ResultUnit unit, int depth) {
+        mDetails.add(new Result(message, values, type, unit, depth));
+    }
+
+    /**
+     * Adds a value to the report.
+     */
+    public void addValue(String message, double value, ResultType type, ResultUnit unit) {
+        mDetails.add(new Result(message, new double[] {value}, type, unit, 0));
+    }
+
+    /**
+     * Adds a value to the report.
+     */
+    public void addValue(String message, double value, ResultType type,
+            ResultUnit unit, int depth) {
+        mDetails.add(new Result(message, new double[] {value}, type, unit, depth));
+    }
+
+    /**
+     * Sets the summary of the report.
+     */
+    public void setSummary(String message, double value, ResultType type, ResultUnit unit) {
+        mSummary = new Result(message, new double[] {value}, type, unit, 0);
+    }
+
+    /**
+     * Sets the summary of the report.
+     */
+    public void setSummary(String message, double value, ResultType type,
+            ResultUnit unit, int depth) {
+        mSummary = new Result(message, new double[] {value}, type, unit, depth);
+    }
+}
diff --git a/common/util/src/com/android/compatibility/common/util/ResultType.java b/common/util/src/com/android/compatibility/common/util/ResultType.java
new file mode 100644
index 0000000..779c6d0
--- /dev/null
+++ b/common/util/src/com/android/compatibility/common/util/ResultType.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+/**
+ * Enum for distinguishing results.
+ */
+public enum ResultType {
+    /** Lower score is better. */
+    LOWER_BETTER,
+    /** Higher score is better. */
+    HIGHER_BETTER,
+    /** This value is not directly correlated with score. */
+    NEUTRAL,
+    /** Presence of this type requires some attention although it may not be an error. */
+    WARNING;
+
+    /**
+     * Return string used in the XML report
+     */
+    public String getXmlString() {
+        return name().toLowerCase();
+    }
+}
diff --git a/common/util/src/com/android/compatibility/common/util/ResultUnit.java b/common/util/src/com/android/compatibility/common/util/ResultUnit.java
new file mode 100644
index 0000000..f38ddae
--- /dev/null
+++ b/common/util/src/com/android/compatibility/common/util/ResultUnit.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+/**
+ * Enum for representing the unit of results.
+ */
+public enum ResultUnit {
+    /** for value with no unit */
+    NONE,
+    /** milli-seconds */
+    MS,
+    /** frames per second */
+    FPS,
+    /** operations per second */
+    OPS,
+    /** kilo-bytes-per-second, not bits-per-second */
+    KBPS,
+    /** mega-bytes-per-second */
+    MBPS,
+    /** amount of data, bytes */
+    BYTE,
+    /** tell how many times it did happen. */
+    COUNT,
+    /** unit for benchmarking with generic score. */
+    SCORE;
+
+    /**
+     * Return string used in the XML report
+     */
+    public String getXmlString() {
+        return name().toLowerCase();
+    }
+}
+
diff --git a/common/util/src/com/android/compatibility/common/util/Stat.java b/common/util/src/com/android/compatibility/common/util/Stat.java
new file mode 100644
index 0000000..8bf9bf7
--- /dev/null
+++ b/common/util/src/com/android/compatibility/common/util/Stat.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compatibility.common.util;
+
+import java.util.Arrays;
+
+/**
+ * Utilities for doing statistics
+ */
+public class Stat {
+
+    /**
+     * Collection of statistical propertirs like average, max, min, and stddev
+     */
+    public static class StatResult {
+        public double mAverage;
+        public double mMin;
+        public double mMax;
+        public double mStddev;
+        public int mDataCount;
+        public StatResult(double average, double min, double max, double stddev, int dataCount) {
+            mAverage = average;
+            mMin = min;
+            mMax = max;
+            mStddev = stddev;
+            mDataCount = dataCount;
+        }
+    }
+
+    /**
+     * Calculate statistics properties likes average, min, max, and stddev for the given array
+     */
+    public static StatResult getStat(double[] data) {
+        double average = data[0];
+        double min = data[0];
+        double max = data[0];
+        double eX2 = data[0] * data[0]; // will become E[X^2]
+        for (int i = 1; i < data.length; i++) {
+            average += data[i];
+            eX2 += data[i] * data[i];
+            if (data[i] > max) {
+                max = data[i];
+            }
+            if (data[i] < min) {
+                min = data[i];
+            }
+        }
+        average /= data.length;
+        eX2 /= data.length;
+        // stddev = sqrt(E[X^2] - (E[X])^2)
+        double stddev = Math.sqrt(eX2 - average * average);
+        return new StatResult(average, min, max, stddev, data.length);
+    }
+
+    /**
+     * Calculate statistics properties likes average, min, max, and stddev for the given array
+     * while rejecting outlier +/- median * rejectionThreshold.
+     * rejectionThreshold should be bigger than 0.0 and be lowerthan 1.0
+     */
+    public static StatResult getStatWithOutlierRejection(double[] data, double rejectionThreshold) {
+        double[] dataCopied = Arrays.copyOf(data, data.length);
+        Arrays.sort(dataCopied);
+        int medianIndex = dataCopied.length / 2;
+        double median;
+        if (dataCopied.length % 2 == 1) {
+            median = dataCopied[medianIndex];
+        } else {
+            median = (dataCopied[medianIndex - 1] + dataCopied[medianIndex]) / 2.0;
+        }
+        double thresholdMin = median * (1.0 - rejectionThreshold);
+        double thresholdMax = median * (1.0 + rejectionThreshold);
+
+        double average = 0.0;
+        double min = median;
+        double max = median;
+        double eX2 = 0.0; // will become E[X^2]
+        int validDataCounter = 0;
+        for (int i = 0; i < data.length; i++) {
+            if ((data[i] > thresholdMin) && (data[i] < thresholdMax)) {
+                validDataCounter++;
+                average += data[i];
+                eX2 += data[i] * data[i];
+                if (data[i] > max) {
+                    max = data[i];
+                }
+                if (data[i] < min) {
+                    min = data[i];
+                }
+            }
+            // TODO report rejected data
+        }
+        double stddev;
+        if (validDataCounter > 0) {
+            average /= validDataCounter;
+            eX2 /= validDataCounter;
+            // stddev = sqrt(E[X^2] - (E[X])^2)
+            stddev = Math.sqrt(eX2 - average * average);
+        } else { // both median is showing too much diff
+            average = median;
+            stddev = 0; // don't care
+        }
+
+        return new StatResult(average, min, max, stddev, validDataCounter);
+    }
+
+    /**
+     * return the average value of the passed array
+     */
+    public static double getAverage(double[] data) {
+        double sum = data[0];
+        for (int i = 1; i < data.length; i++) {
+            sum += data[i];
+        }
+        return sum / data.length;
+    }
+
+    /**
+     * return the minimum value of the passed array
+     */
+    public static double getMin(double[] data) {
+        double min = data[0];
+        for (int i = 1; i < data.length; i++) {
+            if (data[i] < min) {
+                min = data[i];
+            }
+        }
+        return min;
+    }
+
+    /**
+     * return the maximum value of the passed array
+     */
+    public static double getMax(double[] data) {
+        double max = data[0];
+        for (int i = 1; i < data.length; i++) {
+            if (data[i] > max) {
+                max = data[i];
+            }
+        }
+        return max;
+    }
+
+    /**
+     * Calculate rate per sec for given change happened during given timeInMSec.
+     * timeInSec with 0 value will be changed to small value to prevent divide by zero.
+     * @param change total change of quality for the given duration timeInMSec.
+     * @param timeInMSec
+     * @return
+     */
+    public static double calcRatePerSec(double change, double timeInMSec) {
+        if (timeInMSec == 0) {
+            return change * 1000.0 / 0.001; // do not allow zero
+        } else {
+            return change * 1000.0 / timeInMSec;
+        }
+    }
+
+    /**
+     * array version of calcRatePerSecArray
+     */
+    public static double[] calcRatePerSecArray(double change, double[] timeInMSec) {
+        double[] result = new double[timeInMSec.length];
+        change *= 1000.0;
+        for (int i = 0; i < timeInMSec.length; i++) {
+            if (timeInMSec[i] == 0) {
+                result[i] = change / 0.001;
+            } else {
+                result[i] = change / timeInMSec[i];
+            }
+        }
+        return result;
+    }
+
+}
diff --git a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl b/common/util/tests/src/com/android/compatibility/common/util/CommonUtilTest.java
similarity index 68%
copy from tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
copy to common/util/tests/src/com/android/compatibility/common/util/CommonUtilTest.java
index af264c9..a376373 100644
--- a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
+++ b/common/util/tests/src/com/android/compatibility/common/util/CommonUtilTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 The Android Open Source Project
+ * Copyright (C) 2014 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,12 @@
  * limitations under the License.
  */
 
-package android.security.cts.activity;
+package com.android.compatibility.common.util;
 
-interface ISecureRandomService {
-    int getRandomBytesAndPid(inout byte[] randomBytes);
+import junit.framework.TestCase;
+
+public class CommonUtilTest extends TestCase {
+
+    // TODO(stuartscott): Add tests when there is something to test.
+
 }
diff --git a/hostsidetests/aadb/src/com/android/cts/aadb/TestDeviceFuncTest.java b/hostsidetests/aadb/src/com/android/cts/aadb/TestDeviceFuncTest.java
index 8257602..ceb9072 100644
--- a/hostsidetests/aadb/src/com/android/cts/aadb/TestDeviceFuncTest.java
+++ b/hostsidetests/aadb/src/com/android/cts/aadb/TestDeviceFuncTest.java
@@ -30,12 +30,17 @@
 import com.android.tradefed.util.RunUtil;
 import com.android.tradefed.util.StreamUtil;
 
+import java.awt.image.BufferedImage;
+
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.InputStream;
 import java.io.IOException;
 
+import javax.imageio.ImageIO;
+
 /**
  * Functional tests for adb connection
  * <p/>
@@ -328,22 +333,21 @@
     /**
      * Basic test for {@link TestDevice#getScreenshot()}.
      * <p/>
-     * Grab a screenshot, save it to a file, and perform a cursory size check to ensure its valid.
+     * Grab a screenshot and perform a cursory size check to ensure its valid.
      */
     public void testGetScreenshot() throws DeviceNotAvailableException, IOException {
-        CLog.i(LOG_TAG, "testGetScreenshot");
         InputStreamSource source = getDevice().getScreenshot();
         assertNotNull(source);
-        File tmpPngFile = FileUtil.createTempFile("screenshot", ".png");
+        InputStream inputStream = source.createInputStream();
         try {
-            FileUtil.writeToFile(source.createInputStream(), tmpPngFile);
-            CLog.i("Created file at %s", tmpPngFile.getAbsolutePath());
-            assertTrue("Saved png file is less than 16K - is it invalid?",
-                    tmpPngFile.length() > 16*1024);
-            // TODO: add more stringent checks
+            BufferedImage screenshotImage = ImageIO.read(inputStream);
+            CLog.i(LOG_TAG, "testGetScreenshot w=%d, h=%d",
+                    screenshotImage.getWidth(), screenshotImage.getHeight());
+            assertTrue(screenshotImage.getWidth() > 0);
+            assertTrue(screenshotImage.getHeight() > 0);
         } finally {
-            FileUtil.deleteFile(tmpPngFile);
-            source.cancel();
+            StreamUtil.cancel(source);
+            StreamUtil.close(inputStream);
         }
     }
 
diff --git a/hostsidetests/holo/src/android/holo/cts/HoloHostTest.java b/hostsidetests/holo/src/android/holo/cts/HoloHostTest.java
index 5de3030..25d1312 100644
--- a/hostsidetests/holo/src/android/holo/cts/HoloHostTest.java
+++ b/hostsidetests/holo/src/android/holo/cts/HoloHostTest.java
@@ -186,6 +186,8 @@
             ref.delete();
         }
         mExecutionService.shutdown();
+        // Remove the APK.
+        mDevice.uninstallPackage(PACKAGE);
         super.tearDown();
     }
 
diff --git a/suite/cts/deviceTests/browserbench/Android.mk b/suite/cts/deviceTests/browserbench/Android.mk
index 6b241a9..6fdb06d 100644
--- a/suite/cts/deviceTests/browserbench/Android.mk
+++ b/suite/cts/deviceTests/browserbench/Android.mk
@@ -26,7 +26,7 @@
 
 LOCAL_PACKAGE_NAME := CtsDeviceBrowserBench
 
-LOCAL_SDK_VERSION := 16
+LOCAL_SDK_VERSION := current
 
 include $(BUILD_CTS_PACKAGE)
 
diff --git a/suite/cts/deviceTests/browserbench/src/com/android/cts/browser/BrowserBenchTest.java b/suite/cts/deviceTests/browserbench/src/com/android/cts/browser/BrowserBenchTest.java
index 997f730..81e6a21 100644
--- a/suite/cts/deviceTests/browserbench/src/com/android/cts/browser/BrowserBenchTest.java
+++ b/suite/cts/deviceTests/browserbench/src/com/android/cts/browser/BrowserBenchTest.java
@@ -16,7 +16,9 @@
 
 package com.android.cts.browser;
 
+import android.content.Context;
 import android.content.Intent;
+import android.content.pm.PackageManager;
 import android.cts.util.WatchDog;
 import android.net.Uri;
 import android.provider.Browser;
@@ -124,6 +126,10 @@
 
     @TimeoutReq(minutes = 60)
     public void testOctane() throws InterruptedException {
+        if (!hasWebViewFeature(getContext())) {
+            Log.w(TAG, "Skipping testOctane");
+            return;
+        }
         String url = mWebServer.getAssetUrl(OCTANE_START_FILE) + "?auto=1";
         final int kRepeat = 5;
         doTest(url, ResultType.LOWER_BETTER, ResultUnit.MS,
@@ -167,4 +173,9 @@
             numberToProcess++;
         }
     }
+
+    private static boolean hasWebViewFeature(Context context) {
+        // Query the system property that determines if there is a functional WebView on the device
+        return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WEBVIEW);
+    }
 }
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index b65ded0..29caf33 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -74,6 +74,7 @@
     <uses-permission android:name="android.permission.NFC" />
     <uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
     <uses-permission android:name="com.android.voicemail.permission.ADD_VOICEMAIL" />
+    <uses-permission android:name="android.permission.BLUETOOTH" />
 
     <!-- Used for PackageManager test, don't delete this INTERNET permission -->
     <uses-permission android:name="android.permission.INTERNET" />
@@ -117,6 +118,9 @@
     <!-- Used for Transmit IR Test -->
     <uses-permission android:name="android.permission.TRANSMIT_IR" />
 
+    <!-- Used for SystemFeatures Test -->
+    <uses-permission android:name="android.permission.BODY_SENSORS"/>
+
     <!-- Used for PackageManager test, don't delete this permission-tree -->
     <permission-tree android:name="com.android.cts.stub.permission.TEST_DYNAMIC"
                     android:label="Test Tree"/>
@@ -665,7 +669,8 @@
         </activity>
 
         <activity android:name="android.app.cts.InstrumentationTestActivity"
-            android:label="InstrumentationTestActivity">
+                  android:theme="@style/Theme_NoSwipeDismiss"
+                  android:label="InstrumentationTestActivity">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -857,7 +862,8 @@
         </activity>
 
         <activity android:name="android.app.cts.DialogStubActivity"
-            android:label="DialogStubActivity">
+                  android:theme="@style/Theme_NoSwipeDismiss"
+                  android:label="DialogStubActivity">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
diff --git a/tests/expectations/knownfailures.txt b/tests/expectations/knownfailures.txt
index 9b089df..adefd76 100644
--- a/tests/expectations/knownfailures.txt
+++ b/tests/expectations/knownfailures.txt
@@ -8,6 +8,10 @@
   bug: 8148617
 },
 {
+  name: "android.holo.cts.HoloHostTest",
+  bug: 15343612
+},
+{
   name: "android.nativeopengl.EGLCleanupTest#TestCorrect",
   name: "android.nativeopengl.EGLCreateContextTest#BadAttributeFails",
   bug: 11652564
@@ -29,5 +33,156 @@
   name: "android.hardware.cts.SensorIntegrationTests#testSensorsWithSeveralClients",
   name: "android.hardware.cts.SensorIntegrationTests#testSensorsMovingRates",
   bug: 11352697
+},
+{
+  name: "android.app.cts.DownloadManagerTest#testDownloadManager",
+  name: "android.app.cts.DownloadManagerTest#testDownloadManagerDestination",
+  name: "android.app.cts.DownloadManagerTest#testDownloadManagerDestinationExtension",
+  name: "android.app.cts.DownloadManagerTest#testMinimumDownload",
+  name: "android.content.cts.ContentResolverSyncTestCase#testCallMultipleAccounts",
+  name: "android.content.cts.ContentResolverSyncTestCase#testCancelSync",
+  name: "android.content.cts.ContentResolverSyncTestCase#testRequestSync",
+  bug: 14657953
+},
+{
+  name: "android.app.cts.DialogTest#testTouchEvent",
+  bug: 15455341
+},
+{
+  name: "android.database.sqlite.cts.SQLiteQueryBuilderTest#testSetProjectionMap",
+  bug: 12475524
+},
+{
+  name: "android.keystore.cts.KeyChainTest#testIsBoundKeyAlgorithm_RequiredAlgorithmsSupported",
+  bug: 15314696
+},
+{
+  name: "android.location.cts.LocationManagerTest",
+  name: "android.location.cts.LocationProviderTest",
+  bug: 15748237
+},
+{
+  name: "android.media.cts.AudioEffectTest",
+  bug: 15081808
+},
+{
+  name: "android.media.cts.AudioManagerTest#testMusicActive",
+  name: "android.media.cts.AudioManagerTest#testVolume",
+  bug: 15319269
+},
+{
+  name: "android.media.cts.AudioTrackTest#testGetTimestamp",
+  bug: 15320704
+},
+{
+  name: "android.media.cts.BassBoostTest",
+  name: "android.media.cts.EnvReverbTest",
+  name: "android.media.cts.EqualizerTest",
+  bug: 15163233
+},
+{
+  name: "android.media.cts.DecoderTest",
+  bug: 15163143
+},
+{
+  name: "android.media.cts.MediaPlayerFlakyNetworkTest",
+  bug: 15350295
+},
+{
+  name: "android.media.cts.MediaPlayerTest",
+  bug: 15321806
+},
+{
+  name: "android.media.cts.PresetReverbTest",
+  bug: 15338282
+},
+{
+  name: "android.media.cts.RingtoneManagerTest",
+  bug: 15343572
+},
+{
+  name: "android.media.cts.SoundPoolAacTest",
+  name: "android.media.cts.SoundPoolOggTest",
+  bug: 15350147
+},
+{
+  name: "android.media.cts.StreamingMediaPlayerTest",
+  bug: 15321207
+},
+{
+  name: "android.media.cts.VirtualizerTest",
+  bug: 15381765
+},
+{
+  name: "android.mediastress.cts.H263QcifLongPlayerTest",
+  name: "android.mediastress.cts.H264R480x360AacShortPlayerTest",
+  name: "android.mediastress.cts.Vp8R480x360LongPlayerTest",
+  bug: 15081769
+},
+{
+  name: "android.net.cts.ConnectivityManagerTest#testGetActiveNetworkInfo",
+  bug: 15087784
+},
+{
+  name: "android.media.cts.MediaCodecListTest#testIsAVCBaselineProfileSupported",
+  name: "android.media.cts.MediaCodecListTest#testIsH263BaselineProfileSupported",
+  name: "android.media.cts.MediaCodecListTest#testIsM4VSimpleProfileSupported",
+  name: "android.media.cts.MediaCodecListTest#testRequiredMediaCodecList",
+  bug: 15433903
+},
+{
+  name: "com.android.cts.uiautomatortest.CtsUiAutomatorTest",
+  bug: 15093828
+},
+{
+  name: "android.media.cts.RingtoneTest#testRingtone",
+  bug: 15343572
+},
+{
+  name: "android.media.cts.VisualizerTest",
+  bug: 15381765
+},
+{
+  name: "android.mediastress.cts.H263QcifShortPlayerTest",
+  name: "android.mediastress.cts.Vp8R480x360ShortPlayerTest",
+  bug: 15081769
+},
+{
+  name: "android.speech.tts.cts.TextToSpeechTest",
+  bug: 15082733
+},
+{
+  name: "android.net.cts.DnsTest#testDnsWorks",
+  name: "android.net.cts.SSLCertificateSocketFactoryTest",
+  name: "android.net.wifi.cts.NsdManagerTest#testAndroidTestCaseSetupProperly",
+  bug: 15004618
+},
+{
+  name: "android.media.cts.AudioRecord_BufferSizeTest#testGetMinBufferSize",
+  bug: 15319578
+},
+{
+  name: "android.media.cts.AudioRecordTest#testAudioRecordOP",
+  bug: 15340791
+},
+{
+  name: "android.text.cts.BoringLayoutTest#testScale",
+  bug: 15134518
+},
+{
+  name: "android.media.cts.MediaRecorderTest#testOnErrorListener",
+  name: "android.media.cts.MediaRecorderTest#testOnInfoListener",
+  name: "android.media.cts.MediaRecorderTest#testRecorderAudio",
+  name: "android.media.cts.MediaRecorderTest#testRecordingAudioInRawFormats",
+  name: "android.media.cts.MediaRecorderTest#testSetMaxDuration",
+  bug: 15106730
+},
+{
+  name: "android.widget.cts.TextViewTest#testTextAttr",
+  bug: 15131296
+},
+{
+  name: "android.permission.cts.NoSystemFunctionPermissionTest#testSetWallpaper",
+  bug: 15383108
 }
 ]
diff --git a/tests/plans/CTS-flaky.xml b/tests/plans/CTS-flaky.xml
deleted file mode 100644
index 5317d96..0000000
--- a/tests/plans/CTS-flaky.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<TestPlan version="1.0">
-  <Entry uri="android.app" exclude="android.app.cts.SystemFeaturesTest#testTelephonyFeatures;android.app.cts.InstrumentationTest#testCallActivityOnResume;android.app.cts.ActivityManagerRecentTaskInfoTest#testWriteToParcel;android.app.cts.InstrumentationTest#testMisc;android.app.cts.DialogTest#testSetContentView;android.app.cts.ServiceTest#testLocalBindAutoClassPermissionGranted;android.app.cts.ActivityManager_RunningAppProcessInfoTest#testAndroidTestCaseSetupProperly;android.app.cts.AlertDialog_BuilderTest#testSetSingleChoiceItemsWithParamInt;android.app.cts.LocalActivityManagerTest#testConstructor;android.app.cts.ActivityManager_RunningServiceInfoTest#testDescribeContents;android.app.cts.DialogTest#testTakeKeyEvents;android.app.cts.LifecycleTest#testBasic;android.app.cts.NotificationTest#testConstructor;android.app.cts.ActivityManagerMemoryInfoTest#testWriteToParcel;android.app.cts.DialogTest#testConstructor_protectedCancellable;android.app.cts.ProgressDialogTest#testIncrementProgressBy;android.app.cts.ApplicationTest#testApplication;android.app.cts.InstrumentationTest#testSendKeySync;android.app.cts.LocalActivityManagerTest#testDispatchCreate;android.app.cts.AlertDialogTest#testAlertDialogDeprecatedAPI;android.app.cts.AlertDialog_BuilderTest#testSetSingleChoiceItemsWithParamCursor;android.app.cts.InstrumentationTest#testCallActivityOnRestart;android.app.backup.cts.BackupAgentTest#testBackupAgent;android.app.cts.AlertDialog_BuilderTest#testSetSingleChoiceItemsWithParamCharSequence;android.app.cts.ActivityManager_RunningServiceInfoTest#testAndroidTestCaseSetupProperly;android.app.cts.ServiceTest#testLocalBindAutoAction;android.app.cts.DialogTest#testSetFeatureDrawableUri;android.app.cts.KeyguardManagerKeyguardLockTest#testDisableKeyguard;android.app.cts.LaunchTest#testClearTopWhilResumed;android.app.cts.WallpaperManagerTest#testSuggestDesiredDimensions;android.app.cts.SystemFeaturesTest#testLiveWallpaperFeature;android.app.cts.InstrumentationTest#testCallActivityOnUserLeaving;android.app.cts.AlertDialog_BuilderTest#testSetCancelable;android.app.cts.AlertDialogTest#testAlertDialogTheme;android.app.cts.PendingIntentTest#testGetBroadcast;android.app.cts.ActivityManager_RunningServiceInfoTest#testWriteToParcel;android.app.cts.InstrumentationTest#testGetComponentName;android.app.backup.cts.FileBackupHelperTest#testAndroidTestCaseSetupProperly;android.app.cts.DownloadManagerTest#testAndroidTestCaseSetupProperly;android.app.cts.SystemFeaturesTest#testTouchScreenFeatures;android.app.cts.AlarmManagerTest#testAlarmTriggersImmediatelyIfSetTimeIsNegative;android.app.cts.ActivityManagerMemoryInfoTest#testReadFromParcel;android.app.cts.NotificationTest#testAndroidTestCaseSetupProperly;android.app.cts.AlertDialog_BuilderTest#testSetOnCancelListener;android.app.cts.ServiceTest#testLocalBindClass;android.app.cts.ServiceTest#testLocalStartClass;android.app.cts.LauncherActivity_ListItemTest#testConstructor;android.app.cts.InstrumentationTest#testCallActivityOnCreate;android.app.cts.PendingIntentTest#testSendWithParamContextIntIntent;android.app.cts.InstrumentationTest#testSendPointerSync;android.app.cts.DialogTest#testRequestWindowFeature;android.app.cts.LocalActivityManagerTest#testDispatchPauseFalse;android.app.cts.Instrumentation_ActivityResultTest#testActivityResultOp;android.app.cts.ProgressDialogTest#testOnStartCreateStop;android.app.cts.AlertDialog_BuilderTest#testSetNegativeButtonWithParamInt;android.app.cts.KeyguardManagerKeyguardLockTest#testReenableKeyguard;android.app.cts.DialogTest#testShow;android.app.cts.ActivityManagerMemoryInfoTest#testDescribeContents;android.app.cts.SystemFeaturesTest#testFeatureNamespaces;android.app.cts.PendingIntent_CanceledExceptionTest#testConstructor;android.app.cts.AlertDialog_BuilderTest#testSetPositiveButtonWithParamInt;android.app.cts.PendingIntentTest#testSendWithParamInt;android.app.cts.PendingIntentTest#testGetActivity;android.app.cts.AlertDialog_BuilderTest#testSetCursor;android.app.cts.ActivityManagerProcessErrorStateInfoTest#testWriteToParcel;android.app.cts.AlertDialog_BuilderTest#testConstructor;android.app.cts.LocalActivityManagerTest#testDispatchDestroy;android.app.cts.DownloadManagerTest#testDownloadManager;android.app.cts.ServiceTest#testLocalBindAction;android.app.cts.LocalActivityManagerTest#testSaveInstanceState;android.app.cts.LifecycleTest#testTabDialog;android.app.cts.LaunchTest#testLocalActivity;android.app.cts.AlertDialog_BuilderTest#testSetInverseBackgroundForced;android.app.cts.SystemFeaturesTest#testLocationFeatures;android.app.cts.DialogTest#testOnStartCreateStop;android.app.cts.ActivityManagerRecentTaskInfoTest#testReadFromParcel;android.app.cts.ServiceTest#testLocalStartClassPermissions;android.app.cts.ServiceTest#testLocalUnbindTwice;android.app.cts.ActivityManagerProcessErrorStateInfoTest#testConstructor;android.app.cts.DialogTest#testSetFeatureDrawableResource;android.app.cts.ProgressDialogTest#testAccessProgress;android.app.cts.DialogTest#testTrackballEvent;android.app.cts.AlertDialog_BuilderTest#testSetSingleChoiceItems;android.app.cts.LaunchTest#testColdActivity;android.app.cts.ActivityManagerTest#testGetMemoryInfo;android.app.cts.PendingIntentTest#testAndroidTestCaseSetupProperly;android.app.cts.DialogTest#testOnContentChanged;android.app.cts.SearchManagerTest#testSetOnDismissListener;android.app.cts.InstrumentationTest#testContext;android.app.cts.LauncherActivity_IconResizerTest#testIconResizer;android.app.cts.DialogTest#testCancel_listener;android.app.cts.ActivityManagerTest#testIsUserAMonkey;android.app.cts.NotificationManagerTest#testCancelAll;android.app.cts.ActivityGroupTest#testAndroidTestCaseSetupProperly;android.app.cts.AlertDialog_BuilderTest#testCreate;android.app.cts.SystemFeaturesTest#testUsbAccessory;android.app.cts.ActivityManagerRecentTaskInfoTest#testDescribeContents;android.app.cts.ActivityManagerRunningTaskInfoTest#testDescribeContents;android.app.cts.AlertDialog_BuilderTest#testDisableCancelable;android.app.cts.InstrumentationTest#testSendKeyDownUpSync;android.app.cts.ActivityManagerRunningTaskInfoTest#testConstructor;android.app.cts.TimePickerDialogTest#testUpdateTime;android.app.cts.ActivityManagerRunningTaskInfoTest#testReadFromParcel;android.app.cts.ProgressDialogTest#testSetProgressStyle;android.app.cts.InstrumentationTest#testMonitor;android.app.cts.AliasActivityTest#testAliasActivity;android.app.cts.InstrumentationTest#testSendTrackballEventSync;android.app.cts.LifecycleTest#testScreen;android.app.cts.AlarmManagerTest#testCancel;android.app.cts.ActivityGroupTest#testTabDialog;android.app.cts.PendingIntentTest#testDescribeContents;android.app.cts.DialogTest#testOnSearchRequested;android.app.cts.SearchManagerTest#testSetOnCancelListener;android.app.cts.ProgressDialogTest#testAccessMax;android.app.cts.PendingIntentTest#testGetTargetPackage;android.app.cts.SystemFeaturesTest#testWifiFeature;android.app.cts.ActivityManagerRecentTaskInfoTest#testAndroidTestCaseSetupProperly;android.app.cts.DialogTest#testSetFeatureDrawableAlpha;android.app.cts.DialogTest#testSetTitle;android.app.cts.FragmentTest#testInstantiateNonFragment;android.app.cts.DialogTest#testSetDismissMessage;android.app.cts.PendingIntentTest#testWriteToParcel;android.app.cts.ActivityManagerMemoryInfoTest#testAndroidTestCaseSetupProperly;android.app.cts.AlertDialog_BuilderTest#testSetNeutralButtonWithParamCharSequence;android.app.cts.NotificationTest#testToString;android.app.cts.LaunchTest#testColdScreen;android.app.cts.AlertDialogTest#testAlertDialog;android.app.cts.SystemFeaturesTest#testSensorFeatures;android.app.cts.ProgressDialogTest#testShow1;android.app.cts.AlertDialog_BuilderTest#testSetNeutralButtonWithParamInt;android.app.cts.ActivityManagerRunningTaskInfoTest#testWriteToParcel;android.app.cts.ProgressDialogTest#testShow2;android.app.cts.ProgressDialogTest#testShow3;android.app.cts.ProgressDialogTest#testShow4;android.app.cts.InstrumentationTest#testCallActivityOnStart;android.app.cts.PendingIntentTest#testCancel;android.app.cts.InstrumentationTest#testConstructor;android.app.cts.ProgressDialogTest#testSetIndeterminate;android.app.cts.AlertDialog_BuilderTest#testShow;android.app.cts.AlertDialog_BuilderTest#testSetIconWithParamDrawable;android.app.cts.AlarmManagerTest#testSetTypes;android.app.cts.AlarmManagerTest#testSetInexactRepeating;android.app.cts.PendingIntentTest#testSendWithParamIntOnFinishedHandler;android.app.backup.cts.FileBackupHelperTest#testConstructor;android.app.cts.Instrumentation_ActivityResultTest#testAndroidTestCaseSetupProperly;android.app.cts.DownloadManagerTest#testDownloadManagerDestinationExtension;android.app.cts.LaunchTest#testClearTopInCreate;android.app.cts.InstrumentationTest#testRunOnMainSync;android.app.cts.DialogTest#testOnKeyDownKeyUp;android.app.cts.ServiceTest#testLocalStartActionPermissions;android.app.cts.KeyguardManagerTest#testInKeyguardRestrictedInputMode;android.app.cts.DialogTest#testConstructor;android.app.cts.AlertDialogTest#testCallback;android.app.cts.ActivityManagerTest#testGetRunningTasks;android.app.cts.ProgressDialogTest#testIncrementSecondaryProgressBy;android.app.cts.DialogTest#testAccessOwnerActivity;android.app.cts.LifecycleTest#testTabScreen;android.app.cts.TimePickerDialogTest#testOnRestoreInstanceState;android.app.cts.ActivityGroupTest#testTabBasic;android.app.cts.ServiceTest#testAndroidTestCaseSetupProperly;android.app.cts.PendingIntentTest#testSendWithParamContextIntIntentOnFinishedHandler;android.app.backup.cts.BackupManagerTest#testBackupManager;android.app.cts.ActivityManagerRecentTaskInfoTest#testConstructor;android.app.cts.DialogTest#testOnWindowFocusChanged;android.app.cts.DialogTest#testGetCurrentFocus;android.app.cts.TabActivityTest#testChildTitleCallback;android.app.cts.DialogTest#testSetOnDismissListener_listener;android.app.cts.ServiceTest#testLocalStartAction;android.app.cts.AlertDialog_BuilderTest#testSetMultiChoiceItemsWithParamInt;android.app.cts.DialogTest#testGetLayoutInflater;android.app.cts.InstrumentationTest#testInvokeContextMenuAction;android.app.cts.InstrumentationTest#testProfiling;android.app.cts.IntentServiceTest#testIntentServiceLifeCycle;android.app.cts.ProgressDialogTest#testAccessSecondaryProgress;android.app.cts.NotificationManagerTest#testAndroidTestCaseSetupProperly;android.app.backup.cts.BackupAgentTest#testAndroidTestCaseSetupProperly;android.app.cts.ActivityManagerTest#testGetProcessInErrorState;android.app.cts.SearchManagerTest#testStopSearch;android.app.cts.NotificationTest#testSetLatestEventInfo;android.app.cts.DialogTest#testSetCancellable_false;android.app.cts.PendingIntentTest#testSend;android.app.cts.LocalActivityManagerTest#testDispatchResume;android.app.cts.AlertDialog_BuilderTest#testSetViewCustom;android.app.cts.InstrumentationTest#testInvokeMenuActionSync;android.app.cts.DialogTest#testOnSaveInstanceState;android.app.cts.DialogTest#testOnKeyMultiple;android.app.cts.ActivityGroupTest#testTabScreen;android.app.cts.InstrumentationTest#testCallActivityOnSaveInstanceState;android.app.cts.ActivityManagerTest#testGetDeviceConfigurationInfo;android.app.cts.NotificationTest#testWriteToParcel;android.app.cts.InstrumentationTest#testWaitForIdle;android.app.cts.InstrumentationTest#testCallActivityOnStop;android.app.cts.InstrumentationTest#testSendCharacterSync;android.app.cts.TimePickerDialogTest#testOnTimeChanged;android.app.cts.PendingIntentTest#testEquals;android.app.cts.AlertDialog_BuilderTest#testSetIconWithParamInt;android.app.cts.DialogTest#testContextMenu;android.app.cts.SystemFeaturesTest#testBluetoothFeature;android.app.cts.ExpandableListActivityTest#testView;android.app.cts.AlarmManagerTest#testSetRepeating;android.app.cts.ActivityManager_RunningServiceInfoTest#testReadFromParcel;android.app.cts.ServiceTest#testLocalBindActionPermissions;android.app.cts.LocalActivityManagerTest#testDispatchStop;android.app.cts.LauncherActivity_ListItemTest#testAndroidTestCaseSetupProperly;android.app.cts.InstrumentationTest#testNewApplication;android.app.cts.LaunchTest#testForwardResult;android.app.cts.ProgressDialogTest#testSetMessage;android.app.cts.ActivityManagerTest#testGetRunningServices;android.app.cts.AlertDialogTest#testCustomAlertDialogView;android.app.backup.cts.SharedPreferencesBackupHelperTest#testConstructor;android.app.cts.LifecycleTest#testTabBasic;android.app.cts.FragmentTest#testInstantiateFragment;android.app.cts.ActivityManager_RunningAppProcessInfoTest#testRunningAppProcessInfo;android.app.cts.AlertDialogTest#testAlertDialogNotCancelable;android.app.cts.AlertDialog_BuilderTest#testSetItemsWithParamCharSequence;android.app.cts.ActivityManagerProcessErrorStateInfoTest#testDescribeContents;android.app.cts.DialogTest#testConstructor_protectedNotCancellable;android.app.cts.ExpandableListActivityTest#testSelect;android.app.cts.SystemFeaturesTest#testScreenFeatures;android.app.cts.LauncherActivityTest#testLaunchActivity;android.app.cts.LaunchTest#testAndroidTestCaseSetupProperly;android.app.cts.LifecycleTest#testAndroidTestCaseSetupProperly;android.app.cts.NotificationTest#testDescribeContents;android.app.cts.DialogTest#testOnWindowAttributesChanged;android.app.cts.ServiceTest#testLocalBindAutoActionPermissionGranted;android.app.cts.InstrumentationTest#testCallActivityOnPostCreate;android.app.cts.AlertDialogTest#testAlertDialogDeprecatedAPIWithMessage;android.app.cts.AlertDialog_BuilderTest#testSetPositiveButtonWithParamCharSequence;android.app.cts.AlarmManagerTest#testAndroidTestCaseSetupProperly;android.app.cts.AlertDialog_BuilderTest#testSetView;android.app.cts.ActivityManager_RunningServiceInfoTest#testConstructor;android.app.cts.InstrumentationTest#testPerformanceSnapshot;android.app.cts.InstrumentationTest#testCallApplicationOnCreate;android.app.cts.DialogTest#testSetFeatureDrawable;android.app.cts.AliasActivityTest#testAndroidTestCaseSetupProperly;android.app.cts.PendingIntentTest#testGetService;android.app.cts.IntentServiceTest#testIntents;android.app.cts.AlertDialog_BuilderTest#testSetOnItemSelectedListener;android.app.cts.LifecycleTest#testDialog;android.app.cts.DownloadManagerTest#testDownloadManagerDestination;android.app.cts.WallpaperManagerTest#testAndroidTestCaseSetupProperly;android.app.cts.ExpandableListActivityTest#testAndroidTestCaseSetupProperly;android.app.cts.InstrumentationTest#testNewActivity;android.app.cts.ProgressDialogTest#testSetProgressDrawable;android.app.backup.cts.BackupManagerTest#testAndroidTestCaseSetupProperly;android.app.cts.InstrumentationTest#testAllocCounting;android.app.cts.LocalActivityManagerTest#testRemoveAllActivities;android.app.cts.ServiceTest#testLocalBindAutoClass;android.app.backup.cts.BackupAgentHelperTest#testBackupAgentHelper;android.app.cts.ActivityManagerProcessErrorStateInfoTest#testReadFromParcel;android.app.cts.PendingIntent_CanceledExceptionTest#testAndroidTestCaseSetupProperly;android.app.cts.TimePickerDialogTest#testOnClick;android.app.cts.AlertDialog_BuilderTest#testSetOnKeyListener;android.app.cts.DialogTest#testTouchEvent;android.app.cts.ProgressDialogTest#testProgressDialog1;android.app.cts.InstrumentationTest#testCallActivityOnRestoreInstanceState;android.app.cts.ProgressDialogTest#testProgressDialog2;android.app.cts.InstrumentationTest#testCallActivityOnPause;android.app.cts.AlertDialog_BuilderTest#testSetMultiChoiceItemsWithParamCharSequence;android.app.cts.SystemFeaturesTest#testCameraFeatures;android.app.cts.ServiceTest#testLocalBindClassPermissions;android.app.cts.ActivityManagerTest#testGetRecentTasks;android.app.cts.SystemFeaturesTest#testNfcFeatures;android.app.cts.AlertDialogTest#testCustomAlertDialog;android.app.cts.SystemFeaturesTest#testSipFeatures;android.app.cts.InstrumentationTest#testSendStringSync;android.app.cts.ActivityManagerRunningTaskInfoTest#testAndroidTestCaseSetupProperly;android.app.cts.TabActivityTest#testTabActivity;android.app.cts.KeyguardManagerTest#testNewKeyguardLock;android.app.cts.NotificationManagerTest#testCancel;android.app.cts.AlertDialog_BuilderTest#testSetMultiChoiceItemsWithParamCursor;android.app.cts.ActivityManagerMemoryClassTest#testGetMemoryClass;android.app.cts.ActivityManagerTest#testGetRunningAppProcesses;android.app.cts.AlertDialog_BuilderTest#testSetAdapter;android.app.cts.AlertDialog_BuilderTest#testSetItemsWithParamInt;android.app.cts.DialogTest#testCancel_noListener;android.app.cts.DialogTest#testDispatchKeyEvent;android.app.cts.LaunchTest#testLocalScreen;android.app.cts.ActivityManagerTest#testRestartPackage;android.app.cts.FragmentTest#testAndroidTestCaseSetupProperly;android.app.cts.InstrumentationTest#testCallActivityOnNewIntent;android.app.cts.NotificationManagerTest#testNotify;android.app.cts.LocalActivityManagerTest#testDispatchPauseTrue;android.app.cts.ActivityManagerProcessErrorStateInfoTest#testAndroidTestCaseSetupProperly;android.app.backup.cts.BackupAgentHelperTest#testAndroidTestCaseSetupProperly;android.app.cts.ProgressDialogTest#testSetIndeterminateDrawable;android.app.backup.cts.SharedPreferencesBackupHelperTest#testAndroidTestCaseSetupProperly;android.app.cts.DownloadManagerTest#testMinimumDownload;android.app.cts.PendingIntentTest#testReadAndWritePendingIntentOrNullToParcel;android.app.cts.DialogTest#testSetOnDismissListener_noListener;android.app.cts.KeyguardManagerTest#testExitKeyguardSecurely;android.app.cts.AlertDialog_BuilderTest#testSetNegativeButtonWithParamCharSequence;android.app.cts.DialogTest#testSetCancelable_true;android.app.cts.Instrumentation_ActivityMonitorTest#testActivityMonitor;android.app.cts.LocalActivityManagerTest#testStartActivity;android.app.cts.IntentServiceTest#testAndroidTestCaseSetupProperly;android.app.cts.ActionBarTest#testAddTab;android.app.cts.DialogTest#testSetCancelMessage;android.app.cts.TimePickerDialogTest#testSaveInstanceState" />
-  <Entry uri="android.hardware" exclude="android.hardware.consumerir.cts.ConsumerIrTest#test_hasIrEmitter;android.hardware.consumerir.cts.ConsumerIrTest#test_getCarrierFrequencies;android.hardware.consumerir.cts.ConsumerIrTest#test_transmit;android.hardware.camera2.cts.CameraDeviceTest#testCameraDeviceCaptureBurst;android.hardware.camera2.cts.CameraDeviceTest#testCameraDeviceRepeatingBurst;android.hardware.cts.CameraGLTest#testSetPreviewTextureTextureCallback;android.hardware.cts.CameraTest#test3ALockInteraction;android.hardware.cts.CameraTest#testAutoExposureLock;android.hardware.cts.CameraTest#testAutoWhiteBalanceLock;android.hardware.cts.CameraTest#testCancelAutofocus;android.hardware.cts.CameraTest#testDisplayOrientation;android.hardware.cts.CameraTest#testEnableShutterSound;android.hardware.cts.CameraTest#testFaceDetection;android.hardware.cts.CameraTest#testFocusAreas;android.hardware.cts.CameraTest#testFocusDistances;android.hardware.cts.CameraTest#testGetParameterDuringFocus;android.hardware.cts.CameraTest#testInvalidParameters;android.hardware.cts.CameraTest#testJpegCallbackStartPreview;android.hardware.cts.CameraTest#testJpegExif;android.hardware.cts.CameraTest#testJpegThumbnailSize;android.hardware.cts.CameraTest#testLockUnlock;android.hardware.cts.CameraTest#testMeteringAreas;android.hardware.cts.CameraTest#testMultiCameraRelease;android.hardware.cts.CameraTest#testMultipleCameras;android.hardware.cts.CameraTest#testParameters;android.hardware.cts.CameraTest#testPreviewCallbackWithBuffer;android.hardware.cts.CameraTest#testPreviewCallbackWithPicture;android.hardware.cts.CameraTest#testPreviewFormats;android.hardware.cts.CameraTest#testPreviewFpsRange;android.hardware.cts.CameraTest#testPreviewPictureSizesCombination;android.hardware.cts.CameraTest#testRecordingHint;android.hardware.cts.CameraTest#testSceneMode;android.hardware.cts.CameraTest#testSetOneShotPreviewCallback;android.hardware.cts.CameraTest#testSetPreviewDisplay;android.hardware.cts.CameraTest#testTakePicture;android.hardware.camera2.cts.ImageReaderTest#testImageReaderInvalidAccessTest;android.hardware.cts.SensorAccelerometerTest#testEventJittering;android.hardware.cts.SensorGyroscopeTest#testEventsArriveInOrder;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidScalerAvailableJpegSizes;android.hardware.cts.SensorAccelerometerTest#testCanReceiveBatchEvents;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidSensorOrientation;android.hardware.camera2.cts.CameraCharacteristicsTest#testAndroidTestCaseSetupProperly;android.hardware.cts.SensorMagneticFieldTest#testUpdateRate;android.hardware.cts.SensorAccelerometerTest#testNotTriggerSensor;android.hardware.cts.SensorAccelerometerTest#testAndroidTestCaseSetupProperly;android.hardware.cts.SensorAccelerometerTest#testCanReceiveEvents;android.hardware.cts.SensorMagneticFieldTest#testVarianceWhileStatic;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidLensInfoHyperfocalDistance;android.hardware.camera2.cts.CameraManagerTest#testCameraManagerOpenCamerasSerially;android.hardware.camera2.cts.CameraDeviceTest#testCameraDeviceCreateCaptureBuilder;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidScalerAvailableProcessedMinDurations;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidFlashInfoAvailable;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidLensInfoShadingMapSize;android.hardware.cts.LowRamDeviceTest#testAndroidTestCaseSetupProperly;android.hardware.cts.SensorTest#testSensorOperations;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidControlAwbAvailableModes;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidSensorBaseGainFactor;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidSensorInfoPhysicalSize;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidInfoSupportedHardwareLevel;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidJpegAvailableThumbnailSizes;android.hardware.cts.SensorGyroscopeTest#testNotTriggerSensor;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidLensFacing;android.hardware.cts.Camera_ParametersTest#testAccessMethods;android.hardware.cts.SensorMagneticFieldTest#testCanRegisterListener;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidScalerAvailableFormats;android.hardware.cts.SensorTest#testBatchAndFlush;android.hardware.cts.SensorGyroscopeTest#testAndroidTestCaseSetupProperly;android.hardware.cts.SensorMagneticFieldTest#testCanReceiveEvents;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidControlAvailableEffects;android.hardware.camera2.cts.CameraManagerTest#testAndroidTestCaseSetupProperly;android.hardware.cts.SensorGyroscopeTest#testSeveralClientsBatching;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidControlAeAvailableAntibandingModes;android.hardware.cts.GeomagneticFieldTest#testAndroidTestCaseSetupProperly;android.hardware.cts.SensorAccelerometerTest#testStartStopRepeatedly;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidControlAfAvailableModes;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidSensorMaxAnalogSensitivity;android.hardware.cts.SensorTest#testRequestTriggerWithNonTriggerSensor;android.hardware.cts.SensorMagneticFieldTest#testBatchEventsArriveInOrder;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidLensInfoMinimumFocusDistance;android.hardware.cts.SensorTest#testValuesForAllSensors;android.hardware.cts.SensorMagneticFieldTest#testCanReceiveBatchEvents;android.hardware.cts.SensorAccelerometerTest#testUpdateRate;android.hardware.cts.SensorMagneticFieldTest#testStartStopRepeatedly;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidControlMaxRegions;android.hardware.cts.SensorMagneticFieldTest#testAndroidTestCaseSetupProperly;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidControlAeCompensationRange;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidRequestMaxNumOutputStreams;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidSensorInfoSensitivityRange;android.hardware.cts.SensorMagneticFieldTest#testNotTriggerSensor;android.hardware.cts.SensorGyroscopeTest#testBatchEventsArriveInOrder;android.hardware.camera2.cts.CameraManagerTest#testCameraManagerInvalidDevice;android.hardware.cts.LowRamDeviceTest#testLowRamProductProperty;android.hardware.cts.SensorTest#testCancelTriggerWithNonTriggerSensor;android.hardware.cts.SensorMagneticFieldTest#testEventsArriveInOrder;android.hardware.cts.SensorMagneticFieldTest#testMaxFrequency;android.hardware.cts.SensorAccelerometerTest#testSeveralClientsBatching;android.hardware.cts.SensorMagneticFieldTest#testEventJittering;android.hardware.cts.SensorGyroscopeTest#testEventValidity;android.hardware.camera2.cts.ImageReaderTest#testImageReaderFromCameraRaw;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidControlAeCompensationStep;android.hardware.cts.SensorMagneticFieldTest#testSeveralClientsBatching;android.hardware.camera2.cts.CameraManagerTest#testCameraManagerGetCameraCharacteristics;android.hardware.cts.SensorAccelerometerTest#testCanRegisterListener;android.hardware.camera2.cts.ImageReaderTest#testImageReaderFromCameraFlexibleYuv;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidControlAvailableVideoStabilizationModes;android.hardware.cts.SensorGyroscopeTest#testStartStopRepeatedly;android.hardware.cts.SensorAccelerometerTest#testEventsArriveInOrder;android.hardware.cts.SensorMagneticFieldTest#testRegisterForBatchingZeroReport;android.hardware.cts.SensorGyroscopeTest#testCanRegisterListener;android.hardware.cts.SensorGyroscopeTest#testMaxFrequency;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidScalerAvailableProcessedSizes;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidControlAeAvailableTargetFpsRanges;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidTonemapMaxCurvePoints;android.hardware.cts.SensorGyroscopeTest#testCanReceiveEvents;android.hardware.cts.SensorTest#testRegisterTwiceWithSameSensor;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidLensInfoAvailableOpticalStabilization;android.hardware.camera2.cts.ImageReaderTest#testAndroidTestCaseSetupProperly;android.hardware.cts.SensorMagneticFieldTest#testSeveralClients;android.hardware.camera2.cts.CameraManagerTest#testCameraManagerOpenCameraTwice;android.hardware.cts.SensorMagneticFieldTest#testStartStopBatchingRepeatedly;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidScalerAvailableMaxDigitalZoom;android.hardware.cts.SensorAccelerometerTest#testBatchEventsArriveInOrder;android.hardware.camera2.cts.CameraDeviceTest#testAndroidTestCaseSetupProperly;android.hardware.cts.SensorAccelerometerTest#testRegisterForBatchingZeroReport;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidStatisticsInfoMaxFaceCount;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidControlAvailableSceneModes;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidSensorInfoActiveArraySize;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidSensorInfoMaxFrameDuration;android.hardware.cts.SensorAccelerometerTest#testStartStopBatchingRepeatedly;android.hardware.cts.SensorGyroscopeTest#testEventJittering;android.hardware.camera2.cts.CameraDeviceTest#testCameraDeviceCapture;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidSensorInfoExposureTimeRange;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidLensInfoAvailableFocalLengths;android.hardware.cts.SensorGyroscopeTest#testCanReceiveBatchEvents;android.hardware.cts.SensorTest#testLegacySensorOperations;android.hardware.camera2.cts.CameraManagerTest#testCameraManagerListener;android.hardware.cts.GeomagneticFieldTest#testGeomagneticField;android.hardware.cts.SensorGyroscopeTest#testSeveralClients;android.hardware.cts.SensorGyroscopeTest#testStartStopBatchingRepeatedly;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidLensInfoAvailableFilterDensities;android.hardware.camera2.cts.CameraDeviceTest#testCameraDeviceSetErrorListener;android.hardware.cts.SensorGyroscopeTest#testRegisterForBatchingZeroReport;android.hardware.camera2.cts.CameraManagerTest#testCameraManagerGetDeviceIdList;android.hardware.cts.SensorAccelerometerTest#testMaxFrequency;android.hardware.camera2.cts.CameraManagerTest#testCameraManagerOpenAllCameras;android.hardware.cts.SensorAccelerometerTest#testSeveralClients;android.hardware.cts.SensorGyroscopeTest#testVarianceWhileStatic;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidScalerAvailableJpegMinDurations;android.hardware.cts.SensorTest#testAndroidTestCaseSetupProperly;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidStatisticsInfoAvailableFaceDetectModes;android.hardware.camera2.cts.CameraCharacteristicsTest#testCameraCharacteristicsAndroidLensInfoAvailableApertures;android.hardware.cts.SensorAccelerometerTest#testEventValidity;android.hardware.cts.SensorAccelerometerTest#testUpdateBatchRate;android.hardware.cts.SensorAccelerometerTest#testVarianceWhileStatic;android.hardware.cts.SensorGyroscopeTest#testUpdateBatchRate;android.hardware.cts.SensorGyroscopeTest#testUpdateRate;android.hardware.cts.SensorMagneticFieldTest#testEventValidity;android.hardware.cts.SensorMagneticFieldTest#testUpdateBatchRate;android.hardware.cts.SensorTest#testRegisterWithTriggerSensor;android.hardware.cts.Camera_SizeTest#testConstructor" />
-  <Entry uri="android.media" exclude="android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_12fps_AAC_Stereo_24kbps_22050Hz;android.media.cts.AudioPreProcessingTest#test2_1AecCreateAndRelease;android.media.cts.MediaCodecTest#testConcurrentAudioVideoEncodings;android.media.cts.EnvReverbTest#test2_0SetEnabledGetEnabled;android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromBufferToBufferQVGA;android.media.cts.AudioTrackTest#testSetLoopPointsStartTooFar;android.media.cts.RingtoneManagerTest#testStopPreviousRingtone;android.media.cts.EnvReverbTest#test1_3Reflections;android.media.cts.MediaPlayerTest#testGapless3;android.media.cts.MediaPlayerTest#testGapless2;android.media.cts.MediaPlayerTest#testGapless1;android.media.cts.BassBoostTest#testAndroidTestCaseSetupProperly;android.media.cts.EnvReverbTest#test3_1EnableStatusListener;android.media.cts.ExtractDecodeEditEncodeMuxTest#testExtractDecodeEditEncodeMuxQVGA;android.media.cts.MediaRecorderTest#testRecorderCamera;android.media.cts.MediaPlayerTest#testGetTrackInfo;android.media.cts.MediaDrmMockTest#testIsCryptoSchemeNotSupported;android.media.cts.AudioPreProcessingTest#testAndroidTestCaseSetupProperly;android.media.cts.DecodeEditEncodeTest#testVideoEditQCIF;android.media.cts.MediaPlayerTest#testDeselectTrack;android.media.cts.AudioEffectTest#test3_7SetParameterAfterRelease;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_12fps_AAC_Mono_24kbps_22050Hz;android.media.cts.AudioEffectTest#test4_2ControlStatusListener;android.media.cts.StreamingMediaPlayerTest#testHTTP_MPEG4SP_AAC_Video1;android.media.cts.StreamingMediaPlayerTest#testHTTP_MPEG4SP_AAC_Video2;android.media.cts.JetPlayerTest#testLoadJetFromFd;android.media.cts.MediaDrmMockTest#testProvideProvisionResponse;android.media.cts.JetPlayerTest#testQueueJetSegmentMuteArray;android.media.cts.StreamingMediaPlayerTest#testPlayOggStream;android.media.cts.MediaPlayerTest#testLocalVideo_MP4_H264_480x360_1350kbps_25fps_AAC_Stereo_128kbps_44110Hz;android.media.cts.SoundPoolAacTest#testAndroidTestCaseSetupProperly;android.media.cts.PresetReverbTest#test3_2ParameterChangedListener;android.media.cts.MediaDrmMockTest#testNullPropertyString;android.media.cts.AudioEffectTest#test3_2SetParameterIntShort;android.media.cts.AudioRecord_BufferSizeTest#testGetMinBufferSize;android.media.cts.AudioEffectTest#test3_0SetParameterByteArrayByteArray;android.media.cts.MediaScannerConnectionTest#testAndroidTestCaseSetupProperly;android.media.cts.MediaPlayerTest#testLocalVideo_MP4_H264_480x360_1000kbps_30fps_AAC_Stereo_128kbps_44110Hz;android.media.cts.AudioTrackTest#testWriteShortSizeTooBig;android.media.cts.AudioTrackTest#testGetMinBufferSizeTooLowSR;android.media.cts.AudioEffectTest#test1_1ConstructorFromUuid;android.media.cts.ToneGeneratorTest#testSyncGenerate;android.media.cts.AudioEffectTest#test1_3GetEnabledAfterRelease;android.media.cts.BassBoostTest#test1_1Properties;android.media.cts.SoundPoolOggTest#testLoadMore;android.media.cts.AudioEffectTest#test1_7AuxiliaryOnAudioTrack;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_12fps_AAC_Stereo_128kbps_11025Hz;android.media.cts.MediaCodecListTest#testMediaCodecXmlFileExist;android.media.cts.MediaPlayerTest#testLocalVideo_MP4_H264_480x360_1000kbps_25fps_AAC_Stereo_128kbps_44110Hz;android.media.cts.VisualizerTest#test2_1ListenerCapture;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_25fps_AAC_Stereo_24kbps_11025Hz;android.media.cts.StreamingMediaPlayerTest#testPlayMp3Stream2;android.media.cts.StreamingMediaPlayerTest#testPlayMp3Stream1;android.media.cts.MediaPlayerTest#testPlayNullSource;android.media.cts.VirtualizerTest#testAndroidTestCaseSetupProperly;android.media.cts.EncodeVirtualDisplayWithCompositionTest#testSingleVirtualDisplay;android.media.cts.DecoderTest#testDecodeOgg;android.media.cts.MediaRecorderTest#testOnErrorListener;android.media.cts.EnvReverbTest#test2_1SetEnabledAfterRelease;android.media.cts.AudioTrackTest#testSetPlaybackRate;android.media.cts.AudioManagerTest#testVibrateNotification;android.media.cts.AudioManagerTest#testAccessMode;android.media.cts.EqualizerTest#test1_4SetBandLevelAfterRelease;android.media.cts.MediaPlayerTest#testPlayVideo;android.media.cts.MediaCodecTest#testSignalSurfaceEOS;android.media.cts.VisualizerTest#test0_0ConstructorAndRelease;android.media.cts.DecoderTest#testDecodeFlac;android.media.cts.MediaDrmMockTest#testEventWithSessionAndData;android.media.cts.MediaScannerConnectionTest#testMediaScannerConnection;android.media.cts.AudioTrackTest#testConstructorMono8MusicStatic;android.media.cts.AudioManagerTest#testMicrophoneMute;android.media.cts.MediaDrmMockTest#testMissingPropertyString;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_25fps_AAC_Stereo_128kbps_22050Hz;android.media.cts.AudioTrackTest#testConstructorStereo16MusicStream;android.media.cts.Vp8EncoderTest#testAndroidTestCaseSetupProperly;android.media.cts.MediaDrmMockTest#testQueryKeyStatus;android.media.cts.BassBoostTest#test3_2ParameterChangedListener;android.media.cts.AudioManagerTest#testVibrateRinger;android.media.cts.AudioManagerTest#testMusicActive;android.media.cts.DecoderTest#testCodecResetsVP8WithoutSurface;android.media.cts.MediaPlayerTest#testRecordedVideoPlayback90;android.media.cts.MediaPlayerFlakyNetworkTest#test_S3P00001;android.media.cts.AudioTrackTest#testGetMinBufferSizeTooHighSR;android.media.cts.CamcorderProfileTest#testAndroidTestCaseSetupProperly;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_25fps_AAC_Stereo_128kbps_11025Hz;android.media.cts.AudioManagerTest#testVolume;android.media.cts.MediaMuxerTest#testAudioOnly;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_12fps_AAC_Stereo_128kbps_22050Hz;android.media.cts.AudioEffectTest#test1_6AuxiliaryOnMediaPlayerFailure;android.media.cts.DecoderTest#testCodecResetsMpeg4WithSurface;android.media.cts.AudioEffectTest#test4_1setParameterLowerPriority;android.media.cts.MediaPlayerTest#testLocalVideo_MP4_H264_480x360_500kbps_30fps_AAC_Stereo_128kbps_44110Hz;android.media.cts.DecoderTest#testCodecResetsVP8WithSurface;android.media.cts.CamcorderProfileTest#testGet;android.media.cts.DecoderTest#testDecodeMonoM4a;android.media.cts.MediaRecorderTest#testSetCamera;android.media.cts.AudioTrackTest#testSetGetPlaybackRate;android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromSurfaceToSurfaceQVGA;android.media.cts.EnvReverbTest#testAndroidTestCaseSetupProperly;android.media.cts.DecoderTest#testFlush;android.media.cts.AudioEffectTest#testAndroidTestCaseSetupProperly;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_12fps_AAC_Mono_24kbps_11025Hz;android.media.cts.DecoderTest#testDecodeMp3Lame;android.media.cts.EncoderTest#testAMRNBEncoders;android.media.cts.MediaScannerTest#testAndroidTestCaseSetupProperly;android.media.cts.MediaCodecListTest#testRequiredMediaCodecList;android.media.cts.DecoderTest#testCodecResetsMpeg4WithoutSurface;android.media.cts.MediaRecorderTest#testGetAudioSourceMax;android.media.cts.MediaPlayerTest#testLocalVideo_MP4_H264_480x360_500kbps_25fps_AAC_Stereo_128kbps_44110Hz;android.media.cts.AudioTrackTest#testSetLoopPointsLoopTooLong;android.media.cts.EqualizerTest#test1_1BandFrequency;android.media.cts.EncoderTest#testAMRWBEncoders;android.media.cts.AudioTrackTest#testWriteShortNegativeSize;android.media.cts.AudioTrackTest#testConstructorStreamType;android.media.cts.MediaPlayerTest#testCallback;android.media.cts.BassBoostTest#test2_0SetEnabledGetEnabled;android.media.cts.MediaPlayerFlakyNetworkTest#test_S2P00001;android.media.cts.EncodeVirtualDisplayTest#testEncodeVirtualDisplay;android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromSurfaceToSurfaceQCIF;android.media.cts.DecoderTest#testCodecEarlyEOSVP9;android.media.cts.MediaPlayerTest#testLocalVideo_MP4_H264_480x360_1350kbps_30fps_AAC_Stereo_192kbps_44110Hz;android.media.cts.DecoderTest#testCodecEarlyEOSVP8;android.media.cts.MediaPlayerFlakyNetworkTest#test_S5P00001;android.media.cts.MediaRandomTest#testRecorderRandomAction;android.media.cts.MediaDrmMockTest#testBadSession;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_12fps_AAC_Stereo_128kbps_11025Hz;android.media.cts.CameraProfileTest#testGetWithId;android.media.cts.EnvReverbTest#test1_0Room;android.media.cts.StreamingMediaPlayerTest#testPlayMp3StreamNoLength;android.media.cts.SoundPoolAacTest#testMultiSound;android.media.cts.AudioTrackTest#testReloadStaticData;android.media.cts.MediaDrmMockTest#testAndroidTestCaseSetupProperly;android.media.cts.MediaPlayerTest#testPlayAudio;android.media.cts.MediaDrmMockTest#testGetKeyRequestNoOptionalParameters;android.media.cts.MediaRecorderTest#testSetMaxDuration;android.media.cts.AudioPreProcessingTest#test2_2AecSetEnabledGetEnabled;android.media.cts.AsyncPlayerTest#testAsyncPlayer;android.media.cts.DecoderTest#testCodecBasicVP8;android.media.cts.DecoderTest#testCodecBasicVP9;android.media.cts.AudioTrackTest#testSetLoopPointsStream;android.media.cts.AudioTrackTest#testConstructorStereo8MusicStatic;android.media.cts.MediaCodecTest#testDequeueSurface;android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromBufferToBuffer720p;android.media.cts.MediaRecorderTest#testRecorderTimelapsedVideo;android.media.cts.MediaCodecTest#testAndroidTestCaseSetupProperly;android.media.cts.AudioTrackTest#testSetPlaybackHeadPositionStopped;android.media.cts.AudioTrackTest#testWriteByteSizeTooBig;android.media.cts.MediaMuxerTest#testAndroidTestCaseSetupProperly;android.media.cts.EnvReverbTest#test1_1Decay;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_12fps_AAC_Stereo_128kbps_22050Hz;android.media.cts.DecoderTest#testDecodeWav;android.media.cts.DecoderTest#testCodecEarlyEOSH263;android.media.cts.SoundPoolOggTest#testSoundPoolOp;android.media.cts.DecoderTest#testCodecEarlyEOSH264;android.media.cts.MediaPlayerFlakyNetworkTest#test_S6P00002;android.media.cts.EnvReverbTest#test1_2Reverb;android.media.cts.AudioManagerTest#testSoundEffects;android.media.cts.ToneGeneratorTest#testAndroidTestCaseSetupProperly;android.media.cts.MediaCodecTest#testReconfigureWithoutSurface;android.media.cts.RingtoneManagerTest#testConstructors;android.media.cts.MediaCodecListTest#testGetCapabilities;android.media.cts.MediaDrmMockTest#testIsMimeTypeSupported;android.media.cts.DecoderTest#testDecodeMonoMp3;android.media.cts.DecoderTest#testCodecResetsH263WithoutSurface;android.media.cts.MediaScannerNotificationTest#testMediaScannerNotification;android.media.cts.VisualizerTest#testAndroidTestCaseSetupProperly;android.media.cts.VirtualizerTest#test0_0ConstructorAndRelease;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_25fps_AAC_Mono_24kbps_22050Hz;android.media.cts.AudioTrackTest#testWriteShort;android.media.cts.AudioRecordTest#testAndroidTestCaseSetupProperly;android.media.cts.ExtractDecodeEditEncodeMuxTest#testExtractDecodeEditEncodeMux720p;android.media.cts.EqualizerTest#test3_0ControlStatusListener;android.media.cts.MediaDrmMockTest#testRestoreKeys;android.media.cts.MediaMuxerTest#testVideoAudio;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_25fps_AAC_Mono_24kbps_11025Hz;android.media.cts.AudioTrackTest#testConstructorStereo8MusicStream;android.media.cts.MediaPlayerTest#testSetNextMediaPlayerWithRelease;android.media.cts.VisualizerTest#test1_0CaptureRates;android.media.cts.CameraProfileTest#testAndroidTestCaseSetupProperly;android.media.cts.EncodeVirtualDisplayWithCompositionTest#testAndroidTestCaseSetupProperly;android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromBufferToSurfaceQVGA;android.media.cts.VirtualizerTest#test1_1Properties;android.media.cts.AudioManagerTest#testRouting;android.media.cts.EqualizerTest#test3_1EnableStatusListener;android.media.cts.PresetReverbTest#test3_1EnableStatusListener;android.media.cts.EnvReverbTest#test0_0ConstructorAndRelease;android.media.cts.MediaPlayerTest#testChangeSubtitleTrack;android.media.cts.JetPlayerTest#testClone;android.media.cts.AudioEffectTest#test1_5AuxiliaryOnMediaPlayer;android.media.cts.MediaPlayerTest#testSetNextMediaPlayerWithReset;android.media.cts.AudioEffectTest#test2_0SetEnabledGetEnabled;android.media.cts.VisualizerTest#test1_1CaptureSize;android.media.cts.AudioTrackTest#testPlaybackHeadPositionAfterInit;android.media.cts.EqualizerTest#test1_3Properties;android.media.cts.AudioTrackTest#testWriteByte;android.media.cts.VirtualizerTest#test2_1SetEnabledAfterRelease;android.media.cts.AudioTrackTest#testSetStereoVolumeMin;android.media.cts.MediaRecorderTest#testRecorderVideo;android.media.cts.ExtractDecodeEditEncodeMuxTest#testExtractDecodeEditEncodeMuxAudioVideo;android.media.cts.EqualizerTest#test2_0SetEnabledGetEnabled;android.media.cts.MediaPlayerTest#testSetNextMediaPlayer;android.media.cts.AudioTrackTest#testSetStereoVolumeMid;android.media.cts.VirtualizerTest#test1_0Strength;android.media.cts.EncodeDecodeTest#testAndroidTestCaseSetupProperly;android.media.cts.AudioTrackTest#testAudioTrackProperties;android.media.cts.AudioTrackTest#testSetPlaybackHeadPositionPaused;android.media.cts.SoundPoolAacTest#testLoadMore;android.media.cts.ExtractDecodeEditEncodeMuxTest#testExtractDecodeEditEncodeMuxQCIF;android.media.cts.EncodeVirtualDisplayTest#testAndroidTestCaseSetupProperly;android.media.cts.RingtoneManagerTest#testSetType;android.media.cts.MediaDrmMockTest#testMultipleSessions;android.media.cts.MediaPlayerFlakyNetworkTest#test_S0P0;android.media.cts.SoundPoolOggTest#testLoad;android.media.cts.PresetReverbTest#test0_0ConstructorAndRelease;android.media.cts.RingtoneManagerTest#testAccessMethods;android.media.cts.EnvReverbTest#test1_4DiffusionAndDensity;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_12fps_AAC_Stereo_24kbps_22050Hz;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_25fps_AAC_Stereo_24kbps_22050Hz;android.media.cts.MediaDrmMockTest#testGetProvisionRequest;android.media.cts.CamcorderProfileTest#testGetWithId;android.media.cts.AudioEffectTest#test1_2ConstructorUnknownType;android.media.cts.SoundPoolOggTest#testAndroidTestCaseSetupProperly;android.media.cts.AudioTrackTest#testWriteByte8bit;android.media.cts.PresetReverbTest#testAndroidTestCaseSetupProperly;android.media.cts.EncoderTest#testAACEncoders;android.media.cts.ExtractDecodeEditEncodeMuxTest#testExtractDecodeEditEncodeMuxAudio;android.media.cts.DecoderTest#testCodecBasicH263;android.media.cts.DecoderTest#testCodecBasicH264;android.media.cts.AudioTrackTest#testSetLoopPointsSuccess;android.media.cts.MediaDrmMockTest#testRemoveKeys;android.media.cts.FaceDetectorTest#testFindFaces;android.media.cts.MediaDrmMockTest#testGetKeyRequest;android.media.cts.MediaCodecListTest#testIsAVCBaselineProfileSupported;android.media.cts.AudioEffectTest#test3_4SetParameterIntArrayIntArray;android.media.cts.MediaCodecListTest#testIsH263BaselineProfileSupported;android.media.cts.EqualizerTest#test0_0ConstructorAndRelease;android.media.cts.EqualizerTest#test3_2ParameterChangedListener;android.media.cts.AudioTrackTest#testSetPlaybackRateZero;android.media.cts.MediaDrmMockTest#testGetSecureStops;android.media.cts.EnvReverbTest#test3_2ParameterChangedListener;android.media.cts.StreamingMediaPlayerTest#testHTTP_H263_AMR_Video2;android.media.cts.MediaDrmMockTest#testGetKeyRequestRelease;android.media.cts.StreamingMediaPlayerTest#testHTTP_H263_AMR_Video1;android.media.cts.EqualizerTest#testAndroidTestCaseSetupProperly;android.media.cts.ExtractDecodeEditEncodeMuxTest#testAndroidTestCaseSetupProperly;android.media.cts.MediaDrmMockTest#testNullSession;android.media.cts.PresetReverbTest#test1_1Properties;android.media.cts.BassBoostTest#test3_1EnableStatusListener;android.media.cts.AudioTrack_ListenerTest#testAudioTrackCallbackWithHandler;android.media.cts.VirtualizerTest#test3_2ParameterChangedListener;android.media.cts.MediaPlayerTest#testLocalVideo_MP4_H264_480x360_1350kbps_30fps_AAC_Stereo_128kbps_44110Hz;android.media.cts.BassBoostTest#test1_0Strength;android.media.cts.AudioTrackTest#testPlaybackHeadPositionAfterFlushAndPlay;android.media.cts.PresetReverbTest#test2_1SetEnabledAfterRelease;android.media.cts.AudioTrackTest#testWriteShortNegativeOffset;android.media.cts.DecoderTest#testCodecResetsMp3;android.media.cts.AudioTrackTest#testPlaybackHeadPositionAfterFlush;android.media.cts.MediaScannerTest#testCanonicalize;android.media.cts.MediaDrmMockTest#testMediaDrmConstructorFails;android.media.cts.PresetReverbTest#test2_0SetEnabledGetEnabled;android.media.cts.MediaDrmMockTest#testCryptoSession;android.media.cts.DecoderTest#testCodecResetsH263WithSurface;android.media.cts.AudioPreProcessingTest#test1_1NsCreateAndRelease;android.media.cts.DecodeEditEncodeTest#testAndroidTestCaseSetupProperly;android.media.cts.AudioEffectTest#test3_6SetParameterIntArrayByteArray;android.media.cts.AudioTrackTest#testPlaybackHeadPositionAfterStop;android.media.cts.AsyncPlayerTest#testAndroidTestCaseSetupProperly;android.media.cts.AudioPreProcessingTest#test3_2AgcSetEnabledGetEnabled;android.media.cts.MediaDrmMockTest#testGetKeyRequestOffline;android.media.cts.MediaDrmMockTest#testReleaseSecureStops;android.media.cts.MediaPlayerFlakyNetworkTest#test_S4P00001;android.media.cts.MediaDrmMockTest#testNullPropertyByteArray;android.media.cts.EqualizerTest#test1_2Presets;android.media.cts.EnvReverbTest#test1_5Properties;android.media.cts.CameraProfileTest#testGetImageEncodingQualityParameter;android.media.cts.VirtualizerTest#test3_0ControlStatusListener;android.media.cts.AudioTrackTest#testWriteByteNegativeOffset;android.media.cts.StreamingMediaPlayerTest#testPlayMp3StreamRedirect;android.media.cts.DecoderTest#testCodecEarlyEOSMpeg4;android.media.cts.EnvReverbTest#test3_0ControlStatusListener;android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromBufferToSurfaceQCIF;android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromBufferToSurface720p;android.media.cts.MediaDrmMockTest#testCryptoSessionEncrypt;android.media.cts.EqualizerTest#test1_0BandLevel;android.media.cts.EncodeVirtualDisplayWithCompositionTest#testMultipleVirtualDisplays;android.media.cts.AudioTrack_ListenerTest#testAudioTrackCallback;android.media.cts.DecoderTest#testCodecResetsVP9WithoutSurface;android.media.cts.DecodeEditEncodeTest#testVideoEdit720p;android.media.cts.AudioEffectTest#test1_0ConstructorFromType;android.media.cts.AudioTrackTest#testPlayStreamData;android.media.cts.MediaDrmMockTest#testCryptoSessionSign;android.media.cts.MediaDrmMockTest#testMediaDrmConstructor;android.media.cts.AudioTrackTest#testSetStereoVolumeMax;android.media.cts.MediaMuxerTest#testIllegalStateExceptions;android.media.cts.MediaCodecTest#testCreateInputSurfaceErrors;android.media.cts.AudioTrackTest#testConstructorMono16MusicStatic;android.media.cts.MediaDrmMockTest#testOpenCloseSession;android.media.cts.AudioManagerTest#testAndroidTestCaseSetupProperly;android.media.cts.DecoderTest#testEOSBehaviorMpeg4;android.media.cts.SoundPoolOggTest#testMultiSound;android.media.cts.AudioTrackTest#testConstructorMono8MusicStream;android.media.cts.MediaCodecListTest#testIsM4VSimpleProfileSupported;android.media.cts.VirtualizerTest#test1_2SetStrengthAfterRelease;android.media.cts.MediaDrmMockTest#testCryptoSessionVerify;android.media.cts.MediaMuxerTest#testVideoOnly;android.media.cts.AudioTrackTest#testWriteShortOffsetTooBig;android.media.cts.AudioManagerTest#testSetInvalidRingerMode;android.media.cts.MediaDrmMockTest#testIsMimeTypeNotSupported;android.media.cts.StreamingMediaPlayerTest#testPlayOggStreamNoLength;android.media.cts.MediaPlayerFlakyNetworkTest#test_S1P000005;android.media.cts.MediaRandomTest#testPlayerRandomAction;android.media.cts.EncoderTest#testAndroidTestCaseSetupProperly;android.media.cts.MediaPlayerTest#testRecordedVideoPlayback0;android.media.cts.AudioRecordTest#testAudioRecordProperties;android.media.cts.AudioTrackTest#testWriteByteOffsetTooBig;android.media.cts.PresetReverbTest#test3_0ControlStatusListener;android.media.cts.DecodeEditEncodeTest#testVideoEditQVGA;android.media.cts.MediaDrmMockTest#testMissingPropertyByteArray;android.media.cts.MediaPlayerTest#testRecordAndPlay;android.media.cts.PresentationSyncTest#testThroughput;android.media.cts.MediaPlayerTest#testVideoSurfaceResetting;android.media.cts.AudioTrack_ListenerTest#testAndroidTestCaseSetupProperly;android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromBufferToBufferQCIF;android.media.cts.MediaPlayerTest#testRecordedVideoPlayback180;android.media.cts.MediaRecorderTest#testRecorderAudio;android.media.cts.EqualizerTest#test2_1SetEnabledAfterRelease;android.media.cts.AudioTrackTest#testPlaybackHeadPositionAfterPause;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_25fps_AAC_Stereo_128kbps_11025Hz;android.media.cts.MediaRecorderTest#testSetMaxFileSize;android.media.cts.Vp8EncoderTest#testBasic;android.media.cts.AudioTrackTest#testPlaybackHeadPositionIncrease;android.media.cts.AudioTrackTest#testAndroidTestCaseSetupProperly;android.media.cts.MediaDrmMockTest#testEventNoSessionNoData;android.media.cts.MediaDrmMockTest#testByteArrayProperties;android.media.cts.DecoderTest#testCodecResetsM4a;android.media.cts.RingtoneTest#testAndroidTestCaseSetupProperly;android.media.cts.AudioPreProcessingTest#test3_1AgcCreateAndRelease;android.media.cts.AudioTrackTest#testSetPlaybackRateTwiceOutputSR;android.media.cts.PresetReverbTest#test1_0Presets;android.media.cts.StreamingMediaPlayerTest#testPlayOggStreamRedirect;android.media.cts.MediaCodecListTest#testAndroidTestCaseSetupProperly;android.media.cts.AudioTrackTest#testSetLoopPointsStartAfterEnd;android.media.cts.MediaRecorderTest#testOnInfoListener;android.media.cts.VirtualizerTest#test3_1EnableStatusListener;android.media.cts.DecoderTest#testCodecResetsH264WithoutSurface;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_12fps_AAC_Stereo_24kbps_11025Hz;android.media.cts.MediaPlayerTest#testRecordedVideoPlayback270;android.media.cts.BassBoostTest#test3_0ControlStatusListener;android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromSurfaceToSurface720p;android.media.cts.AudioTrackTest#testSetPlaybackRateUninit;android.media.cts.BassBoostTest#test2_1SetEnabledAfterRelease;android.media.cts.AudioEffectTest#test0_0QueryEffects;android.media.cts.VisualizerTest#test2_0PollingCapture;android.media.cts.MediaDrmMockTest#testStringProperties;android.media.cts.BassBoostTest#test0_0ConstructorAndRelease;android.media.cts.MediaScannerNotificationTest#testAndroidTestCaseSetupProperly;android.media.cts.AudioTrackTest#testConstructorMono16MusicStream;android.media.cts.MediaRecorderTest#testRecordingAudioInRawFormats;android.media.cts.AudioEffectTest#test3_1SetParameterIntInt;android.media.cts.DecoderTest#testEOSBehaviorVP8;android.media.cts.StreamingMediaPlayerTest#testHTTP_H264Base_AAC_Video2;android.media.cts.AudioEffectTest#test1_4InsertOnMediaPlayer;android.media.cts.StreamingMediaPlayerTest#testHTTP_H264Base_AAC_Video1;android.media.cts.DecoderTest#testCodecResetsVP9WithSurface;android.media.cts.JetPlayerTest#testLoadJetFromPath;android.media.cts.DecoderTest#testEOSBehaviorVP9;android.media.cts.MediaDrmMockTest#testProvideKeyResponse;android.media.cts.DecoderTest#testDecodeM4a;android.media.cts.AudioTrackTest#testWriteByteNegativeSize;android.media.cts.AudioEffectTest#test4_0setEnabledLowerPriority;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_12fps_AAC_Mono_24kbps_22050Hz;android.media.cts.DecoderTest#testEOSBehaviorH264;android.media.cts.DecoderTest#testEOSBehaviorH263;android.media.cts.DecoderTest#testDecodeMonoOgg;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_12fps_AAC_Stereo_24kbps_11025Hz;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_25fps_AAC_Stereo_24kbps_22050Hz;android.media.cts.AudioTrackTest#testSetPlaybackHeadPositionTooFar;android.media.cts.AudioRecord_BufferSizeTest#testAndroidTestCaseSetupProperly;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_12fps_AAC_Mono_24kbps_11025Hz;android.media.cts.MediaCodecListTest#testComponentInstantiation;android.media.cts.BassBoostTest#test1_2SetStrengthAfterRelease;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_25fps_AAC_Stereo_24kbps_11025Hz;android.media.cts.AudioTrackTest#testSetLoopPointsEndTooFar;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_25fps_AAC_Mono_24kbps_11025Hz;android.media.cts.MediaScannerTest#testMediaScanner;android.media.cts.RingtoneTest#testRingtone;android.media.cts.AudioEffectTest#test5_0Command;android.media.cts.DecoderTest#testDecodeMp3Smpb;android.media.cts.AudioTrackTest#testWriteShort8bit;android.media.cts.AudioEffectTest#test3_3SetParameterIntByteArray;android.media.cts.AudioEffectTest#test4_3EnableStatusListener;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_300kbps_25fps_AAC_Mono_24kbps_22050Hz;android.media.cts.JetPlayerTest#testAndroidTestCaseSetupProperly;android.media.cts.Vp8EncoderTest#testSyncFrame;android.media.cts.VirtualizerTest#test2_0SetEnabledGetEnabled;android.media.cts.MediaPlayerSurfaceTest#testSetSurface;android.media.cts.SoundPoolAacTest#testLoad;android.media.cts.AudioEffectTest#test3_5SetParameterIntArrayShortArray;android.media.cts.MediaDrmMockTest#testBadCryptoSession;android.media.cts.AudioTrackTest#testConstructorStereo16MusicStatic;android.media.cts.AudioPreProcessingTest#test1_2NsSetEnabledGetEnabled;android.media.cts.AudioEffectTest#test2_1SetEnabledAfterRelease;android.media.cts.AudioManagerTest#testAccessRingMode;android.media.cts.SoundPoolAacTest#testSoundPoolOp;android.media.cts.AudioEffectTest#test4_4ParameterChangedListener;android.media.cts.DecoderTest#testCodecBasicMpeg4;android.media.cts.AudioTrackTest#testSetPlaybackHeadPositionPlaying;android.media.cts.AudioRecordTest#testAudioRecordOP;android.media.cts.MediaScannerTest#testWildcardPaths;android.media.cts.AudioEffectTest#test3_8GetParameterAfterRelease;android.media.cts.FaceDetector_FaceTest#testFaceProperties;android.media.cts.MediaPlayerTest#testLocalVideo_3gp_H263_176x144_56kbps_25fps_AAC_Stereo_128kbps_22050Hz;android.media.cts.MediaDrmMockTest#testCryptoSessionDecrypt" />
-  <Entry uri="android.mediastress" exclude="android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay00;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay10;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay11;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay07;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay08;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay10;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay05;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay11;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay06;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay03;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay04;android.mediastress.cts.MediaRecorderStressTest#testStressRecorder;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay01;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay02;android.mediastress.cts.H263QcifShortPlayerTest#testPlay07;android.mediastress.cts.MediaRecorderStressTest#testStressCamera;android.mediastress.cts.H263QcifShortPlayerTest#testPlay08;android.mediastress.cts.H263QcifShortPlayerTest#testPlay05;android.mediastress.cts.H263QcifShortPlayerTest#testPlay06;android.mediastress.cts.H263QcifShortPlayerTest#testPlay03;android.mediastress.cts.H263QcifShortPlayerTest#testPlay04;android.mediastress.cts.H263QcifShortPlayerTest#testPlay01;android.mediastress.cts.H263QcifShortPlayerTest#testPlay02;android.mediastress.cts.H264R720pAacLongPlayerTest#testPlay01;android.mediastress.cts.H264R720pAacLongPlayerTest#testPlay00;android.mediastress.cts.MediaRecorderStressTest#testStressCameraSwitchRecorder;android.mediastress.cts.H263QcifShortPlayerTest#testPlay09;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay06;android.mediastress.cts.NativeMediaTest#test1080pPlay;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay05;android.mediastress.cts.NativeMediaTest#testDefaultPlay;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay08;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay07;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay02;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay03;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay09;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay00;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay01;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay06;android.mediastress.cts.H263QcifShortPlayerTest#testPlay00;android.mediastress.cts.H264R1080pAacShortPlayerTest#testPlay00;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay07;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay04;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay00;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay05;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay02;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay01;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay08;android.mediastress.cts.H264R1080pAacShortPlayerTest#testPlay02;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay04;android.mediastress.cts.Vp8R480x360ShortPlayerTest#testPlay09;android.mediastress.cts.H264R1080pAacShortPlayerTest#testPlay01;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay03;android.mediastress.cts.H264R1080pAacRepeatedPlayerTest#testPlay00;android.mediastress.cts.H263QcifShortPlayerTest#testPlay13;android.mediastress.cts.H263QcifShortPlayerTest#testPlay12;android.mediastress.cts.H263QcifShortPlayerTest#testPlay15;android.mediastress.cts.H263QcifShortPlayerTest#testPlay14;android.mediastress.cts.H263QcifLongPlayerTest#testPlay00;android.mediastress.cts.H263QcifShortPlayerTest#testPlay17;android.mediastress.cts.H264R480pAacLongPlayerTest#testPlay00;android.mediastress.cts.H263QcifShortPlayerTest#testPlay16;android.mediastress.cts.H263QcifShortPlayerTest#testPlay19;android.mediastress.cts.H263QcifShortPlayerTest#testPlay18;android.mediastress.cts.H263QcifShortPlayerTest#testPlay10;android.mediastress.cts.H263QcifShortPlayerTest#testPlay11;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay11;android.mediastress.cts.H264R480x360AacShortPlayerTest#testPlay10;android.mediastress.cts.NativeMediaTest#test720pPlay;android.mediastress.cts.H264R1080pAacLongPlayerTest#testPlay00;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay12;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay01;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay00;android.mediastress.cts.H263QcifShortPlayerTest#testPlay23;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay11;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay10;android.mediastress.cts.H263QcifShortPlayerTest#testPlay21;android.mediastress.cts.H263QcifShortPlayerTest#testPlay22;android.mediastress.cts.H263QcifShortPlayerTest#testPlay20;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay02;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay03;android.mediastress.cts.MediaRecorderStressTest#testStressRecordVideoAndPlayback;android.mediastress.cts.H264R720pAacShortPlayerTest#testPlay09;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay04;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay05;android.mediastress.cts.Vp8R480x360LongPlayerTest#testPlay00;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay06;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay07;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay08;android.mediastress.cts.H264R480pAacShortPlayerTest#testPlay09" />
-  <Entry uri="android.net" exclude="android.net.wifi.cts.ScanResultTest#testScanResultProperties;android.net.wifi.cts.WifiManagerTest#testWifiManagerActions;android.net.cts.UriTest#testStringUri;android.net.cts.UrlQuerySanitizer_IllegalCharacterValueSanitizerTest#testAndroidTestCaseSetupProperly;android.net.rtp.cts.AudioGroupTest#testAdd;android.net.rtp.cts.AudioGroupTest#testAndroidTestCaseSetupProperly;android.net.rtp.cts.AudioGroupTest#testRemove;android.net.cts.LocalSocketTest#testAccessors;android.net.http.cts.SslErrorTest#testConstructorIgnoresInvalidValues;android.net.cts.UriTest#testCompareTo;android.net.http.cts.SslErrorTest#testAddErrorIgnoresInvalidValues;android.net.cts.VpnServiceTest#testProtect_DatagramSocket;android.net.wifi.cts.WifiConfigurationTest#testAndroidTestCaseSetupProperly;android.net.rtp.cts.AudioCodecTest#testGetCodecs;android.net.http.cts.ApacheHttpClientTest#testExecute_withWifi;android.net.cts.DnsTest#testAndroidTestCaseSetupProperly;android.net.cts.VpnServiceTest#testAndroidTestCaseSetupProperly;android.net.wifi.cts.SupplicantStateTest#testAndroidTestCaseSetupProperly;android.net.cts.NetworkInfo_StateTest#testValues;android.net.cts.UriTest#testAndroidTestCaseSetupProperly;android.net.cts.LocalSocketTest#testLocalConnections;android.net.wifi.cts.WifiManager_WifiLockTest#testAndroidTestCaseSetupProperly;android.net.wifi.cts.WifiManagerTest#testWifiManagerNetWork;android.net.cts.ConnectivityManagerTest#testGetAllNetworkInfo;android.net.rtp.cts.AudioGroupTest#testTraffic;android.net.cts.Uri_BuilderTest#testBuilderOperations;android.net.cts.UriTest#testBuildUpon;android.net.cts.TrafficStatsTest#testAndroidTestCaseSetupProperly;android.net.cts.ProxyTest#testConstructor;android.net.rtp.cts.AudioCodecTest#testGetCodec;android.net.cts.DhcpInfoTest#testConstructor;android.net.cts.LocalSocketAddress_NamespaceTest#testValues;android.net.cts.ConnectivityManagerTest#testRequestRouteToHost;android.net.cts.ConnectivityManagerTest#testSetNetworkPreference;android.net.http.cts.SslCertificateTest#testState;android.net.cts.NetworkInfo_DetailedStateTest#testAndroidTestCaseSetupProperly;android.net.rtp.cts.AudioCodecTest#testConstants;android.net.http.cts.SslCertificateTest#testSslCertificate;android.net.cts.ProxyTest#testAccessProperties;android.net.cts.CredentialsTest#testCredentials;android.net.rtp.cts.AudioStreamTest#testDoubleRelease;android.net.cts.TrafficStatsTest#testValidMobileStats;android.net.http.cts.SslErrorTest#testGetUrlWithDeprecatedConstructor;android.net.cts.VpnServiceTest#testProtect_int;android.net.cts.ConnectivityManagerTest#testGetNetworkInfo;android.net.cts.MailToTest#testAndroidTestCaseSetupProperly;android.net.cts.LocalSocketTest#testAndroidTestCaseSetupProperly;android.net.cts.LocalSocketAddress_NamespaceTest#testAndroidTestCaseSetupProperly;android.net.cts.NetworkInfo_DetailedStateTest#testValueOf;android.net.cts.DhcpInfoTest#testAndroidTestCaseSetupProperly;android.net.cts.UriTest#testPathOperations;android.net.rtp.cts.AudioStreamTest#testAndroidTestCaseSetupProperly;android.net.http.cts.SslCertificate_DNameTest#testDName;android.net.wifi.cts.WifiManagerTest#testSignal;android.net.cts.UrlQuerySanitizerTest#testUrlQuerySanitizer;android.net.wifi.cts.WifiManager_WifiLockTest#testWifiLock;android.net.rtp.cts.AudioStreamTest#testSetCodec;android.net.cts.MailToTest#testParseMailToURI;android.net.cts.UriTest#testParcelling;android.net.cts.UrlQuerySanitizerTest#testAndroidTestCaseSetupProperly;android.net.wifi.cts.WifiConfigurationTest#testWifiConfiguration;android.net.cts.NetworkInfoTest#testAccessNetworkInfoProperties;android.net.cts.ConnectivityManagerTest#testTest;android.net.http.cts.SslErrorTest#testGetPrimaryError;android.net.cts.NetworkInfo_StateTest#testValueOf;android.net.cts.UriTest#testFromFile;android.net.cts.VpnServiceTest#testTunDevice;android.net.rtp.cts.AudioStreamTest#testSetDtmfType;android.net.cts.SSLCertificateSocketFactoryTest#testAndroidTestCaseSetupProperly;android.net.http.cts.SslCertificateTest#testConstructor;android.net.http.cts.SslErrorTest#testAddError;android.net.cts.UriTest#testNormalizeScheme;android.net.wifi.cts.WifiInfoTest#testAndroidTestCaseSetupProperly;android.net.cts.ConnectivityManagerTest#testStartUsingNetworkFeature;android.net.cts.UriTest#testHierarchicalUris;android.net.cts.DhcpInfoTest#testToString;android.net.rtp.cts.AudioStreamTest#testV6Stream;android.net.cts.LocalSocketAddressTest#testAndroidTestCaseSetupProperly;android.net.cts.UrlQuerySanitizer_IllegalCharacterValueSanitizerTest#testSanitize;android.net.rtp.cts.AudioStreamTest#testV4Stream;android.net.wifi.cts.ConcurrencyTest#testConcurrency;android.net.cts.LocalSocketAddress_NamespaceTest#testValueOf;android.net.wifi.cts.WifiManagerTest#testWifiWatchdog;android.net.cts.UriTest#testEqualsAndHashCode;android.net.cts.VpnServiceTest#testPrepare;android.net.cts.UriTest#testOpaqueUri;android.net.cts.UriTest#testQueryParameters;android.net.cts.TrafficStatsTest#testThreadStatsTag;android.net.wifi.cts.SupplicantStateTest#testIsValidState;android.net.http.cts.SslErrorTest#testHasError;android.net.cts.SSLCertificateSocketFactoryTest#testAccessProperties;android.net.cts.VpnServiceTest#testEstablish;android.net.ipv6.cts.PingTest#testAndroidTestCaseSetupProperly;android.net.cts.NetworkInfoTest#testAndroidTestCaseSetupProperly;android.net.cts.ConnectivityManagerTest#testAndroidTestCaseSetupProperly;android.net.cts.UriTest#testEncodeAndDecode;android.net.rtp.cts.AudioGroupTest#testClear;android.net.cts.NetworkInfo_StateTest#testAndroidTestCaseSetupProperly;android.net.cts.UrlQuerySanitizer_ParameterValuePairTest#testAndroidTestCaseSetupProperly;android.net.cts.ProxyTest#testAndroidTestCaseSetupProperly;android.net.cts.LocalServerSocketTest#testLocalServerSocket;android.net.cts.CredentialsTest#testAndroidTestCaseSetupProperly;android.net.rtp.cts.AudioCodecTest#testAndroidTestCaseSetupProperly;android.net.cts.UrlQuerySanitizer_ParameterValuePairTest#testConstructor;android.net.cts.NetworkInfo_DetailedStateTest#testValues;android.net.http.cts.SslErrorTest#testGetPrimaryErrorWithEmptySet;android.net.rtp.cts.AudioGroupTest#testSetMode;android.net.wifi.cts.WifiInfoTest#testWifiInfoProperties;android.net.wifi.cts.ConcurrencyTest#testAndroidTestCaseSetupProperly;android.net.http.cts.ApacheHttpClientTest#testAndroidTestCaseSetupProperly;android.net.wifi.cts.WifiManagerTest#testWifiManagerProperties;android.net.rtp.cts.AudioGroupTest#testDoubleClear;android.net.wifi.cts.WifiManagerTest#testAndroidTestCaseSetupProperly;android.net.cts.ConnectivityManagerTest#testGetActiveNetworkInfo;android.net.cts.LocalSocketAddressTest#testNewLocalSocketAddressWithDefaultNamespace;android.net.http.cts.SslErrorTest#testGetUrl;android.net.ipv6.cts.PingTest#testLoopbackPing;android.net.cts.TrafficStatsTest#testValidTotalStats;android.net.wifi.cts.WifiEnterpriseConfigTest#testAddEapNetwork;android.net.cts.VpnServiceTest#testProtect_Socket;android.net.wifi.cts.WifiEnterpriseConfigTest#testAndroidTestCaseSetupProperly;android.net.cts.ConnectivityManagerTest#testIsNetworkTypeValid;android.net.cts.ConnectivityManagerTest#testIsNetworkSupported;android.net.cts.LocalServerSocketTest#testAndroidTestCaseSetupProperly;android.net.wifi.cts.WifiEnterpriseConfigTest#testSettersAndGetters;android.net.http.cts.ApacheHttpClientTest#testExecute_withMobile" />
-  <Entry uri="android.provider" exclude="android.provider.cts.ContactsContract_CommonDataKinds_EventTest#testGetTypeLabel;android.provider.cts.MediaStore_Audio_Genres_MembersTest#testStoreAudioGenresMembersInternal;android.provider.cts.ContactsContract_DataTest#testDataInsert_updatesContactLastUpdatedTimestamp;android.provider.cts.ContactsContract_CommonDataKinds_EmailTest#testGetTypeLabel;android.provider.cts.Settings_NameValueTableTest#testPutString;android.provider.cts.CalendarTest#testCalendarEntityQuery;android.provider.cts.ContactsContract_DataUsageTest#testSingleDataUsageFeedback_incrementsCorrectDataItems;android.provider.cts.BrowserTest#testSendString;android.provider.cts.MediaStore_Video_MediaTest#testStoreVideoMediaInternal;android.provider.cts.UserDictionary_WordsTest#testAddWord_deprecated;android.provider.cts.MediaStoreIntentsTest#testAndroidTestCaseSetupProperly;android.provider.cts.ContactsContract_DeletedContacts#testQuerySinceTimestamp;android.provider.cts.BrowserTest#testRequestAllIcons;android.provider.cts.ContactsContract_CommonDataKinds_EmailTest#testAndroidTestCaseSetupProperly;android.provider.cts.CalendarTest#testReminders;android.provider.cts.MediaStore_Audio_ArtistsTest#testStoreAudioArtistsExternal;android.provider.cts.ContactsContractIntentsTest#testViewContactDir;android.provider.cts.CalendarTest#testBulkUpdate;android.provider.cts.ContactsContract_PhotoTest#testAddPhoto;android.provider.cts.Settings_NameValueTableTest#testAndroidTestCaseSetupProperly;android.provider.cts.ContactsProvider2_AccountRemovalTest#testAccountRemovalWithMergedContact_hasDeleteLogsForContacts;android.provider.cts.ContactsContract_PhotoTest#testAddEmptyPhoto;android.provider.cts.Settings_SecureTest#testGetPutFloat;android.provider.cts.MediaStore_Images_MediaTest#testGetContentUri;android.provider.cts.ContactsContract_DeletedContacts#testDelete_isUnsupported;android.provider.cts.CalendarTest#testCalendarCreationAndDeletion;android.provider.cts.BrowserTest#testBookmarksTable;android.provider.cts.Settings_SecureTest#testGetUriFor;android.provider.cts.ContactsContract_StatusUpdatesTest#testGetPresenceIconresourceId;android.provider.cts.MediaStore_Audio_Playlists_MembersTest#testStoreAudioPlaylistsMembersInternal;android.provider.cts.ContactsContract_CommonDataKinds_EventTest#testAndroidTestCaseSetupProperly;android.provider.cts.Contacts_PhonesTest#testGetDisplayLabel;android.provider.cts.ContactsContract_DeletedContacts#testInsert_isUnsupported;android.provider.cts.MediaStore_Audio_AlbumsTest#testStoreAudioAlbumsExternal;android.provider.cts.ContactsContract_DeletedContacts#testAndroidTestCaseSetupProperly;android.provider.cts.BrowserTest#testGetAllVisitedUrls;android.provider.cts.Contacts_ContactMethodsTest#testEncodeAndDecodeProtocol;android.provider.cts.ContactsContract_DeletedContacts#testQueryAll;android.provider.cts.MediaStore_Audio_MediaTest#testStoreAudioMediaInternal;android.provider.cts.ContactsContract_RawContactsTest#testRawContactPsuedoDelete_hasDeleteLogForContact;android.provider.cts.MediaStore_FilesTest#testAndroidTestCaseSetupProperly;android.provider.cts.MediaStore_Images_MediaTest#testStoreImagesMediaInternal;android.provider.cts.MediaStore_Audio_AlbumsTest#testAlbumArt;android.provider.cts.ContactsContract_ContactsTest#testLookupUri;android.provider.cts.MediaStoreIntentsTest#testPickVideoDir;android.provider.cts.MediaStore_Images_MediaTest#testInsertImageWithBitmap;android.provider.cts.MediaStoreIntentsTest#testViewAudioFile;android.provider.cts.MediaStore_Audio_Genres_MembersTest#testStoreAudioGenresMembersExternal;android.provider.cts.ContactsContract_CommonDataKinds_StructuredPostalTest#testAndroidTestCaseSetupProperly;android.provider.cts.CalendarTest#testInstanceSearch;android.provider.cts.VoicemailContractTest#testStatusTablePermissions;android.provider.cts.ContactsContract_CommonDataKinds_OrganizationTest#testAndroidTestCaseSetupProperly;android.provider.cts.SettingsTest#testAndroidTestCaseSetupProperly;android.provider.cts.MediaStore_Audio_PlaylistsTest#testStoreAudioPlaylistsInternal;android.provider.cts.ContactsContract_DumpFileProviderTest#testQuery_worksWithValidFileName;android.provider.cts.Settings_SecureTest#testAndroidTestCaseSetupProperly;android.provider.cts.MediaStore_Video_MediaTest#testAndroidTestCaseSetupProperly;android.provider.cts.BrowserTest#testAccessHistory;android.provider.cts.ContactsContract_DataTest#testContactablesFilterByPhonePrefix_returnsCorrectDataRows;android.provider.cts.MediaStore_Images_ThumbnailsTest#testStoreImagesMediaInternal;android.provider.cts.ContactsTest#testCallsTable;android.provider.cts.CalendarTest#testEventCreationAndDeletion;android.provider.cts.VoicemailContractTest#testVoicemailTablePermissions;android.provider.cts.CalendarTest#testEventsUid2445;android.provider.cts.MediaStore_VideoTest#testQuery;android.provider.cts.CalendarTest#testDefaultProjections;android.provider.cts.MediaStoreIntentsTest#testViewVideoDir;android.provider.cts.MediaStore_FilesTest#testGetContentUri;android.provider.cts.ContactsContract_ContactsTest#testInsert_isUnsupported;android.provider.cts.ContactsContract_CommonDataKinds_PhoneTest#testGetTypeLabel;android.provider.cts.VoicemailContractTest#testVoicemailsTable;android.provider.cts.ContactsContract_CommonDataKinds_RelationTest#testGetTypeLabel;android.provider.cts.Settings_SystemTest#testGetDefaultValues;android.provider.cts.ContactsContract_RawContactsTest#testAndroidTestCaseSetupProperly;android.provider.cts.MediaStoreTest#testGetMediaScannerUri;android.provider.cts.ContactsContract_RawContactsTest#testRawContactDelete_removesRecord;android.provider.cts.Settings_SecureTest#testGetPutString;android.provider.cts.ContactsTest#testGroupMembershipTable;android.provider.cts.MediaStore_Audio_MediaTest#testGetContentUri;android.provider.cts.CalendarTest#testFullRecurrenceUpdate;android.provider.cts.MediaStore_FilesTest#testCaseSensitivity;android.provider.cts.MediaStore_Audio_AlbumsTest#testAndroidTestCaseSetupProperly;android.provider.cts.MediaStore_Audio_ArtistsTest#testStoreAudioArtistsInternal;android.provider.cts.ContactsContract_ContactsTest#testContactDelete_hasDeleteLog;android.provider.cts.ContactsContract_DataUsageTest#testMultiIdDataUsageFeedback_incrementsCorrectDataItems;android.provider.cts.CalendarTest#testSyncOnlyInsertEnforcement;android.provider.cts.VoicemailContractTest#testDataColumnUpdate_throwsIllegalArgumentException;android.provider.cts.CalendarTest#testColorWriteRequirements;android.provider.cts.CalendarTest#testWhenByDayQuery;android.provider.cts.ContactsContract_StreamItemsTest#testAndroidTestCaseSetupProperly;android.provider.cts.ContactsContract_CommonDataKinds_ImTest#testAndroidTestCaseSetupProperly;android.provider.cts.MediaStore_AudioTest#testKeyFor;android.provider.cts.ContactsContract_ContactsTest#testAndroidTestCaseSetupProperly;android.provider.cts.MediaStore_Images_ThumbnailsTest#testQueryInternalThumbnails;android.provider.cts.ContactsContract_DumpFileProviderTest#testOpenFileDescriptor_throwsErrorWithIllegalFileName;android.provider.cts.CalendarTest#testEventColors;android.provider.cts.SettingsTest#testBluetoothDevicesTable;android.provider.cts.ContactsContract_RawContactsTest#testRawContactUpdate_updatesContactUpdatedTimestamp;android.provider.cts.ContactsContract_CommonDataKinds_RelationTest#testAndroidTestCaseSetupProperly;android.provider.cts.MediaStoreTest#testGetVersion;android.provider.cts.MediaStore_Audio_GenresTest#testGetContentUri;android.provider.cts.ContactsContract_DataTest#testDataDelete_updatesContactLastUpdatedTimestamp;android.provider.cts.ContactsContract_CommonDataKinds_SipAddressTest#testGetTypeLabel;android.provider.cts.BrowserTest#testSaveBookmark;android.provider.cts.ContactsProvider2_AccountRemovalTest#testAndroidTestCaseSetupProperly;android.provider.cts.MediaStore_Video_MediaTest#testGetContentUri;android.provider.cts.CalendarTest#testExtendedProperties;android.provider.cts.Settings_SystemTest#testAndroidTestCaseSetupProperly;android.provider.cts.CalendarTest#testNonAdapterRecurrenceExceptions;android.provider.cts.CalendarTest#testOutOfOrderRecurrenceExceptions;android.provider.cts.CalendarTest#testConversionToRecurring;android.provider.cts.MediaStore_Audio_Playlists_MembersTest#testStoreAudioPlaylistsMembersExternal;android.provider.cts.CalendarTest#testMultiRuleRecurrence;android.provider.cts.MediaStoreIntentsTest#testPickAudioDir;android.provider.cts.MediaStore_Audio_GenresTest#testStoreAudioGenresExternal;android.provider.cts.MediaStoreIntentsTest#testViewVideoFile;android.provider.cts.ContactsProvider2_AccountRemovalTest#testAccountRemoval_deletesContacts;android.provider.cts.Contacts_ContactMethodsTest#testAndroidTestCaseSetupProperly;android.provider.cts.ContactsContract_GroupMembershipTest#testAddGroupMembershipWithGroupRowId;android.provider.cts.TelephonyProviderTest#testOpeningAnyFile;android.provider.cts.MediaStore_Audio_GenresTest#testGetContentUriForAudioId;android.provider.cts.ContactsContract_CommonDataKinds_PhoneTest#testAndroidTestCaseSetupProperly;android.provider.cts.Contacts_PeopleTest#testMarkAsContacted;android.provider.cts.MediaStore_FilesTest#testAccess;android.provider.cts.ContactsContract_CommonDataKinds_ImTest#testGetTypeLabel;android.provider.cts.SearchRecentSuggestionsTest#testSuggestionsTable;android.provider.cts.CalendarTest#testAttendees;android.provider.cts.SettingsTest#testAccessNonTable;android.provider.cts.MediaStoreIntentsTest#testPickImageDir;android.provider.cts.BrowserTest#testSearchesTable;android.provider.cts.Contacts_SettingsTest#testAccessSetting;android.provider.cts.ContactsContract_StreamItemPhotosTest#testContentPhotoUri;android.provider.cts.ContactsContract_DataTest#testGetLookupUriByDisplayName;android.provider.cts.ContactsContract_StatusUpdatesTest#testInsertStatus;android.provider.cts.MediaStore_Video_ThumbnailsTest#testGetContentUri;android.provider.cts.MediaStore_Audio_GenresTest#testStoreAudioGenresInternal;android.provider.cts.MediaStore_Images_MediaTest#testInsertImageWithImagePath;android.provider.cts.CalendarTest#testForwardRecurrenceExceptions;android.provider.cts.Settings_SecureTest#testUnknownSourcesOffByDefault;android.provider.cts.CalendarTest#testBadRequests;android.provider.cts.ContactsTest#testSettingsTable;android.provider.cts.VoicemailContractTest#testInsert_doesNotUpdateDataColumn;android.provider.cts.ContactsContract_RawContactsTest#testRawContactCreate_updatesContactUpdatedTimestamp;android.provider.cts.MediaStoreIntentsTest#testViewImageDir;android.provider.cts.ContactsContract_ContactsTest#testContactDelete_removesContactRecord;android.provider.cts.MediaStore_Images_ThumbnailsTest#testQueryExternalMiniThumbnails;android.provider.cts.ContactsContract_ContactsTest#testContactUpdate_updatesContactUpdatedTimestamp;android.provider.cts.Settings_SettingNotFoundExceptionTest#testAndroidTestCaseSetupProperly;android.provider.cts.ContactsContract_RawContactsTest#testGetLookupUriByDisplayName;android.provider.cts.BrowserTest#testAccessSearches;android.provider.cts.ContactsContract_CommonDataKinds_SipAddressTest#testAndroidTestCaseSetupProperly;android.provider.cts.ContactsContract_GroupMembershipTest#testAddGroupMembershipWithUnknownGroupSourceId;android.provider.cts.MediaStore_Audio_MediaTest#testStoreAudioMediaExternal;android.provider.cts.MediaStore_Audio_PlaylistsTest#testGetContentUri;android.provider.cts.ContactsTest#testGroupsTable;android.provider.cts.MediaStore_Audio_AlbumsTest#testGetContentUri;android.provider.cts.Settings_SystemTest#testGetUriFor;android.provider.cts.ContactsContract_StreamItemPhotosTest#testContentDirectoryUri;android.provider.cts.SearchRecentSuggestionsTest#testSearchRecentSuggestions;android.provider.cts.Contacts_ContactMethodsTest#testAddPostalLocation;android.provider.cts.MediaStore_Audio_Artists_AlbumsTest#testGetContentUri;android.provider.cts.SearchRecentSuggestionsTest#testConstructor;android.provider.cts.ContactsContract_ContactsTest#testMarkAsContacted;android.provider.cts.ContactsTest#testPeopleTable;android.provider.cts.CalendarTest#testCalendarColors;android.provider.cts.CalendarTest#testCalendarIsPrimary;android.provider.cts.ContactsContract_RawContactsTest#testRawContactDelete_hasDeleteLogForContact;android.provider.cts.Settings_SystemTest#testSystemSettings;android.provider.cts.CalendarTest#testRecurrence;android.provider.cts.ContactsContract_GroupMembershipTest#testAddGroupMembershipWithGroupSourceId;android.provider.cts.MediaStore_Audio_Genres_MembersTest#testGetContentUri;android.provider.cts.VoicemailContractTest#testStatusTable;android.provider.cts.ContactsContract_DataTest#testContactablesFilterByFirstName_returnsCorrectDataRows;android.provider.cts.Settings_NameValueTableTest#testGetUriFor;android.provider.cts.ContactsContract_DumpFileProviderTest#testQuery_throwsErrorWithIllegalFileName;android.provider.cts.ContactsTest#testContactMethodsTable;android.provider.cts.ContactsContractIntentsTest#testPickContactDir;android.provider.cts.MediaStore_Audio_AlbumsTest#testStoreAudioAlbumsInternal;android.provider.cts.Contacts_PeopleTest#testAddToGroup;android.provider.cts.ContactsContract_DataTest#testContactablesFilterByEmailPrefix_returnsCorrectDataRows;android.provider.cts.ContactsContract_StatusUpdatesTest#testGetPresencePrecedence;android.provider.cts.BrowserTest#testUpdateVisitedHistory;android.provider.cts.SettingsTest#testSecureTable;android.provider.cts.ContactsContract_StreamItemsTest#testContentUri;android.provider.cts.MediaStore_Audio_Artists_AlbumsTest#testStoreAudioArtistsAlbumsInternal;android.provider.cts.MediaStore_Video_ThumbnailsTest#testGetThumbnail;android.provider.cts.ContactsContractIntentsTest#testGetContentContactDir;android.provider.cts.SettingsTest#testSystemTable;android.provider.cts.CalendarTest#testEventUpdateAsApp;android.provider.cts.MediaStore_Images_MediaTest#testStoreImagesMediaExternal;android.provider.cts.CalendarTest#testEventsEntityQuery;android.provider.cts.ContactsContractIntentsTest#testAndroidTestCaseSetupProperly;android.provider.cts.CalendarTest#testSyncState;android.provider.cts.MediaStore_Video_ThumbnailsTest#testAndroidTestCaseSetupProperly;android.provider.cts.ContactsContract_DataTest#testGetLookupUriBySourceId;android.provider.cts.UserDictionary_WordsTest#testAndroidTestCaseSetupProperly;android.provider.cts.ContactsTest#testExtensionsTable;android.provider.cts.ContactsContract_DataTest#testContactablesUri;android.provider.cts.ContactsContract_CommonDataKinds_ImTest#testGetProtocolLabel;android.provider.cts.Settings_SettingNotFoundExceptionTest#testConstructor;android.provider.cts.CalendarTest#testEventsIsOrganizer;android.provider.cts.ContactsContract_StreamItemsTest#testContentDirectoryUri;android.provider.cts.Contacts_PeopleTest#testAccessPhotoData;android.provider.cts.UserDictionary_WordsTest#testAddWord;android.provider.cts.CalendarTest#testSingleRecurrenceExceptions;android.provider.cts.BrowserTest#testGetAllBookmarks;android.provider.cts.ContactsContract_RawContactsTest#testRawContactDelete_setsDeleteFlag;android.provider.cts.MediaStoreIntentsTest#testViewImageFile;android.provider.cts.Settings_SecureTest#testGetPutLong;android.provider.cts.ContactsContract_DataTest#testContactablesFilterByLastName_returnsCorrectDataRows;android.provider.cts.SearchRecentSuggestionsTest#testAndroidTestCaseSetupProperly;android.provider.cts.Contacts_PhonesTest#testGetDisplayLabelCharSequenceArray;android.provider.cts.SettingsTest#testUserDictionarySettingsExists;android.provider.cts.Contacts_OrganizationsTest#testGetDisplayLabel;android.provider.cts.Settings_SecureTest#testGetDefaultValues;android.provider.cts.ContactsContract_ContactsTest#testContactDelete_marksRawContactsForDeletion;android.provider.cts.ContactsTest#testPhotosTable;android.provider.cts.ContactsContract_ContactsTest#testContentUri;android.provider.cts.MediaStore_Audio_Artists_AlbumsTest#testStoreAudioArtistsAlbumsExternal;android.provider.cts.Contacts_PhonesTest#testAndroidTestCaseSetupProperly;android.provider.cts.ContactsProvider2_AccountRemovalTest#testAccountRemovalWithMergedContact_doesNotDeleteContactAndTimestampUpdated;android.provider.cts.ContactsTest#testOrganizationsTable;android.provider.cts.MediaStore_Audio_Playlists_MembersTest#testGetContentUri;android.provider.cts.MediaStore_Audio_PlaylistsTest#testStoreAudioPlaylistsExternal;android.provider.cts.Contacts_OrganizationsTest#testAndroidTestCaseSetupProperly;android.provider.cts.ContactsTest#testPhonesTable;android.provider.cts.Settings_SecureTest#testGetPutInt;android.provider.cts.ContactsContract_StatusUpdatesTest#testAndroidTestCaseSetupProperly;android.provider.cts.MediaStore_Audio_MediaTest#testGetContentUriForPath;android.provider.cts.CalendarTest#testCalendarUpdateAsApp;android.provider.cts.ContactsContract_DeletedContacts#testQueryByContactId;android.provider.cts.ContactsProvider2_AccountRemovalTest#testAccountRemoval_hasDeleteLogsForContacts;android.provider.cts.ContactsContract_StreamItemPhotosTest#testAndroidTestCaseSetupProperly;android.provider.cts.MediaStore_Audio_ArtistsTest#testGetContentUri;android.provider.cts.ContactsContract_DumpFileProviderTest#testAndroidTestCaseSetupProperly;android.provider.cts.ContactsContract_DataTest#testDataUpdate_updatesContactLastUpdatedTimestamp;android.provider.cts.ContactsProvider2_AccountRemovalTest#testAccountRemovalWithMergedContact_deletesContacts;android.provider.cts.ContactsContract_RawContactsTest#testGetLookupUriBySourceId;android.provider.cts.MediaStore_Images_ThumbnailsTest#testGetContentUri;android.provider.cts.ContactsContract_DumpFileProviderTest#testOpenFileDescriptor_worksWithValidFileName;android.provider.cts.ContactsContract_CommonDataKinds_StructuredPostalTest#testGetTypeLabel;android.provider.cts.ContactsContract_DataUsageTest#testAndroidTestCaseSetupProperly;android.provider.cts.Contacts_ContactMethodsTest#test;android.provider.cts.MediaStore_Video_MediaTest#testStoreVideoMediaExternal;android.provider.cts.ContactsContract_CommonDataKinds_OrganizationTest#testGetTypeLabel;android.provider.cts.MediaStore_Images_ThumbnailsTest#testStoreImagesMediaExternal;android.provider.cts.ContactsContract_DataTest#testContactablesFilter_doesNotExist_returnsCorrectDataRows;android.provider.cts.ContactsContract_DeletedContacts#testQuery_returnsProperColumns" />
-  <Entry uri="android.security" exclude="android.security.cts.KeystoreExploitTest#testAndroidTestCaseSetupProperly;android.security.cts.CharDeviceTest#testExynosKernelMemoryRead;android.security.cts.VoldExploitTest#testAndroidTestCaseSetupProperly;android.security.cts.LoadEffectLibraryTest#testLoadLibrary;android.security.cts.BrowserTest#testAndroidTestCaseSetupProperly;android.security.cts.LinuxRngTest#testDevUrandomMajorMinor;android.security.cts.ServicePermissionsTest#testDumpProtected;android.security.cts.BannedFilesTest#testNoSetuidTcpdump;android.security.cts.SqliteJournalLeakTest#testShm;android.security.cts.LinuxRngTest#testDevRandomMajorMinor;android.security.cts.ClonedSecureRandomTest#testCheckForDuplicateOutput;android.security.cts.BrowserTest#testBrowserPrivateDataAccess;android.security.cts.BrowserTest#testTabExhaustion;android.security.cts.KeystoreExploitTest#testKeystoreCrash;android.security.cts.SqliteJournalLeakTest#testJournal;android.security.cts.BannedFilesTest#testNoCmdClient;android.security.cts.BannedFilesTest#testNoSetuidIp;android.security.cts.BannedFilesTest#testNoSyncAgent;android.security.cts.BannedFilesTest#testNoRootCmdSocket;android.security.cts.ListeningPortsTest#testNoListeningLoopbackTcp6Ports;android.security.cts.KernelSettingsTest#testKptrRestrict;android.security.cts.AslrTest#testVaRandomize;android.security.cts.KernelSettingsTest#testMmapMinAddr;android.security.cts.CertificateTest#testBlockCertificates;android.security.cts.BrowserTest#testTabReuse;android.security.cts.KernelSettingsTest#testSELinuxEnforcing;android.security.cts.ListeningPortsTest#testNoListeningLoopbackUdp6Ports;android.security.cts.NativeCodeTest#testPerfEvent;android.security.cts.KernelSettingsTest#testSetuidDumpable;android.security.cts.PackageSignatureTest#testAndroidTestCaseSetupProperly;android.security.cts.ServicePermissionsTest#testAndroidTestCaseSetupProperly;android.security.cts.CertificateTest#testCertificates;android.security.cts.KernelSettingsTest#testNoConfigGz;android.security.cts.KernelSettingsTest#testDmesgRestrict;android.security.cts.ListeningPortsTest#testAndroidTestCaseSetupProperly;android.security.cts.SqliteJournalLeakTest#testAndroidTestCaseSetupProperly;android.security.cts.ListeningPortsTest#testNoRemotelyAccessibleListeningTcp6Ports;android.security.cts.ListeningPortsTest#testNoListeningLoopbackTcpPorts;android.security.cts.ClonedSecureRandomTest#testAndroidTestCaseSetupProperly;android.security.cts.VoldExploitTest#testTryCommandInjection;android.security.cts.VoldExploitTest#testZergRushCrash;android.security.cts.AslrTest#testOneExecutableIsPie;android.security.cts.VoldExploitTest#testTryToCrashVold;android.security.cts.ListeningPortsTest#testNoListeningLoopbackUdpPorts;android.security.cts.CertificateTest#testAndroidTestCaseSetupProperly;android.security.cts.SqliteJournalLeakTest#testWal;android.security.cts.ListeningPortsTest#testNoRemotelyAccessibleListeningTcpPorts;android.security.cts.CharDeviceTest#testExynosRootingVuln" />
-  <Entry uri="android.webkit" exclude="android.webkit.cts.WebViewTest#testDocumentHasImages;android.webkit.cts.WebViewTest#testScrollBarOverlay;android.webkit.cts.WebViewTest#testGoBackAndForward;android.webkit.cts.WebViewTest#testGetContentHeight;android.webkit.cts.WebChromeClientTest#testOnJsConfirm;android.webkit.cts.WebChromeClientTest#testOnProgressChanged;android.webkit.cts.WebViewTest#testAddJavascriptInterfaceNullObject;android.webkit.cts.WebViewTest#testConstructor;android.webkit.cts.WebViewTest#testInvokeZoomPicker;android.webkit.cts.WebSettingsTest#testAccessMinimumLogicalFontSize;android.webkit.cts.WebViewStartupTest#testCookieManagerBlockingUiThread;android.webkit.cts.WebViewTest#testInternals;android.webkit.cts.WebViewClientTest#testShouldOverrideUrlLoading;android.webkit.cts.GeolocationTest#testSimpleGeolocationRequestAcceptOnce;android.webkit.cts.WebSettingsTest#testDatabaseDisabled;android.webkit.cts.WebView_WebViewTransportTest#testAccessWebView;android.webkit.cts.WebSettingsTest#testAccessJavaScriptCanOpenWindowsAutomatically;android.webkit.cts.WebSettingsTest#testAppCacheEnabled;android.webkit.cts.WebSettingsTest#testAccessUserAgentString;android.webkit.cts.WebViewTest#testClearHistory;android.webkit.cts.WebSettingsTest#testAccessSerifFontFamily;android.webkit.cts.WebSettingsTest#testAccessLayoutAlgorithm;android.webkit.cts.WebSettingsTest#testAccessFantasyFontFamily;android.webkit.cts.WebViewTest#testAddJavascriptInterface;android.webkit.cts.WebSettingsTest#testAccessCacheMode;android.webkit.cts.WebViewTest#testDebugDump;android.webkit.cts.WebViewTest#testSslErrorProceedResponseNotReusedForDifferentHost;android.webkit.cts.WebSettingsTest#testLocalImageLoads;android.webkit.cts.WebViewTest#testSslErrorProceedResponseReusedForSameHost;android.webkit.cts.HttpAuthHandlerTest#testUseHttpAuthUsernamePassword;android.webkit.cts.WebViewTest#testSetLayoutParams;android.webkit.cts.WebViewTest#testAppInjectedXRequestedWithHeaderIsNotOverwritten;android.webkit.cts.WebSettingsTest#testAccessUseDoubleTree;android.webkit.cts.WebViewTest#testOnReceivedSslErrorCancel;android.webkit.cts.URLUtilTest#testIsHttpUrl;android.webkit.cts.DateSorterTest#testConstants;android.webkit.cts.WebSettingsTest#testAccessFixedFontFamily;android.webkit.cts.WebSettingsTest#testSetRenderPriority;android.webkit.cts.WebViewTest#testRemoveJavascriptInterface;android.webkit.cts.WebViewTest#testAndroidAssetAnchor;android.webkit.cts.WebViewTest#testOnReceivedSslError;android.webkit.cts.CookieTest#testEmptyValue;android.webkit.cts.WebViewTest#testPauseResumeTimers;android.webkit.cts.URLUtilTest#testIsContentUrl;android.webkit.cts.WebChromeClientTest#testBlockWindowsAsync;android.webkit.cts.WebViewTest#testGetVisibleTitleHeight;android.webkit.cts.WebBackForwardListTest#testClone;android.webkit.cts.WebSettingsTest#testAccessDefaultTextEncodingName;android.webkit.cts.URLUtilTest#testGuessUrl;android.webkit.cts.MimeTypeMapTest#testAndroidTestCaseSetupProperly;android.webkit.cts.WebChromeClientTest#testOnReceivedIcon;android.webkit.cts.CookieTest#testAndroidTestCaseSetupProperly;android.webkit.cts.CookieManagerTest#testRemoveCookies;android.webkit.cts.WebSettingsTest#testAccessPluginsPath;android.webkit.cts.WebSettingsTest#testAccessAllowFileAccess;android.webkit.cts.WebSettingsTest#testAccessSupportMultipleWindows;android.webkit.cts.WebViewTest#testAppCanInjectHeadersViaImmutableMap;android.webkit.cts.WebViewTest#testSecureSiteSetsCertificate;android.webkit.cts.WebViewTest#testSetWebViewClient;android.webkit.cts.WebViewTest#testSetScrollBarStyle;android.webkit.cts.CookieTest#testDomain;android.webkit.cts.WebViewTest#testZoom;android.webkit.cts.URLUtilTest#testIsDataUrl;android.webkit.cts.CookieManagerTest#testAcceptCookie;android.webkit.cts.WebChromeClientTest#testOnReceivedTitle;android.webkit.cts.URLUtilTest#testIsFileUrl;android.webkit.cts.WebSettingsTest#testAccessJavaScriptEnabled;android.webkit.cts.URLUtilTest#testIsNetworkUrl;android.webkit.cts.WebViewTest#testFindAddress;android.webkit.cts.WebViewTest#testSetNetworkAvailable;android.webkit.cts.WebViewTest#testClearSslPreferences;android.webkit.cts.URLUtilTest#testIsHttpsUrl;android.webkit.cts.MimeTypeMapTest#testGetFileExtensionFromUrl;android.webkit.cts.WebViewTest#testGetOriginalUrl;android.webkit.cts.WebChromeClientTest#testBlockWindowsSync;android.webkit.cts.WebViewTest#testLoadData;android.webkit.cts.WebViewTest#testInsecureSiteClearsCertificate;android.webkit.cts.WebBackForwardListTest#testGetCurrentItem;android.webkit.cts.URLUtilTest#testStripAnchor;android.webkit.cts.URLUtilTest#testGuessFileName;android.webkit.cts.URLUtilTest#testAndroidTestCaseSetupProperly;android.webkit.cts.WebViewTest#testEvaluateJavascript;android.webkit.cts.DateSorterTest#testConstructor;android.webkit.cts.WebViewTest#testPageScroll;android.webkit.cts.WebSettingsTest#testIframesWhenAccessFromFileURLsEnabled;android.webkit.cts.WebViewTest#testFlingScroll;android.webkit.cts.WebSettingsTest#testXHRWhenAccessFromFileURLsEnabled;android.webkit.cts.WebChromeClientTest#testOnJsPrompt;android.webkit.cts.WebSettingsTest#testAccessSupportZoom;android.webkit.cts.WebSettingsTest#testLoadsImagesAutomatically;android.webkit.cts.URLUtilTest#testIsValidUrl;android.webkit.cts.WebViewTest#testRequestFocusNodeHref;android.webkit.cts.WebViewTest#testLoadDataWithBaseUrl;android.webkit.cts.WebChromeClientTest#testOnJsAlert;android.webkit.cts.WebSettingsTest#testAccessSansSerifFontFamily;android.webkit.cts.CookieManagerTest#testCookieManager;android.webkit.cts.WebViewTest#testSetMapTrackballToArrowKeys;android.webkit.cts.WebViewTest#testCreatingWebViewCreatesCookieSyncManager;android.webkit.cts.DateSorterTest#testGetIndex;android.webkit.cts.GeolocationTest#testGeolocationPermissions;android.webkit.cts.WebChromeClientTest#testOnJsBeforeUnload;android.webkit.cts.CookieManagerTest#testClone;android.webkit.cts.CookieManagerTest#testGetInstance;android.webkit.cts.WebViewTest#testGetZoomControls;android.webkit.cts.CookieTest#testSubDomain;android.webkit.cts.WebSettingsTest#testUserAgentString_default;android.webkit.cts.MimeTypeMapTest#testGetMimeTypeFromExtension;android.webkit.cts.WebSettingsTest#testBlockNetworkImage;android.webkit.cts.WebViewTest#testPlatformNotifications;android.webkit.cts.URLUtilTest#testIsAboutUrl;android.webkit.cts.WebViewTest#testSetPictureListener;android.webkit.cts.MimeTypeMapTest#testHasMimeType;android.webkit.cts.WebViewTest#testOnReceivedSslErrorProceed;android.webkit.cts.DateSorterTest#testGetLabel;android.webkit.cts.GeolocationTest#testSimpleGeolocationRequestAcceptAlways;android.webkit.cts.URLUtilTest#testDecode;android.webkit.cts.HttpAuthHandlerTest#testProceed;android.webkit.cts.WebSettingsTest#testSetNeedInitialFocus;android.webkit.cts.WebSettingsTest#testIframesWhenAccessFromFileURLsDisabled;android.webkit.cts.WebSettingsTest#testAccessCursiveFontFamily;android.webkit.cts.WebViewTest#testFindAll;android.webkit.cts.WebViewTest#testStopLoading;android.webkit.cts.DateSorterTest#testAndroidTestCaseSetupProperly;android.webkit.cts.WebSettingsTest#testAccessDefaultFixedFontSize;android.webkit.cts.CookieManagerTest#testb3167208;android.webkit.cts.WebSettingsTest#testAccessMinimumFontSize;android.webkit.cts.WebSettingsTest#testAccessUseWideViewPort;android.webkit.cts.WebSettingsTest#testAccessSaveFormData;android.webkit.cts.WebViewTest#testRequestChildRectangleOnScreen;android.webkit.cts.URLUtilTest#testIsJavaScriptUrl;android.webkit.cts.WebViewTest#testFindNext;android.webkit.cts.MimeTypeMapTest#testHasExtension;android.webkit.cts.WebViewTest#testSetDownloadListener;android.webkit.cts.WebSettingsTest#testXHRWhenAccessFromFileURLsDisabled;android.webkit.cts.WebViewTest#testDestroy;android.webkit.cts.MimeTypeMapTest#testGetSingleton;android.webkit.cts.WebViewTest#testAndroidAssetQueryParam;android.webkit.cts.WebViewTest#testAccessPluginList;android.webkit.cts.CookieTest#testPath;android.webkit.cts.WebViewTest#testAccessHttpAuthUsernamePassword;android.webkit.cts.WebViewTest#testUseRemovedJavascriptInterface;android.webkit.cts.WebSettingsTest#testAccessTextSize;android.webkit.cts.URLUtilTest#testIsAssetUrl;android.webkit.cts.CookieTest#testInvalidDomain;android.webkit.cts.CookieSyncManagerTest#testCookieSyncManager;android.webkit.cts.URLUtilTest#testComposeSearchUrl;android.webkit.cts.WebChromeClientTest#testWindows;android.webkit.cts.WebViewTest#testRequestImageRef;android.webkit.cts.WebSettingsTest#testAccessDefaultFontSize;android.webkit.cts.WebViewClientTest#testShouldOverrideKeyEvent;android.webkit.cts.WebHistoryItemTest#testWebHistoryItem;android.webkit.cts.WebSettingsTest#testAccessBuiltInZoomControls;android.webkit.cts.WebSettingsTest#testAppCacheDisabled;android.webkit.cts.WebViewTest#testSetWebChromeClient;android.webkit.cts.WebViewTest#testGetHitTestResult;android.webkit.cts.WebSettingsTest#testAccessStandardFontFamily;android.webkit.cts.GeolocationTest#testSimpleGeolocationRequestReject;android.webkit.cts.WebSettingsTest#testBlockNetworkLoads;android.webkit.cts.DateSorterTest#testGetBoundary;android.webkit.cts.WebViewTest#testCapturePicture;android.webkit.cts.WebSettingsTest#testAccessPluginsEnabled;android.webkit.cts.WebViewTest#testSaveAndRestoreState;android.webkit.cts.WebViewTest#testLoadUrl;android.webkit.cts.HttpAuthHandlerTest#testCancel;android.webkit.cts.URLUtilTest#testIsCookielessProxyUrl;android.webkit.cts.WebViewTest#testGetFavicon;android.webkit.cts.MimeTypeMapTest#testGetExtensionFromMimeType" />
-  <Entry uri="android.widget" exclude="android.widget.cts.ImageSwitcherTest#testSetImageDrawable;android.widget.cts.ExpandableListViewTest#testOnSaveInstanceState;android.widget.cts.RemoteViewsTest#testSetFloat;android.widget.cts.ToggleButtonTest#testConstructor;android.widget.cts.CursorTreeAdapterTest#testOnGroupCollapsed;android.widget.cts.ListViewTest#testDispatchDraw;android.widget.cts.HorizontalScrollViewTest#testRequestLayout;android.widget.cts.TextViewTest#testDrawableResolution;android.widget.cts.CursorTreeAdapterTest#testGetGroup;android.widget.cts.RemoteViewsTest#testSetBoolean;android.widget.cts.SimpleExpandableListAdapterTest#testGetChildrenCount;android.widget.cts.TimePickerTest#testSetEnabled;android.widget.cts.RemoteViewsTest#testSetChronometer;android.widget.cts.BaseExpandableListAdapterTest#testNotifyDataSetChanged;android.widget.cts.TextViewTest#testConstructor;android.widget.cts.FrameLayoutTest#testGenerateLayoutParams2;android.widget.cts.FrameLayoutTest#testGenerateLayoutParams1;android.widget.cts.DialerFilterTest#testClearText;android.widget.cts.ListViewTest#testFindViewWithTagTraversal;android.widget.cts.TextViewTest#testGetResolvedTextAlignmentWithInheritance;android.widget.cts.SimpleAdapterTest#testSetDropDownViewResource;android.widget.cts.GalleryTest#testShowContextMenu;android.widget.cts.ExpandableListViewTest#testSetChildIndicator;android.widget.cts.GalleryTest#testConstructor;android.widget.cts.CursorTreeAdapterTest#testGetGroupCount;android.widget.cts.TextViewTest#testDebug;android.widget.cts.ExpandableListViewTest#testSetIndicatorBounds;android.widget.cts.AutoCompleteTextViewTest#testOnKeyPreIme;android.widget.cts.TextViewTest#testOnTrackballEvent;android.widget.cts.ExpandableListViewTest#testAndroidTestCaseSetupProperly;android.widget.cts.PopupWindowTest#testAccessBackground;android.widget.cts.PopupWindowTest#testGetMaxAvailableHeight;android.widget.cts.TextViewTest#testGetTotalPaddingLeft;android.widget.cts.AutoCompleteTextViewTest#testAccessAdapter;android.widget.cts.AutoCompleteTextViewTest#testPerformCompletion;android.widget.cts.ZoomButtonTest#testDispatchUnhandledMove;android.widget.cts.AbsSpinnerTest#testOnMeasure;android.widget.cts.TextViewTest#testOnWindowFocusChanged;android.widget.cts.PopupWindowTest#testUpdateDimensionAndAlignAnchorViewWithOffsets;android.widget.cts.GridLayoutTest#testCheckLayoutParams;android.widget.cts.TabHostTest#testNewTabSpec;android.widget.cts.ViewAnimatorTest#testGetCurrentView;android.widget.cts.ListViewTest#testDispatchKeyEvent;android.widget.cts.TextViewTest#testSetMinEms;android.widget.cts.FrameLayoutTest#testGatherTransparentRegion;android.widget.cts.AbsListViewTest#testDraw;android.widget.cts.ZoomControlsTest#testHasFocus;android.widget.cts.RemoteViews_ActionExceptionTest#testConstructor;android.widget.cts.ViewFlipperTest#testActivityTestCaseSetUpProperly;android.widget.cts.RemoteViewsTest#testSetString;android.widget.cts.SimpleExpandableListAdapterTest#testConstructor;android.widget.cts.GalleryTest#testComputeHorizontalScrollExtent;android.widget.cts.DialerFilterTest#testGetFilterText;android.widget.cts.RadioGroupTest#testGenerateDefaultLayoutParams;android.widget.cts.DialerFilterTest#testSetFilterWatcher;android.widget.cts.CheckBoxTest#testConstructor;android.widget.cts.ProgressBarTest#testDrawableStateChanged;android.widget.cts.MultiAutoCompleteTextViewTest#testPerformFiltering;android.widget.cts.TextViewTest#testOnKeyMultiple;android.widget.cts.ProgressBarTest#testPostInvalidate;android.widget.cts.SlidingDrawerTest#testOpenAndClose;android.widget.cts.AutoCompleteTextViewTest#testConstructor;android.widget.cts.TextViewTest#testSetLineSpacing;android.widget.cts.ListViewTest#testFindViewTraversal;android.widget.cts.RadioGroupTest#testGetCheckedRadioButtonId;android.widget.cts.TabHostTest#testSetup2;android.widget.cts.TableLayout_LayoutParamsTest#testConstructor;android.widget.cts.HorizontalScrollViewTest#testRequestChildFocus;android.widget.cts.TabWidgetTest#testDispatchDraw;android.widget.cts.PopupWindowTest#testUpdate;android.widget.cts.BaseAdapterTest#testNotifyDataSetInvalidated;android.widget.cts.ProgressBarTest#testOnSaveAndRestoreInstanceState;android.widget.cts.TabHostTest#testSetup1;android.widget.cts.TextViewTest#testOnMeasure;android.widget.cts.CompoundButtonTest#testAccessInstanceState;android.widget.cts.TabWidgetTest#testOnFocusChange;android.widget.cts.DialerFilterTest#testOnFinishInflate;android.widget.cts.ImageViewTest#testSetSelected;android.widget.cts.TextViewTest#testDrawableResolution2;android.widget.cts.ExpandableListViewWithHeadersTest#testPreconditions;android.widget.cts.AbsListViewTest#testSetFilterText;android.widget.cts.ExpandableListViewTest#testGetAdapter;android.widget.cts.TextViewTest#testSingleLine;android.widget.cts.HorizontalScrollViewTest#testComputeScroll;android.widget.cts.CursorAdapterTest#testRunQueryOnBackgroundThread;android.widget.cts.ToastTest#testMakeText2;android.widget.cts.CursorAdapterTest#testGetView;android.widget.cts.ViewSwitcherTest#testSetFactory;android.widget.cts.ToastTest#testMakeText1;android.widget.cts.GridViewTest#testAccessStretchMode;android.widget.cts.AutoCompleteTextViewTest#testGetThreshold;android.widget.cts.RemoteViewsTest#testConstructor;android.widget.cts.AbsListViewTest#testCheckLayoutParams;android.widget.cts.ViewAnimatorTest#testSetAnimateFirstView;android.widget.cts.DigitalClockTest#testActivityTestCaseSetUpProperly;android.widget.cts.SlidingDrawerTest#testAnimateOpenAndClose;android.widget.cts.PopupWindowTest#testAccessFocusable;android.widget.cts.TimePickerTest#testSetOnTimeChangedListener;android.widget.cts.ScrollViewTest#testGetMaxScrollAmount;android.widget.cts.CursorAdapterTest#testOnContentChanged;android.widget.cts.TextViewTest#testGetTotalPaddingBottom;android.widget.cts.AnalogClockTest#testOnMeasure;android.widget.cts.RadioGroupTest#testCheck;android.widget.cts.CursorTreeAdapterTest#testNotifyDataSetChanged;android.widget.cts.TwoLineListItemTest#testActivityTestCaseSetUpProperly;android.widget.cts.AbsListViewTest#testGetContextMenuInfo;android.widget.cts.ViewAnimatorTest#testAccessOutAnimation;android.widget.cts.SlidingDrawerTest#testConstructor;android.widget.cts.TimePickerTest#testOnSaveInstanceStateAndOnRestoreInstanceState;android.widget.cts.AbsListViewTest#testAccessFastScrollEnabled;android.widget.cts.BaseAdapterTest#testGetItemViewType;android.widget.cts.AbsListViewTest#testSetOnScrollListener;android.widget.cts.ImageViewTest#testSetImageURI;android.widget.cts.RadioGroupTest#testOnFinishInflate;android.widget.cts.TableRowTest#testGenerateLayoutParams;android.widget.cts.DialerFilterTest#testGetLetters;android.widget.cts.HorizontalScrollViewTest#testComputeHorizontalScrollRange;android.widget.cts.TextViewTest#testSetPadding;android.widget.cts.VideoViewTest#testPlayVideo1;android.widget.cts.ArrayAdapterTest#testRemove;android.widget.cts.GridViewTest#testGetNumColumns;android.widget.cts.AbsSpinnerTest#testSetSelectionIntBoolean;android.widget.cts.LayoutDirectionTest#testDirectionForAllLayoutsWithCode;android.widget.cts.SimpleCursorAdapterTest#testAccessStringConversionColumn;android.widget.cts.ViewAnimatorTest#testGetBaseline;android.widget.cts.ChronometerTest#testConstructor;android.widget.cts.ResourceCursorTreeAdapterTest#testConstructor;android.widget.cts.AdapterViewTest#testGetPositionForView;android.widget.cts.GridViewTest#testSetVerticalSpacing;android.widget.cts.ButtonTest#testAndroidTestCaseSetupProperly;android.widget.cts.ToggleButtonTest#testToggleText;android.widget.cts.RatingBarTest#testSetMax;android.widget.cts.RemoteViewsTest#testSetViewVisibility;android.widget.cts.ScrollViewTest#testOnTouchEvent;android.widget.cts.BaseAdapterTest#testIsEnabled;android.widget.cts.ExpandableListViewTest#testSetOnChildClickListener;android.widget.cts.EditTextTest#testAndroidTestCaseSetupProperly;android.widget.cts.TextViewTest#testMarquee;android.widget.cts.ImageViewTest#testActivityTestCaseSetUpProperly;android.widget.cts.RadioGroupTest#testConstructors;android.widget.cts.DialerFilterTest#testAccessMode;android.widget.cts.DatePickerTest#testInit;android.widget.cts.TextViewTest#testGetTextColors;android.widget.cts.ProgressBarTest#testAccessProgress;android.widget.cts.TextViewTest#testGetPaint;android.widget.cts.SimpleExpandableListAdapterTest#testNewGroupView;android.widget.cts.AdapterView_AdapterContextMenuInfoTest#testConstructor;android.widget.cts.CompoundButtonTest#testConstructor;android.widget.cts.ImageViewTest#testSetImageLevel;android.widget.cts.SimpleCursorTreeAdapterTest#testBindGroupView;android.widget.cts.SimpleExpandableListAdapterTest#testGetGroup;android.widget.cts.TabWidgetTest#testFocusCurrentTab;android.widget.cts.RelativeLayoutTest#testOnLayout;android.widget.cts.ScrollViewTest#testComputeScroll;android.widget.cts.TextViewTest#testAccessHintTextColor;android.widget.cts.TableLayoutTest#testAccessShrinkAllColumns;android.widget.cts.RemoteViewsTest#testGetPackage;android.widget.cts.GridViewTest#testAttachLayoutAnimationParameters;android.widget.cts.LinearLayout_LayoutParamsTest#testAndroidTestCaseSetupProperly;android.widget.cts.CompoundButtonTest#testAndroidTestCaseSetupProperly;android.widget.cts.ImageViewTest#testSetImageDrawable;android.widget.cts.AdapterViewTest#testAccessVisiblePosition;android.widget.cts.ListViewTest#testSaveAndRestoreInstanceState;android.widget.cts.CompoundButtonTest#testToggle;android.widget.cts.TextViewTest#testMoveCursorToVisibleOffset;android.widget.cts.AutoCompleteTextViewTest#testAccessDropDownWidth;android.widget.cts.RadioGroupTest#testGenerateLayoutParams;android.widget.cts.AdapterViewTest#testCanAnimate;android.widget.cts.ScrollViewTest#testOnLayout;android.widget.cts.AutoCompleteTextViewTest#testEnoughToFilter;android.widget.cts.CheckedTextViewTest#testOnCreateDrawableState;android.widget.cts.RelativeLayout_LayoutParamsTest#testDebug;android.widget.cts.ToastTest#testAccessDuration;android.widget.cts.ToggleButtonTest#testSetChecked;android.widget.cts.HeaderViewListAdapterTest#testGetFootersCount;android.widget.cts.GridLayoutTest#testGenerateDefaultLayoutParams;android.widget.cts.AbsListViewTest#testAccessSmoothScrollbarEnabled;android.widget.cts.SlidingDrawerTest#testSetOnDrawerOpenListener;android.widget.cts.HeaderViewListAdapterTest#testGetHeadersCount;android.widget.cts.RemoteViewsTest#testSetLong;android.widget.cts.SlidingDrawerTest#testSetOnDrawerCloseListener;android.widget.cts.TextViewTest#testGetResolvedTextDirectionLtrWithInheritance;android.widget.cts.ScrollViewTest#testFullScroll;android.widget.cts.RelativeLayout_LayoutParamsTest#testAccessRule1;android.widget.cts.BaseExpandableListAdapterTest#testAreAllItemsEnabled;android.widget.cts.RelativeLayout_LayoutParamsTest#testAccessRule2;android.widget.cts.RemoteViewsActivityTest#testDerivedClass;android.widget.cts.ToastTest#testShowFailure;android.widget.cts.SimpleAdapterTest#testSetViewImage;android.widget.cts.TextViewTest#testAccessPrivateImeOptions;android.widget.cts.AdapterView_AdapterContextMenuInfoTest#testAndroidTestCaseSetupProperly;android.widget.cts.TwoLineListItemTest#testOnFinishInflate;android.widget.cts.ExpandableListViewTest#testGetExpandableListPosition;android.widget.cts.AbsListViewTest#testAccessListPadding;android.widget.cts.ExpandableListViewTest#testExpandGroup;android.widget.cts.TextViewTest#testGetUrls;android.widget.cts.LinearLayoutTest#testAccessBaselineAlignedChildIndex;android.widget.cts.CheckBoxTest#testAndroidTestCaseSetupProperly;android.widget.cts.ZoomControlsTest#testSetOnZoomInClickListener;android.widget.cts.AbsSpinnerTest#testGetCount;android.widget.cts.SimpleExpandableListAdapterTest#testNewChildView;android.widget.cts.ViewSwitcherTest#testConstructor;android.widget.cts.AutoCompleteTextViewTest#testReplaceText;android.widget.cts.ScrollViewTest#testAccessFillViewport;android.widget.cts.ToastTest#testShow;android.widget.cts.TextViewTest#testDrawableStateChanged;android.widget.cts.TimePickerTest#testGetBaseline;android.widget.cts.TextViewTest#testOnTouchEvent;android.widget.cts.ListViewTest#testOnFocusChanged;android.widget.cts.ImageViewTest#testDrawableStateChanged;android.widget.cts.FrameLayoutTest#testOnLayout;android.widget.cts.ListViewTest#testAccessItemsCanFocus;android.widget.cts.AutoCompleteTextViewTest#testOnCommitCompletion;android.widget.cts.ScrollViewTest#testAccessSmoothScrollingEnabled;android.widget.cts.TextViewTest#testSelection;android.widget.cts.CheckedTextViewTest#testOnDraw;android.widget.cts.ViewAnimatorTest#testConstructor;android.widget.cts.RadioGroupTest#testInternalPassThroughHierarchyChangeListener;android.widget.cts.SimpleCursorAdapterTest#testSetViewImage;android.widget.cts.AdapterViewTest#testGetSelected;android.widget.cts.ExpandableListViewWithHeadersTest#testSelectedPosition;android.widget.cts.ProgressBarTest#testAccessIndeterminateDrawable;android.widget.cts.TableLayoutTest#testSetOnHierarchyChangeListener;android.widget.cts.ExpandableListViewTest#testSetOnItemClickListener;android.widget.cts.ProgressBarTest#testSetVisibility;android.widget.cts.AutoCompleteTextViewTest#testConvertSelectionToString;android.widget.cts.ImageViewTest#testSetImageResource;android.widget.cts.ScrollViewTest#testGetVerticalFadingEdgeStrengths;android.widget.cts.FilterTest#testFilter2;android.widget.cts.CursorTreeAdapterTest#testAndroidTestCaseSetupProperly;android.widget.cts.FilterTest#testFilter1;android.widget.cts.ZoomControlsTest#testSetIsZoomOutEnabled;android.widget.cts.ScrollViewTest#testMeasureChildWithMargins;android.widget.cts.CompoundButtonTest#testSetOnCheckedChangeListener;android.widget.cts.TextViewTest#testGetEditableText;android.widget.cts.HorizontalScrollViewTest#testOnRequestFocusInDescendants;android.widget.cts.AbsSpinnerTest#testAccessAdapter;android.widget.cts.ChronometerTest#testAccessOnChronometerTickListener;android.widget.cts.HeaderViewListAdapterTest#testConstructor;android.widget.cts.FrameLayoutTest#testSetForegroundGravity;android.widget.cts.AbsSpinnerTest#testGetSelectedView;android.widget.cts.TextViewTest#testSetGetTextAlignment;android.widget.cts.TextViewTest#testGetLayout;android.widget.cts.ImageViewTest#testConstructor;android.widget.cts.ImageViewTest#testInvalidateDrawable;android.widget.cts.PopupWindowTest#testShowAsDropDownWithOffsets;android.widget.cts.PopupWindowTest#testIsAboveAnchor;android.widget.cts.AutoCompleteTextViewTest#testPerformFiltering;android.widget.cts.ViewFlipperTest#testConstructor;android.widget.cts.DatePickerTest#testUpdateDate;android.widget.cts.MultiAutoCompleteTextViewTest#testMultiAutoCompleteTextView;android.widget.cts.MultiAutoCompleteTextView_CommaTokenizerTest#testConstructor;android.widget.cts.RemoteViewsTest#testSetOnClickPendingIntent;android.widget.cts.HorizontalScrollViewTest#testScrollTo;android.widget.cts.HorizontalScrollViewTest#testOnTouchEvent;android.widget.cts.ListViewTest#testOnMeasure;android.widget.cts.TextViewTest#testSetHighlightColor;android.widget.cts.BaseExpandableListAdapterTest#testNotifyDataSetInvalidated;android.widget.cts.ExpandableListViewWithHeadersTest#testConvertionBetweenFlatAndPacked;android.widget.cts.HeaderViewListAdapterTest#testRemoveFooter;android.widget.cts.ListViewTest#testTransientStateStableIds;android.widget.cts.ScrollViewTest#testSmoothScrollBy;android.widget.cts.ViewSwitcherTest#testAndroidTestCaseSetupProperly;android.widget.cts.TextViewTest#testAccessAutoLinkMask;android.widget.cts.ScrollerTest#testScrollModeWithDefaultDuration;android.widget.cts.GalleryTest#testComputeHorizontalScrollRange;android.widget.cts.CheckedTextViewTest#testSetPadding;android.widget.cts.CursorTreeAdapterTest#testGetGroupId;android.widget.cts.RemoteViewsTest#testApply;android.widget.cts.DialerFilterTest#testIsQwertyKeyboard;android.widget.cts.GalleryTest#testShowContextMenuForChild;android.widget.cts.ScrollViewTest#testPageScroll;android.widget.cts.SimpleCursorTreeAdapterTest#testSetViewImage;android.widget.cts.TableLayoutTest#testOnLayout;android.widget.cts.ArrayAdapterTest#testGetPosition;android.widget.cts.TabWidgetTest#testOnSizeChanged;android.widget.cts.SimpleCursorAdapterTest#testNewDropDownView;android.widget.cts.AutoCompleteTextViewTest#testAccessListSelection;android.widget.cts.TextViewTest#testSetText1;android.widget.cts.TextViewTest#testSetText2;android.widget.cts.RemoteViewsActivityTest#testWebView;android.widget.cts.TextViewTest#testSetText3;android.widget.cts.ToastTest#testAccessGravity;android.widget.cts.HorizontalScrollViewTest#testAddViewWithIndex;android.widget.cts.ResourceCursorTreeAdapterTest#testNewChildView;android.widget.cts.HeaderViewListAdapterTest#testAndroidTestCaseSetupProperly;android.widget.cts.ExpandableListViewTest#testGetPackedPositionForGroup;android.widget.cts.ZoomControlsTest#testShowAndHide;android.widget.cts.CompoundButtonTest#testAccessChecked;android.widget.cts.SimpleAdapterTest#testGetView;android.widget.cts.DialerFilterTest#testGetDigits;android.widget.cts.ArrayAdapterTest#testDataChangeEvent;android.widget.cts.ImageSwitcherTest#testAndroidTestCaseSetupProperly;android.widget.cts.SimpleExpandableListAdapterTest#testGetChildView;android.widget.cts.ZoomControlsTest#testConstructor;android.widget.cts.CompoundButtonTest#testVerifyDrawable;android.widget.cts.TextViewTest#testSetEms;android.widget.cts.AbsSpinnerTest#testGenerateDefaultLayoutParams;android.widget.cts.TextViewTest#testAccessError;android.widget.cts.ZoomButtonTest#testOnTouchEvent;android.widget.cts.TextViewTest#testSetMaxLinesException;android.widget.cts.CompoundButtonTest#testSetButtonDrawableById;android.widget.cts.FrameLayoutTest#testGenerateDefaultLayoutParams;android.widget.cts.HorizontalScrollViewTest#testComputeScrollDeltaToGetChildRectOnScreen;android.widget.cts.ExpandableListViewTest#testSetSelectedChild;android.widget.cts.MediaControllerTest#testShow;android.widget.cts.CursorAdapterTest#testGetDropDownView;android.widget.cts.ListViewTest#testNoSelectableItems;android.widget.cts.TextViewTest#testGetBaseLine;android.widget.cts.AbsSpinnerTest#testConstructor;android.widget.cts.ListViewTest#testAccessDividerHeight;android.widget.cts.TabWidgetTest#testChildDrawableStateChanged;android.widget.cts.AbsListViewTest#testAccessSelectedItem;android.widget.cts.ScrollerTest#testTimePassed;android.widget.cts.ArrayAdapterTest#testGetItem;android.widget.cts.ImageViewTest#testVerifyDrawable;android.widget.cts.ProgressBarTest#testConstructor;android.widget.cts.ProgressBarTest#testIncrementSecondaryProgressBy;android.widget.cts.CursorTreeAdapterTest#testSetChildrenCursor;android.widget.cts.FrameLayoutTest#testCheckLayoutParams;android.widget.cts.AbsoluteLayoutTest#testGenerateDefaultLayoutParams;android.widget.cts.ZoomButtonTest#testOnKeyUp;android.widget.cts.BaseExpandableListAdapterTest#testGetCombinedId;android.widget.cts.ListViewTest#testSetSelection;android.widget.cts.SimpleCursorAdapterTest#testNewView;android.widget.cts.AutoCompleteTextViewTest#testPopupWindow;android.widget.cts.TextView_SaveStateTest#testWriteToParcel;android.widget.cts.TabHost_TabSpecTest#testSetContent2;android.widget.cts.SeekBarTest#testConstructor;android.widget.cts.TabHost_TabSpecTest#testSetContent1;android.widget.cts.TextViewTest#testSetExtractedText;android.widget.cts.TabHost_TabSpecTest#testSetContent3;android.widget.cts.SimpleExpandableListAdapterTest#testGetGroupCount;android.widget.cts.TextViewTest#testComputeVerticalScrollRange;android.widget.cts.GridLayoutTest#testAlignment;android.widget.cts.ExpandableListViewTest#testGetPackedPositionForChild;android.widget.cts.FrameLayoutTest#testConstructor;android.widget.cts.CursorAdapterTest#testAndroidTestCaseSetupProperly;android.widget.cts.RelativeLayoutTest#testSetHorizontalGravity;android.widget.cts.GalleryTest#testDispatchKeyEvent;android.widget.cts.ToastTest#testSetText1;android.widget.cts.HorizontalScrollViewTest#testFullScroll;android.widget.cts.RemoteViewsTest#testSetCharSequence;android.widget.cts.ToastTest#testSetText2;android.widget.cts.HeaderViewListAdapterTest#testRemoveHeader;android.widget.cts.TextSwitcherTest#testSetCurrentText;android.widget.cts.TwoLineListItemTest#testConstructor;android.widget.cts.MediaControllerTest#testMediaController;android.widget.cts.ListViewTest#testConstructor;android.widget.cts.AbsListViewTest#testAccessSelector;android.widget.cts.BaseExpandableListAdapterTest#testDataSetObserver;android.widget.cts.BaseAdapterTest#testHasStableIds;android.widget.cts.TextViewTest#testAccessImeActionLabel;android.widget.cts.CompoundButtonTest#testSetButtonDrawableByDrawable;android.widget.cts.AbsListViewTest#testLayoutChildren;android.widget.cts.ImageViewTest#testClearColorFilter;android.widget.cts.TextViewTest#testGetResolvedTextDirectionRtl;android.widget.cts.CheckedTextViewTest#testChecked;android.widget.cts.MultiAutoCompleteTextViewTest#testReplaceText;android.widget.cts.DigitalClockTest#testOnDetachedFromWindow;android.widget.cts.CursorTreeAdapterTest#testGetChildView;android.widget.cts.FrameLayout_LayoutParamsTest#testAndroidTestCaseSetupProperly;android.widget.cts.ImageViewTest#testSetMaxWidth;android.widget.cts.TabHostTest#testDispatchWindowFocusChanged;android.widget.cts.DigitalClockTest#testConstructor;android.widget.cts.DialerFilterTest#testOnKeyUpDown;android.widget.cts.TextViewTest#testSetHorizontallyScrolling;android.widget.cts.HeaderViewListAdapterTest#testGetViewTypeCount;android.widget.cts.AbsSeekBarTest#testAccessKeyProgressIncrement;android.widget.cts.AbsSeekBarTest#testSetThumb;android.widget.cts.ProgressBarTest#testOnDraw;android.widget.cts.TextViewTest#testSetText;android.widget.cts.PopupWindowTest#testAccessContentView;android.widget.cts.GridLayoutTest#testConstructor;android.widget.cts.PopupWindowTest#testAccessHeight;android.widget.cts.ToggleButtonTest#testAndroidTestCaseSetupProperly;android.widget.cts.ProgressBarTest#testVerifyDrawable;android.widget.cts.TableRowTest#testOnLayout;android.widget.cts.RadioGroupTest#testInternalCheckedStateTracker;android.widget.cts.HorizontalScrollViewTest#testOnSizeChanged;android.widget.cts.ResourceCursorAdapterTest#testNewView;android.widget.cts.MultiAutoCompleteTextView_CommaTokenizerTest#testFindTokenEnd;android.widget.cts.ZoomButtonTest#testOnLongClick;android.widget.cts.AnalogClockTest#testOnDetachedFromWindow;android.widget.cts.TextViewTest#testSetMaxLines;android.widget.cts.ExpandableListViewTest#testPerformItemClick;android.widget.cts.TextViewTest#testResetTextDirection;android.widget.cts.ScrollViewTest#testScrollTo;android.widget.cts.TableLayoutTest#testGenerateDefaultLayoutParams;android.widget.cts.ImageViewTest#testSetAdjustViewBounds;android.widget.cts.TableRowTest#testCheckLayoutParams;android.widget.cts.CheckedTextViewTest#testToggle;android.widget.cts.RemoteViewsTest#testSetProgressBar;android.widget.cts.VideoViewTest#testSetOnErrorListener;android.widget.cts.GalleryTest#testDispatchSetPressed;android.widget.cts.HorizontalScrollViewTest#testSmoothScrollTo;android.widget.cts.ZoomControlsTest#testSetZoomSpeed;android.widget.cts.ExpandableListViewTest#testSetAdapter;android.widget.cts.AutoCompleteTextViewTest#testOnFilterComplete;android.widget.cts.ImageViewTest#testGetDrawable;android.widget.cts.CursorTreeAdapterTest#testRunQueryOnBackgroundThread;android.widget.cts.SlidingDrawerTest#testGetHandle;android.widget.cts.BaseAdapterTest#testAndroidTestCaseSetupProperly;android.widget.cts.MediaControllerTest#testOnTrackballEvent;android.widget.cts.GalleryTest#testGenerateLayoutParams;android.widget.cts.PopupWindowTest#testConstructor;android.widget.cts.GalleryTest#testFoo;android.widget.cts.PopupWindowTest#testAccessAnimationStyle;android.widget.cts.ToggleButtonTest#testAccessTextOn;android.widget.cts.AbsoluteLayoutTest#testGenerateLayoutParams1;android.widget.cts.TextViewTest#testGetDefaultEditable;android.widget.cts.AbsoluteLayoutTest#testGenerateLayoutParams2;android.widget.cts.ArrayAdapterTest#testGetFilter;android.widget.cts.CheckedTextViewTest#testSetCheckMarkDrawableById;android.widget.cts.ScrollerTest#testAbortAnimation;android.widget.cts.LinearLayout_LayoutParamsTest#testConstructor;android.widget.cts.TextViewTest#testComputeVerticalScrollExtent;android.widget.cts.AbsSpinnerTest#testSetSelectionInt;android.widget.cts.TabHostTest#testGetTabContentView;android.widget.cts.TextViewTest#testGetDefaultMovementMethod;android.widget.cts.ScrollViewTest#testRequestChildRectangleOnScreen;android.widget.cts.TabHostTest#testGetCurrentView;android.widget.cts.TextViewTest#testAccessFilters;android.widget.cts.GalleryTest#testCheckLayoutParams;android.widget.cts.RadioGroup_LayoutParamsTest#testConstructor;android.widget.cts.BaseExpandableListAdapterTest#testOnGroupExpanded;android.widget.cts.MultiAutoCompleteTextView_CommaTokenizerTest#testTerminateToken;android.widget.cts.ScrollViewTest#testConstructor;android.widget.cts.ListViewTest#testLayoutChildren;android.widget.cts.RemoteViewsTest#testSetImageViewUri;android.widget.cts.ViewAnimatorTest#testAccessDisplayedChild;android.widget.cts.ExpandableListViewTest#testCollapseGroup;android.widget.cts.AnalogClockTest#testConstructor;android.widget.cts.CursorAdapterTest#testConvertToString;android.widget.cts.BaseAdapterTest#testIsEmpty;android.widget.cts.ResourceCursorTreeAdapterTest#testNewGroupView;android.widget.cts.ScrollViewTest#testFling;android.widget.cts.SlidingDrawerTest#testOnMeasure;android.widget.cts.TextViewTest#testSetMaxEms;android.widget.cts.LinearLayoutTest#testGenerateLayoutParams;android.widget.cts.PopupWindowTest#testAccessInputMethodMode;android.widget.cts.ListViewTest#testPerformItemClick;android.widget.cts.TextViewTest#testOnTextChanged;android.widget.cts.GridViewTest#testSetSelection;android.widget.cts.CursorAdapterTest#testHasStableIds;android.widget.cts.ProgressBarTest#testSetIndeterminate;android.widget.cts.TableRowTest#testGetVirtualChildCount;android.widget.cts.AutoCompleteTextViewTest#testOnTextChanged;android.widget.cts.TextViewTest#testSetLinesException;android.widget.cts.TextViewTest#testLength;android.widget.cts.RelativeLayoutTest#testSetGravity;android.widget.cts.RelativeLayoutTest#testConstructor;android.widget.cts.TextViewTest#testGetLineHeight;android.widget.cts.GalleryTest#testSetAnimationDuration;android.widget.cts.PopupWindowTest#testAccessTouchable;android.widget.cts.RelativeLayoutTest#testSetVerticalGravity;android.widget.cts.CursorTreeAdapterTest#testConstructor;android.widget.cts.AbsSpinnerTest#testRequestLayout;android.widget.cts.TextViewTest#testOnKeyShortcut;android.widget.cts.TableRowTest#testGetVirtualChildAt;android.widget.cts.SpinnerTest#testConstructor;android.widget.cts.SimpleAdapterTest#testGetDropDownView;android.widget.cts.ScrollViewTest#testAddViewWithLayoutParams;android.widget.cts.HeaderViewListAdapterTest#testGetItemViewType;android.widget.cts.RadioGroupTest#testSetOnCheckedChangeListener;android.widget.cts.ToggleButtonTest#testOnFinishInflate;android.widget.cts.DialerFilterTest#testAppend;android.widget.cts.HorizontalScrollViewTest#testRequestChildRectangleOnScreen;android.widget.cts.RadioButtonTest#testConstructor;android.widget.cts.PopupWindowTest#testDismiss;android.widget.cts.TableLayoutTest#testAddView2;android.widget.cts.TableLayoutTest#testAddView3;android.widget.cts.TabHostTest#testOnTouchModeChanged;android.widget.cts.TableLayoutTest#testAddView4;android.widget.cts.HeaderViewListAdapterTest#testGetWrappedAdapter;android.widget.cts.TableLayoutTest#testAddView1;android.widget.cts.ImageSwitcherTest#testSetImageResource;android.widget.cts.ToggleButtonTest#testDrawableStateChanged;android.widget.cts.EditTextTest#testSetSelectionIndex;android.widget.cts.EditTextTest#testExtendSelection;android.widget.cts.AbsSeekBarTest#testSetMax;android.widget.cts.CursorTreeAdapterTest#testChangeCursor;android.widget.cts.AdapterViewTest#testItemOrItemIdAtPosition;android.widget.cts.HorizontalScrollViewTest#testDispatchKeyEvent;android.widget.cts.TableRowTest#testGenerateDefaultLayoutParams;android.widget.cts.AbsListViewTest#testSetRecyclerListener;android.widget.cts.GalleryTest#testGetContextMenuInfo;android.widget.cts.AbsListViewTest#testAccessStackFromBottom;android.widget.cts.TextViewTest#testAccessText;android.widget.cts.SpinnerTest#testGetBaseline;android.widget.cts.ScrollViewTest#testRequestChildFocus;android.widget.cts.LinearLayoutTest#testGenerateDefaultLayoutParams;android.widget.cts.ButtonTest#testConstructor;android.widget.cts.ResourceCursorAdapterTest#testSetViewResource;android.widget.cts.ExpandableListViewBasicTest#testContextMenus;android.widget.cts.FrameLayoutTest#testVerifyDrawable;android.widget.cts.ExpandableListViewTest#testGetPackedPositionType;android.widget.cts.LinearLayoutTest#testLayoutHorizontal;android.widget.cts.ScrollViewTest#testComputeVerticalScrollRange;android.widget.cts.GridViewTest#testOnFocusChanged;android.widget.cts.ZoomControlsTest#testOnTouchEvent;android.widget.cts.GridViewTest#testActivityTestCaseSetUpProperly;android.widget.cts.ListViewTest#testAccessItemChecked;android.widget.cts.AbsoluteLayoutTest#testConstructor;android.widget.cts.TextViewTest#testComputeHorizontalScrollRange;android.widget.cts.HorizontalScrollViewTest#testAddViewWithLayoutParams;android.widget.cts.RemoteViewsTest#testGetLayoutId;android.widget.cts.CursorTreeAdapterTest#testNotifyDataSetChangedBoolean;android.widget.cts.TableRow_LayoutParamsTest#testSetBaseAttributes;android.widget.cts.HorizontalScrollViewTest#testMeasureChildWithMargins;android.widget.cts.TextViewTest#testSetIncludeFontPadding;android.widget.cts.HorizontalScrollViewTest#testAddView;android.widget.cts.TimePickerTest#testAccessCurrentMinute;android.widget.cts.TextViewTest#testGetExtendedPaddingBottom;android.widget.cts.BaseExpandableListAdapterTest#testIsEmpty;android.widget.cts.SimpleAdapterTest#testAccessViewBinder;android.widget.cts.SpinnerTest#testOnLayout;android.widget.cts.AutoCompleteTextViewTest#testAccessValidater;android.widget.cts.ScrollViewTest#testAddViewWithIndex;android.widget.cts.FrameLayoutTest#testDrawableStateChanged;android.widget.cts.PopupWindowTest#testSetTouchInterceptor;android.widget.cts.SimpleAdapterTest#testGetItem;android.widget.cts.ImageViewTest#testSetColorFilter1;android.widget.cts.ImageViewTest#testSetColorFilter2;android.widget.cts.SlidingDrawerTest#testDispatchDraw;android.widget.cts.TextViewTest#testSetOnEditorActionListener;android.widget.cts.DatePickerTest#testSetEnabled;android.widget.cts.RemoteViewsTest#testReapply;android.widget.cts.TextViewTest#testCompound;android.widget.cts.AdapterViewTest#testAccessEmptyView;android.widget.cts.Gallery_LayoutParamsTest#testConstructor;android.widget.cts.TextViewTest#testGetResolvedTextDirectionRtlWithInheritance;android.widget.cts.PopupWindowTest#testShowAtLocation;android.widget.cts.TextViewTest#testPerformLongClick;android.widget.cts.ExpandableListViewTest#testSetChildDivider;android.widget.cts.PopupWindowTest#testAccessClippingEnabled;android.widget.cts.RemoteViewsTest#testSetTextViewText;android.widget.cts.ScrollViewTest#testMeasureChild;android.widget.cts.TableLayoutTest#testAccessColumnShrinkable;android.widget.cts.TableRow_LayoutParamsTest#testConstructor;android.widget.cts.GalleryTest#testComputeHorizontalScrollOffset;android.widget.cts.ProgressBarTest#testOnMeasure;android.widget.cts.ProgressBarTest#testAccessProgressDrawable;android.widget.cts.SimpleAdapterTest#testGetFilter;android.widget.cts.RadioGroupTest#testSetOnHierarchyChangeListener;android.widget.cts.AbsListViewTest#testHandleDataChanged;android.widget.cts.AbsListViewTest#testShowContextMenuForChild;android.widget.cts.ExpandableListViewTest#testConstructor;android.widget.cts.HeaderViewListAdapterTest#testIsEmpty;android.widget.cts.AlphabetIndexerTest#testAlphabetIndexer;android.widget.cts.ChronometerTest#testAccessBase;android.widget.cts.TextViewTest#testAccessRawContentType;android.widget.cts.ScrollViewTest#testExecuteKeyEvent;android.widget.cts.SpinnerTest#testAccessPrompt;android.widget.cts.AnalogClockTest#testOnDraw;android.widget.cts.ChronometerTest#testStartAndStop;android.widget.cts.TabWidgetTest#testSetCurrentTab;android.widget.cts.CursorTreeAdapterTest#testGetFilter;android.widget.cts.ImageSwitcherTest#testSetImageURI;android.widget.cts.TabHostTest#testSetOnTabChangedListener;android.widget.cts.ScrollViewTest#testSmoothScrollTo;android.widget.cts.SimpleExpandableListAdapterTest#testGetGroupId;android.widget.cts.AbsListViewTest#testAccessCacheColorHint;android.widget.cts.TabHostTest#testSetCurrentTabByTag;android.widget.cts.HeaderViewListAdapterTest#testIsEnabled;android.widget.cts.ImageViewTest#testSetImageState;android.widget.cts.ExpandableListViewTest#testSetSelectedGroup;android.widget.cts.DialerFilterTest#testRemoveFilterWatcher;android.widget.cts.ToggleButtonTest#testAccessTextOff;android.widget.cts.TextViewTest#testSetSelectAllOnFocus;android.widget.cts.TextViewTest#testAccessKeyListener;android.widget.cts.ArrayAdapterTest#testInsert;android.widget.cts.MediaControllerTest#testSetPrevNextListeners;android.widget.cts.PopupWindowTest#testUpdatePositionAndDimension;android.widget.cts.TextViewTest#testOnDraw;android.widget.cts.TextViewTest#testSetFrame;android.widget.cts.ScrollerTest#testAccessFinalX;android.widget.cts.ScrollerTest#testAccessFinalY;android.widget.cts.AdapterViewTest#testOnLayout;android.widget.cts.ScrollViewTest#testOnRequestFocusInDescendants;android.widget.cts.TextViewTest#testCancelLongPress;android.widget.cts.GridViewTest#testAccessAdapter;android.widget.cts.ZoomButtonTest#testSetZoomSpeed;android.widget.cts.ExpandableListViewTest#testGetPackedPositionGroup;android.widget.cts.ExpandableListViewTest#testSetGroupIndicator;android.widget.cts.TextViewTest#testGetResolvedTextDirectionLtr;android.widget.cts.BaseAdapterTest#testGetDropDownView;android.widget.cts.ViewAnimatorTest#testShowPrevious;android.widget.cts.TextViewTest#testOnCreateContextMenu;android.widget.cts.TextViewTest#testAppend;android.widget.cts.DialerFilterTest#testOnFocusChanged;android.widget.cts.SlidingDrawerTest#testOnLayout;android.widget.cts.TextViewTest#testGetFocusedRect;android.widget.cts.TextSwitcherTest#testAddView;android.widget.cts.ExpandableListViewTest#testSetChildIndicatorBounds;android.widget.cts.RemoteViewsTest#testSetImageViewBitmap;android.widget.cts.CursorTreeAdapterTest#testHasStableIds;android.widget.cts.ToastTest#testConstructor;android.widget.cts.CursorTreeAdapterTest#testConvertToString;android.widget.cts.AbsListViewTest#testGetTopBottomFadingEdgeStrength;android.widget.cts.EditTextTest#testGetDefaultMovementMethod;android.widget.cts.AbsListViewTest#testAddTouchables;android.widget.cts.SeekBarTest#testSetOnSeekBarChangeListener;android.widget.cts.TextViewTest#testAccessLinkTextColor;android.widget.cts.TextViewTest#testAccessEllipsize;android.widget.cts.RatingBarTest#testAccessNumStars;android.widget.cts.ImageViewTest#testGetBaseline;android.widget.cts.AnalogClockTest#testOnAttachedToWindow;android.widget.cts.LayoutDirectionTest#testDirectionInheritanceForAllLayoutsWithCode;android.widget.cts.AutoCompleteTextViewTest#testAccessItemSelectedListener;android.widget.cts.TextSwitcherTest#testConstructor;android.widget.cts.TextViewTest#testGetResolvedTextAlignment;android.widget.cts.ExpandableListView_ExpandableListContextMenuInfoTest#testConstructor;android.widget.cts.HeaderViewListAdapterTest#testGetFilter;android.widget.cts.AbsSeekBarTest#testConstructor;android.widget.cts.ZoomControlsTest#testSetOnZoomOutClickListener;android.widget.cts.ArrayAdapterTest#testSort;android.widget.cts.HorizontalScrollViewTest#testFling;android.widget.cts.GridViewTest#testConstructor;android.widget.cts.RemoteViewsTest#testNotFeasibleSetters;android.widget.cts.RemoteViewsTest#testWriteToParcel;android.widget.cts.ScrollViewTest#testAddView;android.widget.cts.FilterTest#testConstructor;android.widget.cts.SimpleExpandableListAdapterTest#testGetChildId;android.widget.cts.AutoCompleteTextViewTest#testOnDetachedFromWindow;android.widget.cts.ScrollViewTest#testRequestLayout;android.widget.cts.ImageButtonTest#testConstructor;android.widget.cts.EditTextTest#testSelectAll;android.widget.cts.PopupWindowTest#testSetOnDismissListener;android.widget.cts.TimePickerTest#testAccessCurrentHour;android.widget.cts.ArrayAdapterTest#testCreateFromResource;android.widget.cts.TextViewTest#testSetShadowLayer;android.widget.cts.CompoundButtonTest#testOnCreateDrawableState;android.widget.cts.SimpleCursorAdapterTest#testChangeCursorAndColumns;android.widget.cts.ImageViewTest#testSetFrame;android.widget.cts.ArrayAdapterTest#testSetDropDownViewResouce;android.widget.cts.ResourceCursorAdapterTest#testNewDropDownView;android.widget.cts.ToastTest#testCancel;android.widget.cts.RatingBarTest#testAccessStepSize;android.widget.cts.CheckedTextViewTest#testSetCheckMarkDrawableByDrawable;android.widget.cts.TextViewTest#testInstanceState;android.widget.cts.AbsListViewTest#testGetFocusedRect;android.widget.cts.ViewAnimatorTest#testAddView;android.widget.cts.AdapterViewTest#testUnsupportedMethods;android.widget.cts.TextViewTest#testOnPrivateIMECommand;android.widget.cts.CursorAdapterTest#testAccessCursor;android.widget.cts.TextViewTest#testBringPointIntoView;android.widget.cts.SpinnerTest#testOnClick;android.widget.cts.TextViewTest#testSetEditableFactory;android.widget.cts.ViewSwitcherTest#testGetNextView;android.widget.cts.AbsSeekBarTest#testAccessThumbOffset;android.widget.cts.AbsoluteLayout_LayoutParamsTest#testDebug;android.widget.cts.DatePickerTest#testAccessDate;android.widget.cts.CursorAdapterTest#testConstructor;android.widget.cts.HorizontalScrollViewTest#testPageScroll;android.widget.cts.AutoCompleteTextViewTest#testPerformValidation;android.widget.cts.TextViewTest#testAccessLinksClickable;android.widget.cts.SlidingDrawerTest#testGetContent;android.widget.cts.ViewAnimatorTest#testShowNext;android.widget.cts.TextViewTest#testResetTextAlignment;android.widget.cts.ScrollerTest#testFlingMode;android.widget.cts.SlidingDrawerTest#testOnInterceptTouchEvent;android.widget.cts.DatePickerTest#testConstructor;android.widget.cts.TableLayoutTest#testAccessColumnCollapsed;android.widget.cts.AbsSeekBarTest#testVerifyDrawable;android.widget.cts.ScrollViewTest#testOnSizeChanged;android.widget.cts.TimePickerTest#testConstructors;android.widget.cts.TextViewTest#testAccessTransformationMethod;android.widget.cts.SimpleCursorTreeAdapterTest#testBindChildView;android.widget.cts.ScrollerTest#testExtendDuration;android.widget.cts.RatingBarTest#testAccessRating;android.widget.cts.RelativeLayoutTest#testCheckLayoutParams;android.widget.cts.GalleryTest#testGenerateDefaultLayoutParams;android.widget.cts.AbsoluteLayoutTest#testCheckLayoutParams;android.widget.cts.SlidingDrawerTest#testOnFinishInflate;android.widget.cts.EditTextTest#testSetSelectionStartstop;android.widget.cts.ToggleButtonTest#testSetBackgroundDrawable;android.widget.cts.HeaderViewListAdapterTest#testRegisterDataSetObserver;android.widget.cts.TextViewTest#testAccessFreezesText;android.widget.cts.ArrayAdapterTest#testAndroidTestCaseSetupProperly;android.widget.cts.ExpandableListViewTest#testGetSelectedPosition;android.widget.cts.TabHostTest#testGetCurrentTabTag;android.widget.cts.GridViewTest#testOnMeasure;android.widget.cts.HeaderViewListAdapterTest#testGetItemId;android.widget.cts.RadioButtonTest#testToggle;android.widget.cts.TextViewTest#testOnFocusChanged;android.widget.cts.AbsoluteLayout_LayoutParamsTest#testAndroidTestCaseSetupProperly;android.widget.cts.ViewAnimatorTest#testAccessInAnimation;android.widget.cts.AdapterViewTest#testDispatchSaveInstanceState;android.widget.cts.HeaderViewListAdapterTest#testHasStableIds;android.widget.cts.RelativeLayoutTest#testOnMeasure;android.widget.cts.HorizontalScrollViewTest#testSmoothScrollBy;android.widget.cts.ListViewTest#testTransientStateUnstableIds;android.widget.cts.TableRowTest#testConstructor;android.widget.cts.TabHost_TabSpecTest#testSetIndicator2;android.widget.cts.ArrayAdapterTest#testAccessView;android.widget.cts.TabHost_TabSpecTest#testSetIndicator1;android.widget.cts.HorizontalScrollViewTest#testAccessSmoothScrollingEnabled;android.widget.cts.TextViewTest#testSetCursorVisible;android.widget.cts.FrameLayout_LayoutParamsTest#testConstructor;android.widget.cts.AutoCompleteTextViewTest#testOnAttachedToWindow;android.widget.cts.CursorAdapterTest#testInit;android.widget.cts.SimpleAdapterTest#testGetItemId;android.widget.cts.TableLayout_LayoutParamsTest#testSetBaseAttributes;android.widget.cts.ExpandableListViewBasicTest#testExpandedGroupMovement;android.widget.cts.TextViewTest#testAccessPaintFlags;android.widget.cts.CursorAdapterTest#testGetItemId;android.widget.cts.GalleryTest#testSetSpacing;android.widget.cts.TextViewTest#testSetLines;android.widget.cts.ScrollerTest#testConstructor;android.widget.cts.CompoundButtonTest#testOnDraw;android.widget.cts.ListViewTest#testGetMaxScrollAmount;android.widget.cts.TwoLineListItemTest#testGetTexts;android.widget.cts.AbsListViewTest#testBeforeAndAfterTextChanged;android.widget.cts.AdapterViewTest#testConstructor;android.widget.cts.SimpleAdapterTest#testSetViewText;android.widget.cts.ExpandableListViewTest#testGetSelectedId;android.widget.cts.TableLayoutTest#testOnMeasure;android.widget.cts.DialerFilterTest#testSetDigitsWatcher;android.widget.cts.AbsListViewTest#testPointToPosition;android.widget.cts.ExpandableListViewTest#testGetPackedPositionChild;android.widget.cts.ExpandableListViewBasicTest#testSelectedPosition;android.widget.cts.RemoteViewsTest#testSetBitmap;android.widget.cts.TextViewTest#testFoo;android.widget.cts.EditTextTest#testAccessText;android.widget.cts.AbsListViewTest#testComputeVerticalScrollValues;android.widget.cts.VideoViewTest#testConstructor;android.widget.cts.EditTextTest#testGetDefaultEditable;android.widget.cts.EditTextTest#testConstructor;android.widget.cts.ExpandableListViewWithHeadersTest#testExpandOnFirstGroup;android.widget.cts.RelativeLayout_LayoutParamsTest#testStartEnd;android.widget.cts.ScrollViewTest#testAddViewWithIndexAndLayoutParams;android.widget.cts.ViewFlipperTest#testSetFlipInterval;android.widget.cts.ZoomButtonTest#testConstructor;android.widget.cts.TableRowTest#testOnMeasure;android.widget.cts.TableLayoutTest#testAccessStretchAllColumns;android.widget.cts.GridViewTest#testSetHorizontalSpacing;android.widget.cts.ExpandableListViewWithHeadersTest#testContextMenus;android.widget.cts.ListViewTest#testRequestChildRectangleOnScreen;android.widget.cts.VideoViewTest#testSetMediaController;android.widget.cts.AdapterViewTest#testAccessOnItemClickAndLongClickListener;android.widget.cts.RemoteViewsTest#testSetImageViewResource;android.widget.cts.TextViewTest#testScroll;android.widget.cts.VideoViewTest#testResolveAdjustedSize;android.widget.cts.ScrollViewTest#testOnInterceptTouchEvent;android.widget.cts.ViewAnimatorTest#testRemoveViews;android.widget.cts.AlphabetIndexerTest#testAndroidTestCaseSetupProperly;android.widget.cts.ImageViewTest#testSetMaxHeight;android.widget.cts.ImageViewTest#testOnMeasure;android.widget.cts.RadioGroup_LayoutParamsTest#testSetBaseAttributes;android.widget.cts.AbsoluteLayoutTest#testOnMeasure;android.widget.cts.CompoundButtonTest#testPerformClick;android.widget.cts.ExpandableListViewTest#testAccessExpandableListAdapter;android.widget.cts.TextView_SaveStateTest#testToString;android.widget.cts.CursorTreeAdapterTest#testGetGroupView;android.widget.cts.TextViewTest#testPressKey;android.widget.cts.ProgressBarTest#testAccessMax;android.widget.cts.TextViewTest#testBeginEndBatchEdit;android.widget.cts.HeaderViewListAdapterTest#testGetItem;android.widget.cts.LinearLayoutTest#testActivityTestCaseSetUpProperly;android.widget.cts.TextViewTest#testSetGetTextDirection;android.widget.cts.HeaderViewListAdapterTest#testGetView;android.widget.cts.ScrollerTest#testScrollMode;android.widget.cts.ProgressBarTest#testAccessInterpolator;android.widget.cts.TextViewTest#testTextAttr;android.widget.cts.AbsListViewTest#testAccessScrollingCacheEnabled;android.widget.cts.MediaControllerTest#testSetEnabled;android.widget.cts.SimpleCursorAdapterTest#testConvertToString;android.widget.cts.ExpandableListViewTest#testDispatchDraw;android.widget.cts.DigitalClockTest#testOnAttachedToWindow;android.widget.cts.BaseAdapterTest#testGetViewTypeCount;android.widget.cts.CursorAdapterTest#testGetCount;android.widget.cts.ToastTest#testAccessView;android.widget.cts.FrameLayoutTest#testOnMeasure;android.widget.cts.HorizontalScrollViewTest#testGetMaxScrollAmount;android.widget.cts.AbsListViewTest#testSetScrollIndicators;android.widget.cts.TabHostTest#testOnAttachedToAndDetachedFromWindow;android.widget.cts.CursorAdapterTest#testGetFilter;android.widget.cts.CursorTreeAdapterTest#testGetChild;android.widget.cts.SlidingDrawerTest#testSetOnDrawerScrollListener;android.widget.cts.ProgressBarTest#testOnSizeChange;android.widget.cts.TextViewTest#testGetTotalPaddingRight;android.widget.cts.GridViewTest#testPressKey;android.widget.cts.CheckedTextViewTest#testDrawableStateChanged;android.widget.cts.ScrollerTest#testGetDuration;android.widget.cts.TableLayoutTest#testRequestLayout;android.widget.cts.ImageViewTest#testAccessImageMatrix;android.widget.cts.PopupWindowTest#testAccessWidth;android.widget.cts.BaseAdapterTest#testDataSetObserver;android.widget.cts.SpinnerTest#testPerformClick;android.widget.cts.MediaControllerTest#testConstructor;android.widget.cts.SimpleCursorTreeAdapterTest#testConstructor;android.widget.cts.TextViewTest#testGetTextColor;android.widget.cts.DialerFilterTest#testOnModechange;android.widget.cts.AdapterViewTest#testDispatchRestoreInstanceState;android.widget.cts.ImageViewTest#testOnCreateDrawableState;android.widget.cts.CursorTreeAdapterTest#testNotifyDataSetInvalidated;android.widget.cts.SimpleExpandableListAdapterTest#testGetGroupView;android.widget.cts.ListViewTest#testRequestLayout;android.widget.cts.Gallery_LayoutParamsTest#testAndroidTestCaseSetupProperly;android.widget.cts.SimpleExpandableListAdapterTest#testGetChild;android.widget.cts.TableRowTest#testSetOnHierarchyChangeListener;android.widget.cts.TextViewTest#testGetExtendedPaddingTop;android.widget.cts.ResourceCursorAdapterTest#testSetDropDownViewResource;android.widget.cts.LinearLayoutTest#testAccessBaselineAligned;android.widget.cts.CursorTreeAdapterTest#testGetChildId;android.widget.cts.GridViewTest#testSetColumnWidth;android.widget.cts.AbsListViewTest#testAccessTranscriptMode;android.widget.cts.VideoViewTest#testGetBufferPercentage;android.widget.cts.LinearLayoutTest#testConstructor;android.widget.cts.TextViewTest#testAccessContentType;android.widget.cts.SimpleCursorAdapterTest#testBindView;android.widget.cts.SlidingDrawerTest#testOnTouchEvent;android.widget.cts.ListViewTest#testOnKeyUpDown;android.widget.cts.SimpleCursorAdapterTest#testAccessCursorToStringConverter;android.widget.cts.TabWidgetTest#testAddView;android.widget.cts.TextViewTest#testIsInputMethodTarget;android.widget.cts.AbsoluteLayout_LayoutParamsTest#testConstructor;android.widget.cts.RelativeLayoutTest#testGetBaseline;android.widget.cts.TextViewTest#testGetLineCount;android.widget.cts.GridLayoutTest#testActivityTestCaseSetUpProperly;android.widget.cts.ProgressBarTest#testInvalidateDrawable;android.widget.cts.AbsSpinnerTest#testOnSaveAndRestoreInstanceState;android.widget.cts.MultiAutoCompleteTextViewTest#testConstructor;android.widget.cts.ExpandableListViewTest#testGetFlatListPosition;android.widget.cts.ArrayAdapterTest#testAddAllParams;android.widget.cts.CursorTreeAdapterTest#testSetGroupCursor;android.widget.cts.TextViewTest#testDidTouchFocusSelect;android.widget.cts.SimpleCursorAdapterTest#testConstructor;android.widget.cts.TextViewTest#testAccessImeOptions;android.widget.cts.TabHostTest#testClearAllTabs;android.widget.cts.TextViewTest#testGetFadingEdgeStrength;android.widget.cts.TextViewTest#testSetMinLines;android.widget.cts.DialerFilterTest#testConstructor;android.widget.cts.AbsListViewTest#testConstructor;android.widget.cts.HorizontalScrollViewTest#testAddViewWithIndexAndLayoutParams;android.widget.cts.TextViewTest#testTextDirectionDefault;android.widget.cts.TextViewTest#testGetLineBounds;android.widget.cts.HorizontalScrollViewTest#testConstructor;android.widget.cts.AutoCompleteTextViewTest#testSetFrame;android.widget.cts.RelativeLayoutTest#testGenerateLayoutParams2;android.widget.cts.RelativeLayoutTest#testGenerateLayoutParams1;android.widget.cts.ArrayAdapterTest#testAdd;android.widget.cts.PopupWindowTest#testUpdateDimensionAndAlignAnchorView;android.widget.cts.ToastTest#testAccessMargin;android.widget.cts.RemoteViewsActivityTest#testGood;android.widget.cts.TextViewTest#testAccessTextSize;android.widget.cts.TableLayoutTest#testColumnStretchableEffect;android.widget.cts.CompoundButtonTest#testDrawableStateChanged;android.widget.cts.CursorAdapterTest#testAccessFilterQueryProvider;android.widget.cts.HorizontalScrollViewTest#testArrowScroll;android.widget.cts.ScrollViewTest#testOnMeasure;android.widget.cts.TextViewTest#testTextChangedListener;android.widget.cts.AutoCompleteTextViewTest#testSetCompletionHint;android.widget.cts.TextViewTest#testAccessTextColor;android.widget.cts.FrameLayoutTest#testAccessMeasureAllChildren;android.widget.cts.LinearLayoutTest#testAccessWeightSum;android.widget.cts.HorizontalScrollViewTest#testOnMeasure;android.widget.cts.ResourceCursorAdapterTest#testConstructor;android.widget.cts.FrameLayoutTest#testOnSizeChanged;android.widget.cts.LinearLayoutTest#testCheckLayoutParams;android.widget.cts.PopupWindowTest#testSetWindowLayoutMode;android.widget.cts.ExpandableListView_ExpandableListContextMenuInfoTest#testAndroidTestCaseSetupProperly;android.widget.cts.ListViewTest#testAccessHeaderView;android.widget.cts.RatingBarTest#testAccessOnRatingBarChangeListener;android.widget.cts.GridViewTest#testSetGravity;android.widget.cts.TextViewTest#testAccessHint;android.widget.cts.HorizontalScrollViewTest#testOnLayout;android.widget.cts.ListViewTest#testAccessAdapter;android.widget.cts.ArrayAdapterTest#testGetItemId;android.widget.cts.ImageButtonTest#testAndroidTestCaseSetupProperly;android.widget.cts.TextViewTest#testOnDetachedFromWindow;android.widget.cts.ProgressBarTest#testAccessSecondaryProgress;android.widget.cts.SimpleExpandableListAdapterTest#testIsChildSelectable;android.widget.cts.TextViewTest#testTextAlignmentDefault;android.widget.cts.TableLayoutTest#testCheckLayoutParams;android.widget.cts.AnalogClockTest#testOnSizeChanged;android.widget.cts.DialerFilterTest#testSetLettersWatcher;android.widget.cts.ViewAnimatorTest#testAccessDisplayedChildBoundary;android.widget.cts.TextViewTest#testSetSpannableFactory;android.widget.cts.ImageSwitcherTest#testConstructor;android.widget.cts.TextViewTest#testAccessMovementMethod;android.widget.cts.AbsSeekBarTest#testDrawableStateChanged;android.widget.cts.RadioGroupTest#testAddView;android.widget.cts.HorizontalScrollViewTest#testOnInterceptTouchEvent;android.widget.cts.TabHostTest#testConstructor;android.widget.cts.CursorTreeAdapterTest#testGetChildrenCount;android.widget.cts.SimpleCursorAdapterTest#testChangeCursor;android.widget.cts.HorizontalScrollViewTest#testAccessFillViewport;android.widget.cts.AbsSeekBarTest#testFoo;android.widget.cts.TableLayoutTest#testConstructor;android.widget.cts.GalleryTest#testSetUnselectedAlpha;android.widget.cts.AbsListViewTest#testInvalidateViews;android.widget.cts.HeaderViewListAdapterTest#testGetCount;android.widget.cts.RatingBarTest#testAccessIndicator;android.widget.cts.RelativeLayout_LayoutParamsTest#testConstructor;android.widget.cts.CursorAdapterTest#testNewDropDownView;android.widget.cts.ChronometerTest#testAccessFormat;android.widget.cts.ExpandableListViewBasicTest#testPreconditions;android.widget.cts.AbsListViewTest#testFoo;android.widget.cts.ListViewTest#testOnTouchEvent;android.widget.cts.TabHostTest#testAddTab;android.widget.cts.AdapterViewTest#testChangeFocusable;android.widget.cts.ListViewTest#testAccessDivider;android.widget.cts.ListViewTest#testAccessFooterView;android.widget.cts.SimpleCursorAdapterTest#testAccessViewBinder;android.widget.cts.ZoomButtonTest#testSetEnabled;android.widget.cts.CheckedTextViewTest#testConstructor;android.widget.cts.GridViewTest#testLayoutChildren;android.widget.cts.ImageViewTest#testSetAlpha;android.widget.cts.TextViewTest#testClearComposingText;android.widget.cts.ZoomControlsTest#testSetIsZoomInEnabled;android.widget.cts.TabWidgetTest#testConstructor;android.widget.cts.TableRowTest#testGenerateLayoutParams2;android.widget.cts.TextViewTest#testSetTextAppearance;android.widget.cts.FilterTest#testConvertResultToString;android.widget.cts.MultiAutoCompleteTextViewTest#testPerformValidation;android.widget.cts.TextViewTest#testHeightAndWidth;android.widget.cts.CursorTreeAdapterTest#testIsChildSelectable;android.widget.cts.ArrayAdapterTest#testAddAllCollection;android.widget.cts.AbsListView_LayoutParamsTest#testConstructors;android.widget.cts.ScrollViewTest#testDispatchKeyEvent;android.widget.cts.TabHostTest#testAccessCurrentTab;android.widget.cts.ViewSwitcherTest#testReset;android.widget.cts.TimePickerTest#testAccessIs24HourView;android.widget.cts.TextViewTest#testGetTotalPaddingTop;android.widget.cts.HorizontalScrollViewTest#testExecuteKeyEvent;android.widget.cts.AbsoluteLayoutTest#testOnLayout;android.widget.cts.ImageViewTest#testAccessScaleType;android.widget.cts.TabHostTest#testGetTabWidget;android.widget.cts.SlidingDrawerTest#testAnimateToggle;android.widget.cts.SlidingDrawerTest#testLockAndUnlock;android.widget.cts.GalleryTest#testSetGravity;android.widget.cts.ListViewTest#testOnFinishInflate;android.widget.cts.ScrollViewTest#testArrowScroll;android.widget.cts.ScrollViewTest#testComputeScrollDeltaToGetChildRectOnScreen;android.widget.cts.TabHostTest#testGetCurrentTabView;android.widget.cts.ExpandableListViewBasicTest#testExpandGroup;android.widget.cts.TextViewTest#testExtractText;android.widget.cts.RemoteViewsTest#testOnLoadClass;android.widget.cts.RadioGroupTest#testCheckLayoutParams;android.widget.cts.TextSwitcherTest#testSetText;android.widget.cts.AbsListViewTest#testGenerateLayoutParams;android.widget.cts.TabWidgetTest#testSetEnabled;android.widget.cts.AutoCompleteTextViewTest#testAccessItemClickListener;android.widget.cts.ChronometerTest#testFoo;android.widget.cts.ExpandableListViewBasicTest#testConvertionBetweenFlatAndPacked;android.widget.cts.DatePickerTest#testOnSaveInstanceState;android.widget.cts.DatePickerTest#testAndroidTestCaseSetupProperly;android.widget.cts.ImageButtonTest#testOnSetAlpha;android.widget.cts.AdapterViewTest#testAccessOnItemSelectedListener;android.widget.cts.BaseExpandableListAdapterTest#testOnGroupCollapsed;android.widget.cts.TableLayoutTest#testGenerateLayoutParams1;android.widget.cts.TableLayoutTest#testGenerateLayoutParams2;android.widget.cts.LinearLayoutTest#testLayoutVertical;android.widget.cts.CursorTreeAdapterTest#testAccessQueryProvider;android.widget.cts.TextViewTest#testSetTextKeepState1;android.widget.cts.ArrayAdapterTest#testConstructor;android.widget.cts.RemoteViewsTest#testDescribeContents;android.widget.cts.RelativeLayoutTest#testGenerateDefaultLayoutParams;android.widget.cts.SimpleExpandableListAdapterTest#testHasStableIds;android.widget.cts.TextViewTest#testOnPreDraw;android.widget.cts.ExpandableListViewBasicTest#testCollapseGroup;android.widget.cts.ExpandableListViewWithHeadersTest#testExpandOnFirstPosition;android.widget.cts.SimpleCursorAdapterTest#testSetViewText;android.widget.cts.RelativeLayoutTest#testSetIgnoreGravity;android.widget.cts.RadioGroup_LayoutParamsTest#testAndroidTestCaseSetupProperly;android.widget.cts.BaseAdapterTest#testAreAllItemsEnabled;android.widget.cts.RemoteViewsTest#testSetInt;android.widget.cts.AutoCompleteTextViewTest#testAccessDropDownAnchor;android.widget.cts.ScrollerTest#testIsFinished;android.widget.cts.TextViewTest#testAccessGravity;android.widget.cts.TableLayoutTest#testAccessColumnStretchable;android.widget.cts.ExpandableListViewTest#testSetOnGroupClickListener;android.widget.cts.AlphabetIndexerTest#testCompare;android.widget.cts.AbsListView_LayoutParamsTest#testAndroidTestCaseSetupProperly;android.widget.cts.LayoutDirectionTest#testLayoutDirectionDefaults;android.widget.cts.HeaderViewListAdapterTest#testAreAllItemsEnabled;android.widget.cts.LinearLayout_LayoutParamsTest#testDebug;android.widget.cts.CursorTreeAdapterTest#testGetCursor;android.widget.cts.ImageViewTest#testOnDraw;android.widget.cts.GalleryTest#testGetChildDrawingOrder;android.widget.cts.TextViewTest#testAccessInputExtras;android.widget.cts.LinearLayoutTest#testGetBaseline;android.widget.cts.RatingBarTest#testConstructor;android.widget.cts.RemoteViewsTest#testSetUri;android.widget.cts.SpinnerTest#testsetPromptId;android.widget.cts.RemoteViewsTest#testSetTextColor;android.widget.cts.VideoViewTest#testGetDuration;android.widget.cts.AdapterViewTest#testGetCount;android.widget.cts.MultiAutoCompleteTextView_CommaTokenizerTest#testFindTokenStart;android.widget.cts.ImageViewTest#testSetImageBitmap;android.widget.cts.HeaderViewListAdapterTest#testUnregisterDataSetObserver;android.widget.cts.PopupWindowTest#testAccessOutsideTouchable;android.widget.cts.EditTextTest#testSetEllipsize;android.widget.cts.SimpleAdapterTest#testGetCount;android.widget.cts.SpinnerTest#testSetOnItemClickListener;android.widget.cts.SlidingDrawerTest#testToggle;android.widget.cts.AbsSpinnerTest#testPointToPosition;android.widget.cts.ViewFlipperTest#testViewFlipper;android.widget.cts.TabHostTest#testDispatchKeyEvent;android.widget.cts.ExpandableListViewTest#testIsGroupExpanded;android.widget.cts.LayoutDirectionTest#testDirectionFromXml;android.widget.cts.TextViewTest#testVerifyDrawable;android.widget.cts.ProgressBarTest#testIncrementProgressBy;android.widget.cts.PopupWindowTest#testShowAsDropDown;android.widget.cts.ListViewTest#testCanAnimate;android.widget.cts.HorizontalScrollViewTest#testMeasureChild;android.widget.cts.RadioGroupTest#testClearCheck;android.widget.cts.SimpleAdapterTest#testConstructor;android.widget.cts.HorizontalScrollViewTest#testGetHorizontalFadingEdgeStrengths;android.widget.cts.CursorAdapterTest#testGetItem" />
-</TestPlan>
diff --git a/tests/plans/CTS-stable.xml b/tests/plans/CTS-stable.xml
deleted file mode 100644
index b9e7321..0000000
--- a/tests/plans/CTS-stable.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<TestPlan version="1.0">
-  <Entry uri="android.aadb"/>
-  <Entry uri="android.acceleration"/>
-  <Entry uri="android.accessibility"/>
-  <Entry uri="android.accessibilityservice"/>
-  <Entry uri="android.accounts"/>
-  <Entry uri="android.admin"/>
-  <Entry uri="android.animation"/>
-  <Entry uri="android.app" exclude="android.app.cts.ActivityManagerTest#testIsRunningInTestHarness;android.app.cts.AlertDialogTest#testAlertDialogCancelable;android.app.cts.ExpandableListActivityTest#testCallback" />
-  <Entry uri="android.bionic"/>
-  <Entry uri="android.bluetooth"/>
-  <Entry uri="android.calendarcommon"/>
-  <Entry uri="android.content"/>
-  <Entry uri="android.core.tests.libcore.package.com"/>
-  <Entry uri="android.core.tests.libcore.package.conscrypt"/>
-  <Entry uri="android.core.tests.libcore.package.dalvik"/>
-  <Entry uri="android.core.tests.libcore.package.libcore"/>
-  <Entry uri="android.core.tests.libcore.package.org"/>
-  <Entry uri="android.core.tests.libcore.package.sun"/>
-  <Entry uri="android.core.tests.libcore.package.tests"/>
-  <Entry uri="android.core.vm-tests-tf"/>
-  <Entry uri="android.database"/>
-  <Entry uri="android.display"/>
-  <Entry uri="android.dpi"/>
-  <Entry uri="android.dpi2"/>
-  <Entry uri="android.dreams"/>
-  <Entry uri="android.drm"/>
-  <Entry uri="android.effect"/>
-  <Entry uri="android.example"/>
-  <Entry uri="android.gesture"/>
-  <Entry uri="android.graphics"/>
-  <Entry uri="android.graphics2"/>
-  <Entry uri="android.hardware" exclude="android.hardware.cts.SensorIntegrationTests#testAccelerometerDoesNotStopGyroscope;android.hardware.cts.SensorIntegrationTests#testsAccelerometerDoesnNotStopMagnetometer;android.hardware.cts.SensorIntegrationTests#testAndroidTestCaseSetupProperly;android.hardware.cts.SensorIntegrationTests#testBatchAndFlush;android.hardware.cts.SensorIntegrationTests#testGyroscopeDoesNotStopAccelerometer;android.hardware.cts.SensorIntegrationTests#testGyroscopeDoesNotStopMagnetometer;android.hardware.cts.SensorIntegrationTests#testMagnetometerDoesNotStopAccelerometer;android.hardware.cts.SensorIntegrationTests#testMagnetometerDoesNotStopGyroscope;android.hardware.cts.SensorMagneticFieldTest#testBatchingStoppingOtherClients;android.hardware.cts.SensorMagneticFieldTest#testBatchingStoppingOtherClientsBatching;android.hardware.cts.SensorMagneticFieldTest#testFrequencyAccuracy;android.hardware.cts.SensorMagneticFieldTest#testOneClientSeveralThreads;android.hardware.cts.SensorMagneticFieldTest#testOneClientSeveralThreadsBatching;android.hardware.cts.SensorMagneticFieldTest#testStandardDeviationWhileStatic;android.hardware.cts.SensorMagneticFieldTest#testStoppingOtherClients;android.hardware.cts.SensorMagneticFieldTest#testStoppingOtherClientsBatching;android.hardware.cts.SensorAccelerometerTest#testBatchingStoppingOtherClients;android.hardware.cts.SensorAccelerometerTest#testBatchingStoppingOtherClientsBatching;android.hardware.cts.SensorAccelerometerTest#testFrequencyAccuracy;android.hardware.cts.SensorAccelerometerTest#testOneClientSeveralThreads;android.hardware.cts.SensorAccelerometerTest#testOneClientSeveralThreadsBatching;android.hardware.cts.SensorGyroscopeTest#testBatchingStoppingOtherClients;android.hardware.cts.SensorGyroscopeTest#testBatchingStoppingOtherClientsBatching;android.hardware.cts.SensorGyroscopeTest#testFrequencyAccuracy;android.hardware.cts.SensorGyroscopeTest#testOneClientSeveralThreads;android.hardware.cts.SensorGyroscopeTest#testOneClientSeveralThreadsBatching;android.hardware.cts.SensorGyroscopeTest#testStandardDeviationWhilStatic;android.hardware.cts.SensorGyroscopeTest#testStoppingOtherClients;android.hardware.cts.SensorGyroscopeTest#testStoppingOtherClientsBatching;android.hardware.cts.SensorAccelerometerTest#testStandardDeviationWhileStatic;android.hardware.cts.SensorAccelerometerTest#testStoppingOtherClients;android.hardware.cts.SensorAccelerometerTest#testStoppingOtherClientsBatching;android.hardware.camera2.cts.CameraDeviceTest#testCameraDeviceRepeatingRequest;android.hardware.camera2.cts.ImageReaderTest#testImageReaderFromCameraJpeg;android.hardware.cts.CameraGLTest#testCameraToSurfaceTextureMetadata;android.hardware.cts.CameraTest#testImmediateZoom;android.hardware.cts.CameraTest#testPreviewCallback;android.hardware.cts.CameraTest#testSmoothZoom;android.hardware.cts.CameraTest#testVideoSnapshot;android.hardware.cts.CameraGLTest#testSetPreviewTextureBothCallbacks;android.hardware.cts.CameraGLTest#testSetPreviewTexturePreviewCallback" />
-  <Entry uri="android.holo"/>
-  <Entry uri="android.jni"/>
-  <Entry uri="android.keystore"/>
-  <Entry uri="android.location"/>
-  <Entry uri="android.media" exclude="android.media.cts.StreamingMediaPlayerTest#testHLS;android.media.cts.DecoderTest#testCodecResetsH264WithSurface" />
-  <Entry uri="android.mediastress" exclude="android.mediastress.cts.NativeMediaTest#test480pPlay" />
-  <Entry uri="android.nativemedia.sl"/>
-  <Entry uri="android.nativemedia.xa"/>
-  <Entry uri="android.nativeopengl"/>
-  <Entry uri="android.ndef"/>
-  <Entry uri="android.net" exclude="android.net.cts.ConnectivityManagerTest#testStartUsingNetworkFeature_enableHipri;android.net.wifi.cts.ScanResultTest#testScanResultTimeStamp;android.net.cts.DnsTest#testDnsWorks;android.net.cts.TrafficStatsTest#testTrafficStatsForLocalhost;android.net.wifi.cts.ScanResultTest#testAndroidTestCaseSetupProperly;android.net.wifi.cts.NsdManagerTest#testAndroidTestCaseSetupProperly;android.net.cts.SSLCertificateSocketFactoryTest#testCreateSocket;android.net.cts.SSLCertificateSocketFactoryTest#test_createSocket_bind;android.net.cts.SSLCertificateSocketFactoryTest#test_createSocket_simple;android.net.cts.SSLCertificateSocketFactoryTest#test_createSocket_wrapping" />
-  <Entry uri="android.opengl"/>
-  <Entry uri="android.openglperf"/>
-  <Entry uri="android.os"/>
-  <Entry uri="android.permission"/>
-  <Entry uri="android.permission2"/>
-  <Entry uri="android.preference"/>
-  <Entry uri="android.preference2"/>
-  <Entry uri="android.provider" exclude="android.provider.cts.CalendarTest#testRemindersAlarm" />
-  <Entry uri="android.renderscript"/>
-  <Entry uri="android.rscpp"/>
-  <Entry uri="android.rsg"/>
-  <Entry uri="android.sax"/>
-  <Entry uri="android.security" exclude="android.security.cts.ListeningPortsTest#testNoRemotelyAccessibleListeningUdp6Ports;android.security.cts.ListeningPortsTest#testNoRemotelyAccessibleListeningUdpPorts;android.security.cts.BannedFilesTest#testNoSu;android.security.cts.BannedFilesTest#testNoSuInPath;android.security.cts.PackageSignatureTest#testPackageSignatures" />
-  <Entry uri="android.speech"/>
-  <Entry uri="android.telephony"/>
-  <Entry uri="android.tests.appsecurity"/>
-  <Entry uri="android.tests.location"/>    
-  <Entry uri="android.tests.sigtest"/>
-  <Entry uri="android.text"/>
-  <Entry uri="android.textureview"/>
-  <Entry uri="android.theme"/>
-  <Entry uri="android.uiautomator"/>
-  <Entry uri="android.usb"/>
-  <Entry uri="android.util"/>
-  <Entry uri="android.view"/>
-  <Entry uri="android.webkit" exclude="android.webkit.cts.WebViewClientTest#testDoUpdateVisitedHistory;android.webkit.cts.WebViewClientTest#testLoadPage;android.webkit.cts.WebViewClientTest#testOnFormResubmission;android.webkit.cts.WebViewClientTest#testOnReceivedError;android.webkit.cts.WebViewClientTest#testOnReceivedHttpAuthRequest;android.webkit.cts.WebViewClientTest#testOnScaleChanged;android.webkit.cts.WebViewClientTest#testOnUnhandledKeyEvent;android.webkit.cts.WebViewTest#testSetInitialScale" />
-  <Entry uri="android.widget" exclude="android.widget.cts.GridViewTest#testSetNumColumns" />
-  <Entry uri="com.android.cts.bootup"/>
-  <Entry uri="com.android.cts.browserbench"/>
-  <Entry uri="com.android.cts.dram"/>
-  <Entry uri="com.android.cts.filesystemperf"/>
-  <Entry uri="com.android.cts.jank.opengl"/>
-  <Entry uri="com.android.cts.jank.ui"/>
-  <Entry uri="com.android.cts.opengl"/>
-  <Entry uri="com.android.cts.simplecpu"/>
-  <Entry uri="com.android.cts.ui"/>
-  <Entry uri="com.android.cts.uihost"/>
-  <Entry uri="com.android.cts.videoperf"/>
-  <Entry uri="zzz.android.monkey"/>
-</TestPlan>
diff --git a/tests/res/layout/framelayout_layout.xml b/tests/res/layout/framelayout_layout.xml
index 1048d1b..c6d1a83 100644
--- a/tests/res/layout/framelayout_layout.xml
+++ b/tests/res/layout/framelayout_layout.xml
@@ -23,8 +23,8 @@
                 android:orientation="vertical">
 
     <FrameLayout
-        android:layout_width="200dip"
-        android:layout_height="200dip"
+        android:layout_width="100dip"
+        android:layout_height="100dip"
         android:background="@drawable/yellow"
         android:id="@+id/framelayout">
     </FrameLayout>
@@ -37,7 +37,7 @@
 
         <TextView android:id="@+id/framelayout_textview"
             android:background="@drawable/blue"
-            android:layout_width="100dip"
+            android:layout_width="60dip"
             android:layout_height="30dip"
             android:text="@string/hello_world"/>
 
diff --git a/tests/res/values/styles.xml b/tests/res/values/styles.xml
index f8b56fd..e0110cc 100644
--- a/tests/res/values/styles.xml
+++ b/tests/res/values/styles.xml
@@ -138,4 +138,8 @@
         <item name="android:panelColorBackground">#ffffffff</item>
     </style>
 
+    <style name="Theme_NoSwipeDismiss">
+        <item name="android:windowSwipeToDismiss">false</item>
+    </style>
+
 </resources>
diff --git a/tests/src/android/opengl/cts/EglConfigStubActivity.java b/tests/src/android/opengl/cts/EglConfigStubActivity.java
index ab1a6d0..749679a 100644
--- a/tests/src/android/opengl/cts/EglConfigStubActivity.java
+++ b/tests/src/android/opengl/cts/EglConfigStubActivity.java
@@ -20,6 +20,7 @@
 import android.content.Intent;
 import android.opengl.GLSurfaceView;
 import android.os.Bundle;
+import android.view.WindowManager;
 
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
@@ -44,6 +45,11 @@
         int contextClientVersion = getContextClientVersion();
         setTitle("EGL Config Id: " + configId + " Client Version: " + contextClientVersion);
 
+        // Dismiss keyguard and keep screen on while this test is on.
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |
+                WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON |
+                WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+
         mFinishedDrawing = new CountDownLatch(1);
         mView = new EglConfigGLSurfaceView(this, configId, contextClientVersion, new Runnable() {
             @Override
diff --git a/tests/src/android/text/EmojiStubActivity.java b/tests/src/android/text/EmojiStubActivity.java
index 1587c94..8d09250 100644
--- a/tests/src/android/text/EmojiStubActivity.java
+++ b/tests/src/android/text/EmojiStubActivity.java
@@ -21,15 +21,20 @@
 import android.app.Activity;
 import android.os.Bundle;
 import android.webkit.WebView;
+import android.webkit.cts.NullWebViewUtils;
 
 public class EmojiStubActivity extends Activity {
     private WebView mWebView;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.webview_layout);
-        mWebView = (WebView) findViewById(R.id.web_page);
+        try {
+            super.onCreate(savedInstanceState);
+            setContentView(R.layout.webview_layout);
+            mWebView = (WebView) findViewById(R.id.web_page);
+        } catch (Exception e) {
+            NullWebViewUtils.determineIfWebViewAvailable(this, e);
+        }
     }
 
     public WebView getWebView() {
@@ -38,7 +43,9 @@
 
     @Override
     public void onDestroy() {
-        mWebView.destroy();
+        if (mWebView != null) {
+            mWebView.destroy();
+        }
         super.onDestroy();
     }
 }
diff --git a/tests/src/android/webkit/cts/CookieSyncManagerStubActivity.java b/tests/src/android/webkit/cts/CookieSyncManagerStubActivity.java
index 3421ac6..a5ac6ec 100644
--- a/tests/src/android/webkit/cts/CookieSyncManagerStubActivity.java
+++ b/tests/src/android/webkit/cts/CookieSyncManagerStubActivity.java
@@ -27,22 +27,35 @@
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        CookieSyncManager.createInstance(this);
 
-        mWebView = new WebView(this);
-        setContentView(mWebView);
+        try {
+            CookieSyncManager.createInstance(this);
+
+            mWebView = new WebView(this);
+            setContentView(mWebView);
+        } catch (Exception e) {
+            NullWebViewUtils.determineIfWebViewAvailable(this, e);
+        }
     }
 
     @Override
     protected void onResume() {
         super.onResume();
-        CookieSyncManager.getInstance().startSync();
+        try {
+            CookieSyncManager.getInstance().startSync();
+        } catch (Exception e) {
+            // May throw on a device with no webview, OK to ignore at this point.
+        }
     }
 
     @Override
     protected void onStop() {
         super.onStop();
-        CookieSyncManager.getInstance().stopSync();
+        try {
+            CookieSyncManager.getInstance().stopSync();
+        } catch (Exception e) {
+            // May throw on a device with no webview, OK to ignore at this point.
+        }
     }
 
     public WebView getWebView(){
diff --git a/tests/src/android/webkit/cts/NullWebViewUtils.java b/tests/src/android/webkit/cts/NullWebViewUtils.java
new file mode 100644
index 0000000..c52219f
--- /dev/null
+++ b/tests/src/android/webkit/cts/NullWebViewUtils.java
@@ -0,0 +1,88 @@
+/*
+ * 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.webkit.cts;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+
+/**
+ * Utilities to enable the android.webkit.* CTS tests (and others that rely on a functioning
+ * android.webkit.WebView implementation) to determine whether a functioning WebView is present
+ * on the device or not.
+ *
+ * Test cases that require android.webkit.* classes should wrap their first usage of WebView in a
+ * try catch block, and pass any exception that is thrown to
+ * NullWebViewUtils.determineIfWebViewAvailable. The return value of
+ * NullWebViewUtils.isWebViewAvailable will then determine if the test should expect to be able to
+ * use a WebView.
+ */
+public class NullWebViewUtils {
+
+    private static boolean sWebViewUnavailable;
+
+    /**
+     * @param context Current Activity context, used to query the PackageManager.
+     * @param t       An exception thrown by trying to invoke android.webkit.* APIs.
+     */
+    public static void determineIfWebViewAvailable(Context context, Throwable t) {
+        sWebViewUnavailable = !hasWebViewFeature(context) && checkCauseWasUnsupportedOperation(t);
+    }
+
+    /**
+     * After calling determineIfWebViewAvailable, this returns whether a WebView is available on the
+     * device and wheter the test can rely on it.
+     * @return True iff. PackageManager determined that there is no WebView on the device and the
+     *         exception thrown from android.webkit.* was UnsupportedOperationException.
+     */
+    public static boolean isWebViewAvailable() {
+        return !sWebViewUnavailable;
+    }
+
+    private static boolean hasWebViewFeature(Context context) {
+        // Query the system property that determins if there is a functional WebView on the device.
+        PackageManager pm = context.getPackageManager();
+        return pm.hasSystemFeature(PackageManager.FEATURE_WEBVIEW);
+    }
+
+    private static boolean checkCauseWasUnsupportedOperation(Throwable t) {
+        if (t == null) return false;
+        while (t.getCause() != null) {
+            t = t.getCause();
+        }
+        return t instanceof UnsupportedOperationException;
+    }
+
+    /**
+     * Some CTS tests (by design) first use android.webkit.* from a background thread. This helper
+     * allows the test to catch the UnsupportedOperationException from that background thread, and
+     * then query the result from the test main thread.
+     */
+    public static class NullWebViewFromThreadExceptionHandler
+            implements Thread.UncaughtExceptionHandler {
+        private Throwable mPendingException;
+
+        @Override
+        public void uncaughtException(Thread t, Throwable e) {
+            mPendingException = e;
+        }
+
+        public boolean isWebViewAvailable(Context context) {
+            return hasWebViewFeature(context) ||
+                    !checkCauseWasUnsupportedOperation(mPendingException);
+        }
+    }
+}
\ No newline at end of file
diff --git a/tests/src/android/webkit/cts/WebViewOnUiThread.java b/tests/src/android/webkit/cts/WebViewOnUiThread.java
index 3616655..f638ba8 100644
--- a/tests/src/android/webkit/cts/WebViewOnUiThread.java
+++ b/tests/src/android/webkit/cts/WebViewOnUiThread.java
@@ -241,6 +241,15 @@
         });
     }
 
+    public boolean canZoomIn() {
+        return getValue(new ValueGetter<Boolean>() {
+            @Override
+            public Boolean capture() {
+                return mWebView.canZoomIn();
+            }
+        });
+    }
+
     public boolean zoomIn() {
         return getValue(new ValueGetter<Boolean>() {
             @Override
diff --git a/tests/src/android/webkit/cts/WebViewStubActivity.java b/tests/src/android/webkit/cts/WebViewStubActivity.java
index 6a51bbe..62adc39 100644
--- a/tests/src/android/webkit/cts/WebViewStubActivity.java
+++ b/tests/src/android/webkit/cts/WebViewStubActivity.java
@@ -29,9 +29,13 @@
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.webview_layout);
-        mWebView = (WebView) findViewById(R.id.web_page);
+        try {
+            super.onCreate(savedInstanceState);
+            setContentView(R.layout.webview_layout);
+            mWebView = (WebView) findViewById(R.id.web_page);
+        } catch (Exception e) {
+            NullWebViewUtils.determineIfWebViewAvailable(this, e);
+        }
     }
 
     public WebView getWebView() {
@@ -40,11 +44,13 @@
 
     @Override
     public void onDestroy() {
-        ViewParent parent =  mWebView.getParent();
-        if (parent instanceof ViewGroup) {
-            ((ViewGroup) parent).removeView(mWebView);
+        if (mWebView != null) {
+            ViewParent parent =  mWebView.getParent();
+            if (parent instanceof ViewGroup) {
+                ((ViewGroup) parent).removeView(mWebView);
+            }
+            mWebView.destroy();
         }
-        mWebView.destroy();
         super.onDestroy();
     }
 }
diff --git a/tests/src/android/widget/cts/RemoteViewsStubActivity.java b/tests/src/android/widget/cts/RemoteViewsStubActivity.java
index f1c0a72..f16ae13 100644
--- a/tests/src/android/widget/cts/RemoteViewsStubActivity.java
+++ b/tests/src/android/widget/cts/RemoteViewsStubActivity.java
@@ -20,6 +20,7 @@
 
 import android.app.Activity;
 import android.os.Bundle;
+import android.webkit.cts.NullWebViewUtils;
 import android.widget.RemoteViews;
 
 /**
@@ -28,7 +29,11 @@
 public class RemoteViewsStubActivity extends Activity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.remoteviews_host);
+        try {
+            super.onCreate(savedInstanceState);
+            setContentView(R.layout.remoteviews_host);
+        } catch (Exception e) {
+            NullWebViewUtils.determineIfWebViewAvailable(this, e);
+        }
     }
 }
diff --git a/tests/tests/accessibilityservice/AndroidManifest.xml b/tests/tests/accessibilityservice/AndroidManifest.xml
index ac75553..ed94f9c 100644
--- a/tests/tests/accessibilityservice/AndroidManifest.xml
+++ b/tests/tests/accessibilityservice/AndroidManifest.xml
@@ -22,8 +22,6 @@
   <uses-sdk android:minSdkVersion="18"
           android:targetSdkVersion="18" />
 
-  <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
-
   <application android:theme="@android:style/Theme.Holo.NoActionBar" >
 
       <uses-library android:name="android.test.runner"/>
@@ -41,7 +39,7 @@
               android:name="android.accessibilityservice.cts.AccessibilityFocusAndInputFocusSyncActivity"/>
 
       <activity android:label="@string/accessibility_text_traversal_test_activity"
-              android:name="android.accessibilityservice.cts.AccessibilityTextTraversalActivity"/> 
+              android:name="android.accessibilityservice.cts.AccessibilityTextTraversalActivity"/>
 
   </application>
 
diff --git a/tests/tests/accessibilityservice/res/layout/accessibility_text_traversal_test.xml b/tests/tests/accessibilityservice/res/layout/accessibility_text_traversal_test.xml
index f86f00f..9906227 100644
--- a/tests/tests/accessibilityservice/res/layout/accessibility_text_traversal_test.xml
+++ b/tests/tests/accessibilityservice/res/layout/accessibility_text_traversal_test.xml
@@ -26,29 +26,32 @@
        android:id="@+id/view"
        android:layout_width="50dip"
        android:layout_height="50dip"
+       android:visibility="gone"
        />
 
    <TextView
        android:id="@+id/text"
-       android:layout_width="200dip"
-       android:layout_height="200dip"
+       android:layout_width="80dip"
+       android:layout_height="80dip"
        android:includeFontPadding="false"
-       android:textSize="14dip"
+       android:textSize="10dip"
        android:textStyle="normal"
        android:fontFamily="sans-serif"
+       android:visibility="gone"
        />
 
    <EditText
        android:id="@+id/edit"
-       android:layout_width="200dip"
-       android:layout_height="200dip"
+       android:layout_width="80dip"
+       android:layout_height="80dip"
        android:maxLines="1000"
        android:scrollbars="vertical"
        android:focusable="false"
        android:includeFontPadding="false"
-       android:textSize="18dip"
+       android:textSize="10dip"
        android:textStyle="normal"
        android:fontFamily="sans-serif"
+       android:visibility="gone"
        />
 
 </LinearLayout>
diff --git a/tests/tests/accessibilityservice/res/layout/accessibility_view_tree_reporting_test.xml b/tests/tests/accessibilityservice/res/layout/accessibility_view_tree_reporting_test.xml
index fe420bc..0dbd62a 100644
--- a/tests/tests/accessibilityservice/res/layout/accessibility_view_tree_reporting_test.xml
+++ b/tests/tests/accessibilityservice/res/layout/accessibility_view_tree_reporting_test.xml
@@ -29,19 +29,22 @@
               android:id="@+id/firstTextView"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
-              android:text="@string/firstTextView" />
+              android:text="@string/firstTextView"
+              android:textSize="10dip" />
 
           <EditText
               android:id="@+id/firstEditText"
-              android:layout_width="200dip"
+              android:layout_width="20dip"
               android:layout_height="wrap_content"
-              android:contentDescription="@string/firstEditText" />
+              android:contentDescription="@string/firstEditText"
+              android:textSize="10dip" />
 
           <Button
               android:id="@+id/firstButton"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
-              android:text="@string/firstButton" />
+              android:text="@string/firstButton"
+              android:textSize="10dip" />
 
       </LinearLayout>
 
@@ -68,19 +71,22 @@
               android:id="@+id/secondTextView"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
-              android:text="@string/secondTextView" />
+              android:text="@string/secondTextView"
+              android:textSize="10dip" />
 
           <EditText
               android:id="@+id/secondEditText"
-              android:layout_width="200dip"
+              android:layout_width="20dip"
               android:layout_height="wrap_content"
-              android:contentDescription="@string/secondEditText" />
+              android:contentDescription="@string/secondEditText"
+              android:textSize="10dip" />
 
           <Button
               android:id="@+id/secondButton"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
-              android:text="@string/secondButton" />
+              android:text="@string/secondButton"
+              android:textSize="10dip" />
 
       </LinearLayout>
 
diff --git a/tests/tests/accessibilityservice/res/layout/end_to_end_test.xml b/tests/tests/accessibilityservice/res/layout/end_to_end_test.xml
index 351ea24..79f87dc 100644
--- a/tests/tests/accessibilityservice/res/layout/end_to_end_test.xml
+++ b/tests/tests/accessibilityservice/res/layout/end_to_end_test.xml
@@ -18,7 +18,8 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:layout_width="fill_parent"
               android:layout_height="fill_parent"
-              android:gravity="center" android:orientation="vertical">
+              android:gravity="center"
+              android:orientation="vertical">
 
     <ListView android:id="@+id/listview"
               android:layout_width="fill_parent"
diff --git a/tests/tests/accessibilityservice/res/layout/query_window_test.xml b/tests/tests/accessibilityservice/res/layout/query_window_test.xml
index 37c0ef0..001b024 100644
--- a/tests/tests/accessibilityservice/res/layout/query_window_test.xml
+++ b/tests/tests/accessibilityservice/res/layout/query_window_test.xml
@@ -17,6 +17,7 @@
 */
 -->
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/added_content"
     android:orientation="vertical"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
@@ -29,21 +30,24 @@
         >
         <Button
             android:id="@+id/button1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="20dip"
+            android:layout_height="20dip"
             android:text="@string/button1"
+            android:textSize="10dip"
         />
         <Button
             android:id="@+id/button2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="20dip"
+            android:layout_height="20dip"
             android:text="@string/button2"
+            android:textSize="10dip"
         />
         <Button
             android:id="@+id/button3"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="20dip"
+            android:layout_height="20dip"
             android:text="@string/button3"
+            android:textSize="10dip"
         />
     </LinearLayout>
 
@@ -54,21 +58,24 @@
         >
         <Button
             android:id="@+id/button4"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="20dip"
+            android:layout_height="20dip"
             android:text="@string/button4"
+            android:textSize="10dip"
         />
         <Button
             android:id="@+id/button5"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="20dip"
+            android:layout_height="20dip"
             android:text="@string/button5"
+            android:textSize="10dip"
         />
         <Button
             android:id="@+id/button6"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="20dip"
+            android:layout_height="20dip"
             android:text="@string/button6"
+            android:textSize="10dip"
             android:contentDescription="@string/contentDescription"
         />
     </LinearLayout>
@@ -80,21 +87,24 @@
         >
         <Button
             android:id="@+id/button7"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="20dip"
+            android:layout_height="20dip"
             android:text="@string/button7"
+            android:textSize="10dip"
         />
         <Button
             android:id="@+id/button8"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="20dip"
+            android:layout_height="20dip"
             android:text="@string/button8"
+            android:textSize="10dip"
         />
         <Button
             android:id="@+id/button9"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="20dip"
+            android:layout_height="20dip"
             android:text="@string/button9"
+            android:textSize="10dip"
         />
     </LinearLayout>
 
diff --git a/tests/tests/accessibilityservice/res/values/strings.xml b/tests/tests/accessibilityservice/res/values/strings.xml
index 97ddb7c..0b97d3f 100644
--- a/tests/tests/accessibilityservice/res/values/strings.xml
+++ b/tests/tests/accessibilityservice/res/values/strings.xml
@@ -52,34 +52,34 @@
     <string name="accessibility_query_window_test_activity">Query window test</string>
 
     <!-- String Button1 text -->
-    <string name="button1">Button1</string>
+    <string name="button1">B1</string>
 
     <!-- String Button2 text -->
-    <string name="button2">Button2</string>
+    <string name="button2">B2</string>
 
     <!-- String Button3 text -->
-    <string name="button3">Button3</string>
+    <string name="button3">B3</string>
 
     <!-- String Button4 text -->
-    <string name="button4">Button4</string>
+    <string name="button4">B4</string>
 
     <!-- String Button5 text -->
-    <string name="button5">Button5</string>
+    <string name="button5">B5</string>
 
     <!-- String Button6 text -->
-    <string name="button6">Button6</string>
+    <string name="button6">B6</string>
 
     <!-- String with content description for Button6 -->
     <string name="contentDescription">contentDescription</string>
 
     <!-- String Button7 text -->
-    <string name="button7">Button7</string>
+    <string name="button7">B7</string>
 
     <!-- String Button8 text -->
-    <string name="button8">Button8</string>
+    <string name="button8">B8</string>
 
     <!-- String Button9 text -->
-    <string name="button9">Button9</string>
+    <string name="button9">B9</string>
 
     <!-- AccessibilityFocusTest -->
 
@@ -87,37 +87,37 @@
     <string name="accessibility_view_tree_reporting_test_activity">Accessibility view three reporting test</string>
 
     <!-- String root LinearLayout text -->
-    <string name="rootLinearLayout">rootLinearLayout</string>
+    <string name="rootLinearLayout">rLL</string>
 
     <!-- String first FrameLayout text -->
-    <string name="firstFrameLayout">firstFrameLayout</string>
+    <string name="firstFrameLayout">fFL</string>
 
     <!-- String first LinearLayout text -->
-    <string name="firstLinearLayout">firstLinearLayout</string>
+    <string name="firstLinearLayout">fLL</string>
 
     <!-- String first TextView text -->
-    <string name="firstTextView">firstTextView</string>
+    <string name="firstTextView">fTV</string>
 
     <!-- String first EditText text -->
-    <string name="firstEditText">firstEditText</string>
+    <string name="firstEditText">fET</string>
 
     <!-- String first Button text -->
-    <string name="firstButton">firstButton</string>
+    <string name="firstButton">fB</string>
 
     <!-- String second FrameLayout text -->
-    <string name="secondFrameLayout">secondFrameLayout</string>
+    <string name="secondFrameLayout">sFL</string>
 
     <!-- String second LinearLayout text -->
-    <string name="secondLinearLayout">secondLinearLayout</string>
+    <string name="secondLinearLayout">sLL</string>
 
     <!-- String second TextView text -->
-    <string name="secondTextView">secondTextView</string>
+    <string name="secondTextView">sTV</string>
 
     <!-- String second EditText text -->
-    <string name="secondEditText">secondEditText</string>
+    <string name="secondEditText">sET</string>
 
     <!-- String second Button text -->
-    <string name="secondButton">secondButton</string>
+    <string name="secondButton">sB</string>
 
     <!-- String title of the accessibility focus and input focus sync test activity -->
     <string name="accessibility_focus_and_input_focus_sync_test_activity">Accessibility focus and input focus sync test</string>
@@ -126,14 +126,11 @@
     <string name="accessibility_text_traversal_test_activity">Accessibility text traversal test</string>
 
     <string name="android_wiki_short">
-        Android is a Linux-based operating system for mobile devices</string>
+        Android is a\nLinux-based\noperating</string>
 
     <string name="android_wiki">
         Android is a Linux-based operating system for mobile devices such as smartphones and tablet
-        computers. It is developed by the Open Handset Alliance, led by Google, and other companies.
-        Google purchased the initial developer of the software, Android Inc., in 2005. The
-        unveiling of the Android distribution in 2007 was announced with the founding of the Open
-        Handset Alliance, a consortium of 86 hardware, software, and telecommunication </string>
+        computers. It is developed by the Open Handset Alliance, more</string>
 
     <string name="a_b">A B</string>
 
@@ -142,12 +139,7 @@
     <string name="foo_bar_baz">Foo bar baz.</string>
 
     <string name="android_wiki_paragraphs">
-        \n\nAndroid is a Linux-based operating system for mobile devices such as smartphones and tablet
-        computers.\n\n It is developed by the Open Handset Alliance, led by Google, and other companies.
-        Google purchased the initial developer of the software, Android Inc., in 2005.\n The
-        unveiling of the Android distribution in 2007 was announced with the founding of the Open
-        Handset Alliance, a consortium of 86 hardware, software, and telecommunication companies
-        devoted to advancing open standards for mobile devices. Google releases the
-        Android code as open-source, under the Apache License.\n\n</string>
+        \n\nAndroid is a\n\n It is developed\n The
+        unveiling\n\n</string>
 
 </resources>
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityActivityTestCase.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityActivityTestCase.java
index c7e4f4c..c121071 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityActivityTestCase.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityActivityTestCase.java
@@ -22,12 +22,13 @@
 import android.test.ActivityInstrumentationTestCase2;
 import android.view.accessibility.AccessibilityEvent;
 
+import java.util.concurrent.TimeoutException;
+
 /**
  * Base text case for testing accessibility APIs by instrumenting an Activity.
  */
 public abstract class AccessibilityActivityTestCase<T extends Activity>
         extends ActivityInstrumentationTestCase2<T> {
-
     /**
      * Timeout required for pending Binder calls or event processing to
      * complete.
@@ -37,7 +38,7 @@
     /**
      * The timeout since the last accessibility event to consider the device idle.
      */
-    public static final long TIMEOUT_ACCESSIBILITY_STATE_IDLE = 200;
+    public static final long TIMEOUT_ACCESSIBILITY_STATE_IDLE = 500;
 
     /**
      * @param activityClass
@@ -55,11 +56,20 @@
         info.flags &= ~AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;
         getInstrumentation().getUiAutomation().setServiceInfo(info);
 
+        startActivityAndWaitForFirstEvent();
+
+        waitForIdle();
+    }
+
+    /**
+     * Waits for the UI do be idle.
+     *
+     * @throws TimeoutException if idle cannot be detected.
+     */
+    public void waitForIdle() throws TimeoutException {
         getInstrumentation().getUiAutomation().waitForIdle(
                 TIMEOUT_ACCESSIBILITY_STATE_IDLE,
                 TIMEOUT_ASYNC_PROCESSING);
-
-        startActivityAndWaitForFirstEvent();
     }
 
     /**
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndActivity.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndActivity.java
index 12bcd96..157a3dc 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndActivity.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndActivity.java
@@ -18,7 +18,6 @@
 
 import com.android.cts.accessibilityservice.R;
 
-import android.app.Activity;
 import android.os.Bundle;
 import android.view.View;
 import android.view.ViewGroup;
@@ -28,11 +27,11 @@
 import android.widget.TextView;
 
 /**
- * This class is an {@link Activity} used to perform end-to-end
+ * This class is an {@link android.app.Activity} used to perform end-to-end
  * testing of the accessibility feature by interaction with the
  * UI widgets.
  */
-public class AccessibilityEndToEndActivity extends Activity {
+public class AccessibilityEndToEndActivity extends AccessibilityTestActivity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java
index 7e05e32..f0f0dd7 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityEndToEndTest.java
@@ -368,7 +368,6 @@
             && first.getCurrentItemIndex() == second.getCurrentItemIndex()
             && first.isEnabled() == second.isEnabled()
             && first.getFromIndex() == second.getFromIndex()
-            && first.isFullScreen() == second.isFullScreen()
             && first.getItemCount() == second.getItemCount()
             && first.isPassword() == second.isPassword()
             && first.getRemovedCount() == second.getRemovedCount()
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityFocusAndInputFocusSyncActivity.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityFocusAndInputFocusSyncActivity.java
index cdd2e42..46f04aa 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityFocusAndInputFocusSyncActivity.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityFocusAndInputFocusSyncActivity.java
@@ -14,7 +14,6 @@
 
 package android.accessibilityservice.cts;
 
-import android.app.Activity;
 import android.os.Bundle;
 
 import com.android.cts.accessibilityservice.R;
@@ -26,7 +25,7 @@
  * this activity is for verifying the the sync between accessibility
  * and input focus.
  */
-public class AccessibilityFocusAndInputFocusSyncActivity extends Activity {
+public class AccessibilityFocusAndInputFocusSyncActivity extends AccessibilityTestActivity {
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTestActivity.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTestActivity.java
new file mode 100644
index 0000000..4d9b97d
--- /dev/null
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTestActivity.java
@@ -0,0 +1,30 @@
+/**
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.accessibilityservice.cts;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.WindowManager;
+
+public abstract class AccessibilityTestActivity extends Activity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
+                | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
+    }
+}
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalActivity.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalActivity.java
index 7c9b45a..4a4a4ba 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalActivity.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalActivity.java
@@ -14,7 +14,6 @@
 
 package android.accessibilityservice.cts;
 
-import android.app.Activity;
 import android.os.Bundle;
 
 import com.android.cts.accessibilityservice.R;
@@ -23,7 +22,7 @@
  * Activity for testing the accessibility APIs for traversing the
  * text content of a View at several granularities.
  */
-public class AccessibilityTextTraversalActivity extends Activity {
+public class AccessibilityTextTraversalActivity extends AccessibilityTestActivity {
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java
index cbaf5d2..bdc0cd5 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java
@@ -15,6 +15,7 @@
 package android.accessibilityservice.cts;
 
 import android.app.UiAutomation;
+import android.content.pm.PackageManager;
 import android.os.Bundle;
 import android.test.suitebuilder.annotation.MediumTest;
 import android.text.Selection;
@@ -46,6 +47,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                view.setVisibility(View.VISIBLE);
                 view.setContentDescription(getString(R.string.a_b));
             }
         });
@@ -260,6 +262,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                view.setVisibility(View.VISIBLE);
                 view.setContentDescription(getString(R.string.foo_bar_baz));
             }
         });
@@ -474,6 +477,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                textView.setVisibility(View.VISIBLE);
                 textView.setText(getString(R.string.a_b));
             }
         });
@@ -722,6 +726,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                editText.setVisibility(View.VISIBLE);
                 editText.setText(getString(R.string.a_b));
                 Selection.removeSelection(editText.getText());
             }
@@ -1220,6 +1225,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                textView.setVisibility(View.VISIBLE);
                 textView.setText(getString(R.string.foo_bar_baz));
             }
         });
@@ -1463,12 +1469,12 @@
     @MediumTest
     public void testActionNextAndPreviousAtGranularityWordOverEditTextWithContentDescription()
             throws Exception {
-
         final EditText editText = (EditText) getActivity().findViewById(R.id.edit);
 
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                editText.setVisibility(View.VISIBLE);
                 editText.setText(getString(R.string.foo_bar_baz));
                 editText.setContentDescription(getString(R.string.android_wiki));
             }
@@ -1723,6 +1729,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                editText.setVisibility(View.VISIBLE);
                 editText.setText(getString(R.string.foo_bar_baz));
                 Selection.removeSelection(editText.getText());
             }
@@ -2217,6 +2224,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                textView.setVisibility(View.VISIBLE);
                 textView.setText(getString(R.string.android_wiki_short));
             }
         });
@@ -2258,7 +2266,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 25
+                        && event.getToIndex() == 13
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2268,8 +2276,8 @@
         assertNotNull(firstExpected);
 
         // Verify the selection position.
-        assertEquals(25, Selection.getSelectionStart(textView.getText()));
-        assertEquals(25, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(13, Selection.getSelectionStart(textView.getText()));
+        assertEquals(13, Selection.getSelectionEnd(textView.getText()));
 
         // Move to the next line and wait for an event.
         AccessibilityEvent secondExpected = getInstrumentation().getUiAutomation()
@@ -2292,8 +2300,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 25
-                        && event.getToIndex() == 53
+                        && event.getFromIndex() == 13
+                        && event.getToIndex() == 25
                         && event.getMovementGranularity() ==
                                  AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2303,8 +2311,8 @@
         assertNotNull(secondExpected);
 
         // Verify the selection position.
-        assertEquals(53, Selection.getSelectionStart(textView.getText()));
-        assertEquals(53, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(25, Selection.getSelectionStart(textView.getText()));
+        assertEquals(25, Selection.getSelectionEnd(textView.getText()));
 
         // Move to the next line and wait for an event.
         AccessibilityEvent thirdExpected = getInstrumentation().getUiAutomation()
@@ -2327,8 +2335,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 53
-                        && event.getToIndex() == 60
+                        && event.getFromIndex() == 25
+                        && event.getToIndex() == 34
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2338,16 +2346,16 @@
         assertNotNull(thirdExpected);
 
         // Verify the selection position.
-        assertEquals(60, Selection.getSelectionStart(textView.getText()));
-        assertEquals(60, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(34, Selection.getSelectionStart(textView.getText()));
+        assertEquals(34, Selection.getSelectionEnd(textView.getText()));
 
         // Make sure there is no next.
         assertFalse(text.performAction(
                 AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments));
 
         // Verify the selection position.
-        assertEquals(60, Selection.getSelectionStart(textView.getText()));
-        assertEquals(60, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(34, Selection.getSelectionStart(textView.getText()));
+        assertEquals(34, Selection.getSelectionEnd(textView.getText()));
 
         // Move to the previous line and wait for an event.
         AccessibilityEvent fourthExpected = getInstrumentation().getUiAutomation()
@@ -2370,8 +2378,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 53
-                        && event.getToIndex() == 60
+                        && event.getFromIndex() == 25
+                        && event.getToIndex() == 34
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2381,8 +2389,8 @@
         assertNotNull(fourthExpected);
 
         // Verify the selection position.
-        assertEquals(53, Selection.getSelectionStart(textView.getText()));
-        assertEquals(53, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(25, Selection.getSelectionStart(textView.getText()));
+        assertEquals(25, Selection.getSelectionEnd(textView.getText()));
 
         // Move to the previous line and wait for an event.
         AccessibilityEvent fifthExpected = getInstrumentation().getUiAutomation()
@@ -2405,8 +2413,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 25
-                        && event.getToIndex() == 53
+                        && event.getFromIndex() == 13
+                        && event.getToIndex() == 25
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2416,8 +2424,8 @@
         assertNotNull(fifthExpected);
 
         // Verify the selection position.
-        assertEquals(25, Selection.getSelectionStart(textView.getText()));
-        assertEquals(25, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(13, Selection.getSelectionStart(textView.getText()));
+        assertEquals(13, Selection.getSelectionEnd(textView.getText()));
 
         // Move to the previous line and wait for an event.
         AccessibilityEvent sixthExpected = getInstrumentation().getUiAutomation()
@@ -2441,7 +2449,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 25
+                        && event.getToIndex() == 13
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2470,6 +2478,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                editText.setVisibility(View.VISIBLE);
                 editText.setText(getString(R.string.android_wiki_short));
                 Selection.removeSelection(editText.getText());
             }
@@ -2513,7 +2522,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 19
+                        && event.getToIndex() == 13
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2524,7 +2533,7 @@
 
         // Verify the selection position.
         assertEquals(0, Selection.getSelectionStart(editText.getText()));
-        assertEquals(19, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(13, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next line and wait for an event.
         AccessibilityEvent secondExpected = getInstrumentation().getUiAutomation()
@@ -2547,8 +2556,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 19
-                        && event.getToIndex() == 35
+                        && event.getFromIndex() == 13
+                        && event.getToIndex() == 25
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2559,7 +2568,7 @@
 
         // Verify the selection position.
         assertEquals(0, Selection.getSelectionStart(editText.getText()));
-        assertEquals(35, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(25, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next line and wait for an event.
         AccessibilityEvent thirdExpected = getInstrumentation().getUiAutomation()
@@ -2582,8 +2591,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 35
-                        && event.getToIndex() == 53
+                        && event.getFromIndex() == 25
+                        && event.getToIndex() == 34
                         && event.getMovementGranularity() ==
                                  AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2594,7 +2603,7 @@
 
         // Verify the selection position.
         assertEquals(0, Selection.getSelectionStart(editText.getText()));
-        assertEquals(53, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(34, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous line and wait for an event.
         AccessibilityEvent fourthExpected = getInstrumentation().getUiAutomation()
@@ -2617,8 +2626,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 35
-                        && event.getToIndex() == 53
+                        && event.getFromIndex() == 25
+                        && event.getToIndex() == 34
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2629,7 +2638,7 @@
 
         // Verify the selection position.
         assertEquals(0, Selection.getSelectionStart(editText.getText()));
-        assertEquals(35, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(25, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous line and wait for an event.
         AccessibilityEvent fifthExpected = getInstrumentation().getUiAutomation()
@@ -2652,8 +2661,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 19
-                        && event.getToIndex() == 35
+                        && event.getFromIndex() == 13
+                        && event.getToIndex() == 25
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2664,7 +2673,7 @@
 
         // Verify the selection position.
         assertEquals(0, Selection.getSelectionStart(editText.getText()));
-        assertEquals(19, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(13, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous line and wait for an event.
         AccessibilityEvent sixthExpected = getInstrumentation().getUiAutomation()
@@ -2688,7 +2697,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 19
+                        && event.getToIndex() == 13
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2720,14 +2729,14 @@
 
         // Put selection at the end of the text.
         Bundle setSelectionArgs = new Bundle();
-        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT, 53);
-        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT, 53);
+        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT, 34);
+        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT, 34);
         assertTrue(text.performAction(
                 AccessibilityNodeInfo.ACTION_SET_SELECTION, setSelectionArgs));
 
         // Verify the selection position.
-        assertEquals(53, Selection.getSelectionStart(editText.getText()));
-        assertEquals(53, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(34, Selection.getSelectionStart(editText.getText()));
+        assertEquals(34, Selection.getSelectionEnd(editText.getText()));
 
         // Unocus the view so we can hide the keyboard.
         getInstrumentation().runOnMainSync(new Runnable() {
@@ -2759,8 +2768,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 35
-                        && event.getToIndex() == 53
+                        && event.getFromIndex() == 25
+                        && event.getToIndex() == 34
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2770,8 +2779,8 @@
         assertNotNull(seventhExpected);
 
         // Verify the selection position.
-        assertEquals(53, Selection.getSelectionStart(editText.getText()));
-        assertEquals(35, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(34, Selection.getSelectionStart(editText.getText()));
+        assertEquals(25, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous line and wait for an event.
         AccessibilityEvent eightExpected = getInstrumentation().getUiAutomation()
@@ -2794,8 +2803,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 19
-                        && event.getToIndex() == 35
+                        && event.getFromIndex() == 13
+                        && event.getToIndex() == 25
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2805,8 +2814,8 @@
         assertNotNull(eightExpected);
 
         // Verify the selection position.
-        assertEquals(53, Selection.getSelectionStart(editText.getText()));
-        assertEquals(19, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(34, Selection.getSelectionStart(editText.getText()));
+        assertEquals(13, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous line and wait for an event.
         AccessibilityEvent ninethExpected = getInstrumentation().getUiAutomation()
@@ -2830,7 +2839,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 19
+                        && event.getToIndex() == 13
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2840,7 +2849,7 @@
         assertNotNull(ninethExpected);
 
         // Verify the selection position.
-        assertEquals(53, Selection.getSelectionStart(editText.getText()));
+        assertEquals(34, Selection.getSelectionStart(editText.getText()));
         assertEquals(0, Selection.getSelectionEnd(editText.getText()));
 
         // Make sure there is no previous.
@@ -2848,7 +2857,7 @@
                 AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, arguments));
 
         // Verify the selection position.
-        assertEquals(53, Selection.getSelectionStart(editText.getText()));
+        assertEquals(34, Selection.getSelectionStart(editText.getText()));
         assertEquals(0, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next line and wait for an event.
@@ -2873,7 +2882,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 19
+                        && event.getToIndex() == 13
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2883,8 +2892,8 @@
         assertNotNull(tenthExpected);
 
         // Verify the selection position.
-        assertEquals(53, Selection.getSelectionStart(editText.getText()));
-        assertEquals(19, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(34, Selection.getSelectionStart(editText.getText()));
+        assertEquals(13, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next line and wait for an event.
         AccessibilityEvent eleventhExpected = getInstrumentation().getUiAutomation()
@@ -2907,8 +2916,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 19
-                        && event.getToIndex() == 35
+                        && event.getFromIndex() == 13
+                        && event.getToIndex() == 25
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2918,8 +2927,8 @@
         assertNotNull(eleventhExpected);
 
         // Verify the selection position.
-        assertEquals(53, Selection.getSelectionStart(editText.getText()));
-        assertEquals(35, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(34, Selection.getSelectionStart(editText.getText()));
+        assertEquals(25, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next line and wait for an event.
         AccessibilityEvent twelvethExpected = getInstrumentation().getUiAutomation()
@@ -2942,8 +2951,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_short))
-                        && event.getFromIndex() == 35
-                        && event.getToIndex() == 53
+                        && event.getFromIndex() == 25
+                        && event.getToIndex() == 34
                         && event.getMovementGranularity() ==
                                  AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE);
             }
@@ -2953,8 +2962,8 @@
         assertNotNull(twelvethExpected);
 
         // Verify the selection position.
-        assertEquals(53, Selection.getSelectionStart(editText.getText()));
-        assertEquals(53, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(34, Selection.getSelectionStart(editText.getText()));
+        assertEquals(34, Selection.getSelectionEnd(editText.getText()));
     }
 
     @MediumTest
@@ -2964,6 +2973,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                editText.setVisibility(View.VISIBLE);
                 editText.setText(getString(R.string.android_wiki));
                 Selection.removeSelection(editText.getText());
             }
@@ -3006,7 +3016,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 139
+                        && event.getToIndex() == 53
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3016,8 +3026,8 @@
         assertNotNull(firstExpected);
 
         // Verify the selection position.
-        assertEquals(139, Selection.getSelectionStart(editText.getText()));
-        assertEquals(139, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(53, Selection.getSelectionStart(editText.getText()));
+        assertEquals(53, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next page and wait for an event.
         AccessibilityEvent secondExpected = getInstrumentation().getUiAutomation()
@@ -3040,8 +3050,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 139
-                        && event.getToIndex() == 285
+                        && event.getFromIndex() == 53
+                        && event.getToIndex() == 103
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3051,8 +3061,8 @@
         assertNotNull(secondExpected);
 
         // Verify the selection position.
-        assertEquals(285, Selection.getSelectionStart(editText.getText()));
-        assertEquals(285, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(103, Selection.getSelectionStart(editText.getText()));
+        assertEquals(103, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next page and wait for an event.
         AccessibilityEvent thirdExpected = getInstrumentation().getUiAutomation()
@@ -3075,8 +3085,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 285
-                        && event.getToIndex() == 436
+                        && event.getFromIndex() == 103
+                        && event.getToIndex() == 153
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3086,16 +3096,16 @@
         assertNotNull(thirdExpected);
 
         // Verify the selection position.
-        assertEquals(436, Selection.getSelectionStart(editText.getText()));
-        assertEquals(436, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(153, Selection.getSelectionStart(editText.getText()));
+        assertEquals(153, Selection.getSelectionEnd(editText.getText()));
 
         // Make sure there is no next.
         assertFalse(text.performAction(
                 AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments));
 
         // Verify the selection position.
-        assertEquals(436, Selection.getSelectionStart(editText.getText()));
-        assertEquals(436, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(153, Selection.getSelectionStart(editText.getText()));
+        assertEquals(153, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous page and wait for an event.
         AccessibilityEvent fourthExpected = getInstrumentation().getUiAutomation()
@@ -3118,8 +3128,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 285
-                        && event.getToIndex() == 436
+                        && event.getFromIndex() == 103
+                        && event.getToIndex() == 153
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3129,8 +3139,8 @@
         assertNotNull(fourthExpected);
 
         // Verify the selection position.
-        assertEquals(285, Selection.getSelectionStart(editText.getText()));
-        assertEquals(285, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(103, Selection.getSelectionStart(editText.getText()));
+        assertEquals(103, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous page and wait for an event.
         AccessibilityEvent fifthExpected = getInstrumentation().getUiAutomation()
@@ -3153,8 +3163,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 139
-                        && event.getToIndex() == 285
+                        && event.getFromIndex() == 53
+                        && event.getToIndex() == 103
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3164,8 +3174,8 @@
         assertNotNull(fifthExpected);
 
         // Verify the selection position.
-        assertEquals(139, Selection.getSelectionStart(editText.getText()));
-        assertEquals(139, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(53, Selection.getSelectionStart(editText.getText()));
+        assertEquals(53, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous page and wait for an event.
         AccessibilityEvent sixthExpected = getInstrumentation().getUiAutomation()
@@ -3189,7 +3199,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 139
+                        && event.getToIndex() == 53
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3218,6 +3228,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                editText.setVisibility(View.VISIBLE);
                 editText.setText(getString(R.string.android_wiki));
                 Selection.removeSelection(editText.getText());
             }
@@ -3261,7 +3272,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 139
+                        && event.getToIndex() == 53
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3272,7 +3283,7 @@
 
         // Verify the selection position.
         assertEquals(0, Selection.getSelectionStart(editText.getText()));
-        assertEquals(139, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(53, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next page and wait for an event.
         AccessibilityEvent secondExpected = getInstrumentation().getUiAutomation()
@@ -3295,8 +3306,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 139
-                        && event.getToIndex() == 285
+                        && event.getFromIndex() == 53
+                        && event.getToIndex() == 103
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3307,7 +3318,7 @@
 
         // Verify the selection position.
         assertEquals(0, Selection.getSelectionStart(editText.getText()));
-        assertEquals(285, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(103, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next page and wait for an event.
         AccessibilityEvent thirdExpected = getInstrumentation().getUiAutomation()
@@ -3330,8 +3341,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 285
-                        && event.getToIndex() == 436
+                        && event.getFromIndex() == 103
+                        && event.getToIndex() == 153
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3342,7 +3353,7 @@
 
         // Verify the selection position.
         assertEquals(0, Selection.getSelectionStart(editText.getText()));
-        assertEquals(436, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(153, Selection.getSelectionEnd(editText.getText()));
 
         // Make sure there is no next.
         assertFalse(text.performAction(
@@ -3369,8 +3380,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 285
-                        && event.getToIndex() == 436
+                        && event.getFromIndex() == 103
+                        && event.getToIndex() == 153
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3381,7 +3392,7 @@
 
         // Verify the selection position.
         assertEquals(0, Selection.getSelectionStart(editText.getText()));
-        assertEquals(285, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(103, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous page and wait for an event.
         AccessibilityEvent fifthExpected = getInstrumentation().getUiAutomation()
@@ -3404,8 +3415,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 139
-                        && event.getToIndex() == 285
+                        && event.getFromIndex() == 53
+                        && event.getToIndex() == 103
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3416,7 +3427,7 @@
 
         // Verify the selection position.
         assertEquals(0, Selection.getSelectionStart(editText.getText()));
-        assertEquals(139, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(53, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous page and wait for an event.
         AccessibilityEvent sixthExpected = getInstrumentation().getUiAutomation()
@@ -3440,7 +3451,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 139
+                        && event.getToIndex() == 53
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3472,14 +3483,14 @@
 
         // Put selection at the end of the text.
         Bundle setSelectionArgs = new Bundle();
-        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT, 436);
-        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT, 436);
+        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT, 153);
+        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT, 153);
         assertTrue(text.performAction(
                 AccessibilityNodeInfo.ACTION_SET_SELECTION, setSelectionArgs));
 
         // Verify the selection position.
-        assertEquals(436, Selection.getSelectionStart(editText.getText()));
-        assertEquals(436, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(153, Selection.getSelectionStart(editText.getText()));
+        assertEquals(153, Selection.getSelectionEnd(editText.getText()));
 
         // Unfocus the view so we can hide the soft-keyboard.
         getInstrumentation().runOnMainSync(new Runnable() {
@@ -3511,8 +3522,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 285
-                        && event.getToIndex() == 436
+                        && event.getFromIndex() == 103
+                        && event.getToIndex() == 153
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3522,8 +3533,8 @@
         assertNotNull(seventhExpected);
 
         // Verify the selection position.
-        assertEquals(436, Selection.getSelectionStart(editText.getText()));
-        assertEquals(285, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(153, Selection.getSelectionStart(editText.getText()));
+        assertEquals(103, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous page and wait for an event.
         AccessibilityEvent eightExpected = getInstrumentation().getUiAutomation()
@@ -3546,8 +3557,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 139
-                        && event.getToIndex() == 285
+                        && event.getFromIndex() == 53
+                        && event.getToIndex() == 103
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3557,8 +3568,8 @@
         assertNotNull(eightExpected);
 
         // Verify the selection position.
-        assertEquals(436, Selection.getSelectionStart(editText.getText()));
-        assertEquals(139, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(153, Selection.getSelectionStart(editText.getText()));
+        assertEquals(53, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous page and wait for an event.
         AccessibilityEvent ninethExpected = getInstrumentation().getUiAutomation()
@@ -3582,7 +3593,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 139
+                        && event.getToIndex() == 53
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3592,7 +3603,7 @@
         assertNotNull(ninethExpected);
 
         // Verify the selection position.
-        assertEquals(436, Selection.getSelectionStart(editText.getText()));
+        assertEquals(153, Selection.getSelectionStart(editText.getText()));
         assertEquals(0, Selection.getSelectionEnd(editText.getText()));
 
         // Make sure there is no previous.
@@ -3600,7 +3611,7 @@
                 AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, arguments));
 
         // Verify the selection position.
-        assertEquals(436, Selection.getSelectionStart(editText.getText()));
+        assertEquals(153, Selection.getSelectionStart(editText.getText()));
         assertEquals(0, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next page and wait for an event.
@@ -3625,7 +3636,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
                         && event.getFromIndex() == 0
-                        && event.getToIndex() == 139
+                        && event.getToIndex() == 53
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3635,8 +3646,8 @@
         assertNotNull(tenthExpected);
 
         // Verify the selection position.
-        assertEquals(436, Selection.getSelectionStart(editText.getText()));
-        assertEquals(139, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(153, Selection.getSelectionStart(editText.getText()));
+        assertEquals(53, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next page and wait for an event.
         AccessibilityEvent eleventhExpected = getInstrumentation().getUiAutomation()
@@ -3659,8 +3670,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 139
-                        && event.getToIndex() == 285
+                        && event.getFromIndex() == 53
+                        && event.getToIndex() == 103
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3670,8 +3681,8 @@
         assertNotNull(eleventhExpected);
 
         // Verify the selection position.
-        assertEquals(436, Selection.getSelectionStart(editText.getText()));
-        assertEquals(285, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(153, Selection.getSelectionStart(editText.getText()));
+        assertEquals(103, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next page and wait for an event.
         AccessibilityEvent twelvethExpected = getInstrumentation().getUiAutomation()
@@ -3694,8 +3705,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki))
-                        && event.getFromIndex() == 285
-                        && event.getToIndex() == 436
+                        && event.getFromIndex() == 103
+                        && event.getToIndex() == 153
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
             }
@@ -3705,8 +3716,8 @@
         assertNotNull(twelvethExpected);
 
         // Verify the selection position.
-        assertEquals(436, Selection.getSelectionStart(editText.getText()));
-        assertEquals(436, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(153, Selection.getSelectionStart(editText.getText()));
+        assertEquals(153, Selection.getSelectionEnd(editText.getText()));
     }
 
     @MediumTest
@@ -3716,13 +3727,14 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                textView.setVisibility(View.VISIBLE);
                 textView.setText(getString(R.string.android_wiki_paragraphs));
             }
         });
 
         final AccessibilityNodeInfo text = getInstrumentation().getUiAutomation()
                .getRootInActiveWindow().findAccessibilityNodeInfosByText(getString(
-                       R.string.android_wiki_short)).get(0);
+                       R.string.android_wiki_paragraphs)).get(0);
 
         final int granularities = text.getMovementGranularities();
         assertEquals(granularities, AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER
@@ -3757,7 +3769,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
                         && event.getFromIndex() == 2
-                        && event.getToIndex() == 104
+                        && event.getToIndex() == 14
                         && event.getMovementGranularity() ==
                                  AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -3767,8 +3779,8 @@
         assertNotNull(firstExpected);
 
         // Verify the selection position.
-        assertEquals(104, Selection.getSelectionStart(textView.getText()));
-        assertEquals(104, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(14, Selection.getSelectionStart(textView.getText()));
+        assertEquals(14, Selection.getSelectionEnd(textView.getText()));
 
         // Move to the next paragraph and wait for an event.
         AccessibilityEvent secondExpected = getInstrumentation().getUiAutomation()
@@ -3791,8 +3803,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 106
-                        && event.getToIndex() == 267
+                        && event.getFromIndex() == 16
+                        && event.getToIndex() == 32
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -3802,8 +3814,8 @@
         assertNotNull(secondExpected);
 
         // Verify the selection position.
-        assertEquals(267, Selection.getSelectionStart(textView.getText()));
-        assertEquals(267, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(32, Selection.getSelectionStart(textView.getText()));
+        assertEquals(32, Selection.getSelectionEnd(textView.getText()));
 
         // Move to the next paragraph and wait for an event.
         AccessibilityEvent thirdExpected = getInstrumentation().getUiAutomation()
@@ -3826,8 +3838,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 268
-                        && event.getToIndex() == 582
+                        && event.getFromIndex() == 33
+                        && event.getToIndex() == 47
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -3837,16 +3849,16 @@
         assertNotNull(thirdExpected);
 
         // Verify the selection position.
-        assertEquals(582, Selection.getSelectionStart(textView.getText()));
-        assertEquals(582, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(47, Selection.getSelectionStart(textView.getText()));
+        assertEquals(47, Selection.getSelectionEnd(textView.getText()));
 
         // Make sure there is no next.
         assertFalse(text.performAction(
                 AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments));
 
         // Verify the selection position.
-        assertEquals(582, Selection.getSelectionStart(textView.getText()));
-        assertEquals(582, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(47, Selection.getSelectionStart(textView.getText()));
+        assertEquals(47, Selection.getSelectionEnd(textView.getText()));
 
         // Move to the previous paragraph and wait for an event.
         AccessibilityEvent fourthExpected = getInstrumentation().getUiAutomation()
@@ -3869,8 +3881,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 268
-                        && event.getToIndex() == 582
+                        && event.getFromIndex() == 33
+                        && event.getToIndex() == 47
                         && event.getMovementGranularity() ==
                                  AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -3880,8 +3892,8 @@
         assertNotNull(fourthExpected);
 
         // Verify the selection position.
-        assertEquals(268, Selection.getSelectionStart(textView.getText()));
-        assertEquals(268, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(33, Selection.getSelectionStart(textView.getText()));
+        assertEquals(33, Selection.getSelectionEnd(textView.getText()));
 
         // Move to the previous paragraph and wait for an event.
         AccessibilityEvent fifthExpected = getInstrumentation().getUiAutomation()
@@ -3904,8 +3916,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 106
-                        && event.getToIndex() == 267
+                        && event.getFromIndex() == 16
+                        && event.getToIndex() == 32
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -3915,8 +3927,8 @@
         assertNotNull(fifthExpected);
 
         // Verify the selection position.
-        assertEquals(106, Selection.getSelectionStart(textView.getText()));
-        assertEquals(106, Selection.getSelectionEnd(textView.getText()));
+        assertEquals(16, Selection.getSelectionStart(textView.getText()));
+        assertEquals(16, Selection.getSelectionEnd(textView.getText()));
 
         // Move to the previous paragraph and wait for an event.
         AccessibilityEvent sixthExpected = getInstrumentation().getUiAutomation()
@@ -3940,7 +3952,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
                         && event.getFromIndex() == 2
-                        && event.getToIndex() == 104
+                        && event.getToIndex() == 14
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -3969,6 +3981,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                editText.setVisibility(View.VISIBLE);
                 editText.setText(getString(R.string.android_wiki_paragraphs));
                 Selection.removeSelection(editText.getText());
             }
@@ -3976,7 +3989,7 @@
 
         final AccessibilityNodeInfo text = getInstrumentation().getUiAutomation()
                .getRootInActiveWindow().findAccessibilityNodeInfosByText(getString(
-                       R.string.android_wiki_short)).get(0);
+                       R.string.android_wiki_paragraphs)).get(0);
 
         final int granularities = text.getMovementGranularities();
         assertEquals(granularities, AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER
@@ -4012,7 +4025,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
                         && event.getFromIndex() == 2
-                        && event.getToIndex() == 104
+                        && event.getToIndex() == 14
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4023,7 +4036,7 @@
 
         // Verify the selection position.
         assertEquals(2, Selection.getSelectionStart(editText.getText()));
-        assertEquals(104, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(14, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next paragraph and wait for an event.
         AccessibilityEvent secondExpected = getInstrumentation().getUiAutomation()
@@ -4046,8 +4059,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 106
-                        && event.getToIndex() == 267
+                        && event.getFromIndex() == 16
+                        && event.getToIndex() == 32
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4058,7 +4071,7 @@
 
         // Verify the selection position.
         assertEquals(2, Selection.getSelectionStart(editText.getText()));
-        assertEquals(267, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(32, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next paragraph and wait for an event.
         AccessibilityEvent thirdExpected = getInstrumentation().getUiAutomation()
@@ -4081,8 +4094,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 268
-                        && event.getToIndex() == 582
+                        && event.getFromIndex() == 33
+                        && event.getToIndex() == 47
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4093,7 +4106,7 @@
 
         // Verify the selection position.
         assertEquals(2, Selection.getSelectionStart(editText.getText()));
-        assertEquals(582, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(47, Selection.getSelectionEnd(editText.getText()));
 
         // Make sure there is no next.
         assertFalse(text.performAction(
@@ -4101,7 +4114,7 @@
 
         // Verify the selection position.
         assertEquals(2, Selection.getSelectionStart(editText.getText()));
-        assertEquals(582, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(47, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous paragraph and wait for an event.
         AccessibilityEvent fourthExpected = getInstrumentation().getUiAutomation()
@@ -4124,8 +4137,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 268
-                        && event.getToIndex() == 582
+                        && event.getFromIndex() == 33
+                        && event.getToIndex() == 47
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4136,7 +4149,7 @@
 
         // Verify the selection position.
         assertEquals(2, Selection.getSelectionStart(editText.getText()));
-        assertEquals(268, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(33, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous paragraph and wait for an event.
         AccessibilityEvent fifthExpected = getInstrumentation().getUiAutomation()
@@ -4159,8 +4172,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 106
-                        && event.getToIndex() == 267
+                        && event.getFromIndex() == 16
+                        && event.getToIndex() == 32
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4171,7 +4184,7 @@
 
         // Verify the selection position.
         assertEquals(2, Selection.getSelectionStart(editText.getText()));
-        assertEquals(106, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(16, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous paragraph and wait for an event.
         AccessibilityEvent sixthExpected = getInstrumentation().getUiAutomation()
@@ -4195,7 +4208,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
                         && event.getFromIndex() == 2
-                        && event.getToIndex() == 104
+                        && event.getToIndex() == 14
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4227,14 +4240,14 @@
 
         // Put selection at the end of the text.
         Bundle setSelectionArgs = new Bundle();
-        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT, 582);
-        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT, 582);
+        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT, 47);
+        setSelectionArgs.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT, 47);
         assertTrue(text.performAction(
                 AccessibilityNodeInfo.ACTION_SET_SELECTION, setSelectionArgs));
 
         // Verify the selection position.
-        assertEquals(582, Selection.getSelectionStart(editText.getText()));
-        assertEquals(582, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(47, Selection.getSelectionStart(editText.getText()));
+        assertEquals(47, Selection.getSelectionEnd(editText.getText()));
 
         // Unfocus the view so we can get rid of the soft-keyboard.
         getInstrumentation().runOnMainSync(new Runnable() {
@@ -4266,8 +4279,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 268
-                        && event.getToIndex() == 582
+                        && event.getFromIndex() == 33
+                        && event.getToIndex() == 47
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4277,8 +4290,8 @@
         assertNotNull(seventhExpected);
 
         // Verify the selection position.
-        assertEquals(582, Selection.getSelectionStart(editText.getText()));
-        assertEquals(268, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(47, Selection.getSelectionStart(editText.getText()));
+        assertEquals(33, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous paragraph and wait for an event.
         AccessibilityEvent eightExpected = getInstrumentation().getUiAutomation()
@@ -4301,8 +4314,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 106
-                        && event.getToIndex() == 267
+                        && event.getFromIndex() == 16
+                        && event.getToIndex() == 32
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4312,8 +4325,8 @@
         assertNotNull(eightExpected);
 
         // Verify the selection position.
-        assertEquals(582, Selection.getSelectionStart(editText.getText()));
-        assertEquals(106, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(47, Selection.getSelectionStart(editText.getText()));
+        assertEquals(16, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the previous paragraph and wait for an event.
         AccessibilityEvent ninethExpected = getInstrumentation().getUiAutomation()
@@ -4337,7 +4350,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
                         && event.getFromIndex() == 2
-                        && event.getToIndex() == 104
+                        && event.getToIndex() == 14
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4347,7 +4360,7 @@
         assertNotNull(ninethExpected);
 
         // Verify the selection position.
-        assertEquals(582, Selection.getSelectionStart(editText.getText()));
+        assertEquals(47, Selection.getSelectionStart(editText.getText()));
         assertEquals(2, Selection.getSelectionEnd(editText.getText()));
 
         // Make sure there is no previous.
@@ -4355,7 +4368,7 @@
                 AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, arguments));
 
         // Verify the selection position.
-        assertEquals(582, Selection.getSelectionStart(editText.getText()));
+        assertEquals(47, Selection.getSelectionStart(editText.getText()));
         assertEquals(2, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next paragraph and wait for an event.
@@ -4380,7 +4393,7 @@
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
                         && event.getFromIndex() == 2
-                        && event.getToIndex() == 104
+                        && event.getToIndex() == 14
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4390,8 +4403,8 @@
         assertNotNull(tenthExpected);
 
         // Verify the selection position.
-        assertEquals(582, Selection.getSelectionStart(editText.getText()));
-        assertEquals(104, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(47, Selection.getSelectionStart(editText.getText()));
+        assertEquals(14, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next paragraph and wait for an event.
         AccessibilityEvent eleventhExpected = getInstrumentation().getUiAutomation()
@@ -4414,8 +4427,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 106
-                        && event.getToIndex() == 267
+                        && event.getFromIndex() == 16
+                        && event.getToIndex() == 32
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4425,8 +4438,8 @@
         assertNotNull(eleventhExpected);
 
         // Verify the selection position.
-        assertEquals(582, Selection.getSelectionStart(editText.getText()));
-        assertEquals(267, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(47, Selection.getSelectionStart(editText.getText()));
+        assertEquals(32, Selection.getSelectionEnd(editText.getText()));
 
         // Move to the next paragraph and wait for an event.
         AccessibilityEvent twlevethExpected = getInstrumentation().getUiAutomation()
@@ -4449,8 +4462,8 @@
                         && event.getText().size() > 0
                         && event.getText().get(0).toString().equals(getString(
                                 R.string.android_wiki_paragraphs))
-                        && event.getFromIndex() == 268
-                        && event.getToIndex() == 582
+                        && event.getFromIndex() == 33
+                        && event.getToIndex() == 47
                         && event.getMovementGranularity() ==
                                 AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH);
             }
@@ -4460,26 +4473,32 @@
         assertNotNull(twlevethExpected);
 
         // Verify the selection position.
-        assertEquals(582, Selection.getSelectionStart(editText.getText()));
-        assertEquals(582, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(47, Selection.getSelectionStart(editText.getText()));
+        assertEquals(47, Selection.getSelectionEnd(editText.getText()));
 
         // Make sure there is no next.
         assertFalse(text.performAction(
                 AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments));
 
         // Verify the selection position.
-        assertEquals(582, Selection.getSelectionStart(editText.getText()));
-        assertEquals(582, Selection.getSelectionEnd(editText.getText()));
+        assertEquals(47, Selection.getSelectionStart(editText.getText()));
+        assertEquals(47, Selection.getSelectionEnd(editText.getText()));
     }
 
     @MediumTest
     public void testTextEditingActions() throws Exception {
+        if (!getActivity().getPackageManager().hasSystemFeature(
+                PackageManager.FEATURE_INPUT_METHODS)) {
+            return;
+        }
+
         final EditText editText = (EditText) getActivity().findViewById(R.id.edit);
         final String textContent = getString(R.string.foo_bar_baz);
 
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                editText.setVisibility(View.VISIBLE);
                 editText.setFocusable(true);
                 editText.requestFocus();
                 editText.setText(getString(R.string.foo_bar_baz));
@@ -4500,7 +4519,7 @@
                 AccessibilityNodeInfo.ACTION_SET_SELECTION, arguments));
 
         // Copy the selected text.
-        text.performAction( AccessibilityNodeInfo.ACTION_COPY);
+        text.performAction(AccessibilityNodeInfo.ACTION_COPY);
 
         // Set selection at the end.
         final int textLength = editText.getText().length();
@@ -4536,6 +4555,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                view.setVisibility(View.VISIBLE);
                 view.setContentDescription(getString(R.string.foo_bar_baz));
             }
         });
@@ -4564,6 +4584,7 @@
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
+                view.setVisibility(View.VISIBLE);
                 view.setContentDescription(getString(R.string.foo_bar_baz));
             }
         });
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityViewTreeReportingActivity.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityViewTreeReportingActivity.java
index 5aaa067..6aa4f44 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityViewTreeReportingActivity.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityViewTreeReportingActivity.java
@@ -14,7 +14,6 @@
 
 package android.accessibilityservice.cts;
 
-import android.app.Activity;
 import android.os.Bundle;
 
 import com.android.cts.accessibilityservice.R;
@@ -26,7 +25,7 @@
  * this activity is for verifying the hierarchical movement of the
  * accessibility focus.
  */
-public class AccessibilityViewTreeReportingActivity extends Activity {
+public class AccessibilityViewTreeReportingActivity extends AccessibilityTestActivity {
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryActivity.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryActivity.java
index 6f72a75..b0cedf6 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryActivity.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryActivity.java
@@ -14,7 +14,6 @@
 
 package android.accessibilityservice.cts;
 
-import android.app.Activity;
 import android.os.Bundle;
 import android.view.View;
 
@@ -26,7 +25,7 @@
  * requesting an action to be performed on a given view from an
  * AccessiiblityService.
  */
-public class AccessibilityWindowQueryActivity extends Activity {
+public class AccessibilityWindowQueryActivity extends AccessibilityTestActivity {
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java
index 0ea9a7f..492b99b 100644
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java
@@ -27,7 +27,6 @@
 import android.accessibilityservice.AccessibilityServiceInfo;
 import android.app.UiAutomation;
 import android.graphics.Rect;
-import android.os.SystemClock;
 import android.test.suitebuilder.annotation.MediumTest;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityNodeInfo;
@@ -55,7 +54,7 @@
     public void testFindByText() throws Exception {
         // find a view by text
         List<AccessibilityNodeInfo> buttons = getInstrumentation().getUiAutomation()
-                .getRootInActiveWindow().findAccessibilityNodeInfosByText("butto");
+                .getRootInActiveWindow().findAccessibilityNodeInfosByText("b");
         assertEquals(9, buttons.size());
     }
 
@@ -77,22 +76,22 @@
 
             // make list of expected nodes
             List<String> classNameAndTextList = new ArrayList<String>();
-            classNameAndTextList.add("android.widget.FrameLayout");
-            classNameAndTextList.add("android.widget.LinearLayout");
-            classNameAndTextList.add("android.widget.FrameLayout");
             classNameAndTextList.add("android.widget.LinearLayout");
             classNameAndTextList.add("android.widget.LinearLayout");
             classNameAndTextList.add("android.widget.LinearLayout");
             classNameAndTextList.add("android.widget.LinearLayout");
-            classNameAndTextList.add("android.widget.ButtonButton1");
-            classNameAndTextList.add("android.widget.ButtonButton2");
-            classNameAndTextList.add("android.widget.ButtonButton3");
-            classNameAndTextList.add("android.widget.ButtonButton4");
-            classNameAndTextList.add("android.widget.ButtonButton5");
-            classNameAndTextList.add("android.widget.ButtonButton6");
-            classNameAndTextList.add("android.widget.ButtonButton7");
-            classNameAndTextList.add("android.widget.ButtonButton8");
-            classNameAndTextList.add("android.widget.ButtonButton9");
+            classNameAndTextList.add("android.widget.ButtonB1");
+            classNameAndTextList.add("android.widget.ButtonB2");
+            classNameAndTextList.add("android.widget.ButtonB3");
+            classNameAndTextList.add("android.widget.ButtonB4");
+            classNameAndTextList.add("android.widget.ButtonB5");
+            classNameAndTextList.add("android.widget.ButtonB6");
+            classNameAndTextList.add("android.widget.ButtonB7");
+            classNameAndTextList.add("android.widget.ButtonB8");
+            classNameAndTextList.add("android.widget.ButtonB9");
+
+            String contentViewIdResName = "com.android.cts.accessibilityservice:id/added_content";
+            boolean verifyContent = false;
 
             Queue<AccessibilityNodeInfo> fringe = new LinkedList<AccessibilityNodeInfo>();
             fringe.add(getInstrumentation().getUiAutomation().getRootInActiveWindow());
@@ -101,13 +100,20 @@
             while (!fringe.isEmpty()) {
                 AccessibilityNodeInfo current = fringe.poll();
 
-                CharSequence text = current.getText();
-                String receivedClassNameAndText = current.getClassName().toString()
-                    + ((text != null) ? text.toString() : "");
-                String expectedClassNameAndText = classNameAndTextList.remove(0);
+                if (!verifyContent
+                        && contentViewIdResName.equals(current.getViewIdResourceName())) {
+                    verifyContent = true;
+                }
 
-                assertEquals("Did not get the expected node info",
-                        expectedClassNameAndText, receivedClassNameAndText);
+                if (verifyContent) {
+                    CharSequence text = current.getText();
+                    String receivedClassNameAndText = current.getClassName().toString()
+                            + ((text != null) ? text.toString() : "");
+                    String expectedClassNameAndText = classNameAndTextList.remove(0);
+
+                    assertEquals("Did not get the expected node info",
+                            expectedClassNameAndText, receivedClassNameAndText);
+                }
 
                 final int childCount = current.getChildCount();
                 for (int i = 0; i < childCount; i++) {
@@ -327,7 +333,7 @@
                 AccessibilityService.GLOBAL_ACTION_BACK));
 
         // Sleep a bit so the UI is settles.
-        SystemClock.sleep(3000);
+        waitForIdle();
     }
 
     @MediumTest
@@ -336,7 +342,7 @@
                 AccessibilityService.GLOBAL_ACTION_HOME));
 
         // Sleep a bit so the UI is settles.
-        SystemClock.sleep(3000);
+        waitForIdle();
     }
 
     @MediumTest
@@ -346,14 +352,14 @@
                 AccessibilityService.GLOBAL_ACTION_RECENTS));
 
         // Sleep a bit so the UI is settles.
-        SystemClock.sleep(3000);
+        waitForIdle();
 
         // Clean up.
         getInstrumentation().getUiAutomation().performGlobalAction(
                 AccessibilityService.GLOBAL_ACTION_BACK);
 
         // Sleep a bit so the UI is settles.
-        SystemClock.sleep(3000);
+        waitForIdle();
     }
 
     @MediumTest
@@ -363,14 +369,14 @@
                 AccessibilityService.GLOBAL_ACTION_NOTIFICATIONS));
 
         // Sleep a bit so the UI is settles.
-        SystemClock.sleep(3000);
+        waitForIdle();
 
         // Clean up.
         assertTrue(getInstrumentation().getUiAutomation().performGlobalAction(
                 AccessibilityService.GLOBAL_ACTION_BACK));
 
         // Sleep a bit so the UI is settles.
-        SystemClock.sleep(3000);
+        waitForIdle();
     }
 
     @MediumTest
@@ -380,14 +386,14 @@
                 AccessibilityService.GLOBAL_ACTION_QUICK_SETTINGS));
 
         // Sleep a bit so the UI is settles.
-        SystemClock.sleep(3000);
+        waitForIdle();
 
         // Clean up.
         getInstrumentation().getUiAutomation().performGlobalAction(
                 AccessibilityService.GLOBAL_ACTION_BACK);
 
         // Sleep a bit so the UI is settles.
-        SystemClock.sleep(3000);
+        waitForIdle();
     }
 
     @MediumTest
diff --git a/tests/tests/app/src/android/app/cts/ActionBarActivity.java b/tests/tests/app/src/android/app/cts/ActionBarActivity.java
index 11cee03..dc65cb2 100644
--- a/tests/tests/app/src/android/app/cts/ActionBarActivity.java
+++ b/tests/tests/app/src/android/app/cts/ActionBarActivity.java
@@ -25,6 +25,8 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         ActionBar bar = getActionBar();
-        bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
+        if (bar != null) {
+            bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
+        }
     }
 }
diff --git a/tests/tests/app/src/android/app/cts/ActionBarTest.java b/tests/tests/app/src/android/app/cts/ActionBarTest.java
index 796cd74..75e7807 100644
--- a/tests/tests/app/src/android/app/cts/ActionBarTest.java
+++ b/tests/tests/app/src/android/app/cts/ActionBarTest.java
@@ -40,6 +40,9 @@
 
     @UiThreadTest
     public void testAddTab() {
+        if (mBar == null) {
+            return;
+        }
         assertEquals(0, mBar.getTabCount());
 
         Tab t1 = createTab("Tab 1");
diff --git a/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java b/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
index 5c80fd1..c4318d8 100644
--- a/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
+++ b/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
@@ -114,6 +114,9 @@
             assertNotAvailable(PackageManager.FEATURE_CAMERA_FLASH);
             assertNotAvailable(PackageManager.FEATURE_CAMERA_FRONT);
             assertNotAvailable(PackageManager.FEATURE_CAMERA_ANY);
+            assertFalse("Devices supporting external cameras must have a representative camera " +
+                    "connected for testing",
+                    mPackageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_EXTERNAL));
         } else {
             assertAvailable(PackageManager.FEATURE_CAMERA_ANY);
             checkFrontCamera();
@@ -234,6 +237,8 @@
                 Sensor.TYPE_STEP_COUNTER);
         assertFeatureForSensor(featuresLeft, PackageManager.FEATURE_SENSOR_STEP_DETECTOR,
                 Sensor.TYPE_STEP_DETECTOR);
+        assertFeatureForSensor(featuresLeft, PackageManager.FEATURE_SENSOR_HEART_RATE,
+                Sensor.TYPE_HEART_RATE);
 
         assertTrue("Assertions need to be added to this test for " + featuresLeft,
                 featuresLeft.isEmpty());
diff --git a/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java b/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java
index fdf3cac..65f89f3 100644
--- a/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java
+++ b/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java
@@ -33,26 +33,37 @@
         mWallpaperManager = WallpaperManager.getInstance(mContext);
     }
 
+    /**
+     * Suggesting desired dimensions is only a hint to the system that can be ignored.
+     *
+     * Test if the desired minimum width or height the WallpaperManager returns
+     * is greater than 0. If so, then we check whether that the size is at least the
+     * as big as the screen.
+     */
     public void testSuggestDesiredDimensions() {
-        Point min = getScreenSize();
-        int w = min.x * 3;
-        int h = min.y * 2;
+        final Point min = getScreenSize();
+        final int w = min.x * 3;
+        final int h = min.y * 2;
 
-        mWallpaperManager.suggestDesiredDimensions(min.x / 2, min.y / 2);
-        assertEquals(min.x, mWallpaperManager.getDesiredMinimumWidth());
-        assertEquals(min.y, mWallpaperManager.getDesiredMinimumHeight());
+        assertDesiredMinimum(new Point(min.x / 2, min.y / 2), min);
 
-        mWallpaperManager.suggestDesiredDimensions(w, h);
-        assertEquals(w, mWallpaperManager.getDesiredMinimumWidth());
-        assertEquals(h, mWallpaperManager.getDesiredMinimumHeight());
+        assertDesiredMinimum(new Point(w, h),
+                             new Point(w, h));
 
-        mWallpaperManager.suggestDesiredDimensions(min.x / 2, h);
-        assertEquals(min.x, mWallpaperManager.getDesiredMinimumWidth());
-        assertEquals(h, mWallpaperManager.getDesiredMinimumHeight());
+        assertDesiredMinimum(new Point(min.x / 2, h),
+                             new Point(min.x, h));
 
-        mWallpaperManager.suggestDesiredDimensions(w, min.y / 2);
-        assertEquals(w, mWallpaperManager.getDesiredMinimumWidth());
-        assertEquals(min.y, mWallpaperManager.getDesiredMinimumHeight());
+        assertDesiredMinimum(new Point(w, min.y / 2),
+                             new Point(w, min.y));
+    }
+
+    private void assertDesiredMinimum(Point suggestedSize, Point expectedSize) {
+        mWallpaperManager.suggestDesiredDimensions(suggestedSize.x, suggestedSize.y);
+        Point actualSize = new Point(mWallpaperManager.getDesiredMinimumWidth(),
+                mWallpaperManager.getDesiredMinimumHeight());
+        if (actualSize.x > 0 || actualSize.y > 0) {
+            assertEquals(expectedSize, actualSize);
+        }
     }
 
     private Point getScreenSize() {
diff --git a/tests/tests/bionic/bionic-unit-tests-cts_list.txt b/tests/tests/bionic/bionic-unit-tests-cts_list.txt
deleted file mode 100644
index 55daff5..0000000
--- a/tests/tests/bionic/bionic-unit-tests-cts_list.txt
+++ /dev/null
@@ -1,576 +0,0 @@
-Fortify1_Gcc_DeathTest.
-  strcpy_fortified
-  strcpy2_fortified
-  strcpy3_fortified
-  strcpy4_fortified
-  strlen_fortified
-  strchr_fortified
-  strrchr_fortified
-  strlcpy_fortified
-  strlcat_fortified
-  sprintf_fortified
-  sprintf2_fortified
-  vsprintf_fortified
-  vsprintf2_fortified
-  vsnprintf_fortified
-  vsnprintf2_fortified
-  strncat_fortified
-  strncat2_fortified
-  strcat_fortified
-  memmove_fortified
-  memcpy_fortified
-  strncpy_fortified
-  snprintf_fortified
-  bzero_fortified
-  umask_fortified
-Fortify2_Gcc_DeathTest.
-  strncpy_fortified2
-  sprintf_fortified2
-  sprintf2_fortified2
-  vsprintf_fortified2
-  vsprintf2_fortified2
-  vsnprintf_fortified2
-  vsnprintf2_fortified2
-  strcpy_fortified2
-  strcpy2_fortified2
-  strcpy3_fortified2
-  strchr_fortified2
-  strrchr_fortified2
-  strlcpy_fortified2
-  strlcat_fortified2
-  strncat_fortified2
-  strncat2_fortified2
-  strncat3_fortified2
-  strcat_fortified2
-  strcat2_fortified2
-  snprintf_fortified2
-  bzero_fortified2
-  strcpy_fortified
-  strcpy2_fortified
-  strcpy3_fortified
-  strcpy4_fortified
-  strlen_fortified
-  strchr_fortified
-  strrchr_fortified
-  strlcpy_fortified
-  strlcat_fortified
-  sprintf_fortified
-  sprintf2_fortified
-  vsprintf_fortified
-  vsprintf2_fortified
-  vsnprintf_fortified
-  vsnprintf2_fortified
-  strncat_fortified
-  strncat2_fortified
-  strcat_fortified
-  memmove_fortified
-  memcpy_fortified
-  strncpy_fortified
-  snprintf_fortified
-  bzero_fortified
-  umask_fortified
-Fortify1_Clang_DeathTest.
-  strcpy_fortified
-  strcpy2_fortified
-  strcpy3_fortified
-  strcpy4_fortified
-  strlen_fortified
-  strchr_fortified
-  strrchr_fortified
-  strlcpy_fortified
-  strlcat_fortified
-  sprintf_fortified
-  sprintf2_fortified
-  vsprintf_fortified
-  vsprintf2_fortified
-  vsnprintf_fortified
-  vsnprintf2_fortified
-  strncat_fortified
-  strncat2_fortified
-  strcat_fortified
-  memmove_fortified
-  memcpy_fortified
-  strncpy_fortified
-  snprintf_fortified
-  bzero_fortified
-  umask_fortified
-Fortify2_Clang_DeathTest.
-  strncat3_fortified2
-  strcat2_fortified2
-  snprintf_fortified2
-  bzero_fortified2
-  strcpy_fortified
-  strcpy2_fortified
-  strcpy3_fortified
-  strcpy4_fortified
-  strlen_fortified
-  strchr_fortified
-  strrchr_fortified
-  strlcpy_fortified
-  strlcat_fortified
-  sprintf_fortified
-  sprintf2_fortified
-  vsprintf_fortified
-  vsprintf2_fortified
-  vsnprintf_fortified
-  vsnprintf2_fortified
-  strncat_fortified
-  strncat2_fortified
-  strcat_fortified
-  memmove_fortified
-  memcpy_fortified
-  strncpy_fortified
-  snprintf_fortified
-  bzero_fortified
-  umask_fortified
-pthread_DeathTest.
-  pthread_bug_37410
-stack_protector_DeathTest.
-  modify_stack_protector
-properties_DeathTest.
-  read_only
-Fortify1_Gcc.
-  strncat
-  strncat2
-  strncat3
-  strncat4
-  strncat5
-  strncat6
-  strcat
-  strcat2
-  strcat_chk_max_int_size
-  strcpy_chk_max_int_size
-  memcpy_chk_max_int_size
-Fortify2_Gcc.
-  strncat
-  strncat2
-  strncat3
-  strncat4
-  strncat5
-  strncat6
-  strcat
-  strcat2
-  strcat_chk_max_int_size
-  strcpy_chk_max_int_size
-  memcpy_chk_max_int_size
-Fortify1_Clang.
-  strncat
-  strncat2
-  strncat3
-  strncat4
-  strncat5
-  strncat6
-  strcat
-  strcat2
-  strcat_chk_max_int_size
-  strcpy_chk_max_int_size
-  memcpy_chk_max_int_size
-Fortify2_Clang.
-  strncat
-  strncat2
-  strncat3
-  strncat4
-  strncat5
-  strncat6
-  strcat
-  strcat2
-  strcat_chk_max_int_size
-  strcpy_chk_max_int_size
-  memcpy_chk_max_int_size
-dirent.
-  scandir
-  fdopendir_invalid
-  fdopendir
-  opendir_invalid
-  opendir
-  closedir_invalid
-  closedir
-  readdir
-  readdir_r
-  rewinddir
-eventfd.
-  smoke
-fenv.
-  fesetround_fegetround_FE_TONEAREST
-  fesetround_fegetround_FE_TOWARDZERO
-  fesetround_fegetround_FE_UPWARD
-  fesetround_fegetround_FE_DOWNWARD
-  feclearexcept_fetestexcept
-  FE_DFL_ENV_macro
-getauxval.
-  expected_values
-  unexpected_values
-getcwd.
-  auto_full
-  auto_reasonable
-  auto_too_small
-  auto_too_large
-  manual_too_small
-  manual_zero
-  manual_path_max
-inttypes.
-  misc
-libc_logging.
-  smoke
-  d_INT_MAX
-  d_INT_MIN
-  ld_LONG_MAX
-  ld_LONG_MIN
-  lld_LLONG_MAX
-  lld_LLONG_MIN
-libgen.
-  basename
-  dirname
-  basename_r
-  dirname_r
-malloc.
-  malloc_std
-  calloc_std
-  memalign_multiple
-  memalign_realloc
-  malloc_realloc_larger
-  malloc_realloc_smaller
-  malloc_multiple_realloc
-  calloc_realloc_larger
-  calloc_realloc_smaller
-  calloc_multiple_realloc
-math.
-  fpclassify
-  isinf
-  isnan
-  isnormal
-  __fpclassifyd
-  __fpclassifyf
-  __fpclassifyl
-  finitef
-  __isfinite
-  __isfinitef
-  __isfinitel
-  finite
-  __isinff
-  __isinfl
-  __isnanf
-  __isnanl
-  isnanf
-  __isnormal
-  __isnormalf
-  __isnormall
-  __signbit
-  __signbitf
-  __signbitl
-  acos
-  acosf
-  acosl
-  asin
-  asinf
-  asinl
-  atan
-  atanf
-  atanl
-  atan2
-  atan2f
-  atan2l
-  cos
-  cosf
-  cosl
-  sin
-  sinf
-  sinl
-  tan
-  tanf
-  tanl
-  acosh
-  acoshf
-  acoshl
-  asinh
-  asinhf
-  asinhl
-  atanh
-  atanhf
-  atanhl
-  cosh
-  coshf
-  coshl
-  sinh
-  sinhf
-  sinhl
-  tanh
-  tanhf
-  tanhl
-  log
-  logf
-  logl
-  log2
-  log2f
-  log2l
-  log10
-  log10f
-  log10l
-  cbrt
-  cbrtf
-  cbrtl
-  sqrt
-  sqrtf
-  sqrtl
-  exp
-  expf
-  expl
-  exp2
-  exp2f
-  exp2l
-  expm1
-  expm1f
-  expm1l
-  pow
-  powf
-  powl
-  ceil
-  ceilf
-  ceill
-  floor
-  floorf
-  floorl
-  fabs
-  fabsf
-  fabsl
-  ldexp
-  ldexpf
-  ldexpl
-  fmod
-  fmodf
-  fmodl
-  remainder
-  remainderf
-  remainderl
-  drem
-  dremf
-  fmax
-  fmaxf
-  fmaxl
-  fmin
-  fminf
-  fminl
-  fma
-  fmaf
-  fmal
-  hypot
-  hypotf
-  hypotl
-  erf
-  erff
-  erfl
-  erfc
-  erfcf
-  erfcl
-  lrint
-  rint
-  nearbyint
-  lround
-  llround
-  ilogb
-  ilogbf
-  ilogbl
-  logb
-  logbf
-  logbl
-  log1p
-  log1pf
-  log1pl
-  fdim
-  fdimf
-  fdiml
-  round
-  roundf
-  roundl
-  trunc
-  truncf
-  truncl
-  nextafter
-  nextafterf
-  nextafterl
-  copysign
-  copysignf
-  copysignl
-  significand
-  significandf
-  significandl
-  scalb
-  scalbf
-  scalbln
-  scalblnf
-  scalblnl
-  scalbn
-  scalbnf
-  scalbnl
-  gamma
-  gammaf
-  gamma_r
-  gammaf_r
-  lgamma
-  lgammaf
-  lgammal
-  lgamma_r
-  lgammaf_r
-  tgamma
-  tgammaf
-  tgammal
-  j0
-  j0f
-  j1
-  j1f
-  jn
-  jnf
-  y0
-  y0f
-  y1
-  y1f
-  yn
-  ynf
-  frexp
-  frexpf
-  frexpl
-  modf
-  modff
-  modfl
-  remquo
-  remquof
-  remquol
-  frexpf_public_bug_6697
-netdb.
-  getaddrinfo_NULL_hints
-  getnameinfo_salen
-pthread.
-  pthread_key_create
-  pthread_key_create_lots
-  pthread_create
-  pthread_create_EAGAIN
-  pthread_no_join_after_detach
-  pthread_no_op_detach_after_join
-  pthread_join_self
-  pthread_sigmask
-  __pthread_clone
-  pthread_setname_np__too_long
-  pthread_setname_np__self
-  pthread_setname_np__other
-  pthread_setname_np__no_such_thread
-  pthread_kill__0
-  pthread_kill__invalid_signal
-  pthread_kill__in_signal_handler
-  pthread_detach__no_such_thread
-  pthread_getcpuclockid__clock_gettime
-  pthread_getcpuclockid__no_such_thread
-  pthread_getschedparam__no_such_thread
-  pthread_setschedparam__no_such_thread
-  pthread_join__no_such_thread
-  pthread_kill__no_such_thread
-  pthread_join__multijoin
-  pthread_attr_setguardsize
-  pthread_attr_setstacksize
-regex.
-  smoke
-signal.
-  sigismember_invalid
-  sigaddset_invalid
-  sigdelset_invalid
-  sigemptyset_invalid
-  sigfillset_invalid
-  raise_invalid
-  raise_in_signal_handler
-  sigwait
-stack_protector.
-  global_guard
-statvfs.
-  statvfs
-  fstatvfs
-stdio.
-  tmpfile_fileno_fprintf_rewind_fgets
-  getdelim
-  getdelim_invalid
-  getline
-  getline_invalid
-  printf_ssize_t
-  popen
-  getc
-  putc
-stdlib.
-  drand48
-  lrand48_random_rand
-  mrand48
-  posix_memalign
-  realpath__NULL_filename
-  realpath__empty_filename
-  realpath__ENOENT
-  realpath
-  qsort
-string.
-  strerror
-  strerror_concurrent
-  strerror_r
-  strsignal
-  strsignal_concurrent
-  strcat
-  strcpy2
-  strcpy3
-  strcpy4
-  strcat2
-  strcat3
-  strncat2
-  strncat3
-  strncat4
-  strncat5
-  strchr_with_0
-  strchr
-  strcmp
-  strcpy
-  strlcat
-  strlcpy
-  strncat
-  strncmp
-  strncpy
-  strrchr
-  memchr
-  memrchr
-  memcmp
-  __memcmp16
-  wmemcmp
-  memcpy
-  memset
-  memmove
-  bcopy
-  bzero
-strings.
-  ffs
-getpwnam.
-  system_id_root
-  system_id_system
-  app_id_radio
-  app_id_nobody
-  app_id_all_a0
-  app_id_u1_a40000
-  app_id_u0_a0
-  app_id_u0_a1234
-  app_id_u0_a9999
-  app_id_u1_root
-  app_id_u1_radio
-  app_id_u1_a0
-  app_id_u1_i0
-sys_stat.
-  futimens
-  futimens_EBADF
-properties.
-  add
-  update
-  fill
-  foreach
-  find_nth
-  fill_hierarchical
-  errors
-  serial
-  wait
-time.
-  mktime_tz
-  gmtime
-  mktime_10310929
-unistd.
-  sysconf_SC_MONOTONIC_CLOCK
-  sbrk
diff --git a/tests/tests/content/src/android/content/pm/cts/ResolveInfo_DisplayNameComparatorTest.java b/tests/tests/content/src/android/content/pm/cts/ResolveInfo_DisplayNameComparatorTest.java
deleted file mode 100644
index be3d99c..0000000
--- a/tests/tests/content/src/android/content/pm/cts/ResolveInfo_DisplayNameComparatorTest.java
+++ /dev/null
@@ -1,44 +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.content.pm.cts;
-
-
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.pm.ResolveInfo.DisplayNameComparator;
-import android.test.AndroidTestCase;
-
-public class ResolveInfo_DisplayNameComparatorTest extends AndroidTestCase {
-    private static final String MAIN_ACTION_NAME = "android.intent.action.MAIN";
-    private static final String SERVICE_NAME = "android.content.pm.cts.activity.PMTEST_SERVICE";
-
-    public void testDisplayNameComparator() {
-        PackageManager pm = getContext().getPackageManager();
-        DisplayNameComparator dnc = new DisplayNameComparator(pm);
-
-        Intent intent = new Intent(MAIN_ACTION_NAME);
-        ResolveInfo activityInfo = pm.resolveActivity(intent, 0);
-
-        intent = new Intent(SERVICE_NAME);
-        ResolveInfo serviceInfo = pm.resolveService(intent, PackageManager.GET_RESOLVED_FILTER);
-
-        assertTrue(dnc.compare(activityInfo, serviceInfo) < 0);
-        assertTrue(dnc.compare(activityInfo, activityInfo) == 0);
-        assertTrue(dnc.compare(serviceInfo, activityInfo) > 0);
-    }
-}
diff --git a/tests/tests/display/src/android/display/cts/VirtualDisplayTest.java b/tests/tests/display/src/android/display/cts/VirtualDisplayTest.java
index 11bc15c..f2f859a 100644
--- a/tests/tests/display/src/android/display/cts/VirtualDisplayTest.java
+++ b/tests/tests/display/src/android/display/cts/VirtualDisplayTest.java
@@ -124,6 +124,7 @@
         Display display = virtualDisplay.getDisplay();
         try {
             assertDisplayRegistered(display, Display.FLAG_PRIVATE);
+            assertEquals(mSurface, virtualDisplay.getSurface());
 
             // Show a private presentation on the display.
             assertDisplayCanShowPresentation("private presentation window",
@@ -148,6 +149,7 @@
         Display display = virtualDisplay.getDisplay();
         try {
             assertDisplayRegistered(display, Display.FLAG_PRIVATE | Display.FLAG_PRESENTATION);
+            assertEquals(mSurface, virtualDisplay.getSurface());
 
             // Show a private presentation on the display.
             assertDisplayCanShowPresentation("private presentation window",
@@ -159,6 +161,38 @@
         assertDisplayUnregistered(display);
     }
 
+    /**
+     * Ensures that an application can create a private virtual display and show
+     * its own windows on it where the surface is attached or detached dynamically.
+     */
+    public void testPrivateVirtualDisplayWithDynamicSurface() throws Exception {
+        VirtualDisplay virtualDisplay = mDisplayManager.createVirtualDisplay(NAME,
+                WIDTH, HEIGHT, DENSITY, null, 0);
+        assertNotNull("virtual display must not be null", virtualDisplay);
+
+        Display display = virtualDisplay.getDisplay();
+        try {
+            assertDisplayRegistered(display, Display.FLAG_PRIVATE);
+            assertNull(virtualDisplay.getSurface());
+
+            // Attach the surface.
+            virtualDisplay.setSurface(mSurface);
+            assertEquals(mSurface, virtualDisplay.getSurface());
+
+            // Show a private presentation on the display.
+            assertDisplayCanShowPresentation("private presentation window",
+                    display, BLUEISH,
+                    WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION, 0);
+
+            // Detach the surface.
+            virtualDisplay.setSurface(null);
+            assertNull(virtualDisplay.getSurface());
+        } finally {
+            virtualDisplay.release();
+        }
+        assertDisplayUnregistered(display);
+    }
+
     private void assertDisplayRegistered(Display display, int flags) {
         assertNotNull("display object must not be null", display);
         assertTrue("display must be valid", display.isValid());
diff --git a/tests/tests/dpi/src/android/dpi/cts/AspectRatioTest.java b/tests/tests/dpi/src/android/dpi/cts/AspectRatioTest.java
index 572c3f4..fafce61 100644
--- a/tests/tests/dpi/src/android/dpi/cts/AspectRatioTest.java
+++ b/tests/tests/dpi/src/android/dpi/cts/AspectRatioTest.java
@@ -20,6 +20,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
 import android.test.ActivityInstrumentationTestCase2;
 import android.util.DisplayMetrics;
 import android.view.Display;
@@ -49,6 +50,12 @@
         if (aspectRatio >= 1.333 && aspectRatio <= 1.86) {
             return;
         }
+        if (getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) {
+            // Watch allows for a different set of aspect ratios.
+            if (aspectRatio >= 1.0 && aspectRatio <= 1.86) {
+                return;
+            }
+        }
         fail("Aspect ratio was not between 1.333 and 1.86: " + aspectRatio);
     }
 
diff --git a/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java b/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
index 4ecabc5..e2f75c6 100644
--- a/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
+++ b/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
@@ -17,6 +17,7 @@
 package android.dpi.cts;
 
 import android.content.Context;
+import android.content.pm.PackageManager;
 import android.test.AndroidTestCase;
 import android.util.DisplayMetrics;
 import android.view.Display;
@@ -40,8 +41,13 @@
         double xInches = (double) metrics.widthPixels / metrics.xdpi;
         double yInches = (double) metrics.heightPixels / metrics.ydpi;
         double diagonalInches = Math.sqrt(Math.pow(xInches, 2) + Math.pow(yInches, 2));
-        assertTrue("Screen diagonal must be at least 2.5 inches: " + diagonalInches,
-                diagonalInches >= 2.5d);
+        double minSize = 2.5d;
+        if (getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) {
+            // Watches have a different minimum diagonal.
+            minSize = 1.0d;
+        }
+        assertTrue("Screen diagonal must be at least " + minSize + " inches: " + diagonalInches,
+                diagonalInches >= minSize);
 
         double density = 160.0d * metrics.density;
         assertTrue("Screen density must be at least 100 dpi: " + density, density >= 100.0d);
diff --git a/tests/tests/drm/src/android/drm/cts/DrmInfoRequestTest.java b/tests/tests/drm/src/android/drm/cts/DrmInfoRequestTest.java
index cedc2d5..02894d4 100644
--- a/tests/tests/drm/src/android/drm/cts/DrmInfoRequestTest.java
+++ b/tests/tests/drm/src/android/drm/cts/DrmInfoRequestTest.java
@@ -31,8 +31,6 @@
 
     public static void testInvalidInfoTypes() throws Exception {
         checkInvalidInfoType(DrmInfoRequest.TYPE_REGISTRATION_INFO - 1);
-        checkInvalidInfoType(
-                DrmInfoRequest.TYPE_RIGHTS_ACQUISITION_PROGRESS_INFO + 1);
     }
 
     public static void testValidInfoTypes() throws Exception {
diff --git a/tests/tests/drm/src/android/drm/cts/DrmInfoStatusTest.java b/tests/tests/drm/src/android/drm/cts/DrmInfoStatusTest.java
index 103bd6e..cecd558 100644
--- a/tests/tests/drm/src/android/drm/cts/DrmInfoStatusTest.java
+++ b/tests/tests/drm/src/android/drm/cts/DrmInfoStatusTest.java
@@ -30,7 +30,6 @@
             DrmInfoRequest.TYPE_REGISTRATION_INFO;
 
     public static void testInvalidStatusCodes() throws Exception {
-        checkInvalidStatusCode(DrmInfoStatus.STATUS_ERROR + 1);
         checkInvalidStatusCode(DrmInfoStatus.STATUS_OK - 1);
     }
 
diff --git a/tests/tests/drm/src/android/drm/cts/DrmInfoTest.java b/tests/tests/drm/src/android/drm/cts/DrmInfoTest.java
index 656df5b..7a498a6 100644
--- a/tests/tests/drm/src/android/drm/cts/DrmInfoTest.java
+++ b/tests/tests/drm/src/android/drm/cts/DrmInfoTest.java
@@ -33,8 +33,6 @@
 
     public static void testInvalidInfoTypes() throws Exception {
         checkInvalidInfoType(DrmInfoRequest.TYPE_REGISTRATION_INFO - 1);
-        checkInvalidInfoType(
-                DrmInfoRequest.TYPE_RIGHTS_ACQUISITION_PROGRESS_INFO + 1);
     }
 
     public static void testValidInfoTypes() throws Exception {
diff --git a/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java b/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java
index f942f93..91d827c 100644
--- a/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java
+++ b/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java
@@ -40,7 +40,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.io.RandomAccessFile;
 
 public class BitmapFactoryTest extends InstrumentationTestCase {
     private Resources mRes;
@@ -241,50 +240,6 @@
         assertEquals(START_WIDTH, b.getWidth());
     }
 
-    public void testDecodeFileDescriptor3() throws IOException {
-        // Arbitrary offsets to use. If the offset of the FD matches the offset of the image,
-        // decoding should succeed, but if they do not match, decoding should fail.
-        long ACTUAL_OFFSETS[] = new long[] { 0, 17 };
-        for (int RES_ID : RES_IDS) {
-            for (int j = 0; j < ACTUAL_OFFSETS.length; ++j) {
-                // FIXME: The purgeable test should attempt to purge the memory
-                // to force a re-decode.
-                for (boolean TEST_PURGEABLE : new boolean[] { false, true }) {
-                    BitmapFactory.Options opts = new BitmapFactory.Options();
-                    opts.inPurgeable = TEST_PURGEABLE;
-                    opts.inInputShareable = TEST_PURGEABLE;
-
-                    long actualOffset = ACTUAL_OFFSETS[j];
-                    String path = obtainPath(RES_ID, actualOffset);
-                    RandomAccessFile file = new RandomAccessFile(path, "r");
-                    FileDescriptor fd = file.getFD();
-                    assertTrue(fd.valid());
-
-                    // Set the offset to ACTUAL_OFFSET
-                    file.seek(actualOffset);
-                    assertEquals(file.getFilePointer(), actualOffset);
-
-                    // Now decode. This should be successful and leave the offset
-                    // unchanged.
-                    Bitmap b = BitmapFactory.decodeFileDescriptor(fd, null, opts);
-                    assertNotNull(b);
-                    assertEquals(file.getFilePointer(), actualOffset);
-
-                    // Now use the other offset. It should fail to decode, and
-                    // the offset should remain unchanged.
-                    long otherOffset = ACTUAL_OFFSETS[(j + 1) % ACTUAL_OFFSETS.length];
-                    assertFalse(otherOffset == actualOffset);
-                    file.seek(otherOffset);
-                    assertEquals(file.getFilePointer(), otherOffset);
-
-                    b = BitmapFactory.decodeFileDescriptor(fd, null, opts);
-                    assertNull(b);
-                    assertEquals(file.getFilePointer(), otherOffset);
-                }
-            }
-        }
-    }
-
     public void testDecodeFile1() throws IOException {
         Bitmap b = BitmapFactory.decodeFile(obtainPath(), mOpt1);
         assertNotNull(b);
@@ -471,32 +426,17 @@
     }
 
     private String obtainPath() throws IOException {
-        return obtainPath(R.drawable.start, 0);
-    }
-
-    /*
-     * Create a new file and return a path to it.
-     * @param resId Original file. It will be copied into the new file.
-     * @param offset Number of zeroes to write to the new file before the
-     *               copied file. This allows testing decodeFileDescriptor
-     *               with an offset. Must be less than or equal to 1024
-     */
-    private String obtainPath(int resId, long offset) throws IOException {
         File dir = getInstrumentation().getTargetContext().getFilesDir();
         dir.mkdirs();
-        // The suffix does not necessarily represent theactual file type.
         File file = new File(dir, "test.jpg");
         if (!file.createNewFile()) {
             if (!file.exists()) {
                 fail("Failed to create new File!");
             }
         }
-        InputStream is = obtainInputStream(resId);
+        InputStream is = obtainInputStream();
         FileOutputStream fOutput = new FileOutputStream(file);
         byte[] dataBuffer = new byte[1024];
-        // Write a bunch of zeroes before the image.
-        assertTrue(offset <= 1024);
-        fOutput.write(dataBuffer, 0, (int) offset);
         int readLength = 0;
         while ((readLength = is.read(dataBuffer)) != -1) {
             fOutput.write(dataBuffer, 0, readLength);
diff --git a/tests/tests/graphics/src/android/graphics/drawable/cts/BitmapDrawableTest.java b/tests/tests/graphics/src/android/graphics/drawable/cts/BitmapDrawableTest.java
index aac71cf..c84510d 100644
--- a/tests/tests/graphics/src/android/graphics/drawable/cts/BitmapDrawableTest.java
+++ b/tests/tests/graphics/src/android/graphics/drawable/cts/BitmapDrawableTest.java
@@ -252,6 +252,7 @@
         bitmapDrawable.setGravity(Gravity.BOTTOM);
         assertEquals(PixelFormat.TRANSLUCENT, bitmapDrawable.getOpacity());
 
+        source = mContext.getResources().openRawResource(R.raw.testimage);
         bitmapDrawable = new BitmapDrawable(source);
         assertEquals(Gravity.FILL, bitmapDrawable.getGravity());
         assertEquals(PixelFormat.OPAQUE, bitmapDrawable.getOpacity());
diff --git a/tests/tests/hardware/src/android/hardware/consumerir/cts/ConsumerIrTest.java b/tests/tests/hardware/src/android/hardware/consumerir/cts/ConsumerIrTest.java
index 395a69b..e06adac 100644
--- a/tests/tests/hardware/src/android/hardware/consumerir/cts/ConsumerIrTest.java
+++ b/tests/tests/hardware/src/android/hardware/consumerir/cts/ConsumerIrTest.java
@@ -77,12 +77,12 @@
 
         ConsumerIrManager.CarrierFrequencyRange[] freqs = mCIR.getCarrierFrequencies();
         // Transmit two seconds for min and max for each frequency range
-        int[] pattern = {1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999};
-        long totalXmitTime = 0; // get the length of the pattern
+        int[] pattern = {11111, 22222, 33333, 44444, 55555, 66666, 77777, 88888, 99999};
+        long totalXmitTimeNanos = 0; // get the length of the pattern
         for (int slice : pattern) {
-            totalXmitTime += slice;
+            totalXmitTimeNanos += slice * 1000; // add the time in nanoseconds
         }
-        double margin = 0.1; // max fraction xmit is allowed to be off timing
+        double margin = 0.5; // max fraction xmit is allowed to be off timing
 
         for (ConsumerIrManager.CarrierFrequencyRange range : freqs) {
             // test min freq
@@ -90,18 +90,18 @@
             mCIR.transmit(range.getMinFrequency(), pattern);
             long newTime = SystemClock.elapsedRealtimeNanos();
             String msg = String.format("Pattern length pattern:%d, actual:%d",
-                    totalXmitTime, newTime - currentTime);
-            assertTrue(msg, newTime - currentTime >= totalXmitTime * (1.0 - margin));
-            assertTrue(msg, newTime - currentTime <= totalXmitTime * (1.0 + margin));
+                    totalXmitTimeNanos, newTime - currentTime);
+            assertTrue(msg, newTime - currentTime >= totalXmitTimeNanos * (1.0 - margin));
+            assertTrue(msg, newTime - currentTime <= totalXmitTimeNanos * (1.0 + margin));
 
             // test max freq
             currentTime = SystemClock.elapsedRealtimeNanos();
             mCIR.transmit(range.getMaxFrequency(), pattern);
             newTime = SystemClock.elapsedRealtimeNanos();
             msg = String.format("Pattern length pattern:%d, actual:%d",
-                    totalXmitTime, newTime - currentTime);
-            assertTrue(msg, newTime - currentTime >= totalXmitTime * (1.0 - margin));
-            assertTrue(msg, newTime - currentTime <= totalXmitTime * (1.0 + margin));
+                    totalXmitTimeNanos, newTime - currentTime);
+            assertTrue(msg, newTime - currentTime >= totalXmitTimeNanos * (1.0 - margin));
+            assertTrue(msg, newTime - currentTime <= totalXmitTimeNanos * (1.0 + margin));
         }
     }
 
diff --git a/tests/tests/hardware/src/android/hardware/cts/CameraTest.java b/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
index b198541..c6e28f7 100644
--- a/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
+++ b/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
@@ -16,6 +16,7 @@
 
 package android.hardware.cts;
 
+import android.content.pm.PackageManager;
 import android.graphics.BitmapFactory;
 import android.graphics.ImageFormat;
 import android.graphics.Rect;
@@ -2938,4 +2939,23 @@
         terminateMessageLooper();
     }
 
+    public void testCameraExternalConnected() {
+        if (getActivity().getPackageManager().
+                hasSystemFeature(PackageManager.FEATURE_CAMERA_EXTERNAL) ) {
+            int nCameras = Camera.getNumberOfCameras();
+            assertTrue("Devices with external camera support must have a camera connected for " +
+                    "testing",
+                    nCameras > 0);
+            for (int id = 0; id < nCameras; id++) {
+                try {
+                    Camera c = Camera.open(id);
+                    c.release();
+                } catch (Throwable e) {
+                    throw new AssertionError("Devices with external camera support must " +
+                            "have all listed cameras be connected and openable for testing", e);
+                }
+            }
+        }
+    }
+
 }
diff --git a/tests/tests/hardware/src/android/hardware/cts/SensorTest.java b/tests/tests/hardware/src/android/hardware/cts/SensorTest.java
index 24dd368..b1691c3 100644
--- a/tests/tests/hardware/src/android/hardware/cts/SensorTest.java
+++ b/tests/tests/hardware/src/android/hardware/cts/SensorTest.java
@@ -21,6 +21,7 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 import android.content.Context;
 import android.content.pm.PackageManager;
@@ -33,13 +34,21 @@
 import android.hardware.TriggerEventListener;
 import android.os.Handler;
 import android.os.HandlerThread;
+import android.os.PowerManager;
 import android.test.AndroidTestCase;
+import android.util.Log;
 
 public class SensorTest extends AndroidTestCase {
     private SensorManager mSensorManager;
     private TriggerListener mTriggerListener;
     private SensorListener mSensorListener;
-    private ArrayList<Sensor> mContinuousSensorList;
+    private List<Sensor> mSensorList;
+    private static final String TAG = "SensorTest";
+    // Test only SDK defined sensors. Any sensors with type > 100 are ignored.
+    private static final int MAX_SENSOR_TYPE = 100;
+    private static final int TIMEOUT_S = 40;
+
+    private PowerManager.WakeLock mWakeLock;
 
     @Override
     protected void setUp() throws Exception {
@@ -47,18 +56,9 @@
         mSensorManager = (SensorManager) getContext().getSystemService(Context.SENSOR_SERVICE);
         mTriggerListener = new TriggerListener();
         mSensorListener = new SensorListener();
-        mContinuousSensorList = new ArrayList<Sensor>();
-        for (int i = Sensor.TYPE_ACCELEROMETER; i <= Sensor.TYPE_GEOMAGNETIC_ROTATION_VECTOR; ++i) {
-            Sensor sensor = mSensorManager.getDefaultSensor(i);
-            // Skip all non-continuous mode sensors.
-            if (sensor == null || Sensor.TYPE_SIGNIFICANT_MOTION == i ||
-                Sensor.TYPE_STEP_COUNTER == i || Sensor.TYPE_STEP_DETECTOR == i ||
-                Sensor.TYPE_LIGHT == i || Sensor.TYPE_PROXIMITY == i ||
-                Sensor.TYPE_AMBIENT_TEMPERATURE == i) {
-                continue;
-            }
-            mContinuousSensorList.add(sensor);
-        }
+        mSensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL);
+        PowerManager pm = (PowerManager) getContext().getSystemService(Context.POWER_SERVICE);
+        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
     }
 
     public void testSensorOperations() {
@@ -79,7 +79,7 @@
 
         sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER);
         boolean hasStepCounter = getContext().getPackageManager().hasSystemFeature(
-                                        PackageManager.FEATURE_SENSOR_STEP_COUNTER);
+                PackageManager.FEATURE_SENSOR_STEP_COUNTER);
         // stepcounter sensor is optional
         if (hasStepCounter) {
             assertEquals(Sensor.TYPE_STEP_COUNTER, sensor.getType());
@@ -90,7 +90,7 @@
 
         sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_STEP_DETECTOR);
         boolean hasStepDetector = getContext().getPackageManager().hasSystemFeature(
-                                        PackageManager.FEATURE_SENSOR_STEP_DETECTOR);
+                PackageManager.FEATURE_SENSOR_STEP_DETECTOR);
         // stepdetector sensor is optional
         if (hasStepDetector) {
             assertEquals(Sensor.TYPE_STEP_DETECTOR, sensor.getType());
@@ -99,6 +99,17 @@
             assertNull(sensor);
         }
 
+        sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE);
+        boolean hasHeartRate = getContext().getPackageManager().hasSystemFeature(
+                PackageManager.FEATURE_SENSOR_HEART_RATE);
+        // heartrate sensor is optional
+        if (hasHeartRate) {
+            assertEquals(Sensor.TYPE_HEART_RATE, sensor.getType());
+            assertSensorValues(sensor);
+        } else {
+            assertNull(sensor);
+        }
+
         sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
         boolean hasCompass = getContext().getPackageManager().hasSystemFeature(
                 PackageManager.FEATURE_SENSOR_COMPASS);
@@ -178,76 +189,91 @@
     // Register for updates from each continuous mode sensor, wait for 25 events, call flush and
     // wait for flushCompleteEvent before unregistering for the sensor.
     public void testBatchAndFlush() throws Exception {
-        for (Sensor sensor : mContinuousSensorList) {
-            final CountDownLatch eventReceived = new CountDownLatch(25);
-            final CountDownLatch flushReceived = new CountDownLatch(1);
-            SensorEventListener2 listener = new SensorEventListener2() {
-                @Override
-                public void onSensorChanged(SensorEvent event) {
-                    eventReceived.countDown();
+        try {
+            mWakeLock.acquire();
+            for (Sensor sensor : mSensorList) {
+                // Skip OEM defined sensors and trigger sensors.
+                if (sensor.getType() > MAX_SENSOR_TYPE || sensor.getMinDelay() < 0) {
+                    continue;
                 }
-
-                @Override
-                public void onAccuracyChanged(Sensor sensor, int accuracy) {
-                }
-
-                @Override
-                public void onFlushCompleted(Sensor sensor) {
-                    flushReceived.countDown();
-                }
-            };
-            boolean result = mSensorManager.registerListener(listener, sensor,
-                                            SensorManager.SENSOR_DELAY_NORMAL, 10000000);
-            assertTrue(result);
-            // Wait for 25 events and call flush.
-            eventReceived.await();
-            result = mSensorManager.flush(listener);
-            assertTrue(result);
-            flushReceived.await();
-            mSensorManager.unregisterListener(listener);
+                registerListenerCallFlush(sensor, null);
+            }
+        } finally {
+            mWakeLock.release();
         }
     }
 
     // Same as testBatchAndFlush but using Handler version of the API to register for sensors.
     // onSensorChanged is now called on a background thread.
     public void testBatchAndFlushWithHandler() throws Exception {
-        for (Sensor sensor : mContinuousSensorList) {
-            final CountDownLatch eventReceived = new CountDownLatch(25);
-            final CountDownLatch flushReceived = new CountDownLatch(1);
-            SensorEventListener2 listener = new SensorEventListener2() {
-                @Override
-                public void onSensorChanged(SensorEvent event) {
-                    eventReceived.countDown();
-                }
-
-                @Override
-                public void onAccuracyChanged(Sensor sensor, int accuracy) {
-                }
-
-                @Override
-                public void onFlushCompleted(Sensor sensor) {
-                    flushReceived.countDown();
-                }
-            };
+        try {
+            mWakeLock.acquire();
             HandlerThread handlerThread = new HandlerThread("sensorThread");
             handlerThread.start();
             Handler handler = new Handler(handlerThread.getLooper());
-            boolean result = mSensorManager.registerListener(listener, sensor,
-                                            SensorManager.SENSOR_DELAY_NORMAL, 15000000,
-                                            handler);
-            assertTrue(result);
-            // Wait for 25 events and call flush.
-            eventReceived.await();
-            result = mSensorManager.flush(listener);
-            assertTrue(result);
-            flushReceived.await();
-            mSensorManager.unregisterListener(listener);
+            for (Sensor sensor : mSensorList) {
+                // Skip OEM defined sensors and trigger sensors.
+                if (sensor.getType() > MAX_SENSOR_TYPE || sensor.getMinDelay() < 0) {
+                    continue;
+                }
+                registerListenerCallFlush(sensor, handler);
+            }
+        }  finally {
+            mWakeLock.release();
         }
     }
 
+    private void registerListenerCallFlush(Sensor sensor, Handler handler)
+            throws InterruptedException {
+        final CountDownLatch eventReceived = new CountDownLatch(25);
+        final CountDownLatch flushReceived = new CountDownLatch(1);
+        SensorEventListener2 listener = new SensorEventListener2() {
+            @Override
+            public void onSensorChanged(SensorEvent event) {
+                eventReceived.countDown();
+            }
+
+            @Override
+            public void onAccuracyChanged(Sensor sensor, int accuracy) {
+            }
+
+            @Override
+            public void onFlushCompleted(Sensor sensor) {
+                flushReceived.countDown();
+            }
+        };
+        // Consider only continuous mode sensors for testing registerListener.
+        // For on-change sensors, call registerListener() so that the listener is associated
+        // with the sensor and flush(listener) can be called on it.
+        if (sensor.getMinDelay() >= 0) {
+            Log.i(TAG, "testBatch " + sensor.getName());
+            boolean result = mSensorManager.registerListener(listener, sensor,
+                    SensorManager.SENSOR_DELAY_NORMAL, 10000000, handler);
+            assertTrue("registerListener failed " + sensor.getName(), result);
+            // Wait for 25 events or 40 seconds only for continuous mode sensors.
+            if (sensor.getMinDelay() > 0) {
+                boolean countZero = eventReceived.await(TIMEOUT_S, TimeUnit.SECONDS);
+                if (!countZero) {
+                    fail("Timed out waiting for events from " + sensor.getName());
+                }
+            }
+        }
+
+        Log.i(TAG, "testFlush " + sensor.getName());
+        boolean result = mSensorManager.flush(listener);
+        assertTrue("flush failed " + sensor.getName(), result);
+        boolean countZero = flushReceived.await(TIMEOUT_S, TimeUnit.SECONDS);
+        if (!countZero) {
+            fail("Timed out waiting for flushCompleteEvent from " + sensor.getName());
+        }
+        mSensorManager.unregisterListener(listener);
+        Log.i(TAG, "testBatchAndFlush pass " + sensor.getName());
+    }
+
     // Call registerListener for multiple sensors at a time and call flush.
     public void testBatchAndFlushWithMutipleSensors() throws Exception {
-        int numSensors = mContinuousSensorList.size() < 3 ? mContinuousSensorList.size() : 3;
+        final int MAX_SENSORS = 3;
+        int numSensors = mSensorList.size() < MAX_SENSORS ? mSensorList.size() : MAX_SENSORS;
         if (numSensors == 0) {
             return;
         }
@@ -268,18 +294,46 @@
                 flushReceived.countDown();
             }
         };
-        for (int i = 0; i < numSensors; ++i) {
-            Sensor sensor = mContinuousSensorList.get(i);
-            boolean result = mSensorManager.registerListener(listener, sensor,
-                                            SensorManager.SENSOR_DELAY_FASTEST);
-            assertTrue(result);
+
+        try {
+            mWakeLock.acquire();
+            StringBuilder registeredSensors = new StringBuilder(30);
+            for (Sensor sensor : mSensorList) {
+                // Skip all non-continuous sensors.
+                if (sensor.getMinDelay() <= 0 || sensor.getType() > MAX_SENSOR_TYPE) {
+                    continue;
+                }
+                boolean result = mSensorManager.registerListener(listener, sensor,
+                        SensorManager.SENSOR_DELAY_GAME, 10000000);
+                assertTrue("registerListener failed for " + sensor.getName(), result);
+                registeredSensors.append(sensor.getName());
+                registeredSensors.append(" ");
+                if (--numSensors == 0) {
+                    break;
+                }
+            }
+            if (registeredSensors.toString().isEmpty()) {
+                return;
+            }
+
+            Log.i(TAG, "testBatchAndFlushWithMutipleSensors " + registeredSensors);
+            // Wait for numSensors * 50 events or 40 seconds.
+            boolean countZero = eventReceived.await(TIMEOUT_S, TimeUnit.SECONDS);
+            if (!countZero) {
+                fail("Timed out waiting for events from " + registeredSensors.toString());
+            }
+            boolean result = mSensorManager.flush(listener);
+            assertTrue("flush failed " + registeredSensors.toString(), result);
+            countZero = flushReceived.await(TIMEOUT_S, TimeUnit.SECONDS);
+            if (!countZero) {
+                fail("Timed out waiting for flushCompleteEvent from " +
+                      registeredSensors.toString());
+            }
+            mSensorManager.unregisterListener(listener);
+            Log.i(TAG, "testBatchAndFlushWithMutipleSensors passed");
+        } finally {
+            mWakeLock.release();
         }
-        // Wait for N events and call flush.
-        eventReceived.await();
-        boolean result = mSensorManager.flush(listener);
-        assertTrue(result);
-        flushReceived.await();
-        mSensorManager.unregisterListener(listener);
     }
 
     private void assertSensorValues(Sensor sensor) {
diff --git a/tests/tests/location/src/android/location/cts/LocationManagerTest.java b/tests/tests/location/src/android/location/cts/LocationManagerTest.java
index 8028422..64b15dc 100644
--- a/tests/tests/location/src/android/location/cts/LocationManagerTest.java
+++ b/tests/tests/location/src/android/location/cts/LocationManagerTest.java
@@ -267,40 +267,66 @@
      */
     public void testModeAndProviderApisConsistent() {
         ContentResolver cr = mContext.getContentResolver();
+
+        // Find out what the settings say about which providers are enabled
         int mode = Settings.Secure.getInt(
                 cr, Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
         boolean gps = Settings.Secure.isLocationProviderEnabled(cr, LocationManager.GPS_PROVIDER);
         boolean nlp = Settings.Secure.isLocationProviderEnabled(
                 cr, LocationManager.NETWORK_PROVIDER);
 
-        // Assert that if there are no test providers enabled, LocationManager just returns the
-        // values from Settings.Secure.
+        // Find out location manager's opinion on the matter, making sure we dont' get spurious
+        // results from test versions of the two providers.
         forceClearTestProvider(LocationManager.GPS_PROVIDER);
         forceClearTestProvider(LocationManager.NETWORK_PROVIDER);
         boolean lmGps = mManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
         boolean lmNlp = mManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
-        assertEquals("Inconsistent GPS values", gps, lmGps);
-        assertEquals("Inconsistent NLP values", nlp, lmNlp);
 
-        // Assert that isLocationProviderEnabled() values are consistent with the location mode
+        // Location Manager will report provider as off if it doesn't know about it
+        boolean expectedGps = gps && deviceHasProvider(LocationManager.GPS_PROVIDER);
+        boolean expectedNlp = nlp && deviceHasProvider(LocationManager.NETWORK_PROVIDER);
+
+        // Assert LocationManager returned the values from Settings.Secure (assuming the device has
+        // the appropriate hardware).
+        assertEquals("Inconsistent GPS values", expectedGps, lmGps);
+        assertEquals("Inconsistent NLP values", expectedNlp, lmNlp);
+
         switch (mode) {
             case Settings.Secure.LOCATION_MODE_OFF:
-                assertFalse("Bad GPS for mode " + mode, gps);
-                assertFalse("Bad NLP for mode " + mode, nlp);
+                expectedGps = false;
+                expectedNlp = false;
                 break;
             case Settings.Secure.LOCATION_MODE_SENSORS_ONLY:
-                assertEquals("Bad GPS for mode " + mode, hasGpsFeature(), gps);
-                assertFalse("Bad NLP for mode " + mode, nlp);
+                expectedGps = true;
+                expectedNlp = false;
                 break;
             case Settings.Secure.LOCATION_MODE_BATTERY_SAVING:
-                assertFalse("Bad GPS for mode " + mode, gps);
-                assertTrue("Bad NLP for mode " + mode, nlp);
+                expectedGps = false;
+                expectedNlp = true;
                 break;
             case Settings.Secure.LOCATION_MODE_HIGH_ACCURACY:
-                assertEquals("Bad GPS for mode " + mode, hasGpsFeature(), gps);
-                assertTrue("Bad NLP for mode " + mode, nlp);
+                expectedGps = true;
+                expectedNlp = true;
                 break;
         }
+
+        // Assert that isLocationProviderEnabled() values are consistent with the location mode
+        assertEquals("Bad GPS for mode " + mode, expectedGps, gps);
+        assertEquals("Bad NLP for mode " + mode, expectedNlp, nlp);
+    }
+
+    /**
+     * Returns true if the {@link LocationManager} reports that the device includes this flavor
+     * of location provider.
+     */
+    private boolean deviceHasProvider(String provider) {
+        List<String> providers = mManager.getAllProviders();
+        for (String aProvider : providers) {
+            if (aProvider.equals(provider)) {
+                return true;
+            }
+        }
+        return false;
     }
 
     /**
@@ -413,7 +439,7 @@
                     // run the update location test logic to ensure location updates can be injected
                     doLocationUpdatesWithLocationListener(providerName);
                 } finally {
-                    removeTestProvider(providerName);
+                    mManager.removeTestProvider(providerName);
                 }
             }
         }
@@ -825,7 +851,7 @@
     }
 
     private void unmockFusedLocation() {
-        removeTestProvider(FUSED_PROVIDER_NAME);
+        mManager.removeTestProvider(FUSED_PROVIDER_NAME);
     }
 
     /**
diff --git a/tests/tests/media/res/raw/bug13652927.ogg b/tests/tests/media/res/raw/bug13652927.ogg
new file mode 100644
index 0000000..065d9e5
--- /dev/null
+++ b/tests/tests/media/res/raw/bug13652927.ogg
Binary files differ
diff --git a/tests/tests/media/src/android/media/cts/AdaptivePlaybackTest.java b/tests/tests/media/src/android/media/cts/AdaptivePlaybackTest.java
index 0230edc..13852ae 100644
--- a/tests/tests/media/src/android/media/cts/AdaptivePlaybackTest.java
+++ b/tests/tests/media/src/android/media/cts/AdaptivePlaybackTest.java
@@ -44,6 +44,7 @@
 public class AdaptivePlaybackTest extends MediaPlayerTestBase {
     private static final String TAG = "AdaptivePlaybackTest";
     private boolean sanity = false;
+    private static final int MIN_FRAMES_BEFORE_DRC = 2;
 
     public Iterable<Codec> H264(CodecFactory factory) {
         return factory.createCodecList(
@@ -466,6 +467,10 @@
             tests.add(
                 new Step("testing DRC with no reconfigure - init", this, c) {
                     public void run() throws Throwable {
+                        // FIXME wait 2 seconds to allow system to free up previous codecs
+                        try {
+                            Thread.sleep(2000);
+                        } catch (InterruptedException e) {}
                         mDecoder = new Decoder(c.name);
                         mDecoder.configureAndStart(stepFormat(), stepSurface());
                         mAdjustTimeUs = 0;
@@ -473,7 +478,7 @@
                         mQueuedFrames = 0;
                     }});
 
-            for (int i = NUM_FRAMES, ix = 0; i > 1; i--, ix++) {
+            for (int i = NUM_FRAMES, ix = 0; i >= MIN_FRAMES_BEFORE_DRC; i--, ix++) {
                 final int mediaIx = ix % c.mediaList.length;
                 final int segmentSize = i;
                 tests.add(
@@ -481,9 +486,9 @@
                             this, c, mediaIx) {
                         public void run() throws Throwable {
                             mQueuedFrames += segmentSize;
-                            boolean lastSequence = segmentSize == 2;
+                            boolean lastSequence = segmentSize == MIN_FRAMES_BEFORE_DRC;
                             if (sanity) {
-                                lastSequence = (segmentSize >> 1) <= 2;
+                                lastSequence = (segmentSize >> 1) <= MIN_FRAMES_BEFORE_DRC;
                             }
                             int frames = mDecoder.queueInputBufferRange(
                                     stepMedia(),
@@ -589,7 +594,7 @@
             };
         }
         public void addTests(TestList tests, Codec c) {
-            for (int drcFrame = 6; drcFrame > 1; drcFrame--) {
+            for (int drcFrame = 6; drcFrame >= MIN_FRAMES_BEFORE_DRC; drcFrame--) {
                 for (int eosFrame = 6; eosFrame >= 1; eosFrame--) {
                     tests.add(testStep(c, drcFrame, eosFrame));
                 }
@@ -1270,11 +1275,13 @@
 
             /* test if the explicitly named codec is present on the system */
             if (explicitCodecName != null) {
-                MediaCodec codec = MediaCodec.createByCodecName(explicitCodecName);
-                if (codec != null) {
-                    codec.release();
-                    add(new Codec(explicitCodecName, null, mediaList));
-                }
+                try {
+                    MediaCodec codec = MediaCodec.createByCodecName(explicitCodecName);
+                    if (codec != null) {
+                        codec.release();
+                        add(new Codec(explicitCodecName, null, mediaList));
+                    }
+                } catch (Exception e) {}
             }
         } catch (Throwable t) {
             Log.wtf("Constructor failed", t);
diff --git a/tests/tests/media/src/android/media/cts/AudioTrackTest.java b/tests/tests/media/src/android/media/cts/AudioTrackTest.java
index 9b1879a..090cde8 100644
--- a/tests/tests/media/src/android/media/cts/AudioTrackTest.java
+++ b/tests/tests/media/src/android/media/cts/AudioTrackTest.java
@@ -18,6 +18,7 @@
 
 import android.media.AudioFormat;
 import android.media.AudioManager;
+import android.media.AudioTimestamp;
 import android.media.AudioTrack;
 import android.test.AndroidTestCase;
 import android.util.Log;
@@ -1364,6 +1365,76 @@
         track.release();
     }
 
+    public void testGetTimestamp() throws Exception {
+        // constants for test
+        final String TEST_NAME = "testGetTimestamp";
+        final int TEST_SR = 22050;
+        final int TEST_CONF = AudioFormat.CHANNEL_CONFIGURATION_MONO;
+        final int TEST_FORMAT = AudioFormat.ENCODING_PCM_16BIT;
+        final int TEST_MODE = AudioTrack.MODE_STREAM;
+        final int TEST_STREAM_TYPE = AudioManager.STREAM_MUSIC;
+        final int TEST_LOOP_CNT = 10;
+
+        final int MILLIS_PER_SEC = 1000;
+        final int NANOS_PER_MILLI = 1000000;
+
+        // -------- initialization --------------
+        final int BYTES_PER_FRAME = 2;
+        final int FRAMES_PER_100_MILLIS =
+                AudioTrack.getMinBufferSize(TEST_SR, TEST_CONF, TEST_FORMAT);
+        final int FRAMES_PER_SEC = FRAMES_PER_100_MILLIS * 10;
+        byte[] data = new byte[FRAMES_PER_100_MILLIS * BYTES_PER_FRAME];
+        AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
+                 FRAMES_PER_SEC * BYTES_PER_FRAME, TEST_MODE);
+        // -------- test --------------
+        assertTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
+
+        long framesWritten = 0, framesSeen = 0, framesPresented = 0;
+        long lastFramesPresented = 0, lastFrameTime = 0, lastOutputFrequency = FRAMES_PER_SEC;
+        AudioTimestamp timestamp = new AudioTimestamp();
+
+        for (int i = 0; i < TEST_LOOP_CNT; i++) {
+            for (int j = 0; j < FRAMES_PER_SEC; j += FRAMES_PER_100_MILLIS) {
+                track.write(data, 0, data.length);
+                framesWritten += FRAMES_PER_100_MILLIS;
+            }
+
+            track.play();
+            Thread.sleep(MILLIS_PER_SEC);
+            track.pause();
+
+            framesSeen = track.getPlaybackHeadPosition();
+            assertTrue(TEST_NAME, framesWritten >= framesSeen);
+
+            assertTrue(TEST_NAME, track.getTimestamp(timestamp));
+            framesPresented = timestamp.framePosition;
+            assertTrue(TEST_NAME, framesSeen >= framesPresented);
+
+            // check output frequency
+            long outFrequency = framesPresented - lastFramesPresented;
+            long freqDiff = Math.abs(FRAMES_PER_SEC - outFrequency);
+            assertTrue(TEST_NAME, freqDiff < FRAMES_PER_100_MILLIS);
+
+            // check output frequency jitter
+            freqDiff = Math.abs(outFrequency - lastOutputFrequency);
+            assertTrue(TEST_NAME, freqDiff < FRAMES_PER_100_MILLIS);
+
+            lastFramesPresented = framesPresented;
+            lastOutputFrequency = outFrequency;
+
+            long frameTime = timestamp.nanoTime;
+            assertTrue(TEST_NAME, frameTime >= lastFrameTime);
+            lastFrameTime = frameTime;
+
+            long curTime = System.nanoTime();
+            assertTrue(TEST_NAME, curTime >= frameTime);
+            assertTrue(TEST_NAME, curTime - frameTime < 100 * NANOS_PER_MILLI);
+        }
+        track.stop();
+        // -------- tear down --------------
+        track.release();
+    }
+
 /* Do not run in JB-MR1. will be re-opened in the next platform release.
     public void testResourceLeakage() throws Exception {
         final int BUFFER_SIZE = 600 * 1024;
diff --git a/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayTest.java b/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayTest.java
index 872b905..7b33b75 100755
--- a/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayTest.java
+++ b/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayTest.java
@@ -161,6 +161,25 @@
         }
     }
 
+    private static boolean hasCodec(String mimeType) {
+        int numCodecs = MediaCodecList.getCodecCount();
+        for (int i = 0; i < numCodecs; i++) {
+            MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
+
+            if (!codecInfo.isEncoder()) {
+                continue;
+            }
+
+            String[] types = codecInfo.getSupportedTypes();
+            for (int j = 0; j < types.length; j++) {
+                if (types[j].equalsIgnoreCase(mimeType)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
     /**
      * Returns true if the encoder level, specified in the ENCODER_PARAM_TABLE, can be supported.
      */
@@ -226,6 +245,11 @@
         OutputSurface outputSurface = null;
         VirtualDisplay virtualDisplay = null;
 
+        // Don't run the test of the codec isn't present.
+        if (!hasCodec(MIME_TYPE)) {
+            return;
+        }
+
         try {
             // Encoded video resolution matches virtual display.
             MediaFormat encoderFormat = MediaFormat.createVideoFormat(MIME_TYPE, sWidth, sHeight);
diff --git a/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java b/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java
index 826fa39..6635c12 100644
--- a/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java
+++ b/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java
@@ -138,6 +138,10 @@
     public void testRendering800x480Locally() throws Throwable {
         Log.i(TAG, "testRendering800x480Locally");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
+        if (maxRes == null) {
+            Log.i(TAG, "codec not supported, skipping the test");
+            return;
+        }
         if (maxRes.first >= 800 && maxRes.second >= 480) {
             runTestRenderingInSeparateThread(800, 480, false, false);
         } else {
@@ -148,6 +152,10 @@
     public void testRenderingMaxResolutionLocally() throws Throwable {
         Log.i(TAG, "testRenderingMaxResolutionLocally");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
+        if (maxRes == null) {
+            Log.i(TAG, "codec not supported, skipping the test");
+            return;
+        }
         Log.w(TAG, "Trying resolution w:" + maxRes.first + " h:" + maxRes.second);
         runTestRenderingInSeparateThread(maxRes.first, maxRes.second, false, false);
     }
@@ -155,6 +163,10 @@
     public void testRendering800x480Remotely() throws Throwable {
         Log.i(TAG, "testRendering800x480Remotely");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
+        if (maxRes == null) {
+            Log.i(TAG, "codec not supported, skipping the test");
+            return;
+        }
         if (maxRes.first >= 800 && maxRes.second >= 480) {
             runTestRenderingInSeparateThread(800, 480, true, false);
         } else {
@@ -165,6 +177,10 @@
     public void testRenderingMaxResolutionRemotely() throws Throwable {
         Log.i(TAG, "testRenderingMaxResolutionRemotely");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
+        if (maxRes == null) {
+            Log.i(TAG, "codec not supported, skipping the test");
+            return;
+        }
         Log.w(TAG, "Trying resolution w:" + maxRes.first + " h:" + maxRes.second);
         runTestRenderingInSeparateThread(maxRes.first, maxRes.second, true, false);
     }
@@ -172,6 +188,10 @@
     public void testRendering800x480RemotelyWith3Windows() throws Throwable {
         Log.i(TAG, "testRendering800x480RemotelyWith3Windows");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
+        if (maxRes == null) {
+            Log.i(TAG, "codec not supported, skipping the test");
+            return;
+        }
         if (maxRes.first >= 800 && maxRes.second >= 480) {
             runTestRenderingInSeparateThread(800, 480, true, true);
         } else {
@@ -182,6 +202,10 @@
     public void testRendering800x480LocallyWith3Windows() throws Throwable {
         Log.i(TAG, "testRendering800x480LocallyWith3Windows");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
+        if (maxRes == null) {
+            Log.i(TAG, "codec not supported, skipping the test");
+            return;
+        }
         if (maxRes.first >= 800 && maxRes.second >= 480) {
             runTestRenderingInSeparateThread(800, 480, false, true);
         } else {
@@ -400,6 +424,10 @@
     private static final int NUM_RENDERING = 10;
     private void doTestVirtualDisplayRecycles(int numDisplays) throws Exception {
         CodecInfo codecInfo = getAvcSupportedFormatInfo();
+        if (codecInfo == null) {
+            Log.i(TAG, "no codec found, skipping");
+            return;
+        }
         VirtualDisplayPresentation[] virtualDisplays = new VirtualDisplayPresentation[numDisplays];
         for (int i = 0; i < NUM_CODEC_CREATION; i++) {
             mCodecConfigReceived = false;
@@ -866,8 +894,7 @@
                         } break;
                     }
                 } catch (GlException e) {
-                    // should stop rendering
-                    mLooper.quit();
+                    //ignore as this can happen during tearing down
                 }
             }
         }
@@ -1324,6 +1351,9 @@
 
     private static CodecInfo getAvcSupportedFormatInfo() {
         MediaCodecInfo mediaCodecInfo = selectCodec(MIME_TYPE);
+        if (mediaCodecInfo == null) {
+            return null;
+        }
         CodecCapabilities cap = mediaCodecInfo.getCapabilitiesForType(MIME_TYPE);
         if (cap == null) { // not supported
             return null;
@@ -1406,6 +1436,9 @@
      */
     private Pair<Integer, Integer> checkMaxConcurrentEncodingDecodingResolution() {
         CodecInfo codecInfo = getAvcSupportedFormatInfo();
+        if (codecInfo == null) {
+            return null;
+        }
         int maxW = codecInfo.mMaxW;
         int maxH = codecInfo.mMaxH;
         if (maxW >= 1920 && maxH >= 1080) {
diff --git a/tests/tests/media/src/android/media/cts/ExtractDecodeEditEncodeMuxTest.java b/tests/tests/media/src/android/media/cts/ExtractDecodeEditEncodeMuxTest.java
index 81296e4..40b4949 100644
--- a/tests/tests/media/src/android/media/cts/ExtractDecodeEditEncodeMuxTest.java
+++ b/tests/tests/media/src/android/media/cts/ExtractDecodeEditEncodeMuxTest.java
@@ -95,6 +95,8 @@
     private boolean mCopyVideo;
     /** Whether to copy the audio from the test video. */
     private boolean mCopyAudio;
+    /** Whether to verify the audio format. */
+    private boolean mVerifyAudioFormat;
     /** Width of the output frames. */
     private int mWidth = -1;
     /** Height of the output frames. */
@@ -131,6 +133,7 @@
         setSize(1280, 720);
         setSource(R.raw.video_480x360_mp4_h264_500kbps_30fps_aac_stereo_128kbps_44100hz);
         setCopyAudio();
+        setVerifyAudioFormat();
         TestWrapper.runTest(this);
     }
 
@@ -139,6 +142,7 @@
         setSource(R.raw.video_480x360_mp4_h264_500kbps_30fps_aac_stereo_128kbps_44100hz);
         setCopyAudio();
         setCopyVideo();
+        setVerifyAudioFormat();
         TestWrapper.runTest(this);
     }
 
@@ -190,6 +194,13 @@
     }
 
     /**
+     * Sets the test to verify the output audio format.
+     */
+    private void setVerifyAudioFormat() {
+        mVerifyAudioFormat = true;
+    }
+
+    /**
      * Sets the desired frame size.
      */
     private void setSize(int width, int height) {
@@ -449,6 +460,43 @@
         if (exception != null) {
             throw exception;
         }
+
+        MediaExtractor mediaExtractor = null;
+        try {
+            mediaExtractor = new MediaExtractor();
+            mediaExtractor.setDataSource(mOutputFile);
+
+            assertEquals("incorrect number of tracks", (mCopyAudio ? 1 : 0) + (mCopyVideo ? 1 : 0),
+                    mediaExtractor.getTrackCount());
+            if (mVerifyAudioFormat) {
+                boolean foundAudio = false;
+                for (int i = 0; i < mediaExtractor.getTrackCount(); i++) {
+                    MediaFormat trackFormat = mediaExtractor.getTrackFormat(i);
+                    if (isAudioFormat(trackFormat)) {
+                        foundAudio = true;
+                        int expectedSampleRate = OUTPUT_AUDIO_SAMPLE_RATE_HZ;
+
+                        // SBR mode halves the sample rate in the format.
+                        if (OUTPUT_AUDIO_AAC_PROFILE ==
+                                MediaCodecInfo.CodecProfileLevel.AACObjectHE) {
+                            expectedSampleRate /= 2;
+                        }
+                        assertEquals("sample rates should match", expectedSampleRate,
+                                trackFormat.getInteger(MediaFormat.KEY_SAMPLE_RATE));
+                    }
+                }
+
+                assertTrue("output should have an audio track", foundAudio || !mCopyAudio);
+            }
+        } catch (IOException e) {
+            throw new IllegalStateException("exception verifying output file", e);
+        } finally {
+            if (mediaExtractor != null) {
+                mediaExtractor.release();
+            }
+        }
+
+        // TODO: Check the generated output file's video format and sample data.
     }
 
     /**
@@ -1061,8 +1109,6 @@
         if (mCopyAudio) {
             assertEquals("no frame should be pending", -1, pendingAudioDecoderOutputBufferIndex);
         }
-
-        // TODO: Check the generated output file.
     }
 
     private static boolean isVideoFormat(MediaFormat format) {
diff --git a/tests/tests/media/src/android/media/cts/MediaCodecCapabilitiesTest.java b/tests/tests/media/src/android/media/cts/MediaCodecCapabilitiesTest.java
index b75a635..142318a 100644
--- a/tests/tests/media/src/android/media/cts/MediaCodecCapabilitiesTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaCodecCapabilitiesTest.java
@@ -35,7 +35,10 @@
     private static final int PLAY_TIME_MS = 30000;
 
     public void testAvcBaseline1() throws Exception {
-        if (!supports(AVC_MIME, CodecProfileLevel.AVCProfileBaseline,
+        if (!supports(AVC_MIME, CodecProfileLevel.AVCProfileBaseline)) {
+          return;
+        }
+        if (supports(AVC_MIME, CodecProfileLevel.AVCProfileBaseline,
                 CodecProfileLevel.AVCLevel1)) {
             throw new RuntimeException("AVCLevel1 support is required by CDD");
         }
@@ -44,6 +47,9 @@
     }
 
     public void testAvcBaseline12() throws Exception {
+        if (!supports(AVC_MIME, CodecProfileLevel.AVCProfileBaseline)) {
+            return;
+        }
         if (!supports(AVC_MIME, CodecProfileLevel.AVCProfileBaseline,
                 CodecProfileLevel.AVCLevel12)) {
             Log.i(TAG, "AvcBaseline12 not supported");
@@ -59,6 +65,9 @@
     }
 
     public void testAvcBaseline30() throws Exception {
+        if (!supports(AVC_MIME, CodecProfileLevel.AVCProfileBaseline)) {
+            return;
+        }
         if (!supports(AVC_MIME, CodecProfileLevel.AVCProfileBaseline,
                 CodecProfileLevel.AVCLevel3)) {
             Log.i(TAG, "AvcBaseline30 not supported");
@@ -74,6 +83,9 @@
     }
 
     public void testAvcHigh31() throws Exception {
+        if (!supports(AVC_MIME, CodecProfileLevel.AVCProfileHigh)) {
+            return;
+        }
         if (!supports(AVC_MIME, CodecProfileLevel.AVCProfileHigh,
                 CodecProfileLevel.AVCLevel31)) {
             Log.i(TAG, "AvcHigh31 not supported");
@@ -90,6 +102,9 @@
     }
 
     public void testAvcHigh40() throws Exception {
+        if (!supports(AVC_MIME, CodecProfileLevel.AVCProfileHigh)) {
+            return;
+        }
         if (!supports(AVC_MIME, CodecProfileLevel.AVCProfileHigh,
                 CodecProfileLevel.AVCLevel4)) {
             Log.i(TAG, "AvcHigh40 not supported");
@@ -108,7 +123,15 @@
                 + "&key=test_key1", 1920, 1080, PLAY_TIME_MS);
     }
 
+    private boolean supports(String mimeType, int profile) {
+        return supports(mimeType, profile, 0, false);
+    }
+
     private boolean supports(String mimeType, int profile, int level) {
+        return supports(mimeType, profile, level, true);
+    }
+
+    private boolean supports(String mimeType, int profile, int level, boolean testLevel) {
         int numCodecs = MediaCodecList.getCodecCount();
         for (int i = 0; i < numCodecs; i++) {
             MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
@@ -119,7 +142,7 @@
             CodecCapabilities capabilities = codecInfo.getCapabilitiesForType(mimeType);
             for (CodecProfileLevel profileLevel : capabilities.profileLevels) {
                 if (profileLevel.profile == profile
-                        && profileLevel.level >= level) {
+                        && (!testLevel || profileLevel.level >= level)) {
                     return true;
                 }
             }
diff --git a/tests/tests/media/src/android/media/cts/MediaCodecListTest.java b/tests/tests/media/src/android/media/cts/MediaCodecListTest.java
index 3428e86..2ed9002 100644
--- a/tests/tests/media/src/android/media/cts/MediaCodecListTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaCodecListTest.java
@@ -241,6 +241,7 @@
         list.add(new CodecType("video/3gpp", true));            // h263 encoder
         list.add(new CodecType("video/mp4v-es", false));        // m4v decoder
         list.add(new CodecType("video/x-vnd.on2.vp8", false));  // vp8 decoder
+        list.add(new CodecType("video/x-vnd.on2.vp8", true));   // vp8 encoder
         list.add(new CodecType("video/x-vnd.on2.vp9", false));  // vp9 decoder
 
         return list;
diff --git a/tests/tests/media/src/android/media/cts/MediaCodecTest.java b/tests/tests/media/src/android/media/cts/MediaCodecTest.java
index 4b8abcd..ce85b78 100644
--- a/tests/tests/media/src/android/media/cts/MediaCodecTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaCodecTest.java
@@ -34,7 +34,7 @@
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.concurrent.atomic.AtomicBoolean;
-
+import java.util.Locale;
 
 /**
  * General MediaCodec tests.
@@ -83,6 +83,10 @@
 
         // Replace color format with something that isn't COLOR_FormatSurface.
         MediaCodecInfo codecInfo = selectCodec(MIME_TYPE);
+        if (codecInfo == null) {
+            // Pass if no codec was available.
+            return;
+        }
         int colorFormat = findNonSurfaceColorFormat(codecInfo, MIME_TYPE);
         format.setInteger(MediaFormat.KEY_COLOR_FORMAT, colorFormat);
 
@@ -133,7 +137,11 @@
         InputSurface inputSurface = null;
 
         try {
-            encoder = MediaCodec.createEncoderByType(MIME_TYPE);
+            encoder = createEncoderForMimeType(MIME_TYPE);
+            if (encoder == null) {
+                // Pass if no codec was available.
+                return;
+            }
             encoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
             inputSurface = new InputSurface(encoder.createInputSurface());
             inputSurface.makeCurrent();
@@ -181,7 +189,11 @@
         Surface surface = null;
 
         try {
-            encoder = MediaCodec.createEncoderByType(MIME_TYPE);
+            encoder = createEncoderForMimeType(MIME_TYPE);
+            if (encoder == null) {
+                // Pass if no codec was available.
+                return;
+            }
             encoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
             surface = encoder.createInputSurface();
             encoder.start();
@@ -215,7 +227,11 @@
         Surface surface = null;
 
         try {
-            encoder = MediaCodec.createEncoderByType(MIME_TYPE);
+            encoder = createEncoderForMimeType(MIME_TYPE);
+            if (encoder == null) {
+                // Pass if no codec was available.
+                return;
+            }
             encoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
             surface = encoder.createInputSurface();
             encoder.start();
@@ -289,8 +305,11 @@
             mediaExtractor = getMediaExtractorForMimeType(inputResourceId, "video/");
             MediaFormat mediaFormat =
                     mediaExtractor.getTrackFormat(mediaExtractor.getSampleTrackIndex());
-            mediaCodec =
-                    MediaCodec.createDecoderByType(mediaFormat.getString(MediaFormat.KEY_MIME));
+            mediaCodec = createDecoderForMimeType(mediaFormat.getString(MediaFormat.KEY_MIME));
+            if (mediaCodec == null) {
+              // Pass if no decoder was available.
+              return true;
+            }
             mediaCodec.configure(mediaFormat, outputSurface.getSurface(), null, 0);
             mediaCodec.start();
             boolean eos = false;
@@ -365,11 +384,15 @@
         MediaCodec audioDecoderA = null;
         MediaCodec audioDecoderB = null;
         try {
-            audioDecoderA = MediaCodec.createDecoderByType(MIME_TYPE_AUDIO);
+            audioDecoderA = createDecoderForMimeType(MIME_TYPE_AUDIO);
+            if (audioDecoderA == null) {
+              // Pass if no decoder was available.
+              return;
+            }
             audioDecoderA.configure(format, null, null, 0);
             audioDecoderA.start();
 
-            audioDecoderB = MediaCodec.createDecoderByType(MIME_TYPE_AUDIO);
+            audioDecoderB = createDecoderForMimeType(MIME_TYPE_AUDIO);
             audioDecoderB.configure(format, null, null, 0);
             audioDecoderB.start();
         } finally {
@@ -407,11 +430,19 @@
         MediaCodec audioEncoder = null;
         MediaCodec audioDecoder = null;
         try {
-            audioEncoder = MediaCodec.createEncoderByType(MIME_TYPE_AUDIO);
+            audioEncoder = createEncoderForMimeType(MIME_TYPE_AUDIO);
+            if (audioEncoder == null) {
+              // Pass if no encoder was available.
+              return;
+            }
             audioEncoder.configure(encoderFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
             audioEncoder.start();
 
-            audioDecoder = MediaCodec.createDecoderByType(MIME_TYPE_AUDIO);
+            audioDecoder = createDecoderForMimeType(MIME_TYPE_AUDIO);
+            if (audioDecoder == null) {
+              // Pass if no decoder was available.
+              return;
+            }
             audioDecoder.configure(decoderFormat, null, null, 0);
             audioDecoder.start();
         } finally {
@@ -440,6 +471,10 @@
         // audio only checks this and stop
         mVideoEncodingOngoing = true;
         final CodecInfo info = getAvcSupportedFormatInfo();
+        if (info == null) {
+            // Pass if no codec was available.
+            return;
+        }
         long start = System.currentTimeMillis();
         Thread videoEncodingThread = new Thread(new Runnable() {
             @Override
@@ -474,6 +509,9 @@
 
     private static CodecInfo getAvcSupportedFormatInfo() {
         MediaCodecInfo mediaCodecInfo = selectCodec(MIME_TYPE);
+        if (mediaCodecInfo == null) { // not supported
+            return null;
+        }
         CodecCapabilities cap = mediaCodecInfo.getCapabilitiesForType(MIME_TYPE);
         if (cap == null) { // not supported
             return null;
@@ -557,7 +595,11 @@
         InputSurface inputSurface = null;
         mVideoEncoderHadError = false;
         try {
-            encoder = MediaCodec.createEncoderByType(MIME_TYPE);
+            encoder = createEncoderForMimeType(MIME_TYPE);
+            if (encoder == null) {
+              // Pass if no encoder was available.
+              return;
+            }
             encoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
             inputSurface = new InputSurface(encoder.createInputSurface());
             inputSurface.makeCurrent();
@@ -599,7 +641,11 @@
         MediaCodec encoder = null;
         mAudioEncoderHadError = false;
         try {
-            encoder = MediaCodec.createEncoderByType(MIME_TYPE_AUDIO);
+            encoder = createEncoderForMimeType(MIME_TYPE_AUDIO);
+            if (encoder == null) {
+              // Pass if no codec was available.
+              return;
+            }
             encoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
             MediaCodec.BufferInfo info = new MediaCodec.BufferInfo();
             encoder.start();
@@ -702,6 +748,39 @@
         return 0;   // not reached
     }
 
+    /** Returns a decoder for {@code mimeType}, or {@code null} if none is available. */
+    private static MediaCodec createDecoderForMimeType(String mimeType) {
+        return createCodecForMimeType(mimeType, false);
+    }
+
+    /** Returns a encoder for {@code mimeType}, or {@code null} if none is available. */
+    private static MediaCodec createEncoderForMimeType(String mimeType) {
+        return createCodecForMimeType(mimeType, true);
+    }
+
+    /**
+     * Returns a codec for {@code mimeType}, or {@code null} if there is no suitable codec on this
+     * device. The codec is an encoder if {@code encoder} is {@code true}, and a decoder otherwise.
+     */
+    private static MediaCodec createCodecForMimeType(String mimeType, boolean encoder) {
+        mimeType = mimeType.toLowerCase(Locale.US);
+        for (int index = 0; index < MediaCodecList.getCodecCount(); index++) {
+            MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(index);
+            if (encoder != codecInfo.isEncoder()) {
+                continue;
+            }
+
+            for (String codecType : codecInfo.getSupportedTypes()) {
+                if (codecType.equals(mimeType)) {
+                    return encoder
+                            ? MediaCodec.createEncoderByType(codecType.toLowerCase(Locale.US))
+                            : MediaCodec.createDecoderByType(codecType.toLowerCase(Locale.US));
+                }
+            }
+        }
+        return null;
+    }
+
     private MediaExtractor getMediaExtractorForMimeType(int resourceId, String mimeTypePrefix)
             throws IOException {
         MediaExtractor mediaExtractor = new MediaExtractor();
diff --git a/tests/tests/media/src/android/media/cts/MediaPlayerTest.java b/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
index 0267497..c670b8c 100644
--- a/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
@@ -22,6 +22,7 @@
 import android.content.res.AssetFileDescriptor;
 import android.media.AudioManager;
 import android.media.MediaPlayer;
+import android.media.MediaPlayer.OnErrorListener;
 import android.media.MediaRecorder;
 import android.media.MediaMetadataRetriever;
 import android.media.TimedText;
@@ -30,7 +31,9 @@
 import android.media.cts.MediaPlayerTestBase.Monitor;
 import android.net.Uri;
 import android.os.Environment;
+import android.os.IBinder;
 import android.os.PowerManager;
+import android.os.ServiceManager;
 import android.os.SystemClock;
 import android.util.Log;
 
@@ -76,6 +79,35 @@
             mOutFile.delete();
         }
     }
+
+    // Bug 13652927
+    public void testVorbisCrash() throws Exception {
+        MediaPlayer mp = mMediaPlayer;
+        MediaPlayer mp2 = mMediaPlayer2;
+        AssetFileDescriptor afd2 = mResources.openRawResourceFd(R.raw.testmp3_2);
+        mp2.setDataSource(afd2.getFileDescriptor(), afd2.getStartOffset(), afd2.getLength());
+        afd2.close();
+        mp2.prepare();
+        mp2.setLooping(true);
+        mp2.start();
+
+        for (int i = 0; i < 20; i++) {
+            try {
+                AssetFileDescriptor afd = mResources.openRawResourceFd(R.raw.bug13652927);
+                mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
+                afd.close();
+                mp.prepare();
+                fail("shouldn't be here");
+            } catch (Exception e) {
+                // expected to fail
+                Log.i("@@@", "failed: " + e);
+            }
+            Thread.sleep(500);
+            assertTrue("media server died", mp2.isPlaying());
+            mp.reset();
+        }
+    }
+
     public void testPlayNullSource() throws Exception {
         try {
             mMediaPlayer.setDataSource((String) null);
diff --git a/tests/tests/media/src/android/media/cts/StreamingMediaPlayerTest.java b/tests/tests/media/src/android/media/cts/StreamingMediaPlayerTest.java
index 2c1b401..8bac442 100644
--- a/tests/tests/media/src/android/media/cts/StreamingMediaPlayerTest.java
+++ b/tests/tests/media/src/android/media/cts/StreamingMediaPlayerTest.java
@@ -116,7 +116,7 @@
                 + "0.0.0.0/ipbits/0/expire/19000000000/sparams/ip,ipbits,expire"
                 + ",id,itag,source,playlist_type/signature/773AB8ACC68A96E5AA48"
                 + "1996AD6A1BBCB70DCB87.95733B544ACC5F01A1223A837D2CF04DF85A336"
-                + "0/key/ik0", 60 * 1000);
+                + "0/key/ik0/file/m3u8", 60 * 1000);
     }
 
     // Streaming audio from local HTTP server
diff --git a/tests/tests/media/src/android/media/cts/Vp8EncoderTest.java b/tests/tests/media/src/android/media/cts/Vp8EncoderTest.java
index 14e4055..2be0fc4 100644
--- a/tests/tests/media/src/android/media/cts/Vp8EncoderTest.java
+++ b/tests/tests/media/src/android/media/cts/Vp8EncoderTest.java
@@ -19,7 +19,9 @@
 import android.content.Context;
 import android.content.res.Resources;
 import android.media.MediaCodec;
+import android.media.MediaCodecInfo;
 import android.media.MediaCodecInfo.CodecCapabilities;
+import android.media.MediaCodecList;
 import android.media.MediaFormat;
 import android.os.Bundle;
 import android.test.AndroidTestCase;
@@ -57,6 +59,28 @@
         mResources = mContext.getResources();
     }
 
+     // TODO: Make a public method selectCodec() in common libraries (e.g. cts/libs/), to avoid
+     // redundant function definitions in this and other media related test files.
+     private static boolean hasCodec(String mimeType) {
+         int numCodecs = MediaCodecList.getCodecCount();
+
+         for (int i = 0; i < numCodecs; i++) {
+             MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
+
+             if (!codecInfo.isEncoder()) {
+                 continue;
+             }
+
+             String[] types = codecInfo.getSupportedTypes();
+             for (int j = 0; j < types.length; j++) {
+                 if (types[j].equalsIgnoreCase(mimeType)) {
+                     return true;
+                 }
+             }
+         }
+         return false;
+     }
+
     /**
      * A basic test for VP8 encoder.
      *
@@ -64,6 +88,11 @@
      * and then decodes it to verify the bitstream.
      */
     public void testBasic() throws Exception {
+        if (!hasCodec(VP8_MIME)) {
+            Log.w(TAG, "Codec " + VP8_MIME + " not supported. Return from testBasic.");
+            return;
+        }
+
         encode(BASIC_IVF,
                R.raw.video_176x144_yv12,
                176,  // width
@@ -79,6 +108,11 @@
      * encoder fails. The test does not verify the output stream.
      */
     public void testSyncFrame() throws Exception {
+        if (!hasCodec(VP8_MIME)) {
+            Log.w(TAG, "Codec " + VP8_MIME + " not supported. Return from testSyncFrame.");
+            return;
+        }
+
         encodeSyncFrame(R.raw.video_176x144_yv12,
                         176, // width
                         144, // height
@@ -92,6 +126,11 @@
      * bitrate and ensure the encoder responds.
      */
     public void testVariableBitrate() throws Exception {
+        if (!hasCodec(VP8_MIME)) {
+            Log.w(TAG, "Codec " + VP8_MIME + " not supported. Return from testVariableBitrate.");
+            return;
+        }
+
         encodeVariableBitrate(R.raw.video_176x144_yv12,
                               176, // width
                               144, // height
diff --git a/tests/tests/nativemedia/sl/NativeMediaTest_SL_list.txt b/tests/tests/nativemedia/sl/NativeMediaTest_SL_list.txt
deleted file mode 100644
index c5d17a3..0000000
--- a/tests/tests/nativemedia/sl/NativeMediaTest_SL_list.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-SLObjectCreationTest.
-  testEngineCreation
-  testOutputMixCreation
-  testAudioPlayerFromUriCreation
-  testAudioPlayerFromFdCreation
-  testAudioPlayerFromPcmBqCreation
-  testAudioPlayerFromTsAbqCreation
-  testAudioPlayerFromUriToPcmBqCreation
-  testAudioPlayerFromFdToPcmBqCreation
-  testAudioPlayerFromAdtsAbqToPcmBqCreation
-  testAudioRecorderCreation
diff --git a/tests/tests/nativemedia/xa/NativeMediaTest_XA_list.txt b/tests/tests/nativemedia/xa/NativeMediaTest_XA_list.txt
deleted file mode 100644
index af8bfad..0000000
--- a/tests/tests/nativemedia/xa/NativeMediaTest_XA_list.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-XAObjectCreationTest.
-  testEngineCreation
-  testOutputMixCreation
diff --git a/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
index adb2b3a..5656119 100644
--- a/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
+++ b/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
@@ -272,9 +272,13 @@
             return;
         }
 
-        boolean isWifiConnected = mWifiManager.isWifiEnabled()
-                && mWifiManager.getConnectionInfo().getSSID() != null;
+        boolean isWifiEnabled = mWifiManager.isWifiEnabled();
+        boolean isWifiConnected = false;
 
+        NetworkInfo nwInfo = mCm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
+        if (nwInfo != null) {
+            isWifiConnected = nwInfo.isConnected();
+        }
         try {
             // Make sure WiFi is connected to an access point.
             if (!isWifiConnected) {
@@ -308,7 +312,7 @@
             // TODO wait for HIPRI to go
             // TODO check dns selection
             // TODO check routes
-            if (!isWifiConnected) {
+            if (!isWifiEnabled) {
                 mWifiManager.setWifiEnabled(false);
             }
         }
diff --git a/tests/tests/net/src/android/net/cts/VpnServiceTest.java b/tests/tests/net/src/android/net/cts/VpnServiceTest.java
index 9e35375..8bdd7b0 100644
--- a/tests/tests/net/src/android/net/cts/VpnServiceTest.java
+++ b/tests/tests/net/src/android/net/cts/VpnServiceTest.java
@@ -42,7 +42,7 @@
 
         // Should be always resolved by only one activity.
         int count = mContext.getPackageManager().queryIntentActivities(intent, 0).size();
-        assertEquals(count, 1);
+        assertEquals(1, count);
     }
 
     public void testEstablish() throws Exception {
diff --git a/tests/tests/net/src/android/net/wifi/cts/WifiEnterpriseConfigTest.java b/tests/tests/net/src/android/net/wifi/cts/WifiEnterpriseConfigTest.java
index 58298d5..6e395aa 100644
--- a/tests/tests/net/src/android/net/wifi/cts/WifiEnterpriseConfigTest.java
+++ b/tests/tests/net/src/android/net/wifi/cts/WifiEnterpriseConfigTest.java
@@ -17,6 +17,7 @@
 package android.net.wifi.cts;
 
 import android.content.Context;
+import android.content.pm.PackageManager;
 import android.net.wifi.WifiConfiguration;
 import android.net.wifi.WifiEnterpriseConfig;
 import android.net.wifi.WifiEnterpriseConfig.Eap;
@@ -34,6 +35,11 @@
     private static final String ANON_IDENTITY = "anonidentity";
     private static final int ENABLE_DELAY = 10000;
 
+    private boolean hasWifi() {
+        return getContext().getPackageManager().hasSystemFeature(
+                PackageManager.FEATURE_WIFI);
+    }
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -42,10 +48,16 @@
         assertNotNull(mWifiManager);
         mWifiManager.setWifiEnabled(true);
         Thread.sleep(ENABLE_DELAY);
-        assertTrue(mWifiManager.isWifiEnabled());
+        if (hasWifi()) {
+            assertTrue(mWifiManager.isWifiEnabled());
+        }
     }
 
     public void testSettersAndGetters() {
+        if (!hasWifi()) {
+            return;
+        }
+
         WifiEnterpriseConfig config = new WifiEnterpriseConfig();
         assertTrue(config.getEapMethod() == Eap.NONE);
         config.setEapMethod(Eap.PEAP);
@@ -78,6 +90,10 @@
     }
 
     public void testAddEapNetwork() {
+        if (!hasWifi()) {
+            return;
+        }
+
         WifiConfiguration config = new WifiConfiguration();
         WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
         enterpriseConfig.setEapMethod(Eap.PWD);
diff --git a/tests/tests/os/src/android/os/cts/BuildVersionTest.java b/tests/tests/os/src/android/os/cts/BuildVersionTest.java
index 1e7503c..bee12b1 100644
--- a/tests/tests/os/src/android/os/cts/BuildVersionTest.java
+++ b/tests/tests/os/src/android/os/cts/BuildVersionTest.java
@@ -29,8 +29,8 @@
 
     private static final String LOG_TAG = "BuildVersionTest";
     private static final Set<String> EXPECTED_RELEASES =
-            new HashSet<String>(Arrays.asList("4.4", "4.4.1", "4.4.2"));
-    private static final int EXPECTED_SDK = 19;
+        new HashSet<String>(Arrays.asList("4.4W", "4.4", "4.4.1", "4.4.2", "4.4.3"));
+    private static final int EXPECTED_SDK = 20;
 
     @SuppressWarnings("deprecation")
     public void testReleaseVersion() {
diff --git a/tests/tests/permission/src/android/permission/cts/AppWidgetManagerPermissionTest.java b/tests/tests/permission/src/android/permission/cts/AppWidgetManagerPermissionTest.java
index a290f6a..4223f08 100644
--- a/tests/tests/permission/src/android/permission/cts/AppWidgetManagerPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/AppWidgetManagerPermissionTest.java
@@ -18,6 +18,7 @@
 
 import android.appwidget.AppWidgetManager;
 import android.content.ComponentName;
+import android.content.pm.PackageManager;
 import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.SmallTest;
 
@@ -44,6 +45,11 @@
      */
     @SmallTest
     public void testBindAppWidget() {
+        if (!getContext().getPackageManager()
+                .hasSystemFeature(PackageManager.FEATURE_APP_WIDGETS)) {
+            return;
+        }
+
         try {
             mAppWidgetManager.bindAppWidgetId(1, new ComponentName(mContext, "foo"));
             fail("Was able to call bindAppWidgetId");
diff --git a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
index 354fbaf..85af555 100755
--- a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
@@ -446,6 +446,7 @@
                     "/data/logs",
                     "/data/logs/core",
                     "/data/lost+found",
+                    "/data/mdl",
                     "/data/misc",
                     "/data/misc/bluetooth",
                     "/data/misc/dhcp",
@@ -733,7 +734,8 @@
                 new File("/dev/alarm"),      // b/9035217
                 new File("/dev/ashmem"),
                 new File("/dev/binder"),
-                new File("/dev/quadd"),      // b/11336334
+                new File("/dev/card0"),       // b/13159510
+                new File("/dev/dri/card0"),   // b/13159510
                 new File("/dev/felica"),     // b/11142586
                 new File("/dev/felica_ant"), // b/11142586
                 new File("/dev/felica_cen"), // b/11142586
@@ -754,10 +756,10 @@
                 new File("/dev/log/radio"),  // b/9035217
                 new File("/dev/log/system"), // b/9035217
                 new File("/dev/mali0"),       // b/9106968
+                new File("/dev/mali"),        // b/11142586
                 new File("/dev/mm_interlock"), // b/12955573
                 new File("/dev/mm_isp"),      // b/12955573
                 new File("/dev/mm_v3d"),      // b/12955573
-                new File("/dev/mali"),        // b/11142586
                 new File("/dev/msm_rotator"), // b/9035217
                 new File("/dev/null"),
                 new File("/dev/nvhost-as-gpu"),
diff --git a/tests/tests/permission/src/android/permission/cts/NoLocationPermissionTest.java b/tests/tests/permission/src/android/permission/cts/NoLocationPermissionTest.java
index da9057e..b5a4f24 100644
--- a/tests/tests/permission/src/android/permission/cts/NoLocationPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/NoLocationPermissionTest.java
@@ -19,6 +19,7 @@
 import android.app.PendingIntent;
 import android.content.Context;
 import android.content.Intent;
+import android.content.pm.PackageManager;
 import android.location.Location;
 import android.location.LocationListener;
 import android.location.LocationManager;
@@ -39,6 +40,7 @@
 
     private LocationManager mLocationManager;
     private List<String> mAllProviders;
+    private boolean mHasTelephony;
 
     @Override
     protected void setUp() throws Exception {
@@ -46,6 +48,8 @@
         mLocationManager = (LocationManager) getContext().getSystemService(
                 Context.LOCATION_SERVICE);
         mAllProviders = mLocationManager.getAllProviders();
+        mHasTelephony = getContext().getPackageManager().hasSystemFeature(
+                PackageManager.FEATURE_TELEPHONY);
 
         assertNotNull(mLocationManager);
         assertNotNull(mAllProviders);
@@ -63,6 +67,10 @@
      */
     @SmallTest
     public void testListenCellLocation() {
+        if (!mHasTelephony) {
+            return;
+        }
+
         TelephonyManager telephonyManager = (TelephonyManager) getContext().getSystemService(
                 Context.TELEPHONY_SERVICE);
         PhoneStateListener phoneStateListener = new PhoneStateListener();
@@ -90,6 +98,10 @@
      */
     @SmallTest
     public void testListenCellLocation2() {
+        if (!mHasTelephony) {
+            return;
+        }
+
         TelephonyManager telephonyManager = (TelephonyManager) getContext().getSystemService(
                 Context.TELEPHONY_SERVICE);
         PhoneStateListener phoneStateListener = new PhoneStateListener();
diff --git a/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java b/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java
index 2e09a49..9441319 100644
--- a/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java
@@ -52,14 +52,14 @@
             int lineCt = 0;
             String line;
             while ((line = reader.readLine()) != null) {
-                if (!line.startsWith("--------- beginning of /dev/log")) {
+                if (!line.startsWith("--------- beginning of ")) {
                     lineCt++;
                 }
             }
 
             // no permission get an empty log buffer.
             // Logcat returns only one line:
-            // "--------- beginning of /dev/log/main"
+            // "--------- beginning of <log device>"
 
             assertEquals("Unexpected logcat entries. Are you running the "
                        + "the latest logger.c from the Android kernel?",
diff --git a/tests/tests/permission/src/android/permission/cts/NoSystemFunctionPermissionTest.java b/tests/tests/permission/src/android/permission/cts/NoSystemFunctionPermissionTest.java
index 17f916a..9eec0ac 100644
--- a/tests/tests/permission/src/android/permission/cts/NoSystemFunctionPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/NoSystemFunctionPermissionTest.java
@@ -20,6 +20,7 @@
 import android.app.ActivityManager;
 import android.app.AlarmManager;
 import android.content.Context;
+import android.content.pm.PackageManager;
 import android.graphics.Bitmap;
 import android.os.Vibrator;
 import android.telephony.gsm.SmsManager;
@@ -146,6 +147,10 @@
      */
     @SmallTest
     public void testSendSms() {
+        if (!getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
+            return;
+        }
+
         SmsManager smsManager = SmsManager.getDefault();
         byte[] testData = new byte[10];
         try {
diff --git a/tests/tests/permission/src/android/permission/cts/TelephonyManagerPermissionTest.java b/tests/tests/permission/src/android/permission/cts/TelephonyManagerPermissionTest.java
index 4c116dd..2681c0f 100644
--- a/tests/tests/permission/src/android/permission/cts/TelephonyManagerPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/TelephonyManagerPermissionTest.java
@@ -17,6 +17,7 @@
 package android.permission.cts;
 
 import android.content.Context;
+import android.content.pm.PackageManager;
 import android.telephony.TelephonyManager;
 import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.SmallTest;
@@ -26,11 +27,14 @@
  */
 public class TelephonyManagerPermissionTest extends AndroidTestCase {
 
+    private boolean mHasTelephony;
     TelephonyManager mTelephonyManager = null;
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
+        mHasTelephony = getContext().getPackageManager().hasSystemFeature(
+                PackageManager.FEATURE_TELEPHONY);
         mTelephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
         assertNotNull(mTelephonyManager);
     }
@@ -43,6 +47,10 @@
      */
     @SmallTest
     public void testGetDeviceId() {
+        if (!mHasTelephony) {
+            return;
+        }
+
         try {
             String id = mTelephonyManager.getDeviceId();
             fail("Got device ID: " + id);
@@ -59,6 +67,10 @@
      */
     @SmallTest
     public void testGetLine1Number() {
+        if (!mHasTelephony) {
+            return;
+        }
+
         try {
             String nmbr = mTelephonyManager.getLine1Number();
             fail("Got line 1 number: " + nmbr);
@@ -75,6 +87,10 @@
      */
     @SmallTest
     public void testGetSimSerialNumber() {
+        if (!mHasTelephony) {
+            return;
+        }
+
         try {
             String nmbr = mTelephonyManager.getSimSerialNumber();
             fail("Got SIM serial number: " + nmbr);
@@ -91,6 +107,10 @@
      */
     @SmallTest
     public void testGetSubscriberId() {
+        if (!mHasTelephony) {
+            return;
+        }
+
         try {
             String sid = mTelephonyManager.getSubscriberId();
             fail("Got subscriber id: " + sid);
@@ -107,6 +127,10 @@
      */
     @SmallTest
     public void testVoiceMailNumber() {
+        if (!mHasTelephony) {
+            return;
+        }
+
         try {
             String vmnum = mTelephonyManager.getVoiceMailNumber();
             fail("Got voicemail number: " + vmnum);
diff --git a/tests/tests/permission2/src/android/permission2/cts/NoProcessOutgoingCallPermissionTest.java b/tests/tests/permission2/src/android/permission2/cts/NoProcessOutgoingCallPermissionTest.java
index 4a124e7..956f1a6 100644
--- a/tests/tests/permission2/src/android/permission2/cts/NoProcessOutgoingCallPermissionTest.java
+++ b/tests/tests/permission2/src/android/permission2/cts/NoProcessOutgoingCallPermissionTest.java
@@ -20,6 +20,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.pm.PackageManager;
 import android.net.Uri;
 import android.os.Bundle;
 import android.test.AndroidTestCase;
@@ -51,6 +52,12 @@
      */
     // TODO: add back to LargeTest when test can cancel initiated call
     public void testProcessOutgoingCall() {
+        final PackageManager pm = getContext().getPackageManager();
+        if (!pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY) ||
+                !pm.hasSystemFeature(PackageManager.FEATURE_SIP_VOIP)) {
+            return;
+        }
+
         Log.i(LOG_TAG, "Beginning testProcessOutgoingCall");
         OutgoingCallBroadcastReceiver rcvr = new OutgoingCallBroadcastReceiver();
         Intent ntnt = mContext.registerReceiver(rcvr,
diff --git a/tests/tests/provider/src/android/provider/cts/Contacts_PeopleTest.java b/tests/tests/provider/src/android/provider/cts/Contacts_PeopleTest.java
index d634d30..e5085b8 100644
--- a/tests/tests/provider/src/android/provider/cts/Contacts_PeopleTest.java
+++ b/tests/tests/provider/src/android/provider/cts/Contacts_PeopleTest.java
@@ -28,10 +28,12 @@
 import android.net.Uri;
 import android.os.RemoteException;
 import android.provider.Contacts;
+import android.provider.Contacts.GroupMembership;
 import android.provider.Contacts.Groups;
 import android.provider.Contacts.GroupsColumns;
 import android.provider.Contacts.People;
 import android.test.InstrumentationTestCase;
+import android.util.Log;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -53,9 +55,6 @@
     private static final int PEOPLE_ID_INDEX = 0;
     private static final int PEOPLE_LAST_CONTACTED_INDEX = 1;
 
-    private static final int MEMBERSHIP_PERSON_ID_INDEX = 1;
-    private static final int MEMBERSHIP_GROUP_ID_INDEX = 5;
-
     private static final String[] GROUPS_PROJECTION = new String[] {
         Groups._ID,
         Groups.NAME
@@ -127,13 +126,19 @@
             mRowsAdded.add(People.addToMyContactsGroup(mContentResolver, personId));
             cursor = mProvider.query(Groups.CONTENT_URI, GROUPS_PROJECTION,
                     Groups.SYSTEM_ID + "='" + Groups.GROUP_MY_CONTACTS + "'", null, null, null);
-            cursor.moveToFirst();
+            assertTrue(cursor.moveToFirst());
             int groupId = cursor.getInt(GROUPS_ID_INDEX);
             cursor.close();
             cursor = People.queryGroups(mContentResolver, personId);
-            cursor.moveToFirst();
-            assertEquals(personId, cursor.getInt(MEMBERSHIP_PERSON_ID_INDEX));
-            assertEquals(groupId, cursor.getInt(MEMBERSHIP_GROUP_ID_INDEX));
+
+            int membershipGroupIdIndex =
+                    cursor.getColumnIndex(android.provider.Contacts.GroupMembership.GROUP_ID);
+            int membershipPersonIdIndex =
+                    cursor.getColumnIndex(android.provider.Contacts.GroupMembership.PERSON_ID);
+
+            assertTrue(cursor.moveToFirst());
+            assertEquals(personId, cursor.getInt(membershipPersonIdIndex));
+            assertEquals(groupId, cursor.getInt(membershipGroupIdIndex));
             cursor.close();
 
             // People: test_people_create, Group: Groups.GROUP_MY_CONTACTS
@@ -145,38 +150,38 @@
             cursor = mProvider.query(People.CONTENT_URI, PEOPLE_PROJECTION,
                     People.NAME + " = 'test_people_create'", null, null, null);
 
-            cursor.moveToFirst();
+            assertTrue(cursor.moveToFirst());
             personId = cursor.getInt(PEOPLE_ID_INDEX);
             mRowsAdded.add(ContentUris.withAppendedId(People.CONTENT_URI, personId));
             cursor.close();
             cursor = mProvider.query(Groups.CONTENT_URI, GROUPS_PROJECTION,
                     Groups.SYSTEM_ID + "='" + Groups.GROUP_MY_CONTACTS + "'", null, null, null);
-            cursor.moveToFirst();
+            assertTrue(cursor.moveToFirst());
             groupId = cursor.getInt(GROUPS_ID_INDEX);
             cursor.close();
             cursor = People.queryGroups(mContentResolver, personId);
-            cursor.moveToFirst();
-            assertEquals(personId, cursor.getInt(MEMBERSHIP_PERSON_ID_INDEX));
-            assertEquals(groupId, cursor.getInt(MEMBERSHIP_GROUP_ID_INDEX));
+            assertTrue(cursor.moveToFirst());
+            assertEquals(personId, cursor.getInt(membershipPersonIdIndex));
+            assertEquals(groupId, cursor.getInt(membershipGroupIdIndex));
             cursor.close();
 
             // People: test_people_1, Group: test_group_0
             cursor = mProvider.query(mPeopleRowsAdded.get(1), PEOPLE_PROJECTION,
                     null, null, null, null);
-            cursor.moveToFirst();
+            assertTrue(cursor.moveToFirst());
             personId = cursor.getInt(PEOPLE_ID_INDEX);
             cursor.close();
             cursor = mProvider.query(mGroupRowsAdded.get(0), GROUPS_PROJECTION,
                     null, null, null, null);
-            cursor.moveToFirst();
+            assertTrue(cursor.moveToFirst());
             groupId = cursor.getInt(GROUPS_ID_INDEX);
             cursor.close();
             mRowsAdded.add(People.addToGroup(mContentResolver, personId, groupId));
             cursor = People.queryGroups(mContentResolver, personId);
             boolean found = false;
             while (cursor.moveToNext()) {
-                assertEquals(personId, cursor.getInt(MEMBERSHIP_PERSON_ID_INDEX));
-                if (cursor.getInt(MEMBERSHIP_GROUP_ID_INDEX) == groupId) {
+                assertEquals(personId, cursor.getInt(membershipPersonIdIndex));
+                if (cursor.getInt(membershipGroupIdIndex) == groupId) {
                     found = true;
                     break;
                 }
@@ -188,7 +193,7 @@
             // People: test_people_2, Group: test_group_1
             cursor = mProvider.query(mPeopleRowsAdded.get(2), PEOPLE_PROJECTION,
                     null, null, null, null);
-            cursor.moveToFirst();
+            assertTrue(cursor.moveToFirst());
             personId = cursor.getInt(PEOPLE_ID_INDEX);
             cursor.close();
             String groupName = "test_group_1";
@@ -196,8 +201,8 @@
             cursor = People.queryGroups(mContentResolver, personId);
             List<Integer> groupIds = new ArrayList<Integer>();
             while (cursor.moveToNext()) {
-                assertEquals(personId, cursor.getInt(MEMBERSHIP_PERSON_ID_INDEX));
-                groupIds.add(cursor.getInt(MEMBERSHIP_GROUP_ID_INDEX));
+                assertEquals(personId, cursor.getInt(membershipPersonIdIndex));
+                groupIds.add(cursor.getInt(membershipGroupIdIndex));
             }
             cursor.close();
 
diff --git a/tests/tests/provider/src/android/provider/cts/MediaStore_Images_MediaTest.java b/tests/tests/provider/src/android/provider/cts/MediaStore_Images_MediaTest.java
index e68286f..3f28a34 100644
--- a/tests/tests/provider/src/android/provider/cts/MediaStore_Images_MediaTest.java
+++ b/tests/tests/provider/src/android/provider/cts/MediaStore_Images_MediaTest.java
@@ -78,6 +78,13 @@
 
         mHelper = new FileCopyHelper(mContext);
         mRowsAdded = new ArrayList<Uri>();
+
+        String campath = Environment.getExternalStorageDirectory() + File.separator +
+                Environment.DIRECTORY_DCIM + File.separator + "Camera";
+        File camfile = new File(campath);
+        if (!camfile.exists()) {
+            assertTrue("failed to create " + campath, camfile.mkdir());
+        }
     }
 
     public void testInsertImageWithImagePath() throws Exception {
diff --git a/tests/tests/provider/src/android/provider/cts/MediaStore_Images_ThumbnailsTest.java b/tests/tests/provider/src/android/provider/cts/MediaStore_Images_ThumbnailsTest.java
index 60bf011..3819cff 100644
--- a/tests/tests/provider/src/android/provider/cts/MediaStore_Images_ThumbnailsTest.java
+++ b/tests/tests/provider/src/android/provider/cts/MediaStore_Images_ThumbnailsTest.java
@@ -69,6 +69,13 @@
 
         mHelper = new FileCopyHelper(mContext);
         mRowsAdded = new ArrayList<Uri>();
+
+        String campath = Environment.getExternalStorageDirectory() + File.separator +
+                Environment.DIRECTORY_DCIM + File.separator + "Camera";
+        File camfile = new File(campath);
+        if (!camfile.exists()) {
+            assertTrue("failed to create " + campath, camfile.mkdir());
+        }
     }
 
     public void testQueryInternalThumbnails() throws Exception {
diff --git a/tests/tests/provider/src/android/provider/cts/MediaStore_Video_ThumbnailsTest.java b/tests/tests/provider/src/android/provider/cts/MediaStore_Video_ThumbnailsTest.java
index 287551c..ac0bc03 100644
--- a/tests/tests/provider/src/android/provider/cts/MediaStore_Video_ThumbnailsTest.java
+++ b/tests/tests/provider/src/android/provider/cts/MediaStore_Video_ThumbnailsTest.java
@@ -22,22 +22,49 @@
 import android.content.ContentUris;
 import android.content.ContentValues;
 import android.database.Cursor;
+import android.media.MediaCodecInfo;
+import android.media.MediaCodecList;
 import android.net.Uri;
 import android.os.Environment;
 import android.provider.MediaStore.Video.Media;
 import android.provider.MediaStore.Video.Thumbnails;
 import android.provider.MediaStore.Video.VideoColumns;
 import android.test.AndroidTestCase;
+import android.util.Log;
 
 import java.io.File;
 import java.io.IOException;
 
 public class MediaStore_Video_ThumbnailsTest extends AndroidTestCase {
+    private static final String TAG = "MediaStore_Video_ThumbnailsTest";
+    private static final String MIME_TYPE = "video/3gpp";
 
     private ContentResolver mResolver;
 
     private FileCopyHelper mFileHelper;
 
+    // TODO: Make a public method selectCodec() in common libraries (e.g. cts/libs/), to avoid
+    // redundant function definitions in this and other media related test files.
+    private static boolean hasCodec(String mimeType) {
+        int numCodecs = MediaCodecList.getCodecCount();
+
+        for (int i = 0; i < numCodecs; i++) {
+            MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
+
+            if (!codecInfo.isEncoder()) {
+                continue;
+            }
+
+            String[] types = codecInfo.getSupportedTypes();
+            for (int j = 0; j < types.length; j++) {
+                if (types[j].equalsIgnoreCase(mimeType)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -69,6 +96,14 @@
         // Get the current thumbnail count for future comparison.
         int count = getThumbnailCount(Thumbnails.EXTERNAL_CONTENT_URI);
 
+        // Don't run the test if the codec isn't supported.
+        if (!hasCodec(MIME_TYPE)) {
+            // Calling getThumbnail should not generate a new thumbnail.
+            assertNull(Thumbnails.getThumbnail(mResolver, videoId, Thumbnails.MINI_KIND, null));
+            Log.w(TAG, "Codec " + MIME_TYPE + " not supported. Return from testGetThumbnail.");
+            return;
+        }
+
         // Calling getThumbnail should generate a new thumbnail.
         assertNotNull(Thumbnails.getThumbnail(mResolver, videoId, Thumbnails.MINI_KIND, null));
         assertNotNull(Thumbnails.getThumbnail(mResolver, videoId, Thumbnails.MICRO_KIND, null));
diff --git a/tests/tests/security/Android.mk b/tests/tests/security/Android.mk
index cd1d8d0..f1a6bfb 100644
--- a/tests/tests/security/Android.mk
+++ b/tests/tests/security/Android.mk
@@ -20,12 +20,11 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner guava ctstestserver
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner guava
 
 LOCAL_JNI_SHARED_LIBRARIES := libctssecurity_jni
 
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    src/android/security/cts/activity/ISecureRandomService.aidl
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_PACKAGE_NAME := CtsSecurityTestCases
 
diff --git a/tests/tests/security/AndroidManifest.xml b/tests/tests/security/AndroidManifest.xml
index 0b9baf2..101c01c 100644
--- a/tests/tests/security/AndroidManifest.xml
+++ b/tests/tests/security/AndroidManifest.xml
@@ -18,7 +18,6 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.android.cts.security">
 
-    <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
     <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
     <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
@@ -30,13 +29,11 @@
                  android:process=":death_test_service"
                  android:isolatedProcess="true"
                  android:exported="true"/>
-        <service android:name="android.security.cts.activity.SecureRandomService"
-                 android:process=":secureRandom"/>
     </application>
 
     <instrumentation android:name="android.test.InstrumentationCtsTestRunner"
-                     android:targetPackage="com.android.cts.security"
-                     android:label="CTS tests of com.android.cts.security"/>
+                     android:targetPackage="com.android.cts.stub"
+                     android:label="CTS tests of com.android.cts.stub"/>
 
 </manifest>
 
diff --git a/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp b/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp
index a98e632..46c3fc4 100644
--- a/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp
+++ b/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp
@@ -15,13 +15,21 @@
  */
 
 #include <jni.h>
+#include <netlink.h>
+#include <sock_diag.h>
+#include <stdio.h>
+#include <sys/socket.h>
 #include <sys/types.h>
-#include <unistd.h>
 #include <sys/syscall.h>
 #include <sys/prctl.h>
 #include <sys/ptrace.h>
 #include <sys/wait.h>
 #include <signal.h>
+#include <unistd.h>
+#include <errno.h>
+
+#define PASSED 0
+#define UNKNOWN_ERROR -1
 #include <stdlib.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
@@ -219,16 +227,114 @@
     return result;
 }
 
+/*
+ * Will hang if vulnerable, return 0 if successful, -1 on unforseen
+ * error.
+ */
+static jint android_security_cts_NativeCodeTest_doSockDiagTest(JNIEnv* env, jobject thiz)
+{
+    int fd, nlmsg_size, err, len;
+    char buf[1024];
+    struct sockaddr_nl nladdr;
+    struct nlmsghdr *nlh;
+    struct msghdr msg;
+    struct iovec iov;
+    struct sock_diag_req* sock_diag_data;
+
+    fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG);
+    if (fd == -1) {
+        switch (errno) {
+            /* NETLINK_SOCK_DIAG not accessible, vector dne */
+            case EACCES:
+            case EAFNOSUPPORT:
+            case EPERM:
+            case EPROTONOSUPPORT:
+                return PASSED;
+            default:
+                return UNKNOWN_ERROR;
+        }
+    }
+    /* prepare and send netlink packet */
+    memset(&nladdr, 0, sizeof(nladdr));
+    nladdr.nl_family = AF_NETLINK;
+    nlmsg_size = NLMSG_ALIGN(NLMSG_HDRLEN + sizeof(sock_diag_data));
+    nlh = (nlmsghdr *)malloc(nlmsg_size);
+    nlh->nlmsg_len = nlmsg_size;
+    nlh->nlmsg_pid = 0;      //send packet to kernel
+    nlh->nlmsg_type = SOCK_DIAG_BY_FAMILY;
+    nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
+    iov = { (void *) nlh, nlmsg_size };
+    msg = { (void *) &nladdr, sizeof(nladdr), &iov, 1, NULL, 0, 0 };
+    sock_diag_data = (sock_diag_req *) NLMSG_DATA(nlh);
+    sock_diag_data->sdiag_family = AF_MAX+1;
+    if ((err = sendmsg(fd, &msg, 0)) == -1) {
+        /* SELinux blocked it */
+        if (errno == 22) {
+            return PASSED;
+        } else {
+            return UNKNOWN_ERROR;
+        }
+    }
+    free(nlh);
+
+    memset(&nladdr, 0, sizeof(nladdr));
+    iov = { buf, sizeof(buf) };
+    msg = { (void *) &nladdr, sizeof(nladdr), &iov, 1, NULL, 0, 0 };
+    if ((len = recvmsg(fd, &msg, 0)) == -1) {
+        return UNKNOWN_ERROR;
+    }
+    for (nlh = (struct nlmsghdr *) buf; NLMSG_OK(nlh, len); nlh = NLMSG_NEXT (nlh, len)){
+        if (nlh->nlmsg_type == NLMSG_ERROR) {
+            /* -22 = -EINVAL from kernel */
+            if (*(int *)NLMSG_DATA(nlh) == -22) {
+                return PASSED;
+            }
+        }
+    }
+    return UNKNOWN_ERROR;
+}
+
+/* This isn't defined in linux/futex.h on JB */
+#define FUTEX_CMP_REQUEUE_PI    12
+
+static inline int futex_syscall(volatile int* uaddr, int op, int val, const struct timespec* ts,
+                                volatile int* uaddr2, int val3) {
+    return syscall(__NR_futex, uaddr, op, val, ts, uaddr2, val3);
+}
+
+/*
+ * Test for vulnerability to CVE-2014-3153, a bug in the futex() syscall that can
+ * lead to privilege escalation and was used by the towelroot exploit. Returns true
+ * if device is patched, false if still vulnerable.
+ */
+static jboolean android_security_cts_NativeCodeTest_doFutexTest(JNIEnv*, jobject)
+{
+    jboolean result = false;
+
+    int futex = 1;
+    int ret;
+
+    /* The patch will reject FUTEX_CMP_REQUEUE_PI calls where addr == addr2, so
+     * that's what we're checking for - they're both &futex. Patched systems will
+     * return -1 and set errno to 22 (EINVAL), vulnerable systems will return 0.
+     */
+    ret = futex_syscall(&futex, FUTEX_CMP_REQUEUE_PI, 1, NULL, &futex, 0);
+    return (ret == -1 && errno == EINVAL);
+}
 
 static JNINativeMethod gMethods[] = {
     {  "doPerfEventTest", "()Z",
             (void *) android_security_cts_NativeCodeTest_doPerfEventTest },
     {  "doPerfEventTest2", "()Z",
             (void *) android_security_cts_NativeCodeTest_doPerfEventTest2 },
+    {  "doSockDiagTest", "()I",
+            (void *) android_security_cts_NativeCodeTest_doSockDiagTest },
     {  "doVrootTest", "()Z",
             (void *) android_security_cts_NativeCodeTest_doVrootTest },
     {  "doCVE20141710Test", "()Z",
             (void *) android_security_cts_NativeCodeTest_doCVE20141710Test },
+    {  "doFutexTest", "()Z",
+            (void *) android_security_cts_NativeCodeTest_doFutexTest },
 };
 
 int register_android_security_cts_NativeCodeTest(JNIEnv* env)
diff --git a/tests/tests/security/jni/netlink.h b/tests/tests/security/jni/netlink.h
new file mode 100644
index 0000000..b5567b0
--- /dev/null
+++ b/tests/tests/security/jni/netlink.h
@@ -0,0 +1,170 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI__LINUX_NETLINK_H
+#define _UAPI__LINUX_NETLINK_H
+#include <linux/kernel.h>
+#include <linux/socket.h>
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#include <linux/types.h>
+#define NETLINK_ROUTE 0
+#define NETLINK_UNUSED 1
+#define NETLINK_USERSOCK 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NETLINK_FIREWALL 3
+#define NETLINK_SOCK_DIAG 4
+#define NETLINK_NFLOG 5
+#define NETLINK_XFRM 6
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NETLINK_SELINUX 7
+#define NETLINK_ISCSI 8
+#define NETLINK_AUDIT 9
+#define NETLINK_FIB_LOOKUP 10
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NETLINK_CONNECTOR 11
+#define NETLINK_NETFILTER 12
+#define NETLINK_IP6_FW 13
+#define NETLINK_DNRTMSG 14
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NETLINK_KOBJECT_UEVENT 15
+#define NETLINK_GENERIC 16
+#define NETLINK_SCSITRANSPORT 18
+#define NETLINK_ECRYPTFS 19
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NETLINK_RDMA 20
+#define NETLINK_CRYPTO 21
+#define NETLINK_INET_DIAG NETLINK_SOCK_DIAG
+#define MAX_LINKS 32
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct sockaddr_nl {
+ __kernel_sa_family_t nl_family;
+ unsigned short nl_pad;
+ __u32 nl_pid;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 nl_groups;
+};
+struct nlmsghdr {
+ __u32 nlmsg_len;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 nlmsg_type;
+ __u16 nlmsg_flags;
+ __u32 nlmsg_seq;
+ __u32 nlmsg_pid;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+};
+#define NLM_F_REQUEST 1
+#define NLM_F_MULTI 2
+#define NLM_F_ACK 4
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NLM_F_ECHO 8
+#define NLM_F_DUMP_INTR 16
+#define NLM_F_ROOT 0x100
+#define NLM_F_MATCH 0x200
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NLM_F_ATOMIC 0x400
+#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
+#define NLM_F_REPLACE 0x100
+#define NLM_F_EXCL 0x200
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NLM_F_CREATE 0x400
+#define NLM_F_APPEND 0x800
+#define NLMSG_ALIGNTO 4U
+#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
+#define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN)
+#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
+#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len),   (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
+#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) &&   (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) &&   (nlh)->nlmsg_len <= (len))
+#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
+#define NLMSG_NOOP 0x1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NLMSG_ERROR 0x2
+#define NLMSG_DONE 0x3
+#define NLMSG_OVERRUN 0x4
+#define NLMSG_MIN_TYPE 0x10
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct nlmsgerr {
+ int error;
+ struct nlmsghdr msg;
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NETLINK_ADD_MEMBERSHIP 1
+#define NETLINK_DROP_MEMBERSHIP 2
+#define NETLINK_PKTINFO 3
+#define NETLINK_BROADCAST_ERROR 4
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NETLINK_NO_ENOBUFS 5
+#define NETLINK_RX_RING 6
+#define NETLINK_TX_RING 7
+struct nl_pktinfo {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 group;
+};
+struct nl_mmap_req {
+ unsigned int nm_block_size;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned int nm_block_nr;
+ unsigned int nm_frame_size;
+ unsigned int nm_frame_nr;
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct nl_mmap_hdr {
+ unsigned int nm_status;
+ unsigned int nm_len;
+ __u32 nm_group;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u32 nm_pid;
+ __u32 nm_uid;
+ __u32 nm_gid;
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum nl_mmap_status {
+ NL_MMAP_STATUS_UNUSED,
+ NL_MMAP_STATUS_RESERVED,
+ NL_MMAP_STATUS_VALID,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NL_MMAP_STATUS_COPY,
+ NL_MMAP_STATUS_SKIP,
+};
+#define NL_MMAP_MSG_ALIGNMENT NLMSG_ALIGNTO
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NL_MMAP_MSG_ALIGN(sz) __ALIGN_KERNEL(sz, NL_MMAP_MSG_ALIGNMENT)
+#define NL_MMAP_HDRLEN NL_MMAP_MSG_ALIGN(sizeof(struct nl_mmap_hdr))
+#define NET_MAJOR 36
+enum {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ NETLINK_UNCONNECTED = 0,
+ NETLINK_CONNECTED,
+};
+struct nlattr {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __u16 nla_len;
+ __u16 nla_type;
+};
+#define NLA_F_NESTED (1 << 15)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NLA_F_NET_BYTEORDER (1 << 14)
+#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
+#define NLA_ALIGNTO 4
+#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
+#endif
diff --git a/tests/tests/security/jni/sock_diag.h b/tests/tests/security/jni/sock_diag.h
new file mode 100644
index 0000000..0dc2902
--- /dev/null
+++ b/tests/tests/security/jni/sock_diag.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI__SOCK_DIAG_H__
+#define _UAPI__SOCK_DIAG_H__
+#include <linux/types.h>
+#define SOCK_DIAG_BY_FAMILY 20
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+struct sock_diag_req {
+ __u8 sdiag_family;
+ __u8 sdiag_protocol;
+};
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+enum {
+ SK_MEMINFO_RMEM_ALLOC,
+ SK_MEMINFO_RCVBUF,
+ SK_MEMINFO_WMEM_ALLOC,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ SK_MEMINFO_SNDBUF,
+ SK_MEMINFO_FWD_ALLOC,
+ SK_MEMINFO_WMEM_QUEUED,
+ SK_MEMINFO_OPTMEM,
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ SK_MEMINFO_BACKLOG,
+ SK_MEMINFO_VARS,
+};
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/tests/tests/security/src/android/security/cts/NativeCodeTest.java b/tests/tests/security/src/android/security/cts/NativeCodeTest.java
index a9fd821..1bdc16c 100644
--- a/tests/tests/security/src/android/security/cts/NativeCodeTest.java
+++ b/tests/tests/security/src/android/security/cts/NativeCodeTest.java
@@ -39,6 +39,20 @@
         assertTrue(doPerfEventTest2());
     }
 
+    public void testSockDiag() throws Exception {
+        int result = doSockDiagTest();
+        assertFalse("Encountered unexpected error: " + result + ".", (result == -1));
+        assertEquals(0, result);
+    }
+
+    public void testFutex() throws Exception {
+        assertTrue("Device is vulnerable to CVE-2014-3153, a vulnerability in the futex() system "
+                   + "call. Please apply the security patch at "
+                   + "https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/"
+                   + "?id=e9c243a5a6de0be8e584c604d353412584b592f8",
+                   doFutexTest());
+    }
+
     /**
      * Returns true iff this device is vulnerable to CVE-2013-2094.
      * A patch for CVE-2013-2094 can be found at
@@ -80,8 +94,25 @@
     }
 
     /**
+     * ANDROID-15455425 / CVE-2014-3153
+     *
+     * Returns true if the device is patched against the futex() system call vulnerability.
+     *
+     * More information on this vulnerability is at http://seclists.org/oss-sec/2014/q2/467 and
+     * the patch is at:
+     * https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e9c243a5a6de0be8e584c604d353412584b592f8
+     */
+    private static native boolean doFutexTest();
+
+    /**
      * Returns true if the device is immune to CVE-2014-1710,
      * false if the device is vulnerable.
      */
     private static native boolean doCVE20141710Test();
+
+    /**
+     * Hangs if device is vulnerable to CVE-2013-1763, returns -1 if
+     * unexpected error occurs, 0 otherwise.
+     */
+    private static native int doSockDiagTest();
 }
diff --git a/tests/tests/security/src/android/security/cts/ServicePermissionsTest.java b/tests/tests/security/src/android/security/cts/ServicePermissionsTest.java
index 8c02d6b..00cbfd8 100644
--- a/tests/tests/security/src/android/security/cts/ServicePermissionsTest.java
+++ b/tests/tests/security/src/android/security/cts/ServicePermissionsTest.java
@@ -17,6 +17,7 @@
 package android.security.cts;
 
 import android.os.IBinder;
+import android.os.TransactionTooLargeException;
 import android.test.AndroidTestCase;
 import android.util.Log;
 
@@ -99,13 +100,17 @@
             try {
                 serviceBinder.dump(out.getFD(), new String[0]);
             } catch (SecurityException e) {
-                if (e.getMessage().contains("android.permission.DUMP")) {
+                String msg = e.getMessage();
+                if ((msg == null) || msg.contains("android.permission.DUMP")) {
                     // Service correctly checked for DUMP permission, yay
                 } else {
                     // Service is throwing about something else; they're
                     // probably not checking for DUMP.
                     throw e;
                 }
+            } catch (TransactionTooLargeException e) {
+                // SELinux likely prevented the dump - assume safe
+                continue;
             } finally {
                 out.close();
             }
diff --git a/tests/tests/security/src/android/security/cts/activity/SecureRandomService.java b/tests/tests/security/src/android/security/cts/activity/SecureRandomService.java
deleted file mode 100644
index 2d425b3..0000000
--- a/tests/tests/security/src/android/security/cts/activity/SecureRandomService.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts.activity;
-
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.security.cts.activity.ISecureRandomService;
-
-import android.app.Service;
-import android.content.Intent;
-
-import java.security.SecureRandom;
-
-public class SecureRandomService extends Service {
-    /**
-     * This helps the process shut down a little faster and get us a new
-     * PID earlier than calling stopService.
-     */
-    private Handler mShutdownHandler = new Handler() {
-        @Override
-        public void handleMessage(Message msg) {
-            stopSelf();
-        }
-    };
-
-    private final ISecureRandomService.Stub mBinder = new ISecureRandomService.Stub() {
-
-        /**
-         * Returns output from SecureRandom and the current process PID. Note
-         * that this should only be called once. To ensure that it's only called
-         * once, this will throw an error if it's called twice in a row.
-         */
-        public int getRandomBytesAndPid(byte[] randomBytes) {
-            mShutdownHandler.sendEmptyMessage(-1);
-
-            SecureRandom sr = new SecureRandom();
-            sr.nextBytes(randomBytes);
-            return android.os.Process.myPid();
-        }
-    };
-
-    @Override
-    public IBinder onBind(Intent intent) {
-        return mBinder;
-    }
-}
diff --git a/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java b/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
index 09c7cc7..9986e67 100644
--- a/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
@@ -16,6 +16,7 @@
 
 package android.telephony.cts;
 
+import android.bluetooth.BluetoothAdapter;
 import android.content.Context;
 import android.content.pm.PackageManager;
 import android.net.ConnectivityManager;
@@ -184,13 +185,14 @@
                 break;
 
             case TelephonyManager.PHONE_TYPE_NONE:
-                boolean nwSupported = mCm.isNetworkSupported(mCm.TYPE_WIFI);
-                if (nwSupported) {
+                if (mCm.isNetworkSupported(ConnectivityManager.TYPE_WIFI)) {
                     assertSerialNumber();
-                    assertMacAddressReported();
+                    assertMacAddress(getWifiMacAddress());
+                } else if (mCm.isNetworkSupported(ConnectivityManager.TYPE_BLUETOOTH)) {
+                    assertSerialNumber();
+                    assertMacAddress(getBluetoothMacAddress());
                 } else {
-                    nwSupported = mCm.isNetworkSupported(mCm.TYPE_ETHERNET);
-                    assertTrue(nwSupported);
+                    assertTrue(mCm.isNetworkSupported(ConnectivityManager.TYPE_ETHERNET));
                 }
                 break;
 
@@ -284,15 +286,14 @@
                 Pattern.matches("[0-9A-Za-z]+", Build.SERIAL));
     }
 
-    private void assertMacAddressReported() {
-        String macAddress = getMacAddress();
+    private void assertMacAddress(String macAddress) {
         String macPattern = "([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}";
         assertTrue("MAC Address " + macAddress + " does not match pattern " + macPattern,
                 Pattern.matches(macPattern, macAddress));
     }
 
     /** @return mac address which requires the WiFi system to be enabled */
-    private String getMacAddress() {
+    private String getWifiMacAddress() {
         WifiManager wifiManager = (WifiManager) getContext()
                 .getSystemService(Context.WIFI_SERVICE);
 
@@ -313,6 +314,15 @@
         }
     }
 
+    private String getBluetoothMacAddress() {
+        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+        if (adapter == null) {
+            return "";
+        }
+
+        return adapter.getAddress();
+    }
+
     private static final String ISO_COUNTRY_CODE_PATTERN = "[a-z]{2}";
 
     public void testGetNetworkCountryIso() {
diff --git a/tests/tests/text/src/android/text/cts/EmojiTest.java b/tests/tests/text/src/android/text/cts/EmojiTest.java
index f5f191f..4bcc0e1 100644
--- a/tests/tests/text/src/android/text/cts/EmojiTest.java
+++ b/tests/tests/text/src/android/text/cts/EmojiTest.java
@@ -25,6 +25,7 @@
 import android.view.KeyEvent;
 import android.view.Menu;
 import android.view.View;
+import android.webkit.cts.NullWebViewUtils;
 import android.webkit.cts.WebViewOnUiThread;
 import android.widget.TextView;
 import android.widget.EditText;
@@ -58,7 +59,6 @@
      */
     public void testEmojiGlyph() {
         CaptureCanvas ccanvas = new CaptureCanvas(getInstrumentation().getContext());
-        CaptureWebView cwebview = new CaptureWebView(getInstrumentation().getContext());
 
         Bitmap mBitmapA, mBitmapB;  // Emoji displayed Bitmaps to compare
 
@@ -92,11 +92,15 @@
 
             assertFalse(mBitmapA.sameAs(mBitmapB));
 
-            mBitmapA = cwebview.capture(Character.toChars(comparedCodePoints[i][0]));
-            mBitmapB = cwebview.capture(Character.toChars(comparedCodePoints[i][1]));
-
-            assertFalse(mBitmapA.sameAs(mBitmapB));
-
+            // Trigger activity bringup so we can determine if a WebView is available on this
+            // device.
+            EmojiStubActivity activity = getActivity();
+            if (NullWebViewUtils.isWebViewAvailable()) {
+                CaptureWebView cwebview = new CaptureWebView(getInstrumentation().getContext());
+                mBitmapA = cwebview.capture(Character.toChars(comparedCodePoints[i][0]));
+                mBitmapB = cwebview.capture(Character.toChars(comparedCodePoints[i][1]));
+                assertFalse(mBitmapA.sameAs(mBitmapB));
+            }
         }
     }
 
diff --git a/tests/tests/text/src/android/text/cts/MyanmarTest.java b/tests/tests/text/src/android/text/cts/MyanmarTest.java
new file mode 100644
index 0000000..60fe608
--- /dev/null
+++ b/tests/tests/text/src/android/text/cts/MyanmarTest.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.text.cts;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.test.ActivityInstrumentationTestCase2;
+import android.widget.TextView;
+
+public class MyanmarTest extends ActivityInstrumentationTestCase2<Activity> {
+
+    public MyanmarTest() {
+        super("com.android.cts.stub", Activity.class);
+    }
+
+    protected void setUp() throws Exception {
+        super.setUp();
+    }
+
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
+
+    /**
+     * Tests Unicode composition semantics.
+     */
+    public void testCompositionSemantics() {
+        String textA = "\u1019\u102d\u102f";
+        String textB = "\u1019\u102f\u102d"; // wrong order for Unicode
+
+        CaptureTextView cviewA = new CaptureTextView(getInstrumentation().getContext());
+        Bitmap bitmapA = cviewA.capture(textA);
+        CaptureTextView cviewB = new CaptureTextView(getInstrumentation().getContext());
+        Bitmap bitmapB = cviewB.capture(textB);
+        if (bitmapA.sameAs(bitmapB)) {
+            // if textA and textB render identically, test against replacement characters
+            String textC = "\ufffd\ufffd\ufffd"; // replacement characters are acceptable
+            CaptureTextView cviewC = new CaptureTextView(getInstrumentation().getContext());
+            Bitmap bitmapC = cviewC.capture(textC);
+            if (!bitmapA.sameAs(bitmapC)) {
+                // ...or against blank/empty glyphs
+                Bitmap bitmapD = Bitmap.createBitmap(bitmapC.getWidth(), bitmapC.getHeight(),
+                        bitmapC.getConfig());
+                assertTrue(bitmapA.sameAs(bitmapD));
+            }
+        }
+    }
+
+    private class CaptureTextView extends TextView {
+
+        CaptureTextView(Context context) {
+            super(context);
+        }
+
+        Bitmap capture(String text) {
+            setText(text);
+
+            invalidate();
+
+            setDrawingCacheEnabled(true);
+            measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
+                    MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
+            layout(0, 0, 200,200);
+
+            Bitmap bitmap = Bitmap.createBitmap(getDrawingCache());
+            setDrawingCacheEnabled(false);
+            return bitmap;
+        }
+
+    }
+}
diff --git a/tests/tests/text/src/android/text/method/cts/ArrowKeyMovementMethodTest.java b/tests/tests/text/src/android/text/method/cts/ArrowKeyMovementMethodTest.java
index 9d3cbc7..3513281 100644
--- a/tests/tests/text/src/android/text/method/cts/ArrowKeyMovementMethodTest.java
+++ b/tests/tests/text/src/android/text/method/cts/ArrowKeyMovementMethodTest.java
@@ -30,6 +30,7 @@
 import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.TextView;
 import android.widget.TextView.BufferType;
 
@@ -68,6 +69,9 @@
 
         getInstrumentation().runOnMainSync(new Runnable() {
             public void run() {
+                getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON |
+                        WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
+                
                 getActivity().setContentView(mTextView);
                 mTextView.setFocusable(true);
                 mTextView.requestFocus();
diff --git a/tests/tests/text/src/android/text/method/cts/KeyListenerTestCase.java b/tests/tests/text/src/android/text/method/cts/KeyListenerTestCase.java
index 4007f33..375ea54 100644
--- a/tests/tests/text/src/android/text/method/cts/KeyListenerTestCase.java
+++ b/tests/tests/text/src/android/text/method/cts/KeyListenerTestCase.java
@@ -23,6 +23,7 @@
 import android.text.format.DateUtils;
 import android.text.method.cts.KeyListenerStubActivity;
 import android.text.method.KeyListener;
+import android.view.WindowManager;
 import android.widget.TextView;
 
 /**
@@ -63,6 +64,13 @@
         mInstrumentation = getInstrumentation();
         mTextView = (TextView) mActivity.findViewById(R.id.keylistener_textview);
 
+        mActivity.runOnUiThread(new Runnable() {
+            public void run() {
+                // Ensure that the screen is on for this test.
+                mTextView.setKeepScreenOn(true);
+            }
+        });
+
         assertTrue(mActivity.waitForWindowFocus(5 * DateUtils.SECOND_IN_MILLIS));
     }
 
diff --git a/tests/tests/text/src/android/text/method/cts/TouchTest.java b/tests/tests/text/src/android/text/method/cts/TouchTest.java
index 3071fd6..58e889a 100644
--- a/tests/tests/text/src/android/text/method/cts/TouchTest.java
+++ b/tests/tests/text/src/android/text/method/cts/TouchTest.java
@@ -34,6 +34,10 @@
     private static final String LONG_TEXT = "Scrolls the specified widget to the specified " +
             "coordinates, except constrains the X scrolling position to the horizontal regions " +
             "of the text that will be visible after scrolling to the specified Y position." +
+            "This is the description of the test." +
+            "Scrolls the specified widget to the specified " +
+            "coordinates, except constrains the X scrolling position to the horizontal regions " +
+            "of the text that will be visible after scrolling to the specified Y position." +
             "This is the description of the test.";
 
     private boolean mReturnFromTouchEvent;
diff --git a/tests/tests/theme/src/android/theme/cts/DeviceDefaultTest.java b/tests/tests/theme/src/android/theme/cts/DeviceDefaultTest.java
index 086dce1..77de0b4 100644
--- a/tests/tests/theme/src/android/theme/cts/DeviceDefaultTest.java
+++ b/tests/tests/theme/src/android/theme/cts/DeviceDefaultTest.java
@@ -19,6 +19,7 @@
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
+import android.content.pm.PackageManager;
 import android.content.res.Configuration;
 import android.test.ActivityInstrumentationTestCase2;
 
@@ -85,7 +86,7 @@
     }
 
     public void testGetActionBar_DeviceDefault_Light_DialogWhenLarge() {
-        assertActionBarWhenLarge(android.R.style.Theme_Holo_Light_DialogWhenLarge);
+        assertActionBarWhenLarge(android.R.style.Theme_DeviceDefault_Light_DialogWhenLarge);
     }
 
     public void testGetActionBar_DeviceDefault_Light_DialogWhenLarge_NoActionBar() {
@@ -122,6 +123,10 @@
 
     private void assertGetActionBar(int themeId, boolean actionBar) {
         Activity activity = startActivity(themeId);
+        if (activity.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) {
+            assertNull(activity.getActionBar());
+            return;
+        }
         if (actionBar) {
             assertNotNull(activity.getActionBar());
         } else {
diff --git a/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java b/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java
index d7c1895..fd8fa53 100644
--- a/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java
+++ b/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java
@@ -36,9 +36,9 @@
         outMetrics.setToDefaults();
         assertEquals(0, outMetrics.widthPixels);
         assertEquals(0, outMetrics.heightPixels);
-        // according to Android enmulator doc UI -scale confine density should between 0.1 to 3
-        assertTrue((0.1 <= outMetrics.density) && (outMetrics.density <= 3));
-        assertTrue((0.1 <= outMetrics.scaledDensity) && (outMetrics.scaledDensity <= 3));
+        // according to Android emulator doc UI -scale confine density should between 0.1 to 4
+        assertTrue((0.1 <= outMetrics.density) && (outMetrics.density <= 4));
+        assertTrue((0.1 <= outMetrics.scaledDensity) && (outMetrics.scaledDensity <= 4));
         assertTrue(0 < outMetrics.xdpi);
         assertTrue(0 < outMetrics.ydpi);
 
@@ -48,9 +48,9 @@
         metrics.setTo(outMetrics);
         assertEquals(display.getHeight(), metrics.heightPixels);
         assertEquals(display.getWidth(), metrics.widthPixels);
-        // according to Android enmulator doc UI -scale confine density should between 0.1 to 3
-        assertTrue((0.1 <= metrics.density) && (metrics.density <= 3));
-        assertTrue((0.1 <= metrics.scaledDensity) && (metrics.scaledDensity <= 3));
+        // according to Android emulator doc UI -scale confine density should between 0.1 to 4
+        assertTrue((0.1 <= metrics.density) && (metrics.density <= 4));
+        assertTrue((0.1 <= metrics.scaledDensity) && (metrics.scaledDensity <= 4));
         assertTrue(0 < metrics.xdpi);
         assertTrue(0 < metrics.ydpi);
     }
diff --git a/tests/tests/util/src/android/util/cts/TypedValueTest.java b/tests/tests/util/src/android/util/cts/TypedValueTest.java
index 5cd7463..2ab91d9 100644
--- a/tests/tests/util/src/android/util/cts/TypedValueTest.java
+++ b/tests/tests/util/src/android/util/cts/TypedValueTest.java
@@ -205,16 +205,4 @@
 
         assertEquals(TypedValue.complexToDimension(10, dm), tv.getDimension(dm));
     }
-
-    public void testComplexToDimensionNoisy() {
-        DisplayMetrics dm = new DisplayMetrics();
-        dm.density = 1.1f;
-        dm.heightPixels = 100;
-        dm.scaledDensity = 2.1f;
-        dm.xdpi = 200f;
-        dm.ydpi = 300f;
-
-        assertEquals(TypedValue.complexToDimension(1, dm),
-                                 TypedValue.complexToDimensionNoisy(1, dm));
-    }
 }
diff --git a/tests/tests/view/src/android/view/cts/WindowTest.java b/tests/tests/view/src/android/view/cts/WindowTest.java
index 7e147ab..afe5f0d 100644
--- a/tests/tests/view/src/android/view/cts/WindowTest.java
+++ b/tests/tests/view/src/android/view/cts/WindowTest.java
@@ -1088,5 +1088,8 @@
 
         public void onActionModeFinished(ActionMode mode) {
         }
+
+        public void onWindowDismissed() {
+        }
     }
 }
diff --git a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodInfoTest.java b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodInfoTest.java
index 9f92d23..12ce833 100644
--- a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodInfoTest.java
+++ b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodInfoTest.java
@@ -195,6 +195,11 @@
     }
 
     public void testInputMethodSubtypesOfSystemImes() {
+        if (!getContext().getPackageManager().hasSystemFeature(
+                PackageManager.FEATURE_INPUT_METHODS)) {
+            return;
+        }
+
         final InputMethodManager imm = (InputMethodManager) mContext
                 .getSystemService(Context.INPUT_METHOD_SERVICE);
         final List<InputMethodInfo> imis = imm.getInputMethodList();
diff --git a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
index 46f58e6..033deb2 100644
--- a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
+++ b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
@@ -19,6 +19,7 @@
 
 import android.app.Instrumentation;
 import android.content.Context;
+import android.content.pm.PackageManager;
 import android.cts.util.PollingCheck;
 import android.os.Handler;
 import android.os.IBinder;
@@ -58,6 +59,11 @@
     }
 
     public void testInputMethodManager() throws Throwable {
+        if (!getActivity().getPackageManager().hasSystemFeature(
+                PackageManager.FEATURE_INPUT_METHODS)) {
+            return;
+        }
+
         Window window = mActivity.getWindow();
         final EditText view = (EditText) window.findViewById(R.id.entry);
 
diff --git a/tests/tests/webkit/src/android/webkit/cts/CookieManagerTest.java b/tests/tests/webkit/src/android/webkit/cts/CookieManagerTest.java
index a0b4fa6..ead235e 100644
--- a/tests/tests/webkit/src/android/webkit/cts/CookieManagerTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/CookieManagerTest.java
@@ -42,13 +42,19 @@
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        mOnUiThread = new WebViewOnUiThread(this, getActivity().getWebView());
+        WebView webview = getActivity().getWebView();
+        if (webview != null) {
+            mOnUiThread = new WebViewOnUiThread(this, webview);
 
-        mCookieManager = CookieManager.getInstance();
-        assertNotNull(mCookieManager);
+            mCookieManager = CookieManager.getInstance();
+            assertNotNull(mCookieManager);
+        }
     }
 
     public void testGetInstance() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mOnUiThread.cleanUp();
         CookieManager c1 = CookieManager.getInstance();
         CookieManager c2 = CookieManager.getInstance();
@@ -57,9 +63,15 @@
     }
 
     public void testClone() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
     }
 
     public void testAcceptCookie() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mCookieManager.removeAllCookie();
         mCookieManager.setAcceptCookie(false);
         assertFalse(mCookieManager.acceptCookie());
@@ -113,6 +125,9 @@
     }
 
     public void testCookieManager() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // enable cookie
         mCookieManager.setAcceptCookie(true);
         assertTrue(mCookieManager.acceptCookie());
@@ -146,6 +161,9 @@
 
     @SuppressWarnings("deprecation")
     public void testRemoveCookies() throws InterruptedException {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // enable cookie
         mCookieManager.setAcceptCookie(true);
         assertTrue(mCookieManager.acceptCookie());
@@ -212,6 +230,9 @@
     }
 
     public void testb3167208() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         String uri = "http://host.android.com/path/";
         // note the space after the domain=
         String problemCookie = "foo=bar; domain= .android.com; path=/";
diff --git a/tests/tests/webkit/src/android/webkit/cts/CookieSyncManagerTest.java b/tests/tests/webkit/src/android/webkit/cts/CookieSyncManagerTest.java
index 67a77e7..95e3add 100644
--- a/tests/tests/webkit/src/android/webkit/cts/CookieSyncManagerTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/CookieSyncManagerTest.java
@@ -33,6 +33,9 @@
     }
 
     public void testCookieSyncManager() throws Exception {
+        if (getActivity().getWebView() == null) {
+            return;
+        }
         CookieSyncManager csm1 = CookieSyncManager.createInstance(getActivity());
         assertNotNull(csm1);
 
diff --git a/tests/tests/webkit/src/android/webkit/cts/CookieTest.java b/tests/tests/webkit/src/android/webkit/cts/CookieTest.java
index 0c0396a..7f3b183 100644
--- a/tests/tests/webkit/src/android/webkit/cts/CookieTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/CookieTest.java
@@ -16,22 +16,30 @@
 
 package android.webkit.cts;
 
-import android.test.AndroidTestCase;
+import android.test.ActivityInstrumentationTestCase2;
 import android.webkit.CookieManager;
 import android.webkit.CookieSyncManager;
 
 /**
  * Original framework tests for CookieManager
  */
-public class CookieTest extends AndroidTestCase {
+public class CookieTest extends ActivityInstrumentationTestCase2<CookieSyncManagerStubActivity> {
 
     private CookieManager mCookieManager;
     private static final long WAIT_TIME = 50;
 
+    public CookieTest() {
+        super("com.android.cts.stub", CookieSyncManagerStubActivity.class);
+    }
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        CookieSyncManager.createInstance(getContext());
+
+        if (getActivity().getWebView() == null) {
+            return;
+        }
+
         mCookieManager = CookieManager.getInstance();
         mCookieManager.removeAllCookie();
         // cookies are removed asynchronously, wait a bit for cookies to be removed
@@ -48,6 +56,9 @@
     }
 
     public void testDomain() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         String url = "http://www.foo.com";
 
         // basic
@@ -86,6 +97,9 @@
     }
 
     public void testSubDomain() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         String url_abcd = "http://a.b.c.d.com";
         String url_bcd = "http://b.c.d.com";
         String url_cd = "http://c.d.com";
@@ -127,6 +141,9 @@
     }
 
     public void testInvalidDomain() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         String url = "http://foo.bar.com";
 
         mCookieManager.setCookie(url, "a=1; domain=.yo.foo.bar.com");
@@ -163,6 +180,9 @@
     }
 
     public void testPath() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         String url = "http://www.foo.com";
 
         mCookieManager.setCookie(url, "a=b; path=/wee");
@@ -192,6 +212,9 @@
     }
 
     public void testEmptyValue() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         String url = "http://www.foobar.com";
 
         mCookieManager.setCookie(url, "bar=");
diff --git a/tests/tests/webkit/src/android/webkit/cts/GeolocationTest.java b/tests/tests/webkit/src/android/webkit/cts/GeolocationTest.java
index 016d7c2..8ab9eb6 100644
--- a/tests/tests/webkit/src/android/webkit/cts/GeolocationTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/GeolocationTest.java
@@ -135,49 +135,58 @@
     protected void setUp() throws Exception {
         super.setUp();
 
-        // Set up a WebView with JavaScript and Geolocation enabled
-        final String GEO_DIR = "geo_test";
-        mOnUiThread = new WebViewOnUiThread(this, getActivity().getWebView());
-        mOnUiThread.getSettings().setJavaScriptEnabled(true);
-        mOnUiThread.getSettings().setGeolocationEnabled(true);
-        mOnUiThread.getSettings().setGeolocationDatabasePath(
-                getActivity().getApplicationContext().getDir(GEO_DIR, 0).getPath());
+        WebView webview = getActivity().getWebView();
 
-        // Add a JsInterface to report back to the test when a location is received
-        mJavascriptStatusReceiver = new JavascriptStatusReceiver();
-        mOnUiThread.addJavascriptInterface(mJavascriptStatusReceiver, JS_INTERFACE_NAME);
+        if (webview != null) {
+            // Set up a WebView with JavaScript and Geolocation enabled
+            final String GEO_DIR = "geo_test";
+            mOnUiThread = new WebViewOnUiThread(this, webview);
+            mOnUiThread.getSettings().setJavaScriptEnabled(true);
+            mOnUiThread.getSettings().setGeolocationEnabled(true);
+            mOnUiThread.getSettings().setGeolocationDatabasePath(
+                    getActivity().getApplicationContext().getDir(GEO_DIR, 0).getPath());
 
-        // Always intercept all loads with the same geolocation test page
-        mOnUiThread.setWebViewClient(new InterceptClient(mOnUiThread));
-        // Clear all permissions before each test
-        GeolocationPermissions.getInstance().clearAll();
-        // Cache this mostly because the lookup is two lines of code
-        mLocationManager = (LocationManager)getActivity().getApplicationContext()
-                .getSystemService(Context.LOCATION_SERVICE);
-        // Add a test provider before each test to inject a location
-        mProviders = mLocationManager.getAllProviders();
-        for (String provider : mProviders) {
-            // Can't mock passive provider.
-            if (provider.equals(LocationManager.PASSIVE_PROVIDER)) {
-                mProviders.remove(provider);
-                break;
+            // Add a JsInterface to report back to the test when a location is received
+            mJavascriptStatusReceiver = new JavascriptStatusReceiver();
+            mOnUiThread.addJavascriptInterface(mJavascriptStatusReceiver, JS_INTERFACE_NAME);
+
+            // Always intercept all loads with the same geolocation test page
+            mOnUiThread.setWebViewClient(new InterceptClient(mOnUiThread));
+            // Clear all permissions before each test
+            GeolocationPermissions.getInstance().clearAll();
+            // Cache this mostly because the lookup is two lines of code
+            mLocationManager = (LocationManager)getActivity().getApplicationContext()
+                    .getSystemService(Context.LOCATION_SERVICE);
+            // Add a test provider before each test to inject a location
+            mProviders = mLocationManager.getAllProviders();
+            for (String provider : mProviders) {
+                // Can't mock passive provider.
+                if (provider.equals(LocationManager.PASSIVE_PROVIDER)) {
+                    mProviders.remove(provider);
+                    break;
+                }
             }
+            addTestProviders();
         }
-        addTestProviders();
     }
 
     @Override
     protected void tearDown() throws Exception {
         stopUpdateLocationThread();
-        // Remove the test provider after each test
-        for (String provider : mProviders) {
-            try {
-                // Work around b/11446702 by clearing the test provider before removing it
-                mLocationManager.clearTestProviderEnabled(provider);
-                mLocationManager.removeTestProvider(provider);
-            } catch (IllegalArgumentException e) {} // Not much to do about this
+        if (mProviders != null) {
+            // Remove the test provider after each test
+            for (String provider : mProviders) {
+                try {
+                    // Work around b/11446702 by clearing the test provider before removing it
+                    mLocationManager.clearTestProviderEnabled(provider);
+                    mLocationManager.removeTestProvider(provider);
+                } catch (IllegalArgumentException e) {} // Not much to do about this
+            }
         }
-        mOnUiThread.cleanUp();
+
+        if (mOnUiThread != null) {
+            mOnUiThread.cleanUp();
+        }
         // This will null all member and static variables
         super.tearDown();
     }
@@ -278,6 +287,9 @@
 
     // Test loading a page and accepting the domain for one load
     public void testSimpleGeolocationRequestAcceptOnce() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final TestSimpleGeolocationRequestWebChromeClient chromeClientAcceptOnce =
                 new TestSimpleGeolocationRequestWebChromeClient(mOnUiThread, true, false);
         mOnUiThread.setWebChromeClient(chromeClientAcceptOnce);
@@ -368,6 +380,9 @@
 
     // Test loading a page and retaining the domain forever
     public void testSimpleGeolocationRequestAcceptAlways() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final TestSimpleGeolocationRequestWebChromeClient chromeClientAcceptAlways =
                 new TestSimpleGeolocationRequestWebChromeClient(mOnUiThread, true, true);
         mOnUiThread.setWebChromeClient(chromeClientAcceptAlways);
@@ -424,6 +439,9 @@
 
     // Test the GeolocationPermissions API
     public void testGeolocationPermissions() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         Set<String> acceptedOrigins = new TreeSet<String>();
         BooleanCheck falseCheck = new BooleanCheck(false);
         GeolocationPermissions.getInstance().getAllowed(URL_2, falseCheck);
@@ -483,6 +501,9 @@
 
     // Test loading pages and checks rejecting once and recjecting the domain forever
     public void testSimpleGeolocationRequestReject() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final TestSimpleGeolocationRequestWebChromeClient chromeClientRejectOnce =
                 new TestSimpleGeolocationRequestWebChromeClient(mOnUiThread, false, false);
         mOnUiThread.setWebChromeClient(chromeClientRejectOnce);
diff --git a/tests/tests/webkit/src/android/webkit/cts/HttpAuthHandlerTest.java b/tests/tests/webkit/src/android/webkit/cts/HttpAuthHandlerTest.java
index 52e9278..b078c7a 100644
--- a/tests/tests/webkit/src/android/webkit/cts/HttpAuthHandlerTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/HttpAuthHandlerTest.java
@@ -43,12 +43,18 @@
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        mOnUiThread = new WebViewOnUiThread(this, getActivity().getWebView());
+        WebView webview = getActivity().getWebView();
+        if (webview != null) {
+            mOnUiThread = new WebViewOnUiThread(this, webview);
+        }
     }
 
     @Override
     protected void tearDown() throws Exception {
-        mOnUiThread.cleanUp();
+        if (mOnUiThread != null) {
+            mOnUiThread.cleanUp();
+        }
+
         if (mWebServer != null) {
             mWebServer.shutdown();
         }
@@ -138,6 +144,9 @@
     }
 
     public void testProceed() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mWebServer = new CtsTestServer(getActivity());
         String url = mWebServer.getAuthAssetUrl(TestHtmlConstants.HELLO_WORLD_URL);
 
@@ -147,6 +156,9 @@
     }
 
     public void testCancel() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mWebServer = new CtsTestServer(getActivity());
         String url = mWebServer.getAuthAssetUrl(TestHtmlConstants.HELLO_WORLD_URL);
 
@@ -159,6 +171,9 @@
     }
 
     public void testUseHttpAuthUsernamePassword() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mWebServer = new CtsTestServer(getActivity());
         String url = mWebServer.getAuthAssetUrl(TestHtmlConstants.HELLO_WORLD_URL);
 
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebBackForwardListTest.java b/tests/tests/webkit/src/android/webkit/cts/WebBackForwardListTest.java
index 34dc697..71893f4 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebBackForwardListTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebBackForwardListTest.java
@@ -20,6 +20,7 @@
 import android.test.ActivityInstrumentationTestCase2;
 import android.webkit.WebBackForwardList;
 import android.webkit.WebHistoryItem;
+import android.webkit.WebView;
 
 
 public class WebBackForwardListTest extends ActivityInstrumentationTestCase2<WebViewStubActivity> {
@@ -35,16 +36,24 @@
     @Override
     public void setUp() throws Exception {
         super.setUp();
-        mOnUiThread = new WebViewOnUiThread(this, getActivity().getWebView());
+        WebView webview = getActivity().getWebView();
+        if (webview != null) {
+            mOnUiThread = new WebViewOnUiThread(this, webview);
+        }
     }
 
     @Override
     public void tearDown() throws Exception {
-        mOnUiThread.cleanUp();
+        if (mOnUiThread != null) {
+            mOnUiThread.cleanUp();
+        }
         super.tearDown();
     }
 
     public void testGetCurrentItem() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         WebBackForwardList list = mOnUiThread.copyBackForwardList();
 
         assertNull(list.getCurrentItem());
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebChromeClientTest.java b/tests/tests/webkit/src/android/webkit/cts/WebChromeClientTest.java
index 5c9c958..3142298 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebChromeClientTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebChromeClientTest.java
@@ -44,13 +44,18 @@
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        mOnUiThread = new WebViewOnUiThread(this, getActivity().getWebView());
+        WebView webview = getActivity().getWebView();
+        if (webview != null) {
+            mOnUiThread = new WebViewOnUiThread(this, webview);
+        }
         mWebServer = new CtsTestServer(getActivity());
     }
 
     @Override
     protected void tearDown() throws Exception {
-        mOnUiThread.cleanUp();
+        if (mOnUiThread != null) {
+            mOnUiThread.cleanUp();
+        }
         if (mWebServer != null) {
             mWebServer.shutdown();
         }
@@ -62,6 +67,9 @@
     }
 
     public void testOnProgressChanged() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebChromeClient webChromeClient = new MockWebChromeClient();
         mOnUiThread.setWebChromeClient(webChromeClient);
 
@@ -78,6 +86,9 @@
     }
 
     public void testOnReceivedTitle() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebChromeClient webChromeClient = new MockWebChromeClient();
         mOnUiThread.setWebChromeClient(webChromeClient);
 
@@ -96,6 +107,9 @@
     }
 
     public void testOnReceivedIcon() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebChromeClient webChromeClient = new MockWebChromeClient();
         mOnUiThread.setWebChromeClient(webChromeClient);
 
@@ -159,20 +173,32 @@
         }
     }
     public void testWindows() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         runWindowTest(true);
     }
 
     public void testBlockWindowsSync() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mBlockWindowCreationSync = true;
         runWindowTest(false);
     }
 
     public void testBlockWindowsAsync() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mBlockWindowCreationAsync = true;
         runWindowTest(false);
     }
 
     public void testOnJsBeforeUnload() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebChromeClient webChromeClient = new MockWebChromeClient();
         mOnUiThread.setWebChromeClient(webChromeClient);
 
@@ -196,6 +222,9 @@
     }
 
     public void testOnJsAlert() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebChromeClient webChromeClient = new MockWebChromeClient();
         mOnUiThread.setWebChromeClient(webChromeClient);
 
@@ -218,6 +247,9 @@
     }
 
     public void testOnJsConfirm() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebChromeClient webChromeClient = new MockWebChromeClient();
         mOnUiThread.setWebChromeClient(webChromeClient);
 
@@ -240,6 +272,9 @@
     }
 
     public void testOnJsPrompt() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebChromeClient webChromeClient = new MockWebChromeClient();
         mOnUiThread.setWebChromeClient(webChromeClient);
 
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebHistoryItemTest.java b/tests/tests/webkit/src/android/webkit/cts/WebHistoryItemTest.java
index 468430f..7d276e9 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebHistoryItemTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebHistoryItemTest.java
@@ -54,12 +54,17 @@
     protected void setUp() throws Exception {
         super.setUp();
         mWebServer = new CtsTestServer(getActivity());
-        mOnUiThread = new WebViewOnUiThread(this, getActivity().getWebView());
+        WebView webview = getActivity().getWebView();
+        if (webview != null) {
+            mOnUiThread = new WebViewOnUiThread(this, webview);
+        }
     }
 
     @Override
     protected void tearDown() throws Exception {
-        mOnUiThread.cleanUp();
+        if (mOnUiThread != null) {
+            mOnUiThread.cleanUp();
+        }
         mWebServer.shutdown();
         super.tearDown();
         if (mIconDb != null) {
@@ -69,6 +74,9 @@
     }
 
     public void testWebHistoryItem() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final WaitForIconClient waitForIconClient = new WaitForIconClient(mOnUiThread);
         mOnUiThread.setWebChromeClient(waitForIconClient);
         runTestOnUiThread(new Runnable() {
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java b/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java
index 291136f..c2104fe 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java
@@ -65,8 +65,11 @@
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        mOnUiThread = new WebViewOnUiThread(this, getActivity().getWebView());
-        mSettings = mOnUiThread.getSettings();
+        WebView webview = getActivity().getWebView();
+        if (webview != null) {
+            mOnUiThread = new WebViewOnUiThread(this, webview);
+            mSettings = mOnUiThread.getSettings();
+        }
         mContext = getInstrumentation().getTargetContext();
     }
 
@@ -75,7 +78,9 @@
         if (mWebServer != null) {
             mWebServer.shutdown();
         }
-        mOnUiThread.cleanUp();
+        if (mOnUiThread != null) {
+            mOnUiThread.cleanUp();
+        }
         super.tearDown();
     }
 
@@ -90,6 +95,9 @@
      * Safari/<major>.<minor>
      */
     public void testUserAgentString_default() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final String actualUserAgentString = mSettings.getUserAgentString();
         Log.i(LOG_TAG, String.format("Checking user agent string %s", actualUserAgentString));
         final String patternString =
@@ -131,6 +139,9 @@
     }
 
     public void testAccessUserAgentString() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         startWebServer();
         String url = mWebServer.getUserAgentUrl();
 
@@ -159,6 +170,9 @@
     }
 
     public void testAccessAllowFileAccess() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // This test is not compatible with 4.0.3
         if ("4.0.3".equals(Build.VERSION.RELEASE)) {
             return;
@@ -184,6 +198,9 @@
     }
 
     public void testAccessCacheMode() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         runTestOnUiThread(new Runnable() {
             @Override
             public void run() {
@@ -256,6 +273,9 @@
     }
 
     public void testAccessCursiveFontFamily() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertNotNull(mSettings.getCursiveFontFamily());
 
         String newCusiveFamily = "Apple Chancery";
@@ -264,6 +284,9 @@
     }
 
     public void testAccessFantasyFontFamily() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertNotNull(mSettings.getFantasyFontFamily());
 
         String newFantasyFamily = "Papyrus";
@@ -272,6 +295,9 @@
     }
 
     public void testAccessFixedFontFamily() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertNotNull(mSettings.getFixedFontFamily());
 
         String newFixedFamily = "Courier";
@@ -280,6 +306,9 @@
     }
 
     public void testAccessSansSerifFontFamily() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertNotNull(mSettings.getSansSerifFontFamily());
 
         String newFixedFamily = "Verdana";
@@ -288,6 +317,9 @@
     }
 
     public void testAccessSerifFontFamily() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertNotNull(mSettings.getSerifFontFamily());
 
         String newSerifFamily = "Times";
@@ -296,6 +328,9 @@
     }
 
     public void testAccessStandardFontFamily() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertNotNull(mSettings.getStandardFontFamily());
 
         String newStandardFamily = "Times";
@@ -304,6 +339,9 @@
     }
 
     public void testAccessDefaultFontSize() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         int defaultSize = mSettings.getDefaultFontSize();
         assertTrue(defaultSize > 0);
 
@@ -322,6 +360,9 @@
     }
 
     public void testAccessDefaultFixedFontSize() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         int defaultSize = mSettings.getDefaultFixedFontSize();
         assertTrue(defaultSize > 0);
 
@@ -340,6 +381,9 @@
     }
 
     public void testAccessDefaultTextEncodingName() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertNotNull(mSettings.getDefaultTextEncodingName());
 
         String newEncodingName = "iso-8859-1";
@@ -348,6 +392,9 @@
     }
 
     public void testAccessJavaScriptCanOpenWindowsAutomatically() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mSettings.setJavaScriptEnabled(true);
 
         mSettings.setJavaScriptCanOpenWindowsAutomatically(false);
@@ -372,6 +419,9 @@
     }
 
     public void testAccessJavaScriptEnabled() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mSettings.setJavaScriptEnabled(true);
         assertTrue(mSettings.getJavaScriptEnabled());
         loadAssetUrl(TestHtmlConstants.JAVASCRIPT_URL);
@@ -395,6 +445,9 @@
     }
 
     public void testAccessLayoutAlgorithm() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertEquals(WebSettings.LayoutAlgorithm.NARROW_COLUMNS, mSettings.getLayoutAlgorithm());
 
         mSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
@@ -405,6 +458,9 @@
     }
 
     public void testAccessMinimumFontSize() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertEquals(8, mSettings.getMinimumFontSize());
 
         mSettings.setMinimumFontSize(100);
@@ -418,6 +474,9 @@
     }
 
     public void testAccessMinimumLogicalFontSize() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertEquals(8, mSettings.getMinimumLogicalFontSize());
 
         mSettings.setMinimumLogicalFontSize(100);
@@ -431,6 +490,9 @@
     }
 
     public void testAccessPluginsEnabled() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertFalse(mSettings.getPluginsEnabled());
 
         mSettings.setPluginsEnabled(true);
@@ -438,6 +500,9 @@
     }
 
     public void testAccessPluginsPath() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertNotNull(mSettings.getPluginsPath());
 
         String pluginPath = "pluginPath";
@@ -447,6 +512,9 @@
     }
 
     public void testAccessSaveFormData() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertTrue(mSettings.getSaveFormData());
 
         mSettings.setSaveFormData(false);
@@ -454,6 +522,9 @@
     }
 
     public void testAccessTextSize() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertEquals(TextSize.NORMAL, mSettings.getTextSize());
 
         mSettings.setTextSize(TextSize.LARGER);
@@ -470,6 +541,9 @@
     }
 
     public void testAccessUseDoubleTree() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertFalse(mSettings.getUseDoubleTree());
 
         mSettings.setUseDoubleTree(true);
@@ -478,6 +552,9 @@
     }
 
     public void testAccessUseWideViewPort() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertFalse(mSettings.getUseWideViewPort());
 
         mSettings.setUseWideViewPort(true);
@@ -485,12 +562,18 @@
     }
 
     public void testSetNeedInitialFocus() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mSettings.setNeedInitialFocus(false);
 
         mSettings.setNeedInitialFocus(true);
     }
 
     public void testSetRenderPriority() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mSettings.setRenderPriority(WebSettings.RenderPriority.HIGH);
 
         mSettings.setRenderPriority(WebSettings.RenderPriority.LOW);
@@ -499,6 +582,9 @@
     }
 
     public void testAccessSupportMultipleWindows() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertFalse(mSettings.supportMultipleWindows());
 
         mSettings.setSupportMultipleWindows(true);
@@ -506,6 +592,9 @@
     }
 
     public void testAccessSupportZoom() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertTrue(mSettings.supportZoom());
 
         runTestOnUiThread(new Runnable() {
@@ -518,6 +607,9 @@
     }
 
     public void testAccessBuiltInZoomControls() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertFalse(mSettings.getBuiltInZoomControls());
 
         runTestOnUiThread(new Runnable() {
@@ -530,6 +622,9 @@
     }
 
     public void testAppCacheDisabled() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // Test that when AppCache is disabled, we don't get any AppCache
         // callbacks.
         startWebServer();
@@ -549,6 +644,9 @@
     }
 
     public void testAppCacheEnabled() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // Note that the AppCache path can only be set once. This limits the
         // amount of testing we can do, and means that we must test all aspects
         // of setting the AppCache path in a single test to guarantee ordering.
@@ -594,6 +692,9 @@
     // using a URL. Finally, it looks like enabling database requires creating a
     // webChromeClient and listening to Quota callbacks, which is not documented.
     public void testDatabaseDisabled() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // Verify that websql database does not work when disabled.
         startWebServer();
 
@@ -612,6 +713,9 @@
     }
 
     public void testLoadsImagesAutomatically() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertTrue(mSettings.getLoadsImagesAutomatically());
 
         startWebServer();
@@ -644,6 +748,9 @@
     }
 
     public void testBlockNetworkImage() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertFalse(mSettings.getBlockNetworkImage());
 
         startWebServer();
@@ -673,6 +780,9 @@
     }
 
     public void testBlockNetworkLoads() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertFalse(mSettings.getBlockNetworkLoads());
 
         startWebServer();
@@ -709,6 +819,9 @@
 
     // Verify that an image in local file system can be loaded by an asset
     public void testLocalImageLoads() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
 
         mSettings.setJavaScriptEnabled(true);
         // Check that local images are loaded without issues regardless of domain checkings
@@ -723,6 +836,9 @@
     // Verify that javascript cross-domain request permissions matches file domain settings
     // for iframes
     public void testIframesWhenAccessFromFileURLsEnabled() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
 
         mSettings.setJavaScriptEnabled(true);
         // disable universal access from files
@@ -739,6 +855,9 @@
     // Verify that javascript cross-domain request permissions matches file domain settings
     // for iframes
     public void testIframesWhenAccessFromFileURLsDisabled() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
 
         mSettings.setJavaScriptEnabled(true);
         // disable universal access from files
@@ -757,11 +876,17 @@
 
     // Verify that enabling file access from file URLs enable XmlHttpRequest (XHR) across files
     public void testXHRWhenAccessFromFileURLsEnabled() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         verifyFileXHR(true);
     }
 
     // Verify that disabling file access from file URLs disable XmlHttpRequest (XHR) accross files
     public void testXHRWhenAccessFromFileURLsDisabled() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
 
         final ChromeClient webChromeClient = new ChromeClient(mOnUiThread);
         mOnUiThread.setWebChromeClient(webChromeClient);
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
index f78c126..7872dbe 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
@@ -47,18 +47,24 @@
     protected void setUp() throws Exception {
         super.setUp();
         final WebViewStubActivity activity = getActivity();
-        new PollingCheck(TEST_TIMEOUT) {
-            @Override
-                protected boolean check() {
-                return activity.hasWindowFocus();
-            }
-        }.run();
-        mOnUiThread = new WebViewOnUiThread(this, activity.getWebView());
+        WebView webview = activity.getWebView();
+        if (webview != null) {
+            new PollingCheck(TEST_TIMEOUT) {
+                @Override
+                    protected boolean check() {
+                    return activity.hasWindowFocus();
+                }
+            }.run();
+
+            mOnUiThread = new WebViewOnUiThread(this, webview);
+        }
     }
 
     @Override
     protected void tearDown() throws Exception {
-        mOnUiThread.cleanUp();
+        if (mOnUiThread != null) {
+            mOnUiThread.cleanUp();
+        }
         if (mWebServer != null) {
             mWebServer.shutdown();
         }
@@ -67,12 +73,18 @@
 
     // Verify that the shouldoverrideurlloading is false by default
     public void testShouldOverrideUrlLoadingDefault() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final WebViewClient webViewClient = new WebViewClient();
         assertFalse(webViewClient.shouldOverrideUrlLoading(mOnUiThread.getWebView(), null));
     }
 
     // Verify shouldoverrideurlloading called on top level navigation
     public void testShouldOverrideUrlLoading() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebViewClient webViewClient = new MockWebViewClient();
         mOnUiThread.setWebViewClient(webViewClient);
         mOnUiThread.getSettings().setJavaScriptEnabled(true);
@@ -86,6 +98,9 @@
 
     // Verify shouldoverrideurlloading called on webview called via onCreateWindow
     public void testShouldOverrideUrlLoadingOnCreateWindow() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mWebServer = new CtsTestServer(getActivity());
         // WebViewClient for main window
         final MockWebViewClient mainWebViewClient = new MockWebViewClient();
@@ -132,6 +147,9 @@
     }
 
     public void testLoadPage() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebViewClient webViewClient = new MockWebViewClient();
         mOnUiThread.setWebViewClient(webViewClient);
         mWebServer = new CtsTestServer(getActivity());
@@ -165,6 +183,9 @@
     }
 
     public void testOnReceivedError() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebViewClient webViewClient = new MockWebViewClient();
         mOnUiThread.setWebViewClient(webViewClient);
 
@@ -176,6 +197,9 @@
     }
 
     public void testOnFormResubmission() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebViewClient webViewClient = new MockWebViewClient();
         mOnUiThread.setWebViewClient(webViewClient);
         final WebSettings settings = mOnUiThread.getSettings();
@@ -201,6 +225,9 @@
     }
 
     public void testDoUpdateVisitedHistory() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebViewClient webViewClient = new MockWebViewClient();
         mOnUiThread.setWebViewClient(webViewClient);
         mWebServer = new CtsTestServer(getActivity());
@@ -219,6 +246,9 @@
     }
 
     public void testOnReceivedHttpAuthRequest() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebViewClient webViewClient = new MockWebViewClient();
         mOnUiThread.setWebViewClient(webViewClient);
         mWebServer = new CtsTestServer(getActivity());
@@ -230,6 +260,9 @@
     }
 
     public void testShouldOverrideKeyEvent() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebViewClient webViewClient = new MockWebViewClient();
         mOnUiThread.setWebViewClient(webViewClient);
 
@@ -237,6 +270,9 @@
     }
 
     public void testOnUnhandledKeyEvent() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         requireLoadedPage();
         final MockWebViewClient webViewClient = new MockWebViewClient();
         mOnUiThread.setWebViewClient(webViewClient);
@@ -256,6 +292,9 @@
     }
 
     public void testOnScaleChanged() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final MockWebViewClient webViewClient = new MockWebViewClient();
         mOnUiThread.setWebViewClient(webViewClient);
         mWebServer = new CtsTestServer(getActivity());
@@ -264,7 +303,14 @@
         String url1 = mWebServer.getAssetUrl(TestHtmlConstants.HELLO_WORLD_URL);
         mOnUiThread.loadUrlAndWaitForCompletion(url1);
 
-        mOnUiThread.zoomIn();
+        new PollingCheck(TEST_TIMEOUT) {
+            @Override
+            protected boolean check() {
+                return mOnUiThread.canZoomIn();
+            }
+        }.run();
+
+        assertTrue(mOnUiThread.zoomIn());
         new PollingCheck(TEST_TIMEOUT) {
             @Override
             protected boolean check() {
@@ -274,6 +320,9 @@
     }
 
     private void requireLoadedPage() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mOnUiThread.loadUrlAndWaitForCompletion("about:blank");
     }
 
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewStartupTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewStartupTest.java
index a7ee974..56f8f61 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewStartupTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewStartupTest.java
@@ -63,9 +63,17 @@
                 Log.i(TAG, "done setting cookie before creating webview");
             }
         });
+        NullWebViewUtils.NullWebViewFromThreadExceptionHandler h =
+                new NullWebViewUtils.NullWebViewFromThreadExceptionHandler();
+
+        background.setUncaughtExceptionHandler(h);
         background.start();
         background.join();
 
+        if (!h.isWebViewAvailable(mActivity)) {
+            return;
+        }
+
         // Now create WebView and test that setting the cookie beforehand really worked.
         mActivity.createAndAttachWebView();
         WebViewOnUiThread onUiThread = new WebViewOnUiThread(this, mActivity.getWebView());
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
index 9815aef..d339a62 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
@@ -124,23 +124,28 @@
     protected void setUp() throws Exception {
         super.setUp();
         final WebViewStubActivity activity = getActivity();
-        new PollingCheck() {
-            @Override
-                protected boolean check() {
-                return activity.hasWindowFocus();
-            }
-        }.run();
         mWebView = activity.getWebView();
-        File f = activity.getFileStreamPath("snapshot");
-        if (f.exists()) {
-            f.delete();
+        if (mWebView != null) {
+            new PollingCheck() {
+                @Override
+                    protected boolean check() {
+                        return activity.hasWindowFocus();
+                }
+            }.run();
+            File f = activity.getFileStreamPath("snapshot");
+            if (f.exists()) {
+                f.delete();
+            }
+
+            mOnUiThread = new WebViewOnUiThread(this, mWebView);
         }
-        mOnUiThread = new WebViewOnUiThread(this, mWebView);
     }
 
     @Override
     protected void tearDown() throws Exception {
-        mOnUiThread.cleanUp();
+        if (mOnUiThread != null) {
+            mOnUiThread.cleanUp();
+        }
         if (mWebServer != null) {
             mWebServer.shutdown();
         }
@@ -171,6 +176,10 @@
 
     @UiThreadTest
     public void testConstructor() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         new WebView(getActivity());
         new WebView(getActivity(), null);
         new WebView(getActivity(), null, 0);
@@ -178,12 +187,19 @@
 
     @UiThreadTest
     public void testCreatingWebViewCreatesCookieSyncManager() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         new WebView(getActivity());
         assertNotNull(CookieSyncManager.getInstance());
     }
 
     @UiThreadTest
     public void testFindAddress() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         /*
          * Info about USPS
          * http://en.wikipedia.org/wiki/Postal_address#United_States
@@ -199,19 +215,25 @@
     @SuppressWarnings("deprecation")
     @UiThreadTest
     public void testGetZoomControls() {
-         WebSettings settings = mWebView.getSettings();
-         assertTrue(settings.supportZoom());
-         View zoomControls = mWebView.getZoomControls();
-         assertNotNull(zoomControls);
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+        WebSettings settings = mWebView.getSettings();
+        assertTrue(settings.supportZoom());
+        View zoomControls = mWebView.getZoomControls();
+        assertNotNull(zoomControls);
 
-         // disable zoom support
-         settings.setSupportZoom(false);
-         assertFalse(settings.supportZoom());
-         assertNull(mWebView.getZoomControls());
+        // disable zoom support
+        settings.setSupportZoom(false);
+        assertFalse(settings.supportZoom());
+        assertNull(mWebView.getZoomControls());
     }
 
     @UiThreadTest
     public void testInvokeZoomPicker() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         WebSettings settings = mWebView.getSettings();
         assertTrue(settings.supportZoom());
         startWebServer(false);
@@ -221,6 +243,10 @@
     }
 
     public void testZoom() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         // Pinch zoom is not supported in wrap_content layouts.
         mOnUiThread.setLayoutHeightToMatchParent();
 
@@ -230,6 +256,7 @@
         mWebServer = new CtsTestServer(getActivity());
         mOnUiThread.loadUrlAndWaitForCompletion(
                 mWebServer.getAssetUrl(TestHtmlConstants.HELLO_WORLD_URL));
+        pollingCheckForCanZoomIn();
 
         WebSettings settings = mOnUiThread.getSettings();
         settings.setSupportZoom(false);
@@ -306,6 +333,10 @@
 
     @UiThreadTest
     public void testSetScrollBarStyle() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_INSET);
         assertFalse(mWebView.overlayHorizontalScrollbar());
         assertFalse(mWebView.overlayVerticalScrollbar());
@@ -325,6 +356,10 @@
 
     @UiThreadTest
     public void testScrollBarOverlay() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         mWebView.setHorizontalScrollbarOverlay(true);
         mWebView.setVerticalScrollbarOverlay(false);
         assertTrue(mWebView.overlayHorizontalScrollbar());
@@ -338,6 +373,10 @@
 
     @UiThreadTest
     public void testLoadUrl() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         assertNull(mWebView.getUrl());
         assertNull(mWebView.getOriginalUrl());
         assertEquals(INITIAL_PROGRESS, mWebView.getProgress());
@@ -361,6 +400,10 @@
 
     @UiThreadTest
     public void testLoadUrlDoesNotStripParamsWhenLoadingContentUrls() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         Uri.Builder uriBuilder = new Uri.Builder().scheme(
                 ContentResolver.SCHEME_CONTENT).authority(MockContentProvider.AUTHORITY);
         uriBuilder.appendPath("foo.html").appendQueryParameter("param","bar");
@@ -373,6 +416,10 @@
 
     @UiThreadTest
     public void testAppInjectedXRequestedWithHeaderIsNotOverwritten() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         startWebServer(false);
         String url = mWebServer.getAssetUrl(TestHtmlConstants.HELLO_WORLD_URL);
         HashMap<String, String> map = new HashMap<String, String>();
@@ -392,6 +439,10 @@
 
     @UiThreadTest
     public void testAppCanInjectHeadersViaImmutableMap() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         startWebServer(false);
         String url = mWebServer.getAssetUrl(TestHtmlConstants.HELLO_WORLD_URL);
         HashMap<String, String> map = new HashMap<String, String>();
@@ -412,6 +463,10 @@
     @SuppressWarnings("deprecation")
     @UiThreadTest
     public void testGetVisibleTitleHeight() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         startWebServer(false);
         String url = mWebServer.getAssetUrl(TestHtmlConstants.HELLO_WORLD_URL);
         mOnUiThread.loadUrlAndWaitForCompletion(url);
@@ -420,6 +475,10 @@
 
     @UiThreadTest
     public void testGetOriginalUrl() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         startWebServer(false);
         final String finalUrl = mWebServer.getAssetUrl(TestHtmlConstants.HELLO_WORLD_URL);
         final String redirectUrl =
@@ -440,6 +499,10 @@
     }
 
     public void testStopLoading() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         assertEquals(INITIAL_PROGRESS, mOnUiThread.getProgress());
 
         startWebServer(false);
@@ -475,6 +538,10 @@
 
     @UiThreadTest
     public void testGoBackAndForward() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         assertGoBackOrForwardBySteps(false, -1);
         assertGoBackOrForwardBySteps(false, 1);
 
@@ -521,6 +588,10 @@
 
     @UiThreadTest
     public void testAddJavascriptInterface() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         WebSettings settings = mWebView.getSettings();
         settings.setJavaScriptEnabled(true);
         settings.setJavaScriptCanOpenWindowsAutomatically(true);
@@ -567,6 +638,10 @@
 
     @UiThreadTest
     public void testAddJavascriptInterfaceNullObject() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         WebSettings settings = mWebView.getSettings();
         settings.setJavaScriptEnabled(true);
         String setTitleToPropertyTypeHtml = "<html><head></head>" +
@@ -599,6 +674,10 @@
 
     @UiThreadTest
     public void testRemoveJavascriptInterface() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         WebSettings settings = mWebView.getSettings();
         settings.setJavaScriptEnabled(true);
         String setTitleToPropertyTypeHtml = "<html><head></head>" +
@@ -618,6 +697,10 @@
     }
 
     public void testUseRemovedJavascriptInterface() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
         class RemovedObject {
             @Override
             @JavascriptInterface
@@ -665,6 +748,34 @@
         assertEquals("removedObject", resultObject.getResult());
     }
 
+    public void testJavascriptInterfaceCustomPropertiesClearedOnReload() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
+
+        mOnUiThread.getSettings().setJavaScriptEnabled(true);
+
+        class DummyJavaScriptInterface {
+        }
+        final DummyJavaScriptInterface obj = new DummyJavaScriptInterface();
+        mOnUiThread.addJavascriptInterface(obj, "dummy");
+        mOnUiThread.loadUrlAndWaitForCompletion("about:blank");
+
+        EvaluateJsResultPollingCheck jsResult;
+        jsResult = new EvaluateJsResultPollingCheck("42");
+        mOnUiThread.evaluateJavascript("dummy.custom_property = 42", jsResult);
+        jsResult.run();
+        jsResult = new EvaluateJsResultPollingCheck("true");
+        mOnUiThread.evaluateJavascript("'custom_property' in dummy", jsResult);
+        jsResult.run();
+
+        mOnUiThread.reload();
+
+        jsResult = new EvaluateJsResultPollingCheck("false");
+        mOnUiThread.evaluateJavascript("'custom_property' in dummy", jsResult);
+        jsResult.run();
+    }
+
     private final class TestPictureListener implements PictureListener {
         public int callCount;
 
@@ -702,6 +813,9 @@
     }
 
     public void testCapturePicture() throws Exception, Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final TestPictureListener listener = new TestPictureListener();
 
         startWebServer(false);
@@ -726,6 +840,9 @@
     }
 
     public void testSetPictureListener() throws Exception, Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final class MyPictureListener implements PictureListener {
             public int callCount;
             public WebView webView;
@@ -769,6 +886,9 @@
 
     @UiThreadTest
     public void testAccessHttpAuthUsernamePassword() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         try {
             WebViewDatabase.getInstance(getActivity()).clearHttpAuthUsernamePassword();
 
@@ -830,6 +950,9 @@
     }
 
     public void testLoadData() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final String HTML_CONTENT =
                 "<html><head><title>Hello,World!</title></head><body></body>" +
                 "</html>";
@@ -858,6 +981,9 @@
 
     @UiThreadTest
     public void testLoadDataWithBaseUrl() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertNull(mWebView.getUrl());
         String imgUrl = TestHtmlConstants.SMALL_IMG_URL; // relative
         // Snippet of HTML that will prevent favicon requests to the test server.
@@ -946,6 +1072,9 @@
     }
 
     public void testFindAll()  throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // Make the page scrollable, so we can detect the scrolling to make sure the
         // content fully loaded.
         mOnUiThread.setInitialScale(100);
@@ -970,6 +1099,9 @@
     }
 
     public void testFindNext() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // Reset the scaling so that finding the next "all" text will require scrolling.
         mOnUiThread.setInitialScale(100);
 
@@ -1026,6 +1158,9 @@
     }
 
     public void testDocumentHasImages() throws Exception, Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final class DocumentHasImageCheckHandler extends Handler {
             private boolean mReceived;
             private int mMsgArg1;
@@ -1075,6 +1210,9 @@
     }
 
     public void testPageScroll() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         DisplayMetrics metrics = mOnUiThread.getDisplayMetrics();
         int dimension = 2 * Math.max(metrics.widthPixels, metrics.heightPixels);
         String p = "<p style=\"height:" + dimension + "px;\">" +
@@ -1119,6 +1257,9 @@
     }
 
     public void testGetContentHeight() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mOnUiThread.loadDataAndWaitForCompletion(
                 "<html><body></body></html>", "text/html", null);
         new PollingCheck() {
@@ -1157,12 +1298,18 @@
 
     @UiThreadTest
     public void testPlatformNotifications() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         WebView.enablePlatformNotifications();
         WebView.disablePlatformNotifications();
     }
 
     @UiThreadTest
     public void testAccessPluginList() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         assertNotNull(WebView.getPluginList());
 
         // can not find a way to install plugins
@@ -1171,12 +1318,18 @@
 
     @UiThreadTest
     public void testDestroy() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // Create a new WebView, since we cannot call destroy() on a view in the hierarchy
         WebView localWebView = new WebView(getActivity());
         localWebView.destroy();
     }
 
     public void testFlingScroll() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         DisplayMetrics metrics = mOnUiThread.getDisplayMetrics();
         final int dimension = 10 * Math.max(metrics.widthPixels, metrics.heightPixels);
         String p = "<p style=\"height:" + dimension + "px;" +
@@ -1206,6 +1359,9 @@
     }
 
     public void testRequestFocusNodeHref() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         startWebServer(false);
         String url1 = mWebServer.getAssetUrl(TestHtmlConstants.HTML_URL1);
         String url2 = mWebServer.getAssetUrl(TestHtmlConstants.HTML_URL2);
@@ -1273,6 +1429,9 @@
     }
 
     public void testRequestImageRef() throws Exception, Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final class ImageLoaded {
             public boolean mImageLoaded;
 
@@ -1353,10 +1512,16 @@
 
     @UiThreadTest
     public void testDebugDump() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mWebView.debugDump();
     }
 
     public void testGetHitTestResult() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final String anchor = "<p><a href=\"" + TestHtmlConstants.EXT_WEB_URL1
                 + "\">normal anchor</a></p>";
         final String blankAnchor = "<p><a href=\"\">blank anchor</a></p>";
@@ -1418,6 +1583,9 @@
     }
 
     public void testSetInitialScale() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final String p = "<p style=\"height:1000px;width:1000px\">Test setInitialScale.</p>";
         final float defaultScale =
             getInstrumentation().getTargetContext().getResources().getDisplayMetrics().density;
@@ -1469,6 +1637,9 @@
 
     @UiThreadTest
     public void testGetFavicon() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         startWebServer(false);
         String url = mWebServer.getAssetUrl(TestHtmlConstants.TEST_FAVICON_URL);
         mOnUiThread.loadUrlAndWaitForCompletion(url);
@@ -1479,6 +1650,9 @@
 
     @UiThreadTest
     public void testClearHistory() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         startWebServer(false);
         String url1 = mWebServer.getAssetUrl(TestHtmlConstants.HTML_URL1);
         String url2 = mWebServer.getAssetUrl(TestHtmlConstants.HTML_URL2);
@@ -1501,6 +1675,9 @@
 
     @UiThreadTest
     public void testSaveAndRestoreState() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // nothing to save
         assertNull(mWebView.saveState(new Bundle()));
 
@@ -1564,6 +1741,9 @@
     }
 
     public void testSetWebViewClient() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final ScaleChangedWebViewClient webViewClient = new ScaleChangedWebViewClient();
         mOnUiThread.setWebViewClient(webViewClient);
         startWebServer(false);
@@ -1571,13 +1751,17 @@
         assertFalse(webViewClient.onScaleChangedCalled());
         String url1 = mWebServer.getAssetUrl(TestHtmlConstants.HELLO_WORLD_URL);
         mOnUiThread.loadUrlAndWaitForCompletion(url1);
+        pollingCheckForCanZoomIn();
 
-        mOnUiThread.zoomIn();
+        assertTrue(mOnUiThread.zoomIn());
         webViewClient.waitForScaleChanged();
     }
 
     @UiThreadTest
     public void testInsecureSiteClearsCertificate() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final class MockWebViewClient extends WaitForLoadedClient {
             public MockWebViewClient() {
                 super(mOnUiThread);
@@ -1606,6 +1790,9 @@
 
     @UiThreadTest
     public void testSecureSiteSetsCertificate() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final class MockWebViewClient extends WaitForLoadedClient {
             public MockWebViewClient() {
                 super(mOnUiThread);
@@ -1634,6 +1821,9 @@
 
     @UiThreadTest
     public void testClearSslPreferences() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // Load the first page. We expect a call to
         // WebViewClient.onReceivedSslError().
         final SslErrorWebViewClient webViewClient = new SslErrorWebViewClient();
@@ -1661,6 +1851,9 @@
     }
 
     public void testOnReceivedSslError() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final class MockWebViewClient extends WaitForLoadedClient {
             private String mErrorUrl;
             private WebView mWebView;
@@ -1694,6 +1887,9 @@
     }
 
     public void testOnReceivedSslErrorProceed() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final class MockWebViewClient extends WaitForLoadedClient {
             public MockWebViewClient() {
                 super(mOnUiThread);
@@ -1712,6 +1908,9 @@
     }
 
     public void testOnReceivedSslErrorCancel() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final class MockWebViewClient extends WaitForLoadedClient {
             public MockWebViewClient() {
                 super(mOnUiThread);
@@ -1731,6 +1930,9 @@
     }
 
     public void testSslErrorProceedResponseReusedForSameHost() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // Load the first page. We expect a call to
         // WebViewClient.onReceivedSslError().
         final SslErrorWebViewClient webViewClient = new SslErrorWebViewClient();
@@ -1751,6 +1953,9 @@
     }
 
     public void testSslErrorProceedResponseNotReusedForDifferentHost() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         // Load the first page. We expect a call to
         // WebViewClient.onReceivedSslError().
         final SslErrorWebViewClient webViewClient = new SslErrorWebViewClient();
@@ -1774,6 +1979,9 @@
     }
 
     public void testRequestChildRectangleOnScreen() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         DisplayMetrics metrics = mOnUiThread.getDisplayMetrics();
         final int dimension = 2 * Math.max(metrics.widthPixels, metrics.heightPixels);
         String p = "<p style=\"height:" + dimension + "px;width:" + dimension + "px\">&nbsp;</p>";
@@ -1797,6 +2005,9 @@
     }
 
     public void testSetDownloadListener() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final class MyDownloadListener implements DownloadListener {
             public String url;
             public String mimeType;
@@ -1828,9 +2039,13 @@
         // the WebView will load the new URL.
         mOnUiThread.setDownloadListener(listener);
         mOnUiThread.getSettings().setJavaScriptEnabled(true);
+
+        // See b/13675265 for discussion on why the setTimeout is necessary.
+        // Works around a Blink bug.
         mOnUiThread.loadDataAndWaitForCompletion(
-                "<html><body onload=\"window.location = \'" + url + "\'\"></body></html>",
-                "text/html", null);
+                "<html><body onload=\"setTimeout(" +
+                "function() { window.location = \'" + url + "\'; }, 100);\">" +
+                "</body></html>", "text/html", null);
         // Wait for layout to complete before setting focus.
         getInstrumentation().waitForIdleSync();
 
@@ -1849,6 +2064,9 @@
 
     @UiThreadTest
     public void testSetLayoutParams() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(600, 800);
         mWebView.setLayoutParams(params);
         assertSame(params, mWebView.getLayoutParams());
@@ -1856,10 +2074,16 @@
 
     @UiThreadTest
     public void testSetMapTrackballToArrowKeys() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mWebView.setMapTrackballToArrowKeys(true);
     }
 
     public void testSetNetworkAvailable() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         WebSettings settings = mOnUiThread.getSettings();
         settings.setJavaScriptEnabled(true);
         startWebServer(false);
@@ -1890,6 +2114,9 @@
     }
 
     public void testSetWebChromeClient() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         final class MockWebChromeClient extends WaitForProgressClient {
             private boolean mOnProgressChanged = false;
 
@@ -1927,6 +2154,9 @@
     }
 
     public void testPauseResumeTimers() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         class Monitor {
             private boolean mIsUpdated;
 
@@ -1982,6 +2212,9 @@
 
     // verify query parameters can be passed correctly to android asset files
     public void testAndroidAssetQueryParam() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
 
         WebSettings settings = mOnUiThread.getSettings();
         settings.setJavaScriptEnabled(true);
@@ -1993,6 +2226,9 @@
 
     // verify anchors work correctly for android asset files
     public void testAndroidAssetAnchor() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
 
         WebSettings settings = mOnUiThread.getSettings();
         settings.setJavaScriptEnabled(true);
@@ -2003,6 +2239,9 @@
     }
 
     public void testEvaluateJavascript() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mOnUiThread.getSettings().setJavaScriptEnabled(true);
         mOnUiThread.loadUrlAndWaitForCompletion("about:blank");
 
@@ -2026,6 +2265,9 @@
 
     // Verify Print feature can create a PDF file with a correct preamble.
     public void testPrinting() throws Throwable {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         mOnUiThread.loadDataAndWaitForCompletion("<html><head></head>" +
                 "<body>foo</body></html>",
                 "text/html", null);
@@ -2301,6 +2543,15 @@
         }
     }
 
+    private void pollingCheckForCanZoomIn() {
+        new PollingCheck(TEST_TIMEOUT) {
+            @Override
+            protected boolean check() {
+                return mOnUiThread.canZoomIn();
+            }
+        }.run();
+    }
+
     final class ScaleChangedWebViewClient extends WaitForLoadedClient {
         private boolean mOnScaleChangedCalled = false;
         public ScaleChangedWebViewClient() {
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebView_WebViewTransportTest.java b/tests/tests/webkit/src/android/webkit/cts/WebView_WebViewTransportTest.java
index dd784be..cb72ef0 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebView_WebViewTransportTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebView_WebViewTransportTest.java
@@ -31,6 +31,9 @@
 
     @UiThreadTest
     public void testAccessWebView() {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         WebView webView = getActivity().getWebView();
         WebViewTransport transport = webView.new WebViewTransport();
 
diff --git a/tests/tests/widget/src/android/widget/cts/FrameLayoutTest.java b/tests/tests/widget/src/android/widget/cts/FrameLayoutTest.java
index 5b225e8..6564ce0 100644
--- a/tests/tests/widget/src/android/widget/cts/FrameLayoutTest.java
+++ b/tests/tests/widget/src/android/widget/cts/FrameLayoutTest.java
@@ -156,7 +156,7 @@
         // text view and button are VISIBLE, they should be measured
         final TextView textView = (TextView) frameLayout.findViewById(R.id.framelayout_textview);
         compareScaledPixels(30, textView.getMeasuredHeight());
-        compareScaledPixels(100, textView.getMeasuredWidth());
+        compareScaledPixels(60, textView.getMeasuredWidth());
         assertEquals(textView.getMeasuredHeight(), frameLayout.getMeasuredHeight());
         assertEquals(textView.getMeasuredWidth(), frameLayout.getMeasuredWidth());
 
diff --git a/tests/tests/widget/src/android/widget/cts/RemoteViewsActivityTest.java b/tests/tests/widget/src/android/widget/cts/RemoteViewsActivityTest.java
index 758afd7..b3c0915 100644
--- a/tests/tests/widget/src/android/widget/cts/RemoteViewsActivityTest.java
+++ b/tests/tests/widget/src/android/widget/cts/RemoteViewsActivityTest.java
@@ -23,6 +23,7 @@
 import android.view.InflateException;
 import android.view.View;
 import android.view.ViewGroup;
+import android.webkit.cts.NullWebViewUtils;
 import android.widget.RemoteViews;
 
 import com.android.cts.stub.R;
@@ -96,6 +97,9 @@
 
     @MediumTest
     public void testWebView() throws Exception {
+        if (!NullWebViewUtils.isWebViewAvailable()) {
+            return;
+        }
         RemoteViews orig = new RemoteViews(PACKAGE_NAME, R.layout.remote_view_test_bad_2);
         Parcel p = Parcel.obtain();
         orig.writeToParcel(p, 0);
diff --git a/tests/tests/widget/src/android/widget/cts/TextViewTest.java b/tests/tests/widget/src/android/widget/cts/TextViewTest.java
index 9e03f84..36ace30 100644
--- a/tests/tests/widget/src/android/widget/cts/TextViewTest.java
+++ b/tests/tests/widget/src/android/widget/cts/TextViewTest.java
@@ -2833,6 +2833,17 @@
     }
 
     @UiThreadTest
+    public void testSetTextLong() {
+        final int MAX_COUNT = 1 << 21;
+        char[] longText = new char[MAX_COUNT];
+        for (int n = 0; n < MAX_COUNT; n++) {
+            longText[n] = 'm';
+        }
+        mTextView = findTextView(R.id.textview_text);
+        mTextView.setText(new String(longText));
+    }
+
+    @UiThreadTest
     public void testSetExtractedText() {
         mTextView = findTextView(R.id.textview_text);
         assertEquals(mActivity.getResources().getString(R.string.text_view_hello),
diff --git a/tests/tests/widget/src/android/widget/cts/VideoViewTest.java b/tests/tests/widget/src/android/widget/cts/VideoViewTest.java
index 679a298..c8d9fc7 100644
--- a/tests/tests/widget/src/android/widget/cts/VideoViewTest.java
+++ b/tests/tests/widget/src/android/widget/cts/VideoViewTest.java
@@ -18,16 +18,18 @@
 
 import com.android.cts.stub.R;
 
-
 import android.app.Activity;
 import android.app.Instrumentation;
 import android.content.Context;
 import android.cts.util.PollingCheck;
+import android.media.MediaCodecInfo;
+import android.media.MediaCodecList;
 import android.media.MediaPlayer;
 import android.media.MediaPlayer.OnCompletionListener;
 import android.media.MediaPlayer.OnErrorListener;
 import android.media.MediaPlayer.OnPreparedListener;
 import android.test.ActivityInstrumentationTestCase2;
+import android.util.Log;
 import android.view.View.MeasureSpec;
 import android.widget.MediaController;
 import android.widget.VideoView;
@@ -40,6 +42,8 @@
  * Test {@link VideoView}.
  */
 public class VideoViewTest extends ActivityInstrumentationTestCase2<VideoViewStubActivity> {
+    /** Debug TAG. **/
+    private static final String TAG = "VideoViewTest";
     /** The maximum time to wait for an operation. */
     private static final long   TIME_OUT = 15000L;
     /** The interval time to wait for completing an operation. */
@@ -48,6 +52,8 @@
     private static final int    TEST_VIDEO_DURATION = 11047;
     /** The full name of R.raw.testvideo. */
     private static final String VIDEO_NAME   = "testvideo.3gp";
+    /** The MIME type. */
+    private static final String MIME_TYPE = "video/3gpp";
     /** delta for duration in case user uses different decoders on different
         hardware that report a duration that's different by a few milliseconds */
     private static final int DURATION_DELTA = 100;
@@ -95,6 +101,28 @@
         }
     }
 
+    // TODO: Make a public method selectCodec() in common libraries (e.g. cts/libs/), to avoid
+    // redundant function definitions in this and other media related test files.
+    private static boolean hasCodec(String mimeType) {
+        int numCodecs = MediaCodecList.getCodecCount();
+
+        for (int i = 0; i < numCodecs; i++) {
+            MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
+
+            if (!codecInfo.isEncoder()) {
+                continue;
+            }
+
+            String[] types = codecInfo.getSupportedTypes();
+            for (int j = 0; j < types.length; j++) {
+                if (types[j].equalsIgnoreCase(mimeType)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
     /**
      * Instantiates a new video view test.
      */
@@ -165,6 +193,12 @@
     }
 
     public void testPlayVideo1() throws Throwable {
+        // Don't run the test if the codec isn't supported.
+        if (!hasCodec(MIME_TYPE)) {
+            Log.w(TAG, "Codec " + MIME_TYPE + " not supported. Return from testPlayVideo1.");
+            return;
+        }
+
         final MockOnPreparedListener preparedListener = new MockOnPreparedListener();
         mVideoView.setOnPreparedListener(preparedListener);
         final MockOnCompletionListener completionListener = new MockOnCompletionListener();
@@ -219,6 +253,12 @@
     }
 
     public void testGetBufferPercentage() throws Throwable {
+        // Don't run the test if the codec isn't supported.
+        if (!hasCodec(MIME_TYPE)) {
+            Log.w(TAG, MIME_TYPE + " not supported. Return from testGetBufferPercentage.");
+            return;
+        }
+
         final MockOnPreparedListener prepareListener = new MockOnPreparedListener();
         mVideoView.setOnPreparedListener(prepareListener);
 
@@ -255,6 +295,12 @@
     }
 
     public void testGetDuration() throws Throwable {
+        // Don't run the test if the codec isn't supported.
+        if (!hasCodec(MIME_TYPE)) {
+            Log.w(TAG, "Codec " + MIME_TYPE + " not supported. Return from testGetDuration.");
+            return;
+        }
+
         runTestOnUiThread(new Runnable() {
             public void run() {
                 mVideoView.setVideoPath(mVideoPath);
diff --git a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl b/tests/uiautomator/test-apps/CtsUiAutomatorApp/res/values-watch/styles.xml
similarity index 72%
copy from tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
copy to tests/uiautomator/test-apps/CtsUiAutomatorApp/res/values-watch/styles.xml
index af264c9..1d904c2 100644
--- a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
+++ b/tests/uiautomator/test-apps/CtsUiAutomatorApp/res/values-watch/styles.xml
@@ -1,5 +1,7 @@
-/*
- * Copyright 2013 The Android Open Source Project
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ * Copyright (C) 2011 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -12,10 +14,9 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
+ -->
+<resources>
 
-package android.security.cts.activity;
+    <style name="AppTheme" parent="android:Theme.Holo.Light.NoActionBar" />
 
-interface ISecureRandomService {
-    int getRandomBytesAndPid(inout byte[] randomBytes);
-}
+</resources>
\ No newline at end of file
diff --git a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoActivity.java b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoActivity.java
index 4df8e62..ed82b08 100644
--- a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoActivity.java
+++ b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoActivity.java
@@ -106,6 +106,11 @@
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
+        // Dismiss keyguard and keep screen on while this test is on.
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |
+                WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON |
+                WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+
         super.onCreate(savedInstanceState);
         Window w = getWindow();
         w.setFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED,
diff --git a/tools/tradefed-host/res/report/cts_result.xsl b/tools/tradefed-host/res/report/cts_result.xsl
index 2d8bb50..fe49308 100644
--- a/tools/tradefed-host/res/report/cts_result.xsl
+++ b/tools/tradefed-host/res/report/cts_result.xsl
@@ -538,15 +538,7 @@
                                                             <xsl:value-of select="@result"/>
                                                         </div>
                                                     </TD>
-                                                    <TD class="failuredetails">
-                                                        <div class="details">
-                                                            <ul>
-                                                              <xsl:for-each select="Details/ValueArray/Value">
-                                                                <li><xsl:value-of select="."/></li>
-                                                              </xsl:for-each>
-                                                            </ul>
-                                                        </div>
-                                                    </TD>
+                                                    <TD class="failuredetails"/>
                                                 </xsl:if>
 
                                                 <xsl:if test="@result='fail'">
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java b/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
index 103ba6e..ccdb0eb 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
@@ -31,7 +31,7 @@
     @Option(name="cts-install-path", description="the path to the cts installation to use")
     private String mCtsRootDirPath = System.getProperty("CTS_ROOT");
 
-    public static final String CTS_BUILD_VERSION = "4.4_r1.95";
+    public static final String CTS_BUILD_VERSION = "4.4_r3";
 
     /**
      * {@inheritDoc}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsXmlResultReporter.java b/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsXmlResultReporter.java
index 6643934..70310ca 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsXmlResultReporter.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsXmlResultReporter.java
@@ -58,7 +58,7 @@
     private static final String LOG_TAG = "CtsXmlResultReporter";
 
     static final String TEST_RESULT_FILE_NAME = "testResult.xml";
-    private static final String CTS_RESULT_FILE_VERSION = "4.4";
+    static final String CTS_RESULT_FILE_VERSION = "4.4";
     private static final String[] CTS_RESULT_RESOURCES = {"cts_result.xsl", "cts_result.css",
         "logo.gif", "newrule-green.png"};
 
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
index c6977e5..48f4773 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
@@ -43,14 +43,13 @@
 import com.android.tradefed.util.RunUtil;
 import com.android.tradefed.util.xml.AbstractXmlParser.ParseException;
 
+import junit.framework.Test;
+
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.InputStream;
-import java.lang.InterruptedException;
-import java.lang.System;
-import java.lang.Thread;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -63,8 +62,6 @@
 import java.util.Queue;
 import java.util.Set;
 
-import junit.framework.Test;
-
 /**
  * A {@link Test} for running CTS tests.
  * <p/>
@@ -600,8 +597,13 @@
             for (String uri : plan.getTestUris()) {
                 if (!mExcludedPackageNames.contains(uri)) {
                     ITestPackageDef testPackage = testRepo.getTestPackage(uri);
-                    testPackage.setExcludedTestFilter(plan.getExcludedTestFilter(uri));
-                    testPkgDefs.add(testPackage);
+                    if (testPackage != null) {
+                        testPackage.setExcludedTestFilter(plan.getExcludedTestFilter(uri));
+                        testPkgDefs.add(testPackage);
+                    } else {
+                        CLog.e("Could not find test package uri %s referenced in plan %s", uri,
+                                mPlanName);
+                    }
                 }
             }
         } else if (mPackageNames.size() > 0){
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestFilter.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestFilter.java
index 053b265..f1a0485 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestFilter.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestFilter.java
@@ -33,6 +33,10 @@
 
     private final Set<String> mExcludedClasses;
     private final Set<TestIdentifier> mExcludedTests;
+
+    private final Set<String> mIncludedClasses;
+    private final Set<TestIdentifier> mIncludedTests;
+
     private String mIncludedClass = null;
     private String mIncludedMethod = null;
 
@@ -42,6 +46,9 @@
     public TestFilter() {
         mExcludedClasses = new HashSet<String>();
         mExcludedTests = new HashSet<TestIdentifier>();
+
+        mIncludedClasses = new HashSet<String>();
+        mIncludedTests = new HashSet<TestIdentifier>();
     }
 
     /**
@@ -79,6 +86,36 @@
     }
 
     /**
+     * Adds a test class to the filter.
+     * <p/>
+     * All tests in this class should be allowed.
+     */
+    public void addIncludedClass(String className) {
+        mIncludedClasses.add(className);
+    }
+
+    /**
+     * Adds a test class to the filter. All tests in this class should be excluded.
+     */
+    public void addIncludedTest(TestIdentifier test) {
+        mIncludedTests.add(test);
+    }
+
+    /**
+     * @return the mIncludedClasses
+     */
+    public Set<String> getIncludedClasses() {
+        return mIncludedClasses;
+    }
+
+    /**
+     * @return the mIncludedTests
+     */
+    public Set<TestIdentifier> getIncludedTests() {
+        return mIncludedTests;
+    }
+
+    /**
      * Sets the class name and optionally method that should pass this filter. If non-null, all
      * other tests will be excluded.
      *
@@ -96,7 +133,7 @@
      * @param tests the list of tests to filter
      * @return a new sorted list of tests that passed the filter
      */
-    public Collection<TestIdentifier> filter(Collection<TestIdentifier > tests) {
+    public Collection<TestIdentifier> filter(Collection<TestIdentifier> tests) {
         List<TestIdentifier> filteredTests = new ArrayList<TestIdentifier>(tests.size());
         for (TestIdentifier test : tests) {
             if (mIncludedClass != null && !test.getClassName().equals(mIncludedClass)) {
@@ -115,6 +152,12 @@
                 // skip
                 continue;
             }
+            if ((!mIncludedTests.isEmpty() || !mIncludedClasses.isEmpty())
+                    && !(mIncludedClasses.contains(test.getClassName())
+                            || mIncludedTests.contains(test))) {
+                // skip
+                continue;
+            }
             filteredTests.add(test);
         }
         Collections.sort(filteredTests, new TestIdComparator());
@@ -129,6 +172,13 @@
     }
 
     /**
+     * @return true if there are inclusion rules defined.
+     */
+    public boolean hasInclusion() {
+        return !mIncludedClasses.isEmpty() || !mIncludedTests.isEmpty();
+    }
+
+    /**
      * A {@link Comparator} for {@link TestIdentifier} that compares using
      * {@link TestIdentifier#toString()}
      */
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageXmlParser.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageXmlParser.java
index 675c986..bd67f78 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageXmlParser.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageXmlParser.java
@@ -84,7 +84,9 @@
                 mPackageDef.setTestType(getTestType(attributes));
                 mPackageDef.setJarPath(jarPath);
                 mPackageDef.setIsSignatureCheck(parseBoolean(signatureCheck));
-                mPackageDef.setTestPackageName(javaPackageFilter);
+                if (!"".equals(javaPackageFilter)) {
+                    mPackageDef.setTestPackageName(javaPackageFilter);
+                }
                 mPackageDef.setTargetBinaryName(targetBinaryName);
                 mPackageDef.setTargetNameSpace(targetNameSpace);
 
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPlan.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPlan.java
index 3639a9c..c2a1348 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPlan.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPlan.java
@@ -47,6 +47,7 @@
     private static final String TEST_DELIM = ";";
     private static final String METHOD_DELIM = "#";
     private static final String EXCLUDE_ATTR = "exclude";
+    private static final String INCLUDE_ATTR = "include";
     private static final String URI_ATTR = "uri";
 
     private final String mName;
@@ -61,21 +62,23 @@
                 throws SAXException {
             if (ENTRY_TAG.equals(localName)) {
                 final String entryUriValue = attributes.getValue(URI_ATTR);
-                TestFilter filter = parseExcludedTests(attributes.getValue(EXCLUDE_ATTR));
+                TestFilter filter = parseTestList(
+                        attributes.getValue(EXCLUDE_ATTR), attributes.getValue(INCLUDE_ATTR));
                 mUriExcludedTestsMap.put(entryUriValue, filter);
             }
         }
 
         /**
-         * Parse the semi colon separated list of tests to exclude.
+         * Parse a semicolon separated list of tests.
          * <p/>
          * Expected format:
          * testClassName[#testMethodName][;testClassName2...]
          *
          * @param excludedString the excluded string list
+         * @param includedString the included string list
          * @return
          */
-        private TestFilter parseExcludedTests(String excludedString) {
+        private TestFilter parseTestList(String excludedString, String includedString) {
             TestFilter filter = new TestFilter();
             if (excludedString != null) {
                 String[] testStrings = excludedString.split(TEST_DELIM);
@@ -89,6 +92,19 @@
                     }
                 }
             }
+            if (includedString != null) {
+                String[] testStrings = includedString.split(TEST_DELIM);
+                for (String testString : testStrings) {
+                    String[] classMethodPair = testString.split(METHOD_DELIM);
+                    if (classMethodPair.length == 2) {
+                        filter.addIncludedTest(new TestIdentifier(classMethodPair[0],
+                                classMethodPair[1]));
+                    } else {
+                        filter.addIncludedClass(testString);
+                    }
+                }
+            }
+
             return filter;
         }
     }
@@ -198,16 +214,27 @@
      */
     private void serializeFilter(KXmlSerializer serializer, TestFilter testFilter)
             throws IOException {
-        if (!testFilter.hasExclusion()) {
-            return;
+        if (testFilter.hasExclusion()) {
+            List<String> exclusionStrings = new ArrayList<String>();
+            exclusionStrings.addAll(testFilter.getExcludedClasses());
+            for (TestIdentifier test : testFilter.getExcludedTests()) {
+                // TODO: this relies on TestIdentifier.toString() using METHOD_DELIM.
+                exclusionStrings.add(test.toString());
+            }
+            String exclusionAttrValue = ArrayUtil.join(TEST_DELIM, exclusionStrings);
+            serializer.attribute(null, EXCLUDE_ATTR, exclusionAttrValue);
         }
-        List<String> exclusionStrings = new ArrayList<String>();
-        exclusionStrings.addAll(testFilter.getExcludedClasses());
-        for (TestIdentifier test : testFilter.getExcludedTests()) {
-            // TODO: this relies on TestIdentifier.toString() using METHOD_DELIM.
-            exclusionStrings.add(test.toString());
+
+        if (testFilter.hasInclusion()) {
+            List<String> inclusionStrings = new ArrayList<String>();
+            inclusionStrings.addAll(testFilter.getIncludedClasses());
+            for (TestIdentifier test : testFilter.getIncludedTests()) {
+                // TODO: this relies on TestIdentifier.toString() using METHOD_DELIM.
+                inclusionStrings.add(test.toString());
+            }
+            String exclusionAttrValue = ArrayUtil.join(TEST_DELIM, inclusionStrings);
+            serializer.attribute(null, INCLUDE_ATTR, exclusionAttrValue);
         }
-        String exclusionAttrValue = ArrayUtil.join(TEST_DELIM, exclusionStrings);
-        serializer.attribute(null, EXCLUDE_ATTR, exclusionAttrValue);
+
     }
 }
diff --git a/tools/tradefed-host/tests/src/com/android/cts/tradefed/result/CtsXmlResultReporterTest.java b/tools/tradefed-host/tests/src/com/android/cts/tradefed/result/CtsXmlResultReporterTest.java
index 9515446..5776568 100644
--- a/tools/tradefed-host/tests/src/com/android/cts/tradefed/result/CtsXmlResultReporterTest.java
+++ b/tools/tradefed-host/tests/src/com/android/cts/tradefed/result/CtsXmlResultReporterTest.java
@@ -15,6 +15,8 @@
  */
 package com.android.cts.tradefed.result;
 
+import static com.android.cts.tradefed.result.CtsXmlResultReporter.CTS_RESULT_FILE_VERSION;
+
 import com.android.ddmlib.testrunner.ITestRunListener.TestFailure;
 import com.android.ddmlib.testrunner.TestIdentifier;
 import com.android.tradefed.build.IFolderBuildInfo;
@@ -84,8 +86,9 @@
     public void testEmptyGeneration() {
         final String expectedHeaderOutput = "<?xml version='1.0' encoding='UTF-8' standalone='no' ?>" +
             "<?xml-stylesheet type=\"text/xsl\" href=\"cts_result.xsl\"?>";
-        final String expectedTestOutput =
-            "<TestResult testPlan=\"NA\" starttime=\"ignore\" endtime=\"ignore\" version=\"1.13\"> ";
+        final String expectedTestOutput = String.format(
+            "<TestResult testPlan=\"NA\" starttime=\"ignore\" endtime=\"ignore\" " +
+                    "version=\"%s\" suite=\"%s\"> ", CTS_RESULT_FILE_VERSION, "CTS" );
         final String expectedSummaryOutput =
             "<Summary failed=\"0\" notExecuted=\"0\" timeout=\"0\" pass=\"0\" />";
         final String expectedEndTag = "</TestResult>";
@@ -93,10 +96,10 @@
         mResultReporter.invocationEnded(1);
         String actualOutput = getOutput();
         assertTrue(actualOutput.startsWith(expectedHeaderOutput));
-        assertTrue(String.format("test output did not contain expected test result. Got %s",
-                actualOutput), actualOutput.contains(expectedTestOutput));
-        assertTrue(String.format("test output did not contain expected test summary. Got %s",
-                actualOutput), actualOutput.contains(expectedSummaryOutput));
+        assertTrue(String.format("test output did not contain expected test result [%s]. Got %s",
+                expectedTestOutput, actualOutput), actualOutput.contains(expectedTestOutput));
+        assertTrue(String.format("test output did not contain expected test summary [%s]. Got %s",
+                expectedTestOutput, actualOutput), actualOutput.contains(expectedSummaryOutput));
         assertTrue(String.format("test output did not contain expected TestResult end tag. Got %s",
                 actualOutput), actualOutput.endsWith(expectedEndTag));
     }
diff --git a/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/TestFilterTest.java b/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/TestFilterTest.java
index 676b912..2f76e1f 100644
--- a/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/TestFilterTest.java
+++ b/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/TestFilterTest.java
@@ -25,7 +25,7 @@
 import java.util.List;
 
 /**
- *
+ * Unit tests for {@link TestFilter}.
  */
 public class TestFilterTest extends TestCase {
 
@@ -87,7 +87,7 @@
     }
 
     /**
-     * Test {@link TestFilter#filter(java.util.Collection)} with at class
+     * Test {@link TestFilter#filter(java.util.Collection)} with a class
      */
     public void testFilter_includeTest() {
         mFilter.setTestInclusion(TEST1.getClassName(), TEST1.getTestName());
@@ -96,4 +96,82 @@
         Iterator<TestIdentifier> iter = filteredList.iterator();
         assertEquals(TEST1, iter.next());
     }
+
+    /**
+     * Test {@link TestFilter#filter(java.util.Collection)} with an included test filter
+     */
+    public void testFilter_includeClasses() {
+        mFilter.addIncludedClass(TEST3.getClassName());
+        Collection<TestIdentifier> filteredList = mFilter.filter(mTestList);
+        assertEquals(1, filteredList.size());
+        assertEquals(TEST3, filteredList.iterator().next());
+    }
+
+    /**
+     * Test {@link TestFilter#filter(java.util.Collection)} with an included test filter
+     */
+    public void testFilter_includeTests() {
+        mFilter.addIncludedTest(TEST1);
+        mFilter.addIncludedTest(TEST3);
+        Collection<TestIdentifier> filteredList = mFilter.filter(mTestList);
+        assertEquals(2, filteredList.size());
+        Iterator<TestIdentifier> iter = filteredList.iterator();
+        assertEquals(TEST1, iter.next());
+        assertEquals(TEST3, iter.next());
+    }
+
+    /**
+     * Test {@link TestFilter#filter(java.util.Collection)}. Exclusion overrides
+     * inclusion.
+     */
+    public void testFilter_includeAndExcludeClasses() {
+        String className = TEST3.getClassName();
+        mFilter.addExcludedClass(className);
+        mFilter.addIncludedClass(className);
+        assertTrue(mFilter.filter(mTestList).isEmpty());
+    }
+
+    /**
+     * Test {@link TestFilter#filter(java.util.Collection)} Exclusion overrides
+     * inclusion.
+     */
+    public void testFilter_includeAndExcludeTests() {
+        mFilter.addExcludedTest(TEST1);
+        mFilter.addIncludedTest(TEST1);
+        assertTrue(mFilter.filter(mTestList).isEmpty());
+    }
+
+    /**
+     * Test {@link TestFilter#filter(java.util.Collection)} Exclusion overrides
+     * inclusion.
+     */
+    public void testFilter_includeTestAndExcludeClass() {
+        mFilter.addExcludedClass(TEST1.getClassName());
+        mFilter.addIncludedTest(TEST1);
+        assertTrue(mFilter.filter(mTestList).isEmpty());
+    }
+
+    /**
+     * Test {@link TestFilter#filter(java.util.Collection)} Exclusion overrides
+     * inclusion.
+     */
+    public void testFilter_includeClassAndExcludeTest() {
+        mFilter.addExcludedTest(TEST1);
+        mFilter.addIncludedClass(TEST1.getClassName());
+        Collection<TestIdentifier> filteredList = mFilter.filter(mTestList);
+        assertEquals(1, filteredList.size());
+        Iterator<TestIdentifier> iter = filteredList.iterator();
+        assertEquals(TEST2, iter.next());
+    }
+
+    /**
+     * Test {@link TestFilter#filter(java.util.Collection)} Exclusion overrides
+     * inclusion.
+     */
+    public void testFilter_includeClassAndExcludeTests() {
+        mFilter.addExcludedTest(TEST1);
+        mFilter.addExcludedTest(TEST2);
+        mFilter.addIncludedClass(TEST1.getClassName());
+        assertTrue(mFilter.filter(mTestList).isEmpty());
+    }
 }
diff --git a/tools/utils/buildCts.py b/tools/utils/buildCts.py
index cb70c54..8e4ae49 100755
--- a/tools/utils/buildCts.py
+++ b/tools/utils/buildCts.py
@@ -72,8 +72,6 @@
 
     self.test_repository = os.path.join(self.out_dir, 'repository/testcases')
     self.plan_repository = os.path.join(self.out_dir, 'repository/plans')
-    
-    #dirty hack to copy over prepopulated CTS test plans, stable vs flaky, for autoCTS
     self.definedplans_repository = os.path.join(self.android_root, 'cts/tests/plans')
 
   def GenerateTestDescriptions(self):
@@ -160,14 +158,111 @@
     plan.Include('android\.telephony')
     plan.Include('android\.nativemedia.*')
     plan.Include('com\.android\.cts\..*')#TODO(stuartscott): Should PDK have all these?
-    #TODO(stuartscott): Maybe move away from com.android.* to android.* - less typing
     self.__WritePlan(plan, 'PDK')
 
-    #dirty hack to copy over pre-populated CTS plans - flaky vs stable - to streamline autoCTS
-    shutil.copyfile(os.path.join(self.definedplans_repository, 'CTS-flaky.xml'),
-        os.path.join(self.plan_repository, 'CTS-flaky.xml'))
-    shutil.copyfile(os.path.join(self.definedplans_repository, 'CTS-stable.xml'),
-        os.path.join(self.plan_repository, 'CTS-stable.xml'))
+    flaky_tests = BuildCtsFlakyTestList()
+
+    # CTS Stable plan
+    plan = tools.TestPlan(packages)
+    plan.Exclude(r'android\.display')
+    for package, test_list in flaky_tests.iteritems():
+      plan.ExcludeTests(package, test_list)
+    self.__WritePlan(plan, 'CTS-stable')
+
+    # CTS Flaky plan - inversion of CTS Stable
+    plan = tools.TestPlan(packages)
+    plan.Exclude('.*')
+    plan.Include(r'android\.display')
+    for package, test_list in flaky_tests.iteritems():
+      plan.Include(package)
+      plan.IncludeTests(package, test_list)
+    self.__WritePlan(plan, 'CTS-flaky')
+
+
+def BuildCtsFlakyTestList():
+  """ Construct a defaultdict that maps package name to a list of tests
+      that are known to be flaky. """
+  return {
+      'android.app' : [
+          'cts.ActivityManagerTest#testIsRunningInTestHarness',
+          'cts.AlertDialogTest#testAlertDialogCancelable',
+          'cts.ExpandableListActivityTest#testCallback',],
+      'android.hardware' : [
+          'cts.SensorIntegrationTests#testAccelerometerDoesNotStopGyroscope',
+          'cts.SensorIntegrationTests#testsAccelerometerDoesnNotStopMagnetometer',
+          'cts.SensorIntegrationTests#testAndroidTestCaseSetupProperly',
+          'cts.SensorIntegrationTests#testBatchAndFlush',
+          'cts.SensorIntegrationTests#testGyroscopeDoesNotStopAccelerometer',
+          'cts.SensorIntegrationTests#testGyroscopeDoesNotStopMagnetometer',
+          'cts.SensorIntegrationTests#testMagnetometerDoesNotStopAccelerometer',
+          'cts.SensorIntegrationTests#testMagnetometerDoesNotStopGyroscope',
+          'cts.SensorMagneticFieldTest#testBatchingStoppingOtherClients',
+          'cts.SensorMagneticFieldTest#testBatchingStoppingOtherClientsBatching',
+          'cts.SensorMagneticFieldTest#testFrequencyAccuracy',
+          'cts.SensorMagneticFieldTest#testOneClientSeveralThreads',
+          'cts.SensorMagneticFieldTest#testOneClientSeveralThreadsBatching',
+          'cts.SensorMagneticFieldTest#testStandardDeviationWhileStatic',
+          'cts.SensorMagneticFieldTest#testStoppingOtherClients',
+          'cts.SensorMagneticFieldTest#testStoppingOtherClientsBatching',
+          'cts.SensorAccelerometerTest#testBatchingStoppingOtherClients',
+          'cts.SensorAccelerometerTest#testBatchingStoppingOtherClientsBatching',
+          'cts.SensorAccelerometerTest#testFrequencyAccuracy',
+          'cts.SensorAccelerometerTest#testOneClientSeveralThreads',
+          'cts.SensorAccelerometerTest#testOneClientSeveralThreadsBatching',
+          'cts.SensorGyroscopeTest#testBatchingStoppingOtherClients',
+          'cts.SensorGyroscopeTest#testBatchingStoppingOtherClientsBatching',
+          'cts.SensorGyroscopeTest#testFrequencyAccuracy',
+          'cts.SensorGyroscopeTest#testOneClientSeveralThreads',
+          'cts.SensorGyroscopeTest#testOneClientSeveralThreadsBatching',
+          'cts.SensorGyroscopeTest#testStandardDeviationWhilStatic',
+          'cts.SensorGyroscopeTest#testStoppingOtherClients',
+          'cts.SensorGyroscopeTest#testStoppingOtherClientsBatching',
+          'cts.SensorAccelerometerTest#testStandardDeviationWhileStatic',
+          'cts.SensorAccelerometerTest#testStoppingOtherClients',
+          'cts.SensorAccelerometerTest#testStoppingOtherClientsBatching',
+          'camera2.cts.CameraDeviceTest#testCameraDeviceRepeatingRequest',
+          'camera2.cts.ImageReaderTest#testImageReaderFromCameraJpeg',
+          'cts.CameraGLTest#testCameraToSurfaceTextureMetadata',
+          'cts.CameraTest#testImmediateZoom',
+          'cts.CameraTest#testPreviewCallback',
+          'cts.CameraTest#testSmoothZoom',
+          'cts.CameraTest#testVideoSnapshot',
+          'cts.CameraGLTest#testSetPreviewTextureBothCallbacks',
+          'cts.CameraGLTest#testSetPreviewTexturePreviewCallback',
+          'cts.CameraGLTest#testSetPreviewTexturePreviewCallback',],
+      'android.media' : [
+          'cts.DecoderTest#testCodecResetsH264WithSurface',
+          'cts.StreamingMediaPlayerTest#testHLS',],
+      'android.mediastress' : [
+          'cts.NativeMediaTest#test480pPlay',],
+      'android.net' : [
+          'cts.ConnectivityManagerTest#testStartUsingNetworkFeature_enableHipri',
+          'wifi.cts.ScanResultTest#testScanResultTimeStamp',
+          'cts.DnsTest#testDnsWorks',
+          'cts.TrafficStatsTest#testTrafficStatsForLocalhost',
+          'wifi.cts.ScanResultTest#testAndroidTestCaseSetupProperly',
+          'wifi.cts.NsdManagerTest#testAndroidTestCaseSetupProperly',
+          'cts.SSLCertificateSocketFactoryTest#testCreateSocket',
+          'cts.SSLCertificateSocketFactoryTest#test_createSocket_bind',
+          'cts.SSLCertificateSocketFactoryTest#test_createSocket_simple',
+          'cts.SSLCertificateSocketFactoryTest#test_createSocket_wrapping',],
+      'android.security' : [
+          'cts.BannedFilesTest#testNoSu',
+          'cts.BannedFilesTest#testNoSuInPath',
+          'cts.ListeningPortsTest#testNoRemotelyAccessibleListeningUdp6Ports',
+          'cts.ListeningPortsTest#testNoRemotelyAccessibleListeningUdpPorts',
+          'cts.PackageSignatureTest#testPackageSignatures',],
+      'android.webkit' : [
+          'cts.WebViewClientTest#testDoUpdateVisitedHistory',
+          'cts.WebViewClientTest#testLoadPage',
+          'cts.WebViewClientTest#testOnFormResubmission',
+          'cts.WebViewClientTest#testOnReceivedError',
+          'cts.WebViewClientTest#testOnReceivedHttpAuthRequest',
+          'cts.WebViewClientTest#testOnScaleChanged',
+          'cts.WebViewClientTest#testOnUnhandledKeyEvent',
+          'cts.WebViewTest#testSetInitialScale',],
+      'android.widget' : [
+          'cts.GridViewTest#testSetNumColumns',],}
 
 def LogGenerateDescription(name):
   print 'Generating test description for package %s' % name
diff --git a/tools/utils/cts/tools.py b/tools/utils/cts/tools.py
index 6cd1b95..0a4c97c 100644
--- a/tools/utils/cts/tools.py
+++ b/tools/utils/cts/tools.py
@@ -120,6 +120,45 @@
     self.all_packages = all_packages
     self.map = None
 
+    self.includedTestsMap = {}
+    self.excludedTestsMap = {}
+
+
+  def IncludeTests(self, package, test_list):
+    """Include only specific tests in this plan.
+
+    package The package that contains the tests. e.g. android.mypackage
+      This package should must be included via Include.
+    test_list A list of tests with methods to be included. e.g.
+      ['TestClass#testA', 'TestClass#testB']
+    """
+    packaged_test_list = []
+    for test in test_list:
+      packaged_test_list.append(package + '.' + test)
+
+    if package in self.includedTestsMap:
+      self.includedTestsMap[package] += packaged_test_list
+    else:
+      self.includedTestsMap[package] = packaged_test_list
+
+
+  def ExcludeTests(self, package, test_list):
+    """Exclude specific tests from this plan.
+
+    package The package that contains the tests. e.g. android.mypackage
+      This package should must be included via Include.
+    test_list A list of tests with methods to be excluded. e.g.
+      ['TestClass#testA', 'TestClass#textB']
+    """
+    packaged_test_list = []
+    for test in test_list:
+      packaged_test_list.append(package + '.' + test)
+    if package in self.excludedTestsMap:
+      self.excludedTestsMap[package] += packaged_test_list
+    else:
+      self.excludedTestsMap[package] = packaged_test_list
+
+
   def Exclude(self, pattern):
     """Exclude all packages matching the given regular expression from the plan.
 
@@ -167,6 +206,10 @@
       if self.map[package]:
         entry = doc.createElement('Entry')
         entry.setAttribute('uri', package)
+        if package in self.excludedTestsMap:
+          entry.setAttribute('exclude', ';'.join(self.excludedTestsMap[package]))
+        if package in self.includedTestsMap:
+          entry.setAttribute('include', ';'.join(self.includedTestsMap[package]))
         plan.appendChild(entry)
     stream = open(file_name, 'w')
     doc.writexml(stream, addindent='  ', newl='\n', encoding='UTF-8')