Merge "Fix android.webkit.GeolocationTest for molly." into lmp-dev
diff --git a/CtsBuild.mk b/CtsBuild.mk
index 4521b7e..86ecde8 100644
--- a/CtsBuild.mk
+++ b/CtsBuild.mk
@@ -33,6 +33,9 @@
 # File indicating which tests should be blacklisted due to unsupported abi.
 CTS_UNSUPPORTED_ABIS := cts/tests/expectations/unsupportedabis.txt
 
+# Holds the target architecture to build for.
+CTS_TARGET_ARCH := $(TARGET_ARCH)
+
 # Functions to get the paths of the build outputs.
 
 define cts-get-lib-paths
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index a3ca867..a08c34f 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -31,6 +31,7 @@
 
 cts_support_packages := \
     CtsAccelerationTestStubs \
+    CtsAppTestStubs \
     CtsDeviceAdmin \
     CtsDeviceOpenGl \
     CtsDeviceTaskswitchingAppA \
@@ -41,7 +42,6 @@
     CtsMonkeyApp2 \
     CtsProfileOwnerApp \
     CtsSomeAccessibilityServices \
-    CtsTestStubs \
     CtsThemeDeviceApp \
     SignatureTest \
     TestDeviceSetup \
diff --git a/apps/CtsVerifier/Android.mk b/apps/CtsVerifier/Android.mk
index bcfaf44..88386ec 100644
--- a/apps/CtsVerifier/Android.mk
+++ b/apps/CtsVerifier/Android.mk
@@ -36,8 +36,6 @@
 
 LOCAL_DEX_PREOPT := false
 
-LOCAL_INSTRUMENTATION_FOR := CtsTestStubs
-
 include $(BUILD_PACKAGE)
 
 # Builds and launches CTS Verifier on a device.
diff --git a/apps/CtsVerifier/AndroidManifest.xml b/apps/CtsVerifier/AndroidManifest.xml
index c655594..95fe006 100644
--- a/apps/CtsVerifier/AndroidManifest.xml
+++ b/apps/CtsVerifier/AndroidManifest.xml
@@ -47,6 +47,8 @@
     <uses-feature android:name="android.hardware.usb.accessory" />
     <uses-permission android:name="android.permission.CALL_PHONE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.READ_CONTACTS"/>
+    <uses-permission android:name="android.permission.WRITE_CONTACTS"/>
 
     <!-- Needed by the Audio Quality Verifier to store the sound samples that will be mailed. -->
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -550,6 +552,14 @@
                 android:label="@string/nfc_hce_conflicting_non_payment_emulator"
                 android:configChanges="keyboardHidden|orientation|screenSize" />
 
+        <activity android:name=".nfc.hce.ForegroundNonPaymentEmulatorActivity"
+                android:label="@string/nfc_hce_foreground_non_payment_emulator"
+                android:configChanges="keyboardHidden|orientation|screenSize" />
+
+        <activity android:name=".nfc.hce.ForegroundPaymentEmulatorActivity"
+                android:label="@string/nfc_hce_foreground_payment_emulator"
+                android:configChanges="keyboardHidden|orientation|screenSize" />
+
         <activity android:name=".nfc.hce.OffHostEmulatorActivity"
                 android:label="@string/nfc_hce_offhost_service_emulator"
                 android:configChanges="keyboardHidden|orientation|screenSize" />
@@ -566,6 +576,26 @@
                 android:label="@string/nfc_hce_tap_test_emulator"
                 android:configChanges="keyboardHidden|orientation|screenSize" />
 
+        <activity android:name=".nfc.hce.DynamicAidEmulatorActivity"
+                android:label="@string/nfc_hce_payment_dynamic_aids_emulator"
+                android:configChanges="keyboardHidden|orientation|screenSize" />
+
+        <activity android:name=".nfc.hce.PrefixPaymentEmulatorActivity"
+                android:label="@string/nfc_hce_payment_prefix_aids_emulator"
+                android:configChanges="keyboardHidden|orientation|screenSize" />
+
+        <activity android:name=".nfc.hce.PrefixPaymentEmulator2Activity"
+                android:label="@string/nfc_hce_payment_prefix_aids_emulator_2"
+                android:configChanges="keyboardHidden|orientation|screenSize" />
+
+        <activity android:name=".nfc.hce.DualNonPaymentPrefixEmulatorActivity"
+                android:label="@string/nfc_hce_other_prefix_aids_emulator"
+                android:configChanges="keyboardHidden|orientation|screenSize" />
+
+        <activity android:name=".nfc.hce.ConflictingNonPaymentPrefixEmulatorActivity"
+                android:label="@string/nfc_hce_other_conflicting_prefix_aids_emulator"
+                android:configChanges="keyboardHidden|orientation|screenSize" />
+
         <!-- services used for testing NFC host-based card emulation -->
         <service android:name=".nfc.hce.PaymentService1" android:exported="true"
                  android:permission="android.permission.BIND_NFC_SERVICE"
@@ -631,15 +661,83 @@
             </intent-filter>
             <meta-data android:name="android.nfc.cardemulation.off_host_apdu_service" android:resource="@xml/offhost_aid_list"/>
         </service>
+        <service android:name=".nfc.hce.PaymentServiceDynamicAids" android:exported="true"
+                 android:permission="android.permission.BIND_NFC_SERVICE"
+                 android:enabled="false">
+            <intent-filter>
+                <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE"/>
+                <category android:name="android.intent.category.DEFAULT"/>
+            </intent-filter>
+            <meta-data android:name="android.nfc.cardemulation.host_apdu_service" android:resource="@xml/payment_aid_list_1"/>
+        </service>
+        <service android:name=".nfc.hce.PrefixPaymentService1" android:exported="true"
+                 android:permission="android.permission.BIND_NFC_SERVICE"
+                 android:enabled="false">
+            <intent-filter>
+                <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE"/>
+                <category android:name="android.intent.category.DEFAULT"/>
+            </intent-filter>
+            <meta-data android:name="android.nfc.cardemulation.host_apdu_service" android:resource="@xml/payment_prefix_aid_list"/>
+        </service>
+        <service android:name=".nfc.hce.PrefixPaymentService2" android:exported="true"
+                 android:permission="android.permission.BIND_NFC_SERVICE"
+                 android:enabled="false">
+            <intent-filter>
+                <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE"/>
+                <category android:name="android.intent.category.DEFAULT"/>
+            </intent-filter>
+            <meta-data android:name="android.nfc.cardemulation.host_apdu_service" android:resource="@xml/payment_prefix_aid_list_2"/>
+        </service>
+        <service android:name=".nfc.hce.PrefixTransportService1" android:exported="true"
+                 android:permission="android.permission.BIND_NFC_SERVICE"
+                 android:enabled="false">
+            <intent-filter>
+                <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE"/>
+                <category android:name="android.intent.category.DEFAULT"/>
+            </intent-filter>
+            <meta-data android:name="android.nfc.cardemulation.host_apdu_service" android:resource="@xml/transport_prefix_aid_list_1"/>
+        </service>
+        <service android:name=".nfc.hce.PrefixTransportService2" android:exported="true"
+                 android:permission="android.permission.BIND_NFC_SERVICE"
+                 android:enabled="false">
+            <intent-filter>
+                <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE"/>
+                <category android:name="android.intent.category.DEFAULT"/>
+            </intent-filter>
+            <meta-data android:name="android.nfc.cardemulation.host_apdu_service" android:resource="@xml/transport_prefix_aid_list_2"/>
+        </service>
+        <service android:name=".nfc.hce.PrefixAccessService" android:exported="true"
+                 android:permission="android.permission.BIND_NFC_SERVICE"
+                 android:enabled="false">
+            <intent-filter>
+                <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE"/>
+                <category android:name="android.intent.category.DEFAULT"/>
+            </intent-filter>
+            <meta-data android:name="android.nfc.cardemulation.host_apdu_service" android:resource="@xml/access_prefix_aid_list"/>
+        </service>
 
-        <activity android:name=".sensors.AccelerometerTestActivity" android:label="@string/snsr_accel_test"
+        <!--
+            A DeviceAdmin receiver for sensor tests, it allows sensor tests to turn off the screen.
+        -->
+        <receiver android:name=".sensors.helpers.SensorDeviceAdminReceiver"
+                android:label="@string/snsr_device_admin_receiver">
+            <meta-data android:name="android.app.device_admin"
+                       android:resource="@xml/sensor_device_admin" />
+            <intent-filter>
+                <action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
+            </intent-filter>
+        </receiver>
+
+        <activity android:name=".sensors.AccelerometerTestActivity"
+                  android:label="@string/snsr_accel_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.accelerometer" />
+            <meta-data android:name="test_required_features"
+                       android:value="android.hardware.sensor.accelerometer" />
         </activity>
 
         <activity android:name=".sensors.AccelerometerMeasurementTestActivity"
@@ -661,7 +759,8 @@
                 <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.gyroscope" />
+            <meta-data android:name="test_required_features"
+                       android:value="android.hardware.sensor.gyroscope" />
         </activity>
 
         <activity android:name=".sensors.GyroscopeMeasurementTestActivity"
@@ -942,7 +1041,7 @@
             <meta-data android:name="test_required_features" android:value="android.hardware.wifi.direct" />
         </activity>
 
-        <activity android:name=".nls.NotificationListenerVerifierActivity"
+        <activity android:name=".notifications.NotificationListenerVerifierActivity"
                 android:label="@string/nls_test">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -951,7 +1050,16 @@
             <meta-data android:name="test_category" android:value="@string/test_category_notifications" />
         </activity>
 
-        <service android:name=".nls.MockListener"
+        <activity android:name=".notifications.NotificationAttentionManagementVerifierActivity"
+                android:label="@string/attention_test">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.cts.intent.category.MANUAL_TEST" />
+            </intent-filter>
+            <meta-data android:name="test_category" android:value="@string/test_category_notifications" />
+        </activity>
+
+        <service android:name=".notifications.MockListener"
                  android:exported="true"
                  android:label="@string/nls_service_name"
                  android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
@@ -960,7 +1068,7 @@
             </intent-filter>
         </service>
 
-        <service  android:name=".nls.NotificationListenerVerifierActivity$DismissService"/>
+        <service  android:name=".notifications.NotificationListenerVerifierActivity$DismissService"/>
         <activity android:name=".security.CAInstallNotificationVerifierActivity"
                 android:label="@string/cacert_test">
             <intent-filter>
diff --git a/apps/CtsVerifier/assets/scripts/execute_power_tests.py b/apps/CtsVerifier/assets/scripts/execute_power_tests.py
index 68e13db..e1b11c2 100755
--- a/apps/CtsVerifier/assets/scripts/execute_power_tests.py
+++ b/apps/CtsVerifier/assets/scripts/execute_power_tests.py
@@ -30,10 +30,10 @@
 signal_exit_q = Queue.Queue()
 signal_abort = Queue.Queue()
 
-# let this script know about the power monitor impementations
+# let this script know about the power monitor implementations
 sys.path = [os.path.basename(__file__)] + sys.path
-available_monitors = [name for _, name, _ in pkgutil.iter_modules([os.path.join(os.path.dirname(__file__),'power_monitors')])
-                      if not name.startswith('_')]
+available_monitors = [name for _, name, _ in pkgutil.iter_modules(
+    [os.path.join(os.path.dirname(__file__),'power_monitors')]) if not name.startswith('_')]
 
 APK = os.path.join( os.path.dirname(__file__), '..', "CtsVerifier.apk")
 
@@ -77,18 +77,28 @@
     SAMPLE_COUNT_NOMINAL = 1000
     RATE_NOMINAL = 100
 
-    QUERY_EXTERNAL_STORAGE = "EXTERNAL STORAGE?"
-    
+    REQUEST_EXTERNAL_STORAGE = "EXTERNAL STORAGE?"
+    REQUEST_EXIT = "EXIT"
+    REQUEST_RAISE = "RAISE %s %s"
+    REQUEST_USER_RESPONSE = "USER RESPONSE %s"
+    REQUEST_SET_TEST_RESULT = "SET TEST RESULT %s %s %s"
+    REQUEST_SENSOR_SWITCH = "SENSOR %s %s"
+    REQUEST_SENSOR_AVAILABILITY = "SENSOR? %s"
+    REQUEST_SCREEN_OFF = "SCREEN OFF"
+    REQUEST_SHOW_MESSAGE = "MESSAGE %s"
+
+
     def __init__(self):
         power_monitors = do_import("power_monitors.%s" % FLAGS.power_monitor)
         testid = time.strftime("%d_%m_%Y__%H__%M_%S")
         self._power_monitor = power_monitors.Power_Monitor(log_file_id = testid)
         print ("Establishing connection to device...")
-        self.setUSBEnabled(True)
+        self.setUsbEnabled(True)
         status = self._power_monitor.GetStatus()
         self._native_hz = status["sampleRate"] * 1000
         self._current_test = "None"
-        self._external_storage = self.executeOnDevice(PowerTest.QUERY_EXTERNAL_STORAGE, reportErrors=True )
+        self._external_storage = self.executeOnDevice(PowerTest.REQUEST_EXTERNAL_STORAGE,
+                                                      reportErrors=True)
 
     def __del__(self):
         self.finalize()
@@ -97,7 +107,7 @@
         """To be called upon termination of host connection to device"""
         if PowerTest.PORT > 0:
             # tell device side to exit connection loop, and remove the forwarding connection
-            self.executeOnDevice("EXIT", reportErrors=False)
+            self.executeOnDevice(PowerTest.REQUEST_EXIT, reportErrors=False)
             self.executeLocal("adb forward --remove tcp:%d" % PowerTest.PORT)
         PowerTest.PORT = 0
         if self._power_monitor:
@@ -105,18 +115,19 @@
             self._power_monitor = None
 
     def _send(self, msg, report_errors=True):
-        """Connect to the device, send the given commmand, and then disconnect"""
+        """Connect to the device, send the given command, and then disconnect"""
         if PowerTest.PORT == 0:
             # on first attempt to send a command, connect to device via any open port number,
             # forwarding that port to a local socket on the device via adb
             logging.debug("Seeking port for communication...")
-            # discover an open port        
+            # discover an open port
             dummysocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
             dummysocket.bind(("localhost", 0))
             (_, PowerTest.PORT) = dummysocket.getsockname()
             dummysocket.close()
             assert(PowerTest.PORT > 0)
-            status = self.executeLocal("adb forward tcp:%d localabstract:%s" % (PowerTest.PORT, PowerTest.DOMAIN_NAME))
+            status = self.executeLocal("adb forward tcp:%d localabstract:%s" %
+                    (PowerTest.PORT, PowerTest.DOMAIN_NAME))
             if report_errors:
                 self.reportErrorIf(status != 0, msg="Unable to forward requests to client over adb")
             logging.info("Forwarding requests over local port %d" % PowerTest.PORT)
@@ -139,11 +150,11 @@
         return response
 
     def queryDevice(self, query):
-        """Post a yes/no query to the device, return True upon successful query,
-        False otherwise"""
+        """Post a yes/no query to the device, return True upon successful query, False otherwise"""
         logging.info("Querying device with '%s'" % query)
         return self._send(query) == "OK"
 
+    # TODO: abstract device communication (and string commands) into its own class
     def executeOnDevice(self, cmd , reportErrors=True):
         """Execute a (string) command on the remote device"""
         return self._send(cmd , reportErrors)
@@ -164,7 +175,7 @@
         if condition:
             try:
                 logging.error("Exiting on error: %s" % msg)
-                self.executeOnDevice("RAISE " + self._current_test + " " + msg , False)
+                self.executeOnDevice(PowerTest.REQUEST_RAISE % (self._current_test, msg), False)
             except:
 
                 logging.error("Unable to communicate with device to report error: %s" % msg)
@@ -172,7 +183,7 @@
                 sys.exit(msg)
             raise Exception(msg)
 
-    def setUSBEnabled(self, enabled, verbose=True):
+    def setUsbEnabled(self, enabled, verbose=True):
         if enabled:
             val = 1
         else:
@@ -180,7 +191,7 @@
         self._power_monitor.SetUsbPassthrough(val)
         tries = 0
 
-        # Sometimes command won't go through first time, paricularly if immediately after a data
+        # Sometimes command won't go through first time, particularly if immediately after a data
         # collection, so allow for retries
         status = self._power_monitor.GetStatus()
         while status is None and tries < 5:
@@ -199,7 +210,8 @@
             if verbose: logging.info("...USB disabled")
         # re-establish port forwarding
         if enabled and PowerTest.PORT > 0:
-            status = self.executeLocal("adb forward tcp:%d localabstract:%s" % (PowerTest.PORT, PowerTest.DOMAIN_NAME))
+            status = self.executeLocal("adb forward tcp:%d localabstract:%s" %
+                                       (PowerTest.PORT, PowerTest.DOMAIN_NAME))
             self.reportErrorIf(status != 0, msg="Unable to forward requests to client over adb")
 
     def waitForScreenOff(self):
@@ -211,13 +223,13 @@
 
         # need at least 100 sequential clean low-power measurements to know screen is off
         THRESHOLD_COUNT_LOW_POWER = 100
-        CURRENT_LOW_POWER_THRESHOLD = 0.060  # mAmps
-        TIMEOUT_SCREEN_OFF = 30 #this many tries at most
+        CURRENT_LOW_POWER_THRESHOLD = 0.060  # Amps
+        TIMEOUT_SCREEN_OFF = 30 # this many tries at most
         count_good = 0
         tries = 0
         print("Waiting for screen off and application processor in suspend mode...")
         while count_good < THRESHOLD_COUNT_LOW_POWER:
-            measurements = self.collectMeasurements( THRESHOLD_COUNT_LOW_POWER,
+            measurements = self.collectMeasurements(THRESHOLD_COUNT_LOW_POWER,
                                                       PowerTest.RATE_NOMINAL,
                                                       ensure_screen_off=False,
                                                       verbose=False)
@@ -225,20 +237,19 @@
                                if m < CURRENT_LOW_POWER_THRESHOLD])
             tries += 1
             if count_good < THRESHOLD_COUNT_LOW_POWER and measurements:
-                print("This current high: %.2f mAmps. Device is probably not in suspend mode.  Waiting..."%\
+                print("Current usage: %.2f mAmps. Device is probably not in suspend mode.   Waiting..." %
                       (1000.0*(sum(measurements)/len(measurements))))
             if tries >= TIMEOUT_SCREEN_OFF:
                 # TODO: dump the state of sensor service to identify if there are features using sensors
-                self.reportErrorIf(tries>=TIMEOUT_SCREEN_OFF, msg="Unable to determine application processor suspend mode status.")
+                self.reportErrorIf(tries>=TIMEOUT_SCREEN_OFF,
+                    msg="Unable to determine application processor suspend mode status.")
                 break
         if DELAY_SCREEN_OFF:
             # add additional delay time if necessary
             time.sleep(DELAY_SCREEN_OFF)
         print("...Screen off and device in suspend mode.")
- 
-    def collectMeasurements(self, measurementCount, rate ,
-                             ensure_screen_off=True,
-                             verbose=True,
+
+    def collectMeasurements(self, measurementCount, rate , ensure_screen_off=True, verbose=True,
                              plot_data = False):
         assert(measurementCount > 0)
         decimate_by = self._native_hz / rate  or 1
@@ -253,11 +264,10 @@
         try:
             while len(measurements) < measurementCount and tries < 5:
                 if tries:
-                    #logging.error("Failed attempt %d" % tries)
                     self._power_monitor.StopDataCollection()
                     self._power_monitor.StartDataCollection()
                     time.sleep(1.0)
-                tries += 1 
+                tries += 1
                 additional = self._power_monitor.CollectData()
                 if additional is not None:
                     tries = 0
@@ -278,7 +288,7 @@
 
     def request_user_acknowledgment(self, msg):
         """Post message to user on screen and wait for acknowledgment"""
-        response = self.executeOnDevice("REQUEST USER RESPONSE " + msg)
+        response = self.executeOnDevice(PowerTest.REQUEST_USER_RESPONSE % msg)
         self.reportErrorIf(response != "OK", "Unable to request user acknowledgment")
 
     def setTestResult (self, testname, condition, msg):
@@ -289,19 +299,21 @@
         else:
             val = condition
         print ("Test %s : %s" % (testname, val))
-        response = self.executeOnDevice("SET TEST RESULT %s %s %s" % (testname, val, msg))
+        response = self.executeOnDevice(PowerTest.REQUEST_SET_TEST_RESULT % (testname, val, msg))
         self.reportErrorIf(response != "OK", "Unable to send test status to Verifier")
 
     def setPowerOn(self, sensor, powered_on):
-        response = self.executeOnDevice("SENSOR %s %s" % ({True:"ON", False:"OFF"}[powered_on], sensor))
-        self.reportErrorIf(response == "ERR", "Unable to set sensor %s state"%sensor)
+        response = self.executeOnDevice(PowerTest.REQUEST_SENSOR_SWITCH %
+                                        ({True:"ON", False:"OFF"}[powered_on], sensor))
+        self.reportErrorIf(response == "ERR", "Unable to set sensor %s state" % sensor)
         logging.info("Set %s %s" % (sensor, {True:"ON", False:"OFF"}[powered_on]))
         return response
 
     def runPowerTest(self, sensor, max_power_allowed, user_request = None):
         if not signal_abort.empty():
             sys.exit( signal_abort.get() )
-        self._current_test = "%s_Power_Test_While_%s" % (sensor, {True:"Under_Motion", False:"Still"}[user_request is not None])
+        self._current_test = "%s_Power_Test_While_%s" % (sensor,
+                                    {True:"Under_Motion", False:"Still"}[user_request is not None])
         try:
             print ("\n\n---------------------------------")
             if user_request is not None:
@@ -309,9 +321,10 @@
             else:
                 print ("Running power test on %s while device is still." % sensor)
             print ("---------------------------------")
-            response = self.executeOnDevice("SENSOR? %s"%sensor)
+            response = self.executeOnDevice(PowerTest.REQUEST_SENSOR_AVAILABILITY % sensor)
             if response == "UNAVAILABLE":
-                self.setTestResult(self._current_test, condition="SKIPPED", msg="Sensor %s not available on this platform"%sensor)
+                self.setTestResult(self._current_test, condition="SKIPPED",
+                    msg="Sensor %s not available on this platform"%sensor)
             self.setPowerOn("ALL", False)
             if response == "UNAVAILABLE":
                 self.setTestResult(self._current_test, condition="SKIPPED",
@@ -321,8 +334,8 @@
             self.reportErrorIf(response != "OK", "Unable to set all sensor off")
             if not signal_abort.empty():
                 sys.exit( signal_abort.get() )
-            self.executeOnDevice("MESSAGE: \nPlease turn screen off or wait for screen to turn off. Do not interact with the device until screen is turned on again.") 
-            self.setUSBEnabled(False)
+            self.executeOnDevice(PowerTest.REQUEST_SCREEN_OFF)
+            self.setUsbEnabled(False)
             print("Collecting background measurements...")
             measurements = self.collectMeasurements( PowerTest.SAMPLE_COUNT_NOMINAL,
                                                      PowerTest.RATE_NOMINAL,
@@ -334,17 +347,16 @@
                         f.write( "%.4f\n"%m)
             self.reportErrorIf(not measurements, "No background measurements could be taken")
             backgnd = sum(measurements) / len(measurements)
-            self.setUSBEnabled( True )
-            self.setPowerOn( sensor, True )
+            self.setUsbEnabled(True)
+            self.setPowerOn(sensor, True)
             if user_request is not None:
                 print("===========================================\n" +
                       "==> Please follow the instructions presented on the device\n" +
                       "==========================================="
                      )
                 self.request_user_acknowledgment(user_request)
-            else:
-                self.executeOnDevice("MESSAGE: Turn screen off or wait for screen to turn off and do not interact with the device until screen is turned on again.") 
-            self.setUSBEnabled(False)
+            self.executeOnDevice(PowerTest.REQUEST_SCREEN_OFF)
+            self.setUsbEnabled(False)
             self.reportErrorIf(response != "OK", "Unable to set sensor %s ON" % sensor)
             print ("Collecting sensor %s measurements" % sensor)
             measurements = self.collectMeasurements(PowerTest.SAMPLE_COUNT_NOMINAL,
@@ -355,11 +367,13 @@
                    {True:"Under_Motion", False:"Still"}[user_request is not None] ),'w') as f:
                     for m in measurements:
                         f.write( "%.4f\n"%m)
-                    self.setUSBEnabled(True, verbose = False)
+                    self.setUsbEnabled(True, verbose = False)
                     print("Saving raw data files to device...")
-                    self.executeLocal("adb shell mkdir -p %s/ctsVerifierData/sensor_power_test_data"%self._external_storage, False)
-                    self.executeLocal("adb push %s %s/ctsVerifierData/sensor_power_test_data/."%(f.name, self._external_storage))
-                    self.setUSBEnabled(False, verbose = False)
+                    self.executeLocal("adb shell mkdir -p %s/ctsVerifierData/sensor_power_test_data"
+                                      % self._external_storage, False)
+                    self.executeLocal("adb push %s %s/ctsVerifierData/sensor_power_test_data/." %
+                                      (f.name, self._external_storage))
+                    self.setUsbEnabled(False, verbose = False)
             self.reportErrorIf(not measurements, "No measurements could be taken for %s" % sensor)
             avg = sum(measurements) / len(measurements)
             squared = [(m-avg)*(m-avg) for m in measurements]
@@ -367,7 +381,7 @@
             import math
             stddev = math.sqrt(sum(squared)/len(squared))
             current_diff = avg - backgnd
-            self.setUSBEnabled(True)
+            self.setUsbEnabled(True)
             max_power = max(measurements) - avg
             if current_diff <= max_power_allowed:
                 # TODO: fail the test of background > current
@@ -383,27 +397,24 @@
         except:
             import traceback
             traceback.print_exc()
-            self.setTestResult(self._current_test, condition="FAIL", msg="Exception occurred during run of test.")
+            self.setTestResult(self._current_test, condition="FAIL",
+                               msg="Exception occurred during run of test.")
 
 
     @staticmethod
     def run_tests():
         testrunner = None
         try:
-            GENERIC_MOTION_REQUEST = "\n===> Please press Next and when the screen is off, keep the device under motion with only tiny, slow movements" + \
-                 " until the screen turns on again.\n" + \
-                 "Please refrain from interacting with the screen or pressing any side buttons " + \
-                 "while measurements are taken."
-            USER_STEPS_REQUEST = "\n===> Please press Next and when the screen is off, then move the device to simulate step motion" + \
-                 " until the screen turns on again.\n" + \
-                 "Please refrain from interacting with the screen or pressing any side buttons " + \
-                 "while measurements are taken."
+            GENERIC_MOTION_REQUEST = "\n===> Please press Next and when the screen is off, keep " + \
+                "the device under motion with only tiny, slow movements until the screen turns " + \
+                "on again.\nPlease refrain from interacting with the screen or pressing any side " + \
+                "buttons while measurements are taken."
+            USER_STEPS_REQUEST = "\n===> Please press Next and when the screen is off, then move " + \
+                "the device to simulate step motion until the screen turns on again.\nPlease " + \
+                "refrain from interacting with the screen or pressing any side buttons while " + \
+                "measurements are taken."
             testrunner = PowerTest()
-            testrunner.reportErrorIf(not testrunner.queryDevice("AIRPLANE MODE ON?"),
-                                      "Airplane mode not off as expected")
-            #testrunner.reportErrorIf(int(testrunner.executeOnDevice("SCREEN OFF TIMEOUT?")) > 15000,
-            #                          "Screen sleep time not set to 15 seconds")
-            testrunner.executeOnDevice("MESSAGE: Connected.  Running tests...")
+            testrunner.executeOnDevice(PowerTest.REQUEST_SHOW_MESSAGE % "Connected.  Running tests...")
             testrunner.runPowerTest("SIGNIFICANT_MOTION", PowerTest.MAX_SIGMO_POWER, user_request = GENERIC_MOTION_REQUEST)
             testrunner.runPowerTest("STEP_DETECTOR", PowerTest.MAX_STEP_DETECTOR_POWER, user_request = USER_STEPS_REQUEST)
             testrunner.runPowerTest("STEP_COUNTER", PowerTest.MAX_STEP_COUNTER_POWER, user_request = USER_STEPS_REQUEST)
@@ -426,9 +437,10 @@
                 try:
                     testrunner.finalize()
                 except socket.error:
-                    sys.exit("============================\nUnable to connect to device under test. Make sure the device is connected via the usb passthrough,"+\
-                             " the CtsVerifier app is running the SensorPowerTest on the device, and USB passthrough is enabled."
-                             "\n===========================")
+                    sys.exit("============================\nUnable to connect to device under " + \
+                             "test. Make sure the device is connected via the usb pass-through, " + \
+                             "the CtsVerifier app is running the SensorPowerTest on the device, " + \
+                             "and USB pass-through is enabled.\n===========================")
 
 
 def main(argv):
@@ -455,9 +467,8 @@
         sys.exit("Aborting.")
 
   if not FLAGS.power_monitor:
-      sys.exit("You must specify a '--power_monitor' option to specify which power monitor type you are using.\n"+
-               "One of:\n  " +
-               "\n  ".join(available_monitors))
+      sys.exit("You must specify a '--power_monitor' option to specify which power monitor type " + \
+               "you are using.\nOne of:\n  \n  ".join(available_monitors))
   power_monitors = do_import('power_monitors.%s' % FLAGS.power_monitor)
   try:
       mon = power_monitors.Power_Monitor(device=FLAGS.device)
@@ -489,7 +500,7 @@
       mon.SetUsbPassthrough(2)
     else:
       mon.Close()
-      sys.exit('bad passthrough flag: %s' % FLAGS.usbpassthrough)
+      sys.exit('bad pass-through flag: %s' % FLAGS.usbpassthrough)
 
   if FLAGS.samples:
     # Make sure state is normal
diff --git a/apps/CtsVerifier/proguard.flags b/apps/CtsVerifier/proguard.flags
index 7605f3d..be17d8b 100644
--- a/apps/CtsVerifier/proguard.flags
+++ b/apps/CtsVerifier/proguard.flags
@@ -14,4 +14,5 @@
 -keepclasseswithmembers class * extends com.android.cts.verifier.location.LocationModeTestActivity
 
 -dontwarn android.hardware.Sensor
+-dontwarn android.test.AndroidTestRunner
 -dontwarn java.util.concurrent.ConcurrentLinkedDeque
diff --git a/apps/CtsVerifier/res/drawable-hdpi/nfc_hce_banner.png b/apps/CtsVerifier/res/drawable-hdpi/nfc_hce_banner.png
new file mode 100644
index 0000000..333b797
--- /dev/null
+++ b/apps/CtsVerifier/res/drawable-hdpi/nfc_hce_banner.png
Binary files differ
diff --git a/apps/CtsVerifier/res/layout/ble_advertiser_hardware_scan_filter.xml b/apps/CtsVerifier/res/layout/ble_advertiser_hardware_scan_filter.xml
index 1496f81..ce3e1e1 100644
--- a/apps/CtsVerifier/res/layout/ble_advertiser_hardware_scan_filter.xml
+++ b/apps/CtsVerifier/res/layout/ble_advertiser_hardware_scan_filter.xml
@@ -29,6 +29,10 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
         />
+        <TextView android:text="@string/ble_advertiser_scannable_instruction"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+        />
         <LinearLayout android:orientation="horizontal"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
@@ -48,6 +52,10 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
         />
+        <TextView android:text="@string/ble_advertiser_unscannable_instruction"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+        />
         <LinearLayout android:orientation="horizontal"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
diff --git a/apps/CtsVerifier/res/layout/ble_advertiser_power_level.xml b/apps/CtsVerifier/res/layout/ble_advertiser_power_level.xml
index 37a7bbc..ec3284d 100644
--- a/apps/CtsVerifier/res/layout/ble_advertiser_power_level.xml
+++ b/apps/CtsVerifier/res/layout/ble_advertiser_power_level.xml
@@ -20,6 +20,10 @@
         android:padding="10dip"
         >
 
+    <TextView android:text="@string/ble_advertiser_power_level_instruction"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+    />
     <LinearLayout android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
diff --git a/apps/CtsVerifier/res/layout/ble_privacy_mac.xml b/apps/CtsVerifier/res/layout/ble_advertiser_privacy_mac.xml
similarity index 90%
rename from apps/CtsVerifier/res/layout/ble_privacy_mac.xml
rename to apps/CtsVerifier/res/layout/ble_advertiser_privacy_mac.xml
index e67c61a..1c68b98 100644
--- a/apps/CtsVerifier/res/layout/ble_privacy_mac.xml
+++ b/apps/CtsVerifier/res/layout/ble_advertiser_privacy_mac.xml
@@ -19,7 +19,10 @@
         android:orientation="vertical"
         android:padding="10dip"
         >
-
+    <TextView android:text="@string/ble_advertiser_privacy_mac_instruction"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+    />
     <LinearLayout android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
diff --git a/apps/CtsVerifier/res/layout/ble_scanner_hardware_scan_filter.xml b/apps/CtsVerifier/res/layout/ble_scanner_hardware_scan_filter.xml
index 4f5de53..f356ded 100644
--- a/apps/CtsVerifier/res/layout/ble_scanner_hardware_scan_filter.xml
+++ b/apps/CtsVerifier/res/layout/ble_scanner_hardware_scan_filter.xml
@@ -19,9 +19,14 @@
         android:orientation="vertical"
         android:padding="10dip"
         >
+    <TextView android:text="@string/ble_scanner_scan_filter_instruction"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+    />
     <LinearLayout android:orientation="vertical"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
             >
         <LinearLayout android:orientation="horizontal"
                 android:layout_width="match_parent"
diff --git a/apps/CtsVerifier/res/layout/ble_scanner_power_level.xml b/apps/CtsVerifier/res/layout/ble_scanner_power_level.xml
index b1fd2df..970b03a 100644
--- a/apps/CtsVerifier/res/layout/ble_scanner_power_level.xml
+++ b/apps/CtsVerifier/res/layout/ble_scanner_power_level.xml
@@ -19,7 +19,10 @@
         android:orientation="vertical"
         android:padding="10dip"
         >
-
+    <TextView android:text="@string/ble_scanner_power_level_instruction"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+    />
     <LinearLayout android:orientation="vertical"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
diff --git a/apps/CtsVerifier/res/layout/ble_scanner_privacy_mac.xml b/apps/CtsVerifier/res/layout/ble_scanner_privacy_mac.xml
index f636705..cad78a3 100644
--- a/apps/CtsVerifier/res/layout/ble_scanner_privacy_mac.xml
+++ b/apps/CtsVerifier/res/layout/ble_scanner_privacy_mac.xml
@@ -20,6 +20,11 @@
         android:padding="10dip"
         >
 
+    <TextView
+            android:text="@string/ble_scanner_privacy_mac_instruction"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+    />
     <LinearLayout android:orientation="vertical"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
diff --git a/apps/CtsVerifier/res/layout/nls_item.xml b/apps/CtsVerifier/res/layout/nls_item.xml
index 3ced3cc..f1a10bf 100644
--- a/apps/CtsVerifier/res/layout/nls_item.xml
+++ b/apps/CtsVerifier/res/layout/nls_item.xml
@@ -40,7 +40,7 @@
         android:text="@string/nls_enable_service" />
 
     <Button
-        android:id="@+id/nls_launch_settings"
+        android:id="@+id/nls_action_button"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_alignParentRight="true"
@@ -48,7 +48,7 @@
         android:layout_marginLeft="20dip"
         android:layout_marginRight="20dip"
         android:layout_toRightOf="@id/nls_status"
-        android:onClick="launchSettings"
+        android:onClick="actionPressed"
         android:text="@string/nls_start_settings" />
 
 </RelativeLayout>
\ No newline at end of file
diff --git a/apps/CtsVerifier/res/layout/snsr_semi_auto_test.xml b/apps/CtsVerifier/res/layout/snsr_semi_auto_test.xml
index 102000f..27880ce 100644
--- a/apps/CtsVerifier/res/layout/snsr_semi_auto_test.xml
+++ b/apps/CtsVerifier/res/layout/snsr_semi_auto_test.xml
@@ -32,18 +32,30 @@
     </ScrollView>
 
     <LinearLayout
-        android:orientation="vertical"
+        android:orientation="horizontal"
+        android:gravity="center"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:paddingBottom="@dimen/snsr_view_padding_bottom"
         android:paddingTop="@dimen/snsr_view_padding_top" >
 
         <Button android:id="@+id/next_button"
-                android:layout_gravity="center_horizontal"
                 android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
                 android:text="@string/next_button_text" />
 
+        <Button android:id="@+id/pass_button"
+                android:visibility="gone"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:drawableTop="@drawable/fs_good"/>
+
+        <Button android:id="@+id/fail_button"
+                android:visibility="gone"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:drawableTop="@drawable/fs_error"/>
+
     </LinearLayout>
 
 </LinearLayout>
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index 918c674..3a84f3b 100644
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -233,12 +233,16 @@
     <string name="ble_advertiser_service_name">Bluetooth LE Advertiser Handler Service</string>
     <string name="ble_privacy_mac_name">BLE Privacy Mac</string>
     <string name="ble_privacy_mac_info">BLE Advertiser should advertise in non-repeating MAC address.</string>
+    <string name="ble_advertiser_privacy_mac_instruction">Click start to start advertising, you can disconnect USB and lock the screen of advertiser. Counts and mac address will show on scanner. You may receive message that this device does not support BLE advertising.</string>
     <string name="ble_power_level_name">BLE Tx Power Level</string>
     <string name="ble_power_level_info">BLE Advertiser advertises in 4 different power levels. Scanner should receive them in different strength of Rssi, cannot receive weak signals beyond several feet.</string>
+    <string name="ble_advertiser_power_level_instruction">Click start to start multi-advertising. Data packets are advertised in 4 different power levels. You may receive message that this device does not support multi advertising. If advertiser does not advertise in 4 power levels, neither you receive the error message, you may not stop the advertising in previous test, or this device does not support 4 advertisers at the same time. Try rebooting the device and run the test to free those advertisers in use.</string>
     <string name="ble_advertiser_scan_filter_name">BLE Hardware Scan Filter</string>
     <string name="ble_advertiser_scan_filter_info">BLE Advertiser advertises with 2 different data separately. One can wake up the scanner, the other cannot.</string>
     <string name="ble_advertiser_scannable">Scannable advertising</string>
+    <string name="ble_advertiser_scannable_instruction">Start scannable advertising, expect scanner consume more power on Monsoon monitor, or see log of GattService from scanner logcat.</string>
     <string name="ble_advertiser_unscannable">Unscannble advertising</string>
+    <string name="ble_advertiser_unscannable_instruction">Start unscannable advertising, expect scanner stay calm on Monsoon monitor, no log of GattService from scanner logcat.</string>
     <string name="ble_advertiser_start">Start</string>
     <string name="ble_advertiser_stop">Stop</string>
 
@@ -247,12 +251,15 @@
     <string name="ble_scanner_service_name">Bluetooth LE Scanner Handler Service</string>
     <string name="ble_scanner_test_info">The BLE test must be done simultaneously on two devices, an advertiser and a scanner. This device is the scanner.</string>
     <string name="ble_scanner_privacy_mac">Hold for 15 min to see if receive a different MAC address from advertiser.</string>
+    <string name="ble_scanner_privacy_mac_instruction">Mac address, counts are shown on screen. It should continuously receive data packet from advertiser. Every 15 min, a new mac address should show up, which prevents mac address disclosure.</string>
     <string name="ble_ultra_low">Ultra low</string>
     <string name="ble_low">Low</string>
     <string name="ble_medium">Medium</string>
     <string name="ble_high">High</string>
+    <string name="ble_scanner_power_level_instruction">Count: Ultra low &lt; low &lt; medium &lt; high\nRssi: Ultra low &lt; low &lt; medium &lt; high\nDistance to see count freezing: Ultra low &lt; low &lt; medium &lt; high\nA common error is ultra low, low and medium behave similarly, with similar rssi, freeze at similar distance.</string>
     <string name="ble_scanner_scan_filter_name">BLE Hardware Scan Filter</string>
     <string name="ble_scanner_scan_filter_info">Lock the screen of scanner, and connect to monsoon. It will not wake up when advertiser is advertising unscannable, and scanner is scanning with filter.</string>
+    <string name="ble_scanner_scan_filter_instruction">For monsoon test:\n\tClick scan with filter, lock the screen, connect to monsoon. It will not wake up when advertiser is advertising unscannable data packets, but will show a peak in power usage when advertiser is advertising scannable data.\nFor logcat test:\n\tClick scan with filter, logcat the scanner. No data will be received by GattService when advertiser is advertising unscannable data.</string>
     <string name="ble_scan_with_filter">Scan with filter</string>
     <string name="ble_scan_without_filter">Scan without filter</string>
 
@@ -396,6 +403,14 @@
     <string name="nfc_hce_conflicting_non_payment_emulator">Two conflicting non-payment services (Emulator)</string>
     <string name="nfc_hce_conflicting_non_payment_reader">Two conflicting non-payment services (Reader)</string>
 
+    <string name="nfc_hce_foreground_non_payment_emulator">Foreground override non-payment services (Emulator)</string>
+    <string name="nfc_hce_foreground_non_payment_reader">Foreground override non-payment services (Reader)</string>
+    <string name="nfc_hce_foreground_non_payment_help">This test enables two non-payment services with conflicting AIDs. It then uses Androids API to allow the foreground app to set a preference for a specific service. This should prevent a popup dialog from showing. If you see a popup dialog during this asking you to select an app, this test has failed.</string>
+
+    <string name="nfc_hce_foreground_payment_emulator">Foreground override payment services (Emulator)</string>
+    <string name="nfc_hce_foreground_payment_reader">Foreground override payment services (Reader)</string>
+    <string name="nfc_hce_foreground_payment_help">This test enables two payment services, and asks you to set one as the default service. It then uses Androids API to allow the foreground app to set a preference for the non-default service. This will cause the non-default payment service to be invoked.</string>
+    <string name="nfc_hce_change_favor_foreground">This test requires the "Favor foreground app" setting to be enabled. Tap OK to go to Tap and Pay settings and check the Favor foreground app option</string>
     <string name="nfc_hce_offhost_service_emulator">Off-host service (Emulator)</string>
     <string name="nfc_hce_offhost_service_reader">Off-host service (Reader)</string>
     <string name="nfc_hce_offhost_emulator_help">This tests enables a service that declares some AIDs to reside off-host. This test only needs to be passed if your device has a secure element (either embedded or UICC.). The responses from the secure element are not verified by the test - it is up to the tester to verify the responses are as expected.</string>
@@ -410,12 +425,33 @@
     <string name="nfc_hce_throughput_emulator">HCE throughput test (Emulator)</string>
     <string name="nfc_hce_throughput_reader">HCE throughput test (Reader)</string>
     <string name="nfc_hce_throughput_emulator_help">This tests verifies that your HCE implementation can reach a decent throughput. While Android does not have any requirements on HCE performance, many HCE applications such as transport and payment apps do. If the average APDU roundtrip time is more than 50ms, please take a look at your implementation to see where the delay is coming from.</string>
-    <string name="nfc_hce_change_preinstalled_wallet">The device has an installed payment application that is currently set as default. To complete the test, you will be asked whether you want to make Payment Service #1 or #2 the default app. Select yes.</string>
+    <string name="nfc_hce_change_preinstalled_wallet">The device has an installed payment application that is currently set as default. To complete the test, you will be asked whether you want to make another app the default app. Select yes.</string>
     <string name="nfc_hce_change_default_help">You will now be asked whether you want to make Payment Service #1 the default app. Select yes.</string>
     <string name="nfc_hce_conflicting_non_payment_help">When tapping the first time, you will be shown a dialog that asks you to choose between TransportService #1 and TransportService #2. Select TransportService #2. Verify a dialog is shown that asks you to tap again to complete. Now tap again, and if communication with TransportService #2 is successfull the pass button will be enabled."</string>
+
+    <string name="nfc_hce_payment_dynamic_aids_emulator">Dynamic payment AIDs (Emulator)</string>
+    <string name="nfc_hce_payment_dynamic_aids_reader">Dynamic payment AIDs (Reader)</string>
+    <string name="nfc_hce_payment_dynamic_aids_help">This test tries to register dynamic AIDs for a payment service.</string>
+
+    <string name="nfc_hce_payment_prefix_aids_emulator">Payment prefix AIDs (Emulator)</string>
+    <string name="nfc_hce_payment_prefix_aids_reader">Payment prefix AIDs (Reader)</string>
+    <string name="nfc_hce_payment_prefix_aids_help">This test statically registers prefix AIDs for a payment service.</string>
+
+    <string name="nfc_hce_payment_prefix_aids_emulator_2">Payment prefix AIDs 2 (Emulator)</string>
+    <string name="nfc_hce_payment_prefix_aids_reader_2">Payment prefix AIDs 2 (Reader)</string>
+
+    <string name="nfc_hce_other_prefix_aids_emulator">Other prefix AIDs (Emulator)</string>
+    <string name="nfc_hce_other_prefix_aids_reader">Other prefix AIDs (Reader)</string>
+    <string name="nfc_hce_other_prefix_aids_help">This test dynamically registers prefix AIDs for a non-payment service.</string>
+
+    <string name="nfc_hce_other_conflicting_prefix_aids_emulator">Conflicting non-payment prefix AIDs (Emulator)</string>
+    <string name="nfc_hce_other_conflicting_prefix_aids_reader">Conflicting non-payment prefix AIDs (Reader)</string>
+    <string name="nfc_hce_other_conflicting_prefix_aids_help">This test registers conflicting prefix AIDs and makes sure AID conflict detection with prefix AIDs works properly. When tapping the first time, you will be shown a dialog that asks you to choose between TransportService #1 and TransportService #2. Select TransportService #2. Verify a dialog is shown that asks you to tap again to complete. Now tap again, and if communication with TransportService #2 is successfull the pass button will be enabled."</string>
+
     <string name="nfc_payment_service_desc">NFC Payment service</string>
     <string name="ppse">PPSE</string>
     <string name="mastercard">MasterCard</string>
+    <string name="visa">Visa</string>
     <string name="paymentService1">Payment Service #1</string>
     <string name="paymentService2">Payment Service #2</string>
     <string name="transportService1">TransportService #1</string>
@@ -424,8 +460,12 @@
     <string name="offhostService">OffhostService</string>
 
     <!-- Strings for Sensor Test Activities -->
+    <string name="snsr_device_admin_receiver">Sensor Tests Device Admin Receiver</string>
     <string name="snsr_test_summary">Tests passed: %1$d, Tests skipped: %2$d, Tests failed: %3$d</string>
-    <string name="snsr_test_complete">Test completed.</string>
+    <string name="snsr_test_complete">Test completed without errors.</string>
+    <string name="snsr_test_complete_with_errors">Test completed with errors: those errors
+        might degrade the user experience and might cause some applications to misbehave. They are
+        not required for Android Compatibility at this time, but will in a future release.</string>
     <string name="snsr_test_pass">PASS</string>
     <string name="snsr_test_skipped">SKIPPED</string>
     <string name="snsr_test_fail">FAIL</string>
@@ -454,6 +494,7 @@
     <string name="snsr_setting_keep_screen_on">Stay awake</string>
     <string name="snsr_setting_location_mode">Location</string>
     <string name="snsr_setting_auto_screen_off_mode">Display Sleep</string>
+    <string name="snsr_pass_on_error">Pass Anyway</string>
 
     <!-- Accelerometer -->
     <string name="snsr_accel_test">Accelerometer Test</string>
@@ -897,10 +938,35 @@
         itself according to the current rotation of the device.</string>
 
     <string name="test_category_notifications">Notifications</string>
+    <string name="attention_test">Notification Attention Management Test</string>
+    <string name="attention_info">This test checks that the NotificationManagerService is
+        respecting user preferences about notification ranking and filtering.
+    </string>
+    <string name="attention_ready">I\'m done</string>
+    <string name="attention_filter_all">Please set the notification filter to \"All\" in the dialog
+        that appears when you change the device\'s volume.</string>
+    <string name="attention_filter_priority">Please set the notification filter to \"Priority\" in
+        the dialog that appears when you change the device\'s volume, and allow messages from
+        starred contacts.</string>
+    <string name="attention_filter_none">Please set the notification filter to \"None\" in the dialog
+        that appears when you change the device\'s volume.</string>
+    <string name="attention_create_contacts">Create contacts for notification annotations.</string>
+    <string name="attention_delete_contacts">Delete test contacts.</string>
+    <string name="attention_default_order">Check that ranker defaults to time order.</string>
+    <string name="attention_priority_order">Check that ranker respects developers priorities.</string>
+    <string name="attention_ambient_bit">Check that the ambient bit is set appropriately.</string>
+    <string name="attention_lookup_order">Check that ranker respects Lookup URIs for contacts.</string>
+    <string name="attention_email_order">Check that ranker respects mailto URIs for contacts.</string>
+    <string name="attention_phone_order">Check that ranker respects telephone URIs for contacts.</string>
+    <string name="attention_interruption_order">Check that ranker temporarily boosts interruptions.
+    This test takes 15 seconds to complete.</string>
+    <string name="attention_none_are_filtered">Check that \"All\" mode doesn\'t filter any notifications.</string>
+    <string name="attention_some_are_filtered">Check that \"Priority\" mode doesn\'t filter priority notifications.</string>
+    <string name="attention_all_are_filtered">Check that \"None\" mode filters all notifications.</string>
     <string name="nls_test">Notification Listener Test</string>
     <string name="nls_service_name">Notification Listener for CTS Verifier</string>
     <string name="nls_info">This test checks that a NotificationListenerService can be enabled
-        and disabled, and that once enabled the service is able to receive notificaitons and
+        and disabled, and that once enabled the service is able to receive notifications and
         dismiss them.
     </string>
     <string name="nls_enable_service">Please enable \"Notification Listener for CTS Verifier\"
diff --git a/apps/CtsVerifier/res/xml/access_prefix_aid_list.xml b/apps/CtsVerifier/res/xml/access_prefix_aid_list.xml
new file mode 100644
index 0000000..915c041
--- /dev/null
+++ b/apps/CtsVerifier/res/xml/access_prefix_aid_list.xml
@@ -0,0 +1,3 @@
+<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
+    android:description="@string/accessService">
+</host-apdu-service>
diff --git a/apps/CtsVerifier/res/xml/empty_aid_list.xml b/apps/CtsVerifier/res/xml/empty_aid_list.xml
new file mode 100644
index 0000000..0646fd9
--- /dev/null
+++ b/apps/CtsVerifier/res/xml/empty_aid_list.xml
@@ -0,0 +1,3 @@
+<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
+    android:description="@string/transportService1">
+</host-apdu-service>
diff --git a/apps/CtsVerifier/res/xml/payment_aid_list_1.xml b/apps/CtsVerifier/res/xml/payment_aid_list_1.xml
index 2036402..37344ff 100644
--- a/apps/CtsVerifier/res/xml/payment_aid_list_1.xml
+++ b/apps/CtsVerifier/res/xml/payment_aid_list_1.xml
@@ -1,5 +1,6 @@
 <host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
-    android:description="@string/paymentService1">
+    android:description="@string/paymentService1"
+    android:apduServiceBanner="@drawable/nfc_hce_banner">
         <aid-group android:description="@string/paymentService1" android:category="payment">
             <aid-filter android:name="325041592E5359532E4444463031"
                         android:description="@string/ppse"/>
diff --git a/apps/CtsVerifier/res/xml/payment_aid_list_2.xml b/apps/CtsVerifier/res/xml/payment_aid_list_2.xml
index 36a5af0..fbf9ce5 100644
--- a/apps/CtsVerifier/res/xml/payment_aid_list_2.xml
+++ b/apps/CtsVerifier/res/xml/payment_aid_list_2.xml
@@ -1,5 +1,5 @@
 <host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
-    android:description="@string/paymentService2">
+    android:description="@string/paymentService2" android:apduServiceBanner="@drawable/nfc_hce_banner">
         <aid-group android:description="@string/paymentService2" android:category="payment">
             <aid-filter android:name="325041592E5359532E4444463031"
                         android:description="@string/ppse"/>
diff --git a/apps/CtsVerifier/res/xml/payment_empty_aid_list.xml b/apps/CtsVerifier/res/xml/payment_empty_aid_list.xml
new file mode 100644
index 0000000..6daf5ea
--- /dev/null
+++ b/apps/CtsVerifier/res/xml/payment_empty_aid_list.xml
@@ -0,0 +1,9 @@
+<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
+    android:description="@string/paymentService1" android:apduServiceBanner="@drawable/nfc_hce_banner">
+        <aid-group android:description="@string/paymentService1" android:category="payment">
+            <aid-filter android:name="325041592E5359532E4444463031"
+                        android:description="@string/ppse"/>
+            <aid-filter android:name="A0000000041010"
+                        android:description="@string/mastercard"/>
+        </aid-group>
+</host-apdu-service>
diff --git a/apps/CtsVerifier/res/xml/payment_prefix_aid_list.xml b/apps/CtsVerifier/res/xml/payment_prefix_aid_list.xml
new file mode 100644
index 0000000..cea5600
--- /dev/null
+++ b/apps/CtsVerifier/res/xml/payment_prefix_aid_list.xml
@@ -0,0 +1,11 @@
+<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
+    android:description="@string/paymentService1" android:apduServiceBanner="@drawable/nfc_hce_banner">
+        <aid-group android:description="@string/paymentService1" android:category="payment">
+            <aid-filter android:name="325041592E5359532E4444463031"
+                        android:description="@string/ppse"/>
+            <aid-prefix-filter android:name="A000000004"
+                        android:description="@string/mastercard"/>
+            <aid-prefix-filter android:name="A000000003"
+                        android:description="@string/visa"/>
+        </aid-group>
+</host-apdu-service>
diff --git a/apps/CtsVerifier/res/xml/payment_prefix_aid_list_2.xml b/apps/CtsVerifier/res/xml/payment_prefix_aid_list_2.xml
new file mode 100644
index 0000000..67b4d90
--- /dev/null
+++ b/apps/CtsVerifier/res/xml/payment_prefix_aid_list_2.xml
@@ -0,0 +1,19 @@
+<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
+    android:description="@string/paymentService1" android:apduServiceBanner="@drawable/nfc_hce_banner">
+        <aid-group android:description="@string/paymentService1" android:category="payment">
+            <aid-filter android:name="325041592E5359532E4444463031"
+                        android:description="@string/ppse"/>
+            <aid-prefix-filter android:name="A00000000410"
+                        android:description="@string/mastercard"/>
+            <aid-prefix-filter android:name="A0000000041010"
+                        android:description="@string/mastercard"/>
+            <aid-prefix-filter android:name="A00000000310"
+                        android:description="@string/visa"/>
+        </aid-group>
+        <aid-group android:description="@string/transportService1" android:category="other">
+            <aid-prefix-filter android:name="F0000000FF"
+                        android:description="@string/transportService1"/>
+            <aid-prefix-filter android:name="F000000000"
+                        android:description="@string/transportService1"/>
+        </aid-group>
+</host-apdu-service>
diff --git a/tests/res/drawable/rippledrawable_theme.xml b/apps/CtsVerifier/res/xml/sensor_device_admin.xml
similarity index 72%
rename from tests/res/drawable/rippledrawable_theme.xml
rename to apps/CtsVerifier/res/xml/sensor_device_admin.xml
index a49b820..2a3437d 100644
--- a/tests/res/drawable/rippledrawable_theme.xml
+++ b/apps/CtsVerifier/res/xml/sensor_device_admin.xml
@@ -1,6 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2014 The Android Open Source Project
+<!-- 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.
@@ -15,5 +13,8 @@
      limitations under the License.
 -->
 
-<ripple xmlns:android="http://schemas.android.com/apk/res/android"
-    android:color="?attr/themeColor" />
+<device-admin xmlns:android="http://schemas.android.com/apk/res/android">
+    <uses-policies>
+        <force-lock />
+    </uses-policies>
+</device-admin>
diff --git a/apps/CtsVerifier/res/xml/transport_prefix_aid_list_1.xml b/apps/CtsVerifier/res/xml/transport_prefix_aid_list_1.xml
new file mode 100644
index 0000000..0646fd9
--- /dev/null
+++ b/apps/CtsVerifier/res/xml/transport_prefix_aid_list_1.xml
@@ -0,0 +1,3 @@
+<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
+    android:description="@string/transportService1">
+</host-apdu-service>
diff --git a/apps/CtsVerifier/res/xml/transport_prefix_aid_list_2.xml b/apps/CtsVerifier/res/xml/transport_prefix_aid_list_2.xml
new file mode 100644
index 0000000..44b1772
--- /dev/null
+++ b/apps/CtsVerifier/res/xml/transport_prefix_aid_list_2.xml
@@ -0,0 +1,3 @@
+<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
+    android:description="@string/transportService2">
+</host-apdu-service>
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserPrivacyMacActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserPrivacyMacActivity.java
index f2bfd9c..87879bd 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserPrivacyMacActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleAdvertiserPrivacyMacActivity.java
@@ -36,7 +36,7 @@
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.ble_privacy_mac);
+        setContentView(R.layout.ble_advertiser_privacy_mac);
         setPassFailButtonClickListeners();
         setInfoResources(R.string.ble_privacy_mac_name,
                          R.string.ble_privacy_mac_info, -1);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/NfcDialogs.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/NfcDialogs.java
index 40a12ae..644e637 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/NfcDialogs.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/NfcDialogs.java
@@ -66,6 +66,22 @@
                 .setPositiveButton("OK", null)
                 .create();
     }
+
+    public static AlertDialog createChangeForegroundDialog(final Context context) {
+        return new AlertDialog.Builder(context)
+                .setIcon(android.R.drawable.ic_dialog_alert)
+                .setTitle(R.string.nfc_hce_tap_reader_title)
+                .setMessage(context.getString(R.string.nfc_hce_change_favor_foreground))
+                .setPositiveButton("OK", new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+                        Intent intent = new Intent(Settings.ACTION_NFC_PAYMENT_SETTINGS);
+                        context.startActivity(intent);
+                    }
+                })
+                .create();
+    }
+
     private NfcDialogs() {
     }
 }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/AccessService.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/AccessService.java
index 969f621..51eb7ec 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/AccessService.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/AccessService.java
@@ -7,9 +7,9 @@
             new ComponentName("com.android.cts.verifier",
             AccessService.class.getName());
 
-    public static final String[] APDU_COMMAND_SEQUENCE = {
-        HceUtils.buildSelectApdu(HceUtils.ACCESS_AID),
-        "80CA01F000"
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu(HceUtils.ACCESS_AID, true),
+        HceUtils.buildCommandApdu("80CA01F000", true)
     };
 
     public static final String[] APDU_RESPOND_SEQUENCE = {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/BaseEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/BaseEmulatorActivity.java
index bcd2b8d..8aa82b5 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/BaseEmulatorActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/BaseEmulatorActivity.java
@@ -1,10 +1,13 @@
 package com.android.cts.verifier.nfc.hce;
 
 import android.annotation.TargetApi;
+import android.app.Activity;
+import android.app.AlertDialog;
 import android.app.ProgressDialog;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.nfc.NfcAdapter;
@@ -19,7 +22,6 @@
 
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
-import com.android.cts.verifier.nfc.hce.PaymentService1;
 
 @TargetApi(19)
 public abstract class BaseEmulatorActivity extends PassFailButtons.Activity {
@@ -27,6 +29,7 @@
     NfcAdapter mAdapter;
     CardEmulation mCardEmulation;
     ProgressDialog mSetupDialog;
+    ComponentName mMakingDefault;
 
     final ArrayList<ComponentName> SERVICES = new ArrayList<ComponentName>(
             Arrays.asList(
@@ -36,7 +39,13 @@
             TransportService2.COMPONENT,
             AccessService.COMPONENT,
             ThroughputService.COMPONENT,
-            OffHostService.COMPONENT)
+            OffHostService.COMPONENT,
+            PaymentServiceDynamicAids.COMPONENT,
+            PrefixPaymentService1.COMPONENT,
+            PrefixPaymentService2.COMPONENT,
+            PrefixTransportService1.COMPONENT,
+            PrefixTransportService2.COMPONENT,
+            PrefixAccessService.COMPONENT)
     );
 
     @Override
@@ -73,6 +82,29 @@
         new SetupServicesTask().execute(components);
     }
 
+    final boolean makePaymentDefault(final ComponentName defaultComponent, int stringId) {
+        if (!mCardEmulation.isDefaultServiceForCategory(defaultComponent,
+                CardEmulation.CATEGORY_PAYMENT)) {
+            AlertDialog.Builder builder = new AlertDialog.Builder(this);
+            builder.setTitle("Note");
+            builder.setMessage(stringId);
+            mMakingDefault = defaultComponent;
+            builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
+                @Override
+                public void onClick(DialogInterface dialog, int which) {
+                Intent changeDefault = new Intent(CardEmulation.ACTION_CHANGE_DEFAULT);
+                changeDefault.putExtra(CardEmulation.EXTRA_CATEGORY, CardEmulation.CATEGORY_PAYMENT);
+                changeDefault.putExtra(CardEmulation.EXTRA_SERVICE_COMPONENT, defaultComponent);
+                startActivityForResult(changeDefault, 0);
+                }
+            });
+            builder.show();
+            return true;
+        } else {
+            return false;
+        }
+    }
+
     final BroadcastReceiver mReceiver = new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
@@ -127,5 +159,38 @@
                     CardEmulation.CATEGORY_PAYMENT);
             return true;
         }
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == Activity.RESULT_OK) {
+            // Verify it's default
+            if (!mCardEmulation.isDefaultServiceForCategory(mMakingDefault,
+                    CardEmulation.CATEGORY_PAYMENT)) {
+                // Popup dialog-box
+                AlertDialog.Builder builder = new AlertDialog.Builder(this);
+                builder.setTitle("Test failed.");
+                builder.setMessage("The service was not made the default service according " +
+                        "to CardEmulation.getDefaultServiceForCategory(), verify the make " +
+                        "default implementation is correct.");
+                builder.setPositiveButton("OK", null);
+                builder.show();
+                onPaymentDefaultResult(mMakingDefault, false);
+            } else {
+                onPaymentDefaultResult(mMakingDefault, true);
+            }
+        } else {
+            AlertDialog.Builder builder = new AlertDialog.Builder(this);
+            builder.setTitle("Test failed.");
+            builder.setMessage("You clicked no.");
+            builder.setPositiveButton("OK", null);
+            builder.show();
+            onPaymentDefaultResult(mMakingDefault, false);
+        }
+    }
+
+    void onPaymentDefaultResult(ComponentName component, boolean success) {
+
     };
 }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ChangeDefaultEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ChangeDefaultEmulatorActivity.java
index 0681f49..633a152 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ChangeDefaultEmulatorActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ChangeDefaultEmulatorActivity.java
@@ -1,20 +1,16 @@
 package com.android.cts.verifier.nfc.hce;
 
 import android.annotation.TargetApi;
-import android.app.AlertDialog;
 import android.content.ComponentName;
 import android.content.Context;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
 import android.content.Intent;
-import android.nfc.cardemulation.CardEmulation;
 import android.os.Bundle;
 
 import com.android.cts.verifier.R;
 import com.android.cts.verifier.nfc.NfcDialogs;
 
 @TargetApi(19)
-public class ChangeDefaultEmulatorActivity extends BaseEmulatorActivity implements OnClickListener {
+public class ChangeDefaultEmulatorActivity extends BaseEmulatorActivity {
     final static int STATE_IDLE = 0;
     final static int STATE_SERVICE1_SETTING_UP = 1;
     final static int STATE_SERVICE2_SETTING_UP = 2;
@@ -48,22 +44,14 @@
             setupServices(this, PaymentService1.COMPONENT, PaymentService2.COMPONENT);
             return;
         }
-        // Verify HCE service 2 is the default
-        if (!mCardEmulation.isDefaultServiceForCategory(
-                PaymentService2.COMPONENT, CardEmulation.CATEGORY_PAYMENT)) {
-            mState = STATE_MAKING_SERVICE2_DEFAULT;
-            AlertDialog.Builder builder = new AlertDialog.Builder(this);
-            builder.setTitle("Note");
-            builder.setMessage(R.string.nfc_hce_change_preinstalled_wallet);
-            builder.setPositiveButton("OK", this);
-            builder.show();
-        } else {
+        if (!makePaymentDefault(PaymentService2.COMPONENT,
+                R.string.nfc_hce_change_preinstalled_wallet)) {
+            // Service 2 is already default, make one default now
             mState = STATE_MAKING_SERVICE1_DEFAULT;
-            AlertDialog.Builder builder = new AlertDialog.Builder(this);
-            builder.setTitle("Note");
-            builder.setMessage(R.string.nfc_hce_change_default_help);
-            builder.setPositiveButton("OK", this);
-            builder.show();
+            makePaymentDefault(PaymentService1.COMPONENT, R.string.nfc_hce_change_default_help);
+        } else {
+            mState = STATE_MAKING_SERVICE2_DEFAULT;
+            // will get callback when 2 is made default
         }
     }
 
@@ -94,57 +82,17 @@
     }
 
     @Override
-    public void onClick(DialogInterface dialog, int which) {
-        if (mState == STATE_MAKING_SERVICE1_DEFAULT) {
-            Intent changeDefault = new Intent(CardEmulation.ACTION_CHANGE_DEFAULT);
-            changeDefault.putExtra(CardEmulation.EXTRA_CATEGORY, CardEmulation.CATEGORY_PAYMENT);
-            changeDefault.putExtra(CardEmulation.EXTRA_SERVICE_COMPONENT, PaymentService1.COMPONENT);
-            startActivityForResult(changeDefault, 0);
-        } else if (mState == STATE_MAKING_SERVICE2_DEFAULT) {
-            Intent changeDefault = new Intent(CardEmulation.ACTION_CHANGE_DEFAULT);
-            changeDefault.putExtra(CardEmulation.EXTRA_CATEGORY, CardEmulation.CATEGORY_PAYMENT);
-            changeDefault.putExtra(CardEmulation.EXTRA_SERVICE_COMPONENT, PaymentService2.COMPONENT);
-            startActivityForResult(changeDefault, 0);
-        }
-    }
-
-    @Override
-    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-        super.onActivityResult(requestCode, resultCode, data);
-        if (mState == STATE_MAKING_SERVICE1_DEFAULT) {
-            if (!mCardEmulation.isDefaultServiceForCategory(
-                    PaymentService1.COMPONENT, CardEmulation.CATEGORY_PAYMENT)) {
-                // Popup dialog-box, fail test
-                AlertDialog.Builder builder = new AlertDialog.Builder(this);
-                builder.setTitle("Test failed.");
-                builder.setMessage("PaymentService1 is not the default service according " +
-                        "to CardEmulation.getDefaultServiceForCategory(), verify the make " +
-                        "default implementation is correct.");
-                builder.setPositiveButton("OK", null);
-                builder.show();
-            } else {
+    void onPaymentDefaultResult(ComponentName component, boolean success) {
+        if (mState == STATE_MAKING_SERVICE2_DEFAULT) {
+            if (success) {
+                mState = STATE_MAKING_SERVICE1_DEFAULT;
+	            makePaymentDefault(PaymentService1.COMPONENT, R.string.nfc_hce_change_default_help);
+            }
+        } else if (mState == STATE_MAKING_SERVICE1_DEFAULT) {
+            if (success) {
                 mState = STATE_DEFAULT_CHANGED;
                 NfcDialogs.createHceTapReaderDialog(this, null).show();
             }
-        } else if (mState == STATE_MAKING_SERVICE2_DEFAULT) {
-            if (!mCardEmulation.isDefaultServiceForCategory(
-                    PaymentService2.COMPONENT, CardEmulation.CATEGORY_PAYMENT)) {
-                // Popup dialog-box, fail test
-                AlertDialog.Builder builder = new AlertDialog.Builder(this);
-                builder.setTitle("Test failed.");
-                builder.setMessage("PaymentService2 is not the default service according " +
-                        "to CardEmulation.getDefaultServiceForCategory(), verify the make " +
-                        "default implementation is correct.");
-                builder.setPositiveButton("OK", null);
-                builder.show();
-            } else {
-                mState = STATE_MAKING_SERVICE1_DEFAULT;
-                AlertDialog.Builder builder = new AlertDialog.Builder(this);
-                builder.setTitle("Note");
-                builder.setMessage(R.string.nfc_hce_change_default_help);
-                builder.setPositiveButton("OK", this);
-                builder.show();
-            }
         }
     }
 }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/CommandApdu.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/CommandApdu.java
new file mode 100644
index 0000000..3039efd
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/CommandApdu.java
@@ -0,0 +1,49 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class CommandApdu implements Parcelable {
+    private String mApdu;
+    private boolean mReachable;
+
+    public CommandApdu(String apdu, boolean reachable) {
+        mApdu = apdu;
+        mReachable = reachable;
+    }
+
+    public boolean isReachable() {
+        return mReachable;
+    }
+
+    public String getApdu() {
+        return mApdu;
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Parcelable.Creator<CommandApdu> CREATOR =
+            new Parcelable.Creator<CommandApdu>() {
+        @Override
+        public CommandApdu createFromParcel(Parcel source) {
+            String apdu = source.readString();
+            boolean reachable = source.readInt() != 0 ? true : false;
+            return new CommandApdu(apdu, reachable);
+        }
+
+        @Override
+        public CommandApdu[] newArray(int size) {
+            return new CommandApdu[size];
+        }
+    };
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(mApdu);
+        dest.writeInt(mReachable ? 1 : 0);
+    }
+
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ConflictingNonPaymentPrefixEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ConflictingNonPaymentPrefixEmulatorActivity.java
new file mode 100644
index 0000000..3b0313a
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ConflictingNonPaymentPrefixEmulatorActivity.java
@@ -0,0 +1,54 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.nfc.cardemulation.CardEmulation;
+import android.os.Bundle;
+
+import com.android.cts.verifier.R;
+import com.android.cts.verifier.nfc.NfcDialogs;
+
+import java.util.ArrayList;
+
+public class ConflictingNonPaymentPrefixEmulatorActivity extends BaseEmulatorActivity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.pass_fail_text);
+        setPassFailButtonClickListeners();
+        getPassButton().setEnabled(false);
+        setupServices(this, PrefixTransportService1.COMPONENT, PrefixTransportService2.COMPONENT);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+    }
+
+    @Override
+    void onServicesSetup(boolean result) {
+        // Do dynamic AID registration
+        ArrayList<String> service_aids = new ArrayList<String>();
+        service_aids.add(HceUtils.TRANSPORT_PREFIX_AID + "*");
+        mCardEmulation.registerAidsForService(PrefixTransportService1.COMPONENT, CardEmulation.CATEGORY_OTHER, service_aids);
+        mCardEmulation.registerAidsForService(PrefixTransportService2.COMPONENT, CardEmulation.CATEGORY_OTHER, service_aids);
+        NfcDialogs.createHceTapReaderDialog(this, getString(R.string.nfc_hce_other_conflicting_prefix_aids_help)).show();
+    }
+
+    public static Intent buildReaderIntent(Context context) {
+        Intent readerIntent = new Intent(context, SimpleReaderActivity.class);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_APDUS, PrefixTransportService2.APDU_COMMAND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_RESPONSES, PrefixTransportService2.APDU_RESPOND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_LABEL,
+                context.getString(R.string.nfc_hce_other_conflicting_prefix_aids_reader));
+        return readerIntent;
+    }
+
+    @Override
+    void onApduSequenceComplete(ComponentName component, long duration) {
+        if (component.equals(PrefixTransportService2.COMPONENT)) {
+            getPassButton().setEnabled(true);
+        }
+    }
+}
\ No newline at end of file
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DefaultRouteEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DefaultRouteEmulatorActivity.java
index 2de99e7..fbf07e7 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DefaultRouteEmulatorActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DefaultRouteEmulatorActivity.java
@@ -9,8 +9,8 @@
 import com.android.cts.verifier.nfc.NfcDialogs;
 
 public class DefaultRouteEmulatorActivity extends BaseEmulatorActivity {
-    public static final String[] APDU_COMMAND_SEQUENCE = {
-        HceUtils.buildSelectApdu("A000000476416E64726F6964484345"),
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu("A000000476416E64726F6964484345", true),
     };
     public static final String[] APDU_RESPONSE_SEQUENCE = {
         "148100009000"
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DualNonPaymentEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DualNonPaymentEmulatorActivity.java
index 27b063c..0a9362a 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DualNonPaymentEmulatorActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DualNonPaymentEmulatorActivity.java
@@ -31,7 +31,7 @@
     public static Intent buildReaderIntent(Context context) {
         Intent readerIntent = new Intent(context, SimpleReaderActivity.class);
         // Combine command/response APDU arrays
-        String[] commandSequences = new String[TransportService2.APDU_COMMAND_SEQUENCE.length +
+        CommandApdu[] commandSequences = new CommandApdu[TransportService2.APDU_COMMAND_SEQUENCE.length +
                                                AccessService.APDU_COMMAND_SEQUENCE.length];
         System.arraycopy(TransportService2.APDU_COMMAND_SEQUENCE, 0, commandSequences, 0,
                 TransportService2.APDU_COMMAND_SEQUENCE.length);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DualNonPaymentPrefixEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DualNonPaymentPrefixEmulatorActivity.java
new file mode 100644
index 0000000..c02faca
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DualNonPaymentPrefixEmulatorActivity.java
@@ -0,0 +1,73 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.nfc.cardemulation.CardEmulation;
+import android.os.Bundle;
+
+import com.android.cts.verifier.R;
+import com.android.cts.verifier.nfc.NfcDialogs;
+
+import java.util.ArrayList;
+
+public class DualNonPaymentPrefixEmulatorActivity extends BaseEmulatorActivity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.pass_fail_text);
+        setPassFailButtonClickListeners();
+        getPassButton().setEnabled(false);
+        setupServices(this, PrefixTransportService1.COMPONENT, PrefixAccessService.COMPONENT);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+    }
+
+    @Override
+    void onServicesSetup(boolean result) {
+        // Do dynamic AID registration
+        ArrayList<String> service1_aids = new ArrayList<String>();
+        service1_aids.add(HceUtils.TRANSPORT_PREFIX_AID + "*");
+        ArrayList<String> service2_aids = new ArrayList<String>();
+        service2_aids.add(HceUtils.ACCESS_PREFIX_AID + "*");
+        mCardEmulation.registerAidsForService(PrefixTransportService1.COMPONENT, CardEmulation.CATEGORY_OTHER, service1_aids);
+        mCardEmulation.registerAidsForService(PrefixAccessService.COMPONENT, CardEmulation.CATEGORY_OTHER, service2_aids);
+        NfcDialogs.createHceTapReaderDialog(this, getString(R.string.nfc_hce_other_prefix_aids_help)).show();
+    }
+
+    public static Intent buildReaderIntent(Context context) {
+        Intent readerIntent = new Intent(context, SimpleReaderActivity.class);
+        // Combine command/response APDU arrays
+        CommandApdu[] commandSequences = new CommandApdu[PrefixTransportService1.APDU_COMMAND_SEQUENCE.length +
+                PrefixAccessService.APDU_COMMAND_SEQUENCE.length];
+        System.arraycopy(PrefixTransportService1.APDU_COMMAND_SEQUENCE, 0, commandSequences, 0,
+                PrefixTransportService1.APDU_COMMAND_SEQUENCE.length);
+        System.arraycopy(PrefixAccessService.APDU_COMMAND_SEQUENCE, 0, commandSequences,
+                PrefixTransportService1.APDU_COMMAND_SEQUENCE.length,
+                PrefixAccessService.APDU_COMMAND_SEQUENCE.length);
+
+        String[] responseSequences = new String[PrefixTransportService1.APDU_RESPOND_SEQUENCE.length +
+                PrefixAccessService.APDU_RESPOND_SEQUENCE.length];
+        System.arraycopy(PrefixTransportService1.APDU_RESPOND_SEQUENCE, 0, responseSequences, 0,
+                PrefixTransportService1.APDU_RESPOND_SEQUENCE.length);
+        System.arraycopy(PrefixAccessService.APDU_RESPOND_SEQUENCE, 0, responseSequences,
+                PrefixTransportService1.APDU_RESPOND_SEQUENCE.length,
+                PrefixAccessService.APDU_RESPOND_SEQUENCE.length);
+
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_APDUS, commandSequences);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_RESPONSES, responseSequences);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_LABEL,
+                context.getString(R.string.nfc_hce_other_prefix_aids_reader));
+        return readerIntent;
+    }
+
+    @Override
+    void onApduSequenceComplete(ComponentName component, long duration) {
+        if (component.equals(PrefixAccessService.COMPONENT)) {
+            getPassButton().setEnabled(true);
+        }
+    }
+}
\ No newline at end of file
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DualPaymentEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DualPaymentEmulatorActivity.java
index 125045f..2e72e09 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DualPaymentEmulatorActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DualPaymentEmulatorActivity.java
@@ -1,11 +1,8 @@
 package com.android.cts.verifier.nfc.hce;
 
 import android.annotation.TargetApi;
-import android.app.AlertDialog;
 import android.content.ComponentName;
 import android.content.Context;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
 import android.content.Intent;
 import android.nfc.cardemulation.CardEmulation;
 import android.os.Bundle;
@@ -14,7 +11,7 @@
 import com.android.cts.verifier.nfc.NfcDialogs;
 
 @TargetApi(19)
-public class DualPaymentEmulatorActivity extends BaseEmulatorActivity implements OnClickListener {
+public class DualPaymentEmulatorActivity extends BaseEmulatorActivity {
     final static int STATE_IDLE = 0;
     final static int STATE_SERVICE1_SETTING_UP = 1;
     final static int STATE_SERVICE2_SETTING_UP = 2;
@@ -46,43 +43,28 @@
             return;
         }
         // Verify HCE service 2 is the default
-        if (!mCardEmulation.isDefaultServiceForCategory(
-                PaymentService2.COMPONENT, CardEmulation.CATEGORY_PAYMENT)) {
+        if (makePaymentDefault(PaymentService2.COMPONENT, R.string.nfc_hce_change_preinstalled_wallet)) {
             mState = STATE_MAKING_SERVICE2_DEFAULT;
-            AlertDialog.Builder builder = new AlertDialog.Builder(this);
-            builder.setTitle("Note");
-            builder.setMessage(R.string.nfc_hce_change_preinstalled_wallet);
-            builder.setPositiveButton("OK", this);
-            builder.show();
         } else {
+            // Already default
             NfcDialogs.createHceTapReaderDialog(this,null).show();
         }
     }
 
     @Override
+    void onPaymentDefaultResult(ComponentName component, boolean success) {
+        if (success) {
+            NfcDialogs.createHceTapReaderDialog(this, null).show();
+        }
+    }
+
+    @Override
     protected void onPause() {
         super.onPause();
         if (mReceiverRegistered) {
             unregisterReceiver(mReceiver);
         }
     }
-    @Override
-    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-        super.onActivityResult(requestCode, resultCode, data);
-        if (!mCardEmulation.isDefaultServiceForCategory(
-                PaymentService2.COMPONENT, CardEmulation.CATEGORY_PAYMENT)) {
-            // Popup dialog-box, fail test
-            AlertDialog.Builder builder = new AlertDialog.Builder(this);
-            builder.setTitle("Test failed.");
-            builder.setMessage("PaymentService2 is not the default service according " +
-                    "to CardEmulation.getDefaultServiceForCategory(), verify the make " +
-                    "default implementation is correct.");
-            builder.setPositiveButton("OK", null);
-            builder.show();
-        } else {
-            NfcDialogs.createHceTapReaderDialog(this, null).show();
-        }
-    }
     public static Intent buildReaderIntent(Context context) {
         Intent readerIntent = new Intent(context, SimpleReaderActivity.class);
         readerIntent.putExtra(SimpleReaderActivity.EXTRA_APDUS,
@@ -100,12 +82,4 @@
             getPassButton().setEnabled(true);
         }
     }
-
-    @Override
-    public void onClick(DialogInterface dialog, int which) {
-        Intent changeDefault = new Intent(CardEmulation.ACTION_CHANGE_DEFAULT);
-        changeDefault.putExtra(CardEmulation.EXTRA_CATEGORY, CardEmulation.CATEGORY_PAYMENT);
-        changeDefault.putExtra(CardEmulation.EXTRA_SERVICE_COMPONENT, PaymentService2.COMPONENT);
-        startActivityForResult(changeDefault, 0);
-    }
 }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DynamicAidEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DynamicAidEmulatorActivity.java
new file mode 100644
index 0000000..ae8d50c
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/DynamicAidEmulatorActivity.java
@@ -0,0 +1,73 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.nfc.cardemulation.CardEmulation;
+import android.os.Bundle;
+
+import com.android.cts.verifier.R;
+import com.android.cts.verifier.nfc.NfcDialogs;
+
+import java.util.ArrayList;
+
+public class DynamicAidEmulatorActivity extends BaseEmulatorActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+       super.onCreate(savedInstanceState);
+       setContentView(R.layout.pass_fail_text);
+       setPassFailButtonClickListeners();
+       getPassButton().setEnabled(false);
+       setupServices(this, PaymentServiceDynamicAids.COMPONENT);
+    }
+
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+    }
+
+
+    @Override
+    void onServicesSetup(boolean result) {
+        ArrayList<String> paymentAids = new ArrayList<String>();
+        paymentAids.add(HceUtils.PPSE_AID);
+        paymentAids.add(HceUtils.VISA_AID);
+        // Register a different set of AIDs for the foreground
+        mCardEmulation.registerAidsForService(PaymentServiceDynamicAids.COMPONENT,
+                CardEmulation.CATEGORY_PAYMENT, paymentAids);
+        // Now make sure it's default
+        if (makePaymentDefault(PaymentServiceDynamicAids.COMPONENT,
+                R.string.nfc_hce_change_preinstalled_wallet)) {
+            // Wait for callback
+        } else {
+	        NfcDialogs.createHceTapReaderDialog(this, getString(R.string.nfc_hce_payment_dynamic_aids_help)).show();
+        }
+    }
+
+    @Override
+    void onPaymentDefaultResult(ComponentName component, boolean success) {
+        if (success) {
+	        NfcDialogs.createHceTapReaderDialog(this, getString(R.string.nfc_hce_payment_dynamic_aids_help)).show();
+        }
+    }
+
+    @Override
+    void onApduSequenceComplete(ComponentName component, long duration) {
+        if (component.equals(PaymentServiceDynamicAids.COMPONENT)) {
+            getPassButton().setEnabled(true);
+        }
+    }
+
+    public static Intent buildReaderIntent(Context context) {
+        Intent readerIntent = new Intent(context, SimpleReaderActivity.class);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_APDUS,
+                PaymentServiceDynamicAids.APDU_COMMAND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_RESPONSES,
+                PaymentServiceDynamicAids.APDU_RESPOND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_LABEL,
+                context.getString(R.string.nfc_hce_payment_dynamic_aids_reader));
+        return readerIntent;
+    }
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ForegroundNonPaymentEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ForegroundNonPaymentEmulatorActivity.java
new file mode 100644
index 0000000..e8bf5f1
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ForegroundNonPaymentEmulatorActivity.java
@@ -0,0 +1,58 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+
+import com.android.cts.verifier.R;
+import com.android.cts.verifier.nfc.NfcDialogs;
+
+public class ForegroundNonPaymentEmulatorActivity extends BaseEmulatorActivity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.pass_fail_text);
+        setPassFailButtonClickListeners();
+        getPassButton().setEnabled(false);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        setupServices(this, TransportService1.COMPONENT, TransportService2.COMPONENT);
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        mCardEmulation.unsetPreferredService(this);
+    }
+
+    @Override
+    void onServicesSetup(boolean result) {
+        // Tell NFC service we prefer TransportService2
+        mCardEmulation.setPreferredService(this, TransportService2.COMPONENT);
+        NfcDialogs.createHceTapReaderDialog(this,
+                getString(R.string.nfc_hce_foreground_non_payment_help)).show();
+    }
+
+    public static Intent buildReaderIntent(Context context) {
+        Intent readerIntent = new Intent(context, SimpleReaderActivity.class);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_APDUS,
+                TransportService2.APDU_COMMAND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_RESPONSES,
+                TransportService2.APDU_RESPOND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_LABEL,
+                context.getString(R.string.nfc_hce_foreground_non_payment_reader));
+        return readerIntent;
+    }
+
+    @Override
+    void onApduSequenceComplete(ComponentName component, long duration) {
+        if (component.equals(TransportService2.COMPONENT)) {
+            getPassButton().setEnabled(true);
+        }
+    }
+
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ForegroundPaymentEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ForegroundPaymentEmulatorActivity.java
new file mode 100644
index 0000000..27cb061
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ForegroundPaymentEmulatorActivity.java
@@ -0,0 +1,75 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.annotation.TargetApi;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.nfc.cardemulation.CardEmulation;
+import android.os.Bundle;
+import android.util.Log;
+
+import com.android.cts.verifier.R;
+import com.android.cts.verifier.nfc.NfcDialogs;
+
+@TargetApi(19)
+public class ForegroundPaymentEmulatorActivity extends BaseEmulatorActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.pass_fail_text);
+        setPassFailButtonClickListeners();
+        getPassButton().setEnabled(false);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (!mCardEmulation.categoryAllowsForegroundPreference(CardEmulation.CATEGORY_PAYMENT)) {
+            // Launch tap&pay settings
+            NfcDialogs.createChangeForegroundDialog(this).show();
+        } else {
+            setupServices(this, PaymentService2.COMPONENT, PaymentService1.COMPONENT);
+        }
+    }
+
+    @Override
+    void onServicesSetup(boolean result) {
+        if (!makePaymentDefault(PaymentService1.COMPONENT,
+                R.string.nfc_hce_change_preinstalled_wallet)) {
+            mCardEmulation.setPreferredService(this, PaymentService2.COMPONENT);
+            NfcDialogs.createHceTapReaderDialog(this, getString(R.string.nfc_hce_foreground_payment_help)).show();
+        } // else, wait for callback
+    }
+
+    @Override
+    void onPaymentDefaultResult(ComponentName component, boolean success) {
+        if (success) {
+            NfcDialogs.createHceTapReaderDialog(this, null).show();
+        }
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        mCardEmulation.unsetPreferredService(this);
+    }
+
+    public static Intent buildReaderIntent(Context context) {
+        Intent readerIntent = new Intent(context, SimpleReaderActivity.class);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_APDUS,
+                PaymentService2.APDU_COMMAND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_RESPONSES,
+                PaymentService2.APDU_RESPOND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_LABEL,
+                context.getString(R.string.nfc_hce_foreground_payment_reader));
+        return readerIntent;
+    }
+
+    @Override
+    void onApduSequenceComplete(ComponentName component, long duration) {
+        if (component.equals(PaymentService2.COMPONENT)) {
+            getPassButton().setEnabled(true);
+        }
+    }
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceEmulatorTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceEmulatorTestActivity.java
index e85d387..3029796 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceEmulatorTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceEmulatorTestActivity.java
@@ -23,6 +23,9 @@
 
 import android.content.Intent;
 import android.content.pm.PackageManager;
+import android.nfc.NfcAdapter;
+import android.nfc.cardemulation.CardEmulation;
+import android.os.Build;
 import android.os.Bundle;
 
 /** Activity that lists all the NFC HCE emulator tests. */
@@ -37,6 +40,8 @@
 
         ArrayTestListAdapter adapter = new ArrayTestListAdapter(this);
 
+        NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this);
+        CardEmulation cardEmulation = CardEmulation.getInstance(nfcAdapter);
         if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION)) {
             adapter.add(TestListItem.newCategory(this, R.string.nfc_hce_emulator_tests));
 
@@ -62,6 +67,9 @@
                     ChangeDefaultEmulatorActivity.class.getName(),
                     new Intent(this, ChangeDefaultEmulatorActivity.class), null));
 
+            adapter.add(TestListItem.newTest(this, R.string.nfc_hce_foreground_payment_emulator,
+                    ForegroundPaymentEmulatorActivity.class.getName(),
+                    new Intent(this, ForegroundPaymentEmulatorActivity.class), null));
 
             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_single_non_payment_emulator,
                     SingleNonPaymentEmulatorActivity.class.getName(),
@@ -75,6 +83,10 @@
                     ConflictingNonPaymentEmulatorActivity.class.getName(),
                     new Intent(this, ConflictingNonPaymentEmulatorActivity.class), null));
 
+            adapter.add(TestListItem.newTest(this, R.string.nfc_hce_foreground_non_payment_emulator,
+                    ForegroundNonPaymentEmulatorActivity.class.getName(),
+                    new Intent(this, ForegroundNonPaymentEmulatorActivity.class), null));
+
             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_throughput_emulator,
                     ThroughputEmulatorActivity.class.getName(),
                     new Intent(this, ThroughputEmulatorActivity.class), null));
@@ -91,6 +103,29 @@
                     OnAndOffHostEmulatorActivity.class.getName(),
                     new Intent(this, OnAndOffHostEmulatorActivity.class), null));
 
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.L) {
+                adapter.add(TestListItem.newTest(this, R.string.nfc_hce_payment_dynamic_aids_emulator,
+                        DynamicAidEmulatorActivity.class.getName(),
+                        new Intent(this, DynamicAidEmulatorActivity.class), null));
+
+                if (cardEmulation.supportsAidPrefixRegistration()) {
+                    adapter.add(TestListItem.newTest(this, R.string.nfc_hce_payment_prefix_aids_emulator,
+                            PrefixPaymentEmulatorActivity.class.getName(),
+                            new Intent(this, PrefixPaymentEmulatorActivity.class), null));
+
+                    adapter.add(TestListItem.newTest(this, R.string.nfc_hce_payment_prefix_aids_emulator_2,
+                            PrefixPaymentEmulator2Activity.class.getName(),
+                            new Intent(this, PrefixPaymentEmulator2Activity.class), null));
+
+                    adapter.add(TestListItem.newTest(this, R.string.nfc_hce_other_prefix_aids_emulator,
+                            DualNonPaymentPrefixEmulatorActivity.class.getName(),
+                            new Intent(this, DualNonPaymentPrefixEmulatorActivity.class), null));
+
+                    adapter.add(TestListItem.newTest(this, R.string.nfc_hce_other_conflicting_prefix_aids_emulator,
+                            ConflictingNonPaymentPrefixEmulatorActivity.class.getName(),
+                            new Intent(this, ConflictingNonPaymentPrefixEmulatorActivity.class), null));
+                }
+            }
         }
 
         setTestListAdapter(adapter);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceReaderTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceReaderTestActivity.java
index 704cc89..f628fb7 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceReaderTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceReaderTestActivity.java
@@ -61,6 +61,10 @@
                     SimpleReaderActivity.class.getName(),
                     ChangeDefaultEmulatorActivity.buildReaderIntent(this), null));
 
+            adapter.add(TestListItem.newTest(this, R.string.nfc_hce_foreground_payment_reader,
+                    SimpleReaderActivity.class.getName(),
+                    ForegroundPaymentEmulatorActivity.buildReaderIntent(this), null));
+
             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_single_non_payment_reader,
                     SimpleReaderActivity.class.getName(),
                     SingleNonPaymentEmulatorActivity.buildReaderIntent(this), null));
@@ -73,6 +77,10 @@
                     SimpleReaderActivity.class.getName(),
                     ConflictingNonPaymentEmulatorActivity.buildReaderIntent(this), null));
 
+            adapter.add(TestListItem.newTest(this, R.string.nfc_hce_foreground_non_payment_reader,
+                    SimpleReaderActivity.class.getName(),
+                    ForegroundNonPaymentEmulatorActivity.buildReaderIntent(this), null));
+
             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_throughput_reader,
                     SimpleReaderActivity.class.getName(),
                     ThroughputEmulatorActivity.buildReaderIntent(this), null));
@@ -88,6 +96,26 @@
             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_on_and_offhost_service_reader,
                     SimpleReaderActivity.class.getName(),
                     OnAndOffHostEmulatorActivity.buildReaderIntent(this), null));
+
+            adapter.add(TestListItem.newTest(this, R.string.nfc_hce_payment_dynamic_aids_reader,
+                    SimpleReaderActivity.class.getName(),
+                    DynamicAidEmulatorActivity.buildReaderIntent(this), null));
+
+            adapter.add(TestListItem.newTest(this, R.string.nfc_hce_payment_prefix_aids_reader,
+                    SimpleReaderActivity.class.getName(),
+                    PrefixPaymentEmulatorActivity.buildReaderIntent(this), null));
+
+            adapter.add(TestListItem.newTest(this, R.string.nfc_hce_payment_prefix_aids_reader_2,
+                    SimpleReaderActivity.class.getName(),
+                    PrefixPaymentEmulator2Activity.buildReaderIntent(this), null));
+
+            adapter.add(TestListItem.newTest(this, R.string.nfc_hce_other_prefix_aids_reader,
+                    SimpleReaderActivity.class.getName(),
+                    DualNonPaymentPrefixEmulatorActivity.buildReaderIntent(this), null));
+
+            adapter.add(TestListItem.newTest(this, R.string.nfc_hce_other_conflicting_prefix_aids_reader,
+                    SimpleReaderActivity.class.getName(),
+                    ConflictingNonPaymentPrefixEmulatorActivity.buildReaderIntent(this), null));
         }
 
         setTestListAdapter(adapter);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceService.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceService.java
index 20b34df..e9cd121 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceService.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceService.java
@@ -18,13 +18,13 @@
     final static int STATE_FAILED = 2;
 
     // Variables below only used on main thread
-    String[] mCommandApdus = null;
+    CommandApdu[] mCommandApdus = null;
     String[] mResponseApdus = null;
     int mApduIndex = 0;
     int mState = STATE_IDLE;
     long mStartTime;
 
-    public void initialize(String[] commandApdus, String[] responseApdus) {
+    public void initialize(CommandApdu[] commandApdus, String[] responseApdus) {
        mCommandApdus = commandApdus;
        mResponseApdus = responseApdus;
     }
@@ -62,12 +62,27 @@
             mStartTime = System.currentTimeMillis();
         }
 
+
+        if (mApduIndex >= mCommandApdus.length) {
+	        // Skip all APDUs which aren't supposed to reach us
+            return null;
+        }
+
+        do {
+            if (!mCommandApdus[mApduIndex].isReachable()) {
+                mApduIndex++;
+            } else {
+                break;
+            }
+        } while (mApduIndex < mCommandApdus.length);
+
         if (mApduIndex >= mCommandApdus.length) {
             Log.d(TAG, "Ignoring command APDU; protocol complete.");
             // Ignore new APDUs after completion
             return null;
         } else {
-            if (!Arrays.equals(HceUtils.hexStringToBytes(mCommandApdus[mApduIndex]), arg0)) {
+
+            if (!Arrays.equals(HceUtils.hexStringToBytes(mCommandApdus[mApduIndex].getApdu()), arg0)) {
                 Log.d(TAG, "Unexpected command APDU: " + HceUtils.getHexBytes("", arg0));
                 onApduSequenceError();
                 return null;
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceUtils.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceUtils.java
index 3bab53b..c67169a 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceUtils.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/HceUtils.java
@@ -14,10 +14,14 @@
 
     public static final String PPSE_AID = "325041592E5359532E4444463031";
     public static final String MC_AID = "A0000000041010";
+    public static final String VISA_AID = "A0000000030000";
 
     public static final String TRANSPORT_AID = "F001020304";
     public static final String ACCESS_AID = "F005060708";
 
+    public static final String TRANSPORT_PREFIX_AID = "F001020304";
+    public static final String ACCESS_PREFIX_AID = "F005060708";
+
     public static void enableComponent(PackageManager pm, ComponentName component) {
         pm.setComponentEnabledSetting(
                 component,
@@ -58,11 +62,15 @@
         return data;
     }
 
-    public static final String buildSelectApdu(String aid) {
+    public static final CommandApdu buildCommandApdu(String apdu, boolean reachable) {
+        return new CommandApdu(apdu, reachable);
+    }
+
+    public static final CommandApdu buildSelectApdu(String aid, boolean reachable) {
         StringBuilder sb = new StringBuilder();
         sb.append("00A40400");
         sb.append(String.format("%02X", aid.length() / 2));
         sb.append(aid);
-        return sb.toString();
+        return new CommandApdu(sb.toString(), reachable);
     }
 }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/OffHostService.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/OffHostService.java
index c087c99..d8cdf19 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/OffHostService.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/OffHostService.java
@@ -7,11 +7,11 @@
             new ComponentName("com.android.cts.verifier",
                     OffHostService.class.getName());
 
-    public static final String[] APDU_COMMAND_SEQUENCE = {
-        HceUtils.buildSelectApdu("A000000151000000"),
-        "80CA9F7F00",
-        HceUtils.buildSelectApdu("A000000003000000"),
-        "80CA9F7F00"
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu("A000000151000000", true),
+        HceUtils.buildCommandApdu("80CA9F7F00", true),
+        HceUtils.buildSelectApdu("A000000003000000", true),
+        HceUtils.buildCommandApdu("80CA9F7F00", true)
     };
 
     public static final String[] APDU_RESPOND_SEQUENCE = {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/OnAndOffHostEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/OnAndOffHostEmulatorActivity.java
index 3d5190f..d599959 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/OnAndOffHostEmulatorActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/OnAndOffHostEmulatorActivity.java
@@ -6,8 +6,8 @@
 import android.content.Intent;
 import android.os.Bundle;
 
-import com.android.cts.verifier.R;
 import com.android.cts.verifier.nfc.NfcDialogs;
+import com.android.cts.verifier.R;
 
 @TargetApi(19)
 public class OnAndOffHostEmulatorActivity extends BaseEmulatorActivity {
@@ -32,7 +32,7 @@
 
     public static Intent buildReaderIntent(Context context) {
         // Combine command/response APDU arrays
-        String[] commandSequences = new String[OffHostService.APDU_COMMAND_SEQUENCE.length +
+        CommandApdu[] commandSequences = new CommandApdu[OffHostService.APDU_COMMAND_SEQUENCE.length +
                                                AccessService.APDU_COMMAND_SEQUENCE.length];
         System.arraycopy(OffHostService.APDU_COMMAND_SEQUENCE, 0, commandSequences, 0,
                 OffHostService.APDU_COMMAND_SEQUENCE.length);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PaymentService1.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PaymentService1.java
index f6119eb..80df0cb 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PaymentService1.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PaymentService1.java
@@ -9,10 +9,10 @@
             new ComponentName("com.android.cts.verifier",
             PaymentService1.class.getName());
 
-    public static final String[] APDU_COMMAND_SEQUENCE = {
-        HceUtils.buildSelectApdu(HceUtils.PPSE_AID),
-        HceUtils.buildSelectApdu(HceUtils.MC_AID),
-        "80CA01F000"
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu(HceUtils.PPSE_AID, true),
+        HceUtils.buildSelectApdu(HceUtils.MC_AID, true),
+        HceUtils.buildCommandApdu("80CA01F000", true)
     };
 
     public static final String[] APDU_RESPOND_SEQUENCE = {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PaymentService2.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PaymentService2.java
index 23664b9..f2c4835 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PaymentService2.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PaymentService2.java
@@ -7,9 +7,9 @@
             new ComponentName("com.android.cts.verifier",
             PaymentService2.class.getName());
 
-    public static final String[] APDU_COMMAND_SEQUENCE = {
-        HceUtils.buildSelectApdu(HceUtils.PPSE_AID),
-        HceUtils.buildSelectApdu(HceUtils.MC_AID)
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu(HceUtils.PPSE_AID, true),
+        HceUtils.buildSelectApdu(HceUtils.MC_AID, true)
     };
 
     public static final String[] APDU_RESPOND_SEQUENCE = {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PaymentServiceDynamicAids.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PaymentServiceDynamicAids.java
new file mode 100644
index 0000000..047a667
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PaymentServiceDynamicAids.java
@@ -0,0 +1,32 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.content.ComponentName;
+
+public class PaymentServiceDynamicAids extends HceService {
+    static final String TAG = "PaymentService1";
+
+    static final ComponentName COMPONENT =
+            new ComponentName("com.android.cts.verifier",
+            PaymentServiceDynamicAids.class.getName());
+
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu(HceUtils.PPSE_AID, true),
+        HceUtils.buildSelectApdu(HceUtils.VISA_AID, true),
+        HceUtils.buildCommandApdu("80CA01F000", true)
+    };
+
+    public static final String[] APDU_RESPOND_SEQUENCE = {
+        "FFFF9000",
+        "FF0F9000",
+        "FFDFFFAACB9000"
+    };
+
+    public PaymentServiceDynamicAids() {
+        initialize(APDU_COMMAND_SEQUENCE, APDU_RESPOND_SEQUENCE);
+    }
+
+    @Override
+    public ComponentName getComponent() {
+        return COMPONENT;
+    }
+}
\ No newline at end of file
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixAccessService.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixAccessService.java
new file mode 100644
index 0000000..8cecb56
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixAccessService.java
@@ -0,0 +1,34 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.content.ComponentName;
+
+public class PrefixAccessService extends HceService {
+    static final String TAG = "PrefixAccessService";
+
+    static final ComponentName COMPONENT =
+            new ComponentName("com.android.cts.verifier",
+            PrefixAccessService.class.getName());
+
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu(HceUtils.ACCESS_PREFIX_AID + "FFFF", true),
+        HceUtils.buildSelectApdu(HceUtils.ACCESS_PREFIX_AID + "FFAA", true),
+        HceUtils.buildSelectApdu(HceUtils.ACCESS_PREFIX_AID + "FFAABBCCDDEEFF", true),
+        HceUtils.buildCommandApdu("80CA010000010203", true)
+    };
+
+    public static final String[] APDU_RESPOND_SEQUENCE = {
+        "FAFE9000",
+        "FAFE25929000",
+        "FAFEAABB25929000",
+        "FAFEFFAACC25929000"
+    };
+
+    public PrefixAccessService() {
+        initialize(APDU_COMMAND_SEQUENCE, APDU_RESPOND_SEQUENCE);
+    }
+
+    @Override
+    public ComponentName getComponent() {
+        return COMPONENT;
+    }
+}
\ No newline at end of file
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentEmulator2Activity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentEmulator2Activity.java
new file mode 100644
index 0000000..5ed6fe9
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentEmulator2Activity.java
@@ -0,0 +1,84 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.annotation.TargetApi;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+
+import com.android.cts.verifier.R;
+import com.android.cts.verifier.nfc.NfcDialogs;
+
+@TargetApi(19)
+public class PrefixPaymentEmulator2Activity extends BaseEmulatorActivity {
+    final static int STATE_IDLE = 0;
+    final static int STATE_SERVICE1_SETTING_UP = 1;
+    final static int STATE_SERVICE2_SETTING_UP = 2;
+    final static int STATE_MAKING_SERVICE2_DEFAULT = 3;
+
+    boolean mReceiverRegistered = false;
+    int mState = STATE_IDLE;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.pass_fail_text);
+        setPassFailButtonClickListeners();
+        getPassButton().setEnabled(false);
+        mState = STATE_SERVICE2_SETTING_UP;
+        setupServices(this, PrefixPaymentService2.COMPONENT);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+    }
+
+    @Override
+    void onServicesSetup(boolean result) {
+        if (mState == STATE_SERVICE2_SETTING_UP) {
+            mState = STATE_SERVICE1_SETTING_UP;
+            setupServices(this, PrefixPaymentService1.COMPONENT, PrefixPaymentService2.COMPONENT);
+            return;
+        }
+        // Verify HCE service 2 is the default
+        if (makePaymentDefault(PrefixPaymentService2.COMPONENT, R.string.nfc_hce_change_preinstalled_wallet)) {
+            mState = STATE_MAKING_SERVICE2_DEFAULT;
+        } else {
+            // Already default
+            NfcDialogs.createHceTapReaderDialog(this,getString(R.string.nfc_hce_payment_prefix_aids_help)).show();
+        }
+    }
+
+    @Override
+    void onPaymentDefaultResult(ComponentName component, boolean success) {
+        if (success) {
+            NfcDialogs.createHceTapReaderDialog(this, getString(R.string.nfc_hce_payment_prefix_aids_help)).show();
+        }
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        if (mReceiverRegistered) {
+            unregisterReceiver(mReceiver);
+        }
+    }
+    public static Intent buildReaderIntent(Context context) {
+        Intent readerIntent = new Intent(context, SimpleReaderActivity.class);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_APDUS,
+                PrefixPaymentService2.APDU_COMMAND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_RESPONSES,
+                PrefixPaymentService2.APDU_RESPOND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_LABEL,
+                context.getString(R.string.nfc_hce_payment_prefix_aids_reader_2));
+        return readerIntent;
+    }
+
+    @Override
+    void onApduSequenceComplete(ComponentName component, long duration) {
+        if (component.equals(PrefixPaymentService2.COMPONENT)) {
+            getPassButton().setEnabled(true);
+        }
+    }
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentEmulatorActivity.java
new file mode 100644
index 0000000..d3a4189
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentEmulatorActivity.java
@@ -0,0 +1,84 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.annotation.TargetApi;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+
+import com.android.cts.verifier.R;
+import com.android.cts.verifier.nfc.NfcDialogs;
+
+@TargetApi(19)
+public class PrefixPaymentEmulatorActivity extends BaseEmulatorActivity {
+    final static int STATE_IDLE = 0;
+    final static int STATE_SERVICE1_SETTING_UP = 1;
+    final static int STATE_SERVICE2_SETTING_UP = 2;
+    final static int STATE_MAKING_SERVICE1_DEFAULT = 3;
+
+    boolean mReceiverRegistered = false;
+    int mState = STATE_IDLE;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.pass_fail_text);
+        setPassFailButtonClickListeners();
+        getPassButton().setEnabled(false);
+        mState = STATE_SERVICE1_SETTING_UP;
+        setupServices(this, PrefixPaymentService1.COMPONENT);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+    }
+
+    @Override
+    void onServicesSetup(boolean result) {
+        if (mState == STATE_SERVICE1_SETTING_UP) {
+            mState = STATE_SERVICE2_SETTING_UP;
+            setupServices(this, PrefixPaymentService1.COMPONENT, PrefixPaymentService2.COMPONENT);
+            return;
+        }
+        // Verify HCE service 1 is the default
+        if (makePaymentDefault(PrefixPaymentService1.COMPONENT, R.string.nfc_hce_change_preinstalled_wallet)) {
+            mState = STATE_MAKING_SERVICE1_DEFAULT;
+        } else {
+            // Already default
+            NfcDialogs.createHceTapReaderDialog(this, getString(R.string.nfc_hce_payment_prefix_aids_help)).show();
+        }
+    }
+
+    @Override
+    void onPaymentDefaultResult(ComponentName component, boolean success) {
+        if (success) {
+            NfcDialogs.createHceTapReaderDialog(this, getString(R.string.nfc_hce_payment_prefix_aids_help)).show();
+        }
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        if (mReceiverRegistered) {
+            unregisterReceiver(mReceiver);
+        }
+    }
+    public static Intent buildReaderIntent(Context context) {
+        Intent readerIntent = new Intent(context, SimpleReaderActivity.class);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_APDUS,
+                PrefixPaymentService1.APDU_COMMAND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_RESPONSES,
+                PrefixPaymentService1.APDU_RESPOND_SEQUENCE);
+        readerIntent.putExtra(SimpleReaderActivity.EXTRA_LABEL,
+                context.getString(R.string.nfc_hce_payment_prefix_aids_reader));
+        return readerIntent;
+    }
+
+    @Override
+    void onApduSequenceComplete(ComponentName component, long duration) {
+        if (component.equals(PrefixPaymentService1.COMPONENT)) {
+            getPassButton().setEnabled(true);
+        }
+    }
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentService1.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentService1.java
new file mode 100644
index 0000000..be6acc2
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentService1.java
@@ -0,0 +1,32 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.content.ComponentName;
+
+public class PrefixPaymentService1 extends HceService {
+    static final String TAG = "PrefixPaymentService1";
+
+    static final ComponentName COMPONENT =
+            new ComponentName("com.android.cts.verifier",
+            PrefixPaymentService1.class.getName());
+
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu(HceUtils.PPSE_AID, true),
+        HceUtils.buildSelectApdu(HceUtils.MC_AID, true),
+        HceUtils.buildCommandApdu("80CA01F000", true)
+    };
+
+    public static final String[] APDU_RESPOND_SEQUENCE = {
+        "F1239000",
+        "F4569000",
+        "F789FFAABB9000"
+    };
+
+    public PrefixPaymentService1() {
+        initialize(APDU_COMMAND_SEQUENCE, APDU_RESPOND_SEQUENCE);
+    }
+
+    @Override
+    public ComponentName getComponent() {
+        return COMPONENT;
+    }
+}
\ No newline at end of file
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentService2.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentService2.java
new file mode 100644
index 0000000..9642025
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixPaymentService2.java
@@ -0,0 +1,36 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.content.ComponentName;
+
+public class PrefixPaymentService2 extends HceService {
+    static final String TAG = "PrefixPaymentService2";
+
+    static final ComponentName COMPONENT =
+            new ComponentName("com.android.cts.verifier",
+            PrefixPaymentService2.class.getName());
+
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu(HceUtils.PPSE_AID, true),
+        HceUtils.buildSelectApdu(HceUtils.MC_AID, true),
+        HceUtils.buildCommandApdu("80CA02F000", true),
+        HceUtils.buildSelectApdu("F0000000FFFFFFFFFFFFFFFFFFFFFFFF", true),
+        HceUtils.buildSelectApdu("F000000000", true)
+    };
+
+    public static final String[] APDU_RESPOND_SEQUENCE = {
+        "FAAA9000",
+        "FBBB9000",
+        "F789FFCCDD9000",
+        "FFBAFEBECA",
+        "F0BABEFECA"
+    };
+
+    public PrefixPaymentService2() {
+        initialize(APDU_COMMAND_SEQUENCE, APDU_RESPOND_SEQUENCE);
+    }
+
+    @Override
+    public ComponentName getComponent() {
+        return COMPONENT;
+    }
+}
\ No newline at end of file
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixTransportService1.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixTransportService1.java
new file mode 100644
index 0000000..5521440
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixTransportService1.java
@@ -0,0 +1,34 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.content.ComponentName;
+
+public class PrefixTransportService1 extends HceService {
+    static final String TAG = "PrefixTransportService1";
+
+    static final ComponentName COMPONENT =
+            new ComponentName("com.android.cts.verifier",
+            PrefixTransportService1.class.getName());
+
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu(HceUtils.TRANSPORT_PREFIX_AID + "FFFF", true),
+        HceUtils.buildSelectApdu(HceUtils.TRANSPORT_PREFIX_AID + "FFAA", true),
+        HceUtils.buildSelectApdu(HceUtils.TRANSPORT_PREFIX_AID + "FFAABBCCDDEEFF", true),
+        HceUtils.buildCommandApdu("80CA01FFAA", true)
+    };
+
+    public static final String[] APDU_RESPOND_SEQUENCE = {
+        "25929000",
+        "FFEF25929000",
+        "FFDFFFAABB25929000",
+        "FFDFFFAACC25929000"
+    };
+
+    public PrefixTransportService1() {
+        initialize(APDU_COMMAND_SEQUENCE, APDU_RESPOND_SEQUENCE);
+    }
+
+    @Override
+    public ComponentName getComponent() {
+        return COMPONENT;
+    }
+}
\ No newline at end of file
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixTransportService2.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixTransportService2.java
new file mode 100644
index 0000000..2235446
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/PrefixTransportService2.java
@@ -0,0 +1,34 @@
+package com.android.cts.verifier.nfc.hce;
+
+import android.content.ComponentName;
+
+public class PrefixTransportService2 extends HceService {
+    static final String TAG = "PrefixTransportService2";
+
+    static final ComponentName COMPONENT =
+            new ComponentName("com.android.cts.verifier",
+            PrefixTransportService2.class.getName());
+
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu(HceUtils.TRANSPORT_PREFIX_AID + "FFFF", true),
+        HceUtils.buildSelectApdu(HceUtils.TRANSPORT_PREFIX_AID + "FFAA", true),
+        HceUtils.buildSelectApdu(HceUtils.TRANSPORT_PREFIX_AID + "FFAABBCCDDEEFF", true),
+        HceUtils.buildCommandApdu("80CA01FFBB", true)
+    };
+
+    public static final String[] APDU_RESPOND_SEQUENCE = {
+        "36039000",
+        "FFBB25929000",
+        "FFDFFFBBBB25929000",
+        "FFDFFFBBCC25929000"
+    };
+
+    public PrefixTransportService2() {
+        initialize(APDU_COMMAND_SEQUENCE, APDU_RESPOND_SEQUENCE);
+    }
+
+    @Override
+    public ComponentName getComponent() {
+        return COMPONENT;
+    }
+}
\ No newline at end of file
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/SimpleReaderActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/SimpleReaderActivity.java
index 6c15811..638bc6f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/SimpleReaderActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/SimpleReaderActivity.java
@@ -9,6 +9,7 @@
 import android.nfc.tech.IsoDep;
 import android.nfc.Tag;
 import android.os.Bundle;
+import android.os.Parcelable;
 import android.util.Log;
 import android.view.View;
 import android.widget.AdapterView;
@@ -34,7 +35,7 @@
     public static final String EXTRA_LABEL = "label";
 
     NfcAdapter mAdapter;
-    String[] mApdus;
+    CommandApdu[] mApdus;
     String[] mResponses;
 
     TextView mTextView;
@@ -76,7 +77,15 @@
         mAdapter.enableReaderMode(this, this, NfcAdapter.FLAG_READER_NFC_A |
                 NfcAdapter.FLAG_READER_NFC_BARCODE | NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK, null);
         Intent intent = getIntent();
-        mApdus = intent.getStringArrayExtra(EXTRA_APDUS);
+        Parcelable[] apdus = intent.getParcelableArrayExtra(EXTRA_APDUS);
+        if (apdus != null) {
+	        mApdus = new CommandApdu[apdus.length];
+	        for (int i = 0; i < apdus.length; i++) {
+	            mApdus[i] = (CommandApdu) apdus[i];
+	        }
+        } else {
+            mApdus = null;
+        }
         mResponses = intent.getStringArrayExtra(EXTRA_RESPONSES);
     }
 
@@ -95,11 +104,11 @@
             int count = 0;
             boolean success = true;
             long startTime = System.currentTimeMillis();
-            for (String apdu: mApdus) {
+            for (CommandApdu apdu: mApdus) {
                 sb.append("Request APDU:\n");
-                sb.append(apdu + "\n\n");
+                sb.append(apdu.getApdu() + "\n\n");
                 long apduStartTime = System.currentTimeMillis();
-                byte[] response = isoDep.transceive(HceUtils.hexStringToBytes(apdu));
+                byte[] response = isoDep.transceive(HceUtils.hexStringToBytes(apdu.getApdu()));
                 long apduEndTime = System.currentTimeMillis();
                 sb.append("Response APDU (in " + Long.toString(apduEndTime - apduStartTime) +
                         " ms):\n");
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/SinglePaymentEmulatorActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/SinglePaymentEmulatorActivity.java
index 13b2fe8..0f1fba0 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/SinglePaymentEmulatorActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/SinglePaymentEmulatorActivity.java
@@ -1,19 +1,15 @@
 package com.android.cts.verifier.nfc.hce;
 
 import android.annotation.TargetApi;
-import android.app.AlertDialog;
 import android.content.ComponentName;
 import android.content.Context;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
 import android.content.Intent;
-import android.nfc.cardemulation.CardEmulation;
 import android.os.Bundle;
 import com.android.cts.verifier.R;
 import com.android.cts.verifier.nfc.NfcDialogs;
 
 @TargetApi(19)
-public class SinglePaymentEmulatorActivity extends BaseEmulatorActivity implements OnClickListener {
+public class SinglePaymentEmulatorActivity extends BaseEmulatorActivity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -31,18 +27,21 @@
     @Override
     void onServicesSetup(boolean result) {
         // Verify HCE service 1 is the default
-        if (!mCardEmulation.isDefaultServiceForCategory(
-                PaymentService1.COMPONENT, CardEmulation.CATEGORY_PAYMENT)) {
-            AlertDialog.Builder builder = new AlertDialog.Builder(this);
-            builder.setTitle("Note");
-            builder.setMessage(R.string.nfc_hce_change_preinstalled_wallet);
-            builder.setPositiveButton("OK", this);
-            builder.show();
+        if (makePaymentDefault(PaymentService1.COMPONENT,
+                R.string.nfc_hce_change_preinstalled_wallet)) {
+            // Wait for callback
         } else {
 	        NfcDialogs.createHceTapReaderDialog(this, null).show();
         }
     }
 
+    @Override
+    void onPaymentDefaultResult(ComponentName component, boolean success) {
+        if (success) {
+	        NfcDialogs.createHceTapReaderDialog(this, null).show();
+        }
+    }
+
     public static Intent buildReaderIntent(Context context) {
         Intent readerIntent = new Intent(context, SimpleReaderActivity.class);
         readerIntent.putExtra(SimpleReaderActivity.EXTRA_APDUS,
@@ -60,30 +59,4 @@
             getPassButton().setEnabled(true);
         }
     }
-
-    @Override
-    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-        super.onActivityResult(requestCode, resultCode, data);
-        if (!mCardEmulation.isDefaultServiceForCategory(
-                PaymentService1.COMPONENT, CardEmulation.CATEGORY_PAYMENT)) {
-            // Popup dialog-box, fail test
-            AlertDialog.Builder builder = new AlertDialog.Builder(this);
-            builder.setTitle("Test failed.");
-            builder.setMessage("PaymentService1 is not the default service according " +
-                    "to CardEmulation.getDefaultServiceForCategory(), verify the make " +
-                    "default implementation is correct.");
-            builder.setPositiveButton("OK", null);
-            builder.show();
-        } else {
-            NfcDialogs.createHceTapReaderDialog(this, null).show();
-        }
-    }
-
-    @Override
-    public void onClick(DialogInterface dialog, int which) {
-        Intent changeDefault = new Intent(CardEmulation.ACTION_CHANGE_DEFAULT);
-        changeDefault.putExtra(CardEmulation.EXTRA_CATEGORY, CardEmulation.CATEGORY_PAYMENT);
-        changeDefault.putExtra(CardEmulation.EXTRA_SERVICE_COMPONENT, PaymentService1.COMPONENT);
-        startActivityForResult(changeDefault, 0);
-    }
 }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ThroughputService.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ThroughputService.java
index 8f826ff..b74f0b7 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ThroughputService.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/ThroughputService.java
@@ -9,23 +9,23 @@
             new ComponentName("com.android.cts.verifier",
             ThroughputService.class.getName());
 
-    public static final String[] APDU_COMMAND_SEQUENCE = {
-        HceUtils.buildSelectApdu("F0010203040607FF"),
-        "80CA010000",
-        "80CA010100",
-        "80CA010200",
-        "80CA010300",
-        "80CA010400",
-        "80CA010500",
-        "80CA010600",
-        "80CA010700",
-        "80CA010800",
-        "80CA010900",
-        "80CA010A00",
-        "80CA010B00",
-        "80CA010C00",
-        "80CA010D00",
-        "80CA010E00",
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu("F0010203040607FF", true),
+        HceUtils.buildCommandApdu("80CA010100", true),
+        HceUtils.buildCommandApdu("80CA010200", true),
+        HceUtils.buildCommandApdu("80CA010300", true),
+        HceUtils.buildCommandApdu("80CA010400", true),
+        HceUtils.buildCommandApdu("80CA010500", true),
+        HceUtils.buildCommandApdu("80CA010600", true),
+        HceUtils.buildCommandApdu("80CA010700", true),
+        HceUtils.buildCommandApdu("80CA010800", true),
+        HceUtils.buildCommandApdu("80CA010900", true),
+        HceUtils.buildCommandApdu("80CA010A00", true),
+        HceUtils.buildCommandApdu("80CA010B00", true),
+        HceUtils.buildCommandApdu("80CA010C00", true),
+        HceUtils.buildCommandApdu("80CA010D00", true),
+        HceUtils.buildCommandApdu("80CA010E00", true),
+        HceUtils.buildCommandApdu("80CA010F00", true),
     };
 
     public static final String[] APDU_RESPOND_SEQUENCE = {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/TransportService1.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/TransportService1.java
index c751e76..c8d8460 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/TransportService1.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/TransportService1.java
@@ -7,9 +7,9 @@
             new ComponentName("com.android.cts.verifier",
             TransportService1.class.getName());
 
-    public static final String[] APDU_COMMAND_SEQUENCE = {
-        HceUtils.buildSelectApdu(HceUtils.TRANSPORT_AID),
-        "80CA01E000"
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu(HceUtils.TRANSPORT_AID, true),
+        HceUtils.buildCommandApdu("80CA01E000", true)
     };
 
     public static final String[] APDU_RESPOND_SEQUENCE = {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/TransportService2.java b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/TransportService2.java
index 0815b9c..322a076 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/TransportService2.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/TransportService2.java
@@ -7,9 +7,9 @@
             new ComponentName("com.android.cts.verifier",
             TransportService2.class.getName());
 
-    public static final String[] APDU_COMMAND_SEQUENCE = {
-        HceUtils.buildSelectApdu(HceUtils.TRANSPORT_AID),
-        "80CA01E100"
+    public static final CommandApdu[] APDU_COMMAND_SEQUENCE = {
+        HceUtils.buildSelectApdu(HceUtils.TRANSPORT_AID, true),
+        HceUtils.buildCommandApdu("80CA01E100", true)
     };
 
     public static final String[] APDU_RESPOND_SEQUENCE = {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nls/MockListener.java b/apps/CtsVerifier/src/com/android/cts/verifier/nls/MockListener.java
deleted file mode 100644
index 0b74fa3..0000000
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nls/MockListener.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.cts.verifier.nls;
-
-import android.app.Activity;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.os.Bundle;
-import android.service.notification.NotificationListenerService;
-import android.service.notification.StatusBarNotification;
-import android.util.Log;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class MockListener extends NotificationListenerService {
-    static final String TAG = "MockListener";
-
-    static final String SERVICE_CHECK = "android.service.notification.cts.SERVICE_CHECK";
-    static final String SERVICE_POSTED = "android.service.notification.cts.SERVICE_POSTED";
-    static final String SERVICE_PAYLOADS = "android.service.notification.cts.SERVICE_PAYLOADS";
-    static final String SERVICE_REMOVED = "android.service.notification.cts.SERVICE_REMOVED";
-    static final String SERVICE_RESET = "android.service.notification.cts.SERVICE_RESET";
-    static final String SERVICE_CLEAR_ONE = "android.service.notification.cts.SERVICE_CLEAR_ONE";
-    static final String SERVICE_CLEAR_ALL = "android.service.notification.cts.SERVICE_CLEAR_ALL";
-
-    static final String EXTRA_PAYLOAD = "TAGS";
-    static final String EXTRA_TAG = "TAG";
-    static final String EXTRA_CODE = "CODE";
-
-    static final int RESULT_TIMEOUT = Activity.RESULT_FIRST_USER;
-    static final int RESULT_NO_SERVER = Activity.RESULT_FIRST_USER + 1;
-
-    public static final String JSON_FLAGS = "flag";
-    public static final String JSON_ICON = "icon";
-    public static final String JSON_ID = "id";
-    public static final String JSON_PACKAGE = "pkg";
-    public static final String JSON_WHEN = "when";
-    public static final String JSON_TAG = "tag";
-
-    private ArrayList<String> mPosted = new ArrayList<String>();
-    private ArrayList<String> mPayloads = new ArrayList<String>();
-    private ArrayList<String> mRemoved = new ArrayList<String>();
-    private BroadcastReceiver mReceiver;
-
-    @Override
-    public void onCreate() {
-        super.onCreate();
-        Log.d(TAG, "created");
-
-        mPosted = new ArrayList<String>();
-        mRemoved = new ArrayList<String>();
-
-        mReceiver = new BroadcastReceiver() {
-            @Override
-            public void onReceive(Context context, Intent intent) {
-                String action = intent.getAction();
-                if (SERVICE_CHECK.equals(action)) {
-                    Log.d(TAG, "SERVICE_CHECK");
-                    setResultCode(Activity.RESULT_OK);
-                } else if (SERVICE_POSTED.equals(action)) {
-                    Log.d(TAG, "SERVICE_POSTED");
-                    Bundle bundle = new Bundle();
-                    bundle.putStringArrayList(EXTRA_PAYLOAD, mPosted);
-                    setResultExtras(bundle);
-                    setResultCode(Activity.RESULT_OK);
-                } else if (SERVICE_PAYLOADS.equals(action)) {
-                    Log.d(TAG, "SERVICE_PAYLOADS");
-                    Bundle bundle = new Bundle();
-                    bundle.putStringArrayList(EXTRA_PAYLOAD, mPayloads);
-                    setResultExtras(bundle);
-                    setResultCode(Activity.RESULT_OK);
-                } else if (SERVICE_REMOVED.equals(action)) {
-                    Log.d(TAG, "SERVICE_REMOVED");
-                    Bundle bundle = new Bundle();
-                    bundle.putStringArrayList(EXTRA_PAYLOAD, mRemoved);
-                    setResultExtras(bundle);
-                    setResultCode(Activity.RESULT_OK);
-                } else if (SERVICE_CLEAR_ONE.equals(action)) {
-                    Log.d(TAG, "SERVICE_CLEAR_ONE");
-                    MockListener.this.cancelNotification(
-                            context.getApplicationInfo().packageName,
-                            intent.getStringExtra(EXTRA_TAG),
-                            intent.getIntExtra(EXTRA_CODE, 0));
-                } else if (SERVICE_CLEAR_ALL.equals(action)) {
-                    Log.d(TAG, "SERVICE_CLEAR_ALL");
-                    MockListener.this.cancelAllNotifications();
-                } else if (SERVICE_RESET.equals(action)) {
-                    Log.d(TAG, "SERVICE_RESET");
-                    resetData();
-                } else {
-                    Log.w(TAG, "unknown action");
-                    setResultCode(Activity.RESULT_CANCELED);
-                }
-            }
-        };
-        IntentFilter filter = new IntentFilter();
-        filter.addAction(SERVICE_CHECK);
-        filter.addAction(SERVICE_POSTED);
-        filter.addAction(SERVICE_PAYLOADS);
-        filter.addAction(SERVICE_REMOVED);
-        filter.addAction(SERVICE_CLEAR_ONE);
-        filter.addAction(SERVICE_CLEAR_ALL);
-        filter.addAction(SERVICE_RESET);
-        registerReceiver(mReceiver, filter);
-    }
-
-    @Override
-    public void onDestroy() {
-        super.onDestroy();
-        unregisterReceiver(mReceiver);
-        mReceiver = null;
-        Log.d(TAG, "destroyed");
-    }
-
-    public void resetData() {
-        mPosted.clear();
-        mPayloads.clear();
-        mRemoved.clear();
-    }
-
-    @Override
-    public void onNotificationPosted(StatusBarNotification sbn) {
-        Log.d(TAG, "posted: " + sbn.getTag());
-        mPosted.add(sbn.getTag());
-        JSONObject payload = new JSONObject();
-        try {
-            payload.put(JSON_TAG, sbn.getTag());
-            payload.put(JSON_ID, sbn.getId());
-            payload.put(JSON_PACKAGE, sbn.getPackageName());
-            payload.put(JSON_WHEN, sbn.getNotification().when);
-            payload.put(JSON_ICON, sbn.getNotification().icon);
-            payload.put(JSON_FLAGS, sbn.getNotification().flags);
-            mPayloads.add(payload.toString());
-        } catch (JSONException e) {
-            Log.e(TAG, "failed to pack up notification payload", e);
-        }
-    }
-
-    @Override
-    public void onNotificationRemoved(StatusBarNotification sbn) {
-        Log.d(TAG, "removed: " + sbn.getTag());
-        mRemoved.add(sbn.getTag());
-    }
-
-    public static void resetListenerData(Context context) {
-        sendCommand(context, SERVICE_RESET, null, 0);
-    }
-
-    public static void probeListenerStatus(Context context, IntegerResultCatcher catcher) {
-        requestIntegerResult(context, SERVICE_CHECK, catcher);
-    }
-
-    public static void probeListenerPosted(Context context, StringListResultCatcher catcher) {
-        requestStringListResult(context, SERVICE_POSTED, catcher);
-    }
-
-    public static void probeListenerPayloads(Context context, StringListResultCatcher catcher) {
-        requestStringListResult(context, SERVICE_PAYLOADS, catcher);
-    }
-
-    public static void probeListenerRemoved(Context context, StringListResultCatcher catcher) {
-        requestStringListResult(context, SERVICE_REMOVED, catcher);
-    }
-
-    public static void clearOne(Context context, String tag, int code) {
-        sendCommand(context, SERVICE_CLEAR_ONE, tag, code);
-    }
-
-    public static void clearAll(Context context) {
-        sendCommand(context, SERVICE_CLEAR_ALL, null, 0);
-    }
-
-    private static void sendCommand(Context context, String action, String tag, int code) {
-        Intent broadcast = new Intent(action);
-        if (tag != null) {
-            broadcast.putExtra(EXTRA_TAG, tag);
-            broadcast.putExtra(EXTRA_CODE, code);
-        }
-        context.sendBroadcast(broadcast);
-    }
-
-    public abstract static class IntegerResultCatcher extends BroadcastReceiver {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            accept(Integer.valueOf(getResultCode()));
-        }
-
-        abstract public void accept(int result);
-    }
-
-    private static void requestIntegerResult(Context context, String action,
-            IntegerResultCatcher catcher) {
-        Intent broadcast = new Intent(action);
-        context.sendOrderedBroadcast(broadcast, null, catcher, null, RESULT_NO_SERVER, null, null);
-    }
-
-    public abstract static class StringListResultCatcher extends BroadcastReceiver {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            accept(getResultExtras(true).getStringArrayList(EXTRA_PAYLOAD));
-        }
-
-        abstract public void accept(List<String> result);
-    }
-
-    private static void requestStringListResult(Context context, String action,
-            StringListResultCatcher catcher) {
-        Intent broadcast = new Intent(action);
-        context.sendOrderedBroadcast(broadcast, null, catcher, null, RESULT_NO_SERVER, null, null);
-    }
-}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/MockListener.java b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/MockListener.java
new file mode 100644
index 0000000..3d0e0d7
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/MockListener.java
@@ -0,0 +1,322 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.cts.verifier.notifications;
+
+import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Bundle;
+import android.service.notification.NotificationListenerService;
+import android.service.notification.StatusBarNotification;
+import android.util.ArrayMap;
+import android.util.Log;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class MockListener extends NotificationListenerService {
+    static final String TAG = "MockListener";
+
+    static final String SERVICE_BASE = "android.service.notification.cts.";
+    static final String SERVICE_CHECK = SERVICE_BASE + "SERVICE_CHECK";
+    static final String SERVICE_POSTED = SERVICE_BASE + "SERVICE_POSTED";
+    static final String SERVICE_PAYLOADS = SERVICE_BASE + "SERVICE_PAYLOADS";
+    static final String SERVICE_REMOVED = SERVICE_BASE + "SERVICE_REMOVED";
+    static final String SERVICE_RESET = SERVICE_BASE + "SERVICE_RESET";
+    static final String SERVICE_CLEAR_ONE = SERVICE_BASE + "SERVICE_CLEAR_ONE";
+    static final String SERVICE_CLEAR_ALL = SERVICE_BASE + "SERVICE_CLEAR_ALL";
+    public static final String SERVICE_ORDER = SERVICE_BASE + "SERVICE_ORDER";
+    public static final String SERVICE_DND = SERVICE_BASE + "SERVICE_DND";
+
+    static final String EXTRA_PAYLOAD = "PAYLOAD";
+    static final String EXTRA_INT = "INT";
+    static final String EXTRA_TAG = "TAG";
+    static final String EXTRA_CODE = "CODE";
+
+    static final int RESULT_TIMEOUT = Activity.RESULT_FIRST_USER;
+    static final int RESULT_NO_SERVER = Activity.RESULT_FIRST_USER + 1;
+
+    public static final String JSON_FLAGS = "flag";
+    public static final String JSON_ICON = "icon";
+    public static final String JSON_ID = "id";
+    public static final String JSON_PACKAGE = "pkg";
+    public static final String JSON_WHEN = "when";
+    public static final String JSON_TAG = "tag";
+    public static final String JSON_RANK = "rank";
+    public static final String JSON_AMBIENT = "ambient";
+    public static final String JSON_MATCHES_ZEN_FILTER = "matches_zen_filter";
+
+    private ArrayList<String> mPosted = new ArrayList<String>();
+    private ArrayMap<String, JSONObject> mNotifications = new ArrayMap<>();
+    private ArrayList<String> mRemoved = new ArrayList<String>();
+    private ArrayList<String> mOrder = new ArrayList<>();
+    private BroadcastReceiver mReceiver;
+    private int mDND = -1;
+
+    @Override
+    public void onCreate() {
+        super.onCreate();
+        Log.d(TAG, "created");
+
+        mPosted = new ArrayList<String>();
+        mRemoved = new ArrayList<String>();
+
+        mReceiver = new BroadcastReceiver() {
+            @Override
+            public void onReceive(Context context, Intent intent) {
+                String action = intent.getAction();
+                if (SERVICE_CHECK.equals(action)) {
+                    Log.d(TAG, "SERVICE_CHECK");
+                    setResultCode(Activity.RESULT_OK);
+                } else if (SERVICE_POSTED.equals(action)) {
+                    Log.d(TAG, "SERVICE_POSTED");
+                    Bundle bundle = new Bundle();
+                    bundle.putStringArrayList(EXTRA_PAYLOAD, mPosted);
+                    setResultExtras(bundle);
+                    setResultCode(Activity.RESULT_OK);
+                } else if (SERVICE_DND.equals(action)) {
+                    Log.d(TAG, "SERVICE_DND");
+                    Bundle bundle = new Bundle();
+                    bundle.putInt(EXTRA_INT, mDND);
+                    setResultExtras(bundle);
+                    setResultCode(Activity.RESULT_OK);
+                } else if (SERVICE_ORDER.equals(action)) {
+                    Log.d(TAG, "SERVICE_ORDER");
+                    Bundle bundle = new Bundle();
+                    bundle.putStringArrayList(EXTRA_PAYLOAD, mOrder);
+                    setResultExtras(bundle);
+                    setResultCode(Activity.RESULT_OK);
+                } else if (SERVICE_PAYLOADS.equals(action)) {
+                    Log.d(TAG, "SERVICE_PAYLOADS");
+                    Bundle bundle = new Bundle();
+                    ArrayList<String> payloadData = new ArrayList<>(mNotifications.size());
+                    for (JSONObject payload: mNotifications.values()) {
+                        payloadData.add(payload.toString());
+                    }
+                    bundle.putStringArrayList(EXTRA_PAYLOAD, payloadData);
+                    setResultExtras(bundle);
+                    setResultCode(Activity.RESULT_OK);
+                } else if (SERVICE_REMOVED.equals(action)) {
+                    Log.d(TAG, "SERVICE_REMOVED");
+                    Bundle bundle = new Bundle();
+                    bundle.putStringArrayList(EXTRA_PAYLOAD, mRemoved);
+                    setResultExtras(bundle);
+                    setResultCode(Activity.RESULT_OK);
+                } else if (SERVICE_CLEAR_ONE.equals(action)) {
+                    Log.d(TAG, "SERVICE_CLEAR_ONE");
+                    MockListener.this.cancelNotification(
+                            context.getApplicationInfo().packageName,
+                            intent.getStringExtra(EXTRA_TAG),
+                            intent.getIntExtra(EXTRA_CODE, 0));
+                } else if (SERVICE_CLEAR_ALL.equals(action)) {
+                    Log.d(TAG, "SERVICE_CLEAR_ALL");
+                    MockListener.this.cancelAllNotifications();
+                } else if (SERVICE_RESET.equals(action)) {
+                    Log.d(TAG, "SERVICE_RESET");
+                    resetData();
+                } else {
+                    Log.w(TAG, "unknown action");
+                    setResultCode(Activity.RESULT_CANCELED);
+                }
+            }
+        };
+        IntentFilter filter = new IntentFilter();
+        filter.addAction(SERVICE_CHECK);
+        filter.addAction(SERVICE_DND);
+        filter.addAction(SERVICE_POSTED);
+        filter.addAction(SERVICE_ORDER);
+        filter.addAction(SERVICE_PAYLOADS);
+        filter.addAction(SERVICE_REMOVED);
+        filter.addAction(SERVICE_CLEAR_ONE);
+        filter.addAction(SERVICE_CLEAR_ALL);
+        filter.addAction(SERVICE_RESET);
+        registerReceiver(mReceiver, filter);
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        unregisterReceiver(mReceiver);
+        mReceiver = null;
+        Log.d(TAG, "destroyed");
+    }
+
+    @Override
+    public void onListenerConnected() {
+        super.onListenerConnected();
+        mDND = getCurrentInterruptionFilter();
+        Log.d(TAG, "initial value of CurrentInterruptionFilter is " + mDND);
+    }
+
+    @Override
+    public void onInterruptionFilterChanged(int interruptionFilter) {
+        super.onInterruptionFilterChanged(interruptionFilter);
+        mDND = interruptionFilter;
+        Log.d(TAG, "value of CurrentInterruptionFilter changed to " + mDND);
+    }
+
+    public void resetData() {
+        mPosted.clear();
+        mNotifications.clear();
+        mRemoved.clear();
+        mOrder.clear();
+    }
+
+    @Override
+    public void onNotificationRankingUpdate(RankingMap rankingMap) {
+        String[] orderedKeys = rankingMap.getOrderedKeys();
+        mOrder.clear();
+        Ranking rank = new Ranking();
+        for( int i = 0; i < orderedKeys.length; i++) {
+            String key = orderedKeys[i];
+            mOrder.add(key);
+            rankingMap.getRanking(key, rank);
+            JSONObject note = mNotifications.get(key);
+            if (note != null) {
+                try {
+                    note.put(JSON_RANK, rank.getRank());
+                    note.put(JSON_AMBIENT, rank.isAmbient());
+                    note.put(JSON_MATCHES_ZEN_FILTER, rank.matchesInterruptionFilter());
+                } catch (JSONException e) {
+                    Log.e(TAG, "failed to pack up notification payload", e);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void onNotificationPosted(StatusBarNotification sbn, RankingMap rankingMap) {
+        Log.d(TAG, "posted: " + sbn.getTag());
+        mPosted.add(sbn.getTag());
+        JSONObject notification = new JSONObject();
+        try {
+            notification.put(JSON_TAG, sbn.getTag());
+            notification.put(JSON_ID, sbn.getId());
+            notification.put(JSON_PACKAGE, sbn.getPackageName());
+            notification.put(JSON_WHEN, sbn.getNotification().when);
+            notification.put(JSON_ICON, sbn.getNotification().icon);
+            notification.put(JSON_FLAGS, sbn.getNotification().flags);
+            mNotifications.put(sbn.getKey(), notification);
+        } catch (JSONException e) {
+            Log.e(TAG, "failed to pack up notification payload", e);
+        }
+        onNotificationRankingUpdate(rankingMap);
+    }
+
+    @Override
+    public void onNotificationRemoved(StatusBarNotification sbn, RankingMap rankingMap) {
+        Log.d(TAG, "removed: " + sbn.getTag());
+        mRemoved.add(sbn.getTag());
+        mNotifications.remove(sbn.getKey());
+        onNotificationRankingUpdate(rankingMap);
+    }
+
+    public static void resetListenerData(Context context) {
+        sendCommand(context, SERVICE_RESET, null, 0);
+    }
+
+    public static void probeListenerStatus(Context context, StatusCatcher catcher) {
+        requestStatus(context, SERVICE_CHECK, catcher);
+    }
+
+    public static void probeFilter(Context context, IntegerResultCatcher catcher) {
+        requestIntegerResult(context, SERVICE_DND, catcher);
+    }
+
+    public static void probeListenerPosted(Context context, StringListResultCatcher catcher) {
+        requestStringListResult(context, SERVICE_POSTED, catcher);
+    }
+
+    public static void probeListenerOrder(Context context, StringListResultCatcher catcher) {
+        requestStringListResult(context, SERVICE_ORDER, catcher);
+    }
+
+    public static void probeListenerPayloads(Context context, StringListResultCatcher catcher) {
+        requestStringListResult(context, SERVICE_PAYLOADS, catcher);
+    }
+
+    public static void probeListenerRemoved(Context context, StringListResultCatcher catcher) {
+        requestStringListResult(context, SERVICE_REMOVED, catcher);
+    }
+
+    public static void clearOne(Context context, String tag, int code) {
+        sendCommand(context, SERVICE_CLEAR_ONE, tag, code);
+    }
+
+    public static void clearAll(Context context) {
+        sendCommand(context, SERVICE_CLEAR_ALL, null, 0);
+    }
+
+    private static void sendCommand(Context context, String action, String tag, int code) {
+        Intent broadcast = new Intent(action);
+        if (tag != null) {
+            broadcast.putExtra(EXTRA_TAG, tag);
+            broadcast.putExtra(EXTRA_CODE, code);
+        }
+        context.sendBroadcast(broadcast);
+    }
+
+    public abstract static class StatusCatcher extends BroadcastReceiver {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            accept(Integer.valueOf(getResultCode()));
+        }
+
+        abstract public void accept(int result);
+    }
+
+    private static void requestStatus(Context context, String action,
+            StatusCatcher catcher) {
+        Intent broadcast = new Intent(action);
+        context.sendOrderedBroadcast(broadcast, null, catcher, null, RESULT_NO_SERVER, null, null);
+    }
+
+    public abstract static class IntegerResultCatcher extends BroadcastReceiver {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            accept(getResultExtras(true).getInt(EXTRA_INT, -1));
+        }
+
+        abstract public void accept(int result);
+    }
+
+    private static void requestIntegerResult(Context context, String action,
+            IntegerResultCatcher catcher) {
+        Intent broadcast = new Intent(action);
+        context.sendOrderedBroadcast(broadcast, null, catcher, null, RESULT_NO_SERVER, null, null);
+    }
+
+    public abstract static class StringListResultCatcher extends BroadcastReceiver {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            accept(getResultExtras(true).getStringArrayList(EXTRA_PAYLOAD));
+        }
+
+        abstract public void accept(List<String> result);
+    }
+
+    private static void requestStringListResult(Context context, String action,
+            StringListResultCatcher catcher) {
+        Intent broadcast = new Intent(action);
+        context.sendOrderedBroadcast(broadcast, null, catcher, null, RESULT_NO_SERVER, null, null);
+    }
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationAttentionManagementVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationAttentionManagementVerifierActivity.java
new file mode 100644
index 0000000..e355b07
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationAttentionManagementVerifierActivity.java
@@ -0,0 +1,826 @@
+/*
+ * 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.notifications;
+
+import static com.android.cts.verifier.notifications.MockListener.JSON_AMBIENT;
+import static com.android.cts.verifier.notifications.MockListener.JSON_MATCHES_ZEN_FILTER;
+import static com.android.cts.verifier.notifications.MockListener.JSON_TAG;
+
+import android.app.Activity;
+import android.app.Notification;
+import android.content.ContentProviderOperation;
+import android.content.Intent;
+import android.content.OperationApplicationException;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.RemoteException;
+import android.provider.ContactsContract;
+import android.provider.ContactsContract.CommonDataKinds.Email;
+import android.provider.ContactsContract.CommonDataKinds.Phone;
+import android.provider.ContactsContract.CommonDataKinds.StructuredName;
+import android.provider.Settings.Secure;
+import android.service.notification.NotificationListenerService;
+import android.util.Log;
+import com.android.cts.verifier.R;
+import com.android.cts.verifier.nfc.TagVerifierActivity;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class NotificationAttentionManagementVerifierActivity
+        extends NotificationListenerVerifierActivity {
+    private static final String TAG = TagVerifierActivity.class.getSimpleName();
+    private static final String ALICE = "Alice";
+    private static final String ALICE_PHONE = "+16175551212";
+    private static final String ALICE_EMAIL = "alice@_foo._bar";
+    private static final String BOB = "Bob";
+    private static final String BOB_PHONE = "+16505551212";;
+    private static final String BOB_EMAIL = "bob@_foo._bar";
+    private static final String CHARLIE = "Charlie";
+    private static final String CHARLIE_PHONE = "+13305551212";
+    private static final String CHARLIE_EMAIL = "charlie@_foo._bar";
+    private static final int MODE_NONE = 0;
+    private static final int MODE_URI = 1;
+    private static final int MODE_PHONE = 2;
+    private static final int MODE_EMAIL = 3;
+    private static final int DELAYED_SETUP = CLEARED;
+
+    private Uri mAliceUri;
+    private Uri mBobUri;
+    private Uri mCharlieUri;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState, R.layout.nls_main);
+        setInfoResources(R.string.attention_test, R.string.attention_info, -1);
+    }
+
+    // Test Setup
+
+    @Override
+    protected void createTestItems() {
+        createNlsSettingsItem(R.string.nls_enable_service);
+        createAutoItem(R.string.nls_service_started);
+        createAutoItem(R.string.attention_create_contacts);
+        createRetryItem(R.string.attention_filter_none);
+        createRetryItem(R.string.attention_filter_all);
+        createAutoItem(R.string.attention_none_are_filtered);
+        createAutoItem(R.string.attention_default_order);
+        createAutoItem(R.string.attention_interruption_order);
+        createAutoItem(R.string.attention_priority_order);
+        createAutoItem(R.string.attention_ambient_bit);
+        createAutoItem(R.string.attention_lookup_order);
+        createAutoItem(R.string.attention_email_order);
+        createAutoItem(R.string.attention_phone_order);
+        createRetryItem(R.string.attention_filter_priority);
+        createAutoItem(R.string.attention_some_are_filtered);
+        createAutoItem(R.string.attention_delete_contacts);
+    }
+
+    // Test management
+
+    @Override
+    protected void updateStateMachine() {
+        switch (mState) {
+            case 0:
+                testIsEnabled(mState);
+                break;
+            case 1:
+                testIsStarted(mState);
+                break;
+            case 2:
+                testInsertContacts(mState);
+                break;
+            case 3:
+                testModeNone(mState);
+                break;
+            case 4:
+                testModeAll(mState);
+                break;
+            case 5:
+                testALLInterceptsNothing(mState);
+                break;
+            case 6:
+                testDefaultOrder(mState);
+                break;
+            case 7:
+                testInterruptionOrder(mState);
+                break;
+            case 8:
+                testPrioritytOrder(mState);
+                break;
+            case 9:
+                testAmbientBits(mState);
+                break;
+            case 10:
+                testLookupUriOrder(mState);
+                break;
+            case 11:
+                testEmailOrder(mState);
+                break;
+            case 12:
+                testPhoneOrder(mState);
+                break;
+            case 13:
+                testModePriority(mState);
+                break;
+            case 14:
+                testPriorityInterceptsSome(mState);
+                break;
+            case 15:
+                testDeleteContacts(mState);
+                break;
+            case 16:
+                getPassButton().setEnabled(true);
+                mNm.cancelAll();
+                break;
+        }
+    }
+
+    // usePriorities true: B, C, A
+    // usePriorities false:
+    //   MODE_NONE: C, B, A
+    //   otherwise: A, B ,C
+    private void sendNotifications(int annotationMode, boolean usePriorities, boolean noisy) {
+        // TODO(cwren) Fixes flakey tests due to bug 17644321. Remove this line when it is fixed.
+        int baseId = NOTIFICATION_ID + (noisy ? 3 : 0);
+
+        // C, B, A when sorted by time.  Times must be in the past.
+        long whenA = System.currentTimeMillis() - 4000000L;
+        long whenB = System.currentTimeMillis() - 2000000L;
+        long whenC = System.currentTimeMillis() - 1000000L;
+
+        // B, C, A when sorted by priorities
+        int priorityA = usePriorities ? Notification.PRIORITY_MIN : Notification.PRIORITY_DEFAULT;
+        int priorityB = usePriorities ? Notification.PRIORITY_MAX : Notification.PRIORITY_DEFAULT;
+        int priorityC = usePriorities ? Notification.PRIORITY_LOW : Notification.PRIORITY_DEFAULT;
+
+        Notification.Builder alice = new Notification.Builder(mContext)
+                .setContentTitle(ALICE)
+                .setContentText(ALICE)
+                .setSmallIcon(R.drawable.fs_good)
+                .setPriority(priorityA)
+                .setCategory(Notification.CATEGORY_MESSAGE)
+                .setWhen(whenA);
+        alice.setDefaults(noisy ? Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE : 0);
+        addPerson(annotationMode, alice, mAliceUri, ALICE_PHONE, ALICE_EMAIL);
+        mNm.notify(ALICE, baseId + 1, alice.build());
+
+        Notification.Builder bob = new Notification.Builder(mContext)
+                .setContentTitle(BOB)
+                .setContentText(BOB)
+                .setSmallIcon(R.drawable.fs_warning)
+                .setPriority(priorityB)
+                .setCategory(Notification.CATEGORY_MESSAGE)
+                .setWhen(whenB);
+        addPerson(annotationMode, bob, mBobUri, BOB_PHONE, BOB_EMAIL);
+        mNm.notify(BOB, baseId + 2, bob.build());
+
+        Notification.Builder charlie = new Notification.Builder(mContext)
+                .setContentTitle(CHARLIE)
+                .setContentText(CHARLIE)
+                .setSmallIcon(R.drawable.fs_error)
+                .setPriority(priorityC)
+                .setCategory(Notification.CATEGORY_MESSAGE)
+                .setWhen(whenC);
+        addPerson(annotationMode, charlie, mCharlieUri, CHARLIE_PHONE, CHARLIE_EMAIL);
+        mNm.notify(CHARLIE, baseId + 3, charlie.build());
+    }
+
+    private void addPerson(int mode, Notification.Builder note,
+            Uri uri, String phone, String email) {
+        if (mode == MODE_URI && uri != null) {
+            note.addPerson(uri.toString());
+        } else if (mode == MODE_PHONE) {
+            note.addPerson(Uri.fromParts("tel", phone, null).toString());
+        } else if (mode == MODE_EMAIL) {
+            note.addPerson(Uri.fromParts("mailto", email, null).toString());
+        }
+    }
+
+    // Tests
+
+    private void testIsEnabled(int i) {
+        // no setup required
+        Intent settings = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
+        if (settings.resolveActivity(mPackageManager) == null) {
+            logWithStack("failed testIsEnabled: no settings activity");
+            mStatus[i] = FAIL;
+        } else {
+            // TODO: find out why Secure.ENABLED_NOTIFICATION_LISTENERS is hidden
+            String listeners = Secure.getString(getContentResolver(),
+                    "enabled_notification_listeners");
+            if (listeners != null && listeners.contains(LISTENER_PATH)) {
+                mStatus[i] = PASS;
+            } else {
+                mStatus[i] = WAIT_FOR_USER;
+            }
+        }
+        next();
+    }
+
+    private void testIsStarted(final int i) {
+        if (mStatus[i] == SETUP) {
+            mStatus[i] = READY;
+            // wait for the service to start
+            delay();
+        } else {
+            MockListener.probeListenerStatus(mContext,
+                    new MockListener.StatusCatcher() {
+                        @Override
+                        public void accept(int result) {
+                            if (result == Activity.RESULT_OK) {
+                                mStatus[i] = PASS;
+                            } else {
+                                logWithStack("failed testIsStarted: " + result);
+                                mStatus[i] = FAIL;
+                            }
+                            next();
+                        }
+                    });
+        }
+    }
+
+    private void testModeAll(final int i) {
+        if (mStatus[i] == READY || mStatus[i] == SETUP) {
+            MockListener.probeFilter(mContext,
+                    new MockListener.IntegerResultCatcher() {
+                        @Override
+                        public void accept(int mode) {
+                            if (mode == NotificationListenerService.INTERRUPTION_FILTER_ALL) {
+                                mStatus[i] = PASS;
+                            } else {
+                                logWithStack("waiting testModeAll: " + mode);
+                                mStatus[i] = WAIT_FOR_USER;
+                            }
+                            next();
+                        }
+                    });
+        }
+    }
+
+    private void testModePriority(final int i) {
+        if (mStatus[i] == READY || mStatus[i] == SETUP) {
+            MockListener.probeFilter(mContext,
+                    new MockListener.IntegerResultCatcher() {
+                        @Override
+                        public void accept(int mode) {
+                            if (mode == NotificationListenerService.INTERRUPTION_FILTER_PRIORITY) {
+                                mStatus[i] = PASS;
+                            } else {
+                                logWithStack("waiting testModePriority: " + mode);
+                                mStatus[i] = WAIT_FOR_USER;
+                            }
+                            next();
+                        }
+                    });
+        }
+    }
+
+    private void testModeNone(final int i) {
+        if (mStatus[i] == READY || mStatus[i] == SETUP) {
+            MockListener.probeFilter(mContext,
+                    new MockListener.IntegerResultCatcher() {
+                        @Override
+                        public void accept(int mode) {
+                            if (mode == NotificationListenerService.INTERRUPTION_FILTER_NONE) {
+                                mStatus[i] = PASS;
+                            } else {
+                                logWithStack("waiting testModeNone: " + mode);
+                                mStatus[i] = WAIT_FOR_USER;
+                            }
+                            next();
+                        }
+                    });
+        }
+    }
+
+
+    private void insertSingleContact(String name, String phone, String email, boolean starred) {
+        final ArrayList<ContentProviderOperation> operationList =
+                new ArrayList<ContentProviderOperation>();
+        ContentProviderOperation.Builder builder =
+                ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI);
+        builder.withValue(ContactsContract.RawContacts.STARRED, starred ? 1 : 0);
+        operationList.add(builder.build());
+
+        builder = ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI);
+        builder.withValueBackReference(StructuredName.RAW_CONTACT_ID, 0);
+        builder.withValue(ContactsContract.Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);
+        builder.withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, name);
+        operationList.add(builder.build());
+
+        if (phone != null) {
+            builder = ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI);
+            builder.withValueBackReference(Phone.RAW_CONTACT_ID, 0);
+            builder.withValue(ContactsContract.Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);
+            builder.withValue(Phone.TYPE, Phone.TYPE_MOBILE);
+            builder.withValue(Phone.NUMBER, phone);
+            builder.withValue(ContactsContract.Data.IS_PRIMARY, 1);
+            operationList.add(builder.build());
+        }
+        if (email != null) {
+            builder = ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI);
+            builder.withValueBackReference(Email.RAW_CONTACT_ID, 0);
+            builder.withValue(ContactsContract.Data.MIMETYPE, Email.CONTENT_ITEM_TYPE);
+            builder.withValue(Email.TYPE, Email.TYPE_HOME);
+            builder.withValue(Email.DATA, email);
+            operationList.add(builder.build());
+        }
+
+        try {
+            mContext.getContentResolver().applyBatch(ContactsContract.AUTHORITY, operationList);
+        } catch (RemoteException e) {
+            Log.e(TAG, String.format("%s: %s", e.toString(), e.getMessage()));
+        } catch (OperationApplicationException e) {
+            Log.e(TAG, String.format("%s: %s", e.toString(), e.getMessage()));
+        }
+    }
+
+    private Uri lookupContact(String phone) {
+        Cursor c = null;
+        try {
+            Uri phoneUri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI,
+                    Uri.encode(phone));
+            String[] projection = new String[] { ContactsContract.Contacts._ID,
+                    ContactsContract.Contacts.LOOKUP_KEY };
+            c = mContext.getContentResolver().query(phoneUri, projection, null, null, null);
+            if (c != null && c.getCount() > 0) {
+                c.moveToFirst();
+                int lookupIdx = c.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY);
+                int idIdx = c.getColumnIndex(ContactsContract.Contacts._ID);
+                String lookupKey = c.getString(lookupIdx);
+                long contactId = c.getLong(idIdx);
+                return ContactsContract.Contacts.getLookupUri(contactId, lookupKey);
+            }
+        } catch (Throwable t) {
+            Log.w(TAG, "Problem getting content resolver or performing contacts query.", t);
+        } finally {
+            if (c != null) {
+                c.close();
+            }
+        }
+        return null;
+    }
+
+    private void testInsertContacts(final int i) {
+        if (mStatus[i] == SETUP) {
+            insertSingleContact(ALICE, ALICE_PHONE, ALICE_EMAIL, true);
+            insertSingleContact(BOB, BOB_PHONE, BOB_EMAIL, false);
+            // charlie is not in contacts
+            mStatus[i] = READY;
+            // wait for insertions to move through the system
+            delay();
+        } else {
+            mAliceUri = lookupContact(ALICE_PHONE);
+            mBobUri = lookupContact(BOB_PHONE);
+            mCharlieUri = lookupContact(CHARLIE_PHONE);
+
+            mStatus[i] = PASS;
+            if (mAliceUri == null) { mStatus[i] = FAIL; }
+            if (mBobUri == null) { mStatus[i] = FAIL; }
+            if (mCharlieUri != null) { mStatus[i] = FAIL; }
+            next();
+        }
+    }
+
+    // ordered by time: C, B, A
+    private void testDefaultOrder(final int i) {
+        if (mStatus[i] == SETUP) {
+            mNm.cancelAll();
+            MockListener.resetListenerData(this);
+            mStatus[i] = CLEARED;
+            // wait for intent to move through the system
+            delay();
+        } else if (mStatus[i] == CLEARED) {
+            sendNotifications(MODE_NONE, false, false);
+            mStatus[i] = READY;
+            // wait for notifications to move through the system
+            delay();
+        } else {
+            MockListener.probeListenerOrder(mContext,
+                    new MockListener.StringListResultCatcher() {
+                        @Override
+                        public void accept(List<String> orderedKeys) {
+                            int rankA = findTagInKeys(ALICE, orderedKeys);
+                            int rankB = findTagInKeys(BOB, orderedKeys);
+                            int rankC = findTagInKeys(CHARLIE, orderedKeys);
+                            if (rankC < rankB && rankB < rankA) {
+                                mStatus[i] = PASS;
+                            } else {
+                                logWithStack("failed testDefaultOrder : "
+                                        + rankA + ", " + rankB + ", " + rankC);
+                                mStatus[i] = FAIL;
+                            }
+                            next();
+                        }
+                    });
+        }
+    }
+
+    // ordered by priority: B, C, A
+    private void testPrioritytOrder(final int i) {
+        if (mStatus[i] == SETUP) {
+            mNm.cancelAll();
+            MockListener.resetListenerData(this);
+            mStatus[i] = CLEARED;
+            // wait for intent to move through the system
+            delay();
+        } else if (mStatus[i] == CLEARED) {
+            sendNotifications(MODE_PHONE, true, false);
+            mStatus[i] = READY;
+            // wait for notifications to move through the system
+            delay();
+        } else {
+            MockListener.probeListenerOrder(mContext,
+                    new MockListener.StringListResultCatcher() {
+                        @Override
+                        public void accept(List<String> orderedKeys) {
+                            int rankA = findTagInKeys(ALICE, orderedKeys);
+                            int rankB = findTagInKeys(BOB, orderedKeys);
+                            int rankC = findTagInKeys(CHARLIE, orderedKeys);
+                            if (rankB < rankC && rankC < rankA) {
+                                mStatus[i] = PASS;
+                            } else {
+                                logWithStack("failed testPrioritytOrder : "
+                                        + rankA + ", " + rankB + ", " + rankC);
+                                mStatus[i] = FAIL;
+                            }
+                            next();
+                        }
+                    });
+        }
+    }
+
+    // B & C above the fold, A below
+    private void testAmbientBits(final int i) {
+        if (mStatus[i] == SETUP) {
+            mNm.cancelAll();
+            MockListener.resetListenerData(this);
+            mStatus[i] = CLEARED;
+            // wait for intent to move through the system
+            delay();
+        } else if (mStatus[i] == CLEARED) {
+            sendNotifications(MODE_PHONE, true, false);
+            mStatus[i] = READY;
+            // wait for notifications to move through the system
+            delay();
+        } else {
+            MockListener.probeListenerPayloads(mContext,
+                    new MockListener.StringListResultCatcher() {
+                        @Override
+                        public void accept(List<String> result) {
+                            boolean pass = false;
+                            Set<String> found = new HashSet<String>();
+                            if (result != null && result.size() > 0) {
+                                pass = true;
+                                for (String payloadData : result) {
+                                    try {
+                                        JSONObject payload = new JSONObject(payloadData);
+                                        String tag = payload.getString(JSON_TAG);
+                                        if (found.contains(tag)) {
+                                            // multiple entries for same notification!
+                                            pass = false;
+                                        } else if (ALICE.equals(tag)) {
+                                            found.add(ALICE);
+                                            pass &= payload.getBoolean(JSON_AMBIENT);
+                                        } else if (BOB.equals(tag)) {
+                                            found.add(BOB);
+                                            pass &= !payload.getBoolean(JSON_AMBIENT);
+                                        } else if (CHARLIE.equals(tag)) {
+                                            found.add(CHARLIE);
+                                            pass &= !payload.getBoolean(JSON_AMBIENT);
+                                        }
+                                    } catch (JSONException e) {
+                                        pass = false;
+                                        Log.e(TAG, "failed to unpack data from mocklistener", e);
+                                    }
+                                }
+                            }
+                            pass &= found.size() == 3;
+                            mStatus[i] = pass ? PASS : FAIL;
+                            next();
+                        }
+                    });
+        }
+    }
+
+    // ordered by contact affinity: A, B, C
+    private void testLookupUriOrder(final int i) {
+        if (mStatus[i] == SETUP) {
+            mNm.cancelAll();
+            MockListener.resetListenerData(this);
+            mStatus[i] = CLEARED;
+            // wait for intent to move through the system
+            delay();
+        } else if (mStatus[i] == CLEARED) {
+            sendNotifications(MODE_URI, false, false);
+            mStatus[i] = READY;
+            // wait for notifications to move through the system
+            delay();
+        } else {
+            MockListener.probeListenerOrder(mContext,
+                    new MockListener.StringListResultCatcher() {
+                        @Override
+                        public void accept(List<String> orderedKeys) {
+                            int rankA = findTagInKeys(ALICE, orderedKeys);
+                            int rankB = findTagInKeys(BOB, orderedKeys);
+                            int rankC = findTagInKeys(CHARLIE, orderedKeys);
+                            if (rankA < rankB && rankB < rankC) {
+                                mStatus[i] = PASS;
+                            } else {
+                                logWithStack("failed testLookupUriOrder : "
+                                        + rankA + ", " + rankB + ", " + rankC);
+                                mStatus[i] = FAIL;
+                            }
+                            next();
+                        }
+                    });
+        }
+    }
+
+    // ordered by contact affinity: A, B, C
+    private void testEmailOrder(final int i) {
+        if (mStatus[i] == SETUP) {
+            mNm.cancelAll();
+            MockListener.resetListenerData(this);
+            mStatus[i] = DELAYED_SETUP;
+            // wait for intent to move through the system
+            delay();
+        } else if (mStatus[i] == DELAYED_SETUP) {
+            sendNotifications(MODE_EMAIL, false, false);
+            mStatus[i] = READY;
+            // wait for notifications to move through the system
+            delay();
+        } else {
+            MockListener.probeListenerOrder(mContext,
+                    new MockListener.StringListResultCatcher() {
+                        @Override
+                        public void accept(List<String> orderedKeys) {
+                            int rankA = findTagInKeys(ALICE, orderedKeys);
+                            int rankB = findTagInKeys(BOB, orderedKeys);
+                            int rankC = findTagInKeys(CHARLIE, orderedKeys);
+                            if (rankA < rankB && rankB < rankC) {
+                                mStatus[i] = PASS;
+                            } else {
+                                logWithStack("failed testEmailOrder : "
+                                        + rankA + ", " + rankB + ", " + rankC);
+                                mStatus[i] = FAIL;
+                            }
+                            next();
+                        }
+                    });
+        }
+    }
+
+    // ordered by contact affinity: A, B, C
+    private void testPhoneOrder(final int i) {
+        if (mStatus[i] == SETUP) {
+            mNm.cancelAll();
+            MockListener.resetListenerData(this);
+            mStatus[i] = CLEARED;
+            // wait for intent to move through the system
+            delay();
+        } else if (mStatus[i] == CLEARED) {
+            sendNotifications(MODE_PHONE, false, false);
+            mStatus[i] = READY;
+            // wait for notifications to move through the system
+            delay();
+        } else {
+            MockListener.probeListenerOrder(mContext,
+                    new MockListener.StringListResultCatcher() {
+                        @Override
+                        public void accept(List<String> orderedKeys) {
+                            int rankA = findTagInKeys(ALICE, orderedKeys);
+                            int rankB = findTagInKeys(BOB, orderedKeys);
+                            int rankC = findTagInKeys(CHARLIE, orderedKeys);
+                            if (rankA < rankB && rankB < rankC) {
+                                mStatus[i] = PASS;
+                            } else {
+                                logWithStack("failed testPhoneOrder : "
+                                        + rankA + ", " + rankB + ", " + rankC);
+                                mStatus[i] = FAIL;
+                            }
+                            next();
+                        }
+                    });
+        }
+    }
+
+    // A starts at the top then falls to the bottom
+    private void testInterruptionOrder(final int i) {
+        if (mStatus[i] == SETUP) {
+            mNm.cancelAll();
+            MockListener.resetListenerData(this);
+            mStatus[i] = CLEARED;
+            // wait for intent to move through the system
+            delay();
+        } else if (mStatus[i] == CLEARED) {
+            sendNotifications(MODE_NONE, false, true);
+            mStatus[i] = READY;
+            // wait for notifications to move through the system
+            delay();
+        } else if (mStatus[i] == READY) {
+            MockListener.probeListenerOrder(mContext,
+                    new MockListener.StringListResultCatcher() {
+                        @Override
+                        public void accept(List<String> orderedKeys) {
+                            int rankA = findTagInKeys(ALICE, orderedKeys);
+                            int rankB = findTagInKeys(BOB, orderedKeys);
+                            int rankC = findTagInKeys(CHARLIE, orderedKeys);
+                            if (rankA < rankB && rankA < rankC) {
+                                mStatus[i] = RETRY;
+                                delay(12000);
+                            } else {
+                                logWithStack("noisy notification did not sort to top.");
+                                mStatus[i] = FAIL;
+                                next();
+                            }
+                        }
+                    });
+        } else if (mStatus[i] == RETRY) {
+            MockListener.probeListenerOrder(mContext,
+                    new MockListener.StringListResultCatcher() {
+                        @Override
+                        public void accept(List<String> orderedKeys) {
+                            int rankA = findTagInKeys(ALICE, orderedKeys);
+                            int rankB = findTagInKeys(BOB, orderedKeys);
+                            int rankC = findTagInKeys(CHARLIE, orderedKeys);
+                            if (rankA > rankB && rankA > rankC) {
+                                mStatus[i] = PASS;
+                            } else {
+                                logWithStack("noisy notification did not fade back into the list.");
+                                mStatus[i] = FAIL;
+                            }
+                            next();
+                        }
+                    });
+        }
+    }
+
+    // Nothing should be filtered when mode is ALL
+    private void testALLInterceptsNothing(final int i) {
+        if (mStatus[i] == SETUP) {
+            mNm.cancelAll();
+            MockListener.resetListenerData(this);
+            mStatus[i] = CLEARED;
+            // wait for intent to move through the system
+            delay();
+        } else if (mStatus[i] == CLEARED) {
+            sendNotifications(MODE_URI, false, false);
+            mStatus[i] = READY;
+            // wait for notifications to move through the system
+            delay();
+        } else {
+            MockListener.probeListenerPayloads(mContext,
+                    new MockListener.StringListResultCatcher() {
+                        @Override
+                        public void accept(List<String> result) {
+                            boolean pass = false;
+                            Set<String> found = new HashSet<String>();
+                            if (result != null && result.size() > 0) {
+                                pass = true;
+                                for (String payloadData : result) {
+                                    try {
+                                        JSONObject payload = new JSONObject(payloadData);
+                                        String tag = payload.getString(JSON_TAG);
+                                        if (found.contains(tag)) {
+                                            // multiple entries for same notification!
+                                            pass = false;
+                                        } else if (ALICE.equals(tag)) {
+                                            found.add(ALICE);
+                                            pass &= payload.getBoolean(JSON_MATCHES_ZEN_FILTER);
+                                        } else if (BOB.equals(tag)) {
+                                            found.add(BOB);
+                                            pass &= payload.getBoolean(JSON_MATCHES_ZEN_FILTER);
+                                        } else if (CHARLIE.equals(tag)) {
+                                            found.add(CHARLIE);
+                                            pass &= payload.getBoolean(JSON_MATCHES_ZEN_FILTER);
+                                        }
+                                    } catch (JSONException e) {
+                                        pass = false;
+                                        Log.e(TAG, "failed to unpack data from mocklistener", e);
+                                    }
+                                }
+                            }
+                            pass &= found.size() == 3;
+                            mStatus[i] = pass ? PASS : FAIL;
+                            next();
+                        }
+                    });
+        }
+    }
+
+    // A should be filtered when mode is Priority/Starred.
+    private void testPriorityInterceptsSome(final int i) {
+        if (mStatus[i] == SETUP) {
+            mNm.cancelAll();
+            MockListener.resetListenerData(this);
+            mStatus[i] = CLEARED;
+            // wait for intent to move through the system
+            delay();
+        } else if (mStatus[i] == CLEARED) {
+            sendNotifications(MODE_URI, false, false);
+            mStatus[i] = READY;
+            // wait for notifications to move through the system
+            delay();
+        } else {
+            MockListener.probeListenerPayloads(mContext,
+                    new MockListener.StringListResultCatcher() {
+                        @Override
+                        public void accept(List<String> result) {
+                            boolean pass = false;
+                            Set<String> found = new HashSet<String>();
+                            if (result != null && result.size() > 0) {
+                                pass = true;
+                                for (String payloadData : result) {
+                                    try {
+                                        JSONObject payload = new JSONObject(payloadData);
+                                        String tag = payload.getString(JSON_TAG);
+                                        if (found.contains(tag)) {
+                                            // multiple entries for same notification!
+                                            pass = false;
+                                        } else if (ALICE.equals(tag)) {
+                                            found.add(ALICE);
+                                            pass &= payload.getBoolean(JSON_MATCHES_ZEN_FILTER);
+                                        } else if (BOB.equals(tag)) {
+                                            found.add(BOB);
+                                            pass &= !payload.getBoolean(JSON_MATCHES_ZEN_FILTER);
+                                        } else if (CHARLIE.equals(tag)) {
+                                            found.add(CHARLIE);
+                                            pass &= !payload.getBoolean(JSON_MATCHES_ZEN_FILTER);
+                                        }
+                                    } catch (JSONException e) {
+                                        pass = false;
+                                        Log.e(TAG, "failed to unpack data from mocklistener", e);
+                                    }
+                                }
+                            }
+                            pass &= found.size() == 3;
+                            mStatus[i] = pass ? PASS : FAIL;
+                            next();
+                        }
+                    });
+        }
+    }
+
+    /** Search a list of notification keys for a givcen tag. */
+    private int findTagInKeys(String tag, List<String> orderedKeys) {
+        for (int i = 0; i < orderedKeys.size(); i++) {
+            if (orderedKeys.get(i).contains(tag)) {
+                return i;
+            }
+        }
+        return -1;
+    }
+
+    private void testDeleteContacts(final int i) {
+        if (mStatus[i] == SETUP) {
+            final ArrayList<ContentProviderOperation> operationList =
+                    new ArrayList<ContentProviderOperation>();
+            operationList.add(ContentProviderOperation.newDelete(mAliceUri).build());
+            operationList.add(ContentProviderOperation.newDelete(mBobUri).build());
+            try {
+                mContext.getContentResolver().applyBatch(ContactsContract.AUTHORITY, operationList);
+                mStatus[i] = READY;
+            } catch (RemoteException e) {
+                Log.e(TAG, String.format("%s: %s", e.toString(), e.getMessage()));
+                mStatus[i] = FAIL;
+            } catch (OperationApplicationException e) {
+                Log.e(TAG, String.format("%s: %s", e.toString(), e.getMessage()));
+                mStatus[i] = FAIL;
+            }
+            // wait for deletions to move through the system
+            delay(3000);
+        } else if (mStatus[i] == READY) {
+            mAliceUri = lookupContact(ALICE_PHONE);
+            mBobUri = lookupContact(BOB_PHONE);
+            mCharlieUri = lookupContact(CHARLIE_PHONE);
+
+            mStatus[i] = PASS;
+            if (mAliceUri != null) { mStatus[i] = FAIL; }
+            if (mBobUri != null) { mStatus[i] = FAIL; }
+            if (mCharlieUri != null) { mStatus[i] = FAIL; }
+            next();
+        }
+    }
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nls/NotificationListenerVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationListenerVerifierActivity.java
similarity index 80%
rename from apps/CtsVerifier/src/com/android/cts/verifier/nls/NotificationListenerVerifierActivity.java
rename to apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationListenerVerifierActivity.java
index 5e9db53..0ef595b 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nls/NotificationListenerVerifierActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationListenerVerifierActivity.java
@@ -14,14 +14,14 @@
  * limitations under the License.
  */
 
-package com.android.cts.verifier.nls;
+package com.android.cts.verifier.notifications;
 
-import static com.android.cts.verifier.nls.MockListener.JSON_FLAGS;
-import static com.android.cts.verifier.nls.MockListener.JSON_ICON;
-import static com.android.cts.verifier.nls.MockListener.JSON_ID;
-import static com.android.cts.verifier.nls.MockListener.JSON_PACKAGE;
-import static com.android.cts.verifier.nls.MockListener.JSON_TAG;
-import static com.android.cts.verifier.nls.MockListener.JSON_WHEN;
+import static com.android.cts.verifier.notifications.MockListener.JSON_FLAGS;
+import static com.android.cts.verifier.notifications.MockListener.JSON_ICON;
+import static com.android.cts.verifier.notifications.MockListener.JSON_ID;
+import static com.android.cts.verifier.notifications.MockListener.JSON_PACKAGE;
+import static com.android.cts.verifier.notifications.MockListener.JSON_TAG;
+import static com.android.cts.verifier.notifications.MockListener.JSON_WHEN;
 
 import android.annotation.SuppressLint;
 import android.app.Activity;
@@ -40,6 +40,7 @@
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.TextView;
 
@@ -58,33 +59,37 @@
 
 public class NotificationListenerVerifierActivity extends PassFailButtons.Activity
 implements Runnable {
-    static final String TAG = TagVerifierActivity.class.getSimpleName();
+    private static final String TAG = TagVerifierActivity.class.getSimpleName();
     private static final String STATE = "state";
-    private static final String LISTENER_PATH = "com.android.cts.verifier/" + 
-            "com.android.cts.verifier.nls.MockListener";
-    private static final int SETUP = 0;
-    private static final int PASS = 1;
-    private static final int FAIL = 2;
-    private static final int WAIT_FOR_USER = 3;
-    private static final int CLEARED = 4;
-    private static final int READY = 5;
-    private static final int RETRY = 6;
-    private static final int NOTIFICATION_ID = 1001;
     private static LinkedBlockingQueue<String> sDeletedQueue = new LinkedBlockingQueue<String>();
 
-    private int mState;
-    private int[] mStatus;
+    protected static final String LISTENER_PATH = "com.android.cts.verifier/" +
+            "com.android.cts.verifier.notifications.MockListener";
+    protected static final int SETUP = 0;
+    protected static final int PASS = 1;
+    protected static final int FAIL = 2;
+    protected static final int WAIT_FOR_USER = 3;
+    protected static final int CLEARED = 4;
+    protected static final int READY = 5;
+    protected static final int RETRY = 6;
+
+    protected static final int NOTIFICATION_ID = 1001;
+
+    protected int mState;
+    protected int[] mStatus;
+    protected PackageManager mPackageManager;
+    protected NotificationManager mNm;
+    protected Context mContext;
+    protected Runnable mRunner;
+    protected View mHandler;
+    protected String mPackageString;
+
     private LayoutInflater mInflater;
     private ViewGroup mItemList;
-    private PackageManager mPackageManager;
+
     private String mTag1;
     private String mTag2;
     private String mTag3;
-    private NotificationManager mNm;
-    private Context mContext;
-    private Runnable mRunner;
-    private View mHandler;
-    private String mPackageString;
     private int mIcon1;
     private int mIcon2;
     private int mIcon3;
@@ -112,6 +117,11 @@
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
+        onCreate(savedInstanceState, R.layout.nls_main);
+        setInfoResources(R.string.nls_test, R.string.nls_info, -1);
+    }
+
+    protected void onCreate(Bundle savedInstanceState, int layoutId) {
         super.onCreate(savedInstanceState);
 
         if (savedInstanceState != null) {
@@ -122,7 +132,7 @@
         mNm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
         mPackageManager = getPackageManager();
         mInflater = getLayoutInflater();
-        View view = mInflater.inflate(R.layout.nls_main, null);
+        View view = mInflater.inflate(layoutId, null);
         mItemList = (ViewGroup) view.findViewById(R.id.nls_test_items);
         mHandler = mItemList;
         createTestItems();
@@ -130,8 +140,6 @@
         setContentView(view);
 
         setPassFailButtonClickListeners();
-        setInfoResources(R.string.nls_test, R.string.nls_info, -1);
-
         getPassButton().setEnabled(false);
     }
 
@@ -148,48 +156,59 @@
 
     // Interface Utilities
 
-    private void createTestItems() {
-        createUserItem(R.string.nls_enable_service);
+    protected void createTestItems() {
+        createNlsSettingsItem(R.string.nls_enable_service);
         createAutoItem(R.string.nls_service_started);
         createAutoItem(R.string.nls_note_received);
         createAutoItem(R.string.nls_payload_intact);
         createAutoItem(R.string.nls_clear_one);
         createAutoItem(R.string.nls_clear_all);
-        createUserItem(R.string.nls_disable_service);
+        createNlsSettingsItem(R.string.nls_disable_service);
         createAutoItem(R.string.nls_service_stopped);
         createAutoItem(R.string.nls_note_missed);
     }
 
-    private void setItemState(int index, boolean passed) {
+    protected void setItemState(int index, boolean passed) {
         ViewGroup item = (ViewGroup) mItemList.getChildAt(index);
         ImageView status = (ImageView) item.findViewById(R.id.nls_status);
         status.setImageResource(passed ? R.drawable.fs_good : R.drawable.fs_error);
-        View button = item.findViewById(R.id.nls_launch_settings);
+        View button = item.findViewById(R.id.nls_action_button);
         button.setClickable(false);
         button.setEnabled(false);
         status.invalidate();
     }
 
-    private void markItemWaiting(int index) {
+    protected void markItemWaiting(int index) {
         ViewGroup item = (ViewGroup) mItemList.getChildAt(index);
         ImageView status = (ImageView) item.findViewById(R.id.nls_status);
         status.setImageResource(R.drawable.fs_warning);
         status.invalidate();
     }
 
-    private View createUserItem(int stringId) {
+    protected View createNlsSettingsItem(int messageId) {
+        return createUserItem(messageId, R.string.nls_start_settings);
+    }
+
+    protected View createRetryItem(int messageId) {
+        return createUserItem(messageId, R.string.attention_ready);
+    }
+
+    protected View createUserItem(int messageId, int actionId) {
         View item = mInflater.inflate(R.layout.nls_item, mItemList, false);
         TextView instructions = (TextView) item.findViewById(R.id.nls_instructions);
-        instructions.setText(stringId);
+        instructions.setText(messageId);
+        Button button = (Button) item.findViewById(R.id.nls_action_button);
+        button.setText(actionId);
         mItemList.addView(item);
+        button.setTag(actionId);
         return item;
     }
 
-    private View createAutoItem(int stringId) {
+    protected View createAutoItem(int stringId) {
         View item = mInflater.inflate(R.layout.nls_item, mItemList, false);
         TextView instructions = (TextView) item.findViewById(R.id.nls_instructions);
         instructions.setText(stringId);
-        View button = item.findViewById(R.id.nls_launch_settings);
+        View button = item.findViewById(R.id.nls_action_button);
         button.setVisibility(View.GONE);
         mItemList.addView(item);
         return item;
@@ -214,33 +233,37 @@
             markItemWaiting(mState);
         }
 
+        updateStateMachine();
+    }
+
+    protected void updateStateMachine() {
         switch (mState) {
             case 0:
-                testIsEnabled(0);
+                testIsEnabled(mState);
                 break;
             case 1:
-                testIsStarted(1);
+                testIsStarted(mState);
                 break;
             case 2:
-                testNotificationRecieved(2);
+                testNotificationRecieved(mState);
                 break;
             case 3:
-                testDataIntact(3);
+                testDataIntact(mState);
                 break;
             case 4:
-                testDismissOne(4);
+                testDismissOne(mState);
                 break;
             case 5:
-                testDismissAll(5);
+                testDismissAll(mState);
                 break;
             case 6:
-                testIsDisabled(6);
+                testIsDisabled(mState);
                 break;
             case 7:
-                testIsStopped(7);
+                testIsStopped(mState);
                 break;
             case 8:
-                testNotificationNotRecieved(8);
+                testNotificationNotRecieved(mState);
                 break;
             case 9:
                 getPassButton().setEnabled(true);
@@ -249,12 +272,25 @@
         }
     }
 
-    public void launchSettings(View button) {
+    public void launchSettings() {
         startActivity(
                 new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"));
     }
 
-    private PendingIntent makeIntent(int code, String tag) {
+    public void actionPressed(View v) {
+        Object tag = v.getTag();
+        if (tag instanceof Integer) {
+            int id = ((Integer) tag).intValue();
+            if (id == R.string.nls_start_settings) {
+                launchSettings();
+            } else if (id == R.string.attention_ready) {
+                mStatus[mState] = READY;
+                next();
+            }
+        }
+    }
+
+    protected PendingIntent makeIntent(int code, String tag) {
         Intent intent = new Intent(tag);
         intent.setComponent(new ComponentName(mContext, DismissService.class));
         PendingIntent pi = PendingIntent.getService(mContext, code, intent,
@@ -263,7 +299,7 @@
     }
 
     @SuppressLint("NewApi")
-    private void sendNotificaitons() {
+    private void sendNotifications() {
         mTag1 = UUID.randomUUID().toString();
         mTag2 = UUID.randomUUID().toString();
         mTag3 = UUID.randomUUID().toString();
@@ -325,18 +361,27 @@
     /**
      * Return to the state machine to progress through the tests.
      */
-    private void next() {
+    protected void next() {
+        mHandler.removeCallbacks(mRunner);
         mHandler.post(mRunner);
     }
 
     /**
      * Wait for things to settle before returning to the state machine.
      */
-    private void delay() {
-        mHandler.postDelayed(mRunner, 2000);
+    protected void delay() {
+        delay(2000);
     }
 
-    boolean checkEquals(long expected, long actual, String message) {
+    /**
+     * Wait for some time.
+     */
+    protected void delay(long waitTime) {
+        mHandler.removeCallbacks(mRunner);
+        mHandler.postDelayed(mRunner, waitTime);
+    }
+
+    protected boolean checkEquals(long expected, long actual, String message) {
         if (expected == actual) {
             return true;
         }
@@ -344,7 +389,7 @@
         return false;
     }
 
-    boolean checkEquals(String expected, String actual, String message) {
+    protected boolean checkEquals(String expected, String actual, String message) {
         if (expected.equals(actual)) {
             return true;
         }
@@ -352,7 +397,7 @@
         return false;
     }
 
-    boolean checkFlagSet(int expected, int actual, String message) {
+    protected boolean checkFlagSet(int expected, int actual, String message) {
         if ((expected & actual) != 0) {
             return true;
         }
@@ -360,7 +405,7 @@
         return false;
     };
 
-    private void logWithStack(String message) {
+    protected void logWithStack(String message) {
         Throwable stackTrace = new Throwable();
         stackTrace.fillInStackTrace();
         Log.e(TAG, message, stackTrace);
@@ -394,7 +439,7 @@
             delay();
         } else {
             MockListener.probeListenerStatus(mContext,
-                    new MockListener.IntegerResultCatcher() {
+                    new MockListener.StatusCatcher() {
                 @Override
                 public void accept(int result) {
                     if (result == Activity.RESULT_OK) {
@@ -416,7 +461,7 @@
             // wait for intent to move through the system
             delay();
         } else if (mStatus[i] == CLEARED) {
-            sendNotificaitons();
+            sendNotifications();
             mStatus[i] = READY;
             // wait for notifications to move through the system
             delay();
@@ -450,38 +495,38 @@
                         try {
                             JSONObject payload = new JSONObject(payloadData);
                             pass &= checkEquals(mPackageString, payload.getString(JSON_PACKAGE),
-                                    "data integrity test fail: notificaiton package (%s, %s)");
+                                    "data integrity test fail: notification package (%s, %s)");
                             String tag = payload.getString(JSON_TAG);
                             if (mTag1.equals(tag)) {
                                 found.add(mTag1);
                                 pass &= checkEquals(mIcon1, payload.getInt(JSON_ICON),
-                                        "data integrity test fail: notificaiton icon (%d, %d)");
+                                        "data integrity test fail: notification icon (%d, %d)");
                                 pass &= checkFlagSet(mFlag1, payload.getInt(JSON_FLAGS),
-                                        "data integrity test fail: notificaiton flags (%d, %d)");
+                                        "data integrity test fail: notification flags (%d, %d)");
                                 pass &= checkEquals(mId1, payload.getInt(JSON_ID),
-                                        "data integrity test fail: notificaiton ID (%d, %d)");
+                                        "data integrity test fail: notification ID (%d, %d)");
                                 pass &= checkEquals(mWhen1, payload.getLong(JSON_WHEN),
-                                        "data integrity test fail: notificaiton when (%d, %d)");
+                                        "data integrity test fail: notification when (%d, %d)");
                             } else if (mTag2.equals(tag)) {
                                 found.add(mTag2);
                                 pass &= checkEquals(mIcon2, payload.getInt(JSON_ICON),
-                                        "data integrity test fail: notificaiton icon (%d, %d)");
+                                        "data integrity test fail: notification icon (%d, %d)");
                                 pass &= checkFlagSet(mFlag2, payload.getInt(JSON_FLAGS),
-                                        "data integrity test fail: notificaiton flags (%d, %d)");
+                                        "data integrity test fail: notification flags (%d, %d)");
                                 pass &= checkEquals(mId2, payload.getInt(JSON_ID),
-                                        "data integrity test fail: notificaiton ID (%d, %d)");
+                                        "data integrity test fail: notification ID (%d, %d)");
                                 pass &= checkEquals(mWhen2, payload.getLong(JSON_WHEN),
-                                        "data integrity test fail: notificaiton when (%d, %d)");
+                                        "data integrity test fail: notification when (%d, %d)");
                             } else if (mTag3.equals(tag)) {
                                 found.add(mTag3);
                                 pass &= checkEquals(mIcon3, payload.getInt(JSON_ICON),
-                                        "data integrity test fail: notificaiton icon (%d, %d)");
+                                        "data integrity test fail: notification icon (%d, %d)");
                                 pass &= checkFlagSet(mFlag3, payload.getInt(JSON_FLAGS),
-                                        "data integrity test fail: notificaiton flags (%d, %d)");
+                                        "data integrity test fail: notification flags (%d, %d)");
                                 pass &= checkEquals(mId3, payload.getInt(JSON_ID),
-                                        "data integrity test fail: notificaiton ID (%d, %d)");
+                                        "data integrity test fail: notification ID (%d, %d)");
                                 pass &= checkEquals(mWhen3, payload.getLong(JSON_WHEN),
-                                        "data integrity test fail: notificaiton when (%d, %d)");
+                                        "data integrity test fail: notification when (%d, %d)");
                             } else {
                                 pass = false;
                                 logWithStack("failed on unexpected notification tag: " + tag);
@@ -587,7 +632,7 @@
             delay();
         } else {
             MockListener.probeListenerStatus(mContext,
-                    new MockListener.IntegerResultCatcher() {
+                    new MockListener.StatusCatcher() {
                 @Override
                 public void accept(int result) {
                     if (result == Activity.RESULT_OK) {
@@ -610,7 +655,7 @@
             delay();
         } else if (mStatus[i] == CLEARED) {
             // setup for testNotificationRecieved
-            sendNotificaitons();
+            sendNotifications();
             mStatus[i] = READY;
             delay();
         } else {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorPowerTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorPowerTestActivity.java
index 245d115..cfc4db0 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorPowerTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/SensorPowerTestActivity.java
@@ -18,50 +18,54 @@
 
 import com.android.cts.verifier.sensors.base.SensorCtsVerifierTestActivity;
 import com.android.cts.verifier.sensors.helpers.PowerTestHostLink;
+import com.android.cts.verifier.sensors.helpers.SensorTestScreenManipulator;
 import com.android.cts.verifier.sensors.reporting.SensorTestDetails;
 
 import junit.framework.Assert;
 
-import java.util.concurrent.TimeUnit;
-
 public class SensorPowerTestActivity
         extends SensorCtsVerifierTestActivity
         implements PowerTestHostLink.HostToDeviceInterface {
-    public class TestExecutionException extends Exception {
-        public TestExecutionException(final String message) {
-            super(message);
-        }
-    }
+
+    private PowerTestHostLink mHostLink;
+    private SensorTestScreenManipulator mScreenManipulator;
 
     public SensorPowerTestActivity() {
         super(SensorPowerTestActivity.class);
     }
 
-    private PowerTestHostLink mHostLink;
 
-    /** HostToDeviceInterface implementation **/
+    @Override
     public void waitForUserAcknowledgement(final String message) {
         appendText(message);
         waitForUser();
     }
 
-    /* channel for host to raise an exception on the device if needed */
+    @Override
     public void raiseError(String testName, String message) throws Exception {
         getTestLogger().logTestFail(testName, message);
-        throw new TestExecutionException(message);
+        throw new RuntimeException(message);
     }
 
+    @Override
     public void logText(String text) {
         appendText(text);
     }
 
+    @Override
     public void logTestResult(SensorTestDetails testDetails) {
         getTestLogger().logTestDetails(testDetails);
     }
 
     @Override
-    protected void activitySetUp() throws InterruptedException {
-        setScreenOffTimeout(15, TimeUnit.SECONDS);
+    public void turnScreenOff() {
+        mScreenManipulator.turnScreenOffOnNextPowerDisconnect();
+    }
+
+    @Override
+    protected void activitySetUp() {
+        mScreenManipulator = new SensorTestScreenManipulator(getApplicationContext());
+        mScreenManipulator.initialize(this);
     }
 
     @Override
@@ -69,7 +73,7 @@
         if (mHostLink != null) {
             mHostLink.close();
         }
-        resetScreenOffTimeout();
+        mScreenManipulator.close();
     }
 
     public String testSensorsPower() throws Throwable {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/base/BaseSensorTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/base/BaseSensorTestActivity.java
index d4ef516..68e72c3 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/base/BaseSensorTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/base/BaseSensorTestActivity.java
@@ -25,9 +25,9 @@
 import junit.framework.Assert;
 
 import android.app.Activity;
-import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
+import android.hardware.cts.helpers.ActivityResultMultiplexedLatch;
 import android.hardware.cts.helpers.SensorTestStateNotSupportedException;
 import android.media.MediaPlayer;
 import android.os.Bundle;
@@ -36,14 +36,13 @@
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
+import android.widget.Button;
 import android.widget.LinearLayout;
 import android.widget.ScrollView;
 import android.widget.TextView;
 
 import java.security.InvalidParameterException;
-import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
 
 /**
  * A base Activity that is used to build different methods to execute tests inside CtsVerifier.
@@ -67,22 +66,25 @@
  */
 public abstract class BaseSensorTestActivity
         extends Activity
-        implements View.OnClickListener, Runnable {
+        implements View.OnClickListener, Runnable, ISensorTestStateContainer {
     @Deprecated
     protected static final String LOG_TAG = "SensorTest";
 
     protected final Class mTestClass;
 
     private final int mLayoutId;
-    private final DeactivatorActivityHandler mDeactivatorActivityHandler;
     private final SensorFeaturesDeactivator mSensorFeaturesDeactivator;
 
     private final Semaphore mSemaphore = new Semaphore(0);
     private final SensorTestLogger mTestLogger = new SensorTestLogger();
+    private final ActivityResultMultiplexedLatch mActivityResultMultiplexedLatch =
+            new ActivityResultMultiplexedLatch();
 
     private ScrollView mLogScrollView;
     private LinearLayout mLogLayout;
-    private View mNextView;
+    private Button mNextButton;
+    private Button mPassButton;
+    private Button mFailButton;
 
     /**
      * Constructor to be used by subclasses.
@@ -105,8 +107,7 @@
     protected BaseSensorTestActivity(Class testClass, int layoutId) {
         mTestClass = testClass;
         mLayoutId = layoutId;
-        mDeactivatorActivityHandler = new DeactivatorActivityHandler();
-        mSensorFeaturesDeactivator = new SensorFeaturesDeactivator(mDeactivatorActivityHandler);
+        mSensorFeaturesDeactivator = new SensorFeaturesDeactivator(this);
     }
 
     @Override
@@ -116,10 +117,12 @@
 
         mLogScrollView = (ScrollView) findViewById(R.id.log_scroll_view);
         mLogLayout = (LinearLayout) findViewById(R.id.log_layout);
-        mNextView = findViewById(R.id.next_button);
-        mNextView.setOnClickListener(this);
+        mNextButton = (Button) findViewById(R.id.next_button);
+        mNextButton.setOnClickListener(this);
+        mPassButton = (Button) findViewById(R.id.pass_button);
+        mFailButton = (Button) findViewById(R.id.fail_button);
 
-        updateButton(false /*enabled*/);
+        updateNextButton(false /*enabled*/);
         new Thread(this).start();
     }
 
@@ -130,7 +133,7 @@
 
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-        mDeactivatorActivityHandler.onActivityResult();
+        mActivityResultMultiplexedLatch.onActivityResult(requestCode, resultCode);
     }
 
     /**
@@ -144,8 +147,8 @@
     @Override
     public void run() {
         SensorTestDetails testDetails = null;
-        mSensorFeaturesDeactivator.requestDeactivationOfFeatures();
         try {
+            mSensorFeaturesDeactivator.requestDeactivationOfFeatures();
             activitySetUp();
         } catch (SensorTestStateNotSupportedException e) {
             testDetails = new SensorTestDetails(
@@ -168,19 +171,34 @@
 
         try {
             activityCleanUp();
+            mSensorFeaturesDeactivator.requestToRestoreFeatures();
         } catch (Throwable e) {
             testDetails = new SensorTestDetails(
                     getTestClassName(),
                     SensorTestDetails.ResultCode.FAIL,
                     "[ActivityCleanUp] " + e.getMessage());
         }
-        mSensorFeaturesDeactivator.requestToRestoreFeatures();
-        mTestLogger.logInstructions(R.string.snsr_test_complete);
+        mTestLogger.logTestDetails(testDetails);
 
-        // log to screen and save the overall test summary (activity level)
-        setTestResult(testDetails);
-        waitForUser(R.string.snsr_wait_to_complete);
-        finish();
+        // because we cannot enforce test failures in several devices, set the test UI so the
+        // operator can report the result of the test
+        if (testDetails.getResultCode() == SensorTestDetails.ResultCode.FAIL) {
+            mTestLogger.logInstructions(R.string.snsr_test_complete_with_errors);
+            enableTestResultButton(
+                    mPassButton,
+                    R.string.snsr_pass_on_error,
+                    testDetails.cloneAndChangeResultCode(SensorTestDetails.ResultCode.PASS));
+            enableTestResultButton(
+                    mFailButton,
+                    R.string.fail_button_text,
+                    testDetails.cloneAndChangeResultCode(SensorTestDetails.ResultCode.FAIL));
+        } else {
+            mTestLogger.logInstructions(R.string.snsr_test_complete);
+            enableTestResultButton(
+                    mPassButton,
+                    R.string.pass_button_text,
+                    testDetails.cloneAndChangeResultCode(SensorTestDetails.ResultCode.PASS));
+        }
     }
 
     /**
@@ -207,31 +225,8 @@
      */
     protected abstract SensorTestDetails executeTests();
 
-    /**
-     * Guides the operator throughout the process of setting the Screen Off timeout to a required
-     * value.
-     *
-     * @param timeout The expected timeout.
-     * @param timeUnit The unit of the provided timeout.
-     *
-     * @throws InterruptedException
-     */
-    protected void setScreenOffTimeout(long timeout, TimeUnit timeUnit)
-            throws InterruptedException {
-        mSensorFeaturesDeactivator.requestToSetScreenOffTimeout(timeout, timeUnit);
-    }
-
-    /**
-     * Guides the operator throughout the process of restoring the state of the Screen Off timeout
-     * to its original state.
-     *
-     * @throws InterruptedException
-     */
-    protected void resetScreenOffTimeout() throws InterruptedException {
-        mSensorFeaturesDeactivator.requestToResetScreenOffTimeout();
-    }
-
-    protected SensorTestLogger getTestLogger() {
+    @Override
+    public SensorTestLogger getTestLogger() {
         return mTestLogger;
     }
 
@@ -274,13 +269,13 @@
      */
     protected void waitForUser(int waitMessageResId) {
         mTestLogger.logInstructions(waitMessageResId);
-        updateButton(true);
+        updateNextButton(true);
         try {
             mSemaphore.acquire();
         } catch (InterruptedException e)  {
             Log.e(LOG_TAG, "Error on waitForUser", e);
         }
-        updateButton(false);
+        updateNextButton(false);
     }
 
     /**
@@ -290,9 +285,35 @@
         waitForUser(R.string.snsr_wait_to_begin);
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void waitForUserToContinue() {
+        waitForUser(R.string.snsr_wait_for_user);
+    }
+
     @Deprecated
     protected void waitForUser() {
-        waitForUser(R.string.snsr_wait_for_user);
+        waitForUserToContinue();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int executeActivity(String action) {
+        return executeActivity(new Intent(action));
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int executeActivity(Intent intent) {
+        ActivityResultMultiplexedLatch.Latch latch = mActivityResultMultiplexedLatch.bindThread();
+        startActivityForResult(intent, latch.getRequestCode());
+        return latch.await();
     }
 
     protected void playSound() {
@@ -348,8 +369,6 @@
     }
 
     private void setTestResult(SensorTestDetails testDetails) {
-        mTestLogger.logTestDetails(testDetails);
-
         String summary = mTestLogger.getOverallSummary();
         String name = testDetails.getName();
         switch(testDetails.getResultCode()) {
@@ -365,17 +384,45 @@
         }
     }
 
-    private void updateButton(boolean enabled) {
-        runOnUiThread(new ButtonEnabler(this.mNextView, enabled));
+    private void updateNextButton(final boolean enabled) {
+        runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                mNextButton.setEnabled(enabled);
+            }
+        });
+    }
+
+    private void enableTestResultButton(
+            final Button button,
+            final int textResId,
+            final SensorTestDetails testDetails) {
+        final View.OnClickListener listener = new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                setTestResult(testDetails);
+                finish();
+            }
+        };
+
+        runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                mNextButton.setVisibility(View.GONE);
+                button.setText(textResId);
+                button.setOnClickListener(listener);
+                button.setVisibility(View.VISIBLE);
+            }
+        });
     }
 
     // a logger available until sensor reporting is in place
-    protected class SensorTestLogger {
+    public class SensorTestLogger {
         private static final String SUMMARY_SEPARATOR = " | ";
 
-        private final StringBuilder mOverallSummaryBuilder = new StringBuilder();
+        private final StringBuilder mOverallSummaryBuilder = new StringBuilder("\n");
 
-        public void logTestStart(String testName) {
+        void logTestStart(String testName) {
             // TODO: log the sensor information and expected execution time of each test
             TextAppender textAppender = new TextAppender(R.layout.snsr_test_title);
             textAppender.setText(testName);
@@ -415,7 +462,7 @@
             }
         }
 
-        public void logTestPass(String testName, String testSummary) {
+        void logTestPass(String testName, String testSummary) {
             testSummary = getValidTestSummary(testSummary, R.string.snsr_test_pass);
             logTestEnd(R.layout.snsr_success, testSummary);
             Log.d(LOG_TAG, testSummary);
@@ -429,14 +476,14 @@
             saveResult(testName, SensorTestDetails.ResultCode.FAIL, testSummary);
         }
 
-        public void logTestSkip(String testName, String testSummary) {
+        void logTestSkip(String testName, String testSummary) {
             testSummary = getValidTestSummary(testSummary, R.string.snsr_test_skipped);
             logTestEnd(R.layout.snsr_warning, testSummary);
             Log.i(LOG_TAG, testSummary);
             saveResult(testName, SensorTestDetails.ResultCode.SKIPPED, testSummary);
         }
 
-        public String getOverallSummary() {
+        String getOverallSummary() {
             return mOverallSummaryBuilder.toString();
         }
 
@@ -496,61 +543,4 @@
             });
         }
     }
-
-    private class ButtonEnabler implements Runnable {
-        private final View mButtonView;
-        private final boolean mButtonEnabled;
-
-        public ButtonEnabler(View buttonView, boolean buttonEnabled) {
-            mButtonView = buttonView;
-            mButtonEnabled = buttonEnabled;
-        }
-
-        @Override
-        public void run() {
-            mButtonView.setEnabled(mButtonEnabled);
-        }
-    }
-
-    private class DeactivatorActivityHandler implements SensorFeaturesDeactivator.ActivityHandler {
-        private static final int SENSOR_FEATURES_DEACTIVATOR_RESULT = 0;
-
-        private CountDownLatch mCountDownLatch;
-
-        @Override
-        public ContentResolver getContentResolver() {
-            return BaseSensorTestActivity.this.getContentResolver();
-        }
-
-        @Override
-        public void logInstructions(int instructionsResId, Object ... params) {
-            mTestLogger.logInstructions(instructionsResId, params);
-        }
-
-        @Override
-        public void waitForUser() {
-            BaseSensorTestActivity.this.waitForUser(R.string.snsr_wait_for_user);
-        }
-
-        @Override
-        public void launchAndWaitForSubactivity(String action) {
-            mCountDownLatch = new CountDownLatch(1);
-            Intent intent = new Intent(action);
-            startActivityForResult(intent, SENSOR_FEATURES_DEACTIVATOR_RESULT);
-            try {
-                mCountDownLatch.await();
-            } catch (InterruptedException e) {
-                Log.e(LOG_TAG, "Error waiting for sub-activity.", e);
-            }
-        }
-
-        public void onActivityResult() {
-            mCountDownLatch.countDown();
-        }
-
-        @Override
-        public String getString(int resId, Object ... params) {
-            return BaseSensorTestActivity.this.getString(resId, params);
-        }
-    }
 }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/base/ISensorTestStateContainer.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/base/ISensorTestStateContainer.java
new file mode 100644
index 0000000..3ef7e21
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/base/ISensorTestStateContainer.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.cts.verifier.sensors.base;
+
+import android.content.ContentResolver;
+import android.content.Intent;
+
+/**
+ * An interface that defines a facade for {@link BaseSensorTestActivity}, so it can be consumed by
+ * other CtsVerifier Sensor Test Framework helper components.
+ */
+public interface ISensorTestStateContainer {
+
+    /**
+     * @return The current logger.
+     */
+    BaseSensorTestActivity.SensorTestLogger getTestLogger();
+
+    /**
+     * Waits for the operator to acknowledge to continue execution.
+     */
+    void waitForUserToContinue();
+
+    /**
+     * @param resId The resource Id to extract.
+     * @return The extracted string.
+     */
+    String getString(int resId);
+
+    /**
+     * @param resId The resource Id to extract.
+     * @param params The parameters to format the string represented by the resource contents.
+     * @return The formatted extracted string.
+     */
+    String getString(int resId, Object ... params);
+
+    /**
+     * Starts an Activity and blocks until it completes, then it returns its result back to the
+     * client.
+     *
+     * @param action The action to start the Activity.
+     * @return The Activity's result code.
+     */
+    int executeActivity(String action);
+
+    /**
+     * Starts an Activity and blocks until it completes, then it returns its result back to the
+     * client.
+     *
+     * @param intent The intent to start the Activity.
+     * @return The Activity's result code.
+     */
+    int executeActivity(Intent intent);
+
+    /**
+     * @return The {@link ContentResolver} associated with the test.
+     */
+    ContentResolver getContentResolver();
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/base/SensorCtsTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/base/SensorCtsTestActivity.java
index 6bdc8d2..4d2813c 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/base/SensorCtsTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/base/SensorCtsTestActivity.java
@@ -62,8 +62,6 @@
     protected void activitySetUp() {
         getTestLogger().logInstructions(R.string.snsr_no_interaction);
         waitForUserToBegin();
-
-        // TODO: deactivate Sensor features?
     }
 
     /**
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/PowerTestHostLink.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/PowerTestHostLink.java
index 645bdb2..59caadf 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/PowerTestHostLink.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/PowerTestHostLink.java
@@ -25,8 +25,6 @@
 import android.hardware.SensorManager;
 import android.net.LocalServerSocket;
 import android.net.LocalSocket;
-import android.os.PowerManager;
-import android.provider.Settings;
 import android.util.Log;
 
 import java.io.IOException;
@@ -38,13 +36,14 @@
 /**
  * This class handles communication with the host to respond to commands.
  * The command/response link is through a TCP socket on the host side, forwarded via adb to a local
- * socket on the device.  The system uses a standard "accept-read_command-send_response-close" to
- * execute commands sent from the host.  
- * 
+ * socket on the device. The system uses a standard "accept-read_command-send_response-close" to
+ * execute commands sent from the host.
+ *
  * CAUTION: The local socket name (SOCKET_NAME below) must match that used by the host to set up
  * the adb-forwarding.
  */
 public class PowerTestHostLink {
+    private static final String TAG = "PowerTestHostLink";
 
     /**
      * Host-to-device bridge will use a Listener instance to drive the test via the CtsVerifier
@@ -55,17 +54,15 @@
         void raiseError(String testName, String message) throws Exception;
         void waitForUserAcknowledgement(String message);
         void logText(String text);
-    };
+        void turnScreenOff();
+    }
 
     /** This is a data-only message to communicate result of a power test */
     public class PowerTestResult{
         public int passedCount = 0;
         public int skippedCount = 0;
         public int failedCount = 0;
-    };
-
-
-    public final String TAG = "PowerTestHostLink";
+    }
 
     /**
      * Standard response types back to host. Host-side code must match these definitions.
@@ -79,35 +76,15 @@
      */
     public final static String SOCKET_NAME = "/android/cts/powertest";
 
-    private LocalServerSocket mServerSocket;
     private volatile boolean mStopThread;
     private final SensorManager mSensorManager;
-    private final PowerManager mPowerManager;
-    private final Context mContext;
     private final HostToDeviceInterface mHostToDeviceExecutor;
-    private PowerTestResult mTestResult;
+    private final PowerTestResult mTestResult = new PowerTestResult();
 
-    public PowerTestHostLink(Context context, final HostToDeviceInterface listener) {
+    public PowerTestHostLink(Context context, HostToDeviceInterface listener) {
         Log.d(TAG, " +++ Begin of localSocketServer() +++ ");
         mHostToDeviceExecutor = listener;
-        mContext = context;
-        try {
-            mServerSocket = new LocalServerSocket(SOCKET_NAME);
-            Log.i(TAG, "OKAY");
-
-        } catch (IOException e) {
-            Log.e(TAG, "The local Socket Server create failed");
-            e.printStackTrace();
-        }
-        if (mServerSocket != null) {
-            Log.d(TAG, "Bound to local server socket");
-        } else {
-            Log.e(TAG, "Unable to bind to local socket ");
-        }
-        mStopThread = false;
-
         mSensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
-        mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
     }
 
     /**
@@ -124,15 +101,15 @@
      * @throws Exception
      */
     public PowerTestResult run() throws Exception {
-        mTestResult = new PowerTestResult();
         // define buffer to receive data from host
         final int BUFFER_SIZE = 4096;
         byte[] buffer = new byte[BUFFER_SIZE];
 
-        if (null == mServerSocket) {
-            Log.d(TAG, "The localSocketServer is NULL !!!");
+        LocalServerSocket serverSocket = createSocket();
+        if (null == serverSocket) {
             mStopThread = true;
         }
+
         InputStream streamIn;
         OutputStream streamOut;
         LocalSocket receiverSocket;
@@ -140,7 +117,7 @@
 
             try {
                 Log.d(TAG, "localSocketServer accept...");
-                receiverSocket = mServerSocket.accept();
+                receiverSocket = serverSocket.accept();
                 Log.d(TAG, "Got new connection");
             } catch (IOException e) {
                 Log.d(TAG, "localSocketServer accept() failed !!!", e);
@@ -188,7 +165,7 @@
                             Log.d(TAG, "Sending response " + response);
                             streamOut.write(response.getBytes(), 0, response.length());
                         }
-                        // null response means response is defered awaiting user response
+                        // null response means response is deferred awaiting user response
                     } catch (Exception e) {
                         Log.e(TAG, "Error executing " + clientRequest, e);
                         streamOut.write(RESPONSE_ERR.getBytes(), 0, RESPONSE_ERR.length());
@@ -196,75 +173,80 @@
                 }
                 receiverSocket.close();
             } catch (IOException e) {
-                Log.e(TAG, "There is an exception when reading from or writing tosocket", e);
+                Log.e(TAG, "There is an exception when reading from or writing to socket", e);
                 break;
             }
         }
         Log.d(TAG, "The LocalSocketServer thread is going to stop !!!");
 
-        if (mServerSocket != null) {
+        if (serverSocket != null) {
             try {
-                mServerSocket.close();
+                serverSocket.close();
             } catch (IOException e) {
                 Log.d(TAG, "Exception on close of server socket", e);
             }
         }
         mHostToDeviceExecutor.logText("Device disconnected.");
-        Log.d(TAG, "Returning " + mTestResult.passedCount + "passed " + mTestResult.skippedCount + "skipped " +
-        mTestResult.failedCount + "failed.");
+        Log.d(TAG, "Returning " + mTestResult.passedCount + "passed " + mTestResult.skippedCount +
+                "skipped " + mTestResult.failedCount + "failed.");
         return mTestResult;
     }
 
-    protected String processClientRequest(String request) throws Exception {
-        final String USER_REQUEST = "REQUEST USER RESPONSE";
+    private  String processClientRequest(String request) throws Exception {
+        // the following constants need to match the definitions in execute_power_tests.py
+        final String REQUEST_EXTERNAL_STORAGE = "EXTERNAL STORAGE?";
+        final String REQUEST_EXIT = "EXIT";
+        final String REQUEST_RAISE = "RAISE ";
+        final String REQUEST_USER_RESPONSE = "USER RESPONSE ";
+        final String REQUEST_SET_TEST_RESULT = "SET TEST RESULT ";
+        final String REQUEST_SENSOR_ON = "SENSOR ON ";
+        final String REQUEST_SENSOR_OFF = "SENSOR OFF";
+        final String REQUEST_SENSOR_AVAILABILITY = "SENSOR? ";
+        final String REQUEST_SCREEN_OFF = "SCREEN OFF";
+        final String REQUEST_SHOW_MESSAGE = "MESSAGE ";
+
         String response = RESPONSE_ERR;
         // Queries must appear first and then commands to direct actions after in these statements
-        if (request.startsWith("SCREEN OFF TIMEOUT?")) {
-            int timeout = Settings.System.getInt(mContext.getContentResolver(),
-                    Settings.System.SCREEN_OFF_TIMEOUT);
-            response = "" + timeout;
-        } else if (request.startsWith("AIRPLANE MODE ON?")) {
-            boolean airplaneModeOn = Settings.Global.getInt
-                    (mContext.getContentResolver(),
-                            Settings.Global.AIRPLANE_MODE_ON, 0) != 0;
-            response = airplaneModeOn ? RESPONSE_OK : RESPONSE_ERR;
-        } else if (request.startsWith("SENSOR?")) {
-            final String sensor = request.substring(9);
+        if (request.startsWith(REQUEST_SENSOR_AVAILABILITY)) {
+            final String sensor = request.substring(REQUEST_SENSOR_AVAILABILITY.length());
             final int sensorId = getSensorId(sensor);
             if (mSensorManager.getDefaultSensor(sensorId) == null) {
                 response = RESPONSE_UNAVAILABLE;
             } else {
                 response = RESPONSE_OK;
             }
-        } else if (request.startsWith("EXTERNAL STORAGE?")){
+        } else if (request.startsWith(REQUEST_EXTERNAL_STORAGE)){
             response = System.getenv("EXTERNAL_STORAGE");
             Log.d(TAG,"External storage is " + response);
-        } else if (request.startsWith("SCREEN OFF?")) {
-            boolean screenOn = mPowerManager.isScreenOn();
-            response = screenOn ? RESPONSE_ERR : RESPONSE_OK;
-        } else if (request.startsWith("SCREEN ON?")) {
-            boolean screenOn = mPowerManager.isScreenOn();
-            response = screenOn ? RESPONSE_OK : RESPONSE_ERR;
-        } else if (request.startsWith("SENSOR ON ")) {
-            String sensorList = request.substring(10).trim();
-            response = handleSensorSensorSwitchCmd(sensorList, true);
-        } else if (request.startsWith("SENSOR OFF")) {
-            String sensorList = request.substring(10).trim();
-            response = handleSensorSensorSwitchCmd(sensorList, false);
-        } else if (request.startsWith("MESSAGE")) {
-            final String message = request.substring(8);
+        } else if (request.startsWith(REQUEST_SCREEN_OFF)) {
+            try {
+                mHostToDeviceExecutor.turnScreenOff();
+                response = RESPONSE_OK;
+            } catch (SecurityException e) {
+                Log.e(TAG, "Error Turning screen off", e);
+                response = RESPONSE_ERR;
+            }
+        } else if (request.startsWith(REQUEST_SENSOR_ON)) {
+            String sensorList = request.substring(REQUEST_SENSOR_ON.length()).trim();
+            response = handleSensorSwitchCommand(sensorList, true);
+        } else if (request.startsWith(REQUEST_SENSOR_OFF)) {
+            String sensorList = request.substring(REQUEST_SENSOR_ON.length()).trim();
+            response = handleSensorSwitchCommand(sensorList, false);
+        } else if (request.startsWith(REQUEST_SHOW_MESSAGE)) {
+            final String message = request.substring(REQUEST_SHOW_MESSAGE.length());
             mHostToDeviceExecutor.logText(message);
             response = RESPONSE_OK;
-        } else if (request.startsWith(USER_REQUEST)) {
-            final String message = request.substring(USER_REQUEST.length() + 1);
+        } else if (request.startsWith(REQUEST_USER_RESPONSE)) {
+            String message = request.substring(REQUEST_USER_RESPONSE.length());
             mHostToDeviceExecutor.waitForUserAcknowledgement(message);
             response = RESPONSE_OK;
-        } else if (request.startsWith("SET TEST RESULT")) {
-            response = handleSetTestResultCmd(request);
-        } else if (request.startsWith("RAISE")) {
-            StringTokenizer tokenizer = new StringTokenizer(request);
+        } else if (request.startsWith(REQUEST_SET_TEST_RESULT)) {
+            String testResult = request.substring(REQUEST_SET_TEST_RESULT.length());
+            response = handleSetTestResultCmd(testResult);
+        } else if (request.startsWith(REQUEST_RAISE)) {
+            String command = request.substring(REQUEST_RAISE.length());
+            StringTokenizer tokenizer = new StringTokenizer(command);
             try {
-                tokenizer.nextToken();/* RAISE */
                 final String testName = tokenizer.nextToken();
                 final String message = request.substring(7 + testName.length());
                 mHostToDeviceExecutor.raiseError(testName, message);
@@ -273,7 +255,7 @@
                 Log.e(TAG, "Invalid RAISE command received (bad arguments): " + request);
                 response = RESPONSE_ERR;
             }
-        } else if (request.startsWith("EXIT")) {
+        } else if (request.startsWith(REQUEST_EXIT)) {
             mStopThread = true;
             response = RESPONSE_OK;
         } else {
@@ -282,7 +264,7 @@
         return response;
     }
 
-    protected String handleSetTestResultCmd(final String request) {
+    private String handleSetTestResultCmd(final String request) {
         String response;
         StringTokenizer tokenizer = new StringTokenizer(request, " ");
         String testName = "";
@@ -290,9 +272,6 @@
         String message = "";
 
         try {
-            tokenizer.nextToken();/* SET */
-            tokenizer.nextToken();/* TEST */
-            tokenizer.nextToken();/* RESULT */
             testName = tokenizer.nextToken();
             final String resultToken = tokenizer.nextToken();
 
@@ -328,7 +307,7 @@
         return response;
     }
 
-    protected String handleSensorSensorSwitchCmd(String sensorList, boolean switchOn) {
+    private String handleSensorSwitchCommand(String sensorList, boolean switchOn) {
         String response;
         try {
             StringTokenizer tokenizer = new StringTokenizer(sensorList, " ");
@@ -360,7 +339,7 @@
         return response;
     }
 
-    protected int getSensorId(String sensorName) {
+    private static int getSensorId(String sensorName) {
         int sensorId = -1;
 
         if (sensorName.compareToIgnoreCase("ACCELEROMETER") == 0) {
@@ -398,11 +377,11 @@
         return sensorId;
     }
 
-    protected String switchSensor(int sensorId, boolean switchOn) {
+    private String switchSensor(int sensorId, boolean switchOn) {
         return switchSensor(sensorId, switchOn, "SENSOR_DELAY_NORMAL");
     }
 
-    protected String switchSensor(int sensorId, boolean switchOn, String requestFrequency) {
+    private String switchSensor(int sensorId, boolean switchOn, String requestFrequency) {
         String response;
         int rateUs = SensorManager.SENSOR_DELAY_NORMAL;
 
@@ -429,7 +408,7 @@
         return response;
     }
 
-    protected String switchAllSensors(boolean on) {
+    private String switchAllSensors(boolean on) {
         List<Sensor> allSensors = mSensorManager.getSensorList(Sensor.TYPE_ALL);
         String response = RESPONSE_OK;
         for (Sensor sensor : allSensors) {
@@ -441,13 +420,20 @@
         return response;
     }
 
+    private LocalServerSocket createSocket() {
+        try {
+            return new LocalServerSocket(SOCKET_NAME);
+        } catch (IOException e) {
+            Log.e(TAG, "LocalSocketServer creation failure.", e);
+            return null;
+        }
+    }
+
     private SensorEventListener mSensorEventListener = new SensorEventListener() {
         @Override
-        public void onAccuracyChanged(Sensor sensor, int accuracy) {
-        }
+        public void onAccuracyChanged(Sensor sensor, int accuracy) {}
 
         @Override
-        public void onSensorChanged(SensorEvent event) {
-        }
+        public void onSensorChanged(SensorEvent event) {}
     };
 }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorDeviceAdminReceiver.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorDeviceAdminReceiver.java
new file mode 100644
index 0000000..9d75a98
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorDeviceAdminReceiver.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.cts.verifier.sensors.helpers;
+
+import android.app.admin.DeviceAdminReceiver;
+import android.content.ComponentName;
+import android.content.Context;
+
+/**
+ * Receiver to be used with {@link SensorTestScreenManipulator}.
+ */
+public class SensorDeviceAdminReceiver extends DeviceAdminReceiver {
+
+    /**
+     * Gets the associated {@link ComponentName} of the current receiver.
+     */
+    public static ComponentName getComponentName(Context context) {
+        return new ComponentName(context, SensorDeviceAdminReceiver.class);
+    }
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorFeaturesDeactivator.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorFeaturesDeactivator.java
index ed29e4c..75c0ec0 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorFeaturesDeactivator.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorFeaturesDeactivator.java
@@ -17,119 +17,63 @@
 package com.android.cts.verifier.sensors.helpers;
 
 import com.android.cts.verifier.R;
+import com.android.cts.verifier.sensors.base.ISensorTestStateContainer;
 
 import android.content.ContentResolver;
 import android.os.Build;
 import android.provider.Settings;
-import android.util.Log;
-
-import java.util.concurrent.TimeUnit;
 
 /**
- * A helper class that provides a mechanism to prompt users to deactivate features that are known
- * to register for sensor data.
- *
- * It also keeps stored the initial state for each feature modified.
+ * A helper class that provides a mechanism to:
+ * - prompt users to activate/deactivate features that are known to register for sensor data.
+ * - turn on/off certain components of the device on behalf of the test (described as 'runtime
+ *   features')
+ * - keep track of the initial state for each sensor feature, so it can be restored at will
  */
 public class SensorFeaturesDeactivator {
-    private static final String TAG = "SensorFeaturesDeactivator";
-
-    private final ActivityHandler mActivityHandler;
 
     private boolean mInitialStateCaptured;
-    private long mScreenOffTimeoutInMs;
 
-    private final SensorSettingContainer mAirplaneMode;
-    private final SensorSettingContainer mScreenBrightnessMode;
-    private final SensorSettingContainer mAutoRotateScreenMode;
-    private final SensorSettingContainer mKeepScreenOnMode;
-    private final SensorSettingContainer mLocationMode;
+    private final ISensorTestStateContainer mStateContainer;
 
-    /**
-     * The handler is a facade for the Activity making use of the {@link SensorFeaturesDeactivator}.
-     */
-    public interface ActivityHandler {
-        ContentResolver getContentResolver();
-        void logInstructions(int instructionsResId, Object ... params);
-        void waitForUser();
-        void launchAndWaitForSubactivity(String action);
-        String getString(int resId, Object ... params);
-    }
+    private final SensorSettingContainer mAirplaneMode = new AirplaneModeSettingContainer();
+    private final SensorSettingContainer mScreenBrightnessMode =
+            new ScreenBrightnessModeSettingContainer();
+    private final SensorSettingContainer mAutoRotateScreenMode =
+            new AutoRotateScreenModeSettingContainer();
+    private final SensorSettingContainer mKeepScreenOnMode = new KeepScreenOnModeSettingContainer();
+    private final SensorSettingContainer mLocationMode = new LocationModeSettingContainer();
 
-    public SensorFeaturesDeactivator(ActivityHandler activityHandler) {
-        mActivityHandler = activityHandler;
-        mAirplaneMode = new AirplaneModeSettingContainer();
-        mScreenBrightnessMode = new ScreenBrightnessModeSettingContainer();
-        mAutoRotateScreenMode = new AutoRotateScreenModeSettingContainer();
-        mKeepScreenOnMode = new KeepScreenOnModeSettingContainer();
-        mLocationMode = new LocationModeSettingContainer();
+    public SensorFeaturesDeactivator(ISensorTestStateContainer stateContainer) {
+        mStateContainer = stateContainer;
     }
 
     public synchronized void requestDeactivationOfFeatures() {
         captureInitialState();
 
-        mAirplaneMode.requestToSetMode(true);
-        mScreenBrightnessMode.requestToSetMode(false);
-        mAutoRotateScreenMode.requestToSetMode(false);
-        mKeepScreenOnMode.requestToSetMode(false);
-        mLocationMode.requestToSetMode(false);
+        mAirplaneMode.requestToSetMode(mStateContainer, true);
+        mScreenBrightnessMode.requestToSetMode(mStateContainer, false);
+        mAutoRotateScreenMode.requestToSetMode(mStateContainer, false);
+        mKeepScreenOnMode.requestToSetMode(mStateContainer, false);
+        mLocationMode.requestToSetMode(mStateContainer, false);
 
         // TODO: try to use adb shell dumpsys sensorservice to find out if there are clients still
         // registered at this time
-        mActivityHandler.logInstructions(R.string.snsr_sensor_feature_deactivation);
-        mActivityHandler.waitForUser();
+        mStateContainer.getTestLogger()
+                .logInstructions(R.string.snsr_sensor_feature_deactivation);
+        mStateContainer.waitForUserToContinue();
     }
 
     public synchronized void requestToRestoreFeatures() {
         if (!isInitialStateCaptured()) {
             return;
         }
-        mAirplaneMode.requestToResetMode();
-        mScreenBrightnessMode.requestToResetMode();
-        mAutoRotateScreenMode.requestToResetMode();
-        mKeepScreenOnMode.requestToResetMode();
-        mLocationMode.requestToResetMode();
-    }
 
-    public synchronized void requestToResetScreenOffTimeout() throws InterruptedException {
-        if (!isInitialStateCaptured()) {
-            return;
-        }
-        try {
-            requestToSetScreenOffTimeout(mScreenOffTimeoutInMs, TimeUnit.MILLISECONDS);
-        } catch (IllegalStateException e) {
-            Log.e(TAG, "Error resetting screen off timeout.", e);
-        }
-    }
-
-    public synchronized void requestToSetScreenOffTimeout(long timeout, TimeUnit timeUnit)
-            throws InterruptedException {
-        captureInitialState();
-
-        String settingName = mActivityHandler.getString(R.string.snsr_setting_auto_screen_off_mode);
-        long timeoutInMs = TimeUnit.MILLISECONDS.convert(timeout, timeUnit);
-        long timeoutInSec = TimeUnit.SECONDS.convert(timeout, timeUnit);
-        if (isScreenOffTimeout(timeoutInMs)) {
-            mActivityHandler.logInstructions(
-                    R.string.snsr_setting_mode_set,
-                    settingName,
-                    timeoutInSec + "s");
-            return;
-        }
-
-        mActivityHandler.logInstructions(
-                R.string.snsr_setting_mode_request,
-                settingName,
-                timeoutInSec + "s");
-        mActivityHandler.logInstructions(R.string.snsr_on_complete_return);
-        mActivityHandler.waitForUser();
-        mActivityHandler.launchAndWaitForSubactivity(Settings.ACTION_DISPLAY_SETTINGS);
-
-        if (!isScreenOffTimeout(timeoutInMs)) {
-            String message = mActivityHandler
-                    .getString(R.string.snsr_setting_mode_not_set, settingName, timeoutInSec + "s");
-            throw new IllegalStateException(message);
-        }
+        mAirplaneMode.requestToResetMode(mStateContainer);
+        mScreenBrightnessMode.requestToResetMode(mStateContainer);
+        mAutoRotateScreenMode.requestToResetMode(mStateContainer);
+        mKeepScreenOnMode.requestToResetMode(mStateContainer);
+        mLocationMode.requestToResetMode(mStateContainer);
     }
 
     private void captureInitialState() {
@@ -142,7 +86,6 @@
         mAutoRotateScreenMode.captureInitialState();
         mLocationMode.captureInitialState();
         mKeepScreenOnMode.captureInitialState();
-        mScreenOffTimeoutInMs = getScreenOffTimeoutInMs();
 
         mInitialStateCaptured = true;
     }
@@ -151,27 +94,14 @@
         return mInitialStateCaptured;
     }
 
-    private boolean isScreenOffTimeout(long expectedTimeoutInMs) {
-        return getScreenOffTimeoutInMs() == expectedTimeoutInMs;
-    }
-
-    private long getScreenOffTimeoutInMs() {
-        return Settings.System.getLong(
-                mActivityHandler.getContentResolver(),
-                Settings.System.SCREEN_OFF_TIMEOUT,
-                Integer.MAX_VALUE);
-    }
-
     private class AirplaneModeSettingContainer extends SensorSettingContainer {
         public AirplaneModeSettingContainer() {
-            super(mActivityHandler,
-                    Settings.ACTION_WIRELESS_SETTINGS,
-                    R.string.snsr_setting_airplane_mode);
+            super(Settings.ACTION_WIRELESS_SETTINGS, R.string.snsr_setting_airplane_mode);
         }
 
         @Override
         protected int getSettingMode() {
-            ContentResolver contentResolver = mActivityHandler.getContentResolver();
+            ContentResolver contentResolver = mStateContainer.getContentResolver();
             // Settings.System.AIRPLANE_MODE_ON is deprecated in API 17
             if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
                 return Settings.System.getInt(contentResolver, Settings.System.AIRPLANE_MODE_ON, 0);
@@ -183,15 +113,13 @@
 
     private class ScreenBrightnessModeSettingContainer extends SensorSettingContainer {
         public ScreenBrightnessModeSettingContainer() {
-            super(mActivityHandler,
-                    Settings.ACTION_DISPLAY_SETTINGS,
-                    R.string.snsr_setting_screen_brightness_mode);
+            super(Settings.ACTION_DISPLAY_SETTINGS, R.string.snsr_setting_screen_brightness_mode);
         }
 
         @Override
         public int getSettingMode() {
             return Settings.System.getInt(
-                    mActivityHandler.getContentResolver(),
+                    mStateContainer.getContentResolver(),
                     Settings.System.SCREEN_BRIGHTNESS_MODE,
                     Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
         }
@@ -199,15 +127,14 @@
 
     private class AutoRotateScreenModeSettingContainer extends SensorSettingContainer {
         public AutoRotateScreenModeSettingContainer() {
-            super(mActivityHandler,
-                    Settings.ACTION_ACCESSIBILITY_SETTINGS,
+            super(Settings.ACTION_ACCESSIBILITY_SETTINGS,
                     R.string.snsr_setting_auto_rotate_screen_mode);
         }
 
         @Override
         protected int getSettingMode() {
             return Settings.System.getInt(
-                    mActivityHandler.getContentResolver(),
+                    mStateContainer.getContentResolver(),
                     Settings.System.ACCELEROMETER_ROTATION,
                     0 /* default */);
         }
@@ -215,15 +142,14 @@
 
     private class KeepScreenOnModeSettingContainer extends SensorSettingContainer {
         public KeepScreenOnModeSettingContainer() {
-            super(mActivityHandler,
-                    Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS,
+            super(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS,
                     R.string.snsr_setting_keep_screen_on);
         }
 
         @Override
         protected int getSettingMode() {
             return Settings.Global.getInt(
-                    mActivityHandler.getContentResolver(),
+                    mStateContainer.getContentResolver(),
                     Settings.Global.STAY_ON_WHILE_PLUGGED_IN,
                     0);
         }
@@ -231,15 +157,13 @@
 
     private class LocationModeSettingContainer extends SensorSettingContainer {
         public LocationModeSettingContainer() {
-            super(mActivityHandler,
-                    Settings.ACTION_LOCATION_SOURCE_SETTINGS,
-                    R.string.snsr_setting_location_mode);
+            super(Settings.ACTION_LOCATION_SOURCE_SETTINGS, R.string.snsr_setting_location_mode);
         }
 
         @Override
         protected int getSettingMode() {
             return Settings.Secure.getInt(
-                    mActivityHandler.getContentResolver(),
+                    mStateContainer.getContentResolver(),
                     Settings.Secure.LOCATION_MODE,
                     Settings.Secure.LOCATION_MODE_OFF);
         }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorSettingContainer.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorSettingContainer.java
index 00a96b5..27fa699 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorSettingContainer.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorSettingContainer.java
@@ -17,6 +17,8 @@
 package com.android.cts.verifier.sensors.helpers;
 
 import com.android.cts.verifier.R;
+import com.android.cts.verifier.sensors.base.BaseSensorTestActivity;
+import com.android.cts.verifier.sensors.base.ISensorTestStateContainer;
 
 import android.util.Log;
 
@@ -28,17 +30,12 @@
  */
 abstract class SensorSettingContainer {
     private static final String TAG = "SensorSettingContainer";
-    private final SensorFeaturesDeactivator.ActivityHandler mActivityHandler;
     private final String mAction;
     private final int mSettingNameResId;
 
     private boolean mCapturedModeOn;
 
-    public SensorSettingContainer(
-            SensorFeaturesDeactivator.ActivityHandler activityHandler,
-            String action,
-            int settingNameResId) {
-        mActivityHandler = activityHandler;
+    public SensorSettingContainer(String action, int settingNameResId) {
         mAction = action;
         mSettingNameResId = settingNameResId;
     }
@@ -47,28 +44,31 @@
         mCapturedModeOn = getCurrentSettingMode();
     }
 
-    public synchronized void requestToSetMode(boolean modeOn) {
-        String settingName = mActivityHandler.getString(mSettingNameResId);
+    public synchronized void requestToSetMode(
+            ISensorTestStateContainer stateContainer,
+            boolean modeOn) {
+        BaseSensorTestActivity.SensorTestLogger logger = stateContainer.getTestLogger();
+        String settingName = stateContainer.getString(mSettingNameResId);
         if (getCurrentSettingMode() == modeOn) {
-            mActivityHandler.logInstructions(R.string.snsr_setting_mode_set, settingName, modeOn);
+            logger.logInstructions(R.string.snsr_setting_mode_set, settingName, modeOn);
             return;
         }
 
-        mActivityHandler.logInstructions(R.string.snsr_setting_mode_request, settingName, modeOn);
-        mActivityHandler.logInstructions(R.string.snsr_on_complete_return);
-        mActivityHandler.waitForUser();
+        logger.logInstructions(R.string.snsr_setting_mode_request, settingName, modeOn);
+        logger.logInstructions(R.string.snsr_on_complete_return);
+        stateContainer.waitForUserToContinue();
 
-        mActivityHandler.launchAndWaitForSubactivity(mAction);
+        stateContainer.executeActivity(mAction);
         if (getCurrentSettingMode() != modeOn) {
-            String message = mActivityHandler
+            String message = stateContainer
                     .getString(R.string.snsr_setting_mode_not_set, settingName, modeOn);
             throw new IllegalStateException(message);
         }
     }
 
-    public synchronized void requestToResetMode() {
+    public synchronized void requestToResetMode(ISensorTestStateContainer stateContainer) {
         try {
-            requestToSetMode(mCapturedModeOn);
+            requestToSetMode(stateContainer, mCapturedModeOn);
         } catch (IllegalStateException e) {
             Log.e(TAG, "Error restoring state of action: " + mAction, e);
         }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorTestScreenManipulator.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorTestScreenManipulator.java
new file mode 100644
index 0000000..8986cd9
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/helpers/SensorTestScreenManipulator.java
@@ -0,0 +1,138 @@
+/*
+ * 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.helpers;
+
+import com.android.cts.verifier.sensors.base.BaseSensorTestActivity;
+import com.android.cts.verifier.sensors.base.ISensorTestStateContainer;
+
+import android.app.Activity;
+import android.app.admin.DeviceAdminInfo;
+import android.app.admin.DevicePolicyManager;
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.text.TextUtils;
+
+/**
+ * A class that provides functionality to manipulate the state of the device's screen.
+ */
+public class SensorTestScreenManipulator {
+
+    private final Context mContext;
+    private final DevicePolicyManager mDevicePolicyManager;
+    private final ComponentName mComponentName;
+
+    private volatile InternalBroadcastReceiver mBroadcastReceiver;
+    private volatile boolean mTurnOffScreenOnPowerDisconnected;
+
+    public SensorTestScreenManipulator(Context context) {
+        mContext = context;
+        mComponentName = SensorDeviceAdminReceiver.getComponentName(context);
+        mDevicePolicyManager =
+                (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
+    }
+
+    /**
+     * Initializes the current instance.
+     * Initialization should usually happen inside {@link BaseSensorTestActivity#activitySetUp}.
+     *
+     * NOTE: Initialization will bring up an Activity to let the user activate the Device Admin,
+     * this method will block until the user completes the operation.
+     */
+    public synchronized void initialize(ISensorTestStateContainer stateContainer) {
+        if (!isDeviceAdminInitialized()) {
+            Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
+            intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mComponentName);
+            int resultCode = stateContainer.executeActivity(intent);
+            if (resultCode != Activity.RESULT_OK) {
+                throw new IllegalStateException(
+                        "Test cannot execute without Activating the Device Administrator.");
+            }
+        }
+
+        if (mBroadcastReceiver == null) {
+            mBroadcastReceiver = new InternalBroadcastReceiver();
+            IntentFilter intentFilter = new IntentFilter();
+            intentFilter.addAction(Intent.ACTION_POWER_DISCONNECTED);
+            mContext.registerReceiver(mBroadcastReceiver, intentFilter);
+        }
+    }
+
+    /**
+     * Closes the current instance.
+     * This operation should usually happen inside {@link BaseSensorTestActivity#activityCleanUp}.
+     */
+    public synchronized  void close() {
+        if (mBroadcastReceiver != null) {
+            mContext.unregisterReceiver(mBroadcastReceiver);
+            mBroadcastReceiver = null;
+        }
+    }
+
+    /**
+     * Instruct the device to turn off the screen immediately.
+     */
+    public synchronized void turnScreenOff() {
+        ensureDeviceAdminInitialized();
+        mDevicePolicyManager.lockNow();
+    }
+
+    /**
+     * Queues a request to turn off the screen off when the device has been disconnected from a
+     * power source (usually upon USB disconnected).
+     *
+     * (It is useful for Sensor Power Tests, as the Power Monitor usually detaches itself from the
+     * device before beginning to sample data).
+     */
+    public synchronized void turnScreenOffOnNextPowerDisconnect() {
+        ensureDeviceAdminInitialized();
+        mTurnOffScreenOnPowerDisconnected = true;
+    }
+
+    private void ensureDeviceAdminInitialized() throws IllegalStateException {
+        if (!isDeviceAdminInitialized()) {
+            throw new IllegalStateException("Component must be initialized before it can be used.");
+        }
+    }
+
+    private boolean isDeviceAdminInitialized() {
+        if (!mDevicePolicyManager.isAdminActive(mComponentName)) {
+            return false;
+        }
+        return mDevicePolicyManager
+                .hasGrantedPolicy(mComponentName, DeviceAdminInfo.USES_POLICY_FORCE_LOCK);
+    }
+
+    private class InternalBroadcastReceiver extends BroadcastReceiver {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            String action = intent.getAction();
+
+            if (mTurnOffScreenOnPowerDisconnected &&
+                    TextUtils.equals(action, Intent.ACTION_POWER_DISCONNECTED)) {
+                turnScreenOff();
+
+                // reset the flag after it has triggered once, we try to avoid cases when the test
+                // might leave the receiver enabled after itself,
+                // this approach still provides a way to multiplex one time requests
+                mTurnOffScreenOnPowerDisconnected = false;
+            }
+        }
+    }
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/reporting/SensorTestDetails.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/reporting/SensorTestDetails.java
index 6ca4e30..dcf6c4a 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/reporting/SensorTestDetails.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/reporting/SensorTestDetails.java
@@ -81,6 +81,10 @@
         return mSummary;
     }
 
+    public SensorTestDetails cloneAndChangeResultCode(ResultCode resultCode) {
+        return new SensorTestDetails(mName, resultCode, mSummary);
+    }
+
     @Override
     public String toString() {
         return String.format("%s|%s|%s", mName, mResultCode.name(), mSummary);
diff --git a/build/test_executable.mk b/build/test_executable.mk
index 5cccd1c..e0352ba 100644
--- a/build/test_executable.mk
+++ b/build/test_executable.mk
@@ -41,4 +41,5 @@
 						-p $(PRIVATE_TEST_PACKAGE) \
 						-e $(CTS_EXPECTATIONS) \
 						-b $(CTS_UNSUPPORTED_ABIS) \
+						-a $(CTS_TARGET_ARCH) \
 						-o $@
diff --git a/build/test_gtest_package.mk b/build/test_gtest_package.mk
index c3471ed..6868081 100644
--- a/build/test_gtest_package.mk
+++ b/build/test_gtest_package.mk
@@ -50,4 +50,5 @@
 						-p $(PRIVATE_TEST_PACKAGE) \
 						-e $(CTS_EXPECTATIONS) \
 						-b $(CTS_UNSUPPORTED_ABIS) \
+						-a $(CTS_TARGET_ARCH) \
 						-o $@
diff --git a/build/test_host_java_library.mk b/build/test_host_java_library.mk
index cb44010..baf9e75 100644
--- a/build/test_host_java_library.mk
+++ b/build/test_host_java_library.mk
@@ -36,4 +36,5 @@
 						-p $(PRIVATE_TEST_PACKAGE) \
 						-e $(CTS_EXPECTATIONS) \
 						-b $(CTS_UNSUPPORTED_ABIS) \
+						-a $(CTS_TARGET_ARCH) \
 						-o $@
diff --git a/build/test_package.mk b/build/test_package.mk
index 7f61e60..353ae07 100644
--- a/build/test_package.mk
+++ b/build/test_package.mk
@@ -58,4 +58,5 @@
 						-p $(PRIVATE_TEST_PACKAGE) \
 						-e $(CTS_EXPECTATIONS) \
 						-b $(CTS_UNSUPPORTED_ABIS) \
+						-a $(CTS_TARGET_ARCH) \
 						-o $@
diff --git a/build/test_target_java_library.mk b/build/test_target_java_library.mk
index d526805..c0d7a2a 100644
--- a/build/test_target_java_library.mk
+++ b/build/test_target_java_library.mk
@@ -41,5 +41,6 @@
 						-p $(PRIVATE_TEST_PACKAGE) \
 						-e $(CTS_EXPECTATIONS) \
 						-b $(CTS_UNSUPPORTED_ABIS) \
+						-a $(CTS_TARGET_ARCH) \
 						-x "runtimeArgs->$(PRIVATE_RUNTIME_ARGS)" \
 						-o $@
diff --git a/build/test_uiautomator.mk b/build/test_uiautomator.mk
index 7757027..5e2f07a 100644
--- a/build/test_uiautomator.mk
+++ b/build/test_uiautomator.mk
@@ -49,4 +49,5 @@
 						-r $(PRIVATE_TEST_APP_PACKAGE) \
 						-e $(CTS_EXPECTATIONS) \
 						-b $(CTS_UNSUPPORTED_ABIS) \
+						-a $(CTS_TARGET_ARCH) \
 						-o $@
diff --git a/common/host-side/tradefed/Android.mk b/common/host-side/tradefed/Android.mk
index 2cb559a..8ff7c8c 100644
--- a/common/host-side/tradefed/Android.mk
+++ b/common/host-side/tradefed/Android.mk
@@ -28,7 +28,7 @@
 
 LOCAL_MODULE_TAGS := optional
 
-LOCAL_JAVA_LIBRARIES := ddmlib-prebuilt tradefed-prebuilt hosttestlib compatibility-common-util-hostsidelib_v2
+LOCAL_JAVA_LIBRARIES := tradefed-prebuilt hosttestlib compatibility-common-util-hostsidelib_v2
 
 include $(BUILD_HOST_JAVA_LIBRARY)
 
@@ -44,7 +44,7 @@
 
 LOCAL_MODULE_TAGS := optional
 
-LOCAL_JAVA_LIBRARIES := ddmlib-prebuilt tradefed-prebuilt compatibility-tradefed_v2 junit
+LOCAL_JAVA_LIBRARIES := tradefed-prebuilt compatibility-tradefed_v2 junit
 
 LOCAL_STATIC_JAVA_LIBRARIES := easymock
 
diff --git a/hostsidetests/aadb/Android.mk b/hostsidetests/aadb/Android.mk
index 2f2113c..b9551d1 100644
--- a/hostsidetests/aadb/Android.mk
+++ b/hostsidetests/aadb/Android.mk
@@ -21,7 +21,7 @@
 
 LOCAL_MODULE := CtsAdbTests
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt junit
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
 
 LOCAL_CTS_TEST_PACKAGE := android.aadb
 
diff --git a/hostsidetests/appsecurity/Android.mk b/hostsidetests/appsecurity/Android.mk
index 4dd8d5c..61f9a4d 100644
--- a/hostsidetests/appsecurity/Android.mk
+++ b/hostsidetests/appsecurity/Android.mk
@@ -21,7 +21,7 @@
 
 LOCAL_MODULE := CtsAppSecurityTests
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt junit
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
 
 LOCAL_CTS_TEST_PACKAGE := android.tests.appsecurity
 
diff --git a/hostsidetests/appsecurity/src/com/android/cts/appsecurity/AppSecurityTests.java b/hostsidetests/appsecurity/src/com/android/cts/appsecurity/AppSecurityTests.java
index a0590d9..9dc51c9 100644
--- a/hostsidetests/appsecurity/src/com/android/cts/appsecurity/AppSecurityTests.java
+++ b/hostsidetests/appsecurity/src/com/android/cts/appsecurity/AppSecurityTests.java
@@ -22,13 +22,13 @@
 import com.android.ddmlib.testrunner.InstrumentationResultParser;
 import com.android.ddmlib.testrunner.RemoteAndroidTestRunner;
 import com.android.ddmlib.testrunner.TestIdentifier;
+import com.android.ddmlib.testrunner.TestResult;
+import com.android.ddmlib.testrunner.TestResult.TestStatus;
+import com.android.ddmlib.testrunner.TestRunResult;
 import com.android.tradefed.build.IBuildInfo;
 import com.android.tradefed.device.DeviceNotAvailableException;
 import com.android.tradefed.device.ITestDevice;
 import com.android.tradefed.result.CollectingTestListener;
-import com.android.tradefed.result.TestResult;
-import com.android.tradefed.result.TestResult.TestStatus;
-import com.android.tradefed.result.TestRunResult;
 import com.android.tradefed.testtype.DeviceTestCase;
 import com.android.tradefed.testtype.IAbi;
 import com.android.tradefed.testtype.IAbiReceiver;
diff --git a/hostsidetests/devicepolicy/.gitignore b/hostsidetests/devicepolicy/.gitignore
new file mode 100644
index 0000000..5e56e04
--- /dev/null
+++ b/hostsidetests/devicepolicy/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/hostsidetests/devicepolicy/Android.mk b/hostsidetests/devicepolicy/Android.mk
index 1f51494..6708c3d 100644
--- a/hostsidetests/devicepolicy/Android.mk
+++ b/hostsidetests/devicepolicy/Android.mk
@@ -22,7 +22,7 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_JAVA_LIBRARIES := junit ddmlib-prebuilt tradefed-prebuilt tools-common-prebuilt cts-tradefed
+LOCAL_JAVA_LIBRARIES := tradefed-prebuilt tools-common-prebuilt cts-tradefed
 
 LOCAL_CTS_TEST_PACKAGE := android.adminhostside
 
diff --git a/hostsidetests/devicepolicy/app/ProfileOwner/Android.mk b/hostsidetests/devicepolicy/app/ProfileOwner/Android.mk
index a845163..baf540b 100644
--- a/hostsidetests/devicepolicy/app/ProfileOwner/Android.mk
+++ b/hostsidetests/devicepolicy/app/ProfileOwner/Android.mk
@@ -24,7 +24,7 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner cts-junit
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/devicepolicy/app/ProfileOwner/src/com/android/cts/profileowner/WipeDataTest.java b/hostsidetests/devicepolicy/app/ProfileOwner/src/com/android/cts/profileowner/WipeDataTest.java
new file mode 100644
index 0000000..2213d3b
--- /dev/null
+++ b/hostsidetests/devicepolicy/app/ProfileOwner/src/com/android/cts/profileowner/WipeDataTest.java
@@ -0,0 +1,80 @@
+/*
+ * 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.profileowner;
+
+import android.app.admin.DevicePolicyManager;
+import android.content.ComponentName;
+import android.content.Context;
+import android.os.Process;
+import android.os.UserHandle;
+import android.os.UserManager;
+
+import com.android.cts.profileowner.BaseProfileOwnerTest.BasicAdminReceiver;
+
+import org.junit.Ignore;
+
+/**
+ * Test wipeData() for use in managed profile. If called from a managed profile, wipeData() should
+ * remove the current managed profile. Also, no erasing of external storage should be allowed.
+ */
+public class WipeDataTest extends BaseProfileOwnerTest {
+
+    private UserManager mUserManager;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        // Make sure we are running in a managed profile, otherwise risk wiping the primary user's
+        // data.
+        assertTrue(mDevicePolicyManager.isAdminActive(ADMIN_RECEIVER_COMPONENT));
+        assertTrue(mDevicePolicyManager.isProfileOwnerApp(ADMIN_RECEIVER_COMPONENT.getPackageName()));
+        mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
+    }
+
+    public void testWipeData() throws InterruptedException {
+        try {
+            mDevicePolicyManager.wipeData(DevicePolicyManager.WIPE_EXTERNAL_STORAGE);
+            fail("Should not be able to wipe external storage from managed profile.");
+        } catch (SecurityException expected) {
+        }
+
+        UserHandle currentUser = Process.myUserHandle();
+        assertTrue(mUserManager.getUserProfiles().contains(currentUser));
+
+        mDevicePolicyManager.wipeData(0);
+
+        // ACTION_MANAGED_PROFILE_REMOVED is only sent to parent user.
+        // As a result, we have to poll in order to know when the profile
+        // is actually removed.
+        long epoch = System.currentTimeMillis();
+        while (System.currentTimeMillis() - epoch <= 10 * 1000) {
+            if (!mUserManager.getUserProfiles().contains(currentUser)) {
+                break;
+            }
+            Thread.sleep(250);
+        }
+
+        // Verify the profile is deleted
+        assertFalse(mUserManager.getUserProfiles().contains(currentUser));
+    }
+
+    // Override this test inherited from base class, as it will trigger another round of setUp()
+    // which would fail because the managed profile has been removed by this test.
+    @Override
+    @Ignore
+    public void testAndroidTestCaseSetupProperly() {
+    }
+}
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ProfileOwnerTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ProfileOwnerTest.java
index e2f2f4e..6d51f9e 100644
--- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ProfileOwnerTest.java
+++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ProfileOwnerTest.java
@@ -21,18 +21,18 @@
 import com.android.ddmlib.testrunner.InstrumentationResultParser;
 import com.android.ddmlib.testrunner.RemoteAndroidTestRunner;
 import com.android.ddmlib.testrunner.TestIdentifier;
+import com.android.ddmlib.testrunner.TestResult;
+import com.android.ddmlib.testrunner.TestResult.TestStatus;
+import com.android.ddmlib.testrunner.TestRunResult;
 import com.android.tradefed.build.IBuildInfo;
 import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.device.ITestDevice;
 import com.android.tradefed.log.LogUtil.CLog;
 import com.android.tradefed.result.CollectingTestListener;
-import com.android.tradefed.result.TestResult;
-import com.android.tradefed.result.TestResult.TestStatus;
-import com.android.tradefed.result.TestRunResult;
 import com.android.tradefed.testtype.DeviceTestCase;
 import com.android.tradefed.testtype.IBuildReceiver;
 
 import java.io.FileNotFoundException;
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Map;
 
@@ -90,12 +90,31 @@
         super.tearDown();
     }
 
+    /**
+     *  wipData() test removes the managed profile, so it needs to separated from other tests.
+     */
+    public void testWipeData() throws Exception {
+        if (!mHasFeature) {
+            return;
+        }
+        assertTrue(listUsers().contains(mUserId));
+        assertTrue(runDeviceTestsAsUser(PROFILE_OWNER_PKG, PROFILE_OWNER_PKG + ".WipeDataTest", mUserId));
+        // Note: the managed profile is removed by this test, which will make removeUserCommand in
+        // tearDown() to complain, but that should be OK since its result is not asserted.
+        assertFalse(listUsers().contains(mUserId));
+    }
+
     public void testProfileOwner() throws Exception {
         if (!mHasFeature) {
             return;
         }
-        // Runs all tests classes from the package, as the profile user.
-        assertTrue(runDeviceTestsAsUser(PROFILE_OWNER_PKG, null /*testClassName*/, mUserId));
+        String[] testClassNames = {
+                "ProfileOwnerSetupTest"
+        };
+        for (String className : testClassNames) {
+            String testClass = PROFILE_OWNER_PKG + "." + className;
+            assertTrue(runDeviceTestsAsUser(PROFILE_OWNER_PKG, testClass, mUserId));
+        }
     }
 
     private boolean hasDeviceFeatures(String[] requiredFeatures)
@@ -144,6 +163,26 @@
         return Integer.parseInt(tokens[tokens.length-1]);
     }
 
+    private ArrayList<Integer> listUsers() throws DeviceNotAvailableException {
+        String command = "pm list users";
+        String commandOutput = getDevice().executeShellCommand(command);
+
+        // Extract the id of all existing users.
+        String[] lines = commandOutput.split("\\r?\\n");
+        assertTrue(lines.length >= 1);
+        assertEquals(lines[0], "Users:");
+
+        ArrayList<Integer> users = new ArrayList<Integer>();
+        for (int i = 1; i < lines.length; i++) {
+            // Individual user is printed out like this:
+            // \tUserInfo{$id$:$name$:$Integer.toHexString(flags)$} [running]
+            String[] tokens = lines[i].split("\\{|\\}|:");
+            assertTrue(tokens.length == 4 || tokens.length == 5);
+            users.add(Integer.parseInt(tokens[1]));
+        }
+        return users;
+    }
+
     private void setProfileOwner(String componentName) throws DeviceNotAvailableException {
         String command = "dpm set-profile-owner '" + componentName + "' " + mUserId;
         String commandOutput = getDevice().executeShellCommand(command);
@@ -170,7 +209,7 @@
                 ? doRunTests(pkgName, testClassName, testMethodName)
                 : doRunTestsAsUser(pkgName, testClassName, testMethodName, userId);
         printTestResult(runResult);
-        return !runResult.hasFailedTests() && runResult.getNumPassedTests() > 0;
+        return !runResult.hasFailedTests() && runResult.getNumTestsInState(TestStatus.PASSED) > 0;
     }
 
     /** Helper method to run tests and return the listener that collected the results. */
diff --git a/hostsidetests/monkey/Android.mk b/hostsidetests/monkey/Android.mk
index 45d2e37..c9f3bb3 100644
--- a/hostsidetests/monkey/Android.mk
+++ b/hostsidetests/monkey/Android.mk
@@ -22,7 +22,7 @@
 
 LOCAL_MODULE := CtsMonkeyTestCases
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt junit
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
 
 # prefix zzz intentional to run this last
 LOCAL_CTS_TEST_PACKAGE := zzz.android.monkey
diff --git a/hostsidetests/sample/Android.mk b/hostsidetests/sample/Android.mk
index 1d3ddc8..e8cbdda 100644
--- a/hostsidetests/sample/Android.mk
+++ b/hostsidetests/sample/Android.mk
@@ -23,7 +23,7 @@
 # Must match the package name in CtsTestCaseList.mk
 LOCAL_MODULE := CtsSampleHostTestCases
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed ddmlib-prebuilt tradefed-prebuilt
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
 
 LOCAL_CTS_TEST_PACKAGE := android.host.sample
 
diff --git a/hostsidetests/security/Android.mk b/hostsidetests/security/Android.mk
index 9796979..a42ee8a 100644
--- a/hostsidetests/security/Android.mk
+++ b/hostsidetests/security/Android.mk
@@ -23,7 +23,7 @@
 # Must match the package name in CtsTestCaseList.mk
 LOCAL_MODULE := CtsSecurityHostTestCases
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed ddmlib-prebuilt tradefed-prebuilt
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
 
 LOCAL_CTS_TEST_PACKAGE := android.host.security
 
diff --git a/hostsidetests/theme/Android.mk b/hostsidetests/theme/Android.mk
index 8e283a3..71027c7 100644
--- a/hostsidetests/theme/Android.mk
+++ b/hostsidetests/theme/Android.mk
@@ -25,7 +25,7 @@
 # Must match the package name in CtsTestCaseList.mk
 LOCAL_MODULE := CtsThemeHostTestCases
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed ddmlib-prebuilt tradefed-prebuilt
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
 
 LOCAL_CTS_TEST_PACKAGE := android.host.theme
 
diff --git a/hostsidetests/usb/.gitignore b/hostsidetests/usb/.gitignore
new file mode 100644
index 0000000..5e56e04
--- /dev/null
+++ b/hostsidetests/usb/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/hostsidetests/usb/Android.mk b/hostsidetests/usb/Android.mk
index 488acbb..f93dfa4 100644
--- a/hostsidetests/usb/Android.mk
+++ b/hostsidetests/usb/Android.mk
@@ -21,7 +21,7 @@
 
 LOCAL_MODULE := CtsUsbTests
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt junit
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
 
 LOCAL_CTS_TEST_PACKAGE := android.usb
 
diff --git a/hostsidetests/usb/src/com/android/cts/usb/TestUsbTest.java b/hostsidetests/usb/src/com/android/cts/usb/TestUsbTest.java
index 2a69e39..4736e51 100644
--- a/hostsidetests/usb/src/com/android/cts/usb/TestUsbTest.java
+++ b/hostsidetests/usb/src/com/android/cts/usb/TestUsbTest.java
@@ -17,34 +17,21 @@
 
 import com.android.cts.tradefed.build.CtsBuildHelper;
 import com.android.cts.util.AbiUtils;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
 import com.android.ddmlib.testrunner.RemoteAndroidTestRunner;
-import com.android.ddmlib.testrunner.TestIdentifier;
+import com.android.ddmlib.testrunner.TestRunResult;
 import com.android.tradefed.build.IBuildInfo;
 import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.device.IFileEntry;
 import com.android.tradefed.device.ITestDevice;
-import com.android.tradefed.log.LogUtil.CLog;
 import com.android.tradefed.result.CollectingTestListener;
-import com.android.tradefed.result.InputStreamSource;
-import com.android.tradefed.result.TestRunResult;
 import com.android.tradefed.testtype.DeviceTestCase;
 import com.android.tradefed.testtype.IAbi;
 import com.android.tradefed.testtype.IAbiReceiver;
 import com.android.tradefed.testtype.IBuildReceiver;
 import com.android.tradefed.util.CommandResult;
 import com.android.tradefed.util.CommandStatus;
-import com.android.tradefed.util.FileUtil;
 import com.android.tradefed.util.RunUtil;
-import com.android.tradefed.util.StreamUtil;
 
-import java.io.BufferedInputStream;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
diff --git a/libs/commonutil/src/com/android/cts/util/AbiUtils.java b/libs/commonutil/src/com/android/cts/util/AbiUtils.java
index f28237c..4a34c6f 100644
--- a/libs/commonutil/src/com/android/cts/util/AbiUtils.java
+++ b/libs/commonutil/src/com/android/cts/util/AbiUtils.java
@@ -100,6 +100,9 @@
      * @return a new Set containing the ABIs.
      */
     public static Set<String> getAbisForArch(String arch) {
+        if (arch == null || arch.isEmpty() || !ARCH_TO_ABIS.containsKey(arch)) {
+            return getAbisSupportedByCts();
+        }
         return new HashSet<String>(ARCH_TO_ABIS.get(arch));
     }
 
diff --git a/suite/cts/hostTests/jank/Android.mk b/suite/cts/hostTests/jank/Android.mk
index a7d85de..a1f4d90 100644
--- a/suite/cts/hostTests/jank/Android.mk
+++ b/suite/cts/hostTests/jank/Android.mk
@@ -22,7 +22,7 @@
 
 LOCAL_MODULE := CtsHostJank
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
 
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
diff --git a/suite/cts/hostTests/uihost/.gitignore b/suite/cts/hostTests/uihost/.gitignore
new file mode 100644
index 0000000..5e56e04
--- /dev/null
+++ b/suite/cts/hostTests/uihost/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/suite/cts/hostTests/uihost/Android.mk b/suite/cts/hostTests/uihost/Android.mk
index dd51b6b..67ebcbb 100644
--- a/suite/cts/hostTests/uihost/Android.mk
+++ b/suite/cts/hostTests/uihost/Android.mk
@@ -22,7 +22,7 @@
 
 LOCAL_MODULE := CtsHostUi
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt junit
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
 
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
diff --git a/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java b/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java
index 9ccff10..100f448 100644
--- a/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java
+++ b/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java
@@ -22,17 +22,12 @@
 import com.android.cts.util.AbiUtils;
 import com.android.cts.util.ReportLog;
 import com.android.cts.util.TimeoutReq;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.Log.LogLevel;
 import com.android.ddmlib.testrunner.RemoteAndroidTestRunner;
 import com.android.ddmlib.testrunner.TestIdentifier;
+import com.android.ddmlib.testrunner.TestRunResult;
 import com.android.tradefed.build.IBuildInfo;
-import com.android.tradefed.device.DeviceNotAvailableException;
 import com.android.tradefed.device.ITestDevice;
-import com.android.tradefed.device.TestDeviceOptions;
 import com.android.tradefed.result.CollectingTestListener;
-import com.android.tradefed.result.TestResult;
-import com.android.tradefed.result.TestRunResult;
 import com.android.tradefed.testtype.DeviceTestCase;
 import com.android.tradefed.testtype.IAbi;
 import com.android.tradefed.testtype.IAbiReceiver;
diff --git a/tests/Android.mk b/tests/Android.mk
index 39a27fe..46a8ec2 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -12,28 +12,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)\
-              $(call all-renderscript-files-under, src)\
-
-LOCAL_JAVA_LIBRARIES := android.test.runner
-
-# Resource unit tests use a private locale and some densities
-LOCAL_AAPT_FLAGS = -c xx_YY -c cs -c small -c normal -c large -c xlarge \
-        -c 320dpi -c 240dpi -c 160dpi -c 32dpi \
-        -c kok,kok_IN,kok_419,kok_419_VARIANT,kok_Knda_419,kok_Knda_419_VARIANT,kok_VARIANT,kok_Knda,tgl,tgl_PH
-
-LOCAL_PACKAGE_NAME := CtsTestStubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestserver ctstestrunner
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_PACKAGE)
-
 # Build the test APK using its own makefile, and any other CTS-related packages
-include $(call all-makefiles-under,$(LOCAL_PATH))
+include $(call all-subdir-makefiles)
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
deleted file mode 100644
index b3798b1..0000000
--- a/tests/AndroidManifest.xml
+++ /dev/null
@@ -1,957 +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.
- -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.cts.stub">
-
-    <permission android:name="android.app.cts.permission.TEST_GRANTED"
-        android:protectionLevel="normal"
-            android:label="@string/permlab_testGranted"
-            android:description="@string/permdesc_testGranted">
-        <meta-data android:name="android.app.cts.string" android:value="foo" />
-        <meta-data android:name="android.app.cts.boolean" android:value="true" />
-        <meta-data android:name="android.app.cts.integer" android:value="100" />
-        <meta-data android:name="android.app.cts.color" android:value="#ff000000" />
-        <meta-data android:name="android.app.cts.float" android:value="100.1" />
-        <meta-data android:name="android.app.cts.reference" android:resource="@xml/metadata" />
-    </permission>
-
-    <uses-permission android:name="android.permission.GET_TASKS" />
-    <uses-permission android:name="android.permission.SET_WALLPAPER" />
-    <uses-permission android:name="android.permission.SET_TIME_ZONE" />
-    <uses-permission android:name="android.permission.WRITE_CALL_LOG" />
-    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
-    <uses-permission android:name="android.permission.WRITE_SOCIAL_STREAM" />
-    <uses-permission android:name="android.permission.READ_CALL_LOG" />
-    <uses-permission android:name="android.permission.READ_CONTACTS" />
-    <uses-permission android:name="android.permission.READ_SOCIAL_STREAM" />
-    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
-    <uses-permission android:name="android.permission.READ_CALENDAR" />
-    <uses-permission android:name="android.permission.DEVICE_POWER" />
-    <uses-permission android:name="android.permission.STATUS_BAR" />
-    <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
-    <uses-permission android:name="android.permission.VIBRATE" />
-    <uses-permission android:name="android.permission.PERSISTENT_ACTIVITY" />
-    <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
-    <uses-permission android:name="android.permission.INSTALL_PACKAGES" />
-    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
-    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
-    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
-    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
-    <uses-permission android:name="android.permission.WRITE_OWNER_DATA" />
-    <uses-permission android:name="android.permission.READ_OWNER_DATA" />
-    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
-    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-    <uses-permission android:name="android.permission.DELETE_CACHE_FILES" />
-    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
-    <uses-permission android:name="android.permission.ADD_SYSTEM_SERVICE" />
-    <uses-permission android:name="android.permission.BROADCAST_STICKY" />
-    <uses-permission android:name="android.app.cts.permission.TEST_GRANTED" />
-    <uses-permission android:name="android.permission.INJECT_EVENTS" />
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
-    <uses-permission android:name="android.permission.WAKE_LOCK" />
-    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
-    <uses-permission android:name="android.permission.CALL_PHONE" />
-    <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
-    <uses-permission android:name="android.permission.RECORD_AUDIO" />
-    <uses-permission android:name="android.permission.DUMP" />
-    <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" />
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
-    <uses-permission android:name="android.permission.WAKE_LOCK" />
-    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
-    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
-    <uses-permission android:name="android.permission.CAMERA" />
-    <uses-permission android:name="android.permission.SET_PREFERRED_APPLICATIONS" />
-    <uses-permission android:name="android.permission.INSTALL_PACKAGES" />
-    <uses-permission android:name="android.permission.GET_PACKAGE_SIZE" />
-    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
-    <uses-permission android:name="android.permission.SEND_SMS" />
-    <uses-permission android:name="android.permission.RECEIVE_SMS" />
-    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
-    <uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
-    <uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS" />
-    <uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" />
-    <uses-permission android:name="android.permission.READ_USER_DICTIONARY" />
-
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-    <uses-permission android:name="android.permission.READ_LOGS" />
-
-    <!-- telephony provider tests -->
-    <uses-permission android:name="android.permission.READ_SMS"/>
-    <uses-permission android:name="android.permission.WRITE_SMS"/>
-
-    <!-- content sync tests -->
-    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
-    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
-    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
-    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
-    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
-    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
-    <uses-permission android:name="android.permission.READ_SYNC_STATS" />
-
-    <!-- Used for ClonedSecureRandomTest -->
-    <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
-
-    <!-- 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"/>
-
-    <!-- Used for PackageManager test, don't delete this permission-group -->
-    <permission-group android:name="android.permission-group.COST_MONEY"/>
-    <!-- Used for PackageManager test, don't delete! -->
-    <uses-configuration/>
-    <uses-feature android:name="android.hardware.camera" />
-    <uses-feature android:glEsVersion="0x00020000" />
-    <feature-group/>
-    <feature-group>
-        <uses-feature android:glEsVersion="0x00030000" />
-        <uses-feature android:name="android.hardware.location" />
-    </feature-group>
-    <feature-group>
-        <uses-feature android:glEsVersion="0x00010001" />
-        <uses-feature android:name="android.hardware.camera" />
-    </feature-group>
-
-    <!-- maxRecents=1 keeps the recents list from filling memory with thumbnails -->
-    <application android:label="Android TestCase"
-                android:icon="@drawable/size_48x48"
-                android:maxRecents="1"
-                android:multiArch="true"
-                android:name="android.app.cts.MockApplication"
-                android:supportsRtl="true">
-
-        <activity android:name="android.app.cts.ActionBarActivity" />
-        <activity android:name="android.widget.cts.TwoLineListItemStubActivity"
-            android:label="TwoLineListItemStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.ViewFlipperStubActivity"
-            android:label="ViewFlipperStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.DialogStubActivity"
-            android:label="DialogStubActivity"
-            android:configChanges="keyboardHidden|orientation|screenSize">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.HorizontalScrollViewStubActivity"
-            android:label="HorizontalScrollViewStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.SlidingDrawerStubActivity"
-            android:label="SlidingDrawerStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.MockActivity" android:label="MockActivity">
-            <meta-data android:name="android.app.alias"
-                android:resource="@xml/alias" />
-            <meta-data android:name="android.app.intent.filter"
-                android:resource="@xml/intentfilter" />
-            <meta-data android:name="android.widget.layout"
-                android:resource="@xml/layout" />
-            <meta-data android:name="android.view.merge"
-                android:resource="@xml/merge" />
-        </activity>
-
-        <activity android:name="android.widget.cts.DigitalClockStubActivity"
-            android:label="DigitalClockStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.ImageViewStubActivity"
-            android:label="ImageViewStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.SeekBarStubActivity"
-            android:label="SeekBarStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.ScrollViewStubActivity"
-            android:label="ScrollViewStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.FrameLayoutStubActivity"
-            android:label="FrameLayoutStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.LinearLayoutStubActivity"
-            android:label="LinearLayoutStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.GridLayoutStubActivity"
-            android:label="GridLayoutStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.LayoutDirectionStubActivity"
-            android:label="LayoutDirectionStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.ProgressBarStubActivity"
-            android:label="ProgressBarStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.ChronometerStubActivity"
-            android:label="ChronometerStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.MediaControllerStubActivity"
-            android:label="MediaControllerStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.RatingBarStubActivity"
-            android:label="RatingBarStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.RemoteViewsStubActivity"
-            android:label="RemoteViewsStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.ViewGroupStubActivity"
-            android:label="WidgetViewGroupStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.VideoViewStubActivity"
-            android:configChanges="keyboardHidden|orientation|screenSize"
-            android:label="VideoViewStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.AutoCompleteStubActivity"
-            android:label="AutoCompleteStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.ViewAnimatorStubActivity" android:label="ViewAnimatorStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.GridViewStubActivity"
-            android:label="GridViewStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.RelativeLayoutStubActivity"
-            android:label="RelativeLayoutStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.FrameLayoutStubActivity"
-            android:label="FrameLayoutStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <service android:name="android.content.cts.MockContextWrapperService" />
-        <activity android:name=".content.ContextWrapperStubActivity"
-            android:label="ContextWrapperStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-            </intent-filter>
-        </activity>
-
-        <receiver android:name="android.content.cts.MockReceiverFirst">
-            <intent-filter android:priority="3">
-                <action android:name="android.content.cts.BroadcastReceiverTest.BROADCAST_TESTABORT" />
-            </intent-filter>
-        </receiver>
-        <receiver android:name="android.content.cts.MockReceiverAbort">
-            <intent-filter android:priority="2">
-                <action android:name="android.content.cts.BroadcastReceiverTest.BROADCAST_TESTABORT" />
-            </intent-filter>
-        </receiver>
-        <receiver android:name="android.content.cts.MockReceiver">
-            <intent-filter android:priority="1">
-                <action android:name="android.content.cts.BroadcastReceiverTest.BROADCAST_MOCKTEST" />
-                <action android:name="android.content.cts.BroadcastReceiverTest.BROADCAST_TESTABORT" />
-                <action android:name="android.content.cts.ContextWrapperTest.BROADCAST_TESTORDER" />
-            </intent-filter>
-        </receiver>
-
-        <activity android:name="android.provider.cts.BrowserStubActivity"
-            android:label="BrowserStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.content.cts.AvailableIntentsActivity"
-            android:label="AvailableIntentsActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.text.cts.EmojiStubActivity"
-            android:label="AvailableIntentsActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.TableStubActivity"
-            android:label="TableStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.TabHostStubActivity"
-            android:label="TabHostStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.view.animation.cts.GridLayoutAnimStubActivity"
-            android:label="GridLayoutAnimStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.view.animation.cts.LayoutAnimStubActivity"
-            android:label="LayoutAnimStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.webkit.cts.CookieSyncManagerStubActivity"
-            android:label="CookieSyncManagerStubActivity"
-            android:screenOrientation="nosensor">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.ExpandableListSimple"
-            android:label="ExpandableListSimple">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.StubActivity"
-            android:label="StubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.ExpandableListWithHeaders"
-            android:label="ExpandableListWithHeaders">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.GalleryStubActivity"
-            android:label="GalleryStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.MockPopupWindowStubActivity"
-            android:label="MockPopupWindowStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.ListViewStubActivity"
-            android:label="ListViewStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.TextViewStubActivity"
-            android:label="TextViewStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.DialerFilterStubActivity"
-            android:label="DialerFilterStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-        <activity android:name="android.widget.cts.MultiAutoCompleteTextViewStubActivity"
-            android:label="MultiAutoCompleteTextView Test Activity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.AdapterViewStubActivity"
-            android:label="AdapterViewStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.CheckedTextViewStubActivity"
-            android:label="CheckedTextViewStubActivity"/>
-
-        <activity android:name="android.hardware.cts.CameraStubActivity"
-            android:label="CameraStubActivity"
-            android:screenOrientation="landscape"
-            android:configChanges="keyboardHidden|orientation|screenSize">
-        </activity>
-
-        <activity android:name="android.hardware.camera2.cts.Camera2SurfaceViewStubActivity"
-            android:label="Camera2StubActivity"
-            android:screenOrientation="landscape"
-            android:configChanges="keyboardHidden|orientation|screenSize">
-        </activity>
-
-        <activity android:name="android.hardware.camera2.cts.Camera2MultiViewStubActivity"
-            android:label="Camera2MultiViewStubActivity"
-            android:screenOrientation="landscape"
-            android:configChanges="keyboardHidden|orientation|screenSize">
-        </activity>
-
-        <activity android:name="android.view.inputmethod.cts.InputMethodStubActivity"
-            android:label="InputMethodStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-        <service android:name="android.view.inputmethod.cts.InputMethodInfoStub"
-            android:label="InputMethodInfoStub">
-            <intent-filter>
-                <action android:name="android.view.InputMethod" />
-            </intent-filter>
-            <meta-data android:name="android.view.im"
-                android:resource="@xml/method" />
-        </service>
-
-        <activity android:name="android.text.method.cts.KeyListenerStubActivity"
-            android:label="KeyListenerStubActivity"/>
-
-        <activity android:name="android.text.method.cts.StubActivity"
-            android:label="StubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.text.style.cts.URLSpanStubActivity"
-            android:label="URLSpanStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.text.style.cts.MockURLSpanTestActivity"
-            android:label="MockURLSpanTestActivity"
-            android:launchMode="singleTask"
-            android:alwaysRetainTaskState="true"
-            android:configChanges="orientation|keyboardHidden">
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="android.intent.category.BROWSABLE" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-                <data android:scheme="ctstest" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.widget.cts.ZoomButtonStubActivity"
-            android:label="ZoomButtonStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.MockApplicationActivity"
-            android:label="MockApplicationActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.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" />
-                <data android:mimeType="vnd.android.cursor.dir/person" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.AliasActivityStub">
-            <meta-data android:name="android.app.alias"
-                android:resource="@xml/alias" />
-        </activity>
-
-        <activity android:name="android.webkit.cts.WebViewStubActivity"
-            android:label="WebViewStubActivity"
-            android:screenOrientation="nosensor">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.webkit.cts.WebViewStartupStubActivity"
-            android:label="WebViewStartupStubActivity"
-            android:screenOrientation="nosensor">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.ChildActivity"
-                        android:label="ChildActivity" />
-
-        <receiver android:name="android.app.cts.MockReceiver">
-            <intent-filter>
-                <action android:name="android.app.cts.PendingIntentTest.TEST_RECEIVER" />
-            </intent-filter>
-        </receiver>
-
-        <service android:name="android.app.cts.MockService" />
-
-        <activity android:name="android.app.cts.SearchManagerStubActivity"
-                android:label="SearchManagerStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.SEARCH" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-            <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" />
-        </activity>
-
-        <service android:name="android.app.cts.LocalService">
-            <intent-filter>
-                <action android:name="android.app.cts.activity.SERVICE_LOCAL" />
-            </intent-filter>
-            <meta-data android:name="android.app.cts.string" android:value="foo" />
-            <meta-data android:name="android.app.cts.boolean" android:value="true" />
-            <meta-data android:name="android.app.cts.integer" android:value="100" />
-            <meta-data android:name="android.app.cts.color" android:value="#ff000000" />
-            <meta-data android:name="android.app.cts.float" android:value="100.1" />
-            <meta-data android:name="android.app.cts.reference" android:resource="@xml/metadata" />
-        </service>
-
-        <service android:name="android.app.cts.LocalGrantedService"
-             android:permission="android.app.cts.permission.TEST_GRANTED">
-            <intent-filter>
-                <action android:name="android.app.cts.activity.SERVICE_LOCAL_GRANTED" />
-            </intent-filter>
-        </service>
-
-        <service android:name="android.app.cts.LocalDeniedService"
-               android:permission="android.app.cts.permission.TEST_DENIED">
-            <intent-filter>
-                <action android:name="android.app.cts.activity.SERVICE_LOCAL_DENIED" />
-            </intent-filter>
-        </service>
-
-        <activity android:name="android.app.cts.TestedScreen"
-                android:process=":remoteScreen">
-        </activity>
-        <activity android:name="android.app.cts.LocalScreen" android:multiprocess="true">
-        </activity>
-        <activity android:name="android.app.cts.ClearTop" android:multiprocess="true"
-               android:launchMode="singleTop">
-        </activity>
-        <activity android:name="android.app.cts.LocalDialog" android:multiprocess="true"
-               android:theme="@android:style/Theme.Dialog">
-        </activity>
-
-        <activity android:name="android.app.cts.PendingIntentStubActivity"
-             android:label="PendingIntentStubActivity"/>
-
-        <activity android:name="android.app.cts.LocalActivityManagerStubActivity"
-                        android:label="LocalActivityManagerStubActivity" />
-
-        <activity android:name="android.app.cts.LocalActivityManagerTestHelper"
-            android:label="LocalActivityManagerTestHelper" />
-
-        <activity android:name="android.app.cts.LaunchpadTabActivity" android:multiprocess="true">
-        </activity>
-
-        <activity android:name="android.app.cts.LocalActivity" android:multiprocess="true">
-            <meta-data android:name="android.app.cts.string" android:value="foo" />
-            <meta-data android:name="android.app.cts.boolean" android:value="true" />
-            <meta-data android:name="android.app.cts.integer" android:value="100" />
-            <meta-data android:name="android.app.cts.color" android:value="#ff000000" />
-            <meta-data android:name="android.app.cts.float" android:value="100.1" />
-            <meta-data android:name="android.app.cts.reference" android:resource="@xml/metadata" />
-        </activity>
-
-        <activity android:name="android.app.cts.TestedActivity"
-                android:process=":remoteActivity">
-        </activity>
-
-        <activity android:name="android.app.cts.ExpandableListTestActivity"
-            android:label="ExpandableListTestActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <!--Test for PackageManager-->
-        <activity android:name="android.content.pm.cts.TestPmActivity"
-                android:icon="@drawable/start">
-            <intent-filter>
-                <action android:name="android.intent.action.PMTEST" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-            <meta-data android:name="android.content.pm.cts.xmltest" android:resource="@xml/pm_test" />
-        </activity>
-        <activity android:name="android.content.pm.cts.TestPmCompare">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.INFO" />
-            </intent-filter>
-        </activity>
-        <!--Test for PackageManager-->
-        <service android:name="android.content.pm.cts.TestPmService">
-            <intent-filter>
-                <action android:name="android.content.pm.cts.activity.PMTEST_SERVICE" />
-            </intent-filter>
-        </service>
-        <!--Test for PackageManager-->
-        <receiver android:name="android.content.pm.cts.PmTestReceiver">
-            <intent-filter>
-                <action android:name="android.content.pm.cts.PackageManagerTest.PMTEST_RECEIVER" />
-            </intent-filter>
-        </receiver>
-
-        <activity android:name="android.app.cts.ChildTabActivity" android:label="ChildTabActivity" />
-
-        <activity android:name="android.app.cts.LauncherActivityStub"
-                  android:label="LauncherActivityStub" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.MockTabActivity" android:label="MockTabActivity" />
-
-        <activity android:name="android.app.cts.AppStubActivity" android:label="AppStubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.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" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.ActivityManagerStubFooActivity"
-            android:label="ActivityManagerStubFooActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.ActivityManagerRecentOneActivity"
-            android:label="ActivityManagerRecentOneActivity"
-            android:allowTaskReparenting="true"
-            android:taskAffinity="android.app.cts.recentOne">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.ActivityManagerRecentTwoActivity"
-            android:label="ActivityManagerRecentTwoActivity"
-            android:allowTaskReparenting="true"
-            android:taskAffinity="android.app.cts.recentTwo">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.ActivityManagerStubCrashActivity"
-            android:label="ActivityManagerStubCrashActivity"
-            android:multiprocess="true"
-            android:process=":ActivityManagerStubCrashActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.text.method.cts.StubActivity"
-            android:label="StubActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <service android:name="android.app.cts.StubRemoteService"
-            android:process=":remote">
-            <intent-filter>
-                <action
-                    android:name="android.app.cts.ISecondary" />
-                <action
-                    android:name="android.app.REMOTESERVICE" />
-            </intent-filter>
-        </service>
-
-        <activity android:name="android.app.ActivityGroup"
-            android:label="ActivityGroup" />
-
-        <activity android:name="android.app.cts.KeyguardManagerActivity"
-            android:label="KeyguardManagerActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.os.cts.CountDownTimerTestStub"
-            android:label="CountDownTimerTestStub">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <service android:name="android.os.cts.EmptyService"
-            android:process=":remote">
-            <intent-filter>
-                <action
-                    android:name="android.os.cts.IEmptyService" />
-                <action
-                    android:name="android.os.REMOTESERVICE" />
-            </intent-filter>
-        </service>
-
-        <service android:name="android.os.cts.MessengerService"
-                android:process=":messengerService">
-        </service>
-        <service android:name="android.app.cts.IntentServiceStub"/>
-
-        <activity android:name="android.app.cts.LaunchpadActivity"
-                  android:configChanges="keyboardHidden|orientation|screenSize"
-                  android:multiprocess="true">
-        </activity>
-
-        <service android:name="android.content.cts.MockSyncAdapterService" android:exported="true">
-            <intent-filter>
-                <action android:name="android.content.SyncAdapter" />
-            </intent-filter>
-
-            <meta-data android:name="android.content.SyncAdapter"
-                       android:resource="@xml/syncadapter" />
-        </service>
-
-        <service android:name="android.content.cts.MockAccountService" android:exported="true"
-                 >
-            <intent-filter>
-                <action android:name="android.accounts.AccountAuthenticator" />
-            </intent-filter>
-
-            <meta-data android:name="android.accounts.AccountAuthenticator"
-                       android:resource="@xml/authenticator" />
-        </service>
-
-        <activity android:name="android.opengl.cts.GLSurfaceViewStubActivity"
-                  android:label="GLSurfaceViewStub"/>
-
-        <activity android:name="android.opengl.cts.OpenGlEsVersionStubActivity"/>
-
-        <activity android:name="android.opengl.cts.EglConfigStubActivity"
-            android:configChanges="keyboardHidden|orientation|screenSize|uiMode" />
-
-        <activity android:name="android.opengl.cts.CompressedTextureStubActivity"
-            android:label="CompressedTextureStubActivity"
-            android:screenOrientation="nosensor">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.content.cts.ClipboardManagerListenerActivity"/>
-
-        <activity android:name="android.app.cts.ActivityManagerMemoryClassLaunchActivity" />
-
-        <activity android:name="android.app.cts.ActivityManagerMemoryClassTestActivity"
-                android:process=":memoryclass" />
-
-        <service android:name="android.speech.tts.cts.StubTextToSpeechService">
-            <intent-filter>
-                <action android:name="android.intent.action.TTS_SERVICE" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-        </service>
-
-        <activity android:name="android.renderscriptgraphics.cts.RenderscriptGLStubActivity"
-                  android:label="RenderscriptGLStub"/>
-
-        <service android:name="android.security.cts.activity.SecureRandomService"
-                 android:process=":secureRandom"/>
-    </application>
-
-
-    <!--Test for PackageManager, please put this at the very beginning-->
-    <instrumentation android:name="android.content.pm.cts.TestPmInstrumentation"
-        android:targetPackage="android"
-        android:label="PackageManager Instrumentation Test" />
-
-</manifest>
-
diff --git a/tests/app/Android.mk b/tests/app/Android.mk
new file mode 100644
index 0000000..69bf590
--- /dev/null
+++ b/tests/app/Android.mk
@@ -0,0 +1,35 @@
+# 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.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+# don't include this package in any target
+LOCAL_MODULE_TAGS := optional
+# and when built explicitly put it in the data partition
+LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
+
+LOCAL_PROGUARD_ENABLED := disabled
+
+LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common voip-common
+
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner ctstestserver
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src) \
+              src/android/app/cts/ISecondary.aidl
+
+LOCAL_PACKAGE_NAME := CtsAppTestStubs
+
+include $(BUILD_PACKAGE)
diff --git a/tests/app/AndroidManifest.xml b/tests/app/AndroidManifest.xml
new file mode 100644
index 0000000..b628a0c
--- /dev/null
+++ b/tests/app/AndroidManifest.xml
@@ -0,0 +1,283 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.android.cts.app.stub">
+
+    <permission android:name="android.app.cts.permission.TEST_GRANTED"
+        android:protectionLevel="normal"
+            android:label="@string/permlab_testGranted"
+            android:description="@string/permdesc_testGranted">
+        <meta-data android:name="android.app.cts.string" android:value="foo" />
+        <meta-data android:name="android.app.cts.boolean" android:value="true" />
+        <meta-data android:name="android.app.cts.integer" android:value="100" />
+        <meta-data android:name="android.app.cts.color" android:value="#ff000000" />
+        <meta-data android:name="android.app.cts.float" android:value="100.1" />
+        <meta-data android:name="android.app.cts.reference" android:resource="@xml/metadata" />
+    </permission>
+
+    <uses-permission android:name="android.app.cts.permission.TEST_GRANTED" />
+    <uses-permission android:name="android.permission.READ_CONTACTS" />
+    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+    <uses-permission android:name="android.permission.CAMERA" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
+    <uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+
+    <application android:label="Android TestCase"
+                android:icon="@drawable/size_48x48"
+                android:maxRecents="1"
+                android:multiArch="true"
+                android:name="android.app.cts.MockApplication"
+                android:supportsRtl="true">
+        <uses-library android:name="android.test.runner" />
+
+        <activity android:name="android.app.cts.ActionBarActivity" />
+
+        <activity android:name="android.app.cts.DialogStubActivity"
+            android:label="DialogStubActivity"
+            android:configChanges="keyboardHidden|orientation|screenSize">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.app.cts.MockActivity" android:label="MockActivity">
+            <meta-data android:name="android.app.alias"
+                android:resource="@xml/alias" />
+            <meta-data android:name="android.app.intent.filter"
+                android:resource="@xml/intentfilter" />
+        </activity>
+
+        <activity android:name="android.app.cts.MockApplicationActivity"
+            android:label="MockApplicationActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.app.cts.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" />
+                <data android:mimeType="vnd.android.cursor.dir/person" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.app.cts.AliasActivityStub">
+            <meta-data android:name="android.app.alias"
+                android:resource="@xml/alias" />
+        </activity>
+
+        <activity android:name="android.app.cts.ChildActivity"
+                        android:label="ChildActivity" />
+
+        <receiver android:name="android.app.cts.MockReceiver">
+            <intent-filter>
+                <action android:name="android.app.cts.PendingIntentTest.TEST_RECEIVER" />
+            </intent-filter>
+        </receiver>
+
+        <service android:name="android.app.cts.MockService" />
+
+        <activity android:name="android.app.cts.SearchManagerStubActivity"
+                android:label="SearchManagerStubActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.SEARCH" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+            <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" />
+        </activity>
+
+        <service android:name="android.app.cts.LocalService">
+            <intent-filter>
+                <action android:name="android.app.cts.activity.SERVICE_LOCAL" />
+            </intent-filter>
+            <meta-data android:name="android.app.cts.string" android:value="foo" />
+            <meta-data android:name="android.app.cts.boolean" android:value="true" />
+            <meta-data android:name="android.app.cts.integer" android:value="100" />
+            <meta-data android:name="android.app.cts.color" android:value="#ff000000" />
+            <meta-data android:name="android.app.cts.float" android:value="100.1" />
+            <meta-data android:name="android.app.cts.reference" android:resource="@xml/metadata" />
+        </service>
+
+        <service android:name="android.app.cts.LocalGrantedService"
+             android:permission="android.app.cts.permission.TEST_GRANTED">
+            <intent-filter>
+                <action android:name="android.app.cts.activity.SERVICE_LOCAL_GRANTED" />
+            </intent-filter>
+        </service>
+
+        <service android:name="android.app.cts.LocalDeniedService"
+               android:permission="android.app.cts.permission.TEST_DENIED">
+            <intent-filter>
+                <action android:name="android.app.cts.activity.SERVICE_LOCAL_DENIED" />
+            </intent-filter>
+        </service>
+
+        <activity android:name="android.app.cts.TestedScreen"
+                android:process=":remoteScreen">
+        </activity>
+        <activity android:name="android.app.cts.LocalScreen" android:multiprocess="true">
+        </activity>
+        <activity android:name="android.app.cts.ClearTop" android:multiprocess="true"
+               android:launchMode="singleTop">
+        </activity>
+        <activity android:name="android.app.cts.LocalDialog" android:multiprocess="true"
+               android:theme="@android:style/Theme.Dialog">
+        </activity>
+
+        <activity android:name="android.app.cts.PendingIntentStubActivity"
+             android:label="PendingIntentStubActivity"/>
+
+        <activity android:name="android.app.cts.LocalActivityManagerStubActivity"
+                        android:label="LocalActivityManagerStubActivity" />
+
+        <activity android:name="android.app.cts.LocalActivityManagerTestHelper"
+            android:label="LocalActivityManagerTestHelper" />
+
+        <activity android:name="android.app.cts.LaunchpadTabActivity" android:multiprocess="true">
+        </activity>
+
+        <activity android:name="android.app.cts.LocalActivity" android:multiprocess="true">
+            <meta-data android:name="android.app.cts.string" android:value="foo" />
+            <meta-data android:name="android.app.cts.boolean" android:value="true" />
+            <meta-data android:name="android.app.cts.integer" android:value="100" />
+            <meta-data android:name="android.app.cts.color" android:value="#ff000000" />
+            <meta-data android:name="android.app.cts.float" android:value="100.1" />
+            <meta-data android:name="android.app.cts.reference" android:resource="@xml/metadata" />
+        </activity>
+
+        <activity android:name="android.app.cts.TestedActivity"
+                android:process=":remoteActivity">
+        </activity>
+
+        <activity android:name="android.app.cts.ExpandableListTestActivity"
+            android:label="ExpandableListTestActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.app.cts.ChildTabActivity" android:label="ChildTabActivity" />
+
+        <activity android:name="android.app.cts.LauncherActivityStub"
+                  android:label="LauncherActivityStub" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.app.cts.MockTabActivity" android:label="MockTabActivity" />
+
+        <activity android:name="android.app.cts.AppStubActivity" android:label="AppStubActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.app.cts.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" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.app.cts.ActivityManagerStubFooActivity"
+            android:label="ActivityManagerStubFooActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.app.cts.ActivityManagerRecentOneActivity"
+            android:label="ActivityManagerRecentOneActivity"
+            android:allowTaskReparenting="true"
+            android:taskAffinity="android.app.cts.recentOne">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.app.cts.ActivityManagerRecentTwoActivity"
+            android:label="ActivityManagerRecentTwoActivity"
+            android:allowTaskReparenting="true"
+            android:taskAffinity="android.app.cts.recentTwo">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.app.cts.ActivityManagerStubCrashActivity"
+            android:label="ActivityManagerStubCrashActivity"
+            android:multiprocess="true"
+            android:process=":ActivityManagerStubCrashActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+            </intent-filter>
+        </activity>
+
+        <service android:name="android.app.cts.StubRemoteService"
+            android:process=":remote">
+            <intent-filter>
+                <action
+                    android:name="android.app.cts.ISecondary" />
+                <action
+                    android:name="android.app.REMOTESERVICE" />
+            </intent-filter>
+        </service>
+
+        <activity android:name="android.app.ActivityGroup"
+            android:label="ActivityGroup" />
+
+        <activity android:name="android.app.cts.KeyguardManagerActivity"
+            android:label="KeyguardManagerActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <service android:name="android.app.cts.IntentServiceStub"/>
+
+        <activity android:name="android.app.cts.LaunchpadActivity"
+                  android:configChanges="keyboardHidden|orientation|screenSize"
+                  android:multiprocess="true">
+        </activity>
+
+        <activity android:name="android.app.cts.ActivityManagerMemoryClassLaunchActivity" />
+
+        <activity android:name="android.app.cts.ActivityManagerMemoryClassTestActivity"
+                android:process=":memoryclass" />
+
+    </application>
+
+</manifest>
+
diff --git a/tests/tests/app/assets/noiseandchirps b/tests/app/assets/noiseandchirps
similarity index 100%
rename from tests/tests/app/assets/noiseandchirps
rename to tests/app/assets/noiseandchirps
Binary files differ
diff --git a/tests/tests/app/assets/noiseandchirps.mp3 b/tests/app/assets/noiseandchirps.mp3
similarity index 100%
rename from tests/tests/app/assets/noiseandchirps.mp3
rename to tests/app/assets/noiseandchirps.mp3
Binary files differ
diff --git a/tests/tests/app/assets/noiseandchirps.ogg b/tests/app/assets/noiseandchirps.ogg
similarity index 100%
rename from tests/tests/app/assets/noiseandchirps.ogg
rename to tests/app/assets/noiseandchirps.ogg
Binary files differ
diff --git a/tests/tests/app/assets/noiseandchirps.wrong b/tests/app/assets/noiseandchirps.wrong
similarity index 100%
rename from tests/tests/app/assets/noiseandchirps.wrong
rename to tests/app/assets/noiseandchirps.wrong
Binary files differ
diff --git a/tests/tests/app/res/drawable/icon_black.jpg b/tests/app/res/drawable/icon_black.jpg
similarity index 100%
rename from tests/tests/app/res/drawable/icon_black.jpg
rename to tests/app/res/drawable/icon_black.jpg
Binary files differ
diff --git a/tests/tests/app/res/drawable/icon_blue.jpg b/tests/app/res/drawable/icon_blue.jpg
similarity index 100%
rename from tests/tests/app/res/drawable/icon_blue.jpg
rename to tests/app/res/drawable/icon_blue.jpg
Binary files differ
diff --git a/tests/tests/app/res/drawable/icon_green.jpg b/tests/app/res/drawable/icon_green.jpg
similarity index 100%
rename from tests/tests/app/res/drawable/icon_green.jpg
rename to tests/app/res/drawable/icon_green.jpg
Binary files differ
diff --git a/tests/tests/app/res/drawable/icon_red.jpg b/tests/app/res/drawable/icon_red.jpg
similarity index 100%
rename from tests/tests/app/res/drawable/icon_red.jpg
rename to tests/app/res/drawable/icon_red.jpg
Binary files differ
diff --git a/tests/tests/app/res/drawable/icon_yellow.jpg b/tests/app/res/drawable/icon_yellow.jpg
similarity index 100%
rename from tests/tests/app/res/drawable/icon_yellow.jpg
rename to tests/app/res/drawable/icon_yellow.jpg
Binary files differ
diff --git a/tests/tests/app/res/drawable/ninepatch_0.9.png b/tests/app/res/drawable/ninepatch_0.9.png
similarity index 100%
rename from tests/tests/app/res/drawable/ninepatch_0.9.png
rename to tests/app/res/drawable/ninepatch_0.9.png
Binary files differ
diff --git a/tests/tests/app/res/drawable/ninepatch_1.9.png b/tests/app/res/drawable/ninepatch_1.9.png
similarity index 100%
rename from tests/tests/app/res/drawable/ninepatch_1.9.png
rename to tests/app/res/drawable/ninepatch_1.9.png
Binary files differ
diff --git a/tests/tests/app/res/drawable/pass.jpg b/tests/app/res/drawable/pass.jpg
similarity index 100%
rename from tests/tests/app/res/drawable/pass.jpg
rename to tests/app/res/drawable/pass.jpg
Binary files differ
diff --git a/tests/tests/app/res/drawable/robot.png b/tests/app/res/drawable/robot.png
similarity index 100%
rename from tests/tests/app/res/drawable/robot.png
rename to tests/app/res/drawable/robot.png
Binary files differ
diff --git a/tests/tests/app/res/drawable/size_48x48.jpg b/tests/app/res/drawable/size_48x48.jpg
similarity index 100%
rename from tests/tests/app/res/drawable/size_48x48.jpg
rename to tests/app/res/drawable/size_48x48.jpg
Binary files differ
diff --git a/tests/tests/app/res/layout/alert_dialog_text_entry.xml b/tests/app/res/layout/alert_dialog_text_entry.xml
similarity index 100%
rename from tests/tests/app/res/layout/alert_dialog_text_entry.xml
rename to tests/app/res/layout/alert_dialog_text_entry.xml
diff --git a/tests/tests/app/res/layout/alert_dialog_text_entry_2.xml b/tests/app/res/layout/alert_dialog_text_entry_2.xml
similarity index 100%
rename from tests/tests/app/res/layout/alert_dialog_text_entry_2.xml
rename to tests/app/res/layout/alert_dialog_text_entry_2.xml
diff --git a/tests/tests/app/res/layout/alertdialog_custom_title.xml b/tests/app/res/layout/alertdialog_custom_title.xml
similarity index 100%
rename from tests/tests/app/res/layout/alertdialog_custom_title.xml
rename to tests/app/res/layout/alertdialog_custom_title.xml
diff --git a/tests/tests/app/res/layout/app_activity.xml b/tests/app/res/layout/app_activity.xml
similarity index 100%
rename from tests/tests/app/res/layout/app_activity.xml
rename to tests/app/res/layout/app_activity.xml
diff --git a/tests/tests/app/res/layout/checkbox_layout.xml b/tests/app/res/layout/checkbox_layout.xml
similarity index 100%
rename from tests/tests/app/res/layout/checkbox_layout.xml
rename to tests/app/res/layout/checkbox_layout.xml
diff --git a/tests/tests/app/res/layout/dialog_stub_layout.xml b/tests/app/res/layout/dialog_stub_layout.xml
similarity index 100%
rename from tests/tests/app/res/layout/dialog_stub_layout.xml
rename to tests/app/res/layout/dialog_stub_layout.xml
diff --git a/tests/tests/app/res/menu/browser.xml b/tests/app/res/menu/browser.xml
similarity index 100%
rename from tests/tests/app/res/menu/browser.xml
rename to tests/app/res/menu/browser.xml
diff --git a/tests/tests/app/res/values/arrays.xml b/tests/app/res/values/arrays.xml
similarity index 100%
rename from tests/tests/app/res/values/arrays.xml
rename to tests/app/res/values/arrays.xml
diff --git a/tests/tests/app/res/values/attrs.xml b/tests/app/res/values/attrs.xml
similarity index 100%
rename from tests/tests/app/res/values/attrs.xml
rename to tests/app/res/values/attrs.xml
diff --git a/tests/tests/app/res/values/colors.xml b/tests/app/res/values/colors.xml
similarity index 100%
rename from tests/tests/app/res/values/colors.xml
rename to tests/app/res/values/colors.xml
diff --git a/tests/tests/app/res/values/strings.xml b/tests/app/res/values/strings.xml
similarity index 100%
rename from tests/tests/app/res/values/strings.xml
rename to tests/app/res/values/strings.xml
diff --git a/tests/tests/app/res/values/styles.xml b/tests/app/res/values/styles.xml
similarity index 100%
rename from tests/tests/app/res/values/styles.xml
rename to tests/app/res/values/styles.xml
diff --git a/tests/tests/app/res/xml/alias.xml b/tests/app/res/xml/alias.xml
similarity index 93%
rename from tests/tests/app/res/xml/alias.xml
rename to tests/app/res/xml/alias.xml
index a03104f..321e536 100644
--- a/tests/tests/app/res/xml/alias.xml
+++ b/tests/app/res/xml/alias.xml
@@ -19,7 +19,7 @@
 
 <alias xmlns:android="http://schemas.android.com/apk/res/android">
     <intent android:action="android.intent.action.MAIN"
-        android:targetPackage="com.android.cts.app"
+        android:targetPackage="com.android.cts.app.stub"
         android:targetClass="android.app.cts.ChildActivity"
         android:data="http://www.google.com/">
     </intent>
diff --git a/tests/tests/app/res/xml/intentfilter.xml b/tests/app/res/xml/intentfilter.xml
similarity index 100%
rename from tests/tests/app/res/xml/intentfilter.xml
rename to tests/app/res/xml/intentfilter.xml
diff --git a/tests/tests/app/res/xml/metadata.xml b/tests/app/res/xml/metadata.xml
similarity index 100%
rename from tests/tests/app/res/xml/metadata.xml
rename to tests/app/res/xml/metadata.xml
diff --git a/tests/tests/app/res/xml/searchable.xml b/tests/app/res/xml/searchable.xml
similarity index 100%
rename from tests/tests/app/res/xml/searchable.xml
rename to tests/app/res/xml/searchable.xml
diff --git a/tests/tests/app/src/android/app/cts/ActionBarActivity.java b/tests/app/src/android/app/cts/ActionBarActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ActionBarActivity.java
rename to tests/app/src/android/app/cts/ActionBarActivity.java
diff --git a/tests/tests/app/src/android/app/cts/ActivityManagerMemoryClassLaunchActivity.java b/tests/app/src/android/app/cts/ActivityManagerMemoryClassLaunchActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ActivityManagerMemoryClassLaunchActivity.java
rename to tests/app/src/android/app/cts/ActivityManagerMemoryClassLaunchActivity.java
diff --git a/tests/tests/app/src/android/app/cts/ActivityManagerMemoryClassTestActivity.java b/tests/app/src/android/app/cts/ActivityManagerMemoryClassTestActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ActivityManagerMemoryClassTestActivity.java
rename to tests/app/src/android/app/cts/ActivityManagerMemoryClassTestActivity.java
diff --git a/tests/tests/app/src/android/app/cts/ActivityManagerRecentOneActivity.java b/tests/app/src/android/app/cts/ActivityManagerRecentOneActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ActivityManagerRecentOneActivity.java
rename to tests/app/src/android/app/cts/ActivityManagerRecentOneActivity.java
diff --git a/tests/tests/app/src/android/app/cts/ActivityManagerRecentTwoActivity.java b/tests/app/src/android/app/cts/ActivityManagerRecentTwoActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ActivityManagerRecentTwoActivity.java
rename to tests/app/src/android/app/cts/ActivityManagerRecentTwoActivity.java
diff --git a/tests/tests/app/src/android/app/cts/ActivityManagerStubCrashActivity.java b/tests/app/src/android/app/cts/ActivityManagerStubCrashActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ActivityManagerStubCrashActivity.java
rename to tests/app/src/android/app/cts/ActivityManagerStubCrashActivity.java
diff --git a/tests/tests/app/src/android/app/cts/ActivityManagerStubFooActivity.java b/tests/app/src/android/app/cts/ActivityManagerStubFooActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ActivityManagerStubFooActivity.java
rename to tests/app/src/android/app/cts/ActivityManagerStubFooActivity.java
diff --git a/tests/tests/app/src/android/app/cts/ActivityTestsBase.java b/tests/app/src/android/app/cts/ActivityTestsBase.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ActivityTestsBase.java
rename to tests/app/src/android/app/cts/ActivityTestsBase.java
diff --git a/tests/tests/app/src/android/app/cts/AliasActivityStub.java b/tests/app/src/android/app/cts/AliasActivityStub.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/AliasActivityStub.java
rename to tests/app/src/android/app/cts/AliasActivityStub.java
diff --git a/tests/tests/app/src/android/app/cts/AppCtsActivity.java b/tests/app/src/android/app/cts/AppStubActivity.java
similarity index 97%
rename from tests/tests/app/src/android/app/cts/AppCtsActivity.java
rename to tests/app/src/android/app/cts/AppStubActivity.java
index a1722bb..da5e55a 100644
--- a/tests/tests/app/src/android/app/cts/AppCtsActivity.java
+++ b/tests/app/src/android/app/cts/AppStubActivity.java
@@ -26,12 +26,12 @@
 import android.view.View;
 import android.view.ContextMenu.ContextMenuInfo;
 
-import com.android.cts.app.R;
+import com.android.cts.app.stub.R;
 
 /**
  * A minimal "Hello, World!" application.
  */
-public class AppCtsActivity extends Activity {
+public class AppStubActivity extends Activity {
     private Dialog mDialog;
     public boolean mOnPrepareDialog;
     public boolean mOnOptionsMenuClosedCalled;
@@ -47,7 +47,7 @@
     public boolean mCreateContextMenuCalled;
     public boolean mRequestWinFeatureRet = false;
 
-    public AppCtsActivity() {
+    public AppStubActivity() {
 
     }
 
diff --git a/tests/tests/app/src/android/app/cts/CTSActivityTestCaseBase.java b/tests/app/src/android/app/cts/CTSActivityTestCaseBase.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/CTSActivityTestCaseBase.java
rename to tests/app/src/android/app/cts/CTSActivityTestCaseBase.java
diff --git a/tests/tests/app/src/android/app/cts/ChildActivity.java b/tests/app/src/android/app/cts/ChildActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ChildActivity.java
rename to tests/app/src/android/app/cts/ChildActivity.java
diff --git a/tests/tests/app/src/android/app/cts/ChildTabActivity.java b/tests/app/src/android/app/cts/ChildTabActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ChildTabActivity.java
rename to tests/app/src/android/app/cts/ChildTabActivity.java
diff --git a/tests/tests/app/src/android/app/cts/ClearTop.java b/tests/app/src/android/app/cts/ClearTop.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ClearTop.java
rename to tests/app/src/android/app/cts/ClearTop.java
diff --git a/tests/tests/app/src/android/app/cts/DialogCtsActivity.java b/tests/app/src/android/app/cts/DialogStubActivity.java
similarity index 97%
rename from tests/tests/app/src/android/app/cts/DialogCtsActivity.java
rename to tests/app/src/android/app/cts/DialogStubActivity.java
index 2fb293e..a773ae2 100644
--- a/tests/tests/app/src/android/app/cts/DialogCtsActivity.java
+++ b/tests/app/src/android/app/cts/DialogStubActivity.java
@@ -16,7 +16,7 @@
 
 package android.app.cts;
 
-import com.android.cts.app.R;
+import com.android.cts.app.stub.R;
 
 import android.app.Activity;
 import android.app.AlertDialog;
@@ -43,7 +43,7 @@
 /*
  * Stub class for  Dialog, AlertDialog, DatePickerDialog, TimePickerDialog etc.
  */
-public class DialogCtsActivity extends Activity {
+public class DialogStubActivity extends Activity {
     public static final int TEST_DIALOG_WITHOUT_THEME = 0;
     public static final int TEST_DIALOG_WITH_THEME = 1;
     public static final int TEST_ALERTDIALOG = 2;
@@ -71,7 +71,7 @@
 
     public static final String DEFAULT_ALERTDIALOG_TITLE = "AlertDialog";
     public static final String DEFAULT_ALERTDIALOG_MESSAGE = "AlertDialog message";
-    private static final String LOG_TAG = "DialogCtsActivity";
+    private static final String LOG_TAG = "DialogStubActivity";
 
     public boolean isPositiveButtonClicked = false;
     public boolean isNegativeButtonClicked = false;
@@ -235,8 +235,8 @@
 
     @SuppressWarnings("deprecation")
     private AlertDialog getAlertDialogInstance(boolean deprecated) {
-        mAlertDialog = new AlertDialog.Builder(DialogCtsActivity.this).create();
-        mAlertDialog.setIcon(com.android.cts.app.R.drawable.pass);
+        mAlertDialog = new AlertDialog.Builder(DialogStubActivity.this).create();
+        mAlertDialog.setIcon(com.android.cts.app.stub.R.drawable.pass);
         mAlertDialog.setTitle(DEFAULT_ALERTDIALOG_TITLE);
         mAlertDialog.setMessage(DEFAULT_ALERTDIALOG_MESSAGE);
         mAlertDialog.setInverseBackgroundForced(true);
@@ -267,7 +267,7 @@
         final LayoutInflater inflate = getLayoutInflater();
         final View customTitleViewCustom = inflate.inflate(R.layout.alertdialog_custom_title, null);
         final View textEntryView = inflate.inflate(R.layout.alert_dialog_text_entry_2, null);
-        mAlertDialog = new AlertDialog.Builder(DialogCtsActivity.this).create();
+        mAlertDialog = new AlertDialog.Builder(DialogStubActivity.this).create();
         mAlertDialog.setCustomTitle(customTitleViewCustom);
         mAlertDialog.setMessage(DEFAULT_ALERTDIALOG_MESSAGE);
         if (withSpacing) {
diff --git a/tests/tests/app/src/android/app/cts/ExpandableListTestActivity.java b/tests/app/src/android/app/cts/ExpandableListTestActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ExpandableListTestActivity.java
rename to tests/app/src/android/app/cts/ExpandableListTestActivity.java
diff --git a/tests/tests/app/src/android/app/cts/IBinderParcelable.java b/tests/app/src/android/app/cts/IBinderParcelable.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/IBinderParcelable.java
rename to tests/app/src/android/app/cts/IBinderParcelable.java
diff --git a/tests/tests/app/src/android/app/cts/ISecondary.aidl b/tests/app/src/android/app/cts/ISecondary.aidl
similarity index 100%
rename from tests/tests/app/src/android/app/cts/ISecondary.aidl
rename to tests/app/src/android/app/cts/ISecondary.aidl
diff --git a/tests/tests/app/src/android/app/cts/InstrumentationTestActivity.java b/tests/app/src/android/app/cts/InstrumentationTestActivity.java
similarity index 99%
rename from tests/tests/app/src/android/app/cts/InstrumentationTestActivity.java
rename to tests/app/src/android/app/cts/InstrumentationTestActivity.java
index ac1039b..bec721e 100644
--- a/tests/tests/app/src/android/app/cts/InstrumentationTestActivity.java
+++ b/tests/app/src/android/app/cts/InstrumentationTestActivity.java
@@ -29,7 +29,7 @@
 import android.view.MotionEvent;
 import android.view.View;
 import android.widget.TextView;
-import com.android.cts.app.R;
+import com.android.cts.app.stub.R;
 
 public class InstrumentationTestActivity extends Activity {
 
diff --git a/tests/tests/app/src/android/app/cts/IntentServiceStub.java b/tests/app/src/android/app/cts/IntentServiceStub.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/IntentServiceStub.java
rename to tests/app/src/android/app/cts/IntentServiceStub.java
diff --git a/tests/tests/app/src/android/app/cts/KeyguardManagerActivity.java b/tests/app/src/android/app/cts/KeyguardManagerActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/KeyguardManagerActivity.java
rename to tests/app/src/android/app/cts/KeyguardManagerActivity.java
diff --git a/tests/tests/app/src/android/app/cts/LauncherActivityStub.java b/tests/app/src/android/app/cts/LauncherActivityStub.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/LauncherActivityStub.java
rename to tests/app/src/android/app/cts/LauncherActivityStub.java
diff --git a/tests/tests/app/src/android/app/cts/LaunchpadActivity.java b/tests/app/src/android/app/cts/LaunchpadActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/LaunchpadActivity.java
rename to tests/app/src/android/app/cts/LaunchpadActivity.java
diff --git a/tests/tests/app/src/android/app/cts/LaunchpadTabActivity.java b/tests/app/src/android/app/cts/LaunchpadTabActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/LaunchpadTabActivity.java
rename to tests/app/src/android/app/cts/LaunchpadTabActivity.java
diff --git a/tests/tests/app/src/android/app/cts/LocalActivity.java b/tests/app/src/android/app/cts/LocalActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/LocalActivity.java
rename to tests/app/src/android/app/cts/LocalActivity.java
diff --git a/tests/tests/app/src/android/app/cts/LocalActivityManagerCtsActivity.java b/tests/app/src/android/app/cts/LocalActivityManagerStubActivity.java
similarity index 95%
rename from tests/tests/app/src/android/app/cts/LocalActivityManagerCtsActivity.java
rename to tests/app/src/android/app/cts/LocalActivityManagerStubActivity.java
index 93da3e4..e64c75a 100644
--- a/tests/tests/app/src/android/app/cts/LocalActivityManagerCtsActivity.java
+++ b/tests/app/src/android/app/cts/LocalActivityManagerStubActivity.java
@@ -19,7 +19,7 @@
 import android.app.Activity;
 import android.os.Bundle;
 
-public class LocalActivityManagerCtsActivity extends Activity{
+public class LocalActivityManagerStubActivity extends Activity{
 
     public static boolean sIsOnResumeCalled;
     public static boolean sIsOnStopCalled;
diff --git a/tests/tests/app/src/android/app/cts/LocalActivityManagerTestHelper.java b/tests/app/src/android/app/cts/LocalActivityManagerTestHelper.java
similarity index 90%
rename from tests/tests/app/src/android/app/cts/LocalActivityManagerTestHelper.java
rename to tests/app/src/android/app/cts/LocalActivityManagerTestHelper.java
index 5c0aca0..76af648 100644
--- a/tests/tests/app/src/android/app/cts/LocalActivityManagerTestHelper.java
+++ b/tests/app/src/android/app/cts/LocalActivityManagerTestHelper.java
@@ -87,7 +87,7 @@
 
     private void testRemoveAllActivity() {
         final String id = "id_remove_activity";
-        final Intent intent = new Intent(this, LocalActivityManagerCtsActivity.class);
+        final Intent intent = new Intent(this, LocalActivityManagerStubActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mLocalActivityManager.startActivity(id, intent);
 
@@ -98,7 +98,7 @@
         }
 
         if (!activity.getClass().getName().equals("android.app.cts."
-                    + "LocalActivityManagerCtsActivity")) {
+                    + "LocalActivityManagerStubActivity")) {
             fail();
             return;
         }
@@ -115,27 +115,27 @@
     private void testDispatchDestroy() {
         final String id1 = "id_dispatch_destroy1";
         final String id2 = "id_dispatch_destroy2";
-        final Intent intent = new Intent(this, LocalActivityManagerCtsActivity.class);
+        final Intent intent = new Intent(this, LocalActivityManagerStubActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mLocalActivityManager.startActivity(id1, intent);
 
-        LocalActivityManagerCtsActivity.sIsOnDestroyCalled = false;
+        LocalActivityManagerStubActivity.sIsOnDestroyCalled = false;
         mLocalActivityManager.dispatchDestroy(false);
         if (mLocalActivityManager.getCurrentActivity().isFinishing()){
             fail();
             return;
         }
 
-        if (!LocalActivityManagerCtsActivity.sIsOnDestroyCalled) {
+        if (!LocalActivityManagerStubActivity.sIsOnDestroyCalled) {
             fail();
             return;
         }
 
         mLocalActivityManager.startActivity(id2, intent);
-        LocalActivityManagerCtsActivity.sIsOnDestroyCalled = false;
+        LocalActivityManagerStubActivity.sIsOnDestroyCalled = false;
         mLocalActivityManager.dispatchDestroy(true);
 
-        if (!LocalActivityManagerCtsActivity.sIsOnDestroyCalled) {
+        if (!LocalActivityManagerStubActivity.sIsOnDestroyCalled) {
             fail();
             return;
         }
@@ -157,7 +157,7 @@
         }
 
         final String id = "id_dispatch_pause";
-        final Intent intent = new Intent(this, LocalActivityManagerCtsActivity.class);
+        final Intent intent = new Intent(this, LocalActivityManagerStubActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mLocalActivityManager.startActivity(id, intent);
 
@@ -176,12 +176,12 @@
 
     private void testDispatchPauseFalse() {
         final String id = "id_dispatch_pause";
-        final Intent intent = new Intent(this, LocalActivityManagerCtsActivity.class);
+        final Intent intent = new Intent(this, LocalActivityManagerStubActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mLocalActivityManager.startActivity(id, intent);
-        LocalActivityManagerCtsActivity.sIsOnPauseCalled = false;
+        LocalActivityManagerStubActivity.sIsOnPauseCalled = false;
         mLocalActivityManager.dispatchPause(false);
-        if (!LocalActivityManagerCtsActivity.sIsOnPauseCalled) {
+        if (!LocalActivityManagerStubActivity.sIsOnPauseCalled) {
             fail();
             return;
         }
@@ -190,12 +190,12 @@
 
     private void testDispatchPauseTrue() {
         final String id = "id_dispatch_pause";
-        final Intent intent = new Intent(this, LocalActivityManagerCtsActivity.class);
+        final Intent intent = new Intent(this, LocalActivityManagerStubActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mLocalActivityManager.startActivity(id, intent);
-        LocalActivityManagerCtsActivity.sIsOnPauseCalled = false;
+        LocalActivityManagerStubActivity.sIsOnPauseCalled = false;
         mLocalActivityManager.dispatchPause(true);
-        if (!LocalActivityManagerCtsActivity.sIsOnPauseCalled) {
+        if (!LocalActivityManagerStubActivity.sIsOnPauseCalled) {
             fail();
             return;
         }
@@ -204,7 +204,7 @@
 
     private void testDispatchStop() {
         final String id = "id_dispatch_stop";
-        final Intent intent = new Intent(this, LocalActivityManagerCtsActivity.class);
+        final Intent intent = new Intent(this, LocalActivityManagerStubActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mLocalActivityManager.startActivity(id, intent);
         if (mLocalActivityManager.getCurrentActivity() == null) {
@@ -212,10 +212,10 @@
             return;
         }
 
-        LocalActivityManagerCtsActivity.sIsOnStopCalled = false;
+        LocalActivityManagerStubActivity.sIsOnStopCalled = false;
         mLocalActivityManager.dispatchStop();
 
-        if (!LocalActivityManagerCtsActivity.sIsOnStopCalled) {
+        if (!LocalActivityManagerStubActivity.sIsOnStopCalled) {
             fail();
             return;
         }
@@ -226,7 +226,7 @@
         final Bundle EXPECTED = new Bundle();
         final String id = "id";
 
-        final Intent intent = new Intent(this, LocalActivityManagerCtsActivity.class);
+        final Intent intent = new Intent(this, LocalActivityManagerStubActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mLocalActivityManager.startActivity("_id" + System.currentTimeMillis(), intent);
         final Bundle bundle = mLocalActivityManager.saveInstanceState();
@@ -261,7 +261,7 @@
     }
 
     private void testStartActivity() {
-        final Intent intent = new Intent(this, LocalActivityManagerCtsActivity.class);
+        final Intent intent = new Intent(this, LocalActivityManagerStubActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         final String id = "_id_resume_test";
         final Window w = mLocalActivityManager.startActivity(id, intent);
@@ -315,13 +315,13 @@
     }
 
     private void testDispatchResume() {
-        final Intent intent = new Intent(this, LocalActivityManagerCtsActivity.class);
+        final Intent intent = new Intent(this, LocalActivityManagerStubActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mLocalActivityManager.startActivity("_id_resume_test", intent);
         mLocalActivityManager.dispatchStop();
-        LocalActivityManagerCtsActivity.sIsOnResumeCalled = false;
+        LocalActivityManagerStubActivity.sIsOnResumeCalled = false;
         mLocalActivityManager.dispatchResume();
-        if (LocalActivityManagerCtsActivity.sIsOnResumeCalled) {
+        if (LocalActivityManagerStubActivity.sIsOnResumeCalled) {
             pass();
         } else {
             fail();
diff --git a/tests/tests/app/src/android/app/cts/LocalDeniedService.java b/tests/app/src/android/app/cts/LocalDeniedService.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/LocalDeniedService.java
rename to tests/app/src/android/app/cts/LocalDeniedService.java
diff --git a/tests/tests/app/src/android/app/cts/LocalDialog.java b/tests/app/src/android/app/cts/LocalDialog.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/LocalDialog.java
rename to tests/app/src/android/app/cts/LocalDialog.java
diff --git a/tests/tests/app/src/android/app/cts/LocalGrantedService.java b/tests/app/src/android/app/cts/LocalGrantedService.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/LocalGrantedService.java
rename to tests/app/src/android/app/cts/LocalGrantedService.java
diff --git a/tests/tests/app/src/android/app/cts/LocalScreen.java b/tests/app/src/android/app/cts/LocalScreen.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/LocalScreen.java
rename to tests/app/src/android/app/cts/LocalScreen.java
diff --git a/tests/tests/app/src/android/app/cts/LocalService.java b/tests/app/src/android/app/cts/LocalService.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/LocalService.java
rename to tests/app/src/android/app/cts/LocalService.java
diff --git a/tests/tests/app/src/android/app/cts/MockActivity.java b/tests/app/src/android/app/cts/MockActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/MockActivity.java
rename to tests/app/src/android/app/cts/MockActivity.java
diff --git a/tests/tests/app/src/android/app/cts/MockAlarmReceiver.java b/tests/app/src/android/app/cts/MockAlarmReceiver.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/MockAlarmReceiver.java
rename to tests/app/src/android/app/cts/MockAlarmReceiver.java
diff --git a/tests/tests/app/src/android/app/cts/MockApplication.java b/tests/app/src/android/app/cts/MockApplication.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/MockApplication.java
rename to tests/app/src/android/app/cts/MockApplication.java
diff --git a/tests/tests/app/src/android/app/cts/MockApplicationActivity.java b/tests/app/src/android/app/cts/MockApplicationActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/MockApplicationActivity.java
rename to tests/app/src/android/app/cts/MockApplicationActivity.java
diff --git a/tests/tests/app/src/android/app/cts/MockReceiver.java b/tests/app/src/android/app/cts/MockReceiver.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/MockReceiver.java
rename to tests/app/src/android/app/cts/MockReceiver.java
diff --git a/tests/tests/app/src/android/app/cts/MockService.java b/tests/app/src/android/app/cts/MockService.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/MockService.java
rename to tests/app/src/android/app/cts/MockService.java
diff --git a/tests/tests/app/src/android/app/cts/MockTabActivity.java b/tests/app/src/android/app/cts/MockTabActivity.java
similarity index 96%
rename from tests/tests/app/src/android/app/cts/MockTabActivity.java
rename to tests/app/src/android/app/cts/MockTabActivity.java
index ebbeb7b..aca19f5 100644
--- a/tests/tests/app/src/android/app/cts/MockTabActivity.java
+++ b/tests/app/src/android/app/cts/MockTabActivity.java
@@ -46,7 +46,7 @@
                 .setContent(new Intent(this, MockActivity.class)));
 
         tabHost.addTab(tabHost.newTabSpec(TAB3).setIndicator(TAB3).setContent(
-                new Intent(this, AppCtsActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));
+                new Intent(this, AppStubActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));
 
     }
 
diff --git a/tests/tests/app/src/android/app/cts/OrientationTestUtils.java b/tests/app/src/android/app/cts/OrientationTestUtils.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/OrientationTestUtils.java
rename to tests/app/src/android/app/cts/OrientationTestUtils.java
diff --git a/tests/tests/app/src/android/app/cts/PendingIntentCtsActivity.java b/tests/app/src/android/app/cts/PendingIntentStubActivity.java
similarity index 93%
rename from tests/tests/app/src/android/app/cts/PendingIntentCtsActivity.java
rename to tests/app/src/android/app/cts/PendingIntentStubActivity.java
index f11fe10..a2a3bd8 100644
--- a/tests/tests/app/src/android/app/cts/PendingIntentCtsActivity.java
+++ b/tests/app/src/android/app/cts/PendingIntentStubActivity.java
@@ -19,7 +19,7 @@
 import android.app.Activity;
 import android.os.Bundle;
 
-public class PendingIntentCtsActivity extends Activity {
+public class PendingIntentStubActivity extends Activity {
 
     public static final int INVALIDATE = -1;
     public static final int ON_CREATE = 0;
diff --git a/tests/tests/app/src/android/app/cts/SearchManagerCtsActivity.java b/tests/app/src/android/app/cts/SearchManagerStubActivity.java
similarity index 97%
rename from tests/tests/app/src/android/app/cts/SearchManagerCtsActivity.java
rename to tests/app/src/android/app/cts/SearchManagerStubActivity.java
index 7198e8d..6385fef 100644
--- a/tests/tests/app/src/android/app/cts/SearchManagerCtsActivity.java
+++ b/tests/app/src/android/app/cts/SearchManagerStubActivity.java
@@ -25,9 +25,9 @@
 import android.os.Message;
 import android.util.Log;
 
-public class SearchManagerCtsActivity extends Activity {
+public class SearchManagerStubActivity extends Activity {
 
-    private static final String TAG = "SearchManagerCtsActivity";
+    private static final String TAG = "SearchManagerStubActivity";
 
     public static final String TEST_STOP_SEARCH = "stopSearch";
     public static final String TEST_ON_DISMISSLISTENER = "setOnDismissListener";
diff --git a/tests/tests/app/src/android/app/cts/StubRemoteService.java b/tests/app/src/android/app/cts/StubRemoteService.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/StubRemoteService.java
rename to tests/app/src/android/app/cts/StubRemoteService.java
diff --git a/tests/tests/app/src/android/app/cts/TestDialog.java b/tests/app/src/android/app/cts/TestDialog.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/TestDialog.java
rename to tests/app/src/android/app/cts/TestDialog.java
diff --git a/tests/tests/app/src/android/app/cts/TestedActivity.java b/tests/app/src/android/app/cts/TestedActivity.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/TestedActivity.java
rename to tests/app/src/android/app/cts/TestedActivity.java
diff --git a/tests/tests/app/src/android/app/cts/TestedScreen.java b/tests/app/src/android/app/cts/TestedScreen.java
similarity index 100%
rename from tests/tests/app/src/android/app/cts/TestedScreen.java
rename to tests/app/src/android/app/cts/TestedScreen.java
diff --git a/tests/assets/images/tomato.png b/tests/assets/images/tomato.png
deleted file mode 100644
index 44c590d..0000000
--- a/tests/assets/images/tomato.png
+++ /dev/null
Binary files differ
diff --git a/tests/assets/ringer.mp3 b/tests/assets/ringer.mp3
deleted file mode 100644
index aa052e7..0000000
--- a/tests/assets/ringer.mp3
+++ /dev/null
Binary files differ
diff --git a/tests/assets/sphere.a3d b/tests/assets/sphere.a3d
deleted file mode 100644
index 3d78b01..0000000
--- a/tests/assets/sphere.a3d
+++ /dev/null
Binary files differ
diff --git a/tests/expectations/knownfailures.txt b/tests/expectations/knownfailures.txt
index 3916531..b7f7078 100644
--- a/tests/expectations/knownfailures.txt
+++ b/tests/expectations/knownfailures.txt
@@ -82,13 +82,6 @@
   bug: 17496766
 },
 {
-  description: "instrumentation target context and test context are the same after move test target inside the test itself",
-  names: [
-    "android.app.cts.InstrumentationTest#testContext"
-  ],
-  bug: 17614217
-},
-{
   description: "Current implementation of uninstallAllUserCaCerts does not throw expected security exception, wait for fix from framework",
   names: [
     "android.admin.cts.DevicePolicyManagerTest#testUninstallAllUserCaCerts_failIfNotProfileOwner"
@@ -96,6 +89,7 @@
   bug: 17508787
 },
 {
+
   description: "These tests fail on some devices.",
   names: [
     "android.uirendering.cts.testclasses.ExactCanvasTests#testBlueRect",
@@ -107,5 +101,173 @@
     "android.uirendering.cts.testclasses.InfrastructureTests#testViewInitializer"
   ],
   bug: 17511118
+},
+{
+  description: "This test failed on devices that use effect off loading. In addition it uses hidden apis",
+  names: [
+    "android.meida.cts.AudioEffectTest#test1_1ConstructorFromUuid"
+  ],
+  bug: 17605875
+},
+{
+  description: "Failures on these tests are known on several devices.",
+  names: [
+    "android.hardware.cts.SensorBatchingTests#testAccelerometer_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testAccelerometer_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testAccelerometer_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testAccelerometer_50hz_flush",
+    "android.hardware.cts.SensorBatchingTests#testMagneticField_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testMagneticField_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testMagneticField_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testMagneticField_50hz_flush",
+    "android.hardware.cts.SensorBatchingTests#testOrientation_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testOrientation_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testOrientation_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testOrientation_50hz_flush",
+    "android.hardware.cts.SensorBatchingTests#testGyroscope_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testGyroscope_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testGyroscope_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testGyroscope_50hz_flush",
+    "android.hardware.cts.SensorBatchingTests#testPressure_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testPressure_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testPressure_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testPressure_50hz_flush",
+    "android.hardware.cts.SensorBatchingTests#testGravity_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testGravity_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testGravity_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testGravity_50hz_flush",
+    "android.hardware.cts.SensorBatchingTests#testRotationVector_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testRotationVector_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testRotationVector_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testRotationVector_50hz_flush",
+    "android.hardware.cts.SensorBatchingTests#testMagneticFieldUncalibrated_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testMagneticFieldUncalibrated_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testMagneticFieldUncalibrated_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testMagneticFieldUncalibrated_50hz_flush",
+    "android.hardware.cts.SensorBatchingTests#testGameRotationVector_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testGameRotationVector_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testGameRotationVector_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testGameRotationVector_50hz_flush",
+    "android.hardware.cts.SensorBatchingTests#testGyroscopeUncalibrated_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testGyroscopeUncalibrated_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testGyroscopeUncalibrated_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testGyroscopeUncalibrated_50hz_flush",
+    "android.hardware.cts.SensorBatchingTests#testLinearAcceleration_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testLinearAcceleration_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testLinearAcceleration_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testLinearAcceleration_50hz_flush",
+    "android.hardware.cts.SensorBatchingTests#testGeomagneticRotationVector_fastest_batching",
+    "android.hardware.cts.SensorBatchingTests#testGeomagneticRotationVector_50hz_batching",
+    "android.hardware.cts.SensorBatchingTests#testGeomagneticRotationVector_fastest_flush",
+    "android.hardware.cts.SensorBatchingTests#testGeomagneticRotationVector_50hz_flush",
+    "android.hardware.cts.SensorIntegrationTests#testSensorsWithSeveralClients",
+    "android.hardware.cts.SensorIntegrationTests#testSensorsMovingRates",
+    "android.hardware.cts.SensorIntegrationTests#testSensorStoppingInteraction",
+    "android.hardware.cts.SingleSensorTests#testSensorProperties",
+    "android.hardware.cts.SingleSensorTests#testAccelerometer_fastest",
+    "android.hardware.cts.SingleSensorTests#testAccelerometer_100hz",
+    "android.hardware.cts.SingleSensorTests#testAccelerometer_200hz",
+    "android.hardware.cts.SingleSensorTests#testAccelerometer_50hz",
+    "android.hardware.cts.SingleSensorTests#testAccelerometer_25hz",
+    "android.hardware.cts.SingleSensorTests#testAccelerometer_15hz",
+    "android.hardware.cts.SingleSensorTests#testAccelerometer_10hz",
+    "android.hardware.cts.SingleSensorTests#testAccelerometer_5hz",
+    "android.hardware.cts.SingleSensorTests#testAccelerometer_1hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticField_fastest",
+    "android.hardware.cts.SingleSensorTests#testMagneticField_200hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticField_100hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticField_50hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticField_25hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticField_15hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticField_10hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticField_5hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticField_1hz",
+    "android.hardware.cts.SingleSensorTests#testOrientation_fastest",
+    "android.hardware.cts.SingleSensorTests#testOrientation_200hz",
+    "android.hardware.cts.SingleSensorTests#testOrientation_100hz",
+    "android.hardware.cts.SingleSensorTests#testOrientation_50hz",
+    "android.hardware.cts.SingleSensorTests#testOrientation_25hz",
+    "android.hardware.cts.SingleSensorTests#testOrientation_15hz",
+    "android.hardware.cts.SingleSensorTests#testOrientation_10hz",
+    "android.hardware.cts.SingleSensorTests#testOrientation_5hz",
+    "android.hardware.cts.SingleSensorTests#testOrientation_1hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscope_fastest",
+    "android.hardware.cts.SingleSensorTests#testGyroscope_200hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscope_100hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscope_50hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscope_25hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscope_15hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscope_10hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscope_5hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscope_1hz",
+    "android.hardware.cts.SingleSensorTests#testPressure_fastest",
+    "android.hardware.cts.SingleSensorTests#testPressure_200hz",
+    "android.hardware.cts.SingleSensorTests#testPressure_100hz",
+    "android.hardware.cts.SingleSensorTests#testPressure_50hz",
+    "android.hardware.cts.SingleSensorTests#testPressure_25hz",
+    "android.hardware.cts.SingleSensorTests#testPressure_15hz",
+    "android.hardware.cts.SingleSensorTests#testPressure_10hz",
+    "android.hardware.cts.SingleSensorTests#testPressure_5hz",
+    "android.hardware.cts.SingleSensorTests#testPressure_1hz",
+    "android.hardware.cts.SingleSensorTests#testGravity_fastest",
+    "android.hardware.cts.SingleSensorTests#testGravity_200hz",
+    "android.hardware.cts.SingleSensorTests#testGravity_100hz",
+    "android.hardware.cts.SingleSensorTests#testGravity_50hz",
+    "android.hardware.cts.SingleSensorTests#testGravity_25hz",
+    "android.hardware.cts.SingleSensorTests#testGravity_15hz",
+    "android.hardware.cts.SingleSensorTests#testGravity_10hz",
+    "android.hardware.cts.SingleSensorTests#testGravity_5hz",
+    "android.hardware.cts.SingleSensorTests#testGravity_1hz",
+    "android.hardware.cts.SingleSensorTests#testRotationVector_fastest",
+    "android.hardware.cts.SingleSensorTests#testRotationVector_200hz",
+    "android.hardware.cts.SingleSensorTests#testRotationVector_100hz",
+    "android.hardware.cts.SingleSensorTests#testRotationVector_50hz",
+    "android.hardware.cts.SingleSensorTests#testRotationVector_25hz",
+    "android.hardware.cts.SingleSensorTests#testRotationVector_15hz",
+    "android.hardware.cts.SingleSensorTests#testRotationVector_10hz",
+    "android.hardware.cts.SingleSensorTests#testRotationVector_5hz",
+    "android.hardware.cts.SingleSensorTests#testRotationVector_1hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticFieldUncalibrated_fastest",
+    "android.hardware.cts.SingleSensorTests#testMagneticFieldUncalibrated_200hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticFieldUncalibrated_100hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticFieldUncalibrated_50hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticFieldUncalibrated_25hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticFieldUncalibrated_15hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticFieldUncalibrated_10hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticFieldUncalibrated_5hz",
+    "android.hardware.cts.SingleSensorTests#testMagneticFieldUncalibrated_1hz",
+    "android.hardware.cts.SingleSensorTests#testGameRotationVector_fastest",
+    "android.hardware.cts.SingleSensorTests#testGameRotationVector_200hz",
+    "android.hardware.cts.SingleSensorTests#testGameRotationVector_100hz",
+    "android.hardware.cts.SingleSensorTests#testGameRotationVector_50hz",
+    "android.hardware.cts.SingleSensorTests#testGameRotationVector_25hz",
+    "android.hardware.cts.SingleSensorTests#testGameRotationVector_15hz",
+    "android.hardware.cts.SingleSensorTests#testGameRotationVector_10hz",
+    "android.hardware.cts.SingleSensorTests#testGameRotationVector_5hz",
+    "android.hardware.cts.SingleSensorTests#testGameRotationVector_1hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscopeUncalibrated_fastest",
+    "android.hardware.cts.SingleSensorTests#testGyroscopeUncalibrated_200hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscopeUncalibrated_100hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscopeUncalibrated_50hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscopeUncalibrated_25hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscopeUncalibrated_15hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscopeUncalibrated_10hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscopeUncalibrated_5hz",
+    "android.hardware.cts.SingleSensorTests#testGyroscopeUncalibrated_1hz",
+    "android.hardware.cts.SingleSensorTests#testGeomagneticRotationVector_fastest",
+    "android.hardware.cts.SingleSensorTests#testLinearAcceleration_200hz",
+    "android.hardware.cts.SingleSensorTests#testLinearAcceleration_100hz",
+    "android.hardware.cts.SingleSensorTests#testLinearAcceleration_50hz",
+    "android.hardware.cts.SingleSensorTests#testLinearAcceleration_25hz",
+    "android.hardware.cts.SingleSensorTests#testLinearAcceleration_15hz",
+    "android.hardware.cts.SingleSensorTests#testLinearAcceleration_10hz",
+    "android.hardware.cts.SingleSensorTests#testLinearAcceleration_5hz",
+    "android.hardware.cts.SingleSensorTests#testLinearAcceleration_1hz",
+    "android.hardware.cts.SensorTest#testValuesForAllSensors",
+    "android.hardware.cts.SensorTest#testSensorTimeStamps",
+    "android.hardware.cts.SensorTest#testBatchAndFlush",
+    "android.hardware.cts.SensorTest#testBatchAndFlushWithHandler"
+  ],
+  bug: 17675466
 }
 ]
diff --git a/tests/res/anim/accelerate_alpha.xml b/tests/res/anim/accelerate_alpha.xml
deleted file mode 100644
index 594652b..0000000
--- a/tests/res/anim/accelerate_alpha.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
-    android:interpolator="@android:anim/accelerate_interpolator"
-    android:fromAlpha="0.1"
-    android:toAlpha="0.9"
-    android:duration="1000" />
diff --git a/tests/res/anim/accelerate_decelerate_alpha.xml b/tests/res/anim/accelerate_decelerate_alpha.xml
deleted file mode 100644
index 7c892b2..0000000
--- a/tests/res/anim/accelerate_decelerate_alpha.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
-    android:interpolator="@android:anim/accelerate_decelerate_interpolator"
-    android:fromAlpha="0.0"
-    android:toAlpha="1.0"
-    android:duration="2000" />
diff --git a/tests/res/anim/alpha.xml b/tests/res/anim/alpha.xml
deleted file mode 100644
index 8893d66..0000000
--- a/tests/res/anim/alpha.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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.
--->
-
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
-       android:fromAlpha="0.0"
-       android:toAlpha="1.0"
-       android:duration="500" />
diff --git a/tests/res/anim/anim_alpha.xml b/tests/res/anim/anim_alpha.xml
deleted file mode 100644
index b5794c3..0000000
--- a/tests/res/anim/anim_alpha.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
- -->
-
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
-       android:interpolator="@android:anim/accelerate_interpolator"
-       android:fromAlpha="0.0"
-       android:toAlpha="1.0"
-       android:duration="500" />
-
diff --git a/tests/res/anim/anim_gridlayout.xml b/tests/res/anim/anim_gridlayout.xml
deleted file mode 100644
index be42d76..0000000
--- a/tests/res/anim/anim_gridlayout.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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.
--->
-
-<gridLayoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
-        android:delay="10%"
-        android:rowDelay="50%"
-        android:directionPriority="column"
-        android:animation="@anim/anim_alpha" />
diff --git a/tests/res/anim/anim_rotate.xml b/tests/res/anim/anim_rotate.xml
deleted file mode 100644
index 4fbadcf..0000000
--- a/tests/res/anim/anim_rotate.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
- -->
-
-<rotate xmlns:android="http://schemas.android.com/apk/res/android"
-    android:interpolator="@android:anim/decelerate_interpolator"
-    android:fromDegrees="0"
-    android:toDegrees="-45"
-    android:toYScale="0.0"
-    android:pivotX="50%"
-    android:pivotY="50%"
-    android:duration="700" />
diff --git a/tests/res/anim/anim_scale.xml b/tests/res/anim/anim_scale.xml
deleted file mode 100644
index 96a3e28..0000000
--- a/tests/res/anim/anim_scale.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
- -->
-
-<scale xmlns:android="http://schemas.android.com/apk/res/android"
-    android:interpolator="@android:anim/accelerate_decelerate_interpolator"
-    android:fromXScale="1.0"
-    android:toXScale="1.4"
-    android:fromYScale="1.0"
-    android:toYScale="0.6"
-    android:pivotX="50%"
-    android:pivotY="50%"
-    android:fillAfter="false"
-    android:duration="600" />
diff --git a/tests/res/anim/anim_set.xml b/tests/res/anim/anim_set.xml
deleted file mode 100644
index 7d139a8..0000000
--- a/tests/res/anim/anim_set.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
-
-    <scale
-        android:interpolator="@android:anim/accelerate_decelerate_interpolator"
-        android:fromXScale="1.0"
-        android:toXScale="1.4"
-        android:fromYScale="1.0"
-        android:toYScale="0.6"
-        android:pivotX="50%"
-        android:pivotY="50%"
-        android:fillAfter="false"
-        android:duration="900" />
-
-    <set
-        android:interpolator="@android:anim/accelerate_interpolator"
-                android:startOffset="700">
-
-        <scale
-            android:fromXScale="1.4"
-            android:toXScale="0.0"
-            android:fromYScale="0.6"
-            android:toYScale="0.0"
-            android:pivotX="50%"
-            android:pivotY="50%"
-            android:duration="400" />
-
-        <rotate
-            android:fromDegrees="0"
-            android:toDegrees="-45"
-            android:toYScale="0.0"
-            android:pivotX="50%"
-            android:pivotY="50%"
-            android:duration="400" />
-    </set>
-
-</set>
diff --git a/tests/res/anim/anim_translate.xml b/tests/res/anim/anim_translate.xml
deleted file mode 100644
index 6659c2b..0000000
--- a/tests/res/anim/anim_translate.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
- -->
-
-<translate xmlns:android="http://schemas.android.com/apk/res/android"
-    android:interpolator="@android:anim/accelerate_interpolator"
-    android:fromXDelta="100%p"
-    android:toXDelta="0"
-    android:fromYDelta="100%p"
-    android:toYDelta="0"
-    android:duration="800" />
diff --git a/tests/res/anim/cycle_alpha.xml b/tests/res/anim/cycle_alpha.xml
deleted file mode 100644
index 0a3b53c..0000000
--- a/tests/res/anim/cycle_alpha.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
-       android:interpolator="@anim/cycle_interpolator"
-       android:fromAlpha="0.0"
-       android:toAlpha="1.0"
-       android:duration="2000" />
diff --git a/tests/res/anim/cycle_interpolator.xml b/tests/res/anim/cycle_interpolator.xml
deleted file mode 100644
index d1586e5..0000000
--- a/tests/res/anim/cycle_interpolator.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
- <cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="1" />
diff --git a/tests/res/anim/decelerate_alpha.xml b/tests/res/anim/decelerate_alpha.xml
deleted file mode 100644
index 793807e..0000000
--- a/tests/res/anim/decelerate_alpha.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 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.
--->
-
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
-    android:interpolator="@android:anim/decelerate_interpolator"
-    android:fromAlpha="0.0"
-    android:toAlpha="1.0"
-    android:duration="2000" />
diff --git a/tests/res/anim/layout_anim_controller_animation.xml b/tests/res/anim/layout_anim_controller_animation.xml
deleted file mode 100644
index 1e3608c..0000000
--- a/tests/res/anim/layout_anim_controller_animation.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
-       android:interpolator="@android:anim/accelerate_interpolator"
-       android:fillAfter="true"
-       android:fromAlpha="0.0"
-       android:toAlpha="1.0"
-       android:duration="1000" />
diff --git a/tests/res/anim/lineartest.xml b/tests/res/anim/lineartest.xml
deleted file mode 100644
index 7a41628..0000000
--- a/tests/res/anim/lineartest.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<screenplay>
-     <paint id="paint" antiAlias="true">
-         <color id="col" color="gray"/>
-     </paint>
-     <event kind="onLoad">
-         <add id="addPaint" use="paint"/>
-         <text y="15" text="hello"/>
-     </event>
-     <event kind="keyPress" code="up">
-         <apply scope="addPaint">
-             <set target="paint" field="linearText" to="true"/>
-             <set target="col" field="color" to="black"/>
-             <animate target="paint" id="grow" field="textSize" from="12" to="15" dur=".25"/>
-         </apply>
-     </event>
-     <event kind="onEnd" target="grow">
-         <apply scope="addPaint">
-             <set target="paint" field="linearText" to="false"/>
-         </apply>
-     </event>
-     <event kind="keyPress" code="down">
-         <apply scope="addPaint">
-             <set target="col" field="color" to="gray"/>
-             <animate target="paint" id="shrink" field="textSize" from="15" to="12" dur=".25"/>
-         </apply>
-     </event>
-     <event kind="onEnd" target="shrink">
-         <apply scope="addPaint">
-             <set target="paint" field="linearText" to="false"/>
-         </apply>
-     </event>
- </screenplay>
diff --git a/tests/res/anim/move_ani.xml b/tests/res/anim/move_ani.xml
deleted file mode 100644
index b691c0d..0000000
--- a/tests/res/anim/move_ani.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<translate xmlns:android="http://schemas.android.com/apk/res/android"
-           android:fromXDelta="0"
-           android:toXDelta="4"
-           android:duration="2000"
-           android:interpolator="@anim/move_cycle" />
diff --git a/tests/res/anim/move_cycle.xml b/tests/res/anim/move_cycle.xml
deleted file mode 100644
index 2e2233a..0000000
--- a/tests/res/anim/move_cycle.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="20" />
diff --git a/tests/res/anim/movie_test.xml b/tests/res/anim/movie_test.xml
deleted file mode 100644
index dcebd16..0000000
--- a/tests/res/anim/movie_test.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<screenplay>
-    <event kind="onLoad">
-        <movie src="lineartest.xml"/>
-    </event>
-</screenplay>
diff --git a/tests/res/color/color1.xml b/tests/res/color/color1.xml
deleted file mode 100755
index 87034fa..0000000
--- a/tests/res/color/color1.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_focused="true" android:color="@color/testcolor1"/>
-    <item android:color="@color/testcolor2"/>
-</selector>
diff --git a/tests/res/drawable-nodpi/vector_icon_clip_path_1_golden.png b/tests/res/drawable-nodpi/vector_icon_clip_path_1_golden.png
deleted file mode 100644
index be487d1..0000000
--- a/tests/res/drawable-nodpi/vector_icon_clip_path_1_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_create_golden.png b/tests/res/drawable-nodpi/vector_icon_create_golden.png
deleted file mode 100644
index 943fce5..0000000
--- a/tests/res/drawable-nodpi/vector_icon_create_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_delete_golden.png b/tests/res/drawable-nodpi/vector_icon_delete_golden.png
deleted file mode 100644
index b46363e..0000000
--- a/tests/res/drawable-nodpi/vector_icon_delete_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_heart_golden.png b/tests/res/drawable-nodpi/vector_icon_heart_golden.png
deleted file mode 100644
index 7450751..0000000
--- a/tests/res/drawable-nodpi/vector_icon_heart_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_random_path_1_golden.png b/tests/res/drawable-nodpi/vector_icon_random_path_1_golden.png
deleted file mode 100644
index 91776a9..0000000
--- a/tests/res/drawable-nodpi/vector_icon_random_path_1_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_random_path_2_golden.png b/tests/res/drawable-nodpi/vector_icon_random_path_2_golden.png
deleted file mode 100644
index 9af40a3..0000000
--- a/tests/res/drawable-nodpi/vector_icon_random_path_2_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_render_order_1_golden.png b/tests/res/drawable-nodpi/vector_icon_render_order_1_golden.png
deleted file mode 100644
index ea3be94..0000000
--- a/tests/res/drawable-nodpi/vector_icon_render_order_1_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_render_order_2_golden.png b/tests/res/drawable-nodpi/vector_icon_render_order_2_golden.png
deleted file mode 100644
index f317901..0000000
--- a/tests/res/drawable-nodpi/vector_icon_render_order_2_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_repeated_a_1_golden.png b/tests/res/drawable-nodpi/vector_icon_repeated_a_1_golden.png
deleted file mode 100644
index b3acfe7..0000000
--- a/tests/res/drawable-nodpi/vector_icon_repeated_a_1_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_repeated_a_2_golden.png b/tests/res/drawable-nodpi/vector_icon_repeated_a_2_golden.png
deleted file mode 100644
index bbc84b9..0000000
--- a/tests/res/drawable-nodpi/vector_icon_repeated_a_2_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_repeated_cq_golden.png b/tests/res/drawable-nodpi/vector_icon_repeated_cq_golden.png
deleted file mode 100644
index 8d73cfd..0000000
--- a/tests/res/drawable-nodpi/vector_icon_repeated_cq_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_repeated_st_golden.png b/tests/res/drawable-nodpi/vector_icon_repeated_st_golden.png
deleted file mode 100644
index 6094a9a..0000000
--- a/tests/res/drawable-nodpi/vector_icon_repeated_st_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_schedule_golden.png b/tests/res/drawable-nodpi/vector_icon_schedule_golden.png
deleted file mode 100644
index 9822bc2..0000000
--- a/tests/res/drawable-nodpi/vector_icon_schedule_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_settings_golden.png b/tests/res/drawable-nodpi/vector_icon_settings_golden.png
deleted file mode 100644
index d12b142..0000000
--- a/tests/res/drawable-nodpi/vector_icon_settings_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_stroke_1_golden.png b/tests/res/drawable-nodpi/vector_icon_stroke_1_golden.png
deleted file mode 100644
index c57ad20..0000000
--- a/tests/res/drawable-nodpi/vector_icon_stroke_1_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_stroke_2_golden.png b/tests/res/drawable-nodpi/vector_icon_stroke_2_golden.png
deleted file mode 100644
index aee8ff5..0000000
--- a/tests/res/drawable-nodpi/vector_icon_stroke_2_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_stroke_3_golden.png b/tests/res/drawable-nodpi/vector_icon_stroke_3_golden.png
deleted file mode 100644
index 1212fb3..0000000
--- a/tests/res/drawable-nodpi/vector_icon_stroke_3_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_transformation_1_golden.png b/tests/res/drawable-nodpi/vector_icon_transformation_1_golden.png
deleted file mode 100644
index baf418d..0000000
--- a/tests/res/drawable-nodpi/vector_icon_transformation_1_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_transformation_2_golden.png b/tests/res/drawable-nodpi/vector_icon_transformation_2_golden.png
deleted file mode 100644
index e0e14f3..0000000
--- a/tests/res/drawable-nodpi/vector_icon_transformation_2_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_transformation_3_golden.png b/tests/res/drawable-nodpi/vector_icon_transformation_3_golden.png
deleted file mode 100644
index b6798c2..0000000
--- a/tests/res/drawable-nodpi/vector_icon_transformation_3_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_transformation_4_golden.png b/tests/res/drawable-nodpi/vector_icon_transformation_4_golden.png
deleted file mode 100644
index a5d4d33..0000000
--- a/tests/res/drawable-nodpi/vector_icon_transformation_4_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_transformation_5_golden.png b/tests/res/drawable-nodpi/vector_icon_transformation_5_golden.png
deleted file mode 100644
index 0d8ded1..0000000
--- a/tests/res/drawable-nodpi/vector_icon_transformation_5_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable-nodpi/vector_icon_transformation_6_golden.png b/tests/res/drawable-nodpi/vector_icon_transformation_6_golden.png
deleted file mode 100644
index 64d07fa..0000000
--- a/tests/res/drawable-nodpi/vector_icon_transformation_6_golden.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/alpha.png b/tests/res/drawable/alpha.png
deleted file mode 100644
index 8a88548..0000000
--- a/tests/res/drawable/alpha.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/animated.gif b/tests/res/drawable/animated.gif
deleted file mode 100644
index 51baf15..0000000
--- a/tests/res/drawable/animated.gif
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/animationdrawable.xml b/tests/res/drawable/animationdrawable.xml
deleted file mode 100644
index 6756966..0000000
--- a/tests/res/drawable/animationdrawable.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false">
-    <item android:drawable="@drawable/testimage" android:duration="3000"/>
-    <item android:drawable="@drawable/pass" android:duration="2000"/>
-    <item android:drawable="@drawable/scenery" android:duration="1000"/>
-</animation-list>
diff --git a/tests/res/drawable/baseline_jpeg.jpg b/tests/res/drawable/baseline_jpeg.jpg
deleted file mode 100644
index ed5251c..0000000
--- a/tests/res/drawable/baseline_jpeg.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/baseline_restart_jpeg.jpg b/tests/res/drawable/baseline_restart_jpeg.jpg
deleted file mode 100644
index 00dcc5b..0000000
--- a/tests/res/drawable/baseline_restart_jpeg.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/bitmapdrawable_theme.xml b/tests/res/drawable/bitmapdrawable_theme.xml
deleted file mode 100644
index 6df36b3..0000000
--- a/tests/res/drawable/bitmapdrawable_theme.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
-    android:antialias="?attr/themeBoolean"
-    android:autoMirrored="?attr/themeBoolean"
-    android:dither="?attr/themeBoolean"
-    android:filter="?attr/themeBoolean"
-    android:gravity="?attr/themeGravity"
-    android:mipMap="?attr/themeBoolean"
-    android:src="?attr/themeBitmap"
-    android:tileMode="?attr/themeTileMode" />
diff --git a/tests/res/drawable/bmp_test.bmp b/tests/res/drawable/bmp_test.bmp
deleted file mode 100644
index 5ec6dd4..0000000
--- a/tests/res/drawable/bmp_test.bmp
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/colordrawable_test.xml b/tests/res/drawable/colordrawable_test.xml
deleted file mode 100644
index 9d2f390..0000000
--- a/tests/res/drawable/colordrawable_test.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<ColorDrawable xmlns:android="http://schemas.android.com/apk/res/android" android:color="#02000000">
-    <solid android:color="#02000000"/>
-</ColorDrawable>
diff --git a/tests/res/drawable/colordrawable_theme.xml b/tests/res/drawable/colordrawable_theme.xml
deleted file mode 100644
index 00c6fe7..0000000
--- a/tests/res/drawable/colordrawable_theme.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?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.
--->
-
-<color xmlns:android="http://schemas.android.com/apk/res/android"
-    android:color="?attr/themeColor" />
diff --git a/tests/res/drawable/colorstatelist_test.xml b/tests/res/drawable/colorstatelist_test.xml
deleted file mode 100644
index c86a1a7..0000000
--- a/tests/res/drawable/colorstatelist_test.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-   <item android:state_focused="true" android:color="@color/resource_test_color"/>
-   <item android:state_pressed="true" android:state_enabled="false" android:color="@color/resource_test_color"/>
-   <item android:state_enabled="false" android:color="@color/resource_test_color"/>
-   <item android:state_active="true" android:color="@color/resource_test_color"/>
-   <item android:color="@color/resource_test_color"/>
- </selector>
diff --git a/tests/res/drawable/faces.jpg b/tests/res/drawable/faces.jpg
deleted file mode 100644
index 0672022..0000000
--- a/tests/res/drawable/faces.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/failed.jpg b/tests/res/drawable/failed.jpg
deleted file mode 100644
index 1bb9b52..0000000
--- a/tests/res/drawable/failed.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/gif_test.gif b/tests/res/drawable/gif_test.gif
deleted file mode 100644
index d1c2815..0000000
--- a/tests/res/drawable/gif_test.gif
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/google_logo_1.png b/tests/res/drawable/google_logo_1.png
deleted file mode 100644
index 6e038fc..0000000
--- a/tests/res/drawable/google_logo_1.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/google_logo_2.webp b/tests/res/drawable/google_logo_2.webp
deleted file mode 100644
index f92c42b..0000000
--- a/tests/res/drawable/google_logo_2.webp
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/gradientdrawable.xml b/tests/res/drawable/gradientdrawable.xml
deleted file mode 100644
index ed8ff96..0000000
--- a/tests/res/drawable/gradientdrawable.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <gradient android:startColor="#ffffffff" android:centerColor="#ffff0000"
-              android:endColor="#0000ffff" />
-    <corners android:radius="8px" />
-    <padding android:left="4px" android:top="2px"
-             android:right="6px" android:bottom="10px" />
-    <size android:width="42px" android:height="63px"/>
-</shape>
-
diff --git a/tests/res/drawable/gradientdrawable_radius_base.xml b/tests/res/drawable/gradientdrawable_radius_base.xml
deleted file mode 100644
index ecd50f8..0000000
--- a/tests/res/drawable/gradientdrawable_radius_base.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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.
--->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android" >
-
-    <gradient
-        android:centerColor="#ffff0000"
-        android:endColor="#0000ffff"
-        android:gradientRadius="50%"
-        android:startColor="#ffffffff"
-        android:type="radial" />
-
-    <corners android:radius="8px" />
-
-    <padding
-        android:bottom="10px"
-        android:left="4px"
-        android:right="6px"
-        android:top="2px" />
-
-    <size
-        android:height="50px"
-        android:width="50px" />
-
-</shape>
\ No newline at end of file
diff --git a/tests/res/drawable/gradientdrawable_radius_parent.xml b/tests/res/drawable/gradientdrawable_radius_parent.xml
deleted file mode 100644
index 73d116a..0000000
--- a/tests/res/drawable/gradientdrawable_radius_parent.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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.
--->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android" >
-
-    <gradient
-        android:centerColor="#ffff0000"
-        android:endColor="#0000ffff"
-        android:gradientRadius="50%p"
-        android:startColor="#ffffffff"
-        android:type="radial" />
-
-    <corners android:radius="8px" />
-
-    <padding
-        android:bottom="10px"
-        android:left="4px"
-        android:right="6px"
-        android:top="2px" />
-
-    <size
-        android:height="50px"
-        android:width="50px" />
-
-</shape>
\ No newline at end of file
diff --git a/tests/res/drawable/gradientdrawable_theme.xml b/tests/res/drawable/gradientdrawable_theme.xml
deleted file mode 100644
index 68cec62..0000000
--- a/tests/res/drawable/gradientdrawable_theme.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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.
--->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android" >
-
-    <corners
-        android:bottomLeftRadius="?attr/themeDimension"
-        android:bottomRightRadius="?attr/themeDimension"
-        android:topLeftRadius="?attr/themeDimension"
-        android:topRightRadius="?attr/themeDimension" />
-
-    <gradient
-        android:angle="?attr/themeAngle"
-        android:centerColor="?attr/themeColor"
-        android:centerX="?attr/themeFloat"
-        android:centerY="?attr/themeFloat"
-        android:endColor="?attr/themeColor"
-        android:gradientRadius="?attr/themeFloat"
-        android:startColor="?attr/themeColor"
-        android:useLevel="?attr/themeBoolean" />
-
-    <padding
-        android:bottom="?attr/themeDimension"
-        android:left="?attr/themeDimension"
-        android:right="?attr/themeDimension"
-        android:top="?attr/themeDimension" />
-
-    <size
-        android:height="?attr/themeDimension"
-        android:width="?attr/themeDimension" />
-
-    <solid android:color="?attr/themeColor" />
-
-    <stroke android:color="?attr/themeColor" />
-
-</shape>
diff --git a/tests/res/drawable/ic_cts_minitab_selected.png b/tests/res/drawable/ic_cts_minitab_selected.png
deleted file mode 100644
index c730050..0000000
--- a/tests/res/drawable/ic_cts_minitab_selected.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/ic_cts_selected.png b/tests/res/drawable/ic_cts_selected.png
deleted file mode 100644
index 72a065c..0000000
--- a/tests/res/drawable/ic_cts_selected.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/icon_black.jpg b/tests/res/drawable/icon_black.jpg
deleted file mode 100644
index 4c9062a..0000000
--- a/tests/res/drawable/icon_black.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/icon_blue.jpg b/tests/res/drawable/icon_blue.jpg
deleted file mode 100644
index 9e6c1c8..0000000
--- a/tests/res/drawable/icon_blue.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/icon_green.jpg b/tests/res/drawable/icon_green.jpg
deleted file mode 100644
index 55a78f2..0000000
--- a/tests/res/drawable/icon_green.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/icon_red.jpg b/tests/res/drawable/icon_red.jpg
deleted file mode 100644
index 6bc9e1f..0000000
--- a/tests/res/drawable/icon_red.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/icon_yellow.jpg b/tests/res/drawable/icon_yellow.jpg
deleted file mode 100644
index e748059..0000000
--- a/tests/res/drawable/icon_yellow.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/insetdrawable.xml b/tests/res/drawable/insetdrawable.xml
deleted file mode 100644
index 8431c69..0000000
--- a/tests/res/drawable/insetdrawable.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
-    android:drawable="@drawable/testimage"/>
-
diff --git a/tests/res/drawable/layerdrawable.xml b/tests/res/drawable/layerdrawable.xml
deleted file mode 100644
index 521703b..0000000
--- a/tests/res/drawable/layerdrawable.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:drawable="@drawable/testimage"/>
-    <item android:drawable="@drawable/start"/>
-</layer-list>
diff --git a/tests/res/drawable/layerdrawable_theme.xml b/tests/res/drawable/layerdrawable_theme.xml
deleted file mode 100644
index 2a678ff..0000000
--- a/tests/res/drawable/layerdrawable_theme.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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.
--->
-
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
-    android:autoMirrored="?attr/themeBoolean" >
-
-    <item android:drawable="@drawable/bitmapdrawable_theme"/>
-    <item>
-        <nine-patch
-            android:autoMirrored="?attr/themeBoolean"
-            android:dither="?attr/themeBoolean"
-            android:src="?attr/themeNinePatch" />
-    </item>
-
-</layer-list>
\ No newline at end of file
diff --git a/tests/res/drawable/levellistdrawable.xml b/tests/res/drawable/levellistdrawable.xml
deleted file mode 100644
index 8fa93e8..0000000
--- a/tests/res/drawable/levellistdrawable.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<level-list xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:maxLevel="50" android:drawable="@drawable/testimage"/>
-    <item android:maxLevel="100" android:drawable="@drawable/start"/>
-</level-list>
-
diff --git a/tests/res/drawable/ninepatch_0.9.png b/tests/res/drawable/ninepatch_0.9.png
deleted file mode 100644
index 24019d8..0000000
--- a/tests/res/drawable/ninepatch_0.9.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/ninepatch_1.9.png b/tests/res/drawable/ninepatch_1.9.png
deleted file mode 100644
index c56b1db..0000000
--- a/tests/res/drawable/ninepatch_1.9.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/ninepatchdrawable.xml b/tests/res/drawable/ninepatchdrawable.xml
deleted file mode 100644
index 6e72457..0000000
--- a/tests/res/drawable/ninepatchdrawable.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
-    android:src="@drawable/ninepatch_0"
-    android:dither="true"
-/>
-
diff --git a/tests/res/drawable/ninepatchdrawable_theme.xml b/tests/res/drawable/ninepatchdrawable_theme.xml
deleted file mode 100644
index bb031a5..0000000
--- a/tests/res/drawable/ninepatchdrawable_theme.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?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.
--->
-
-<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
-    android:autoMirrored="?attr/themeBoolean"
-    android:dither="?attr/themeBoolean"
-    android:src="?attr/themeNinePatch" />
diff --git a/tests/res/drawable/no_padding.png b/tests/res/drawable/no_padding.png
deleted file mode 100644
index 7d4c27c..0000000
--- a/tests/res/drawable/no_padding.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/opaque.9.png b/tests/res/drawable/opaque.9.png
deleted file mode 100644
index a60f6d8..0000000
--- a/tests/res/drawable/opaque.9.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/padding_0.9.png b/tests/res/drawable/padding_0.9.png
deleted file mode 100644
index 0127bf4..0000000
--- a/tests/res/drawable/padding_0.9.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/paintdrawable_attr.xml b/tests/res/drawable/paintdrawable_attr.xml
deleted file mode 100644
index 444e5e2..0000000
--- a/tests/res/drawable/paintdrawable_attr.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- */
- -->
-<shape  xmlns:android="http://schemas.android.com/apk/res/android"
-        android:shape="rectangle">
-
-        <solid
-            android:color="#00000000"/>
-
-        <stroke
-            android:width="2dp"
-            android:color="#ff000000"/>
-
-        <padding
-            android:paddingLeft="1dp"
-            android:paddingRight="10dp"
-            android:paddingTop="1dp"
-            android:paddingBottom="10dp"/>
-
-        <corners
-            android:radius="9dp"
-            android:bottomRightRadius="8dp"
-            android:bottomLeftRadius="8dp"
-            android:topLeftRadius="0.5dp"
-            android:topRightRadius="0.5dp"/>
-
-</shape>
-
diff --git a/tests/res/drawable/pass.jpg b/tests/res/drawable/pass.jpg
deleted file mode 100644
index 2f4b083..0000000
--- a/tests/res/drawable/pass.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/png_test.png b/tests/res/drawable/png_test.png
deleted file mode 100644
index 5230051..0000000
--- a/tests/res/drawable/png_test.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/premul_data.png b/tests/res/drawable/premul_data.png
deleted file mode 100644
index 92d7e37..0000000
--- a/tests/res/drawable/premul_data.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/progressive_jpeg.jpg b/tests/res/drawable/progressive_jpeg.jpg
deleted file mode 100644
index 6b58be4..0000000
--- a/tests/res/drawable/progressive_jpeg.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/progressive_restart_jpeg.jpg b/tests/res/drawable/progressive_restart_jpeg.jpg
deleted file mode 100644
index 352c7a8..0000000
--- a/tests/res/drawable/progressive_restart_jpeg.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/robot.png b/tests/res/drawable/robot.png
deleted file mode 100644
index 8a9e698..0000000
--- a/tests/res/drawable/robot.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/rotatedrawable.xml b/tests/res/drawable/rotatedrawable.xml
deleted file mode 100644
index b9b2cfe..0000000
--- a/tests/res/drawable/rotatedrawable.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<rotate xmlns:android="http://schemas.android.com/apk/res/android"
-    android:pivotX="50%" android:pivotY="50%"
-    android:fromDegrees="0" android:toDegrees="360"
-    android:drawable="@drawable/testimage"/>
-
diff --git a/tests/res/drawable/scaled1.png b/tests/res/drawable/scaled1.png
deleted file mode 100644
index 2dad421..0000000
--- a/tests/res/drawable/scaled1.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/scaled2.png b/tests/res/drawable/scaled2.png
deleted file mode 100644
index 6d6a94f..0000000
--- a/tests/res/drawable/scaled2.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/scaledrawable.xml b/tests/res/drawable/scaledrawable.xml
deleted file mode 100644
index 7e65dce..0000000
--- a/tests/res/drawable/scaledrawable.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<scale xmlns:android="http://schemas.android.com/apk/res/android"
-    android:fromXScale="1.0"
-    android:toXScale="1.4"
-    android:fromYScale="1.0"
-    android:toYScale="0.6"
-    android:drawable="@drawable/testimage"/>
diff --git a/tests/res/drawable/scenery.jpg b/tests/res/drawable/scenery.jpg
deleted file mode 100644
index 7a6145b..0000000
--- a/tests/res/drawable/scenery.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/shapedrawable_test.xml b/tests/res/drawable/shapedrawable_test.xml
deleted file mode 100644
index 02da9f8..0000000
--- a/tests/res/drawable/shapedrawable_test.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<MockShapeDrawable xmlns:android="http://schemas.android.com/apk/res/android"
-       android:color="#00000000" android:width="42px" android:height="63px">
-    <padding android:left="1px" android:top="2px" android:right="3px" android:bottom="4px"/>
-    <testattrs android:id="@id/background"/>
-</MockShapeDrawable>
-
diff --git a/tests/res/drawable/size_48x48.jpg b/tests/res/drawable/size_48x48.jpg
deleted file mode 100644
index 5c2291e..0000000
--- a/tests/res/drawable/size_48x48.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/start.jpg b/tests/res/drawable/start.jpg
deleted file mode 100644
index 54e05e0..0000000
--- a/tests/res/drawable/start.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/statelist_testimage.jpg b/tests/res/drawable/statelist_testimage.jpg
deleted file mode 100644
index 754df0c..0000000
--- a/tests/res/drawable/statelist_testimage.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/statelistdrawable.xml b/tests/res/drawable/statelistdrawable.xml
deleted file mode 100644
index b867904..0000000
--- a/tests/res/drawable/statelistdrawable.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-   <item android:state_focused="true" android:drawable="@drawable/statelist_testimage"/>
-   <item android:state_enabled="false" android:drawable="@drawable/statelist_testimage"/>
-</selector>
-
diff --git a/tests/res/drawable/testcolor.xml b/tests/res/drawable/testcolor.xml
deleted file mode 100644
index d7b2718..0000000
--- a/tests/res/drawable/testcolor.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:color="#FFA6C839"/>
-</selector>
-
diff --git a/tests/res/drawable/testimage.jpg b/tests/res/drawable/testimage.jpg
deleted file mode 100644
index 754df0c..0000000
--- a/tests/res/drawable/testimage.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/transition_test.xml b/tests/res/drawable/transition_test.xml
deleted file mode 100644
index 3d62378..0000000
--- a/tests/res/drawable/transition_test.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<transition xmlns:android="http://schemas.android.com/apk/res/android" >
-    <item >
-        <color android:color="#ffff0000" />
-    </item>
-
-    <item >
-        <color android:color="#ff0000ff" />
-    </item>
-</transition>
-
diff --git a/tests/res/drawable/transparent_border.9.png b/tests/res/drawable/transparent_border.9.png
deleted file mode 100644
index 2614c06..0000000
--- a/tests/res/drawable/transparent_border.9.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/transparent_right.9.png b/tests/res/drawable/transparent_right.9.png
deleted file mode 100644
index a438312..0000000
--- a/tests/res/drawable/transparent_right.9.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/typeface_test.png b/tests/res/drawable/typeface_test.png
deleted file mode 100644
index c337f5f..0000000
--- a/tests/res/drawable/typeface_test.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/vector_icon_clip_path_1.xml b/tests/res/drawable/vector_icon_clip_path_1.xml
deleted file mode 100644
index c2ab429..0000000
--- a/tests/res/drawable/vector_icon_clip_path_1.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="12.25"
-        android:viewportWidth="7.30625" >
-
-    <group
-        android:pivotX="3.65"
-        android:pivotY="6.125"
-        android:rotation="-30" >
-        <clip-path
-            android:name="clip1"
-            android:pathData="
-                M 0, 6.125
-                l 7.3, 0
-                l 0, 12.25
-                l -7.3, 0
-                z" />
-    </group>
-    <group>
-        <path
-            android:name="one"
-            android:fillColor="#ff88ff"
-            android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875 -2.109375,0.421875 0.0-1.078125
-                l 2.09375-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0
-                l -5.046875,0.0 0.0-1.0Z" />
-    </group>
-    <group
-        android:pivotX="3.65"
-        android:pivotY="6.125"
-        android:rotation="-30" >
-        <clip-path
-            android:name="clip2"
-            android:pathData="
-                M 0, 0
-                l 7.3, 0
-                l 0, 6.125
-                l -7.3, 0
-                z" />
-    </group>
-    <group>
-        <path
-            android:name="two"
-            android:fillColor="#ff88ff"
-            android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0 -5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375
-                        q 1.1718752-1.1875 1.4687502-1.53125 0.578125-0.625 0.796875-1.0625
-                        q 0.234375-0.453125 0.234375-0.875 0.0-0.703125 -0.5-1.140625
-                        q -0.484375-0.4375 -1.2656252-0.4375 -0.5625,0.0 -1.1875,0.1875
-                        q -0.609375,0.1875 -1.3125,0.59375l 0.0-1.203125q 0.71875-0.28125 1.328125-0.421875
-                        q 0.625-0.15625 1.140625-0.15625 1.3593752,0.0 2.1718752,0.6875
-                        q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125 -0.203125,1.015625
-                        q -0.203125,0.484375 -0.734375,1.140625 -0.15625,0.171875 -0.9375,0.984375
-                        q -0.78125024,0.8125 -2.2187502,2.265625Z" />
-    </group>
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_create.xml b/tests/res/drawable/vector_icon_create.xml
deleted file mode 100644
index 7db4ad5..0000000
--- a/tests/res/drawable/vector_icon_create.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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.
- */
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="24"
-        android:viewportWidth="24" >
-
-    <path
-        android:fillColor="#FF000000"
-        android:pathData="M3.0,17.25L3.0,21.0l3.75,0.0L17.813995,9.936001l-3.75-3.75L3.0,17.25zM20.707,7.0429993c0.391-0.391 0.391-1.023 0.0-1.414l-2.336-2.336c-0.391-0.391-1.023-0.391 -1.414,0.0l-1.832,1.832l3.75,3.75L20.707,7.0429993z" />
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_delete.xml b/tests/res/drawable/vector_icon_delete.xml
deleted file mode 100644
index 8d9c21c..0000000
--- a/tests/res/drawable/vector_icon_delete.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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.
- */
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="24"
-        android:viewportWidth="24" >
-
-    <path
-        android:fillColor="#FF000000"
-        android:pathData="M6.0,19.0c0.0,1.104 0.896,2.0 2.0,2.0l8.0,0.0c1.104,0.0 2.0-0.896 2.0-2.0l0.0-12.0L6.0,7.0L6.0,19.0zM18.0,4.0l-2.5,0.0l-1.0-1.0l-5.0,0.0l-1.0,1.0L6.0,4.0C5.4469986,4.0 5.0,4.4469986 5.0,5.0l0.0,1.0l14.0,0.0l0.0-1.0C19.0,4.4469986 18.552002,4.0 18.0,4.0z" />
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_heart.xml b/tests/res/drawable/vector_icon_heart.xml
deleted file mode 100644
index ff55fe5..0000000
--- a/tests/res/drawable/vector_icon_heart.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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.
- */
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="24"
-        android:viewportWidth="24" >
-
-    <path
-        android:fillColor="#FF000000"
-        android:pathData="M16.0,5.0c-1.955,0.0 -3.83,1.268 -4.5,3.0c-0.67-1.732 -2.547-3.0 -4.5-3.0C4.4570007,5.0 2.5,6.931999 2.5,9.5c0.0,3.529 3.793,6.258 9.0,11.5c5.207-5.242 9.0-7.971 9.0-11.5C20.5,6.931999 18.543,5.0 16.0,5.0z" />
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_random_path_1.xml b/tests/res/drawable/vector_icon_random_path_1.xml
deleted file mode 100644
index 5c55294..0000000
--- a/tests/res/drawable/vector_icon_random_path_1.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="128"
-        android:viewportWidth="128" >
-
-    <path
-        android:fillColor="#FF00FF00"
-        android:pathData="
-                 m 0.0 0.0
-                 c 58.357853 57.648304 47.260395 2.2044754 3.0 3.0
-                 s 61.29288 10.748665 6.0 6.0
-                 s 0.12015152 45.193787 9.0 9.0
-                 s 32.573513 46.862522 12.0 12.0
-                 C 52.051823 62.050003 14.197739 51.99994 15.0 15.0
-                 S 58.365482 51.877937 18.0 18.0
-                 S 26.692455 3.9604378 21.0 21.0
-                 S 21.433464 52.17514 24.0 24.0
-                 M 27.0 27.0
-                 s 0.77630234 20.606667 30.0 30.0
-                 M 33.0 33.0
-                 S 31.06879 21.506374 36.0 36.0
-                 m 39.0 39.0
-                 s 11.699013 23.684185 42.0 42.0
-                 m 45.0 45.0
-                 S 3.7642136 38.589584 48.0 48.0
-                 Q 27.203026 53.329338 51.0 51.0
-                 s 39.229023 15.1781845 54.0 54.0
-                 Q 47.946877 23.706299 57.0 57.0
-                 S 45.63452 56.15198 60.0 60.0 "
-        android:strokeColor="#FF0000FF"
-        android:strokeWidth="1" />
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_random_path_2.xml b/tests/res/drawable/vector_icon_random_path_2.xml
deleted file mode 100644
index 95e0a54..0000000
--- a/tests/res/drawable/vector_icon_random_path_2.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="128"
-        android:viewportWidth="128" >
-
-    <path
-        android:fillColor="#FF00FF00"
-        android:pathData="
-                 m 0.0 0.0
-                 q 4.7088394 36.956432 3.0 3.0
-                 s 29.470345 16.754963 6.0 6.0
-                 q 20.278355 7.4670525 9.0 9.0
-                 S 30.897224 17.732414 12.0 12.0
-                 T 15.0 15.0
-                 s 63.47204 45.67142 18.0 18.0
-                 T 21.0 21.0
-                 S 0.3184204 24.808247 24.0 24.0
-                 t 27.0 27.0
-                 s 39.02275 38.261158 30.0 30.0
-                 t 33.0 33.0
-                 S 50.709816 16.067192 36.0 36.0
-                 a 62.50911 7.7131805 51.932335 0 0 39.0 39.0
-                 s 5.155651 15.749123 42.0 42.0
-                 a 51.87415 40.30564 49.804344 0 0 45.0 45.0
-                 S 16.16534 62.55986 48.0 48.0
-                 A 39.90161 43.904438 41.642593 1 0 51.0 51.0
-                 s 46.258068 32.12831 54.0 54.0
-                 A 22.962704 55.05604 42.912285 1 1 57.0 57.0
-                 S 36.47731 54.216763 60.0 60.0 "
-        android:strokeColor="#FF0000FF"
-        android:strokeWidth="1" />
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_render_order_1.xml b/tests/res/drawable/vector_icon_render_order_1.xml
deleted file mode 100644
index 8639096..0000000
--- a/tests/res/drawable/vector_icon_render_order_1.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="400"
-        android:viewportWidth="400" >
-
-    <group
-        android:name="FirstLevelGroup"
-        android:alpha="0.9"
-        android:translateX="100.0"
-        android:translateY="0.0" >
-        <path
-            android:fillColor="#FFFF0000"
-            android:pathData="@string/rectangle200" />
-
-        <group
-            android:name="SecondLevelGroup1"
-            android:alpha="0.9"
-            android:translateX="-100.0"
-            android:translateY="50.0" >
-            <path
-                android:fillColor="#FF00FF00"
-                android:pathData="@string/rectangle200" />
-
-            <group
-                android:name="ThridLevelGroup1"
-                android:alpha="0.9"
-                android:translateX="-100.0"
-                android:translateY="50.0" >
-                <path
-                    android:fillColor="#FF0000FF"
-                    android:pathData="@string/rectangle200" />
-            </group>
-            <group
-                android:name="ThridLevelGroup2"
-                android:alpha="0.8"
-                android:translateX="100.0"
-                android:translateY="50.0" >
-                <path
-                    android:fillColor="#FF000000"
-                    android:pathData="@string/rectangle200" />
-            </group>
-        </group>
-        <group
-            android:name="SecondLevelGroup2"
-            android:alpha="0.8"
-            android:translateX="100.0"
-            android:translateY="50.0" >
-            <path
-                android:fillColor="#FF0000FF"
-                android:pathData="@string/rectangle200" />
-
-            <group
-                android:name="ThridLevelGroup3"
-                android:alpha="0.9"
-                android:translateX="-100.0"
-                android:translateY="50.0" >
-                <path
-                    android:fillColor="#FFFF0000"
-                    android:pathData="@string/rectangle200" />
-            </group>
-            <group
-                android:name="ThridLevelGroup4"
-                android:alpha="0.8"
-                android:translateX="100.0"
-                android:translateY="50.0" >
-                <path
-                    android:fillColor="#FF00FF00"
-                    android:pathData="@string/rectangle200" />
-            </group>
-        </group>
-    </group>
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_render_order_2.xml b/tests/res/drawable/vector_icon_render_order_2.xml
deleted file mode 100644
index 069a531..0000000
--- a/tests/res/drawable/vector_icon_render_order_2.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="400"
-        android:viewportWidth="400" >
-
-    <group
-        android:name="FirstLevelGroup"
-        android:alpha="0.9"
-        android:translateX="100.0"
-        android:translateY="0.0" >
-        <group
-            android:name="SecondLevelGroup1"
-            android:alpha="0.9"
-            android:translateX="-100.0"
-            android:translateY="50.0" >
-            <path
-                android:fillColor="#FF00FF00"
-                android:pathData="@string/rectangle200" />
-
-            <group
-                android:name="ThridLevelGroup1"
-                android:alpha="0.9"
-                android:translateX="-100.0"
-                android:translateY="50.0" >
-                <path
-                    android:fillColor="#FF0000FF"
-                    android:pathData="@string/rectangle200" />
-            </group>
-            <group
-                android:name="ThridLevelGroup2"
-                android:alpha="0.8"
-                android:translateX="100.0"
-                android:translateY="50.0" >
-                <path
-                    android:fillColor="#FF000000"
-                    android:pathData="@string/rectangle200" />
-            </group>
-        </group>
-        <group
-            android:name="SecondLevelGroup2"
-            android:alpha="0.8"
-            android:translateX="100.0"
-            android:translateY="50.0" >
-            <path
-                android:fillColor="#FF0000FF"
-                android:pathData="@string/rectangle200" />
-
-            <group
-                android:name="ThridLevelGroup3"
-                android:alpha="0.9"
-                android:translateX="-100.0"
-                android:translateY="50.0" >
-                <path
-                    android:fillColor="#FFFF0000"
-                    android:pathData="@string/rectangle200" />
-            </group>
-            <group
-                android:name="ThridLevelGroup4"
-                android:alpha="0.8"
-                android:translateX="100.0"
-                android:translateY="50.0" >
-                <path
-                    android:fillColor="#FF00FF00"
-                    android:pathData="@string/rectangle200" />
-            </group>
-        </group>
-
-        <path
-            android:fillColor="#FFFF0000"
-            android:pathData="@string/rectangle200" />
-    </group>
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_repeated_a_1.xml b/tests/res/drawable/vector_icon_repeated_a_1.xml
deleted file mode 100644
index e27464b..0000000
--- a/tests/res/drawable/vector_icon_repeated_a_1.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="128"
-        android:viewportWidth="128" >
-
-    <path
-        android:fillColor="#FF00FF00"
-        android:pathData="m 45.712063 19.109837
-                H 24.509682
-                a 59.3415 26.877445 22.398209 1 1 3.3506432 1.6524277
-                a 34.922844 36.72583 13.569004 0 0 24.409462 20.931156
-                a 43.47134 32.61542 52.534607 1 0 7.187504 61.509724
-                A 30.621132 41.44202 50.885685 0 0 23.235489 26.638653
-                A 7.251148 15.767811 44.704533 1 1 19.989803 21.33052
-                A 55.645584 46.20288 19.40316 0 1 32.881298 53.410923
-                c 30.649612 4.8525085 21.96682 1.3304634 17.300182 14.747681
-                a 9.375069 44.365055 57.169727 0 0 56.01326 52.59596
-                A 50.071907 37.331825 56.301754 1 0 14.676102 62.04976
-                C 36.531925 4.6217957 47.59332 54.793385 13.562473 13.753647
-                A 2.3695297 42.578487 54.250687 0 1 33.1337 41.511288
-                a 39.4827 38.844944 54.52335 1 1 13.549484 46.81581
-                c 56.943657 51.96854 27.938824 61.148792 24.168636 46.642727
-                "
-        android:strokeColor="#FF0000FF"
-        android:strokeWidth="1" />
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_repeated_a_2.xml b/tests/res/drawable/vector_icon_repeated_a_2.xml
deleted file mode 100644
index 924ba1b..0000000
--- a/tests/res/drawable/vector_icon_repeated_a_2.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="128"
-        android:viewportWidth="128" >
-
-    <path
-        android:fillColor="#FF00FF00"
-        android:pathData="m 45.712063 19.109837
-                H 24.509682
-                A 37.689938 2.3916092 17.462616 1 0 24.958328 48.110596
-                q 45.248383 30.396336 5.777027 3.4086685
-                a 30.966236 62.67946 50.532032 1 0 29.213684 60.63014
-                L 56.16764 8.342098
-                Q 61.172253 1.4613304 4.4721107 38.287144
-                A 6.284897 22.991482 47.409508 1 1 44.10166 60.998764
-                t 36.36881 55.68292
-                a 51.938667 35.22107 22.272938 1 1 28.572739 60.848858
-                A 19.610851 11.569599 51.407906 1 1 56.82705 24.386292
-                T 36.918854 59.542286
-                a 33.191364 10.553429 53.047726 1 0 54.874985 7.409252
-                s 30.186714 42.154182 59.73551 35.50219
-                A 47.9379 5.776497 28.307701 1 1 3.3323975 30.113499
-                a 22.462494 28.096004 55.76455 0 0 25.58981 30.816948
-                S 43.91107 54.679676 19.540264 0.34284973
-                "
-        android:strokeColor="#FF0000FF"
-        android:strokeWidth="1" />
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_repeated_cq.xml b/tests/res/drawable/vector_icon_repeated_cq.xml
deleted file mode 100644
index e0848f0..0000000
--- a/tests/res/drawable/vector_icon_repeated_cq.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="128"
-        android:viewportWidth="128" >
-
-    <path
-        android:fillColor="#FF00FF00"
-        android:pathData="m 30.81895 41.37989
-                v 31.00579
-                c 24.291603 52.03364 40.6086 24.840137 29.56704 6.5204926
-                45.133224 22.913471 33.052887 21.727486 33.369 61.60278
-                9.647232 22.098152 48.939598 47.470215 53.653687 62.32235
-                C 2.0560722 1.4615479 7.0928993 26.005287 40.137558 36.75628
-                11.246731 32.178127 59.367462 60.34823 57.254383 37.357815
-                47.75605 11.424667 3.3105545 51.886635 56.63027 17.12133
-                q 28.37534 32.85535 25.85654 33.57151
-                10.356537 51.850616 54.085087 35.653175
-                12.530029 52.87991 17.44696 11.780586
-                Q 2.585228 51.92801 60.000664 56.79912
-                54.18275 51.500694 9.375679 23.836113
-                60.35329 59.026245 31.058632 35.14934
-                "
-        android:strokeColor="#FF0000FF"
-        android:strokeWidth="1" />
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_repeated_st.xml b/tests/res/drawable/vector_icon_repeated_st.xml
deleted file mode 100644
index b104349..0000000
--- a/tests/res/drawable/vector_icon_repeated_st.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="128"
-        android:viewportWidth="128" >
-
-    <path
-        android:fillColor="#FF00FF00"
-        android:pathData="m 20.20005 8.139153
-                h 10.053165
-                s 14.2943 49.612846 35.520653 54.904068
-                50.1405 17.044182 5.470337 40.180553
-                3.125019 34.221123 53.212563 32.862965
-                S 35.985264 35.74349 0.15337753 59.27337
-                2.2951508 44.56783 51.089413 29.829689
-                8.5599785 22.649555 4.3914986 28.139206
-                t 11.932453 44.041077
-                62.629326 7.40921
-                23.302986 54.116184
-                T 43.560753 63.370514
-                40.156204 17.60786
-                40.12051 60.803394
-                "
-        android:strokeColor="#FF0000FF"
-        android:strokeWidth="1" />
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_schedule.xml b/tests/res/drawable/vector_icon_schedule.xml
deleted file mode 100644
index 64d19e8..0000000
--- a/tests/res/drawable/vector_icon_schedule.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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.
- */
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="24"
-        android:viewportWidth="24" >
-
-    <path
-        android:fillColor="#E6000000"
-        android:pathData="M11.994999,2.0C6.4679985,2.0 2.0,6.4780006 2.0,12.0s4.468,10.0 9.995,10.0S22.0,17.522 22.0,12.0S17.521,2.0 11.994999,2.0zM12.0,20.0c-4.42,0.0 -8.0-3.582-8.0-8.0s3.58-8.0 8.0-8.0s8.0,3.582 8.0,8.0S16.419998,20.0 12.0,20.0z" />
-    <path
-        android:fillColor="#E6000000"
-        android:pathData="M12.5,6.0l-1.5,0.0 0.0,7.0 5.3029995,3.1819992 0.75-1.249999-4.5529995-2.7320004z" />
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_settings.xml b/tests/res/drawable/vector_icon_settings.xml
deleted file mode 100644
index 13d7f05..0000000
--- a/tests/res/drawable/vector_icon_settings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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.
- */
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="24"
-        android:viewportWidth="24" >
-
-    <path
-        android:fillColor="#FF000000"
-        android:pathData="M19.429,12.975998c0.042-0.32 0.07-0.645 0.07-0.976s-0.029-0.655-0.07-0.976l2.113-1.654c0.188-0.151 0.243-0.422 0.118-0.639l-2.0-3.463c-0.125-0.217-0.386-0.304-0.612-0.218l-2.49,1.004c-0.516-0.396-1.081-0.731-1.69-0.984l-0.375-2.648C14.456,2.1829987 14.25,2.0 14.0,2.0l-4.0,0.0C9.75,2.0 9.544,2.1829987 9.506,2.422001L9.131,5.0699997C8.521,5.322998 7.957,5.6570015 7.44,6.054001L4.952,5.0509987C4.726,4.965 4.464,5.052002 4.34,5.269001l-2.0,3.463C2.2150002,8.947998 2.27,9.219002 2.4580002,9.369999l2.112,1.653C4.528,11.344002 4.5,11.668999 4.5,12.0s0.029,0.656 0.071,0.977L2.4580002,14.630001c-0.188,0.151-0.243,0.422-0.118,0.639l2.0,3.463c0.125,0.217 0.386,0.304 0.612,0.218l2.489-1.004c0.516,0.396 1.081,0.731 1.69,0.984l0.375,2.648C9.544,21.817001 9.75,22.0 10.0,22.0l4.0,0.0c0.25,0.0 0.456-0.183 0.494-0.422l0.375-2.648c0.609-0.253 1.174-0.588 1.689-0.984l2.49,1.004c0.226,0.086 0.487-0.001 0.612-0.218l2.0-3.463c0.125-0.217 0.07-0.487-0.118-0.639L19.429,12.975998zM12.0,16.0c-2.21,0.0-4.0-1.791-4.0-4.0c0.0-2.21 1.79-4.0 4.0-4.0c2.208,0.0 4.0,1.79 4.0,4.0C16.0,14.209 14.208,16.0 12.0,16.0z" />
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_stroke_1.xml b/tests/res/drawable/vector_icon_stroke_1.xml
deleted file mode 100644
index af351f1..0000000
--- a/tests/res/drawable/vector_icon_stroke_1.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:height="64dp"
-    android:viewportHeight="200"
-    android:viewportWidth="200"
-    android:width="64dp" >
-
-    <group>
-        <path
-            android:name="background1"
-            android:fillColor="#FF000000"
-            android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" />
-        <path
-            android:name="background2"
-            android:fillColor="#FF000000"
-            android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" />
-    </group>
-    <group
-        android:translateX="50"
-        android:translateY="50" >
-        <path
-            android:name="twoLines"
-            android:pathData="M 100,20 l 0 80 l -30 -80"
-            android:fillColor="#FF000000"
-            android:strokeColor="#FF00FF00"
-            android:strokeLineCap="butt"
-            android:strokeLineJoin="miter"
-            android:strokeMiterLimit="6"
-            android:strokeWidth="20" />
-    </group>
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_stroke_2.xml b/tests/res/drawable/vector_icon_stroke_2.xml
deleted file mode 100644
index f85d5fc..0000000
--- a/tests/res/drawable/vector_icon_stroke_2.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:height="64dp"
-    android:viewportHeight="200"
-    android:viewportWidth="200"
-    android:width="64dp" >
-
-    <group>
-        <path
-            android:name="background1"
-            android:fillColor="#FF000000"
-            android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" />
-        <path
-            android:name="background2"
-            android:fillColor="#FF000000"
-            android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" />
-    </group>
-    <group
-        android:translateX="50"
-        android:translateY="50" >
-        <path
-            android:name="twoLines"
-            android:pathData="M 100,20 l 0 80 l -30 -80"
-            android:fillColor="#FF000000"
-            android:strokeColor="#FF00FF00"
-            android:strokeLineCap="round"
-            android:strokeLineJoin="round"
-            android:strokeMiterLimit="10"
-            android:strokeWidth="20" />
-    </group>
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_stroke_3.xml b/tests/res/drawable/vector_icon_stroke_3.xml
deleted file mode 100644
index 8f3d47e..0000000
--- a/tests/res/drawable/vector_icon_stroke_3.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:height="64dp"
-    android:viewportHeight="200"
-    android:viewportWidth="200"
-    android:width="64dp" >
-
-    <group>
-        <path
-            android:name="background1"
-            android:fillColor="#FF000000"
-            android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" />
-        <path
-            android:name="background2"
-            android:fillColor="#FF000000"
-            android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" />
-    </group>
-    <group
-        android:translateX="50"
-        android:translateY="50" >
-        <path
-            android:name="twoLines"
-            android:pathData="M 100,20 l 0 80 l -30 -80"
-            android:fillColor="#FF000000"
-            android:strokeColor="#FF00FF00"
-            android:strokeLineCap="square"
-            android:strokeLineJoin="bevel"
-            android:strokeMiterLimit="10"
-            android:strokeWidth="20" />
-    </group>
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_transformation_1.xml b/tests/res/drawable/vector_icon_transformation_1.xml
deleted file mode 100644
index f6623d0..0000000
--- a/tests/res/drawable/vector_icon_transformation_1.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="500"
-        android:viewportWidth="800" >
-
-    <group
-        android:pivotX="90"
-        android:pivotY="100"
-        android:rotation="20">
-        <path
-            android:name="pie2"
-            android:pathData="M200,350 l 50,-25
-           a25,12 -30 0,1 100,-50 l 50,-25
-           a25,25 -30 0,1 100,-50 l 50,-25
-           a25,37 -30 0,1 100,-50 l 50,-25
-           a25,50 -30 0,1 100,-50 l 50,-25"
-           android:fillColor="#00000000"
-            android:strokeColor="#FF00FF00"
-            android:strokeWidth="10" />
-    </group>
-
-</vector>
diff --git a/tests/res/drawable/vector_icon_transformation_2.xml b/tests/res/drawable/vector_icon_transformation_2.xml
deleted file mode 100644
index 87da0bb..0000000
--- a/tests/res/drawable/vector_icon_transformation_2.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="200"
-        android:viewportWidth="200" >
-
-    <group>
-        <path
-            android:name="background1"
-            android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z"
-            android:fillColor="#FF000000"/>
-        <path
-            android:name="background2"
-            android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z"
-            android:fillColor="#FF000000"/>
-    </group>
-    <group
-        android:pivotX="100"
-        android:pivotY="100"
-        android:rotation="90"
-        android:scaleX="0.75"
-        android:scaleY="0.5"
-        android:translateX="0.0"
-        android:translateY="100.0">
-        <path
-            android:name="twoLines"
-            android:pathData="M 100,10 v 90 M 10,100 h 90"
-            android:fillColor="#00000000"
-            android:strokeColor="#FF00FF00"
-            android:strokeWidth="10" />
-    </group>
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_transformation_3.xml b/tests/res/drawable/vector_icon_transformation_3.xml
deleted file mode 100644
index fc30af3..0000000
--- a/tests/res/drawable/vector_icon_transformation_3.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="200"
-        android:viewportWidth="200" >
-
-    <group>
-        <path
-            android:name="background1"
-            android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z"
-            android:fillColor="#FF000000"/>
-        <path
-            android:name="background2"
-            android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z"
-            android:fillColor="#FF000000"/>
-    </group>
-    <group
-        android:pivotX="0"
-        android:pivotY="0"
-        android:rotation="90"
-        android:scaleX="0.75"
-        android:scaleY="0.5"
-        android:translateX="100.0"
-        android:translateY="100.0">
-        <path
-            android:name="twoLines"
-            android:pathData="M 100,10 v 90 M 10,100 h 90"
-            android:fillColor="#00000000"
-            android:strokeColor="#FF00FF00"
-            android:strokeWidth="10" />
-    </group>
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_transformation_4.xml b/tests/res/drawable/vector_icon_transformation_4.xml
deleted file mode 100644
index 5b40d0d..0000000
--- a/tests/res/drawable/vector_icon_transformation_4.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="400"
-        android:viewportWidth="400" >
-
-    <group android:name="backgroundGroup" >
-        <path
-            android:name="background1"
-            android:fillColor="#80000000"
-            android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" />
-        <path
-            android:name="background2"
-            android:fillColor="#80000000"
-            android:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" />
-    </group>
-    <group
-        android:name="translateToCenterGroup"
-        android:translateX="50.0"
-        android:translateY="90.0" >
-        <path
-            android:name="twoLines"
-            android:pathData="M 0,0 v 100 M 0,0 h 100"
-            android:strokeColor="#FFFF0000"
-            android:strokeWidth="20" />
-
-        <group
-            android:name="rotationGroup"
-            android:pivotX="0.0"
-            android:pivotY="0.0"
-            android:rotation="-45.0" >
-            <path
-                android:name="twoLines1"
-                android:pathData="M 0,0 v 100 M 0,0 h 100"
-                android:strokeColor="#FF00FF00"
-                android:strokeWidth="20" />
-
-            <group
-                android:name="translateGroup"
-                android:translateX="130.0"
-                android:translateY="160.0" >
-                <group android:name="scaleGroup" >
-                    <path
-                        android:name="twoLines2"
-                        android:pathData="M 0,0 v 100 M 0,0 h 100"
-                        android:strokeColor="#FF0000FF"
-                        android:strokeWidth="20" />
-                </group>
-            </group>
-        </group>
-    </group>
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_transformation_5.xml b/tests/res/drawable/vector_icon_transformation_5.xml
deleted file mode 100644
index 4a27754..0000000
--- a/tests/res/drawable/vector_icon_transformation_5.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="400"
-        android:viewportWidth="400" >
-
-    <group android:name="backgroundGroup" >
-        <path
-            android:name="background1"
-            android:fillColor="#80000000"
-            android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" />
-        <path
-            android:name="background2"
-            android:fillColor="#80000000"
-            android:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" />
-    </group>
-    <group
-        android:name="translateToCenterGroup"
-        android:translateX="50.0"
-        android:translateY="90.0" >
-        <path
-            android:name="twoLines"
-            android:pathData="M 0,0 v 150 M 0,0 h 150"
-            android:strokeColor="#FFFF0000"
-            android:strokeWidth="20" />
-
-        <group
-            android:name="rotationGroup"
-            android:pivotX="0.0"
-            android:pivotY="0.0"
-            android:rotation="-45.0" >
-            <path
-                android:name="twoLines1"
-                android:pathData="M 0,0 v 100 M 0,0 h 100"
-                android:strokeColor="#FF00FF00"
-                android:strokeWidth="20" />
-
-            <group
-                android:name="translateGroup"
-                android:translateX="130.0"
-                android:translateY="160.0" >
-                <group android:name="scaleGroup" >
-                    <path
-                        android:name="twoLines3"
-                        android:pathData="M 0,0 v 100 M 0,0 h 100"
-                        android:strokeColor="#FF0000FF"
-                        android:strokeWidth="20" />
-                </group>
-            </group>
-
-            <group
-                android:name="translateGroupHalf"
-                android:translateX="65.0"
-                android:translateY="80.0" >
-                <group android:name="scaleGroup" >
-                    <path
-                        android:name="twoLines2"
-                        android:pathData="M 0,0 v 100 M 0,0 h 100"
-                        android:strokeColor="#FF0000FF"
-                        android:strokeWidth="20" />
-                </group>
-            </group>
-        </group>
-    </group>
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/vector_icon_transformation_6.xml b/tests/res/drawable/vector_icon_transformation_6.xml
deleted file mode 100644
index 5e60c4a..0000000
--- a/tests/res/drawable/vector_icon_transformation_6.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<!--
- 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:height="64dp"
-        android:width="64dp"
-        android:viewportHeight="400"
-        android:viewportWidth="400" >
-
-    <group android:name="backgroundGroup"
-        android:alpha = "0.5" >
-        <path
-            android:name="background1"
-            android:fillColor="#FF000000"
-            android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" />
-        <path
-            android:name="background2"
-            android:fillColor="#FF000000"
-            android:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" />
-    </group>
-    <group
-        android:name="translateToCenterGroup"
-        android:translateX="50.0"
-        android:translateY="90.0"
-        android:alpha = "0.5" >
-        <path
-            android:name="twoLines"
-            android:pathData="M 0,0 v 100 M 0,0 h 100"
-            android:strokeColor="#FFFF0000"
-            android:strokeWidth="20" />
-
-        <group
-            android:name="rotationGroup"
-            android:pivotX="0.0"
-            android:pivotY="0.0"
-            android:rotation="-45.0"
-            android:alpha = "0.5" >
-            <path
-                android:name="twoLines1"
-                android:pathData="M 0,0 v 100 M 0,0 h 100"
-                android:strokeColor="#FF00FF00"
-                android:strokeWidth="20" />
-
-            <group
-                android:name="translateGroup"
-                android:translateX="130.0"
-                android:translateY="160.0"
-                android:alpha = "0.5">
-                <group android:name="scaleGroup" >
-                    <path
-                        android:name="twoLines3"
-                        android:pathData="M 0,0 v 100 M 0,0 h 100"
-                        android:strokeColor="#FF0000FF"
-                        android:strokeWidth="20" />
-                </group>
-            </group>
-
-            <group
-                android:name="translateGroupHalf"
-                android:translateX="65.0"
-                android:translateY="80.0"
-                android:alpha = "0.5">
-                <group android:name="scaleGroup" >
-                    <path
-                        android:name="twoLines2"
-                        android:pathData="M 0,0 v 100 M 0,0 h 100"
-                        android:strokeColor="#FF0000FF"
-                        android:strokeWidth="20" />
-                </group>
-            </group>
-        </group>
-    </group>
-
-</vector>
\ No newline at end of file
diff --git a/tests/res/drawable/webp_test.webp b/tests/res/drawable/webp_test.webp
deleted file mode 100644
index 7b1009f..0000000
--- a/tests/res/drawable/webp_test.webp
+++ /dev/null
Binary files differ
diff --git a/tests/res/drawable/window_test_drawable.xml b/tests/res/drawable/window_test_drawable.xml
deleted file mode 100644
index 4281cd8..0000000
--- a/tests/res/drawable/window_test_drawable.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <solid android:color="#00000000"/>
-    <stroke android:width="2dp" android:color="#ff000000"/>
-    <padding android:left="1dp" android:top="1dp"
-            android:right="1dp" android:bottom="1dp" />
-</shape>
diff --git a/tests/res/layout-land/mediaplayer.xml b/tests/res/layout-land/mediaplayer.xml
deleted file mode 100644
index 5dafdb9..0000000
--- a/tests/res/layout-land/mediaplayer.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="horizontal"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <SurfaceView android:id="@+id/surface"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_weight="1">
-    </SurfaceView>
-
-    <SurfaceView android:id="@+id/surface2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_weight="1">
-    </SurfaceView>
-
-    <SurfaceView android:id="@+id/surface3"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_weight="1">
-    </SurfaceView>
-
-</LinearLayout>
diff --git a/tests/res/layout/abslistview_layout.xml b/tests/res/layout/abslistview_layout.xml
deleted file mode 100644
index a090ce3..0000000
--- a/tests/res/layout/abslistview_layout.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<ViewGroup_Layout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/abslistview_root"
-    android:layout_width="25px"
-    android:layout_height="25px" >
-
-   <GridView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" />
-
-   <ListView>
-        <TextView
-            android:text="@string/table_layout_first"
-            android:padding="3dip" />
-        <TextView
-            android:text="@string/table_layout_second"
-            android:padding="3dip" />
-        <TextView
-            android:text="@string/table_layout_third"
-            android:padding="3dip" />
-    </ListView>
-</ViewGroup_Layout>
-
diff --git a/tests/res/layout/absolute_layout.xml b/tests/res/layout/absolute_layout.xml
deleted file mode 100644
index 6cec61b..0000000
--- a/tests/res/layout/absolute_layout.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <AbsoluteLayout
-        android:id="@+id/absolute_view"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_x="1dip"
-        android:layout_y="2dip">
-
-        <TextView
-            android:id="@+id/absolute_textview"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_x="10dip"
-            android:layout_y="20dip"
-            android:background="@drawable/red"
-            android:text="@string/hello_world"/>
-
-    </AbsoluteLayout>
-
-</LinearLayout>
diff --git a/tests/res/layout/adapterview_layout.xml b/tests/res/layout/adapterview_layout.xml
deleted file mode 100644
index e118500..0000000
--- a/tests/res/layout/adapterview_layout.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/adapterview_tv"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" />
-
diff --git a/tests/res/layout/alert_dialog_text_entry.xml b/tests/res/layout/alert_dialog_text_entry.xml
deleted file mode 100644
index 8b87a5d..0000000
--- a/tests/res/layout/alert_dialog_text_entry.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:orientation="vertical">
-
-    <TextView
-        android:id="@+id/username_view"
-        android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
-        android:layout_marginLeft="20dip"
-        android:layout_marginRight="20dip"
-        android:text="@string/alert_dialog_username"
-        android:gravity="left"
-        android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    <EditText
-        android:id="@+id/username_edit"
-        android:layout_height="wrap_content"
-        android:layout_width="match_parent"
-        android:layout_marginLeft="20dip"
-        android:layout_marginRight="20dip"
-        android:scrollHorizontally="true"
-        android:autoText="false"
-        android:capitalize="none"
-        android:gravity="fill_horizontal"
-        android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    <TextView
-        android:id="@+id/password_view"
-        android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
-        android:layout_marginLeft="20dip"
-        android:layout_marginRight="20dip"
-        android:text="@string/alert_dialog_password"
-        android:gravity="left"
-        android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    <EditText
-        android:id="@+id/password_edit"
-        android:layout_height="wrap_content"
-        android:layout_width="match_parent"
-        android:layout_marginLeft="20dip"
-        android:layout_marginRight="20dip"
-        android:scrollHorizontally="true"
-        android:autoText="false"
-        android:capitalize="none"
-        android:gravity="fill_horizontal"
-        android:password="true"
-        android:textAppearance="?android:attr/textAppearanceMedium" />
-
-</LinearLayout>
diff --git a/tests/res/layout/alert_dialog_text_entry_2.xml b/tests/res/layout/alert_dialog_text_entry_2.xml
deleted file mode 100644
index 848b342..0000000
--- a/tests/res/layout/alert_dialog_text_entry_2.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:orientation="vertical">
-
-    <TextView
-        android:id="@+id/username_view"
-        android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
-        android:layout_marginLeft="20dip"
-        android:layout_marginRight="20dip"
-        android:text="@string/alert_dialog_username"
-        android:gravity="left" />
-
-    <EditText
-        android:id="@+id/username_edit"
-        android:layout_height="wrap_content"
-        android:layout_width="match_parent"
-        android:layout_marginLeft="20dip"
-        android:layout_marginRight="20dip"
-        android:scrollHorizontally="true"
-        android:autoText="false"
-        android:capitalize="none"
-        android:gravity="fill_horizontal" />
-
-</LinearLayout>
diff --git a/tests/res/layout/alertdialog_custom_title.xml b/tests/res/layout/alertdialog_custom_title.xml
deleted file mode 100644
index ff36f2a..0000000
--- a/tests/res/layout/alertdialog_custom_title.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/alertdialog_custom_title"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:gravity="center_vertical|center_horizontal"
-    android:textAppearance="?android:attr/textAppearanceMedium"
-    android:text="@string/hello_world"/>
diff --git a/tests/res/layout/alertdialog_custom_title2.xml b/tests/res/layout/alertdialog_custom_title2.xml
deleted file mode 100644
index 51c154d..0000000
--- a/tests/res/layout/alertdialog_custom_title2.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TextView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/alertdialog_custom_title"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:gravity="center_vertical|center_horizontal"
-    android:text="@string/hello_android"/>
diff --git a/tests/res/layout/analogclock.xml b/tests/res/layout/analogclock.xml
deleted file mode 100644
index 7d862c3..0000000
--- a/tests/res/layout/analogclock.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<AnalogClock android:id="@+id/clock"
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="96dip"
-    android:layout_gravity="center_horizontal"
-    android:layout_height="wrap_content"/>
diff --git a/tests/res/layout/anim_layout.xml b/tests/res/layout/anim_layout.xml
deleted file mode 100644
index b6aa906..0000000
--- a/tests/res/layout/anim_layout.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:id="@+id/anim_window_parent">
-
-    <TextView android:id="@+id/anim_window"
-        android:layout_width="100dip"
-        android:layout_height="20dip"
-        android:text="@string/text_view_hello"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/animation_layout.xml b/tests/res/layout/animation_layout.xml
deleted file mode 100644
index 13228d1..0000000
--- a/tests/res/layout/animation_layout.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:id="@+id/layout"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <ImageButton android:id="@+id/scenery"
-        android:src="@drawable/scenery"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_centerHorizontal="true"/>
-
-    <ImageButton android:id="@+id/start"
-        android:src="@drawable/start"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_centerHorizontal="true"
-        android:layout_below="@id/scenery"/>
-
-    <TextView android:id="@+id/explain"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textSize="18sp"
-        android:autoText="true"
-        android:capitalize="sentences"
-        android:text="@string/explain"
-        android:layout_centerHorizontal="true"
-        android:layout_below="@id/start"/>
-
-    <LinearLayout android:id="@+id/button_layout"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal"
-        android:layout_centerHorizontal="true"
-        android:layout_alignParentBottom="true">
-
-        <ImageButton android:id="@+id/pass"
-            android:src="@drawable/pass"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginRight="20px"/>
-
-        <ImageButton android:id="@+id/failed"
-            android:src="@drawable/failed"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="40px"/>
-
-    </LinearLayout>
-
-</RelativeLayout>
diff --git a/tests/res/layout/app_activity.xml b/tests/res/layout/app_activity.xml
deleted file mode 100644
index 8b7206f..0000000
--- a/tests/res/layout/app_activity.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<!-- Demonstrates receiving activity results.
-     See corresponding Java code com.android.sdk.app.ReceiveResult.java. -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="4dip"
-    android:gravity="center_horizontal"
-    android:layout_width="match_parent" android:layout_height="match_parent">
-
-    <TextView
-        android:layout_width="match_parent" android:layout_height="wrap_content"
-        android:layout_weight="0"
-        android:paddingBottom="4dip"
-        android:text="@string/forwarding"/>
-
-    <Button android:id="@+id/go"
-        android:layout_width="wrap_content" android:layout_height="wrap_content"
-        android:text="@string/go">
-        <requestFocus />
-    </Button>
-
-</LinearLayout>
-
diff --git a/tests/res/layout/app_another.xml b/tests/res/layout/app_another.xml
deleted file mode 100644
index f4574a2..0000000
--- a/tests/res/layout/app_another.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<!-- Demonstrates receiving activity results.
-     See corresponding Java code com.android.sdk.app.ReceiveResult.java. -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="4dip"
-    android:gravity="center_horizontal"
-    android:layout_width="match_parent" android:layout_height="match_parent">
-
-    <TextView
-        android:layout_width="match_parent" android:layout_height="wrap_content"
-        android:layout_weight="0"
-        android:paddingBottom="4dip"
-        android:text="@string/forwarding"/>
-
-    <Button android:id="@+id/back"
-        android:layout_width="wrap_content" android:layout_height="wrap_content"
-        android:text="@string/back">
-        <requestFocus />
-    </Button>
-
-</LinearLayout>
-
diff --git a/tests/res/layout/autocompletetextview_layout.xml b/tests/res/layout/autocompletetextview_layout.xml
deleted file mode 100644
index c2404d5..0000000
--- a/tests/res/layout/autocompletetextview_layout.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/autocompletetv_title"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/notify" />
-
-    <AutoCompleteTextView android:id="@+id/autocompletetv_edit"
-        android:completionThreshold="1"
-        android:completionHint="@string/tabs_1"
-        android:layout_width="match_parent" 
-        android:layout_height="wrap_content"
-        android:inputType="none"/>
-</LinearLayout>
diff --git a/tests/res/layout/available_intents_layout.xml b/tests/res/layout/available_intents_layout.xml
deleted file mode 100644
index 5415657..0000000
--- a/tests/res/layout/available_intents_layout.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="vertical">
-
-    <TextView android:id="@+id/text"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:paddingLeft="4dip"
-        android:focusable="true"
-        android:focusableInTouchMode="true"
-        android:text="@string/text_view_hello"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/checkbox_layout.xml b/tests/res/layout/checkbox_layout.xml
deleted file mode 100644
index a1f1718..0000000
--- a/tests/res/layout/checkbox_layout.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="vertical">
-
-    <CheckBox android:id="@+id/check_box"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/hello_world" />
-
-</LinearLayout>
diff --git a/tests/res/layout/checkedtextview_layout.xml b/tests/res/layout/checkedtextview_layout.xml
deleted file mode 100644
index d5b9c1f..0000000
--- a/tests/res/layout/checkedtextview_layout.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent">
-
-    <ListView android:id="@+id/checkedtextview_listview"
-        android:orientation="vertical"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-    </ListView>
-
-    <CheckedTextView android:id="@+id/checkedtextview_test"
-        android:orientation="vertical"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-    </CheckedTextView>
-
-</LinearLayout>
diff --git a/tests/res/layout/chronometer_stub_layout.xml b/tests/res/layout/chronometer_stub_layout.xml
deleted file mode 100644
index 487f2f8..0000000
--- a/tests/res/layout/chronometer_stub_layout.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/screen"
-    android:layout_width="match_parent" android:layout_height="match_parent"
-    android:orientation="vertical">
-    <LinearLayout
-        android:id="@+id/chronometer_view_group"
-        android:layout_width="match_parent" android:layout_height="match_parent"
-        android:orientation="vertical">
-        <Chronometer
-            android:id="@+id/test_chronometer"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/chronometer_text"
-            />
-    </LinearLayout>
-</ScrollView>
-
diff --git a/tests/res/layout/context_layout.xml b/tests/res/layout/context_layout.xml
deleted file mode 100644
index 6ec6c76..0000000
--- a/tests/res/layout/context_layout.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<RelativeLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-    <DatePicker
-        android:id="@+id/contextdatepicker_dp"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_centerInParent="true" />
-
-</RelativeLayout>
diff --git a/tests/res/layout/cursoradapter_group0.xml b/tests/res/layout/cursoradapter_group0.xml
deleted file mode 100644
index f640686..0000000
--- a/tests/res/layout/cursoradapter_group0.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:id="@+id/cursorAdapter_group0">
-</ImageView>
diff --git a/tests/res/layout/cursoradapter_group1.xml b/tests/res/layout/cursoradapter_group1.xml
deleted file mode 100644
index d1dfa3c..0000000
--- a/tests/res/layout/cursoradapter_group1.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:id="@+id/cursorAdapter_group1">
-</ImageView>
diff --git a/tests/res/layout/cursoradapter_host.xml b/tests/res/layout/cursoradapter_host.xml
deleted file mode 100644
index 82ac72b..0000000
--- a/tests/res/layout/cursoradapter_host.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:id="@+id/cursorAdapter_host">
-</LinearLayout>
diff --git a/tests/res/layout/cursoradapter_item0.xml b/tests/res/layout/cursoradapter_item0.xml
deleted file mode 100644
index 5ecd496..0000000
--- a/tests/res/layout/cursoradapter_item0.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:id="@+id/cursorAdapter_item0">
-</TextView>
diff --git a/tests/res/layout/cursoradapter_item1.xml b/tests/res/layout/cursoradapter_item1.xml
deleted file mode 100644
index 44037b0..0000000
--- a/tests/res/layout/cursoradapter_item1.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:id="@+id/cursorAdapter_item1">
-</TextView>
diff --git a/tests/res/layout/datepicker.xml b/tests/res/layout/datepicker.xml
deleted file mode 100644
index 6a7b51c..0000000
--- a/tests/res/layout/datepicker.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-    <DatePicker android:id="@+id/datePicker1"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:spinnersShown="false"
-                xmlns:android="http://schemas.android.com/apk/res/android">
-    </DatePicker>
diff --git a/tests/res/layout/datepicker_layout.xml b/tests/res/layout/datepicker_layout.xml
deleted file mode 100644
index 925674c..0000000
--- a/tests/res/layout/datepicker_layout.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<RelativeLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-    <DatePicker
-        android:id="@+id/datePicker_dp"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_centerInParent="true" />
-
-</RelativeLayout>
diff --git a/tests/res/layout/dialerfilter_layout.xml b/tests/res/layout/dialerfilter_layout.xml
deleted file mode 100644
index 46edbd7..0000000
--- a/tests/res/layout/dialerfilter_layout.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<DialerFilter android:id="@+id/dialer_filter"
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <EditText android:id="@android:id/hint"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="@android:drawable/editbox_background"/>
-
-    <EditText android:id="@android:id/primary"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@android:id/hint"/>
-
-</DialerFilter>
diff --git a/tests/res/layout/dialog_stub_layout.xml b/tests/res/layout/dialog_stub_layout.xml
deleted file mode 100644
index b0a8861..0000000
--- a/tests/res/layout/dialog_stub_layout.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
-        android:layout_width="match_parent" 
-        android:layout_height="match_parent"
-        >
-</LinearLayout>
diff --git a/tests/res/layout/digitalclock_layout.xml b/tests/res/layout/digitalclock_layout.xml
deleted file mode 100644
index cbdb84d..0000000
--- a/tests/res/layout/digitalclock_layout.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<com.android.cts.stub.alarmclock.DigitalClock android:id="@+id/digitalClock"
-     xmlns:android="http://schemas.android.com/apk/res/android"
-     android:layout_width="wrap_content"
-     android:layout_height="208dip"
-     android:gravity="center">
-     <!-- Includes vertical padding so animated background doesn't
-          stretch much -->
-     <TextView android:id="@+id/timeDisplay"
-         android:layout_width="wrap_content"
-         android:layout_height="wrap_content"
-         android:textSize="64sp"
-         android:paddingRight="4dip"
-         android:paddingTop="48dip"
-         android:paddingBottom="48dip"/>
-     <LinearLayout android:id="@+id/am_pm"
-         android:layout_width="wrap_content"
-         android:layout_height="wrap_content"
-         android:orientation="vertical">
-         <TextView android:id="@+id/am"
-             android:layout_width="wrap_content"
-             android:layout_height="wrap_content"
-             android:layout_marginTop="-7dp"
-             android:text="@string/am"
-             android:textSize="28sp"/>
-         <TextView android:id="@+id/pm"
-             android:layout_width="wrap_content"
-             android:layout_height="wrap_content"
-             android:layout_marginTop="-4dp"
-             android:text="@string/pm"
-             android:textSize="28sp"/>
-     </LinearLayout>
-</com.android.cts.stub.alarmclock.DigitalClock>
diff --git a/tests/res/layout/digitalclock_simplelayout.xml b/tests/res/layout/digitalclock_simplelayout.xml
deleted file mode 100644
index 16f7b45..0000000
--- a/tests/res/layout/digitalclock_simplelayout.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/digitalclock_root"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-</LinearLayout>
diff --git a/tests/res/layout/edittext_layout.xml b/tests/res/layout/edittext_layout.xml
deleted file mode 100644
index 398d3be..0000000
--- a/tests/res/layout/edittext_layout.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
-    <LinearLayout android:id="@+id/edit_text"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-        <EditText android:id="@+id/edittext1"
-            style="@android:style/Widget.EditText"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_marginTop="10dip"
-            android:scrollHorizontally="true"
-            android:capitalize="sentences"
-            android:autoText="false"
-            android:maxLines="3"
-            android:textColor="#FF0000"
-            android:text="@string/edit_text"
-        />
-    </LinearLayout>
-</ScrollView>
diff --git a/tests/res/layout/expandablelistview_layout.xml b/tests/res/layout/expandablelistview_layout.xml
deleted file mode 100644
index 3a3ebb7..0000000
--- a/tests/res/layout/expandablelistview_layout.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<ExpandableListView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/expandablelistview_test"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:drawSelectorOnTop="false" />
-
diff --git a/tests/res/layout/focus_finder_layout.xml b/tests/res/layout/focus_finder_layout.xml
deleted file mode 100644
index 0502fd8..0000000
--- a/tests/res/layout/focus_finder_layout.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-    <TableLayout android:id="@+id/layout"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerInParent="true">
-        <TableRow>
-            <android.view.cts.TestButton android:id="@+id/top_left_button"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:text="TL" />
-            <android.view.cts.TestButton android:id="@+id/top_right_button"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:text="TR" />
-        </TableRow>
-        <TableRow>
-            <android.view.cts.TestButton android:id="@+id/bottom_left_button"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:text="BL" />
-            <android.view.cts.TestButton android:id="@+id/bottom_right_button"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:text="BR" />
-        </TableRow>  
-    </TableLayout>
-</RelativeLayout>
-
diff --git a/tests/res/layout/focus_handling_layout.xml b/tests/res/layout/focus_handling_layout.xml
deleted file mode 100644
index 84c8e6a..0000000
--- a/tests/res/layout/focus_handling_layout.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <View
-        android:id="@+id/view1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/id_ok"/>
-
-    <View
-        android:id="@+id/view2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_toRightOf="@id/view1"
-        android:layout_alignTop="@id/view1"
-        android:nextFocusLeft="@id/view1"
-        android:text="@string/id_ok"/>
-
-    <View
-        android:id="@+id/view3"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/view1"
-        android:layout_alignLeft="@id/view1"
-        android:nextFocusUp="@id/view1"
-        android:text="@string/id_ok"/>
-
-    <View
-        android:id="@+id/view4"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_toRightOf="@id/view3"
-        android:layout_alignTop="@id/view3"
-        android:layout_alignRight="@id/view2"
-        android:nextFocusUp="@id/view2"
-        android:nextFocusLeft="@id/view3"
-        android:text="@string/id_ok"/>
-</RelativeLayout>
-
diff --git a/tests/res/layout/framelayout_layout.xml b/tests/res/layout/framelayout_layout.xml
deleted file mode 100644
index 78b7b47..0000000
--- a/tests/res/layout/framelayout_layout.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:id="@+id/framelayout_container"
-                android:background="@drawable/red"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_gravity="bottom"
-                android:orientation="vertical">
-
-    <FrameLayout
-        android:layout_width="100dip"
-        android:layout_height="100dip"
-        android:background="@drawable/yellow"
-        android:id="@+id/framelayout">
-    </FrameLayout>
-
-    <FrameLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:background="@drawable/yellow"
-        android:id="@+id/framelayout_measureall">
-
-        <TextView android:id="@+id/framelayout_textview"
-            android:background="@drawable/blue"
-            android:layout_width="60dip"
-            android:layout_height="30dip"
-            android:text="@string/hello_world"/>
-
-        <Button android:id="@+id/framelayout_button"
-            android:layout_width="50dip"
-            android:layout_height="15dip"
-            android:text="@string/go"/>
-
-    </FrameLayout>
-
-    <FrameLayout
-        android:id="@+id/foreground_tint"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:foregroundTint="@android:color/white"
-        android:foregroundTintMode="src_over" />
-
-</LinearLayout>
diff --git a/tests/res/layout/gallery_test.xml b/tests/res/layout/gallery_test.xml
deleted file mode 100644
index 03f0e60..0000000
--- a/tests/res/layout/gallery_test.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <android.widget.cts.MyGallery xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/gallery_test"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-    </android.widget.cts.MyGallery>
-
-</LinearLayout>
diff --git a/tests/res/layout/gridlayout_anim_controller_layout.xml b/tests/res/layout/gridlayout_anim_controller_layout.xml
deleted file mode 100644
index 0ff2d46..0000000
--- a/tests/res/layout/gridlayout_anim_controller_layout.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<GridView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/gridlayout_anim_gridview"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:padding="10dp"
-    android:verticalSpacing="20dp"
-    android:horizontalSpacing="20dp"
-    android:numColumns="3"
-    android:columnWidth="60dp"
-    android:stretchMode="columnWidth"
-    android:gravity="center"
-/>
diff --git a/tests/res/layout/gridlayout_layout.xml b/tests/res/layout/gridlayout_layout.xml
deleted file mode 100644
index 54b3b2c..0000000
--- a/tests/res/layout/gridlayout_layout.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2012 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.
- -->
-<GridLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:orientation="vertical"
-    >
-</GridLayout>
diff --git a/tests/res/layout/gridview_layout.xml b/tests/res/layout/gridview_layout.xml
deleted file mode 100644
index c7774a3..0000000
--- a/tests/res/layout/gridview_layout.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<GridView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/gridview"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-/>
-
diff --git a/tests/res/layout/home_activity.xml b/tests/res/layout/home_activity.xml
deleted file mode 100644
index 49174da..0000000
--- a/tests/res/layout/home_activity.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:orientation="vertical"
-              android:layout_width="match_parent"
-              android:layout_height="match_parent">
-      <Button android:text="@string/holo_test"
-              android:id="@+id/button_holo"
-              android:onClick="onHoloTestClick"
-              android:layout_width="wrap_content"
-              android:layout_height="wrap_content">
-      </Button>
-      <Button android:text="@string/holo_generator"
-              android:id="@+id/button2"
-              android:onClick="onHoloGenClick"
-              android:layout_width="wrap_content"
-              android:layout_height="wrap_content">
-      </Button>
-      <Button android:text="@string/holo_light_test"
-              android:id="@+id/button3"
-              android:onClick="onHoloLightTestClick"
-              android:layout_width="wrap_content"
-              android:layout_height="wrap_content">
-      </Button>
-      <Button android:text="@string/holo_light_generator"
-              android:id="@+id/button4"
-              android:onClick="onHoloLightGenClick"
-              android:layout_width="wrap_content"
-              android:layout_height="wrap_content">
-      </Button>
-</LinearLayout>
diff --git a/tests/res/layout/horizontal_scrollview.xml b/tests/res/layout/horizontal_scrollview.xml
deleted file mode 100644
index 0f88ab3..0000000
--- a/tests/res/layout/horizontal_scrollview.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<android.widget.cts.MyHorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/horizontal_scroll_view"
-    android:layout_width="100px"
-    android:layout_height="100px">
-
-    <LinearLayout
-        android:orientation="horizontal"
-        android:layout_width="250px"
-        android:layout_height="wrap_content">
-
-        <Button
-            android:id="@+id/first_horizontal_child"
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_1"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_2"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_3"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_1"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_2"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_3"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_1"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_2"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_3"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_1"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_2"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_3"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_1"/>
-
-        <Button
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_2"/>
-
-        <Button
-            android:id="@+id/last_horizontal_child"
-            android:layout_width="250px"
-            android:layout_height="100px"
-            android:text="@string/vertical_text_3"/>
-    </LinearLayout>
-
-</android.widget.cts.MyHorizontalScrollView>
diff --git a/tests/res/layout/imagebutton_test.xml b/tests/res/layout/imagebutton_test.xml
deleted file mode 100644
index 7d4b691..0000000
--- a/tests/res/layout/imagebutton_test.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/imagebutton"
-    android:layout_width="96px"
-    android:layout_height="76px"
-    android:soundEffectsEnabled="false"
-/>
-
diff --git a/tests/res/layout/imageswitcher_test.xml b/tests/res/layout/imageswitcher_test.xml
deleted file mode 100644
index 496b2ba..0000000
--- a/tests/res/layout/imageswitcher_test.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
- -->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <ImageSwitcher android:id="@+id/switcher"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_alignParentTop="true"
-        android:layout_alignParentLeft="true"
-    />
-</RelativeLayout>
-
diff --git a/tests/res/layout/imageview_layout.xml b/tests/res/layout/imageview_layout.xml
deleted file mode 100644
index e56a9c9..0000000
--- a/tests/res/layout/imageview_layout.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <ImageView
-        android:id="@+id/imageview"
-        android:layout_width="320px"
-        android:layout_height="240px"/>
-
-    <ImageView
-        android:id="@+id/image_tint"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:tint="@android:color/white"
-        android:tintMode="src_over" />
-
-</LinearLayout>
-
diff --git a/tests/res/layout/inflater_layout.xml b/tests/res/layout/inflater_layout.xml
deleted file mode 100644
index cff224e..0000000
--- a/tests/res/layout/inflater_layout.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/numeric_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:editable="true"/>
-
-    <TextView android:id="@+id/numeric_integer"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="integer"/>
-
-    <TextView android:id="@+id/numeric_signed"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="signed"/>
-
-    <TextView android:id="@+id/numeric_decimal"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="decimal"/>
-
-    <TextView android:id="@+id/numeric_signed_integer"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="signed|integer"/>
-
-    <TextView android:id="@+id/numeric_integer_decimal"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="integer|decimal"/>
-
-    <TextView android:id="@+id/numeric_signed_decimal"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="signed|decimal"/>
-
-    <TextView android:id="@+id/numeric_signed_decimal_integer"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="signed|integer|decimal"/>
-
-     <android.view.cts.MockViewStub class="android.view.cts.MockViewStub"
-        android:id="@+id/autotext_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/inflater_layout_tags.xml b/tests/res/layout/inflater_layout_tags.xml
deleted file mode 100644
index dc3eb29..0000000
--- a/tests/res/layout/inflater_layout_tags.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/viewlayout_root"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <tag
-        android:id="@+id/tag_viewlayout_root"
-        android:value="@string/tag1" />
-
-    <View
-        android:id="@+id/mock_view"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" >
-
-        <tag
-            android:id="@+id/tag_mock_view"
-            android:value="@string/tag2" />
-    </View>
-
-</LinearLayout>
\ No newline at end of file
diff --git a/tests/res/layout/inflater_override_theme_layout.xml b/tests/res/layout/inflater_override_theme_layout.xml
deleted file mode 100644
index 2d2a578..0000000
--- a/tests/res/layout/inflater_override_theme_layout.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2013 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:orientation="vertical"
-    android:theme="@style/Theme_OverrideOuter" >
-
-    <View
-        android:id="@+id/view_outer"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" />
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical"
-        android:theme="@style/Theme_OverrideInner" >
-
-        <View
-            android:id="@+id/view_inner"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
-        <View
-            android:id="@+id/view_attr"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:theme="?attr/themeOverrideAttr" />
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/tests/res/layout/inputmethod_edittext.xml b/tests/res/layout/inputmethod_edittext.xml
deleted file mode 100755
index 849b411..0000000
--- a/tests/res/layout/inputmethod_edittext.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                  android:layout_width="fill_parent"
-                  android:layout_height="wrap_content"
-                  android:background="@drawable/blue"
-                android:padding="10px">
-
-    <EditText android:id="@+id/entry"
-              android:layout_width="fill_parent"
-              android:layout_height="wrap_content"
-              android:background="@android:drawable/editbox_background"/>
-
-</RelativeLayout>
diff --git a/tests/res/layout/keylistener_layout.xml b/tests/res/layout/keylistener_layout.xml
deleted file mode 100644
index 96a419d..0000000
--- a/tests/res/layout/keylistener_layout.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/keylistener_textview"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-/>
-
diff --git a/tests/res/layout/layoutdirection_layout.xml b/tests/res/layout/layoutdirection_layout.xml
deleted file mode 100644
index e506dc1..0000000
--- a/tests/res/layout/layoutdirection_layout.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2012 The Android Open Source Project.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:layout_width="match_parent"
-              android:layout_height="wrap_content"
-              android:orientation="vertical">
-
-    <LinearLayout android:id="@+id/layout_linearlayout_ltr"
-                  android:layout_width="wrap_content"
-                  android:layout_height="wrap_content"
-                  android:layoutDirection="ltr">
-
-        <LinearLayout android:id="@+id/layout_linearlayout_ltr_child_1"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="ltr" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_ltr_child_2"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="rtl" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_ltr_child_3"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="inherit" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_ltr_child_4"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="locale" />
-
-    </LinearLayout>
-
-    <LinearLayout android:id="@+id/layout_linearlayout_rtl"
-                  android:layout_width="wrap_content"
-                  android:layout_height="wrap_content"
-                  android:layoutDirection="rtl">
-
-        <LinearLayout android:id="@+id/layout_linearlayout_rtl_child_1"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="ltr" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_rtl_child_2"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="rtl" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_rtl_child_3"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="inherit" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_rtl_child_4"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="locale" />
-
-    </LinearLayout>
-
-    <LinearLayout android:id="@+id/layout_linearlayout_locale"
-                  android:layout_width="wrap_content"
-                  android:layout_height="wrap_content"
-                  android:layoutDirection="locale">
-
-        <LinearLayout android:id="@+id/layout_linearlayout_locale_child_1"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="ltr" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_locale_child_2"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="rtl" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_locale_child_3"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="inherit" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_locale_child_4"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="locale" />
-
-    </LinearLayout>
-
-    <LinearLayout android:id="@+id/layout_linearlayout_inherit"
-                  android:layout_width="wrap_content"
-                  android:layout_height="wrap_content"
-                  android:layoutDirection="inherit">
-
-        <LinearLayout android:id="@+id/layout_linearlayout_inherit_child_1"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="ltr" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_inherit_child_2"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="rtl" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_inherit_child_3"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="inherit" />
-
-        <LinearLayout android:id="@+id/layout_linearlayout_inherit_child_4"
-                      android:layout_width="wrap_content"
-                      android:layout_height="wrap_content"
-                      android:layoutDirection="locale" />
-
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/tests/res/layout/linearlayout_layout.xml b/tests/res/layout/linearlayout_layout.xml
deleted file mode 100644
index c70937d..0000000
--- a/tests/res/layout/linearlayout_layout.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="vertical">
-
-    <LinearLayout android:id="@+id/horizontal"
-        android:orientation="horizontal"
-        android:layout_width="wrap_content"
-        android:layout_height="100dip"
-        android:background="#FF909090">
-
-        <TextView android:id="@+id/gravity_top"
-            android:background="#FF00FF00"
-            android:layout_width="wrap_content"
-            android:layout_height="50dip"
-            android:layout_gravity="top"
-            android:text="@string/horizontal_text_1"/>
-
-        <TextView android:id="@+id/gravity_center_vertical"
-            android:background="#FF00FF00"
-            android:layout_width="wrap_content"
-            android:layout_height="50dip"
-            android:layout_gravity="center_vertical"
-            android:text="@string/horizontal_text_2"/>
-
-        <TextView android:id="@+id/gravity_bottom"
-            android:background="#FF00FF00"
-            android:layout_width="wrap_content"
-            android:layout_height="50dip"
-            android:layout_gravity="bottom"
-            android:text="@string/horizontal_text_3"/>
-    </LinearLayout>
-
-    <LinearLayout android:id="@+id/vertical"
-        android:orientation="vertical"
-        android:layout_width="100dip"
-        android:layout_height="wrap_content"
-        android:background="#FFFF0909">
-
-        <TextView android:id="@+id/gravity_left"
-            android:background="#FF00FF00"
-            android:layout_width="wrap_content"
-            android:layout_height="20dip"
-            android:layout_gravity="left"
-            android:text="@string/vertical_text_1"/>
-
-        <TextView android:id="@+id/gravity_center_horizontal"
-            android:background="#FF0000FF"
-            android:layout_width="wrap_content"
-            android:layout_height="20dip"
-            android:layout_gravity="center_horizontal"
-            android:text="@string/vertical_text_2"/>
-
-        <TextView android:id="@+id/gravity_right"
-            android:background="#FF00FF00"
-            android:layout_width="wrap_content"
-            android:layout_height="20dip"
-            android:layout_gravity="right"
-            android:text="@string/vertical_text_3"/>
-    </LinearLayout>
-
-    <LinearLayout android:id="@+id/weightsum"
-        android:orientation="horizontal"
-        android:weightSum="1.0"
-        android:baselineAligned="false"
-        android:layout_width="100dip"
-        android:layout_height="100dip"
-        android:background="#FF909090">
-
-        <TextView android:id="@+id/weight_0_2"
-            android:background="#FF0000FF"
-            android:layout_width="0dip"
-            android:layout_height="wrap_content"
-            android:layout_weight="0.2"
-            android:text="@string/horizontal_text_1"/>
-
-        <TextView android:id="@+id/weight_0_5"
-            android:background="#FFF00F0F"
-            android:layout_width="0dip"
-            android:layout_height="wrap_content"
-            android:layout_weight="0.5"
-            android:text="@string/horizontal_text_2"/>
-
-        <TextView android:id="@+id/weight_0_3"
-            android:background="#FF0000FF"
-            android:layout_width="0dip"
-            android:layout_height="wrap_content"
-            android:layout_weight="0.3"
-            android:text="@string/horizontal_text_3"/>
-    </LinearLayout>
-
-    <LinearLayout android:id="@+id/baseline_aligned_child_index"
-        android:orientation="vertical"
-        android:baselineAlignedChildIndex="1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:background="#FFFF0909">
-
-        <TextView android:id="@+id/textview1"
-            android:background="#FF00FF00"
-            android:layout_width="wrap_content"
-            android:layout_height="20dip"
-            android:layout_gravity="left"
-            android:text="@string/vertical_text_1"/>
-
-        <TextView android:id="@+id/textview2"
-            android:background="#FF0000FF"
-            android:layout_width="wrap_content"
-            android:layout_height="20dip"
-            android:layout_gravity="center_horizontal"
-            android:text="@string/vertical_text_2"/>
-
-        <TextView android:id="@+id/textview3"
-            android:background="#FF00FF00"
-            android:layout_width="wrap_content"
-            android:layout_height="20dip"
-            android:layout_gravity="right"
-            android:text="@string/vertical_text_3"/>
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/tests/res/layout/list_activity_layout.xml b/tests/res/layout/list_activity_layout.xml
deleted file mode 100644
index 0486cf0..0000000
--- a/tests/res/layout/list_activity_layout.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@android:id/text1"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-/>
diff --git a/tests/res/layout/listview_layout.xml b/tests/res/layout/listview_layout.xml
deleted file mode 100644
index ee8b6de..0000000
--- a/tests/res/layout/listview_layout.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/headerview1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/header_view" />
-
-    <TextView android:id="@+id/headerview2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/header_view" />
-
-    <ListView android:id="@+id/listview_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
-
-    <TextView android:id="@+id/footerview1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/footer_view" />
-
-    <TextView android:id="@+id/footerview2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/footer_view" />
-</LinearLayout>
-
diff --git a/tests/res/layout/local_sample.xml b/tests/res/layout/local_sample.xml
deleted file mode 100644
index 6f02e78..0000000
--- a/tests/res/layout/local_sample.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:padding="4dip"
-    android:gravity="center_horizontal"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <TextView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_weight="0"
-        android:paddingBottom="4dip"
-        android:text="@string/text"/>
-
-    <Button android:id="@+id/go"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/text">
-        <requestFocus />
-    </Button>
-
-</LinearLayout>
-
diff --git a/tests/res/layout/mediacontroller_layout.xml b/tests/res/layout/mediacontroller_layout.xml
deleted file mode 100644
index 871adf4..0000000
--- a/tests/res/layout/mediacontroller_layout.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <VideoView
-        android:id="@+id/mediacontroller_videoview"
-        android:layout_width="320px"
-        android:layout_height="240px"/>
-
-</LinearLayout>
-
diff --git a/tests/res/layout/multi_auto_complete_text_view_layout.xml b/tests/res/layout/multi_auto_complete_text_view_layout.xml
deleted file mode 100644
index 50109c8..0000000
--- a/tests/res/layout/multi_auto_complete_text_view_layout.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/text_country" />
-
-    <MultiAutoCompleteTextView android:id="@+id/country_edit"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/text_name" />
-
-    <MultiAutoCompleteTextView android:id="@+id/name_edit"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
-
-</LinearLayout>
-
diff --git a/tests/res/layout/popupwindow.xml b/tests/res/layout/popupwindow.xml
deleted file mode 100644
index 2508115..0000000
--- a/tests/res/layout/popupwindow.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:orientation="vertical">
-
-    <TextView android:id="@+id/anchor_upper"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/text_view_hint" />
-
-    <LinearLayout android:layout_width="match_parent"
-                android:layout_height="0dp"
-                android:layout_weight="1">
-
-        <TextView android:id="@+id/anchor_middle_left"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:text="@string/text_view_hint"
-            android:layout_weight="1"/>
-
-        <TextView android:id="@+id/anchor_middle_right"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:text="@string/text_view_hint"
-            android:layout_weight="1"/>
-
-    </LinearLayout>
-
-    <TextView android:id="@+id/anchor_lower"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/text_view_hint" />
-
-</LinearLayout>
diff --git a/tests/res/layout/progressbar_layout.xml b/tests/res/layout/progressbar_layout.xml
deleted file mode 100644
index a1786b8..0000000
--- a/tests/res/layout/progressbar_layout.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <ProgressBar
-        android:id="@+id/progress_tint"
-        android:progressTint="@android:color/white"
-        android:progressTintMode="src_over"
-        android:progressBackgroundTint="@android:color/white"
-        android:progressBackgroundTintMode="src_over"
-        android:secondaryProgressTint="@android:color/white"
-        android:secondaryProgressTintMode="src_over"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        style="@android:style/Widget.ProgressBar.Horizontal" />
-
-    <ProgressBar
-        android:id="@+id/indeterminate_tint"
-        android:indeterminateTint="@android:color/white"
-        android:indeterminateTintMode="src_over"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        style="@android:style/Widget.ProgressBar.Large" />
-
-</LinearLayout>
diff --git a/tests/res/layout/radiogroup_1.xml b/tests/res/layout/radiogroup_1.xml
deleted file mode 100644
index 1e9db83..0000000
--- a/tests/res/layout/radiogroup_1.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical"
-    android:layout_weight="0.5"
-    android:layout_gravity="bottom"
-    android:layout_margin="5px">
-</RadioGroup>
-
diff --git a/tests/res/layout/ratingbar_layout.xml b/tests/res/layout/ratingbar_layout.xml
deleted file mode 100644
index acc7fa8..0000000
--- a/tests/res/layout/ratingbar_layout.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:orientation="vertical">
-
-    <RatingBar android:id="@+id/ratingbar_constructor"
-        android:isIndicator="false"
-        android:numStars="50"
-        android:rating="1.2"
-        android:stepSize="0.2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_weight="1"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/relative_layout.xml b/tests/res/layout/relative_layout.xml
deleted file mode 100644
index db4b2e8..0000000
--- a/tests/res/layout/relative_layout.xml
+++ /dev/null
@@ -1,258 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <RelativeLayout
-        android:id="@+id/relative_sublayout_attrs"
-        android:background="@drawable/blue"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-
-        <!-- view1, centered within its parent. -->
-        <TextView
-            android:id="@+id/relative_view1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerInParent="true"
-            android:text="@string/relative_view1"/>
-
-        <!-- view2, below view1 and has same left position with view1. -->
-        <TextView
-            android:id="@+id/relative_view2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/relative_view1"
-            android:layout_alignLeft="@id/relative_view1"
-            android:text="@string/relative_view2"/>
-
-        <!-- view3, has same top position with view1 and same bottom position with view2,
-             and on the right of view1. -->
-        <TextView
-            android:id="@+id/relative_view3"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignTop="@id/relative_view1"
-            android:layout_alignBottom="@id/relative_view2"
-            android:layout_toRightOf="@id/relative_view1"
-            android:text="@string/relative_view3"/>
-
-        <!-- view4, has same right position with view3 and above view3. -->
-        <TextView
-            android:id="@+id/relative_view4"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignRight="@id/relative_view3"
-            android:layout_above="@id/relative_view3"
-            android:text="@string/relative_view4"/>
-
-        <!-- view5 goes on the left-bottom -->
-        <TextView
-            android:id="@+id/relative_view5"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentBottom="true"
-            android:layout_alignParentLeft="true"
-            android:text="@string/relative_view5"/>
-
-        <!-- view6 goes on the top-right -->
-        <TextView
-            android:id="@+id/relative_view6"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentTop="true"
-            android:layout_alignParentRight="true"
-            android:text="@string/relative_view6"/>
-
-        <!-- view7, has same baseline with view6 and centered horizontally within its parent. -->
-        <TextView
-            android:id="@+id/relative_view7"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignBaseline="@id/relative_view6"
-            android:layout_centerHorizontal="true"
-            android:text="@string/relative_view7"/>
-
-        <!-- view8, centered vertically within its parent and on the left of view1. -->
-        <TextView
-            android:id="@+id/relative_view8"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_toLeftOf="@id/relative_view1"
-            android:layout_centerVertical="true"
-            android:text="@string/relative_view8"/>
-
-        <!-- view9, has same top and bottom position with view3 and same left position
-             with its parent. -->
-        <TextView
-            android:id="@+id/relative_view9"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignLeft="@id/gravity_bottom"
-            android:layout_alignTop="@id/relative_view3"
-            android:layout_alignBottom="@id/relative_view3"
-            android:layout_alignWithParentIfMissing="true"
-            android:text="@string/relative_view9"/>
-
-    </RelativeLayout>
-
-    <RelativeLayout
-        android:id="@+id/relative_sublayout_gravity"
-        android:background="@drawable/yellow"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-
-        <!-- view10 -->
-        <TextView
-            android:id="@+id/relative_view10"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/relative_view10"/>
-
-        <!-- view11 -->
-        <TextView
-            android:id="@+id/relative_view11"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/relative_view10"
-            android:text="@string/relative_view11"/>
-    </RelativeLayout>
-
-    <RelativeLayout
-        android:id="@+id/relative_sublayout_ignore_gravity"
-        android:background="@drawable/red"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:ignoreGravity="@+id/relative_view12"
-        android:gravity="right">
-
-        <!-- view12 -->
-        <TextView
-            android:id="@id/relative_view12"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/relative_view12"/>
-
-        <!-- view13 -->
-        <TextView
-            android:id="@+id/relative_view13"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/relative_view13"/>
-    </RelativeLayout>
-
-    <Spinner
-        android:id="@+id/spinner1"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:prompt="@string/text_view_hello"/>
-
-    <RelativeLayout
-            android:id="@+id/relative_sublayout_attrs_2"
-            android:background="@drawable/blue"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent">
-
-        <!-- view21, centered within its parent. -->
-        <TextView
-                android:id="@+id/relative_view21"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerInParent="true"
-                android:text="@string/relative_view1"/>
-
-        <!-- view22, below view1 and has same start position with view21. -->
-        <TextView
-                android:id="@+id/relative_view22"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_below="@id/relative_view21"
-                android:layout_alignStart="@id/relative_view21"
-                android:text="@string/relative_view2"/>
-
-        <!-- view23, has same top position with view21 and same bottom position with view22,
-             and on the end of view1. -->
-        <TextView
-                android:id="@+id/relative_view23"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignTop="@id/relative_view21"
-                android:layout_alignBottom="@id/relative_view22"
-                android:layout_toEndOf="@id/relative_view21"
-                android:text="@string/relative_view3"/>
-
-        <!-- view24, has same end position with view23 and above view23. -->
-        <TextView
-                android:id="@+id/relative_view24"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignEnd="@id/relative_view23"
-                android:layout_above="@id/relative_view23"
-                android:text="@string/relative_view4"/>
-
-        <!-- view25 goes on the start-bottom -->
-        <TextView
-                android:id="@+id/relative_view25"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentBottom="true"
-                android:layout_alignParentStart="true"
-                android:text="@string/relative_view5"/>
-
-        <!-- view26 goes on the top-end -->
-        <TextView
-                android:id="@+id/relative_view26"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentTop="true"
-                android:layout_alignParentEnd="true"
-                android:text="@string/relative_view6"/>
-
-        <!-- view27, has same baseline with view26 and centered horizontally within its parent. -->
-        <TextView
-                android:id="@+id/relative_view27"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignBaseline="@id/relative_view26"
-                android:layout_centerHorizontal="true"
-                android:text="@string/relative_view7"/>
-
-        <!-- view28, centered vertically within its parent and on the start of view21. -->
-        <TextView
-                android:id="@+id/relative_view28"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_toStartOf="@id/relative_view21"
-                android:layout_centerVertical="true"
-                android:text="@string/relative_view8"/>
-
-        <!-- view29, has same top and bottom position with view23 and same start position
-             with its parent. -->
-        <TextView
-                android:id="@+id/relative_view29"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignStart="@id/gravity_bottom"
-                android:layout_alignTop="@id/relative_view23"
-                android:layout_alignBottom="@id/relative_view23"
-                android:layout_alignWithParentIfMissing="true"
-                android:text="@string/relative_view9"/>
-
-    </RelativeLayout>
-
-</RelativeLayout>
diff --git a/tests/res/layout/remote_view_test_bad_1.xml b/tests/res/layout/remote_view_test_bad_1.xml
deleted file mode 100644
index a65a5ec..0000000
--- a/tests/res/layout/remote_view_test_bad_1.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 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.
-*/
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/linear"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <EditText android:id="@+id/edit"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/tests/res/layout/remote_view_test_bad_2.xml b/tests/res/layout/remote_view_test_bad_2.xml
deleted file mode 100644
index 92623d8..0000000
--- a/tests/res/layout/remote_view_test_bad_2.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 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.
-*/
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/linear"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <WebView android:id="@+id/web"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/tests/res/layout/remote_view_test_good.xml b/tests/res/layout/remote_view_test_good.xml
deleted file mode 100644
index 3df9d62..0000000
--- a/tests/res/layout/remote_view_test_good.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 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.
-*/
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/linear"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <TextView android:id="@+id/text"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-    <ImageView android:id="@+id/image"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-    <FrameLayout android:id="@+id/frame"
-        android:layout_width="10dip"
-        android:layout_height="10dip" />
-
-    <RelativeLayout android:id="@+id/relative"
-        android:layout_width="10dip"
-        android:layout_height="10dip" />
-
-    <AbsoluteLayout android:id="@+id/absolute"
-        android:layout_width="10dip"
-        android:layout_height="10dip" />
-
-    <ProgressBar android:id="@+id/progress"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-    <ImageButton android:id="@+id/image_button"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-    <Button android:id="@+id/button"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/tests/res/layout/remoteviews_good.xml b/tests/res/layout/remoteviews_good.xml
deleted file mode 100644
index 8fdbc64..0000000
--- a/tests/res/layout/remoteviews_good.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/remoteViews_good"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <LinearLayout android:id="@+id/remoteView_linear"
-        android:layout_width="10dip"
-        android:layout_height="10dip" />
-
-    <TextView android:id="@+id/remoteView_text"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-    <ImageView android:id="@+id/remoteView_image"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-    <FrameLayout android:id="@+id/remoteView_frame"
-        android:layout_width="10dip"
-        android:layout_height="10dip" />
-
-    <RelativeLayout android:id="@+id/remoteView_relative"
-        android:layout_width="10dip"
-        android:layout_height="10dip" />
-
-    <AbsoluteLayout android:id="@+id/remoteView_absolute"
-        android:layout_width="10dip"
-        android:layout_height="10dip" />
-
-    <ProgressBar android:id="@+id/remoteView_progress"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        style="?android:attr/progressBarStyleHorizontal" />
-
-    <Chronometer android:id="@+id/remoteView_chronometer"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/tests/res/layout/remoteviews_host.xml b/tests/res/layout/remoteviews_host.xml
deleted file mode 100644
index ace5903..0000000
--- a/tests/res/layout/remoteviews_host.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:id="@+id/remoteView_host">
-</LinearLayout>
diff --git a/tests/res/layout/scrollview_layout.xml b/tests/res/layout/scrollview_layout.xml
deleted file mode 100644
index 3c9a474..0000000
--- a/tests/res/layout/scrollview_layout.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<android.widget.cts.MyScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/scroll_view"
-    android:layout_width="100dip"
-    android:layout_height="100dip">
-
-    <LinearLayout
-        android:orientation="vertical"
-        android:layout_width="250dip"
-        android:layout_height="wrap_content">
-
-        <Button
-            android:id="@+id/first_child"
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_1"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_2"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_3"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_1"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_2"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_3"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_1"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_2"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_3"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_1"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_2"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_3"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_1"/>
-
-        <Button
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_2"/>
-
-        <Button
-            android:id="@+id/last_child"
-            android:layout_width="250dip"
-            android:layout_height="100dip"
-            android:text="@string/vertical_text_3"/>
-    </LinearLayout>
-
-</android.widget.cts.MyScrollView>
diff --git a/tests/res/layout/searchview.xml b/tests/res/layout/searchview.xml
deleted file mode 100644
index dba105a..0000000
--- a/tests/res/layout/searchview.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-    <SearchView android:id="@+id/searchView1"
-                android:layout_width="fill_parent"
-                android:layout_height="fill_parent"
-                xmlns:android="http://schemas.android.com/apk/res/android">
-    </SearchView>
diff --git a/tests/res/layout/seekbar_layout.xml b/tests/res/layout/seekbar_layout.xml
deleted file mode 100644
index 5c311fd..0000000
--- a/tests/res/layout/seekbar_layout.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-     <SeekBar android:id="@+id/seekBar"
-         android:layout_width="match_parent"
-         android:layout_height="wrap_content"
-         android:max="100"
-         android:progress="50"
-         android:secondaryProgress="75" />
-
-    <SeekBar
-        android:id="@+id/thumb_tint"
-        android:thumbTint="@android:color/white"
-        android:thumbTintMode="src_over"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/tests/res/layout/simple_dropdown_item_1line.xml b/tests/res/layout/simple_dropdown_item_1line.xml
deleted file mode 100644
index 9a044b1..0000000
--- a/tests/res/layout/simple_dropdown_item_1line.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/text1"
-    style="?android:attr/dropDownItemStyle"
-    android:textAppearance="?android:attr/textAppearanceLargeInverse"
-    android:singleLine="true"
-    android:layout_width="match_parent"
-    android:layout_height="?android:attr/listPreferredItemHeight" />
diff --git a/tests/res/layout/simple_spinner_item.xml b/tests/res/layout/simple_spinner_item.xml
deleted file mode 100644
index 247bffa..0000000
--- a/tests/res/layout/simple_spinner_item.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<TextView xmlns:android="http://schemas.android.com/apk/res/android" 
-    android:id="@android:id/text1"
-    style="?android:attr/spinnerItemStyle"
-    android:singleLine="true"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content" />
diff --git a/tests/res/layout/sliding_drawer_layout.xml b/tests/res/layout/sliding_drawer_layout.xml
deleted file mode 100644
index 3f84d46..0000000
--- a/tests/res/layout/sliding_drawer_layout.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <SlidingDrawer
-        android:id="@+id/drawer"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:animateOnClick="false"
-
-        android:handle="@+id/handle"
-        android:content="@+id/content">
-
-        <ImageView
-            android:id="@id/handle"
-            android:background="#FF00FF00"
-            android:layout_width="88dip"
-            android:layout_height="44dip" />
-
-        <TextView
-            android:id="@id/content"
-            android:background="#FF0000FF"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:text="@string/hello_world" />
-
-    </SlidingDrawer>
-
-</RelativeLayout>
diff --git a/tests/res/layout/surface_view.xml b/tests/res/layout/surface_view.xml
deleted file mode 100644
index f410544..0000000
--- a/tests/res/layout/surface_view.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <SurfaceView
-        android:id="@+id/surface_view"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/tabhost_layout.xml b/tests/res/layout/tabhost_layout.xml
deleted file mode 100644
index 1bae57a..0000000
--- a/tests/res/layout/tabhost_layout.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@android:id/tabhost"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content">
-
-    <TabWidget android:id="@android:id/tabs"
-        android:layout_width="match_parent"
-        android:layout_height="68dip"
-        android:paddingLeft="1dip"
-        android:paddingRight="1dip"
-        android:paddingTop="4dip"
-    />
-
-    <FrameLayout android:id="@android:id/tabcontent"
-        android:layout_width="match_parent"
-        android:layout_height="0dip"
-        android:layout_weight="1">
-
-        <TextView android:id="@+id/tabhost_textview"
-            android:password="true"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/hello_world"/>
-
-        <ListView android:id="@+id/tabhost_listview"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"/>
-    </FrameLayout>
-</TabHost>
diff --git a/tests/res/layout/table_layout_1.xml b/tests/res/layout/table_layout_1.xml
deleted file mode 100644
index 0896cd2..0000000
--- a/tests/res/layout/table_layout_1.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/table1"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:collapseColumns="0"
-    android:stretchColumns="2">
-
-    <TableRow>
-        <TextView
-            android:text="@string/table_layout_first"
-            android:padding="3dip" />
-        <TextView
-            android:text="@string/table_layout_second"
-            android:padding="3dip" />
-        <TextView
-            android:text="@string/table_layout_third"
-            android:padding="3dip" />
-    </TableRow>
-</TableLayout>
-
diff --git a/tests/res/layout/table_layout_2.xml b/tests/res/layout/table_layout_2.xml
deleted file mode 100644
index 84750fc..0000000
--- a/tests/res/layout/table_layout_2.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/table2"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:shrinkColumns="1">
-
-    <TableRow>
-        <TextView
-            android:layout_column="1"
-            android:text="@string/table_layout_long"
-            android:padding="3dip" />
-        <TextView
-            android:layout_span="2"
-            android:text="@string/table_layout_second"
-            android:padding="3dip" />
-        <TextView
-            android:text="@string/table_layout_third"
-            android:padding="3dip" />
-    </TableRow>
-</TableLayout>
-
diff --git a/tests/res/layout/textview_autolink.xml b/tests/res/layout/textview_autolink.xml
deleted file mode 100644
index 53d89f3..0000000
--- a/tests/res/layout/textview_autolink.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/autolink_default"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"/>
-
-    <TextView android:id="@+id/autolink_web"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:autoLink="web"/>
-
-    <TextView android:id="@+id/autolink_email"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:autoLink="email"/>
-
-    <TextView android:id="@+id/autolink_phone"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:autoLink="phone"/>
-
-    <TextView android:id="@+id/autolink_all"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:autoLink="all"/>
-
-    <TextView android:id="@+id/autolink_compound1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:autoLink="web|email"/>
-
-    <TextView android:id="@+id/autolink_compound2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:autoLink="web|phone"/>
-
-    <TextView android:id="@+id/autolink_compound3"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:autoLink="email|phone"/>
-
-    <TextView android:id="@+id/autolink_compound4"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:autoLink="phone|all"/>
-
-</FrameLayout>
diff --git a/tests/res/layout/textview_autotext.xml b/tests/res/layout/textview_autotext.xml
deleted file mode 100644
index 9a1e9ef..0000000
--- a/tests/res/layout/textview_autotext.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/autotext_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
-
-    <TextView android:id="@+id/autotext_false"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:autoText="false"/>
-
-    <TextView android:id="@+id/autotext_true"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:autoText="true"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_buffertype.xml b/tests/res/layout/textview_buffertype.xml
deleted file mode 100644
index 33b0d20..0000000
--- a/tests/res/layout/textview_buffertype.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/buffertype_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
-
-    <TextView android:id="@+id/buffertype_normal"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:bufferType="normal"/>
-
-    <TextView android:id="@+id/buffertype_spannable"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:bufferType="spannable"/>
-
-    <TextView android:id="@+id/buffertype_editable"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:bufferType="editable"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_capitalize.xml b/tests/res/layout/textview_capitalize.xml
deleted file mode 100644
index 4b80ce0..0000000
--- a/tests/res/layout/textview_capitalize.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/capitalize_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:editable="true"/>
-
-    <TextView android:id="@+id/capitalize_none"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:capitalize="none"/>
-
-    <TextView android:id="@+id/capitalize_sentences"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:capitalize="sentences"/>
-
-    <TextView android:id="@+id/capitalize_words"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:capitalize="words"/>
-
-    <TextView android:id="@+id/capitalize_characters"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:capitalize="characters"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_content.xml b/tests/res/layout/textview_content.xml
deleted file mode 100644
index 189f812..0000000
--- a/tests/res/layout/textview_content.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/text_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
-
-    <TextView android:id="@+id/text_resid"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/text_view_hello"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_digits.xml b/tests/res/layout/textview_digits.xml
deleted file mode 100644
index 2a0d470..0000000
--- a/tests/res/layout/textview_digits.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/digits_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:editable="true"/>
-
-    <TextView android:id="@+id/digits_hex"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:digits="0123456789ABCDEFabcdef.-"/>
-
-    <TextView android:id="@+id/digits_blank"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:digits=""/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_ellipsize.xml b/tests/res/layout/textview_ellipsize.xml
deleted file mode 100644
index 0fc5779..0000000
--- a/tests/res/layout/textview_ellipsize.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/ellipsize_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
-
-    <TextView android:id="@+id/ellipsize_none"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ellipsize="none"/>
-
-    <TextView android:id="@+id/ellipsize_start"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ellipsize="start"/>
-
-    <TextView android:id="@+id/ellipsize_middle"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ellipsize="middle"/>
-
-    <TextView android:id="@+id/ellipsize_end"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ellipsize="end"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_ems.xml b/tests/res/layout/textview_ems.xml
deleted file mode 100644
index a169cb0..0000000
--- a/tests/res/layout/textview_ems.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/ems_default"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:scrollHorizontally="true"/>
-
-    <TextView android:id="@+id/ems_huge"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:ems="60"
-        android:text="@string/explain"
-        android:scrollHorizontally="true"/>
-
-    <TextView android:id="@+id/ems_tiny"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:ems="1"
-        android:text="@string/explain"
-        android:scrollHorizontally="true"/>
-
-    <TextView android:id="@+id/ems_zero"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:ems="0"
-        android:text="@string/explain"
-        android:scrollHorizontally="true"/>
-
-    <TextView android:id="@+id/minEms_tiny"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:minEms="1"
-        android:scrollHorizontally="true"/>
-
-    <TextView android:id="@+id/minEms_huge"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:minEms="1000"
-        android:scrollHorizontally="true"/>
-
-    <TextView android:id="@+id/minEms_zero"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:minEms="0"
-        android:scrollHorizontally="true"/>
-
-    <TextView android:id="@+id/maxEms_tiny"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:maxEms="1"
-        android:scrollHorizontally="true"/>
-
-    <TextView android:id="@+id/maxEms_huge"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:maxEms="1000"
-        android:scrollHorizontally="true"/>
-
-    <TextView android:id="@+id/maxEms_zero"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:maxEms="0"
-        android:scrollHorizontally="true"/>
-
-    <TextView android:id="@+id/minEms_maxEms_correct"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:maxEms="60"
-        android:minEms="10"
-        android:scrollHorizontally="true"/>
-
-    <TextView android:id="@+id/minEms_maxEms_wrong"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:maxEms="10"
-        android:minEms="60"
-        android:scrollHorizontally="true"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_gravity.xml b/tests/res/layout/textview_gravity.xml
deleted file mode 100644
index a4a7592..0000000
--- a/tests/res/layout/textview_gravity.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/gravity_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
-
-    <TextView android:id="@+id/gravity_bottom"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="bottom"/>
-
-    <TextView android:id="@+id/gravity_right"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="right"/>
-
-    <TextView android:id="@+id/gravity_fill"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="fill"/>
-
-    <TextView android:id="@+id/gravity_center"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center"/>
-
-    <TextView android:id="@+id/gravity_center_vertical_right"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_vertical|right"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_hint_linksclickable_freezestext.xml b/tests/res/layout/textview_hint_linksclickable_freezestext.xml
deleted file mode 100644
index a22e429..0000000
--- a/tests/res/layout/textview_hint_linksclickable_freezestext.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/hint_linksClickable_freezesText_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
-
-    <TextView android:id="@+id/hint_blank"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:hint=""/>
-
-    <TextView android:id="@+id/hint_string"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:hint="@string/text_view_simple_hint"/>
-
-    <TextView android:id="@+id/hint_resid"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:hint="@string/text_view_hint"/>
-
-    <TextView android:id="@+id/linksClickable_true"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:linksClickable="true"/>
-
-    <TextView android:id="@+id/linksClickable_false"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:linksClickable="false"/>
-
-    <TextView android:id="@+id/freezesText_true"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:freezesText="true"/>
-
-    <TextView android:id="@+id/freezesText_false"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:freezesText="false"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_inputmethod_blank.xml b/tests/res/layout/textview_inputmethod_blank.xml
deleted file mode 100644
index 4420611..0000000
--- a/tests/res/layout/textview_inputmethod_blank.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:inputMethod=""/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_inputmethod_builtin.xml b/tests/res/layout/textview_inputmethod_builtin.xml
deleted file mode 100644
index e09a0ea..0000000
--- a/tests/res/layout/textview_inputmethod_builtin.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/inputMethod_builtIn_digits"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:inputMethod="android.text.method.DigitsKeyListener"/>
-
-    <TextView android:id="@+id/inputMethod_builtIn_datetime"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:inputMethod="android.text.method.DateTimeKeyListener"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_inputmethod_notexist.xml b/tests/res/layout/textview_inputmethod_notexist.xml
deleted file mode 100644
index 9030b62..0000000
--- a/tests/res/layout/textview_inputmethod_notexist.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:inputMethod="android.text.method.NotExistKeyListener"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_layout.xml b/tests/res/layout/textview_layout.xml
deleted file mode 100644
index d069df2..0000000
--- a/tests/res/layout/textview_layout.xml
+++ /dev/null
@@ -1,220 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:id="@+id/layout_textviewtest">
-
-    <ScrollView android:layout_width="match_parent"
-            android:layout_height="match_parent">
-
-        <LinearLayout android:orientation="vertical"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent">
-
-            <TextView android:id="@+id/textview_textAttr"
-                    android:text="@string/text_view_hello"
-                    android:textColor="@drawable/black"
-                    android:textColorHighlight="@drawable/yellow"
-                    android:textColorHint="@drawable/red"
-                    android:textColorLink="@drawable/blue"
-                    android:textScaleX="1.2"
-                    android:typeface="normal"
-                    android:textSize="20px"
-                    android:textStyle="normal"
-                    android:textAppearance="@null"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"/>
-        
-            <TextView android:id="@+id/textview_password"
-                    android:password="true"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"/>
-        
-            <TextView android:id="@+id/textview_singleLine"
-                    android:singleLine="true"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"/>
-        
-            <TextView android:id="@+id/textview_text"
-                    android:text="@string/text_view_hello"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"/>
-
-            <TextView android:id="@+id/textview_text_two_lines"
-                    android:text="@string/text_view_hello_two_lines"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"/>
-
-            <android.widget.cts.MockTextView
-                    android:id="@+id/mock_textview_left"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:requiresFadingEdge="horizontal"
-                    android:singleLine="true"
-                    android:text="@string/long_text"
-                    android:gravity="left"
-                    />
-
-            <android.widget.cts.MockTextView
-                    android:id="@+id/mock_textview_right"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:requiresFadingEdge="horizontal"
-                    android:singleLine="true"
-                    android:text="@string/long_text"
-                    android:gravity="right"
-                    />
-
-            <android.widget.cts.MockTextView
-                    android:id="@+id/mock_textview_center"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:requiresFadingEdge="horizontal"
-                    android:singleLine="true"
-                    android:text="@string/long_text"
-                    android:gravity="center"
-                    />
-        </LinearLayout>
-
-    </ScrollView>
-
-    <TextView android:id="@+id/textview_ltr"
-              android:layout_height="wrap_content"
-              android:layout_width="wrap_content"/>
-
-    <TextView android:id="@+id/textview_rtl"
-              android:layout_height="wrap_content"
-              android:layout_width="wrap_content"/>
-
-    <TextView android:id="@+id/textview_drawable_1_1"
-              android:layout_height="wrap_content"
-              android:layout_width="wrap_content"
-              android:drawableLeft="@drawable/icon_blue"
-              android:drawableRight="@drawable/icon_red"
-              android:drawableTop="@drawable/icon_green"
-              android:drawableBottom="@drawable/icon_yellow"
-            />
-
-    <TextView android:id="@+id/textview_drawable_1_2"
-              android:layout_height="wrap_content"
-              android:layout_width="wrap_content"
-              android:drawableLeft="@drawable/icon_blue"
-              android:drawableRight="@drawable/icon_red"
-              android:drawableTop="@drawable/icon_green"
-              android:drawableBottom="@drawable/icon_yellow"
-              android:layoutDirection="rtl"
-            />
-
-    <TextView android:id="@+id/textview_drawable_2_1"
-              android:layout_height="wrap_content"
-              android:layout_width="wrap_content"
-              android:drawableStart="@drawable/icon_blue"
-              android:drawableEnd="@drawable/icon_red"
-              android:drawableTop="@drawable/icon_green"
-              android:drawableBottom="@drawable/icon_yellow"
-            />
-
-    <TextView android:id="@+id/textview_drawable_2_2"
-              android:layout_height="wrap_content"
-              android:layout_width="wrap_content"
-              android:drawableStart="@drawable/icon_blue"
-              android:drawableEnd="@drawable/icon_red"
-              android:drawableTop="@drawable/icon_green"
-              android:drawableBottom="@drawable/icon_yellow"
-              android:layoutDirection="rtl"
-            />
-
-    <TextView android:id="@+id/textview_drawable_3_1"
-              android:layout_height="wrap_content"
-              android:layout_width="wrap_content"
-              android:drawableLeft="@drawable/icon_black"
-              android:drawableRight="@drawable/icon_black"
-              android:drawableStart="@drawable/icon_blue"
-              android:drawableEnd="@drawable/icon_red"
-              android:drawableTop="@drawable/icon_green"
-              android:drawableBottom="@drawable/icon_yellow"
-            />
-
-    <TextView android:id="@+id/textview_drawable_3_2"
-              android:layout_height="wrap_content"
-              android:layout_width="wrap_content"
-              android:drawableLeft="@drawable/icon_black"
-              android:drawableRight="@drawable/icon_black"
-              android:drawableStart="@drawable/icon_blue"
-              android:drawableEnd="@drawable/icon_red"
-              android:drawableTop="@drawable/icon_green"
-              android:drawableBottom="@drawable/icon_yellow"
-              android:layoutDirection="rtl"
-            />
-
-
-    <LinearLayout android:orientation="vertical"
-                  android:layout_width="match_parent"
-                  android:layout_height="match_parent"
-                  android:layoutDirection="ltr">
-
-        <TextView android:id="@+id/textview_drawable_4_1"
-                  android:layout_height="wrap_content"
-                  android:layout_width="wrap_content"
-                  android:drawableStart="@drawable/icon_blue"
-                  android:drawableEnd="@drawable/icon_red"
-                  android:drawableTop="@drawable/icon_green"
-                  android:drawableBottom="@drawable/icon_yellow"
-                />
-
-        <TextView android:id="@+id/textview_drawable_5_1"
-                  android:layout_height="wrap_content"
-                  android:layout_width="wrap_content"
-                  android:drawableLeft="@drawable/icon_black"
-                  android:drawableRight="@drawable/icon_black"
-                  android:drawableStart="@drawable/icon_blue"
-                  android:drawableEnd="@drawable/icon_red"
-                  android:drawableTop="@drawable/icon_green"
-                  android:drawableBottom="@drawable/icon_yellow"
-                />
-
-    </LinearLayout>
-
-    <LinearLayout android:orientation="vertical"
-                  android:layout_width="match_parent"
-                  android:layout_height="match_parent"
-                  android:layoutDirection="rtl">
-
-        <TextView android:id="@+id/textview_drawable_4_2"
-                  android:layout_height="wrap_content"
-                  android:layout_width="wrap_content"
-                  android:drawableStart="@drawable/icon_blue"
-                  android:drawableEnd="@drawable/icon_red"
-                  android:drawableTop="@drawable/icon_green"
-                  android:drawableBottom="@drawable/icon_yellow"
-                />
-
-        <TextView android:id="@+id/textview_drawable_5_2"
-                  android:layout_height="wrap_content"
-                  android:layout_width="wrap_content"
-                  android:drawableLeft="@drawable/icon_black"
-                  android:drawableRight="@drawable/icon_black"
-                  android:drawableStart="@drawable/icon_blue"
-                  android:drawableEnd="@drawable/icon_red"
-                  android:drawableTop="@drawable/icon_green"
-                  android:drawableBottom="@drawable/icon_yellow"
-                />
-
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_numeric.xml b/tests/res/layout/textview_numeric.xml
deleted file mode 100644
index e60cb26..0000000
--- a/tests/res/layout/textview_numeric.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/numeric_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:editable="true"/>
-
-    <TextView android:id="@+id/numeric_integer"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="integer"/>
-
-    <TextView android:id="@+id/numeric_signed"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="signed"/>
-
-    <TextView android:id="@+id/numeric_decimal"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="decimal"/>
-
-    <TextView android:id="@+id/numeric_signed_integer"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="signed|integer"/>
-
-    <TextView android:id="@+id/numeric_integer_decimal"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="integer|decimal"/>
-
-    <TextView android:id="@+id/numeric_signed_decimal"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="signed|decimal"/>
-
-    <TextView android:id="@+id/numeric_signed_decimal_integer"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:numeric="signed|integer|decimal"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_phonenumber.xml b/tests/res/layout/textview_phonenumber.xml
deleted file mode 100644
index d0975c6..0000000
--- a/tests/res/layout/textview_phonenumber.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/phoneNumber_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:editable="true"/>
-
-    <TextView android:id="@+id/phoneNumber_true"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:phoneNumber="true"/>
-
-    <TextView android:id="@+id/phoneNumber_false"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:phoneNumber="false"
-        android:editable="true"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/textview_selectallonfocus.xml b/tests/res/layout/textview_selectallonfocus.xml
deleted file mode 100644
index b1c3682..0000000
--- a/tests/res/layout/textview_selectallonfocus.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <TextView android:id="@+id/selectAllOnFocus_default"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:focusable="true"/>
-
-    <TextView android:id="@+id/selectAllOnFocus_true"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:selectAllOnFocus="true"
-        android:focusable="true"/>
-
-    <TextView android:id="@+id/selectAllOnFocus_false"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:selectAllOnFocus="false"
-        android:focusable="true"/>
-
-        <TextView android:id="@+id/selectAllOnFocus_dummy"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:focusable="true"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/timepicker.xml b/tests/res/layout/timepicker.xml
deleted file mode 100644
index 352f69b..0000000
--- a/tests/res/layout/timepicker.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TimePicker xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"/>
diff --git a/tests/res/layout/togglebutton_layout.xml b/tests/res/layout/togglebutton_layout.xml
deleted file mode 100644
index a6c08e1..0000000
--- a/tests/res/layout/togglebutton_layout.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <LinearLayout
-        android:orientation="vertical"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-
-        <ToggleButton android:id="@+id/toggle1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content" />
-
-        <ToggleButton android:id="@+id/toggle2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content" />
-
-        <ToggleButton android:id="@+id/button_tint"
-            android:buttonTint="@android:color/white"
-            android:buttonTintMode="src_over"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content" />
-
-    </LinearLayout>
-
-</ScrollView>
diff --git a/tests/res/layout/twolinelistitem.xml b/tests/res/layout/twolinelistitem.xml
deleted file mode 100644
index ec256c1..0000000
--- a/tests/res/layout/twolinelistitem.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:id="@+id/twoLineListItem">
-
-    <TextView android:id="@android:id/text1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/twolinelistitem_test_text1"/>
-
-    <TextView android:id="@android:id/text2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/twolinelistitem_test_text2"/>
-
-</TwoLineListItem>
diff --git a/tests/res/layout/urlspan_layout.xml b/tests/res/layout/urlspan_layout.xml
deleted file mode 100644
index 2ca95ac..0000000
--- a/tests/res/layout/urlspan_layout.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="vertical">
-
-    <TextView android:id="@+id/url"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:paddingLeft="4dip"
-        android:focusable="true"
-        android:focusableInTouchMode="true"
-        android:text="@string/text_view_hello"/>
-
-</LinearLayout>
diff --git a/tests/res/layout/using_views_layout.xml b/tests/res/layout/using_views_layout.xml
deleted file mode 100644
index b35aa08..0000000
--- a/tests/res/layout/using_views_layout.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <TextView
-        android:id="@+id/country"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/country"/>
-
-    <EditText
-        android:id="@+id/entry"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="@android:drawable/editbox_background"
-        android:layout_below="@id/country"/>
-
-    <Button
-        android:id="@+id/cancel"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/entry"
-        android:layout_alignParentRight="true"
-        android:layout_marginLeft="10dip"
-        android:text="@string/id_cancel"/>
-
-    <Button
-        android:id="@+id/ok"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_toLeftOf="@id/cancel"
-        android:layout_alignTop="@id/cancel"
-        android:text="@string/id_ok"/>
-
-    <TextView
-        android:id="@+id/symbol"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/ok"
-        android:text="@string/symbol"/>
-
-    <TextView
-        android:id="@+id/symbolball"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/symbol"
-        android:layout_marginLeft="20dip"/>
-
-    <TextView
-        android:id="@+id/warning"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="#aa0000"
-        android:layout_below="@id/symbolball"
-        android:text="@string/country_warning"
-        android:visibility="invisible"
-        android:layout_weight="2"/>
-
-</RelativeLayout>
-
diff --git a/tests/res/layout/videoview_layout.xml b/tests/res/layout/videoview_layout.xml
deleted file mode 100644
index 9b042cb..0000000
--- a/tests/res/layout/videoview_layout.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <VideoView
-        android:id="@+id/videoview"
-        android:layout_width="160px"
-        android:layout_height="120px"/>
-</LinearLayout>
diff --git a/tests/res/layout/view_layout.xml b/tests/res/layout/view_layout.xml
deleted file mode 100644
index fa817dc..0000000
--- a/tests/res/layout/view_layout.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * 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.
- */
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/viewlayout_root"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <android.view.cts.MockView
-        android:id="@+id/mock_view"
-        android:layout_width="100px"
-        android:layout_height="200px"/>
-
-    <android.view.cts.MockView
-        android:id="@+id/scroll_view"
-        android:layout_width="100px"
-        android:layout_height="200px"
-        android:scrollbars="horizontal|vertical"
-        android:fadingEdge="horizontal|vertical"
-        android:fadingEdgeLength="20px"/>
-
-    <android.view.cts.MockView
-        android:id="@+id/scroll_view_2"
-        android:layout_width="100px"
-        android:layout_height="200px"
-        android:scrollbars="horizontal|vertical"
-        android:requiresFadingEdge="horizontal|vertical"
-        android:fadingEdgeLength="20px"/>
-
-    <View
-        android:id="@+id/fit_windows"
-        android:fitsSystemWindows="true"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"/>
-
-    <android.view.cts.MockView
-            android:id="@+id/mock_view_padding_full"
-            android:layout_width="200px"
-            android:layout_height="200px"
-            android:padding="0px"
-            android:background="@drawable/padding_0" />
-
-    <android.view.cts.MockView
-            android:id="@+id/mock_view_padding_left"
-            android:layout_width="200px"
-            android:layout_height="200px"
-            android:paddingLeft="0px"
-            android:background="@drawable/padding_0" />
-
-    <android.view.cts.MockView
-            android:id="@+id/mock_view_padding_right"
-            android:layout_width="200px"
-            android:layout_height="200px"
-            android:paddingRight="0px"
-            android:background="@drawable/padding_0" />
-
-    <android.view.cts.MockView
-            android:id="@+id/mock_view_padding_top"
-            android:layout_width="200px"
-            android:layout_height="200px"
-            android:paddingTop="0px"
-            android:background="@drawable/padding_0" />
-
-    <android.view.cts.MockView
-            android:id="@+id/mock_view_padding_bottom"
-            android:layout_width="200px"
-            android:layout_height="200px"
-            android:paddingBottom="0dp"
-            android:background="@drawable/padding_0" />
-
-    <android.view.cts.MockView
-            android:id="@+id/mock_view_padding_runtime_updated"
-            android:layout_width="200px"
-            android:layout_height="200px"
-            android:paddingStart="8px"
-            android:paddingEnd="8px"
-            android:background="@drawable/no_padding" />
-
-    <View
-        android:id="@+id/background_tint"
-        android:backgroundTint="@android:color/white"
-        android:backgroundTintMode="src_over"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/tests/res/layout/view_layout_position.xml b/tests/res/layout/view_layout_position.xml
deleted file mode 100644
index 7d28186..0000000
--- a/tests/res/layout/view_layout_position.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * 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.
- */
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <LinearLayout
-            android:id="@+id/testparent"
-            android:layout_marginLeft = "1dip"
-            android:layout_marginTop = "2dip"
-            android:layout_marginRight = "3dip"
-            android:layout_marginBottom = "4dip"
-            android:orientation="vertical"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent">
-
-        <View
-            android:id="@+id/testview"
-            android:layout_marginLeft = "5dip"
-            android:layout_marginTop = "6dip"
-            android:layout_marginRight = "7dip"
-            android:layout_marginBottom = "8dip"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"/>
-
-    </LinearLayout>
-</LinearLayout>
diff --git a/tests/res/layout/view_visibility_layout.xml b/tests/res/layout/view_visibility_layout.xml
deleted file mode 100644
index 92d22ed..0000000
--- a/tests/res/layout/view_visibility_layout.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical">
-
-    <View
-        android:id="@+id/textview1"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:visibility="visible"/>
-
-    <View
-        android:id="@+id/textview2"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:visibility="invisible"/>
-
-    <View
-        android:id="@+id/textview3"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:visibility="gone"/>
-</LinearLayout>
-
diff --git a/tests/res/layout/viewanimator_layout.xml b/tests/res/layout/viewanimator_layout.xml
deleted file mode 100644
index 96b2483..0000000
--- a/tests/res/layout/viewanimator_layout.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<!-- Demonstrates using a relative layout to create a form -->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:focusable="true"
-    android:background="@drawable/blue">
-
-    <TextView android:id="@+id/label"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_alignParentTop="true"
-        android:layout_alignParentLeft="true"
-        android:text="@string/viewanimator_test"/>
-
-    <EditText android:id="@+id/entry"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="@android:drawable/editbox_background"
-        android:layout_below="@id/label"/>
-
-    <Button android:id="@+id/cancel"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/entry"
-        android:layout_alignParentRight="true"
-        android:layout_marginLeft="10px"
-        android:text="@string/id_cancel" />
-
-    <Button android:id="@+id/ok"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_toLeftOf="@id/cancel"
-        android:layout_alignTop="@id/cancel"
-        android:text="@string/id_ok" />
-
-</RelativeLayout>
-
diff --git a/tests/res/layout/viewflipper_layout.xml b/tests/res/layout/viewflipper_layout.xml
deleted file mode 100644
index 6480379..0000000
--- a/tests/res/layout/viewflipper_layout.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:orientation="vertical"
-        android:padding="10dip"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-
-    <ViewFlipper android:id="@+id/viewflipper_test"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:flipInterval="1000"
-                android:layout_marginBottom="20dip" >
-                <TextView android:id="@+id/viewflipper_textview1"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:gravity="center_horizontal"
-                        android:textSize="26sp"
-                        android:visibility="gone"
-                        android:text="@string/hello_world"/>
-                <TextView android:id="@+id/viewflipper_textview2"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:gravity="center_horizontal"
-                        android:textSize="26sp"
-                        android:visibility="gone"
-                        android:text="@string/hello_android"/>
-    </ViewFlipper>
-</LinearLayout>
-
diff --git a/tests/res/layout/viewgroup_margin_layout.xml b/tests/res/layout/viewgroup_margin_layout.xml
deleted file mode 100644
index 8e750c9..0000000
--- a/tests/res/layout/viewgroup_margin_layout.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
- -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:padding="10dip"
-    android:layout_width="200dip"
-    android:layout_height="300dip">
-</LinearLayout>
-
diff --git a/tests/res/layout/viewgrouptest_stub.xml b/tests/res/layout/viewgrouptest_stub.xml
deleted file mode 100644
index ee59126..0000000
--- a/tests/res/layout/viewgrouptest_stub.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
- -->
-
-<android.widget.cts.MockLinearLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:id="@+id/mocklinearlayout">
-
-    <!-- view1 goes on top -->
-    <TextView
-        android:id="@+id/viewgrouptest_stub"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-    />
-
-</android.widget.cts.MockLinearLayout>
-
diff --git a/tests/res/layout/viewstub_layout.xml b/tests/res/layout/viewstub_layout.xml
deleted file mode 100644
index 5c7ff22..0000000
--- a/tests/res/layout/viewstub_layout.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <ViewStub android:id="@+id/viewstub"
-        android:inflatedId="@+id/inflated_id"
-        android:layout="@layout/textview_layout"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/tests/res/layout/viewswitcher_layout.xml b/tests/res/layout/viewswitcher_layout.xml
deleted file mode 100644
index 933dc32..0000000
--- a/tests/res/layout/viewswitcher_layout.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <ViewSwitcher android:id="@+id/viewswitcher_test"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" />
-</LinearLayout>
-
diff --git a/tests/res/layout/viewtreeobserver_layout.xml b/tests/res/layout/viewtreeobserver_layout.xml
deleted file mode 100644
index 66e98b2..0000000
--- a/tests/res/layout/viewtreeobserver_layout.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:id="@+id/linearlayout"
-                android:orientation="vertical"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
-
-    <View android:id="@+id/view1"
-        android:layout_width="match_parent"
-        android:layout_height="10dip"
-        android:focusable="true"/>
-
-    <View android:id="@+id/view2"
-        android:layout_width="match_parent"
-        android:layout_height="10dip"
-        android:focusable="true"/>
-
-    <Button android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="10dip" />
-
-</LinearLayout>
-
diff --git a/tests/res/layout/webview_layout.xml b/tests/res/layout/webview_layout.xml
deleted file mode 100644
index 7a0ed0d..0000000
--- a/tests/res/layout/webview_layout.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-
-    <WebView android:id="@+id/web_page"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-</LinearLayout>
diff --git a/tests/res/layout/windowstub_addlayout.xml b/tests/res/layout/windowstub_addlayout.xml
deleted file mode 100644
index 0d6399e..0000000
--- a/tests/res/layout/windowstub_addlayout.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <TextView android:id="@+id/listview_addwindow"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</ScrollView>
diff --git a/tests/res/layout/windowstub_layout.xml b/tests/res/layout/windowstub_layout.xml
deleted file mode 100644
index 0cf7d6d..0000000
--- a/tests/res/layout/windowstub_layout.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/listview_window"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-     </TextView>
diff --git a/tests/res/layout/windowstub_presentation.xml b/tests/res/layout/windowstub_presentation.xml
deleted file mode 100644
index 80490c4..0000000
--- a/tests/res/layout/windowstub_presentation.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent">
-    <Button
-        android:id="@+id/presentation_button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center"
-        android:layout_weight="1"
-        android:text="@string/vertical_text_1" />
-    <Button
-        android:id="@+id/presentation_button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center"
-        android:layout_weight="1"
-        android:text="@string/vertical_text_2" />
-    <Button
-        android:id="@+id/presentation_button3"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center"
-        android:layout_weight="1"
-        android:text="@string/vertical_text_3" />
-</LinearLayout>
diff --git a/tests/res/layout/xml_test.xml b/tests/res/layout/xml_test.xml
deleted file mode 100644
index 4702281..0000000
--- a/tests/res/layout/xml_test.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-</LinearLayout>
diff --git a/tests/res/layout/zoombutton_layout.xml b/tests/res/layout/zoombutton_layout.xml
deleted file mode 100644
index 1b1e0b2..0000000
--- a/tests/res/layout/zoombutton_layout.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<ZoomButton xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/zoombutton_test"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-/>
-
diff --git a/tests/res/menu/browser.xml b/tests/res/menu/browser.xml
deleted file mode 100644
index 29e5149..0000000
--- a/tests/res/menu/browser.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <group android:id="@+id/MAIN_MENU">
-        <item android:id="@+id/goto_menu_id"
-            android:title="@string/hello_world"
-            android:alphabeticShortcut="l"/>
-    </group>
-
-</menu>
diff --git a/tests/res/menu/category_order.xml b/tests/res/menu/category_order.xml
deleted file mode 100644
index 06a6993..0000000
--- a/tests/res/menu/category_order.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <!-- This group uses the default category. -->
-    <group android:id="@+id/most_used_items">
-
-        <item android:id="@+id/last_most_item"
-            android:orderInCategory="5"
-            android:title="Last most often" />
-
-        <item android:id="@+id/middle_most_item"
-            android:orderInCategory="3"
-            android:title="Middle most often" />
-
-        <item android:id="@+id/first_most_item"
-            android:orderInCategory="1"
-            android:title="First most often" />
-
-    </group>
-
-    <!-- This group uses the secondary category, which is used for less oftenly used items.
-         Notice these items will show up after the above items.
-         (Furthermore, notice how the orders in each category are independent from the other
-         category.) -->
-    <group android:id="@+id/least_used_items"
-        android:menuCategory="secondary">
-
-        <item android:id="@+id/last_least_item"
-            android:orderInCategory="4"
-            android:title="Last least often" />
-
-        <item android:id="@+id/middle_least_item"
-            android:orderInCategory="2"
-            android:title="Middle least often" />
-
-        <item android:id="@+id/first_least_item"
-            android:orderInCategory="0"
-            android:title="First least often" />
-
-    </group>
-
-</menu>
diff --git a/tests/res/menu/checkable.xml b/tests/res/menu/checkable.xml
deleted file mode 100644
index 339d9c9..0000000
--- a/tests/res/menu/checkable.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <!-- Checkable items appear only in submenus or context menus. -->
-
-    <!-- Carefully look at the attribute name checkableBehavior on groups, but
-         the attribute name checkable on items. The checkableBehavior encompasses
-         the number of items that will be checkable within that group. -->
-
-    <item android:title="None">
-        <menu>
-            <!-- The none checkableBehavior is default, but we explicitly show it here. -->
-            <group android:id="@+id/noncheckable_group"
-                    android:checkableBehavior="none">
-                <!-- Notice how these items inherit from the group. -->
-                <item android:id="@+id/noncheckable_item_1"
-                        android:title="Item 1" />
-                <item android:id="@+id/noncheckable_item_2"
-                        android:title="Item 2" />
-                <item android:id="@+id/noncheckable_item_3"
-                        android:title="Item 3" />
-            </group>
-        </menu>
-    </item>
-
-    <item android:title="All">
-        <menu>
-            <group android:id="@+id/checkable_group"
-                    android:checkableBehavior="all">
-                <!-- Notice how these items inherit from the group. -->
-                <item android:id="@+id/checkable_item_1"
-                        android:title="Item 1" />
-                <item android:id="@+id/checkable_item_2"
-                        android:title="Item 2"
-                        android:checked="true" />
-                <item android:id="@+id/checkable_item_3"
-                        android:title="Item 3"
-                        android:checked="true" />
-            </group>
-        </menu>
-    </item>
-
-    <item android:title="Single">
-        <menu>
-            <group android:id="@+id/exclusive_checkable_group"
-                    android:checkableBehavior="single">
-                <!-- Notice how these items inherit from the group. -->
-                <item android:id="@+id/exclusive_checkable_item_1"
-                        android:title="Item 1" />
-                <item android:id="@+id/exclusive_checkable_item_2"
-                        android:title="Item 2" />
-                <item android:id="@+id/exclusive_checkable_item_3"
-                        android:title="Item 3"
-                        android:checked="true" />
-            </group>
-        </menu>
-    </item>
-
-    <item android:title="All without group"
-            android:id="@+id/submenu">
-        <menu>
-            <!-- Notice how these items have each set. -->
-            <item android:id="@+id/nongroup_checkable_item_1"
-                    android:title="Item 1"
-                    android:checkable="true" />
-            <item android:id="@+id/nongroup_checkable_item_2"
-                    android:title="Item 2"
-                    android:checkable="true"
-                    android:checked="true" />
-            <item android:id="@+id/nongroup_checkable_item_3"
-                    android:title="Item 3"
-                    android:checkable="true"
-                    android:checked="true" />
-        </menu>
-    </item>
-
-</menu>
diff --git a/tests/res/menu/menu_searchview.xml b/tests/res/menu/menu_searchview.xml
deleted file mode 100644
index d9f6475..0000000
--- a/tests/res/menu/menu_searchview.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:id="@+id/menu_search"
-        android:title="Search"
-        android:icon="@android:drawable/ic_menu_search"
-        android:showAsAction="ifRoom"
-        android:actionLayout="@layout/searchview" />
-</menu>
\ No newline at end of file
diff --git a/tests/res/menu/title_icon.xml b/tests/res/menu/title_icon.xml
deleted file mode 100644
index d8cdc52..0000000
--- a/tests/res/menu/title_icon.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item android:id="@+id/start"
-        android:title="Start"
-        android:icon="@drawable/start" />
-
-    <item android:id="@+id/pass"
-        android:title="Pass"
-        android:icon="@drawable/pass" />
-
-    <item android:id="@+id/failed"
-        android:title="Failed"
-        android:icon="@drawable/failed" />
-
-</menu>
diff --git a/tests/res/menu/visible_shortcut.xml b/tests/res/menu/visible_shortcut.xml
deleted file mode 100644
index 4d6f362..0000000
--- a/tests/res/menu/visible_shortcut.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item android:id="@+id/visible_item"
-        android:title="Visible"
-        android:alphabeticShortcut="a" />
-
-    <item android:id="@+id/hidden_item"
-        android:title="Hidden"
-        android:visible="false"
-        android:alphabeticShortcut="b" />
-
-    <group android:id="@+id/hidden_group"
-        android:visible="false">
-
-        <item android:id="@+id/hidden_by_group"
-            android:title="Hidden by group"
-            android:alphabeticShortcut="c" />
-
-    </group>
-
-</menu>
diff --git a/tests/res/raw/basetex.png b/tests/res/raw/basetex.png
deleted file mode 100644
index c47a8a5..0000000
--- a/tests/res/raw/basetex.png
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/ddstex.dds b/tests/res/raw/ddstex.dds
deleted file mode 100644
index a865693..0000000
--- a/tests/res/raw/ddstex.dds
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/pvrtex.pvr b/tests/res/raw/pvrtex.pvr
deleted file mode 100644
index c92962d..0000000
--- a/tests/res/raw/pvrtex.pvr
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/samplefont.ttf b/tests/res/raw/samplefont.ttf
deleted file mode 100644
index 49f1c62..0000000
--- a/tests/res/raw/samplefont.ttf
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/scenery.jpg b/tests/res/raw/scenery.jpg
deleted file mode 100644
index 7d1f5e1..0000000
--- a/tests/res/raw/scenery.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/sphere.a3d b/tests/res/raw/sphere.a3d
deleted file mode 100644
index 3d78b01..0000000
--- a/tests/res/raw/sphere.a3d
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/test1.obb b/tests/res/raw/test1.obb
deleted file mode 100644
index a6b3e1c..0000000
--- a/tests/res/raw/test1.obb
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/test1_nosig.obb b/tests/res/raw/test1_nosig.obb
deleted file mode 100644
index 5c3573f..0000000
--- a/tests/res/raw/test1_nosig.obb
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/test1_wrongpackage.obb b/tests/res/raw/test1_wrongpackage.obb
deleted file mode 100644
index d0aafe1..0000000
--- a/tests/res/raw/test1_wrongpackage.obb
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/testimage.jpg b/tests/res/raw/testimage.jpg
deleted file mode 100644
index d3dae03..0000000
--- a/tests/res/raw/testimage.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/testmp3.mp3 b/tests/res/raw/testmp3.mp3
deleted file mode 100755
index 657faf7..0000000
--- a/tests/res/raw/testmp3.mp3
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/testmp3_2.mp3 b/tests/res/raw/testmp3_2.mp3
deleted file mode 100644
index 6a70c69..0000000
--- a/tests/res/raw/testmp3_2.mp3
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/testvideo.3gp b/tests/res/raw/testvideo.3gp
deleted file mode 100644
index 1503272..0000000
--- a/tests/res/raw/testvideo.3gp
+++ /dev/null
Binary files differ
diff --git a/tests/res/raw/text.txt b/tests/res/raw/text.txt
deleted file mode 100755
index 3d8c519..0000000
--- a/tests/res/raw/text.txt
+++ /dev/null
@@ -1 +0,0 @@
-OneTwoThreeFourFiveSixSevenEightNineTen
\ No newline at end of file
diff --git a/tests/res/values/arrays.xml b/tests/res/values/arrays.xml
deleted file mode 100644
index 71e0133..0000000
--- a/tests/res/values/arrays.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<resources>
-    <item type="integer" name="reference" format="integer">101</item>
-
-      <string-array name="strings">
-        <item>zero</item>
-        <item>1</item>
-        <item>@string/reference</item>
-    </string-array>
-
-    <integer-array name="integers">
-        <item>0</item>
-        <item>1</item>
-        <item>@integer/reference</item>
-    </integer-array>
-
-    <array name="difficultyLevel">
-        <item>Easy</item>
-        <item>Medium</item>
-        <item>Hard</item>
-    </array>
-
-    <string-array name="string">
-        <item>Test String 1</item>
-        <item>Test String 2</item>
-        <item>Test String 3</item>
-    </string-array>
-
-    <integer-array name="table_row_layout">
-        <item>1</item>
-        <item>2</item>
-        <item>3</item>
-        <item>4</item>
-        <item>5</item>
-        <item>6</item>
-        <item>7</item>
-        <item>8</item>
-        <item>9</item>
-        <item>10</item>
-    </integer-array>
-</resources>
diff --git a/tests/res/values/attrs.xml b/tests/res/values/attrs.xml
deleted file mode 100644
index 4c3d9db..0000000
--- a/tests/res/values/attrs.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<resources>
-    <declare-styleable name="Style1">
-        <attr name="Type1" format="integer">
-            <enum name="type" value="28" />
-            <enum name="data" value="0xff00ff00" />
-            <enum name="asset_cookie" value="0" />
-            <enum name="resource_id" value="0" />
-            <enum name="changing_config" value="0" />
-        </attr>
-        <attr name="Type2" format="integer">
-            <enum name="type" value="28" />
-            <enum name="data" value="0xff0000ff" />
-            <enum name="asset_cookie" value="0" />
-            <enum name="resource_id" value="0" />
-            <enum name="changing_config" value="0" />
-        </attr>
-    </declare-styleable>
-    <attr name="type1" format="boolean"/>
-    <attr name="type2" format="boolean"/>
-    <attr name="type3" format="color"/>
-    <attr name="type4" format="reference|color"/>
-    <attr name="type5" format="dimension"/>
-    <attr name="type6" format="dimension"/>
-    <attr name="type7" format="dimension"/>
-    <attr name="type8" format="reference"/>
-    <attr name="type9" format="float"/>
-    <attr name="type10" format="fraction"/>
-    <attr name="type11" format="integer"/>
-    <attr name="type12" format="integer"/>
-    <attr name="type13" format="reference|string"/>
-    <attr name="type14" format="string"/>
-    <attr name="type15" format="reference"/>
-    <attr name="type16" format="string"/>
-    <declare-styleable name="style1">
-        <attr name="type1"/>
-        <attr name="type2"/>
-        <attr name="type3"/>
-        <attr name="type4"/>
-        <attr name="type5"/>
-        <attr name="type6"/>
-        <attr name="type7"/>
-        <attr name="type8"/>
-        <attr name="type9"/>
-        <attr name="type10"/>
-        <attr name="type11"/>
-        <attr name="type12"/>
-        <attr name="type13"/>
-        <attr name="type14"/>
-        <attr name="type15"/>
-        <attr name="type16"/>
-    </declare-styleable>
-    <attr name="testEnum">
-        <enum name="val1" value="1" />
-        <enum name="val2" value="2" />
-        <enum name="val10" value="10" />
-    </attr>
-    <attr name="testFlags">
-        <flag name="bit1" value="0x1" />
-        <flag name="bit2" value="0x2" />
-        <flag name="bit31" value="0x40000000" />
-    </attr>
-    <attr name="testString" format="string" />
-    <declare-styleable name="EnumStyle">
-        <attr name="testEnum" />
-    </declare-styleable>
-    <declare-styleable name="FlagStyle">
-        <attr name="testFlags" />
-    </declare-styleable>
-    <declare-styleable name="TestConfig">
-        <attr name="testString" />
-    </declare-styleable>
-    <!-- Size of text. Recommended dimension type for text is "sp" for scaled-pixels (example: 15sp).
-         Supported values include the following:<p/>
-    <ul>
-        <li><b>px</b> Pixels</li>
-        <li><b>sp</b> Scaled pixels (scaled to relative pixel size on screen). See {@link android.util.DisplayMetrics} for more information.</li>
-        <li><b>pt</b> Points</li>
-        <li><b>dip</b> Device independent pixels. See {@link android.util.DisplayMetrics} for more information.</li>
-    </ul>
-    -->
-    <attr name="textSize" format="dimension" />
-    <attr name="typeface">
-        <enum name="normal" value="0" />
-        <enum name="sans" value="1" />
-        <enum name="serif" value="2" />
-        <enum name="monospace" value="3" />
-    </attr>
-    <!-- Default text typeface style. -->
-    <attr name="textStyle">
-        <flag name="normal" value="0" />
-        <flag name="bold" value="1" />
-        <flag name="italic" value="2" />
-    </attr>
-    <!-- Color of text (usually same as colorForeground). -->
-    <attr name="textColor" format="reference|color" />
-    <!-- Color of highlighted text. -->
-    <attr name="textColorHighlight" format="reference|color" />
-    <!-- Color of hint text (displayed when the field is empty). -->
-    <attr name="textColorHint" format="reference|color" />
-    <!-- Color of link text (URLs). -->
-    <attr name="textColorLink" format="reference|color" />
-    <declare-styleable name="TextAppearance">
-        <attr name="textColor"/>
-        <attr name="textSize"/>
-        <attr name="textStyle"/>
-        <attr name="typeface"/>
-        <attr name="textColorHighlight"/>
-        <attr name="textColorHint"/>
-        <attr name="textColorLink"/>
-    </declare-styleable>
-    <!-- Integer used to uniquely identify theme overrides. -->
-    <attr name="themeType" format="integer"/>
-    <!-- Theme reference used to override parent theme. -->
-    <attr name="themeOverrideAttr" format="reference"/>
-
-    <!-- Drawable theming attributes -->
-    <attr name="themeBoolean" />
-    <attr name="themeColor" />
-    <attr name="themeFloat" />
-    <attr name="themeInteger" />
-    <attr name="themeDimension" />
-    <attr name="themeDrawable" />
-    <attr name="themeBitmap" />
-    <attr name="themeNinePatch" />
-    <attr name="themeGravity" />
-    <attr name="themeTileMode" />
-    <attr name="themeAngle" />
-</resources>
diff --git a/tests/res/values/bools.xml b/tests/res/values/bools.xml
deleted file mode 100755
index f119cda..0000000
--- a/tests/res/values/bools.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<resources>
-	<bool name="trueRes">true</bool>
-	<bool name="falseRes">false</bool>
-</resources>
diff --git a/tests/res/values/colors.xml b/tests/res/values/colors.xml
deleted file mode 100644
index f3cc325..0000000
--- a/tests/res/values/colors.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<resources>
-    <drawable name="red">#7f00</drawable>
-    <drawable name="blue">#770000ff</drawable>
-    <drawable name="black">#77ffffff</drawable>
-    <drawable name="yellow">#77ffff00</drawable>
-    <color name="testcolor1">#ff00ff00</color>
-    <color name="testcolor2">#ffff0000</color>
-    <color name="failColor">#ff0000ff</color>
-</resources>
diff --git a/tests/res/values/configVarying.xml b/tests/res/values/configVarying.xml
deleted file mode 100755
index 7b7d576..0000000
--- a/tests/res/values/configVarying.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<resources>
-    <item type="configVarying" name="simple">simple default</item>
-    <bag type="configVarying" name="bag">
-        <item name="testString">bag default</item>
-    </bag>
-    <item type="configVarying" name="small">default</item>
-    <item type="configVarying" name="normal">default</item>
-    <item type="configVarying" name="large">default</item>
-    <item type="configVarying" name="xlarge">default</item>
-    <item type="configVarying" name="sw">default</item>
-    <item type="configVarying" name="w">default</item>
-    <item type="configVarying" name="h">default</item>
-    <item type="configVarying" name="wh">default</item>
-</resources>
diff --git a/tests/res/values/dimens.xml b/tests/res/values/dimens.xml
deleted file mode 100755
index bae216f..0000000
--- a/tests/res/values/dimens.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<resources>
-    <item name="frac100perc" type="dimen" format="fraction">100%</item>
-    <item name="frac1perc" type="dimen" format="fraction">1%</item>
-    <item name="fracp1perc" type="dimen" format="fraction">.1%</item>
-    <item name="fracp01perc" type="dimen" format="fraction">.01%</item>
-    <item name="frac0perc" type="dimen" format="fraction">0%</item>
-    <item name="frac1p1perc" type="dimen" format="fraction">1.1%</item>
-    <item name="frac100p1perc" type="dimen" format="fraction">100.1%</item>
-    <item name="frac25510perc" type="dimen" format="fraction">25510%</item>
-    <item name="frac25610perc" type="dimen" format="fraction">25610%</item>
-    <item name="frac6553510perc" type="dimen" format="fraction">6553510%</item>
-    <item name="frac6553610perc" type="dimen" format="fraction">6553610%</item>
-
-    <item name="frac100pperc" type="dimen" format="fraction">100%p</item>
-    <item name="frac1pperc" type="dimen" format="fraction">1%p</item>
-    <item name="fracp1pperc" type="dimen" format="fraction">.1%p</item>
-    <item name="fracp01pperc" type="dimen" format="fraction">.01%p</item>
-    <item name="frac0pperc" type="dimen" format="fraction">0%p</item>
-    <item name="frac1p1pperc" type="dimen" format="fraction">1.1%p</item>
-    <item name="frac100p1pperc" type="dimen" format="fraction">100.1%p</item>
-    <item name="frac25510pperc" type="dimen" format="fraction">25510%p</item>
-    <item name="frac25610pperc" type="dimen" format="fraction">25610%p</item>
-    <item name="frac6553510pperc" type="dimen" format="fraction">6553510%p</item>
-    <item name="frac6553610pperc" type="dimen" format="fraction">6553610%p</item>
-</resources>
-
diff --git a/tests/res/values/ids.xml b/tests/res/values/ids.xml
deleted file mode 100644
index 30e081b..0000000
--- a/tests/res/values/ids.xml
+++ /dev/null
@@ -1,18 +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.
--->
-
-<resources>
-  <item type="id" name="background" />
-</resources>
diff --git a/tests/res/values/resources_test.xml b/tests/res/values/resources_test.xml
deleted file mode 100644
index 91c2c4a..0000000
--- a/tests/res/values/resources_test.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<resources>
-     <!-- The width that is used when creating thumbnails of applications. -->
-     <dimen name="thumbnail_width">84dp</dimen>
-     <!-- The height that is used when creating thumbnails of applications. -->
-     <dimen name="thumbnail_height">63dp</dimen>
-     <!-- The standard size (both width and height) of an application icon that
-          will be displayed in the app launcher and elsewhere. -->
-     <dimen name="app_icon_size">48px</dimen>
-     <dimen name="toast_y_offset">64dip</dimen>
-     <plurals name="plurals_test">
-        <item quantity="one">A dog</item>
-        <item quantity="other">Some dogs</item>
-      </plurals>
-     <color name="resource_test_color">#003B3B3B</color>
-     <integer name="resource_test_int">10</integer>
-</resources>
diff --git a/tests/res/values/strings.xml b/tests/res/values/strings.xml
deleted file mode 100644
index c167278..0000000
--- a/tests/res/values/strings.xml
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="permlab_testGranted">Test Granted</string>
-    <string name="permdesc_testGranted">Used for running CTS tests, for testing operations
-        where we have the permission.</string>
-    <string name="permlab_testDynamic">Test Dynamic</string>
-    <string name="permdesc_testDynamic">Used for running CTS tests, for testing adding
-        dynamic permissions.</string>
-    <string name="permlab_testDenied">Test Denied</string>
-    <string name="permdesc_testDenied">Used for running CTS tests, for testing operations
-        where we do not have the permission.</string>
-    <string name="explain">1. click start. \n2. if above image shaked, then press pass button,
-         else press failed button.</string>
-    <string name="text_view_hello">Hello! Text view!</string>
-    <string name="text_view_hello_two_lines">Hello! \nText view!</string>
-    <string name="text_view_simple_hint">This is a hint.</string>
-    <string name="text_view_hint">This is a string for testing hint of textview.</string>
-    <string name="activity_forwarding">App/Forwarding</string>
-    <string name="forwarding">$$$</string>
-    <string name="go">Go</string>
-    <string name="back">Back</string>
-    <string name="forward_target">
-        Press back button and notice we don\'t see the previous activity.
-    </string>
-    <string name="edit_text">testing</string>
-    <string name="text">DialogTest</string>
-    <string name="text_country">Country</string>
-    <string name="text_name">Name</string>
-    <string name="hello_world">Hello, World!</string>
-    <string name="hello_android">Hello, Android!</string>
-    <string name="alert_dialog_username">Name:</string>
-    <string name="alert_dialog_password">Password:</string>
-    <string name="alert_dialog_positive">Positive</string>
-    <string name="alert_dialog_negative">Negative</string>
-    <string name="alert_dialog_neutral">Neutral</string>
-    <string name="notify">Notify </string>
-    <string name="tabs_1">testing</string>
-    <string name="table_layout_first">first</string>
-    <string name="table_layout_second">second</string>
-    <string name="table_layout_third">third</string>
-    <string name="table_layout_long">Very long to make the string out of the screen</string>
-    <string name="chronometer_text">Test Chronometer</string>
-    <string name="am">AM</string>
-    <string name="pm">PM</string>
-    <string name="viewgroup_test">ViewGroup test</string>
-    <string name="viewanimator_test">ViewAnimator test</string>
-    <string name="id_ok">OK</string>
-    <string name="id_cancel">Cancel</string>
-    <string name="context_test_string1">This is %s string.</string>
-    <string name="context_test_string2">This is test string.</string>
-    <string name="animationutils_test_instructions">Choose different animations</string>
-    <string name="animationutils_test_alpha">Alpha animation</string>
-    <string name="animationutils_test_scale">Scale animation</string>
-    <string name="animationutils_test_rotate">Rotate animation</string>
-    <string name="animationutils_test_translate">Translate animation</string>
-    <string name="animationutils_test_set">Animation set</string>
-    <string name="animationutils_test_layout">Layout animation</string>
-    <string name="animationutils_test_gridlayout">Grid layout animation</string>
-    <string name="twolinelistitem_test_text1">text1</string>
-    <string name="twolinelistitem_test_text2">text2</string>
-    <string name="metadata_text">metadata text</string>
-    <string name="horizontal_text_1">horizontal 1</string>
-    <string name="horizontal_text_2">horizontal 2</string>
-    <string name="horizontal_text_3">horizontal 3</string>
-    <string name="vertical_text_1">vertical 1</string>
-    <string name="vertical_text_2">vertical 2</string>
-    <string name="vertical_text_3">vertical 3</string>
-    <string name="reference">here</string>
-    <string name="coerceIntegerToString">100</string>
-    <string name="coerceBooleanToString">true</string>
-    <string name="coerceColorToString">#fff</string>
-    <string name="coerceFloatToString">100.0</string>
-    <string name="coerceDimensionToString">100px</string>
-    <string name="coerceFractionToString">100<xliff:g id="percent">%</xliff:g></string>
-    <string name="formattedStringNone">Format[]</string>
-    <string name="formattedStringOne">Format[<xliff:g id="format">%d</xliff:g>]</string>
-    <string name="formattedStringTwo">Format[<xliff:g id="format">%3$d,%2$s</xliff:g>]</string>
-    <string name="checkboxpref_key">checkboxpref_key</string>
-   <string name="checkboxpref_title">title of preference</string>
-   <string name="checkboxpref_summary">summary of preference</string>
-   <string name="checkboxpref_summary_on">summary on of preference</string>
-   <string name="checkboxpref_summary_off">summary off of preference</string>
-   <string name="checkboxpref_depend">checkboxpref_depend</string>
-   <string name="checkboxpref_depend_title"> depend title of preference</string>
-   <string name="checkboxpref_depend_summary"> depend summary of preference</string>
-   <string name="edittextpref_key">edittextpref_key</string>
-   <string name="edittextpref_default_value">default value of preference</string>
-   <string name="edittextpref_title">title of edit text preference</string>
-   <string name="edittextpref_summary">summary of edit text preference</string>
-   <string name="edittextpref_dialog_title">dialog title of edit text preference</string>
-   <string name="edittextpref_text">text of  edit text preference</string>
-   <string name="listpref_key">listpref_key</string>
-   <string name="listpref_title">title of list preference</string>
-   <string name="listpref_summary">summary of list preference</string>
-   <string name="listpref_dialogtitle">dialog title of list preference</string>
-   <string name="easy">Easy</string>
-   <string name="medium">Medium</string>
-   <string name="hard">Hard</string>
-   <string name="footer_view">Footer view</string>
-   <string name="header_view">Header view</string>
-   <string name="dialogpref_title">title of dialog preference </string>
-   <string name="dialogpref_dialog_title">dialog title of dialog preference </string>
-   <string name="dialogpref_key">dialogpref_key</string>
-   <string name="dialogpref_default_value">default value of dialog preference</string>
-   <string name="dialogpref_summary">summary of dialog preference</string>
-   <string name="dialogpref_message">message of dialog preference</string>
-   <string name="dialogpref_sure">Sure</string>
-   <string name="dialogpref_cancel">Cancel</string>
-   <string name="pref_key">pref_key</string>
-   <string name="pref_title">title of preference</string>
-   <string name="pref_summary">summary of preference</string>
-   <string name="pref_depend_key">pref_depend_key</string>
-   <string name="pref_depend_title"> depend title of preference</string>
-   <string name="pref_depend_summary"> depend summary of preference</string>
-   <string name="android_intent_action_preference">android.intent.action.PREFERENCE</string>
-   <string name="def_pref_key">def_pref_key</string>
-   <string name="def_pref_title">default preference</string>
-   <string name="def_pref_summary">This is default preference of cts</string>
-   <string name="relative_view1">view 1</string>
-   <string name="relative_view2">view 2</string>
-   <string name="relative_view3">view 3</string>
-   <string name="relative_view4">view 4</string>
-   <string name="relative_view5">view 5</string>
-   <string name="relative_view6">view 6</string>
-   <string name="relative_view7">view 7</string>
-   <string name="relative_view8">view 8</string>
-   <string name="relative_view9">view 9</string>
-   <string name="relative_view10">view 10</string>
-   <string name="relative_view11">view 11</string>
-   <string name="relative_view12">view 12</string>
-   <string name="relative_view13">view 13</string>
-   <string name="country">Country:</string>
-   <string name="symbol">Symbol:</string>
-   <string name="country_warning">No such country registered</string>
-   <string name="version_cur">base</string>
-   <string name="version_old">base</string>
-   <string name="version_v3">base</string>
-   <string name="authenticator_label">Android CTS</string>
-   <string name="search_label">Android CTS</string>
-   <string name="tag1">tag 1</string>
-   <string name="tag2">tag 2</string>
-
-   <string name="button">Button</string>
-   <string name="holo_test">Holo Test</string>
-   <string name="holo_generator">Holo Generator</string>
-   <string name="holo_light_test">Holo Light Test</string>
-   <string name="holo_light_generator">Holo Light Generator</string>
-   <string name="reference_image">Reference Image: </string>
-   <string name="generated_image">Generated Image: </string>
-   <string name="themes_prompt">Select a Theme:</string>
-   <string name="sample_text">Sample text goes here. I wanted something creative and whimsical
-but then I just got bored...</string>
-    <string name="long_text">This is a really long string which exceeds the width of the view.
-New devices have a much larger screen which actually enables long strings to be displayed
-with no fading. I have made this string longer to fix this case. If you are correcting this
-text, I would love to see the kind of devices you guys now use! Guys, maybe some devices need longer string!
-I think so, so how about double this string, like copy and paste!
-This is a really long string which exceeds the width of the view.
-New devices have a much larger screen which actually enables long strings to be displayed
-with no fading. I have made this string longer to fix this case. If you are correcting this
-text, I would love to see the kind of devices you guys now use! Guys, maybe some devices need longer string!
-I think so, so how about double this string, like copy and paste! </string>
-    <string name="rectangle200">"M 0,0 l 200,0 l 0, 200 l -200, 0 z"</string>
-</resources>
diff --git a/tests/res/values/styles.xml b/tests/res/values/styles.xml
deleted file mode 100644
index 20c80f8..0000000
--- a/tests/res/values/styles.xml
+++ /dev/null
@@ -1,172 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <style name="Whatever">
-        <item name="type1">true</item>
-        <item name="type2">false</item>
-        <item name="type3">#ff0000ff</item>
-        <item name="type4">#ff00ff00</item>
-        <item name="type5">0.75px</item>
-        <item name="type6">10px</item>
-        <item name="type7">18px</item>
-        <item name="type8">@drawable/pass</item>
-        <item name="type9">3.14</item>
-        <item name="type10">100%</item>
-        <item name="type11">365</item>
-        <item name="type12">86400</item>
-        <item name="type13">@string/hello_android</item>
-        <item name="type14">TypedArray Test!</item>
-        <item name="type15">@array/difficultyLevel</item>
-        <item name="type16">Typed Value!</item>
-    </style>
-
-    <style name="TextViewWithoutColorAndAppearance">
-        <item name="android:textSize">18sp</item>
-    </style>
-
-    <style name="TextViewWithColorButWithOutAppearance">
-        <item name="android:textColor">#ff0000ff</item>
-    </style>
-
-    <style name="TextViewWithColorAndAppearance">
-        <item name="android:textColor">#ff0000ff</item>
-        <item name="android:textAppearance">@style/TextAppearance.WithColor</item>
-    </style>
-
-    <style name="TextViewWithoutColorButWithAppearance">
-        <item name="android:textAppearance">@style/TextAppearance.WithColor</item>
-    </style>
-
-    <style name="TextAppearance" parent="android:TextAppearance">
-    </style>
-
-    <style name="TextAppearance.WithColor">
-        <item name="android:textColor">#ffff0000</item>
-    </style>
-
-    <style name="TextAppearance.All">
-        <item name="android:textColor">@drawable/black</item>
-        <item name="android:textSize">20px</item>
-        <item name="android:textStyle">bold</item>
-        <item name="android:textColorHint">@drawable/red</item>
-        <item name="android:textColorLink">@drawable/blue</item>
-        <item name="android:textColorHighlight">@drawable/yellow</item>
-    </style>
-
-    <style name="TextAppearance.Colors">
-        <item name="android:textColor">@drawable/black</item>
-        <item name="android:textColorHint">@drawable/blue</item>
-        <item name="android:textColorLink">@drawable/yellow</item>
-        <item name="android:textColorHighlight">@drawable/red</item>
-    </style>
-
-    <style name="TextAppearance.NotColors">
-        <item name="android:textSize">17px</item>
-        <item name="android:typeface">sans</item>
-        <item name="android:textStyle">normal</item>
-    </style>
-
-    <style name="TextAppearance.Style">
-        <item name="android:textStyle">normal</item>
-    </style>
-
-    <style name="TestEnum1">
-        <item name="testEnum">val1</item>
-    </style>
-
-    <style name="TestEnum2">
-        <item name="testEnum">val2</item>
-    </style>
-
-    <style name="TestEnum10">
-        <item name="testEnum">val10</item>
-    </style>
-
-    <style name="TestFlag1">
-        <item name="testFlags">bit1</item>
-    </style>
-
-    <style name="TestFlag2">
-        <item name="testFlags">bit2</item>
-    </style>
-
-    <style name="TestFlag31">
-        <item name="testFlags">bit31</item>
-    </style>
-
-    <style name="TestFlag1And2">
-        <item name="testFlags">bit1|bit2</item>
-    </style>
-
-    <style name="TestFlag1And2And31">
-        <item name="testFlags">bit1|bit2|bit31</item>
-    </style>
-
-    <style name="TestEnum1.EmptyInherit" />
-
-    <style name="Theme_AlertDialog">
-        <item name="android:textSize">18sp</item>
-    </style>
-
-    <style name="TestProgressBar">
-        <item name="android:indeterminateOnly">false</item>
-        <item name="android:progressDrawable">?android:drawable/progress_horizontal</item>
-        <item name="android:indeterminateDrawable">?android:drawable/progress_horizontal</item>
-        <item name="android:minHeight">20dip</item>
-        <item name="android:maxHeight">20dip</item>
-        <item name="android:focusable">true</item>
-    </style>
-
-    <style name="Test_Theme">
-        <item name="android:windowNoTitle">true</item>
-        <item name="android:panelColorForeground">#ff000000</item>
-        <item name="android:panelColorBackground">#ffffffff</item>
-    </style>
-
-    <style name="Theme_OverrideOuter">
-        <item name="themeType">1</item>
-    </style>
-
-    <style name="Theme_OverrideInner">
-        <item name="themeType">2</item>
-        <item name="themeOverrideAttr">@style/Theme_OverrideAttr</item>
-    </style>
-
-    <style name="Theme_OverrideAttr">
-        <item name="themeType">3</item>
-    </style>
-    
-    <style name="Theme_ThemedDrawableTest">
-        <item name="themeBoolean">true</item>
-        <item name="themeColor">@android:color/black</item>
-        <item name="themeFloat">1.0</item>
-        <item name="themeAngle">45.0</item>
-        <item name="themeInteger">1</item>
-        <item name="themeDimension">1px</item>
-        <item name="themeDrawable">@drawable/icon_black</item>
-        <item name="themeBitmap">@drawable/icon_black</item>
-        <item name="themeNinePatch">@drawable/ninepatch_0</item>
-        <item name="themeGravity">48</item>
-        <item name="themeTileMode">2</item>
-    </style>
-
-    <style name="Theme_NoSwipeDismiss">
-        <item name="android:windowSwipeToDismiss">false</item>
-    </style>
-
-</resources>
diff --git a/tests/res/xml/alias.xml b/tests/res/xml/alias.xml
deleted file mode 100644
index f88f3dc..0000000
--- a/tests/res/xml/alias.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<alias xmlns:android="http://schemas.android.com/apk/res/android">
-    <intent android:action="android.intent.action.MAIN"
-        android:targetPackage="com.android.cts.stub"
-        android:targetClass="android.app.cts.ChildActivity"
-        android:data="http://www.google.com/">
-    </intent>
-</alias>
-
diff --git a/tests/res/xml/anim_list_correct.xml b/tests/res/xml/anim_list_correct.xml
deleted file mode 100644
index 660aa96..0000000
--- a/tests/res/xml/anim_list_correct.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
-    android:visible="false"
-    android:variablePadding="true"
-    android:oneshot="true" >
-
-    <item android:drawable="@drawable/testimage"
-        android:duration="2000" />
-
-    <item android:duration="1000" >
-        <color android:color="#77ffffff" />
-    </item>
-</animation-list>
-
diff --git a/tests/res/xml/anim_list_missing_item_drawable.xml b/tests/res/xml/anim_list_missing_item_drawable.xml
deleted file mode 100644
index 99052f4..0000000
--- a/tests/res/xml/anim_list_missing_item_drawable.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<animation-list xmlns:android="http://schemas.android.com/apk/res/android" >
-    <item android:duration="2000" />
-</animation-list>
-
diff --git a/tests/res/xml/anim_list_missing_item_duration.xml b/tests/res/xml/anim_list_missing_item_duration.xml
deleted file mode 100644
index e3986c2..0000000
--- a/tests/res/xml/anim_list_missing_item_duration.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<animation-list xmlns:android="http://schemas.android.com/apk/res/android" >
-    <item android:drawable="@drawable/testimage" />
-</animation-list>
-
diff --git a/tests/res/xml/anim_list_missing_list_attrs.xml b/tests/res/xml/anim_list_missing_list_attrs.xml
deleted file mode 100644
index 25d2dfe..0000000
--- a/tests/res/xml/anim_list_missing_list_attrs.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<animation-list xmlns:android="http://schemas.android.com/apk/res/android" >
-    <item android:drawable="@drawable/testimage"
-        android:duration="2000" />
-</animation-list>
-
diff --git a/tests/res/xml/authenticator.xml b/tests/res/xml/authenticator.xml
deleted file mode 100644
index 1e298b13..0000000
--- a/tests/res/xml/authenticator.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/**
- * Copyright (c) 2009, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<!-- The attributes in this XML file provide configuration information -->
-<!-- for the Account Manager. -->
-
-<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
-    android:accountType="android.content.cts.account.type"
-    android:icon="@drawable/ic_cts_selected"
-    android:smallIcon="@drawable/ic_cts_minitab_selected"
-    android:label="@string/authenticator_label"
-/>
\ No newline at end of file
diff --git a/tests/res/xml/base_attributes.xml b/tests/res/xml/base_attributes.xml
deleted file mode 100644
index adb44de..0000000
--- a/tests/res/xml/base_attributes.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<alias xmlns:android="http://schemas.android.com/apk/res/android">
-    <base_attr_pixel>
-        <Attributes xmlns:android="http://schemas.android.com/apk/res/android"
-            android:layout_width="400px"
-            android:layout_height="600px"/>
-    </base_attr_pixel>
-    <base_attr_fillwrap>
-        <Attributes xmlns:android="http://schemas.android.com/apk/res/android"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-    </base_attr_fillwrap>
-    <base_attr_noheight>
-        <Attributes xmlns:android="http://schemas.android.com/apk/res/android"
-            android:layout_width="600px"/>
-    </base_attr_noheight>
-</alias>
diff --git a/tests/res/xml/bitmapdrawable.xml b/tests/res/xml/bitmapdrawable.xml
deleted file mode 100644
index f9001aa..0000000
--- a/tests/res/xml/bitmapdrawable.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<alias xmlns:android="http://schemas.android.com/apk/res/android">
-    <bitmap_allattrs>
-        <bitmap android:src="@drawable/testimage"
-            android:gravity="top|right"
-            android:dither="true"
-            android:antialias="true"
-            android:filter="false"
-            android:tileMode="repeat"/>
-    </bitmap_allattrs>
-
-    <bitmap_partattrs>
-        <bitmap android:src="@drawable/size_48x48"
-            android:gravity="center"
-            android:tileMode="mirror"/>
-    </bitmap_partattrs>
-
-    <bitmap_wrongsrc>
-        <bitmap android:src="@drawable/colorstatelist_test"/>
-    </bitmap_wrongsrc>
-
-    <bitmap_nosrc>
-        <bitmap android:gravity="center"/>
-    </bitmap_nosrc>
-</alias>
diff --git a/tests/res/xml/colors.xml b/tests/res/xml/colors.xml
deleted file mode 100644
index 8c44a66..0000000
--- a/tests/res/xml/colors.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-<resources>
-    <color name="testcolor1">#ff00ff00</color>
-    <color name="testcolor2">#ffff0000</color>
-    <color name="failColor">#ff0000ff</color>
-</resources>
-
diff --git a/tests/res/xml/drawable_test.xml b/tests/res/xml/drawable_test.xml
deleted file mode 100644
index f2a2e5d..0000000
--- a/tests/res/xml/drawable_test.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-
-<drawable xmlns:android="http://schemas.android.com/apk/res/android" android:visible="false">
-</drawable>
-
diff --git a/tests/res/xml/extra.xml b/tests/res/xml/extra.xml
deleted file mode 100755
index b3bffb4..0000000
--- a/tests/res/xml/extra.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<tag xmlns:android="http://schemas.android.com/apk/res/android" android:name="Bruce" android:value="Lee">
-    <extra android:name="google" android:value="android">
-    </extra>
-</tag>
diff --git a/tests/res/xml/input_extras.xml b/tests/res/xml/input_extras.xml
deleted file mode 100644
index ce5eb5e..0000000
--- a/tests/res/xml/input_extras.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
--->
-<input-extras xmlns:android="http://schemas.android.com/apk/res/android">
-    <extra android:name="google" android:value="android"/>
-    <extra android:name="test" android:value="cts"/>
-</input-extras>
-
diff --git a/tests/res/xml/intentfilter.xml b/tests/res/xml/intentfilter.xml
deleted file mode 100644
index 7ed3a53..0000000
--- a/tests/res/xml/intentfilter.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-<intent-filter xmlns="http://schemas.android.com/apk/res/android">
-    <action name="testAction"/>
-    <cat name="testCategory" />
-    <type name="vnd.android.cursor.dir/person"/>
-    <scheme name="testScheme"/>
-    <auth host="testHost" port="80"/>
-    <path name="testPath" literal="test"/>
-    <path name="testPath" prefix="test"/>
-    <path name="testPath" sglob="test"/>
-</intent-filter>
diff --git a/tests/res/xml/layerdrawable.xml b/tests/res/xml/layerdrawable.xml
deleted file mode 100644
index 9bb1268..0000000
--- a/tests/res/xml/layerdrawable.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<alias xmlns:android="http://schemas.android.com/apk/res/android">
-    <layer-list_full>
-        <layer-list>
-            <item><color android:color="#88ffffff">
-                <padding android:left="1px" android:top="2px" android:right="3px"
-                    android:bottom="4px"/>
-            </color></item>
-            <item android:drawable="@drawable/testimage"/>
-            <item>
-                <rotate
-                    android:pivotX="50%" android:pivotY="50%"
-                    android:fromDegrees="0" android:toDegrees="360"
-                    android:drawable="@drawable/testimage"/>
-                <padding android:left="4px" android:top="3px"
-                    android:right="2px" android:bottom="1px" />
-            </item>
-            <bitmap android:src="@drawable/testimage"/>
-            <item android:id="@id/background"
-                android:drawable="@drawable/window_test_drawable" />
-        </layer-list>
-    </layer-list_full>
-    <layer-list_empty>
-        <layer-list>
-            <bitmap android:src="@drawable/testimage"/>
-        </layer-list>
-    </layer-list_empty>
-    <layer-list_exception>
-        <layer-list>
-            <item android:id="@id/background"/>
-        </layer-list>
-    </layer-list_exception>
-</alias>
diff --git a/tests/res/xml/layout.xml b/tests/res/xml/layout.xml
deleted file mode 100644
index 6bcb27d..0000000
--- a/tests/res/xml/layout.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<alias xmlns:android="http://schemas.android.com/apk/res/android">
-    <AbsoluteLayout    android:layout_width="20dip"
-               android:layout_height="30dip"
-               android:layout_x="10dip"
-               android:layout_y="20dip">
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_x="0dip"
-                android:layout_y="0dip"
-                android:text="@string/notify">
-                <requestFocuse/>
-            </TextView>
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_x="0dip"
-                android:layout_y="0dip"
-                android:text="@string/notify"/>
-
-            <View
-                android:id="@+id/fit_windows"
-                android:fitsSystemWindows="true"
-                android:layout_height="wrap_content"/>
-            <include layout="@xml/merge" />
-    </AbsoluteLayout>
-
-</alias>
diff --git a/tests/res/xml/level_list_correct.xml b/tests/res/xml/level_list_correct.xml
deleted file mode 100644
index 241ec16..0000000
--- a/tests/res/xml/level_list_correct.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<level-list xmlns:android="http://schemas.android.com/apk/res/android" >
-    <item android:drawable="@drawable/testimage"
-        android:minLevel="100"
-        android:maxLevel="200" />
-
-    <item android:minLevel="200"
-        android:maxLevel="300" >
-        <color android:color="#77ffffff" />
-    </item>
-</level-list>
-
diff --git a/tests/res/xml/level_list_missing_item_drawable.xml b/tests/res/xml/level_list_missing_item_drawable.xml
deleted file mode 100644
index 506b10f..0000000
--- a/tests/res/xml/level_list_missing_item_drawable.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<level-list xmlns:android="http://schemas.android.com/apk/res/android" >
-    <item android:minLevel="100"
-        android:maxLevel="200"/>
-</level-list>
-
diff --git a/tests/res/xml/level_list_missing_item_minlevel_maxlevel.xml b/tests/res/xml/level_list_missing_item_minlevel_maxlevel.xml
deleted file mode 100644
index f77bfd5..0000000
--- a/tests/res/xml/level_list_missing_item_minlevel_maxlevel.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<level-list xmlns:android="http://schemas.android.com/apk/res/android" >
-    <item android:drawable="@drawable/testimage" />
-</level-list>
-
diff --git a/tests/res/xml/merge.xml b/tests/res/xml/merge.xml
deleted file mode 100644
index 710e904..0000000
--- a/tests/res/xml/merge.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
-   <AbsoluteLayout    android:layout_width="20dip"
-               android:layout_height="30dip"
-               android:layout_x="10dip"
-               android:layout_y="20dip">
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_x="0dip"
-                android:layout_y="0dip"
-                android:text="@string/notify"/>
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_x="0dip"
-                android:layout_y="0dip"
-                android:text="@string/notify"/>
-
-    </AbsoluteLayout>
-
-</merge>
diff --git a/tests/res/xml/metadata.xml b/tests/res/xml/metadata.xml
deleted file mode 100644
index 336b931..0000000
--- a/tests/res/xml/metadata.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<thedata xmlns:android="http://schemas.android.com/apk/res/android"
-    rawText="some raw text"
-    rawColor="#ffffff00"
-    android:color="#f00"
-    android:text="@string/metadata_text"/>
diff --git a/tests/res/xml/method.xml b/tests/res/xml/method.xml
deleted file mode 100644
index 763faa5..0000000
--- a/tests/res/xml/method.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<input-method xmlns:android="http://schemas.android.com/apk/res/android"
-        android:settingsActivity="android.view.inputmethod.cts.InputMethodInfoStub"
-/>
diff --git a/tests/res/xml/scaledrawable.xml b/tests/res/xml/scaledrawable.xml
deleted file mode 100644
index d8d5f73..0000000
--- a/tests/res/xml/scaledrawable.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * 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.
- -->
-<alias xmlns:android="http://schemas.android.com/apk/res/android">
-    <scale_allattrs>
-        <scale
-            android:scaleWidth="0.4"
-            android:scaleHeight="0.3"
-            android:scaleGravity="center"
-            android:drawable="@drawable/testimage">
-            <color android:color="#88ffffff"/>
-            <bitmap android:src="@drawable/size_48x48"/>
-        </scale>
-    </scale_allattrs>
-
-    <scale_nodrawable>
-        <scale
-            android:scaleWidth="0.7"
-            android:scaleHeight="0.3"
-            android:scaleGravity="center"/>
-    </scale_nodrawable>
-</alias>
diff --git a/tests/res/xml/searchable.xml b/tests/res/xml/searchable.xml
deleted file mode 100644
index f526341..0000000
--- a/tests/res/xml/searchable.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<searchable xmlns:android="http://schemas.android.com/apk/res/android"
-    android:label="@string/search_label"
-/>
diff --git a/tests/res/xml/selector_correct.xml b/tests/res/xml/selector_correct.xml
deleted file mode 100644
index 917833f..0000000
--- a/tests/res/xml/selector_correct.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:visible="false"
-    android:variablePadding="true"
-    android:constantSize="true" >
-
-    <item android:state_focused="true"
-        android:state_pressed="false"
-        android:drawable="@drawable/testimage" />
-
-    <item >
-        <color android:color="#77ffffff" />
-    </item>
-</selector>
-
diff --git a/tests/res/xml/selector_missing_item_drawable.xml b/tests/res/xml/selector_missing_item_drawable.xml
deleted file mode 100644
index 35bef42..0000000
--- a/tests/res/xml/selector_missing_item_drawable.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:visible="false"
-    android:variablePadding="true"
-    android:constantSize="true" >
-
-    <item android:state_focused="true"
-        android:state_pressed="false" />
-</selector>
-
diff --git a/tests/res/xml/selector_missing_selector_attrs.xml b/tests/res/xml/selector_missing_selector_attrs.xml
deleted file mode 100644
index 87ccc3c..0000000
--- a/tests/res/xml/selector_missing_selector_attrs.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android" >
-    <item android:drawable="@drawable/testimage"
-        android:state_focused="true"
-        android:state_pressed="false" />
-</selector>
-
diff --git a/tests/res/xml/syncadapter.xml b/tests/res/xml/syncadapter.xml
deleted file mode 100644
index 1c0bb72..0000000
--- a/tests/res/xml/syncadapter.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/**
- * Copyright (c) 2009, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<!-- The attributes in this XML file provide configuration information -->
-<!-- for the SyncAdapter. -->
-
-<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
-    android:contentAuthority="android.content.cts.authority"
-    android:accountType="android.content.cts.account.type"
-/>
diff --git a/tests/res/xml/test_color.xml b/tests/res/xml/test_color.xml
deleted file mode 100644
index 97f7dec..0000000
--- a/tests/res/xml/test_color.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-        android:versionName="testNonResourcesString">
-    <color name="testcolor1">#ff00ff00</color>
-    <color name="testcolor2">#ffff0000</color>
-    <color name="failColor">#ff0000ff</color>
-</resources>
diff --git a/tests/src/android/opengl/cts/CompressedTextureLoader.java b/tests/src/android/opengl/cts/CompressedTextureLoader.java
deleted file mode 100644
index 2cb6910..0000000
--- a/tests/src/android/opengl/cts/CompressedTextureLoader.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android.opengl.cts;
-
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.nio.Buffer;
-import java.nio.ByteOrder;
-import java.util.HashMap;
-
-import com.android.cts.stub.R;
-
-import android.app.Activity;
-import android.content.res.AssetFileDescriptor;
-import android.content.res.Resources;
-import android.os.Bundle;
-import android.util.Log;
-
-import android.opengl.ETC1;
-import android.opengl.ETC1Util;
-import android.opengl.GLES20;
-
-import android.graphics.Bitmap;
-import android.graphics.Bitmap.Config;
-import android.graphics.BitmapFactory;
-
-public class CompressedTextureLoader {
-    private static final String TAG = "CompressedTextureLoader";
-
-    public static final String TEXTURE_UNCOMPRESSED = "UNCOMPRESSED";
-    public static final String TEXTURE_ETC1 = "ETC1";
-    public static final String TEXTURE_S3TC = "S3TC";
-    public static final String TEXTURE_ATC = "ATC";
-    public static final String TEXTURE_PVRTC = "PVRTC";
-
-    public static class Texture {
-        public Texture(int width, int height, int internalformat, ByteBuffer data,
-                       String formatName) {
-            mWidth = width;
-            mHeight = height;
-            mInternalFormat = internalformat;
-            mData = data;
-            mFormatName = formatName;
-        }
-
-        /**
-         * Get the width of the texture in pixels.
-         * @return the width of the texture in pixels.
-         */
-        public int getWidth() { return mWidth; }
-
-        /**
-         * Get the height of the texture in pixels.
-         * @return the width of the texture in pixels.
-         */
-        public int getHeight() { return mHeight; }
-
-        /**
-         * Get the compressed data of the texture.
-         * @return the texture data.
-         */
-        public ByteBuffer getData() { return mData; }
-
-        /**
-         * Get the format of the texture.
-         * @return the internal format.
-         */
-        public int getFormat() { return mInternalFormat; }
-
-        /**
-         * Get the format of the texture.
-         * @return the internal format.
-         */
-        public boolean isSupported() { return isFormatSupported(mFormatName); }
-
-        private int mWidth;
-        private int mHeight;
-        private int mInternalFormat;
-        private ByteBuffer mData;
-        private String mFormatName;
-    }
-
-    /*  .pvr header is described by the following c struct
-        typedef struct PVR_TEXTURE_HEADER_TAG{
-            unsigned int  dwHeaderSize;   // size of the structure
-            unsigned int  dwHeight;    // height of surface to be created
-            unsigned int  dwWidth;    // width of input surface
-            unsigned int  dwMipMapCount;   // number of MIP-map levels requested
-            unsigned int  dwpfFlags;   // pixel format flags
-            unsigned int  dwDataSize;   // Size of the compress data
-            unsigned int  dwBitCount;   // number of bits per pixel
-            unsigned int  dwRBitMask;   // mask for red bit
-            unsigned int  dwGBitMask;   // mask for green bits
-            unsigned int  dwBBitMask;   // mask for blue bits
-            unsigned int  dwAlphaBitMask;   // mask for alpha channel
-            unsigned int  dwPVR;    // should be 'P' 'V' 'R' '!'
-            unsigned int  dwNumSurfs;   //number of slices for volume textures or skyboxes
-        } PVR_TEXTURE_HEADER;
-    */
-    static final int PVR_HEADER_SIZE = 13 * 4;
-    static final int PVR_2BPP = 24;
-    static final int PVR_4BPP = 25;
-    static final int PVR_MAGIC_NUMBER = 559044176;
-
-    static final int GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
-    static final int GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
-    static final int GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
-    static final int GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
-
-    static class PVRHeader {
-        int mHeaderSize;   // size of the structure
-        int mHeight;    // height of surface to be created
-        int mWidth;    // width of input surface
-        int mMipMapCount;   // number of MIP-map levels requested
-        int mpfFlags;   // pixel format flags
-        int mDataSize;   // Size of the compress data
-        int mBitCount;   // number of bits per pixel
-        int mRBitMask;   // mask for red bit
-        int mGBitMask;   // mask for green bits
-        int mBBitMask;   // mask for blue bits
-        int mAlphaBitMask;   // mask for alpha channel
-        int mPVR;    // should be 'P' 'V' 'R' '!'
-        int mNumSurfs;   //number of slices for volume textures or skyboxes
-    }
-
-    protected static PVRHeader readPVRHeader(InputStream is) {
-
-        byte[] headerData = new byte[PVR_HEADER_SIZE];
-        try {
-            is.read(headerData);
-        } catch (Exception e) {
-            throw new RuntimeException("Unable to read data");
-        }
-
-        ByteBuffer headerBuffer = ByteBuffer.allocateDirect(PVR_HEADER_SIZE)
-                .order(ByteOrder.nativeOrder());
-        headerBuffer.put(headerData, 0, PVR_HEADER_SIZE).position(0);
-
-        PVRHeader header = new PVRHeader();
-
-        header.mHeaderSize = headerBuffer.getInt();
-        header.mHeight = headerBuffer.getInt();
-        header.mWidth = headerBuffer.getInt();
-        header.mMipMapCount = headerBuffer.getInt();
-        header.mpfFlags = headerBuffer.getInt();
-        header.mDataSize = headerBuffer.getInt();
-        header.mBitCount = headerBuffer.getInt();
-        header.mRBitMask = headerBuffer.getInt();
-        header.mGBitMask = headerBuffer.getInt();
-        header.mBBitMask = headerBuffer.getInt();
-        header.mAlphaBitMask = headerBuffer.getInt();
-        header.mPVR = headerBuffer.getInt();
-        header.mNumSurfs = headerBuffer.getInt();
-
-        if (header.mHeaderSize != PVR_HEADER_SIZE ||
-            header.mPVR != PVR_MAGIC_NUMBER) {
-            throw new RuntimeException("Invalid header data");
-        }
-
-        return header;
-    }
-
-    public static Texture loadTextureATC(Resources res, int id) {
-        Texture tex = new Texture(0, 0, 0, null, "Stub!");
-        return tex;
-    }
-
-    private static ETC1Util.ETC1Texture compressTexture(Buffer input,
-                                                        int width, int height,
-                                                        int pixelSize, int stride){
-        int encodedImageSize = ETC1.getEncodedDataSize(width, height);
-        ByteBuffer compressedImage = ByteBuffer.allocateDirect(encodedImageSize).
-            order(ByteOrder.nativeOrder());
-        ETC1.encodeImage(input, width, height, pixelSize, stride, compressedImage);
-        return new ETC1Util.ETC1Texture(width, height, compressedImage);
-    }
-
-    public static Texture createFromUncompressedETC1(Bitmap bitmap) {
-        int dataSize = bitmap.getRowBytes() * bitmap.getHeight();
-
-        ByteBuffer dataBuffer;
-        dataBuffer = ByteBuffer.allocateDirect(dataSize).order(ByteOrder.nativeOrder());
-        bitmap.copyPixelsToBuffer(dataBuffer);
-        dataBuffer.position(0);
-
-        int bytesPerPixel = bitmap.getRowBytes() / bitmap.getWidth();
-        ETC1Util.ETC1Texture compressed = compressTexture(dataBuffer,
-                                                          bitmap.getWidth(),
-                                                          bitmap.getHeight(),
-                                                          bytesPerPixel,
-                                                          bitmap.getRowBytes());
-
-        Texture tex = new Texture(compressed.getWidth(), compressed.getHeight(),
-                                  ETC1.ETC1_RGB8_OES, compressed.getData(), TEXTURE_ETC1);
-
-        return tex;
-    }
-
-    private static ByteBuffer read(InputStream is, int dataSize) {
-        ByteBuffer dataBuffer;
-        dataBuffer = ByteBuffer.allocateDirect(dataSize).order(ByteOrder.nativeOrder());
-        byte[] ioBuffer = new byte[4096];
-        for (int i = 0; i < dataSize; ) {
-            int chunkSize = Math.min(ioBuffer.length, dataSize - i);
-            try {
-                is.read(ioBuffer, 0, chunkSize);
-            } catch (Exception e) {
-                throw new RuntimeException("Unable to read data");
-            }
-            dataBuffer.put(ioBuffer, 0, chunkSize);
-            i += chunkSize;
-        }
-        dataBuffer.position(0);
-        return dataBuffer;
-    }
-
-    public static Texture loadTexturePVRTC(Resources res, int id) {
-        InputStream is = null;
-        try {
-            is = res.openRawResource(id);
-        } catch (Exception e) {
-            throw new RuntimeException("Unable to open resource " + id);
-        }
-
-        PVRHeader header = readPVRHeader(is);
-
-        int format = header.mpfFlags & 0xFF;
-        int internalFormat = 0;
-        if (format == PVR_2BPP && header.mAlphaBitMask == 1) {
-            internalFormat = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
-        } else if (format == PVR_2BPP && header.mAlphaBitMask == 0) {
-            internalFormat = GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
-        } else if (format == PVR_4BPP && header.mAlphaBitMask == 1) {
-            internalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
-        } else if (format == PVR_4BPP && header.mAlphaBitMask == 0) {
-            internalFormat = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
-        }
-
-        // only load the first mip level for now
-        int dataSize = (header.mWidth * header.mHeight * header.mBitCount) >> 3;
-        ByteBuffer dataBuffer = read(is, dataSize);
-        Texture tex = new Texture(header.mWidth, header.mHeight,
-                                  internalFormat, dataBuffer,
-                                  TEXTURE_PVRTC);
-        try {
-            is.close();
-        } catch (Exception e) {
-            throw new RuntimeException("Unable to close resource stream " + id);
-        }
-        return tex;
-    }
-
-    /* DDS Header is described by the following structs
-       typedef struct {
-          DWORD           dwSize;
-          DWORD           dwFlags;
-          DWORD           dwHeight;
-          DWORD           dwWidth;
-          DWORD           dwPitchOrLinearSize;
-          DWORD           dwDepth;
-          DWORD           dwMipMapCount;
-          DWORD           dwReserved1[11];
-          DDS_PIXELFORMAT ddspf;
-          DWORD           dwCaps;
-          DWORD           dwCaps2;
-          DWORD           dwCaps3;
-          DWORD           dwCaps4;
-          DWORD           dwReserved2;
-        } DDS_HEADER;
-
-        struct DDS_PIXELFORMAT {
-          DWORD dwSize;
-          DWORD dwFlags;
-          DWORD dwFourCC;
-          DWORD dwRGBBitCount;
-          DWORD dwRBitMask;
-          DWORD dwGBitMask;
-          DWORD dwBBitMask;
-          DWORD dwABitMask;
-        };
-
-        In the file it looks like this
-        DWORD               dwMagic;
-        DDS_HEADER          header;
-        DDS_HEADER_DXT10    header10; // If the DDS_PIXELFORMAT dwFlags is set to DDPF_FOURCC
-                                      // and dwFourCC is DX10
-
-    */
-
-    static final int DDS_HEADER_STRUCT_SIZE = 124;
-    static final int DDS_PIXELFORMAT_STRUCT_SIZE = 32;
-    static final int DDS_HEADER_SIZE = 128;
-    static final int DDS_MAGIC_NUMBER = 0x20534444;
-    static final int DDS_DDPF_FOURCC = 0x4;
-    static final int DDS_DXT1 = 0x31545844;
-    static final int DDS_DXT5 = 0x35545844;
-
-    static final int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
-    static final int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
-    static final int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
-
-    static class DDSHeader {
-        int mMagic;
-        int mSize;
-        int mFlags;
-        int mHeight;
-        int mWidth;
-        int mPitchOrLinearSize;
-        int mDepth;
-        int mMipMapCount;
-        int[] mReserved1;
-        // struct DDS_PIXELFORMAT {
-            int mPixelFormatSize;
-            int mPixelFormatFlags;
-            int mPixelFormatFourCC;
-            int mPixelFormatRGBBitCount;
-            int mPixelFormatRBitMask;
-            int mPixelFormatGBitMask;
-            int mPixelFormatBBitMask;
-            int mPixelFormatABitMask;
-        // };
-        int mCaps;
-        int mCaps2;
-        int mCaps3;
-        int mCaps4;
-        int mReserved2;
-
-        DDSHeader() {
-            mReserved1 = new int[11];
-        }
-    }
-
-    protected static DDSHeader readDDSHeader(InputStream is) {
-
-        byte[] headerData = new byte[DDS_HEADER_SIZE];
-        try {
-            is.read(headerData);
-        } catch (Exception e) {
-            throw new RuntimeException("Unable to read data");
-        }
-
-        ByteBuffer headerBuffer = ByteBuffer.allocateDirect(DDS_HEADER_SIZE)
-                .order(ByteOrder.nativeOrder());
-        headerBuffer.put(headerData, 0, DDS_HEADER_SIZE).position(0);
-
-        DDSHeader header = new DDSHeader();
-
-        header.mMagic = headerBuffer.getInt();
-        header.mSize = headerBuffer.getInt();
-        header.mFlags = headerBuffer.getInt();
-        header.mHeight = headerBuffer.getInt();
-        header.mWidth = headerBuffer.getInt();
-        header.mPitchOrLinearSize = headerBuffer.getInt();
-        header.mDepth = headerBuffer.getInt();
-        header.mMipMapCount = headerBuffer.getInt();
-        for (int i = 0; i < header.mReserved1.length; i ++) {
-            header.mReserved1[i] = headerBuffer.getInt();
-        }
-        // struct DDS_PIXELFORMAT {
-            header.mPixelFormatSize = headerBuffer.getInt();
-            header.mPixelFormatFlags = headerBuffer.getInt();
-            header.mPixelFormatFourCC = headerBuffer.getInt();
-            header.mPixelFormatRGBBitCount = headerBuffer.getInt();
-            header.mPixelFormatRBitMask = headerBuffer.getInt();
-            header.mPixelFormatGBitMask = headerBuffer.getInt();
-            header.mPixelFormatBBitMask = headerBuffer.getInt();
-            header.mPixelFormatABitMask = headerBuffer.getInt();
-        // };
-        header.mCaps = headerBuffer.getInt();
-        header.mCaps2 = headerBuffer.getInt();
-        header.mCaps3 = headerBuffer.getInt();
-        header.mCaps4 = headerBuffer.getInt();
-        header.mReserved2 = headerBuffer.getInt();
-
-        if (header.mSize != DDS_HEADER_STRUCT_SIZE ||
-            header.mPixelFormatSize != DDS_PIXELFORMAT_STRUCT_SIZE ||
-            header.mMagic != DDS_MAGIC_NUMBER) {
-            throw new RuntimeException("Invalid header data");
-        }
-
-        return header;
-    }
-
-    // Very simple loader that only reads in the header and a DXT1 mip level 0
-    public static Texture loadTextureDXT(Resources res, int id) {
-        InputStream is = null;
-        try {
-            is = res.openRawResource(id);
-        } catch (Exception e) {
-            throw new RuntimeException("Unable to open resource " + id);
-        }
-
-        DDSHeader header = readDDSHeader(is);
-
-        if (header.mPixelFormatFlags != DDS_DDPF_FOURCC) {
-            throw new RuntimeException("Unsupported DXT data");
-        }
-
-        int internalFormat = 0;
-        int bpp = 0;
-        switch (header.mPixelFormatFourCC) {
-        case DDS_DXT1:
-            internalFormat = COMPRESSED_RGB_S3TC_DXT1_EXT;
-            bpp = 4;
-            break;
-        case DDS_DXT5:
-            internalFormat = COMPRESSED_RGBA_S3TC_DXT5_EXT;
-            bpp = 8;
-            break;
-        default:
-            throw new RuntimeException("Unsupported DXT data");
-        }
-
-        // only load the first mip level for now
-        int dataSize = (header.mWidth * header.mHeight * bpp) >> 3;
-        if (dataSize != header.mPitchOrLinearSize) {
-            throw new RuntimeException("Expected data and header mismatch");
-        }
-        ByteBuffer dataBuffer = read(is, dataSize);
-
-        Texture tex = new Texture(header.mWidth, header.mHeight, internalFormat,
-                                  dataBuffer, TEXTURE_S3TC);
-        return tex;
-    }
-
-    static HashMap<String, Boolean> sExtensionMap;
-    static HashMap<String, Boolean> sFormatMap;
-
-    private static synchronized void updateSupportedFormats() {
-        if (sExtensionMap != null) {
-            return;
-        }
-
-        sExtensionMap = new HashMap<String, Boolean>();
-        sFormatMap = new HashMap<String, Boolean>();
-        String extensionList = GLES20.glGetString(GLES20.GL_EXTENSIONS);
-
-        for (String extension : extensionList.split(" ")) {
-            sExtensionMap.put(extension, true);
-        }
-
-        // Check ETC1
-        sFormatMap.put(TEXTURE_ETC1, ETC1Util.isETC1Supported());
-        // Check ATC
-        if (sExtensionMap.get("GL_AMD_compressed_ATC_texture") != null ||
-            sExtensionMap.get("GL_ATI_compressed_texture_atitc") != null ||
-            sExtensionMap.get("GL_ATI_texture_compression_atitc") != null) {
-            sFormatMap.put(TEXTURE_ATC, true);
-        }
-        // Check DXT
-        if (sExtensionMap.get("GL_EXT_texture_compression_dxt1") != null ||
-            sExtensionMap.get("GL_EXT_texture_compression_s3tc") != null ||
-            sExtensionMap.get("OES_texture_compression_S3TC") != null) {
-            sFormatMap.put(TEXTURE_S3TC, true);
-        }
-        // Check DXT
-        if (sExtensionMap.get("GL_IMG_texture_compression_pvrtc") != null) {
-            sFormatMap.put(TEXTURE_PVRTC, true);
-        }
-
-        /*Log.i(TAG, "mIsSupportedETC1 " + sFormatMap.get(TEXTURE_ETC1));
-        Log.i(TAG, "mIsSupportedATC " + sFormatMap.get(TEXTURE_ATC));
-        Log.i(TAG, "mIsSupportedDXT " + sFormatMap.get(TEXTURE_S3TC));
-        Log.i(TAG, "mIsSupportedPVRTC " + sFormatMap.get(TEXTURE_PVRTC));*/
-    }
-
-    private static boolean isFormatSupported(String format) {
-        updateSupportedFormats();
-        Boolean supported = sFormatMap.get(format);
-        return supported != null ? supported : false;
-    }
-}
diff --git a/tests/src/android/opengl/cts/CompressedTextureStubActivity.java b/tests/src/android/opengl/cts/CompressedTextureStubActivity.java
deleted file mode 100644
index cfd3129..0000000
--- a/tests/src/android/opengl/cts/CompressedTextureStubActivity.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android.opengl.cts;
-
-import com.android.cts.stub.R;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.content.res.AssetFileDescriptor;
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.Bitmap.Config;
-import android.graphics.BitmapFactory;
-import android.os.Bundle;
-import android.util.Log;
-
-public class CompressedTextureStubActivity extends Activity {
-
-    private static final String TAG = "CompressedTextureStubActivity";
-
-    protected Resources mResources;
-
-    private CompressedTextureSurfaceView mCompressedTextureView = null;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        Bundle extras = getIntent().getExtras();
-        String formatTest = extras.getString("TextureFormat", null);
-
-        Log.i(TAG, "Testing format " + formatTest);
-
-        mResources = getResources();
-
-        CompressedTextureLoader.Texture compressed = null;
-
-        BitmapFactory.Options optionsRGB = new BitmapFactory.Options();
-        optionsRGB.inPreferredConfig = Bitmap.Config.RGB_565;
-        optionsRGB.inScaled = false;
-        Bitmap bitmap = BitmapFactory.decodeResource(mResources, R.raw.basetex, optionsRGB);
-
-        if (formatTest.equals(CompressedTextureLoader.TEXTURE_ETC1)) {
-            compressed = CompressedTextureLoader.createFromUncompressedETC1(bitmap);
-        } else if (formatTest.equals(CompressedTextureLoader.TEXTURE_S3TC)) {
-            compressed = CompressedTextureLoader.loadTextureDXT(mResources, R.raw.ddstex);
-        } else if (formatTest.equals(CompressedTextureLoader.TEXTURE_ATC)) {
-            compressed = CompressedTextureLoader.loadTextureATC(mResources, 0); //stub for now
-        } else if (formatTest.equals(CompressedTextureLoader.TEXTURE_PVRTC)) {
-            compressed = CompressedTextureLoader.loadTexturePVRTC(mResources, R.raw.pvrtex);
-        }
-
-        mCompressedTextureView = new CompressedTextureSurfaceView(this, bitmap, compressed);
-        setContentView(mCompressedTextureView);
-    }
-
-    @Override
-    protected void onResume() {
-        super.onResume();
-        mCompressedTextureView.onResume();
-    }
-
-    public boolean getPassed() throws InterruptedException {
-        return mCompressedTextureView.getTestPassed();
-    }
-}
diff --git a/tests/src/android/opengl/cts/CompressedTextureSurfaceView.java b/tests/src/android/opengl/cts/CompressedTextureSurfaceView.java
deleted file mode 100644
index d0c8ed4..0000000
--- a/tests/src/android/opengl/cts/CompressedTextureSurfaceView.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.opengl.cts;
-
-import java.io.IOException;
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-import com.android.cts.stub.R;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.Bitmap.Config;
-import android.graphics.BitmapFactory;
-import android.graphics.Color;
-import android.graphics.SurfaceTexture;
-import android.opengl.ETC1;
-import android.opengl.ETC1Util;
-import android.opengl.GLES20;
-import android.opengl.GLSurfaceView;
-import android.opengl.GLUtils;
-import android.opengl.Matrix;
-import android.util.Log;
-import android.view.Surface;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-class CompressedTextureSurfaceView extends GLSurfaceView {
-    private static final String TAG = "CompressedTextureSurfaceView";
-    private static final int SLEEP_TIME_MS = 1000;
-
-    CompressedTextureRender mRenderer;
-
-    public CompressedTextureSurfaceView(Context context,
-                                        Bitmap base,
-                                        CompressedTextureLoader.Texture compressed) {
-        super(context);
-
-        setEGLContextClientVersion(2);
-        mRenderer = new CompressedTextureRender(context, base, compressed);
-        setRenderer(mRenderer);
-        setRenderMode(RENDERMODE_WHEN_DIRTY);
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-    }
-
-    public boolean getTestPassed() throws InterruptedException {
-        return mRenderer.getTestPassed();
-    }
-
-    private static class CompressedTextureRender implements GLSurfaceView.Renderer {
-        private static String TAG = "CompressedTextureRender";
-
-        private static final int ALLOWED_DELTA = 25;
-        private static final int FBO_PIXEL_SIZE_BYTES = 4;
-        private static final int FLOAT_SIZE_BYTES = 4;
-        private static final int TRIANGLE_VERTICES_DATA_STRIDE_BYTES = 5 * FLOAT_SIZE_BYTES;
-        private static final int TRIANGLE_VERTICES_DATA_POS_OFFSET = 0;
-        private static final int TRIANGLE_VERTICES_DATA_UV_OFFSET = 3;
-        private final float[] mTriangleVerticesData = {
-            // X, Y, Z, U, V
-            -1.0f, -1.0f, 0, 0.f, 0.f,
-            1.0f, -1.0f, 0, 1.f, 0.f,
-            -1.0f,  1.0f, 0, 0.f, 1.f,
-            1.0f,  1.0f, 0, 1.f, 1.f,
-        };
-
-        private FloatBuffer mTriangleVertices;
-
-        private final String mVertexShader =
-                "uniform mat4 uMVPMatrix;\n" +
-                "attribute vec4 aPosition;\n" +
-                "attribute vec4 aTextureCoord;\n" +
-                "varying vec2 vTextureCoord;\n" +
-                "void main() {\n" +
-                "  gl_Position = uMVPMatrix * aPosition;\n" +
-                "  vTextureCoord = aTextureCoord.xy;\n" +
-                "}\n";
-
-        private final String mFragmentShader =
-                "precision mediump float;\n" +
-                "varying vec2 vTextureCoord;\n" +
-                "uniform sampler2D sTexture;\n" +
-                "void main() {\n" +
-                "  gl_FragColor = texture2D(sTexture, vTextureCoord);\n" +
-                "}\n";
-
-        private float[] mMVPMatrix = new float[16];
-        private float[] mSTMatrix = new float[16];
-
-        private int mProgram;
-        private int mTextureID;
-        private int muMVPMatrixHandle;
-        private int maPositionHandle;
-        private int maTextureHandle;
-        private int msTextureHandle;
-
-        private int mColorTargetID;
-        private int mFrameBufferObjectID;
-
-        private boolean updateSurface = false;
-
-        private boolean mTestPassed;
-        private CountDownLatch mDoneSignal;
-
-        Bitmap mBaseTexture;
-        CompressedTextureLoader.Texture mCompressedTexture;
-
-        int mWidth;
-        int mHeight;
-
-        ByteBuffer mReadBackBuffer;
-
-        boolean getTestPassed() throws InterruptedException {
-            if (!mDoneSignal.await(2000L, TimeUnit.MILLISECONDS)) {
-                throw new IllegalStateException("Coudn't finish drawing frames!");
-            }
-
-            return mTestPassed;
-        }
-
-        public CompressedTextureRender(Context context,
-                                       Bitmap base,
-                                       CompressedTextureLoader.Texture compressed) {
-            mBaseTexture = base;
-            mCompressedTexture = compressed;
-            mTriangleVertices = ByteBuffer.allocateDirect(
-                mTriangleVerticesData.length * FLOAT_SIZE_BYTES)
-                    .order(ByteOrder.nativeOrder()).asFloatBuffer();
-            mTriangleVertices.put(mTriangleVerticesData).position(0);
-
-            Matrix.setIdentityM(mSTMatrix, 0);
-
-            int byteBufferSize = mBaseTexture.getWidth() *
-                                 mBaseTexture.getHeight() *
-                                 FBO_PIXEL_SIZE_BYTES;
-            mReadBackBuffer = ByteBuffer.allocateDirect(byteBufferSize);
-
-            mDoneSignal = new CountDownLatch(1);
-        }
-
-        private void renderQuad(int textureID) {
-            GLES20.glUseProgram(mProgram);
-            checkGlError("glUseProgram");
-
-            GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
-            GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureID);
-
-            mTriangleVertices.position(TRIANGLE_VERTICES_DATA_POS_OFFSET);
-            GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false,
-                TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
-            checkGlError("glVertexAttribPointer maPosition");
-            GLES20.glEnableVertexAttribArray(maPositionHandle);
-            checkGlError("glEnableVertexAttribArray maPositionHandle");
-
-            mTriangleVertices.position(TRIANGLE_VERTICES_DATA_UV_OFFSET);
-            GLES20.glVertexAttribPointer(maTextureHandle, 2, GLES20.GL_FLOAT, false,
-                TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
-            checkGlError("glVertexAttribPointer maTextureHandle");
-            GLES20.glEnableVertexAttribArray(maTextureHandle);
-            checkGlError("glEnableVertexAttribArray maTextureHandle");
-
-            Matrix.setIdentityM(mMVPMatrix, 0);
-            GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mMVPMatrix, 0);
-
-            GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
-            checkGlError("glDrawArrays");
-        }
-
-        private int getUnsignedByte(byte val) {
-            return 0xFF & ((int)val);
-        }
-
-        private boolean comparePixel(int x, int y) {
-            int w = mBaseTexture.getWidth();
-            int sampleStart = (y * w + x) * FBO_PIXEL_SIZE_BYTES;
-
-            int R = getUnsignedByte(mReadBackBuffer.get(sampleStart));
-            int G = getUnsignedByte(mReadBackBuffer.get(sampleStart + 1));
-            int B = getUnsignedByte(mReadBackBuffer.get(sampleStart + 2));
-
-            int original = mBaseTexture.getPixel(x, y);
-
-            int deltaR = Math.abs(R - Color.red(original));
-            int deltaG = Math.abs(G - Color.green(original));
-            int deltaB = Math.abs(B - Color.blue(original));
-
-            if (deltaR <= ALLOWED_DELTA &&
-                deltaG <= ALLOWED_DELTA &&
-                deltaB <= ALLOWED_DELTA) {
-                return true;
-            }
-
-            Log.i("PIXEL DELTA", "R: " + deltaR + " G: " + deltaG + " B: " + deltaB);
-
-            return false;
-        }
-
-        private void comparePixels() {
-            int w = mBaseTexture.getWidth();
-            int h = mBaseTexture.getWidth();
-            int wOver4 = w / 4;
-            int hOver4 = h / 4;
-
-            // Sample 4 points in the image. Test is designed so that
-            // sample areas are low frequency and easy to compare
-            boolean sample1Matches = comparePixel(wOver4, hOver4);
-            boolean sample2Matches = comparePixel(wOver4 * 3, hOver4);
-            boolean sample3Matches = comparePixel(wOver4, hOver4 * 3);
-            boolean sample4Matches = comparePixel(wOver4 * 3, hOver4 * 3);
-
-            mTestPassed = sample1Matches && sample2Matches && sample3Matches && sample4Matches;
-            mDoneSignal.countDown();
-        }
-
-        public void onDrawFrame(GL10 glUnused) {
-            if (mProgram == 0) {
-                return;
-            }
-
-            GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBufferObjectID);
-            GLES20.glViewport(0, 0, mBaseTexture.getWidth(), mBaseTexture.getHeight());
-            GLES20.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
-            renderQuad(mTextureID);
-            GLES20.glReadPixels(0, 0, mBaseTexture.getWidth(), mBaseTexture.getHeight(),
-                                GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, mReadBackBuffer);
-            comparePixels();
-            GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
-
-            GLES20.glViewport(0, 0, mWidth, mHeight);
-            GLES20.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
-            GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
-
-            renderQuad(mColorTargetID);
-
-            GLES20.glFinish();
-        }
-
-        public void onSurfaceChanged(GL10 glUnused, int width, int height) {
-            mWidth = width;
-            mHeight = height;
-        }
-
-        private void setupSamplers() {
-            GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D,
-                    GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
-            GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D,
-                    GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
-            GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
-                    GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
-            GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
-                    GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
-        }
-
-        private void initFBO() {
-            int[] textures = new int[1];
-            GLES20.glGenTextures(1, textures, 0);
-
-            mColorTargetID = textures[0];
-            GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mColorTargetID);
-            checkGlError("glBindTexture mColorTargetID");
-            setupSamplers();
-            GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA,
-                                mBaseTexture.getWidth(), mBaseTexture.getHeight(), 0,
-                                GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
-            checkGlError("glTexImage2D mColorTargetID");
-
-            GLES20.glGenFramebuffers(1, textures, 0);
-            mFrameBufferObjectID = textures[0];
-            GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBufferObjectID);
-
-            GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
-                                          GLES20.GL_TEXTURE_2D, mColorTargetID, 0);
-
-            int status = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);
-            if(status != GLES20.GL_FRAMEBUFFER_COMPLETE) {
-                throw new RuntimeException("Failed to initialize framebuffer object");
-            }
-
-            GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
-        }
-
-        public void onSurfaceCreated(GL10 glUnused, EGLConfig config) {
-            if (mCompressedTexture != null && !mCompressedTexture.isSupported()) {
-                mTestPassed = true;
-                mDoneSignal.countDown();
-                return;
-            }
-
-            initFBO();
-
-            mProgram = createProgram(mVertexShader, mFragmentShader);
-            if (mProgram == 0) {
-                return;
-            }
-            maPositionHandle = GLES20.glGetAttribLocation(mProgram, "aPosition");
-            checkGlError("glGetAttribLocation aPosition");
-            if (maPositionHandle == -1) {
-                throw new RuntimeException("Could not get attrib location for aPosition");
-            }
-            maTextureHandle = GLES20.glGetAttribLocation(mProgram, "aTextureCoord");
-            checkGlError("glGetAttribLocation aTextureCoord");
-            if (maTextureHandle == -1) {
-                throw new RuntimeException("Could not get attrib location for aTextureCoord");
-            }
-
-            muMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uMVPMatrix");
-            checkGlError("glGetUniformLocation uMVPMatrix");
-            if (muMVPMatrixHandle == -1) {
-                throw new RuntimeException("Could not get attrib location for uMVPMatrix");
-            }
-
-            int[] textures = new int[1];
-            GLES20.glGenTextures(1, textures, 0);
-
-            mTextureID = textures[0];
-            GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureID);
-            checkGlError("glBindTexture mTextureID");
-            setupSamplers();
-
-            if (mCompressedTexture == null) {
-                GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, mBaseTexture, 0);
-                checkGlError("texImage2D mBaseTexture");
-            } else {
-                GLES20.glCompressedTexImage2D(GLES20.GL_TEXTURE_2D,
-                                              0,
-                                              mCompressedTexture.getFormat(),
-                                              mCompressedTexture.getWidth(),
-                                              mCompressedTexture.getHeight(),
-                                              0,
-                                              mCompressedTexture.getData().remaining(),
-                                              mCompressedTexture.getData());
-                checkGlError("glCompressedTexImage2D mTextureID");
-            }
-        }
-
-        synchronized public void onFrameAvailable(SurfaceTexture surface) {
-            updateSurface = true;
-        }
-
-        private int loadShader(int shaderType, String source) {
-            int shader = GLES20.glCreateShader(shaderType);
-            if (shader != 0) {
-                GLES20.glShaderSource(shader, source);
-                GLES20.glCompileShader(shader);
-                int[] compiled = new int[1];
-                GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);
-                if (compiled[0] == 0) {
-                    Log.e(TAG, "Could not compile shader " + shaderType + ":");
-                    Log.e(TAG, GLES20.glGetShaderInfoLog(shader));
-                    GLES20.glDeleteShader(shader);
-                    shader = 0;
-                }
-            }
-            return shader;
-        }
-
-        private int createProgram(String vertexSource, String fragmentSource) {
-            int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
-            if (vertexShader == 0) {
-                return 0;
-            }
-            int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
-            if (pixelShader == 0) {
-                return 0;
-            }
-
-            int program = GLES20.glCreateProgram();
-            if (program != 0) {
-                GLES20.glAttachShader(program, vertexShader);
-                checkGlError("glAttachShader");
-                GLES20.glAttachShader(program, pixelShader);
-                checkGlError("glAttachShader");
-                GLES20.glLinkProgram(program);
-                int[] linkStatus = new int[1];
-                GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
-                if (linkStatus[0] != GLES20.GL_TRUE) {
-                    Log.e(TAG, "Could not link program: ");
-                    Log.e(TAG, GLES20.glGetProgramInfoLog(program));
-                    GLES20.glDeleteProgram(program);
-                    program = 0;
-                }
-            }
-            return program;
-        }
-
-        private void checkGlError(String op) {
-            int error;
-            while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
-                Log.e(TAG, op + ": glError " + error);
-                throw new RuntimeException(op + ": glError " + error);
-            }
-        }
-
-    }  // End of class CompressedTextureRender.
-
-}  // End of class CompressedTextureSurfaceView.
diff --git a/tests/src/android/opengl/cts/EglConfigGLSurfaceView.java b/tests/src/android/opengl/cts/EglConfigGLSurfaceView.java
deleted file mode 100644
index 03e8d94..0000000
--- a/tests/src/android/opengl/cts/EglConfigGLSurfaceView.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.opengl.cts;
-
-import android.content.Context;
-import android.opengl.GLES20;
-import android.opengl.GLSurfaceView;
-import android.util.Log;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.egl.EGLDisplay;
-import javax.microedition.khronos.opengles.GL10;
-
-/**
- * {@link GLSurfaceView} that uses the EGL configuration specified. Draws a couple frames of a red
- * triangle and then calls the callback.
- */
-public class EglConfigGLSurfaceView extends GLSurfaceView {
-
-    private static final String TAG = EglConfigGLSurfaceView.class.getName();
-
-    private final int mConfigId;
-
-    private final Runnable mCallback;
-
-    public EglConfigGLSurfaceView(Context context, int configId, int contextClientVersion,
-            Runnable callback) {
-        super(context);
-        mConfigId = configId;
-        mCallback = callback;
-        setEGLConfigChooser(new ConfigChooser());
-        setEGLContextClientVersion(contextClientVersion);
-        setRenderer(contextClientVersion == 1
-                ? new Renderer()
-                : new Renderer20());
-    }
-
-    private class ConfigChooser implements GLSurfaceView.EGLConfigChooser {
-
-        public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
-            int[] attributeList = new int[] {
-                    EGL10.EGL_CONFIG_ID, mConfigId,
-                    EGL10.EGL_NONE
-            };
-
-            EGLConfig[] configs = new EGLConfig[1];
-            if (egl.eglChooseConfig(display, attributeList, configs, 1, new int[] {1})) {
-                // Print out the configuration since we may crash...
-                printConfig(egl, display, configs[0]);
-                return configs[0];
-            } else {
-                throw new IllegalStateException("Could not get EGL config...");
-            }
-        }
-    }
-
-    private class Renderer implements GLSurfaceView.Renderer {
-
-        private int mNumFrames;
-
-        private FloatBuffer mFloatBuffer;
-
-        public void onSurfaceCreated(GL10 gl, EGLConfig config) {
-            float[] triangleVertices = {
-                    0.0f, 1.0f, -1.0f,
-                    -1.0f, -1.0f, -1.0f,
-                    1.0f, -1.0f, -1.0f
-            };
-
-            ByteBuffer byteBuffer = ByteBuffer.allocateDirect(triangleVertices.length * 4);
-            byteBuffer.order(ByteOrder.nativeOrder());
-
-            mFloatBuffer = ByteBuffer.allocateDirect(triangleVertices.length * 4)
-                    .order(ByteOrder.nativeOrder())
-                    .asFloatBuffer();
-            mFloatBuffer.put(triangleVertices).position(0);
-
-            gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
-        }
-
-        public void onDrawFrame(GL10 gl) {
-            gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
-            gl.glColor4f(1.0f, 0, 0, 0);
-            gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mFloatBuffer);
-            gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 9);
-
-            if (++mNumFrames == 10) {
-                post(mCallback);
-            }
-        }
-
-        public void onSurfaceChanged(GL10 gl, int width, int height) {
-            gl.glViewport(0, 0, width, height);
-        }
-    }
-
-    private class Renderer20 implements GLSurfaceView.Renderer {
-
-        private FloatBuffer mFloatBuffer;
-
-        private final String mVertexShader =
-            "attribute vec4 aPosition;\n" +
-            "void main() {\n" +
-            "  gl_Position = aPosition;\n" +
-            "}\n";
-
-        private final String mFragmentShader =
-            "void main() {\n" +
-            "  gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);\n" +
-            "}\n";
-
-        private int mProgram;
-
-        private int maPositionHandle;
-
-        private int mNumFrames;
-
-        public void onSurfaceCreated(GL10 gl, EGLConfig config) {
-            mProgram = createProgram(mVertexShader, mFragmentShader);
-            if (mProgram == 0) {
-                throw new RuntimeException("Could not create program");
-            }
-
-            maPositionHandle = GLES20.glGetAttribLocation(mProgram, "aPosition");
-            checkGlError("glGetAttribLocation aPosition");
-            if (maPositionHandle == -1) {
-                throw new RuntimeException("Could not get attrib location for aPosition");
-            }
-
-            float[] triangleVertices = {
-                    0.0f, 1.0f, 0.0f,
-                    -1.0f, -1.0f, 0.0f,
-                    1.0f, -1.0f, 0.0f
-            };
-
-            mFloatBuffer = ByteBuffer.allocateDirect(triangleVertices.length * 4)
-                    .order(ByteOrder.nativeOrder())
-                    .asFloatBuffer();
-            mFloatBuffer.put(triangleVertices).position(0);
-        }
-
-        private int createProgram(String vertexSource, String fragmentSource) {
-            int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
-            if (vertexShader == 0) {
-                return 0;
-            }
-
-            int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
-            if (pixelShader == 0) {
-                return 0;
-            }
-
-            int program = GLES20.glCreateProgram();
-            if (program != 0) {
-                GLES20.glAttachShader(program, vertexShader);
-                checkGlError("glAttachShader");
-                GLES20.glAttachShader(program, pixelShader);
-                checkGlError("glAttachShader");
-                GLES20.glLinkProgram(program);
-                int[] linkStatus = new int[1];
-                GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
-                if (linkStatus[0] != GLES20.GL_TRUE) {
-                    Log.e(TAG, "Could not link program: ");
-                    Log.e(TAG, GLES20.glGetProgramInfoLog(program));
-                    GLES20.glDeleteProgram(program);
-                    program = 0;
-                }
-            }
-            return program;
-        }
-
-        private int loadShader(int shaderType, String source) {
-            int shader = GLES20.glCreateShader(shaderType);
-            if (shader != 0) {
-                GLES20.glShaderSource(shader, source);
-                GLES20.glCompileShader(shader);
-                int[] compiled = new int[1];
-                GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);
-                if (compiled[0] == 0) {
-                    Log.e(TAG, "Could not compile shader " + shaderType + ":");
-                    Log.e(TAG, GLES20.glGetShaderInfoLog(shader));
-                    GLES20.glDeleteShader(shader);
-                    shader = 0;
-                }
-            }
-            return shader;
-        }
-
-        private void checkGlError(String op) {
-            int error;
-            while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
-                Log.e(TAG, op + ": glError " + error);
-                throw new RuntimeException(op + ": glError " + error);
-            }
-        }
-
-        @Override
-        public void onDrawFrame(GL10 gl) {
-            GLES20.glClearColor(0, 0, 0, 1);
-            GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
-            GLES20.glUseProgram(mProgram);
-
-            GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false,
-                    0, mFloatBuffer);
-            checkGlError("glVertexAttribPointer maPosition");
-
-            GLES20.glEnableVertexAttribArray(maPositionHandle);
-            checkGlError("glEnableVertexAttribArray maPositionHandle");
-
-            GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 3);
-            checkGlError("glDrawArrays");
-
-            if (++mNumFrames == 10) {
-                post(mCallback);
-            }
-        }
-
-        public void onSurfaceChanged(GL10 gl, int width, int height) {
-            GLES20.glViewport(0, 0, width, height);
-        }
-    }
-
-    /** Ripped from the NDK sample GL2JNIView class. */
-    private static void printConfig(EGL10 egl, EGLDisplay display,
-            EGLConfig config) {
-        int[] attributes = {
-                EGL10.EGL_BUFFER_SIZE,
-                EGL10.EGL_ALPHA_SIZE,
-                EGL10.EGL_BLUE_SIZE,
-                EGL10.EGL_GREEN_SIZE,
-                EGL10.EGL_RED_SIZE,
-                EGL10.EGL_DEPTH_SIZE,
-                EGL10.EGL_STENCIL_SIZE,
-                EGL10.EGL_CONFIG_CAVEAT,
-                EGL10.EGL_CONFIG_ID,
-                EGL10.EGL_LEVEL,
-                EGL10.EGL_MAX_PBUFFER_HEIGHT,
-                EGL10.EGL_MAX_PBUFFER_PIXELS,
-                EGL10.EGL_MAX_PBUFFER_WIDTH,
-                EGL10.EGL_NATIVE_RENDERABLE,
-                EGL10.EGL_NATIVE_VISUAL_ID,
-                EGL10.EGL_NATIVE_VISUAL_TYPE,
-                0x3030, // EGL10.EGL_PRESERVED_RESOURCES,
-                EGL10.EGL_SAMPLES,
-                EGL10.EGL_SAMPLE_BUFFERS,
-                EGL10.EGL_SURFACE_TYPE,
-                EGL10.EGL_TRANSPARENT_TYPE,
-                EGL10.EGL_TRANSPARENT_RED_VALUE,
-                EGL10.EGL_TRANSPARENT_GREEN_VALUE,
-                EGL10.EGL_TRANSPARENT_BLUE_VALUE,
-                0x3039, // EGL10.EGL_BIND_TO_TEXTURE_RGB,
-                0x303A, // EGL10.EGL_BIND_TO_TEXTURE_RGBA,
-                0x303B, // EGL10.EGL_MIN_SWAP_INTERVAL,
-                0x303C, // EGL10.EGL_MAX_SWAP_INTERVAL,
-                EGL10.EGL_LUMINANCE_SIZE,
-                EGL10.EGL_ALPHA_MASK_SIZE,
-                EGL10.EGL_COLOR_BUFFER_TYPE,
-                EGL10.EGL_RENDERABLE_TYPE,
-                0x3042 // EGL10.EGL_CONFORMANT
-        };
-        String[] names = {
-                "EGL_BUFFER_SIZE",
-                "EGL_ALPHA_SIZE",
-                "EGL_BLUE_SIZE",
-                "EGL_GREEN_SIZE",
-                "EGL_RED_SIZE",
-                "EGL_DEPTH_SIZE",
-                "EGL_STENCIL_SIZE",
-                "EGL_CONFIG_CAVEAT",
-                "EGL_CONFIG_ID",
-                "EGL_LEVEL",
-                "EGL_MAX_PBUFFER_HEIGHT",
-                "EGL_MAX_PBUFFER_PIXELS",
-                "EGL_MAX_PBUFFER_WIDTH",
-                "EGL_NATIVE_RENDERABLE",
-                "EGL_NATIVE_VISUAL_ID",
-                "EGL_NATIVE_VISUAL_TYPE",
-                "EGL_PRESERVED_RESOURCES",
-                "EGL_SAMPLES",
-                "EGL_SAMPLE_BUFFERS",
-                "EGL_SURFACE_TYPE",
-                "EGL_TRANSPARENT_TYPE",
-                "EGL_TRANSPARENT_RED_VALUE",
-                "EGL_TRANSPARENT_GREEN_VALUE",
-                "EGL_TRANSPARENT_BLUE_VALUE",
-                "EGL_BIND_TO_TEXTURE_RGB",
-                "EGL_BIND_TO_TEXTURE_RGBA",
-                "EGL_MIN_SWAP_INTERVAL",
-                "EGL_MAX_SWAP_INTERVAL",
-                "EGL_LUMINANCE_SIZE",
-                "EGL_ALPHA_MASK_SIZE",
-                "EGL_COLOR_BUFFER_TYPE",
-                "EGL_RENDERABLE_TYPE",
-                "EGL_CONFORMANT"
-        };
-        int[] value = new int[1];
-        for (int i = 0; i < attributes.length; i++) {
-            int attribute = attributes[i];
-            String name = names[i];
-            if (egl.eglGetConfigAttrib(display, config, attribute, value)) {
-                Log.w(TAG, String.format("  %s: %d\n", name, value[0]));
-            } else {
-                // Log.w(TAG, String.format("  %s: failed\n", name));
-                while (egl.eglGetError() != EGL10.EGL_SUCCESS);
-            }
-        }
-    }
-}
diff --git a/tests/src/android/opengl/cts/EglConfigStubActivity.java b/tests/src/android/opengl/cts/EglConfigStubActivity.java
deleted file mode 100644
index 749679a..0000000
--- a/tests/src/android/opengl/cts/EglConfigStubActivity.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.opengl.cts;
-
-import android.app.Activity;
-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;
-
-/**
- * {@link Activity} with a {@link GLSurfaceView} that chooses a specific configuration.
- */
-public class EglConfigStubActivity extends Activity {
-
-    public static final String CONFIG_ID_EXTRA = "eglConfigId";
-
-    public static final String CONTEXT_CLIENT_VERSION_EXTRA = "eglContextClientVersion";
-
-    private EglConfigGLSurfaceView mView;
-
-    private CountDownLatch mFinishedDrawing;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        int configId = getConfigId();
-        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
-            public void run() {
-                mFinishedDrawing.countDown();
-            }
-        });
-        setContentView(mView);
-    }
-
-    private int getConfigId() {
-        Intent intent = getIntent();
-        if (intent != null) {
-            return intent.getIntExtra(CONFIG_ID_EXTRA, 0);
-        } else {
-            return 0;
-        }
-    }
-
-    private int getContextClientVersion() {
-        Intent intent = getIntent();
-        if (intent != null) {
-            return intent.getIntExtra(CONTEXT_CLIENT_VERSION_EXTRA, 0);
-        } else {
-            return 0;
-        }
-    }
-
-    @Override
-    protected void onResume() {
-        super.onResume();
-        mView.onResume();
-    }
-
-    @Override
-    protected void onPause() {
-        super.onPause();
-        mView.onPause();
-    }
-
-    public void waitToFinishDrawing() throws InterruptedException {
-        if (!mFinishedDrawing.await(3, TimeUnit.SECONDS)) {
-            throw new IllegalStateException("Coudn't finish drawing frames!");
-        }
-    }
-}
diff --git a/tests/src/android/opengl/cts/GLSurfaceViewStubActivity.java b/tests/src/android/opengl/cts/GLSurfaceViewStubActivity.java
deleted file mode 100644
index 85ad172..0000000
--- a/tests/src/android/opengl/cts/GLSurfaceViewStubActivity.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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.opengl.cts;
-
-import android.app.Activity;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-import android.view.Window;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-/**
- * A minimal activity for testing {@link android.opengl.GLSurfaceView}.
- * Also accepts non-blank renderers to allow its use for more complex tests.
- */
-public class GLSurfaceViewStubActivity extends Activity {
-
-    private static class Renderer implements GLSurfaceView.Renderer {
-
-        public void onDrawFrame(GL10 gl) {
-            // Do nothing.
-        }
-
-        public void onSurfaceChanged(GL10 gl, int width, int height) {
-            // Do nothing.
-        }
-
-        public void onSurfaceCreated(GL10 gl, EGLConfig config) {
-            // Do nothing.
-        }
-    }
-
-    private GLSurfaceView mView;
-
-    /** To override the blank renderer, or other settings, these
-     * static set* methods must be called before onCreate() is called.
-     * If using ActivityInstrumentationTestCase2, that means the set
-     * methods need to be called before calling getActivity in the
-     * test setUp().
-     */
-    private static GLSurfaceView.Renderer mRenderer = null;
-    public static void setRenderer(GLSurfaceView.Renderer renderer) {
-        mRenderer = renderer;
-    }
-    public static void resetRenderer() {
-        mRenderer = null;
-    }
-
-    private static int mRenderMode = 0;
-    private static boolean mRenderModeSet = false;
-    public static void setRenderMode(int renderMode) {
-        mRenderModeSet = true;
-        mRenderMode = renderMode;
-    }
-    public static void resetRenderMode() {
-        mRenderModeSet = false;
-        mRenderMode = 0;
-    }
-
-    private static int mGlVersion = 0;
-    private static boolean mGlVersionSet = false;
-    public static void setGlVersion(int glVersion) {
-        mGlVersionSet = true;
-        mGlVersion = glVersion;
-    }
-    public static void resetGlVersion() {
-        mGlVersionSet = false;
-        mGlVersion = 0;
-    }
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        mView = new GLSurfaceView(this);
-        // Only set this if explicitly asked for
-        if (mGlVersionSet) {
-            mView.setEGLContextClientVersion(mGlVersion);
-        }
-        // Use no-op renderer by default
-        if (mRenderer == null) {
-            mView.setRenderer(new Renderer());
-        } else {
-            mView.setRenderer(mRenderer);
-        }
-        // Only set this if explicitly asked for
-        if (mRenderModeSet) {
-            mView.setRenderMode(mRenderMode);
-        }
-        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
-        setContentView(mView);
-    }
-
-    public GLSurfaceView getView() {
-        return mView;
-    }
-
-    @Override
-    protected void onResume() {
-        super.onResume();
-        mView.onResume();
-    }
-
-    @Override
-    protected void onPause() {
-        super.onPause();
-        mView.onPause();
-    }
-}
diff --git a/tests/src/android/opengl/cts/OpenGlEsVersionStubActivity.java b/tests/src/android/opengl/cts/OpenGlEsVersionStubActivity.java
deleted file mode 100644
index 2b96c5d..0000000
--- a/tests/src/android/opengl/cts/OpenGlEsVersionStubActivity.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * 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.opengl.cts;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.opengl.GLES31;
-import android.opengl.GLES31Ext;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-import android.util.Log;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-/**
- * {@link Activity} that queries the device's display attributes to determine what version of
- * OpenGL ES is supported and returns what the GL version string reports.
- */
-public class OpenGlEsVersionStubActivity extends Activity {
-    private static String TAG = "OpenGlEsVersionStubActivity";
-
-    private static final String EGL_CONTEXT_CLIENT_VERSION = "eglContextClientVersion";
-
-    /** Timeout to wait for the surface to be created and the version queried. */
-    private static final int TIMEOUT_SECONDS = 10;
-
-    /** Version string reported by glGetString. */
-    private String mVersionString;
-
-    /** Extensions string reported by glGetString. */
-    private String mExtensionsString;
-
-    /** Whether GL_ANDROID_extension_pack_es31a is correctly supported. */
-    private boolean mAepEs31Support = false;
-
-    /** Latch that is unlocked when the activity is done finding the version. */
-    private CountDownLatch mSurfaceCreatedLatch = new CountDownLatch(1);
-
-    public static Intent createIntent(int eglContextClientVersion) {
-        Intent intent = new Intent(Intent.ACTION_MAIN);
-        intent.putExtra(EGL_CONTEXT_CLIENT_VERSION, eglContextClientVersion);
-        return intent;
-    }
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        GLSurfaceView view = new GLSurfaceView(this);
-
-        Intent intent = getIntent();
-        int eglContextClientVersion = intent.getIntExtra(EGL_CONTEXT_CLIENT_VERSION, -1);
-        if (eglContextClientVersion > 0) {
-            view.setEGLContextClientVersion(eglContextClientVersion);
-        }
-
-        view.setRenderer(new Renderer());
-        setContentView(view);
-    }
-
-    public String getVersionString() throws InterruptedException {
-        mSurfaceCreatedLatch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
-        synchronized (this) {
-            return mVersionString;
-        }
-    }
-
-    public String getExtensionsString() throws InterruptedException {
-        mSurfaceCreatedLatch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
-        synchronized (this) {
-            return mExtensionsString;
-        }
-    }
-
-    public boolean getAepEs31Support() throws InterruptedException {
-        mSurfaceCreatedLatch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
-        synchronized (this) {
-            return mAepEs31Support;
-        }
-    }
-
-    public static boolean hasExtension(String extensions, String name) {
-        int start = extensions.indexOf(name);
-        while (start >= 0) {
-            // check that we didn't find a prefix of a longer extension name
-            int end = start + name.length();
-            if (end == extensions.length() || extensions.charAt(end) == ' ') {
-                return true;
-            }
-            start = extensions.indexOf(name, end);
-        }
-        return false;
-    }
-
-    private class Renderer implements GLSurfaceView.Renderer {
-        /**
-         * These shaders test at least one feature of each of the underlying extension, to verify
-         * that enabling GL_ANDROID_extension_pack_es31a correctly enables all of them.
-         */
-        private final String mAepEs31VertexShader =
-                "#version 310 es\n" +
-                "#extension GL_ANDROID_extension_pack_es31a : require\n" +
-                "void main() {\n" +
-                "  gl_Position = vec4(1, 0, 0, 1);\n" +
-                "}\n";
-
-        private final String mAepEs31TessellationControlShader =
-                "#version 310 es\n" +
-                "#extension GL_ANDROID_extension_pack_es31a : require\n" +
-                "layout(vertices = 3) out;\n" +  // GL_EXT_tessellation_shader
-                "void main() {\n" +
-                "  gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" +  // GL_EXT_shader_io_blocks
-                "  if (gl_InvocationID == 0) {\n" +
-                "    gl_BoundingBoxEXT[0] = gl_in[0].gl_Position;\n" +  // GL_EXT_primitive_bounding_box
-                "    gl_BoundingBoxEXT[1] = gl_in[1].gl_Position;\n" +
-                "  }\n" +
-                "}\n";
-
-        private final String mAepEs31TessellationEvaluationShader =
-                "#version 310 es\n" +
-                "#extension GL_ANDROID_extension_pack_es31a : require\n" +
-                "layout(triangles, equal_spacing, cw) in;\n" +
-                "void main() {\n" +
-                "  gl_Position = gl_in[0].gl_Position * gl_TessCoord.x +\n" +
-                "      gl_in[1].gl_Position * gl_TessCoord.y +\n" +
-                "      gl_in[2].gl_Position * gl_TessCoord.z;\n" +
-                "}\n";
-
-        private final String mAepEs31GeometryShader =
-                "#version 310 es\n" +
-                "#extension GL_ANDROID_extension_pack_es31a : require\n" +
-                "layout(triangles) in;\n" +  // GL_EXT_geometry_shader
-                "layout(triangle_strip, max_vertices = 3) out;\n" +
-                "sample out vec4 perSampleColor;\n" +
-                "void main() {\n" +
-                "  for (int i = 0; i < gl_in.length(); ++i) {\n" +
-                "    gl_Position = gl_in[i].gl_Position;\n" +
-                "    perSampleColor = gl_in[i].gl_Position;\n" +
-                "    EmitVertex();\n" +
-                "  }\n" +
-                "}\n";
-
-        private final String mAepEs31FragmentShader =
-                "#version 310 es\n" +
-                "#extension GL_ANDROID_extension_pack_es31a : require\n" +
-                "precision mediump float;\n" +
-                "layout(blend_support_all_equations) out;\n" +  // GL_KHR_blend_equation_advanced
-                "sample in vec4 perSampleColor;\n" +  // GL_OES_shader_multisample_interpolation
-                "layout(r32ui) coherent uniform mediump uimage2D image;\n" +
-                "uniform mediump sampler2DMSArray mySamplerMSArray;\n" +  // GL_OES_texture_storage_multisample_2d_array
-                "uniform mediump samplerBuffer mySamplerBuffer;\n" +  // GL_EXT_texture_buffer
-                "uniform mediump samplerCubeArray mySamplerCubeArray;\n" +  // GL_EXT_texture_cube_map_array
-                "out vec4 color;\n" +
-                "void main() {\n" +
-                "  imageAtomicAdd(image, ivec2(1, 1), 1u);\n" +  // GL_OES_shader_image_atomic
-                "  vec4 color = vec4(gl_SamplePosition.x, 0, 0, 1);\n" +  // GL_OES_sample_variables
-                "  vec4 color2 = texelFetch(mySamplerMSArray, ivec3(1, 1, 1), 3);\n" +
-                "  vec4 color3 = texelFetch(mySamplerBuffer, 3);\n" +
-                "  vec4 color4 = texture(mySamplerCubeArray, vec4(1, 1, 1, 1));\n" +
-                "  color = fma(color + color2, color3 + color4, perSampleColor);" +  // GL_EXT_gpu_shader5
-                "}\n";
-
-        public void onSurfaceCreated(GL10 gl, EGLConfig config) {
-            synchronized (OpenGlEsVersionStubActivity.this) {
-                try {
-                    mVersionString = gl.glGetString(GL10.GL_VERSION);
-                    mExtensionsString = gl.glGetString(GL10.GL_EXTENSIONS);
-                    if (hasExtension(mExtensionsString, "ANDROID_extension_pack_es31a"))
-                        mAepEs31Support = checkAepEs31Support();
-                } finally {
-                    mSurfaceCreatedLatch.countDown();
-                }
-            }
-        }
-
-        public void onSurfaceChanged(GL10 gl, int width, int height) {
-        }
-
-        public void onDrawFrame(GL10 gl) {
-        }
-
-        private boolean compileShaderAndAttach(int program, int shaderType, String source) {
-            int shader = GLES31.glCreateShader(shaderType);
-            if (shader == 0) {
-                Log.e(TAG, "Unable to create shaders of type " + shaderType);
-                return false;
-            }
-            GLES31.glShaderSource(shader, source);
-            GLES31.glCompileShader(shader);
-            int[] compiled = new int[1];
-            GLES31.glGetShaderiv(shader, GLES31.GL_COMPILE_STATUS, compiled, 0);
-            if (compiled[0] == 0) {
-                Log.e(TAG, "Unable to compile shader " + shaderType + ":");
-                Log.e(TAG, GLES31.glGetShaderInfoLog(shader));
-                GLES31.glDeleteShader(shader);
-                return false;
-            }
-            GLES31.glAttachShader(program, shader);
-            GLES31.glDeleteShader(shader);
-            return true;
-        }
-
-        private boolean checkAepEs31Support() {
-            final String requiredList[] = {
-                "EXT_copy_image",
-                "EXT_draw_buffers_indexed",
-                "EXT_geometry_shader",
-                "EXT_gpu_shader5",
-                "EXT_primitive_bounding_box",
-                "EXT_shader_io_blocks",
-                "EXT_tessellation_shader",
-                "EXT_texture_border_clamp",
-                "EXT_texture_buffer",
-                "EXT_texture_cube_map_array",
-                "EXT_texture_sRGB_decode",
-                "KHR_blend_equation_advanced",
-                "KHR_debug",
-                "KHR_texture_compression_astc_ldr",
-                "OES_sample_shading",
-                "OES_sample_variables",
-                "OES_shader_image_atomic",
-                "OES_shader_multisample_interpolation",
-                "OES_texture_stencil8",
-                "OES_texture_storage_multisample_2d_array"
-            };
-
-            for (int i = 0; i < requiredList.length; ++i) {
-                if (!hasExtension(mExtensionsString, requiredList[i])) {
-                    Log.e(TAG,"ANDROID_extension_pack_es31a is present but extension " +
-                            requiredList[i] + " is missing");
-                    return false;
-                }
-            }
-
-            int[] value = new int[1];
-            GLES31.glGetIntegerv(GLES31.GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS, value, 0);
-            if (value[0] < 1) {
-                Log.e(TAG, "ANDROID_extension_pack_es31a is present, but the " +
-                        "GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS value is " + value[0] + " < 1");
-                return false;
-            }
-            GLES31.glGetIntegerv(GLES31.GL_MAX_FRAGMENT_ATOMIC_COUNTERS, value, 0);
-            if (value[0] < 8) {
-                Log.e(TAG, "ANDROID_extension_pack_es31a is present, but the " +
-                        "GL_MAX_FRAGMENT_ATOMIC_COUNTERS value is " + value[0] + " < 8");
-                return false;
-            }
-            GLES31.glGetIntegerv(GLES31.GL_MAX_FRAGMENT_IMAGE_UNIFORMS, value, 0);
-            if (value[0] < 4) {
-                Log.e(TAG, "ANDROID_extension_pack_es31a is present, but the " +
-                        "GL_MAX_FRAGMENT_IMAGE_UNIFORMS value is " + value[0] + " < 4");
-                return false;
-            }
-            GLES31.glGetIntegerv(GLES31.GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS, value, 0);
-            if (value[0] < 4) {
-                Log.e(TAG, "ANDROID_extension_pack_es31a is present, but the " +
-                        "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS value is " + value[0] + " < 4");
-                return false;
-            }
-
-            int program = GLES31.glCreateProgram();
-            try {
-                if (!compileShaderAndAttach(program, GLES31.GL_VERTEX_SHADER, mAepEs31VertexShader) ||
-                    !compileShaderAndAttach(program, GLES31Ext.GL_TESS_CONTROL_SHADER_EXT, mAepEs31TessellationControlShader) ||
-                    !compileShaderAndAttach(program, GLES31Ext.GL_TESS_EVALUATION_SHADER_EXT, mAepEs31TessellationEvaluationShader) ||
-                    !compileShaderAndAttach(program, GLES31Ext.GL_GEOMETRY_SHADER_EXT, mAepEs31GeometryShader) ||
-                    !compileShaderAndAttach(program, GLES31.GL_FRAGMENT_SHADER, mAepEs31FragmentShader))
-                    return false;
-
-                GLES31.glLinkProgram(program);
-                GLES31.glGetProgramiv(program, GLES31.GL_LINK_STATUS, value, 0);
-                if (value[0] == 0) {
-                    Log.e(TAG, "Unable to link program :");
-                    Log.e(TAG, GLES31.glGetProgramInfoLog(program));
-                    return false;
-                }
-            } finally {
-                GLES31.glDeleteProgram(program);
-            }
-            return true;
-        }
-    }
-}
diff --git a/tests/src/android/os/cts/TestThread.java b/tests/src/android/os/cts/TestThread.java
deleted file mode 100644
index 1a28a20..0000000
--- a/tests/src/android/os/cts/TestThread.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android.os.cts;
-
-/**
- * Thread class for executing a Runnable containing assertions in a separate thread.
- * Uncaught exceptions in the Runnable are rethrown in the context of the the thread
- * calling the <code>runTest()</code> method.
- */
-public final class TestThread extends Thread {
-    private Throwable mThrowable;
-    private Runnable mTarget;
-
-    public TestThread(Runnable target) {
-        mTarget = target;
-    }
-
-    @Override
-    public final void run() {
-        try {
-            mTarget.run();
-        } catch (Throwable t) {
-            mThrowable = t;
-        }
-    }
-
-    /**
-     * Run the target Runnable object and wait until the test finish or throw
-     * out Exception if test fail.
-     *
-     * @param runTime
-     * @throws Throwable
-     */
-    public void runTest(long runTime) throws Throwable {
-        start();
-        joinAndCheck(runTime);
-    }
-
-    /**
-     * Get the Throwable object which is thrown when test running
-     * @return  The Throwable object
-     */
-    public Throwable getThrowable() {
-        return mThrowable;
-    }
-
-    /**
-     * Set the Throwable object which is thrown when test running
-     * @param t The Throwable object
-     */
-    public void setThrowable(Throwable t) {
-        mThrowable = t;
-    }
-
-    /**
-     * Wait for the test thread to complete and throw the stored exception if there is one.
-     *
-     * @param runTime The time to wait for the test thread to complete.
-     * @throws Throwable
-     */
-    public void joinAndCheck(long runTime) throws Throwable {
-        this.join(runTime);
-        if (this.isAlive()) {
-            this.interrupt();
-            this.join(runTime);
-            throw new Exception("Thread did not finish within allotted time.");
-        }
-        checkException();
-    }
-
-    /**
-     * Check whether there is an exception when running Runnable object.
-     * @throws Throwable
-     */
-    public void checkException() throws Throwable {
-        if (mThrowable != null) {
-            throw mThrowable;
-        }
-    }
-}
diff --git a/tests/src/android/webkit/cts/WebViewOnUiThread.java b/tests/src/android/webkit/cts/WebViewOnUiThread.java
deleted file mode 100644
index 03059a1..0000000
--- a/tests/src/android/webkit/cts/WebViewOnUiThread.java
+++ /dev/null
@@ -1,998 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.webkit.cts;
-
-import android.cts.util.PollingCheck;
-import android.graphics.Bitmap;
-import android.graphics.Picture;
-import android.graphics.Rect;
-import android.os.Bundle;
-import android.os.Looper;
-import android.os.Message;
-import android.os.SystemClock;
-import android.print.PrintDocumentAdapter;
-import android.test.InstrumentationTestCase;
-import android.util.DisplayMetrics;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewParent;
-import android.webkit.DownloadListener;
-import android.webkit.CookieManager;
-import android.webkit.ValueCallback;
-import android.webkit.WebBackForwardList;
-import android.webkit.WebChromeClient;
-import android.webkit.WebSettings;
-import android.webkit.WebView.HitTestResult;
-import android.webkit.WebView.PictureListener;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import junit.framework.Assert;
-
-import java.io.File;
-import java.util.concurrent.Callable;
-import java.util.Map;
-
-/**
- * Many tests need to run WebView code in the UI thread. This class
- * wraps a WebView so that calls are ensured to arrive on the UI thread.
- *
- * All methods may be run on either the UI thread or test thread.
- */
-public class WebViewOnUiThread {
-    /**
-     * The maximum time, in milliseconds (10 seconds) to wait for a load
-     * to be triggered.
-     */
-    private static final long LOAD_TIMEOUT = 10000;
-
-    /**
-     * Set to true after onPageFinished is called.
-     */
-    private boolean mLoaded;
-
-    /**
-     * Set to true after onNewPicture is called. Reset when onPageStarted
-     * is called.
-     */
-    private boolean mNewPicture;
-
-    /**
-     * The progress, in percentage, of the page load. Valid values are between
-     * 0 and 100.
-     */
-    private int mProgress;
-
-    /**
-     * The test that this class is being used in. Used for runTestOnUiThread.
-     */
-    private InstrumentationTestCase mTest;
-
-    /**
-     * The WebView that calls will be made on.
-     */
-    private WebView mWebView;
-
-    /**
-     * Initializes the webView with a WebViewClient, WebChromeClient,
-     * and PictureListener to prepare for loadUrlAndWaitForCompletion.
-     *
-     * A new WebViewOnUiThread should be called during setUp so as to
-     * reinitialize between calls.
-     *
-     * @param test The test in which this is being run.
-     * @param webView The webView that the methods should call.
-     * @see loadUrlAndWaitForCompletion
-     */
-    public WebViewOnUiThread(InstrumentationTestCase test, WebView webView) {
-        mTest = test;
-        mWebView = webView;
-        final WebViewClient webViewClient = new WaitForLoadedClient(this);
-        final WebChromeClient webChromeClient = new WaitForProgressClient(this);
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.setWebViewClient(webViewClient);
-                mWebView.setWebChromeClient(webChromeClient);
-                mWebView.setPictureListener(new WaitForNewPicture());
-            }
-        });
-    }
-
-    /**
-     * Called after a test is complete and the WebView should be disengaged from
-     * the tests.
-     */
-    public void cleanUp() {
-        clearHistory();
-        clearCache(true);
-        setPictureListener(null);
-        setWebChromeClient(null);
-        setWebViewClient(null);
-    }
-
-    /**
-     * Called from WaitForNewPicture, this is used to indicate that
-     * the page has been drawn.
-     */
-    synchronized public void onNewPicture() {
-        mNewPicture = true;
-        this.notifyAll();
-    }
-
-    /**
-     * Called from WaitForLoadedClient, this is used to clear the picture
-     * draw state so that draws before the URL begins loading don't count.
-     */
-    synchronized public void onPageStarted() {
-        mNewPicture = false; // Earlier paints won't count.
-    }
-
-    /**
-     * Called from WaitForLoadedClient, this is used to indicate that
-     * the page is loaded, but not drawn yet.
-     */
-    synchronized public void onPageFinished() {
-        mLoaded = true;
-        this.notifyAll();
-    }
-
-    /**
-     * Called from the WebChrome client, this sets the current progress
-     * for a page.
-     * @param progress The progress made so far between 0 and 100.
-     */
-    synchronized public void onProgressChanged(int progress) {
-        mProgress = progress;
-        this.notifyAll();
-    }
-
-    public void setWebViewClient(final WebViewClient webViewClient) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.setWebViewClient(webViewClient);
-            }
-        });
-    }
-
-    public void setWebChromeClient(final WebChromeClient webChromeClient) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.setWebChromeClient(webChromeClient);
-            }
-        });
-    }
-
-    public void setPictureListener(final PictureListener pictureListener) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.setPictureListener(pictureListener);
-            }
-        });
-    }
-
-    public void setNetworkAvailable(final boolean available) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.setNetworkAvailable(available);
-            }
-        });
-    }
-
-    public void setDownloadListener(final DownloadListener listener) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.setDownloadListener(listener);
-            }
-        });
-    }
-
-    public void setBackgroundColor(final int color) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.setBackgroundColor(color);
-            }
-        });
-    }
-
-    public void clearCache(final boolean includeDiskFiles) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.clearCache(includeDiskFiles);
-            }
-        });
-    }
-
-    public void clearHistory() {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.clearHistory();
-            }
-        });
-    }
-
-    public void requestFocus() {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.requestFocus();
-            }
-        });
-    }
-
-    public boolean canZoomIn() {
-        return getValue(new ValueGetter<Boolean>() {
-            @Override
-            public Boolean capture() {
-                return mWebView.canZoomIn();
-            }
-        });
-    }
-
-    public boolean canZoomOut() {
-        return getValue(new ValueGetter<Boolean>() {
-            @Override
-            public Boolean capture() {
-                return mWebView.canZoomOut();
-            }
-        });
-    }
-
-    public boolean zoomIn() {
-        return getValue(new ValueGetter<Boolean>() {
-            @Override
-            public Boolean capture() {
-                return mWebView.zoomIn();
-            }
-        });
-    }
-
-    public boolean zoomOut() {
-        return getValue(new ValueGetter<Boolean>() {
-            @Override
-            public Boolean capture() {
-                return mWebView.zoomOut();
-            }
-        });
-    }
-
-    public void zoomBy(final float zoomFactor) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.zoomBy(zoomFactor);
-            }
-        });
-    }
-
-    public void setFindListener(final WebView.FindListener listener) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.setFindListener(listener);
-            }
-        });
-    }
-
-    public void removeJavascriptInterface(final String interfaceName) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.removeJavascriptInterface(interfaceName);
-            }
-        });
-    }
-
-    public void addJavascriptInterface(final Object object, final String name) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.addJavascriptInterface(object, name);
-            }
-        });
-    }
-
-    public void flingScroll(final int vx, final int vy) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.flingScroll(vx, vy);
-            }
-        });
-    }
-
-    public void requestFocusNodeHref(final Message hrefMsg) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.requestFocusNodeHref(hrefMsg);
-            }
-        });
-    }
-
-    public void requestImageRef(final Message msg) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.requestImageRef(msg);
-            }
-        });
-    }
-
-    public void setInitialScale(final int scaleInPercent) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.setInitialScale(scaleInPercent);
-            }
-        });
-    }
-
-    public void clearSslPreferences() {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.clearSslPreferences();
-            }
-        });
-    }
-
-    public void clearClientCertPreferences(final Runnable onCleared) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                WebView.clearClientCertPreferences(onCleared);
-            }
-        });
-    }
-
-    public void resumeTimers() {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.resumeTimers();
-            }
-        });
-    }
-
-    public void findNext(final boolean forward) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.findNext(forward);
-            }
-        });
-    }
-
-    public void clearMatches() {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.clearMatches();
-            }
-        });
-    }
-
-    /**
-     * Calls loadUrl on the WebView and then waits onPageFinished,
-     * onNewPicture and onProgressChange to reach 100.
-     * Test fails if the load timeout elapses.
-     * @param url The URL to load.
-     */
-    public void loadUrlAndWaitForCompletion(final String url) {
-        callAndWait(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.loadUrl(url);
-            }
-        });
-    }
-
-    /**
-     * Calls loadUrl on the WebView and then waits onPageFinished,
-     * onNewPicture and onProgressChange to reach 100.
-     * Test fails if the load timeout elapses.
-     * @param url The URL to load.
-     * @param extraHeaders The additional headers to be used in the HTTP request.
-     */
-    public void loadUrlAndWaitForCompletion(final String url,
-            final Map<String, String> extraHeaders) {
-        callAndWait(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.loadUrl(url, extraHeaders);
-            }
-        });
-    }
-
-    public void loadUrl(final String url) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.loadUrl(url);
-            }
-        });
-    }
-
-    public void stopLoading() {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.stopLoading();
-            }
-        });
-    }
-
-    public void postUrlAndWaitForCompletion(final String url, final byte[] postData) {
-        callAndWait(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.postUrl(url, postData);
-            }
-        });
-    }
-
-    public void loadDataAndWaitForCompletion(final String data,
-            final String mimeType, final String encoding) {
-        callAndWait(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.loadData(data, mimeType, encoding);
-            }
-        });
-    }
-
-    public void loadDataWithBaseURLAndWaitForCompletion(final String baseUrl,
-            final String data, final String mimeType, final String encoding,
-            final String historyUrl) {
-        callAndWait(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.loadDataWithBaseURL(baseUrl, data, mimeType, encoding,
-                        historyUrl);
-            }
-        });
-    }
-
-    /**
-     * Reloads a page and waits for it to complete reloading. Use reload
-     * if it is a form resubmission and the onFormResubmission responds
-     * by telling WebView not to resubmit it.
-     */
-    public void reloadAndWaitForCompletion() {
-        callAndWait(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.reload();
-            }
-        });
-    }
-
-    /**
-     * Reload the previous URL. Use reloadAndWaitForCompletion unless
-     * it is a form resubmission and the onFormResubmission responds
-     * by telling WebView not to resubmit it.
-     */
-    public void reload() {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.reload();
-            }
-        });
-    }
-
-    /**
-     * Use this only when JavaScript causes a page load to wait for the
-     * page load to complete. Otherwise use loadUrlAndWaitForCompletion or
-     * similar functions.
-     */
-    public void waitForLoadCompletion() {
-        waitForCriteria(LOAD_TIMEOUT,
-                new Callable<Boolean>() {
-                    @Override
-                    public Boolean call() {
-                        return isLoaded();
-                    }
-                });
-        clearLoad();
-    }
-
-    private void waitForCriteria(long timeout, Callable<Boolean> doneCriteria) {
-        if (isUiThread()) {
-            waitOnUiThread(timeout, doneCriteria);
-        } else {
-            waitOnTestThread(timeout, doneCriteria);
-        }
-    }
-
-    public String getTitle() {
-        return getValue(new ValueGetter<String>() {
-            @Override
-            public String capture() {
-                return mWebView.getTitle();
-            }
-        });
-    }
-
-    public WebSettings getSettings() {
-        return getValue(new ValueGetter<WebSettings>() {
-            @Override
-            public WebSettings capture() {
-                return mWebView.getSettings();
-            }
-        });
-    }
-
-    public WebBackForwardList copyBackForwardList() {
-        return getValue(new ValueGetter<WebBackForwardList>() {
-            @Override
-            public WebBackForwardList capture() {
-                return mWebView.copyBackForwardList();
-            }
-        });
-    }
-
-    public Bitmap getFavicon() {
-        return getValue(new ValueGetter<Bitmap>() {
-            @Override
-            public Bitmap capture() {
-                return mWebView.getFavicon();
-            }
-        });
-    }
-
-    public String getUrl() {
-        return getValue(new ValueGetter<String>() {
-            @Override
-            public String capture() {
-                return mWebView.getUrl();
-            }
-        });
-    }
-
-    public int getProgress() {
-        return getValue(new ValueGetter<Integer>() {
-            @Override
-            public Integer capture() {
-                return mWebView.getProgress();
-            }
-        });
-    }
-
-    public int getHeight() {
-        return getValue(new ValueGetter<Integer>() {
-            @Override
-            public Integer capture() {
-                return mWebView.getHeight();
-            }
-        });
-    }
-
-    public int getContentHeight() {
-        return getValue(new ValueGetter<Integer>() {
-            @Override
-            public Integer capture() {
-                return mWebView.getContentHeight();
-            }
-        });
-    }
-
-    public boolean savePicture(final Bundle b, final File dest) {
-        return getValue(new ValueGetter<Boolean>() {
-            @Override
-            public Boolean capture() {
-                return mWebView.savePicture(b, dest);
-            }
-        });
-    }
-
-    public boolean pageUp(final boolean top) {
-        return getValue(new ValueGetter<Boolean>() {
-            @Override
-            public Boolean capture() {
-                return mWebView.pageUp(top);
-            }
-        });
-    }
-
-    public boolean pageDown(final boolean bottom) {
-        return getValue(new ValueGetter<Boolean>() {
-            @Override
-            public Boolean capture() {
-                return mWebView.pageDown(bottom);
-            }
-        });
-    }
-
-    public int[] getLocationOnScreen() {
-        final int[] location = new int[2];
-        return getValue(new ValueGetter<int[]>() {
-            @Override
-            public int[] capture() {
-                mWebView.getLocationOnScreen(location);
-                return location;
-            }
-        });
-    }
-
-    public float getScale() {
-        return getValue(new ValueGetter<Float>() {
-            @Override
-            public Float capture() {
-                return mWebView.getScale();
-            }
-        });
-    }
-
-    public boolean requestFocus(final int direction,
-            final Rect previouslyFocusedRect) {
-        return getValue(new ValueGetter<Boolean>() {
-            @Override
-            public Boolean capture() {
-                return mWebView.requestFocus(direction, previouslyFocusedRect);
-            }
-        });
-    }
-
-    public HitTestResult getHitTestResult() {
-        return getValue(new ValueGetter<HitTestResult>() {
-            @Override
-            public HitTestResult capture() {
-                return mWebView.getHitTestResult();
-            }
-        });
-    }
-
-    public int getScrollX() {
-        return getValue(new ValueGetter<Integer>() {
-            @Override
-            public Integer capture() {
-                return mWebView.getScrollX();
-            }
-        });
-    }
-
-    public int getScrollY() {
-        return getValue(new ValueGetter<Integer>() {
-            @Override
-            public Integer capture() {
-                return mWebView.getScrollY();
-            }
-        });
-    }
-
-    public final DisplayMetrics getDisplayMetrics() {
-        return getValue(new ValueGetter<DisplayMetrics>() {
-            @Override
-            public DisplayMetrics capture() {
-                return mWebView.getContext().getResources().getDisplayMetrics();
-            }
-        });
-    }
-
-    public boolean requestChildRectangleOnScreen(final View child,
-            final Rect rect,
-            final boolean immediate) {
-        return getValue(new ValueGetter<Boolean>() {
-            @Override
-            public Boolean capture() {
-                return mWebView.requestChildRectangleOnScreen(child, rect,
-                        immediate);
-            }
-        });
-    }
-
-    public int findAll(final String find) {
-        return getValue(new ValueGetter<Integer>() {
-            @Override
-            public Integer capture() {
-                return mWebView.findAll(find);
-            }
-        });
-    }
-
-    public Picture capturePicture() {
-        return getValue(new ValueGetter<Picture>() {
-            @Override
-            public Picture capture() {
-                return mWebView.capturePicture();
-            }
-        });
-    }
-
-    public void evaluateJavascript(final String script, final ValueCallback<String> result) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mWebView.evaluateJavascript(script, result);
-            }
-        });
-    }
-
-    public WebView createWebView() {
-        return getValue(new ValueGetter<WebView>() {
-            @Override
-            public WebView capture() {
-                return new WebView(mWebView.getContext());
-            }
-        });
-    }
-
-    public PrintDocumentAdapter createPrintDocumentAdapter() {
-        return getValue(new ValueGetter<PrintDocumentAdapter>() {
-            @Override
-            public PrintDocumentAdapter capture() {
-                return mWebView.createPrintDocumentAdapter();
-            }
-        });
-    }
-
-    public void setLayoutHeightToMatchParent() {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                ViewParent parent = mWebView.getParent();
-                if (parent instanceof ViewGroup) {
-                    ((ViewGroup) parent).getLayoutParams().height =
-                        ViewGroup.LayoutParams.MATCH_PARENT;
-                }
-                mWebView.getLayoutParams().height = ViewGroup.LayoutParams.MATCH_PARENT;
-                mWebView.requestLayout();
-            }
-        });
-    }
-
-    public void setAcceptThirdPartyCookies(final boolean accept) {
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                CookieManager.getInstance().setAcceptThirdPartyCookies(mWebView, accept);
-            }
-        });
-    }
-
-    public boolean acceptThirdPartyCookies() {
-        return getValue(new ValueGetter<Boolean>() {
-            @Override
-            public Boolean capture() {
-                return CookieManager.getInstance().acceptThirdPartyCookies(mWebView);
-            }
-        });
-    }
-
-    /**
-     * Helper for running code on the UI thread where an exception is
-     * a test failure. If this is already the UI thread then it runs
-     * the code immediately.
-     *
-     * @see runTestOnUiThread
-     * @param r The code to run in the UI thread
-     */
-    public void runOnUiThread(Runnable r) {
-        try {
-            if (isUiThread()) {
-                r.run();
-            } else {
-                mTest.runTestOnUiThread(r);
-            }
-        } catch (Throwable t) {
-            Assert.fail("Unexpected error while running on UI thread: "
-                    + t.getMessage());
-        }
-    }
-
-    /**
-     * Accessor for underlying WebView.
-     * @return The WebView being wrapped by this class.
-     */
-    public WebView getWebView() {
-        return mWebView;
-    }
-
-    private<T> T getValue(ValueGetter<T> getter) {
-        runOnUiThread(getter);
-        return getter.getValue();
-    }
-
-    private abstract class ValueGetter<T> implements Runnable {
-        private T mValue;
-
-        @Override
-        public void run() {
-            mValue = capture();
-        }
-
-        protected abstract T capture();
-
-        public T getValue() {
-           return mValue;
-        }
-    }
-
-    /**
-     * Returns true if the current thread is the UI thread based on the
-     * Looper.
-     */
-    private static boolean isUiThread() {
-        return (Looper.myLooper() == Looper.getMainLooper());
-    }
-
-    /**
-     * @return Whether or not the load has finished.
-     */
-    private synchronized boolean isLoaded() {
-        return mLoaded && mNewPicture && mProgress == 100;
-    }
-
-    /**
-     * Makes a WebView call, waits for completion and then resets the
-     * load state in preparation for the next load call.
-     * @param call The call to make on the UI thread prior to waiting.
-     */
-    private void callAndWait(Runnable call) {
-        Assert.assertTrue("WebViewOnUiThread.load*AndWaitForCompletion calls "
-                + "may not be mixed with load* calls directly on WebView "
-                + "without calling waitForLoadCompletion after the load",
-                !isLoaded());
-        clearLoad(); // clear any extraneous signals from a previous load.
-        runOnUiThread(call);
-        waitForLoadCompletion();
-    }
-
-    /**
-     * Called whenever a load has been completed so that a subsequent call to
-     * waitForLoadCompletion doesn't return immediately.
-     */
-    synchronized private void clearLoad() {
-        mLoaded = false;
-        mNewPicture = false;
-        mProgress = 0;
-    }
-
-    /**
-     * Uses a polling mechanism, while pumping messages to check when the
-     * criteria is met.
-     */
-    private void waitOnUiThread(long timeout, final Callable<Boolean> doneCriteria) {
-        new PollingCheck(timeout) {
-            @Override
-            protected boolean check() {
-                pumpMessages();
-                try {
-                    return doneCriteria.call();
-                } catch (Exception e) {
-                    Assert.fail("Unexpected error while checking the criteria: "
-                            + e.getMessage());
-                    return true;
-                }
-            }
-        }.run();
-    }
-
-    /**
-     * Uses a wait/notify to check when the criteria is met.
-     */
-    private synchronized void waitOnTestThread(long timeout, Callable<Boolean> doneCriteria) {
-        try {
-            long waitEnd = SystemClock.uptimeMillis() + timeout;
-            long timeRemaining = timeout;
-            while (!doneCriteria.call() && timeRemaining > 0) {
-                this.wait(timeRemaining);
-                timeRemaining = waitEnd - SystemClock.uptimeMillis();
-            }
-            Assert.assertTrue("Action failed to complete before timeout", doneCriteria.call());
-        } catch (InterruptedException e) {
-            // We'll just drop out of the loop and fail
-        } catch (Exception e) {
-            Assert.fail("Unexpected error while checking the criteria: "
-                    + e.getMessage());
-        }
-    }
-
-    /**
-     * Pumps all currently-queued messages in the UI thread and then exits.
-     * This is useful to force processing while running tests in the UI thread.
-     */
-    private void pumpMessages() {
-        class ExitLoopException extends RuntimeException {
-        }
-
-        // Force loop to exit when processing this. Loop.quit() doesn't
-        // work because this is the main Loop.
-        mWebView.getHandler().post(new Runnable() {
-            @Override
-            public void run() {
-                throw new ExitLoopException(); // exit loop!
-            }
-        });
-        try {
-            // Pump messages until our message gets through.
-            Looper.loop();
-        } catch (ExitLoopException e) {
-        }
-    }
-
-    /**
-     * A WebChromeClient used to capture the onProgressChanged for use
-     * in waitFor functions. If a test must override the WebChromeClient,
-     * it can derive from this class or call onProgressChanged
-     * directly.
-     */
-    public static class WaitForProgressClient extends WebChromeClient {
-        private WebViewOnUiThread mOnUiThread;
-
-        public WaitForProgressClient(WebViewOnUiThread onUiThread) {
-            mOnUiThread = onUiThread;
-        }
-
-        @Override
-        public void onProgressChanged(WebView view, int newProgress) {
-            super.onProgressChanged(view, newProgress);
-            mOnUiThread.onProgressChanged(newProgress);
-        }
-    }
-
-    /**
-     * A WebViewClient that captures the onPageFinished for use in
-     * waitFor functions. Using initializeWebView sets the WaitForLoadedClient
-     * into the WebView. If a test needs to set a specific WebViewClient and
-     * needs the waitForCompletion capability then it should derive from
-     * WaitForLoadedClient or call WebViewOnUiThread.onPageFinished.
-     */
-    public static class WaitForLoadedClient extends WebViewClient {
-        private WebViewOnUiThread mOnUiThread;
-
-        public WaitForLoadedClient(WebViewOnUiThread onUiThread) {
-            mOnUiThread = onUiThread;
-        }
-
-        @Override
-        public void onPageFinished(WebView view, String url) {
-            super.onPageFinished(view, url);
-            mOnUiThread.onPageFinished();
-        }
-
-        @Override
-        public void onPageStarted(WebView view, String url, Bitmap favicon) {
-            super.onPageStarted(view, url, favicon);
-            mOnUiThread.onPageStarted();
-        }
-    }
-
-    /**
-     * A PictureListener that captures the onNewPicture for use in
-     * waitForLoadCompletion. Using initializeWebView sets the PictureListener
-     * into the WebView. If a test needs to set a specific PictureListener and
-     * needs the waitForCompletion capability then it should call
-     * WebViewOnUiThread.onNewPicture.
-     */
-    private class WaitForNewPicture implements PictureListener {
-        @Override
-        public void onNewPicture(WebView view, Picture picture) {
-            WebViewOnUiThread.this.onNewPicture();
-        }
-    }
-}
diff --git a/tests/tests/app/Android.mk b/tests/tests/app/Android.mk
index 136f072..39be0dc 100644
--- a/tests/tests/app/Android.mk
+++ b/tests/tests/app/Android.mk
@@ -26,8 +26,9 @@
 LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner ctstestserver
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-              src/android/app/cts/ISecondary.aidl
 
 LOCAL_PACKAGE_NAME := CtsAppTestCases
 
+LOCAL_INSTRUMENTATION_FOR := CtsAppTestStubs
+
 include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/app/AndroidManifest.xml b/tests/tests/app/AndroidManifest.xml
index 6cafe80..08b0dda 100644
--- a/tests/tests/app/AndroidManifest.xml
+++ b/tests/tests/app/AndroidManifest.xml
@@ -20,269 +20,12 @@
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
 
-    <permission android:name="android.app.cts.permission.TEST_GRANTED"
-        android:protectionLevel="normal"
-            android:label="@string/permlab_testGranted"
-            android:description="@string/permdesc_testGranted">
-        <meta-data android:name="android.app.cts.string" android:value="foo" />
-        <meta-data android:name="android.app.cts.boolean" android:value="true" />
-        <meta-data android:name="android.app.cts.integer" android:value="100" />
-        <meta-data android:name="android.app.cts.color" android:value="#ff000000" />
-        <meta-data android:name="android.app.cts.float" android:value="100.1" />
-        <meta-data android:name="android.app.cts.reference" android:resource="@xml/metadata" />
-    </permission>
-
-    <uses-permission android:name="android.app.cts.permission.TEST_GRANTED" />
-    <uses-permission android:name="android.permission.READ_CONTACTS" />
-    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
-    <uses-permission android:name="android.permission.CAMERA" />
-    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
-    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
-    <uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-
-    <application android:label="Android TestCase"
-                android:icon="@drawable/size_48x48"
-                android:maxRecents="1"
-                android:multiArch="true"
-                android:name="android.app.cts.MockApplication"
-                android:supportsRtl="true">
+    <application>
         <uses-library android:name="android.test.runner" />
-
-        <activity android:name="android.app.cts.ActionBarActivity" />
-
-        <activity android:name="android.app.cts.DialogCtsActivity"
-            android:label="DialogCtsActivity"
-            android:configChanges="keyboardHidden|orientation|screenSize">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.MockActivity" android:label="MockActivity">
-            <meta-data android:name="android.app.alias"
-                android:resource="@xml/alias" />
-            <meta-data android:name="android.app.intent.filter"
-                android:resource="@xml/intentfilter" />
-        </activity>
-
-        <activity android:name="android.app.cts.MockApplicationActivity"
-            android:label="MockApplicationActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.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" />
-                <data android:mimeType="vnd.android.cursor.dir/person" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.AliasActivityStub">
-            <meta-data android:name="android.app.alias"
-                android:resource="@xml/alias" />
-        </activity>
-
-        <activity android:name="android.app.cts.ChildActivity"
-                        android:label="ChildActivity" />
-
-        <receiver android:name="android.app.cts.MockReceiver">
-            <intent-filter>
-                <action android:name="android.app.cts.PendingIntentTest.TEST_RECEIVER" />
-            </intent-filter>
-        </receiver>
-
-        <service android:name="android.app.cts.MockService" />
-
-        <activity android:name="android.app.cts.SearchManagerCtsActivity"
-                android:label="SearchManagerCtsActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.SEARCH" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-            <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" />
-        </activity>
-
-        <service android:name="android.app.cts.LocalService">
-            <intent-filter>
-                <action android:name="android.app.cts.activity.SERVICE_LOCAL" />
-            </intent-filter>
-            <meta-data android:name="android.app.cts.string" android:value="foo" />
-            <meta-data android:name="android.app.cts.boolean" android:value="true" />
-            <meta-data android:name="android.app.cts.integer" android:value="100" />
-            <meta-data android:name="android.app.cts.color" android:value="#ff000000" />
-            <meta-data android:name="android.app.cts.float" android:value="100.1" />
-            <meta-data android:name="android.app.cts.reference" android:resource="@xml/metadata" />
-        </service>
-
-        <service android:name="android.app.cts.LocalGrantedService"
-             android:permission="android.app.cts.permission.TEST_GRANTED">
-            <intent-filter>
-                <action android:name="android.app.cts.activity.SERVICE_LOCAL_GRANTED" />
-            </intent-filter>
-        </service>
-
-        <service android:name="android.app.cts.LocalDeniedService"
-               android:permission="android.app.cts.permission.TEST_DENIED">
-            <intent-filter>
-                <action android:name="android.app.cts.activity.SERVICE_LOCAL_DENIED" />
-            </intent-filter>
-        </service>
-
-        <activity android:name="android.app.cts.TestedScreen"
-                android:process=":remoteScreen">
-        </activity>
-        <activity android:name="android.app.cts.LocalScreen" android:multiprocess="true">
-        </activity>
-        <activity android:name="android.app.cts.ClearTop" android:multiprocess="true"
-               android:launchMode="singleTop">
-        </activity>
-        <activity android:name="android.app.cts.LocalDialog" android:multiprocess="true"
-               android:theme="@android:style/Theme.Dialog">
-        </activity>
-
-        <activity android:name="android.app.cts.PendingIntentCtsActivity"
-             android:label="PendingIntentCtsActivity"/>
-
-        <activity android:name="android.app.cts.LocalActivityManagerCtsActivity"
-                        android:label="LocalActivityManagerCtsActivity" />
-
-        <activity android:name="android.app.cts.LocalActivityManagerTestHelper"
-            android:label="LocalActivityManagerTestHelper" />
-
-        <activity android:name="android.app.cts.LaunchpadTabActivity" android:multiprocess="true">
-        </activity>
-
-        <activity android:name="android.app.cts.LocalActivity" android:multiprocess="true">
-            <meta-data android:name="android.app.cts.string" android:value="foo" />
-            <meta-data android:name="android.app.cts.boolean" android:value="true" />
-            <meta-data android:name="android.app.cts.integer" android:value="100" />
-            <meta-data android:name="android.app.cts.color" android:value="#ff000000" />
-            <meta-data android:name="android.app.cts.float" android:value="100.1" />
-            <meta-data android:name="android.app.cts.reference" android:resource="@xml/metadata" />
-        </activity>
-
-        <activity android:name="android.app.cts.TestedActivity"
-                android:process=":remoteActivity">
-        </activity>
-
-        <activity android:name="android.app.cts.ExpandableListTestActivity"
-            android:label="ExpandableListTestActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.ChildTabActivity" android:label="ChildTabActivity" />
-
-        <activity android:name="android.app.cts.LauncherActivityStub"
-                  android:label="LauncherActivityStub" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.MockTabActivity" android:label="MockTabActivity" />
-
-        <activity android:name="android.app.cts.AppCtsActivity" android:label="AppCtsActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.DialogCtsActivity"
-                  android:theme="@style/Theme_NoSwipeDismiss"
-                  android:label="DialogCtsActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.ActivityManagerStubFooActivity"
-            android:label="ActivityManagerStubFooActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.ActivityManagerRecentOneActivity"
-            android:label="ActivityManagerRecentOneActivity"
-            android:allowTaskReparenting="true"
-            android:taskAffinity="android.app.cts.recentOne">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.ActivityManagerRecentTwoActivity"
-            android:label="ActivityManagerRecentTwoActivity"
-            android:allowTaskReparenting="true"
-            android:taskAffinity="android.app.cts.recentTwo">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name="android.app.cts.ActivityManagerStubCrashActivity"
-            android:label="ActivityManagerStubCrashActivity"
-            android:multiprocess="true"
-            android:process=":ActivityManagerStubCrashActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-            </intent-filter>
-        </activity>
-
-        <service android:name="android.app.cts.StubRemoteService"
-            android:process=":remote">
-            <intent-filter>
-                <action
-                    android:name="android.app.cts.ISecondary" />
-                <action
-                    android:name="android.app.REMOTESERVICE" />
-            </intent-filter>
-        </service>
-
-        <activity android:name="android.app.ActivityGroup"
-            android:label="ActivityGroup" />
-
-        <activity android:name="android.app.cts.KeyguardManagerActivity"
-            android:label="KeyguardManagerActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
-            </intent-filter>
-        </activity>
-
-        <service android:name="android.app.cts.IntentServiceStub"/>
-
-        <activity android:name="android.app.cts.LaunchpadActivity"
-                  android:configChanges="keyboardHidden|orientation|screenSize"
-                  android:multiprocess="true">
-        </activity>
-
-        <activity android:name="android.app.cts.ActivityManagerMemoryClassLaunchActivity" />
-
-        <activity android:name="android.app.cts.ActivityManagerMemoryClassTestActivity"
-                android:process=":memoryclass" />
-
     </application>
 
     <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
-                     android:targetPackage="com.android.cts.app"
+                     android:targetPackage="com.android.cts.app.stub"
                      android:label="CTS tests of android.app">
         <meta-data android:name="listener"
             android:value="com.android.cts.runner.CtsTestRunListener" />
diff --git a/tests/tests/app/src/android/app/backup/cts/BackupManagerTest.java b/tests/tests/app/src/android/app/backup/cts/BackupManagerTest.java
index 3ee1104..1b0a401 100644
--- a/tests/tests/app/src/android/app/backup/cts/BackupManagerTest.java
+++ b/tests/tests/app/src/android/app/backup/cts/BackupManagerTest.java
@@ -26,7 +26,7 @@
         // Check that these don't crash as if they were called in an app...
         BackupManager backupManager = new BackupManager(mContext);
         backupManager.dataChanged();
-        BackupManager.dataChanged("com.android.cts.app");
+        BackupManager.dataChanged("com.android.cts.app.stub");
 
         // Backup isn't expected to work in this test but check for obvious bugs...
         int result = backupManager.requestRestore(new RestoreObserver() {});
diff --git a/tests/tests/app/src/android/app/cts/ActivityManagerTest.java b/tests/tests/app/src/android/app/cts/ActivityManagerTest.java
index dfec7db..e633f1f 100644
--- a/tests/tests/app/src/android/app/cts/ActivityManagerTest.java
+++ b/tests/tests/app/src/android/app/cts/ActivityManagerTest.java
@@ -35,7 +35,7 @@
 import android.test.InstrumentationTestCase;
 
 public class ActivityManagerTest extends InstrumentationTestCase {
-    private static final String STUB_PACKAGE_NAME = "com.android.cts.app";
+    private static final String STUB_PACKAGE_NAME = "com.android.cts.app.stub";
     private static final int WAITFOR_MSEC = 5000;
     private static final String SERVICE_NAME = "android.app.cts.MockService";
     private static final int WAIT_TIME = 2000;
@@ -222,13 +222,13 @@
         assertTrue(hasSystemProcess && hasTestProcess);
 
         for (RunningAppProcessInfo ra : list) {
-            if (ra.processName.equals("com.android.cts.app:remote")) {
-                fail("should be no process named com.android.cts.app:remote");
+            if (ra.processName.equals("com.android.cts.app.stub:remote")) {
+                fail("should be no process named com.android.cts.app.stub:remote");
             }
         }
         // start a new process
         mIntent = new Intent("android.app.REMOTESERVICE");
-        mIntent.setPackage("com.android.cts.app");
+        mIntent.setPackage("com.android.cts.app.stub");
         mInstrumentation.getTargetContext().startService(mIntent);
         Thread.sleep(WAITFOR_MSEC);
 
@@ -236,11 +236,11 @@
         assertTrue(list.size() <= listNew.size());
 
         for (RunningAppProcessInfo ra : listNew) {
-            if (ra.processName.equals("com.android.cts.app:remote")) {
+            if (ra.processName.equals("com.android.cts.app.stub:remote")) {
                 return;
             }
         }
-        fail("com.android.cts.app:remote process should be available");
+        fail("com.android.cts.app.stub:remote process should be available");
     }
 
     public void testGetProcessInErrorState() throws Exception {
diff --git a/tests/tests/app/src/android/app/cts/AlertDialogTest.java b/tests/tests/app/src/android/app/cts/AlertDialogTest.java
index a35fd9c..3e9f3b2 100644
--- a/tests/tests/app/src/android/app/cts/AlertDialogTest.java
+++ b/tests/tests/app/src/android/app/cts/AlertDialogTest.java
@@ -35,17 +35,17 @@
 /*
  * Test AlertDialog
  */
-public class AlertDialogTest extends ActivityInstrumentationTestCase2<DialogCtsActivity> {
+public class AlertDialogTest extends ActivityInstrumentationTestCase2<DialogStubActivity> {
     private static final String ALERTDIALOG_CUSTOM_TITLE = "Hello, World!";
 
     private Instrumentation mInstrumentation;
-    private DialogCtsActivity mActivity;
+    private DialogStubActivity mActivity;
     private Button mPositiveButton;
     private Button mNegativeButton;
     private Button mNeutralButton;
 
     public AlertDialogTest() {
-        super("com.android.cts.app", DialogCtsActivity.class);
+        super("com.android.cts.app.stub", DialogStubActivity.class);
     }
 
     @Override
@@ -55,7 +55,7 @@
     }
 
     protected void startDialogActivity(int dialogNumber) {
-        mActivity = DialogCtsActivity.startDialogActivity(this, dialogNumber);
+        mActivity = DialogStubActivity.startDialogActivity(this, dialogNumber);
         new PollingCheck() {
             @Override
             protected boolean check() {
@@ -65,7 +65,7 @@
     }
 
     public void testAlertDialog() throws Throwable {
-        doTestAlertDialog(DialogCtsActivity.TEST_ALERTDIALOG);
+        doTestAlertDialog(DialogStubActivity.TEST_ALERTDIALOG);
     }
 
     private void doTestAlertDialog(int index) throws Throwable {
@@ -75,17 +75,17 @@
         mPositiveButton = ((AlertDialog) (mActivity.getDialog())).getButton(
                 DialogInterface.BUTTON_POSITIVE);
         assertNotNull(mPositiveButton);
-        assertEquals(mActivity.getString(com.android.cts.app.R.string.alert_dialog_positive),
+        assertEquals(mActivity.getString(com.android.cts.app.stub.R.string.alert_dialog_positive),
                 mPositiveButton.getText());
         mNeutralButton = ((AlertDialog) (mActivity.getDialog())).getButton(
                 DialogInterface.BUTTON_NEUTRAL);
         assertNotNull(mNeutralButton);
-        assertEquals(mActivity.getString(com.android.cts.app.R.string.alert_dialog_neutral),
+        assertEquals(mActivity.getString(com.android.cts.app.stub.R.string.alert_dialog_neutral),
                 mNeutralButton.getText());
         mNegativeButton = ((AlertDialog) (mActivity.getDialog())).getButton(
                 DialogInterface.BUTTON_NEGATIVE);
         assertNotNull(mNegativeButton);
-        assertEquals(mActivity.getString(com.android.cts.app.R.string.alert_dialog_negative),
+        assertEquals(mActivity.getString(com.android.cts.app.stub.R.string.alert_dialog_negative),
                 mNegativeButton.getText());
 
         assertFalse(mActivity.isPositiveButtonClicked);
@@ -102,40 +102,40 @@
     }
 
     public void testAlertDialogDeprecatedAPI() throws Throwable {
-        doTestAlertDialog(DialogCtsActivity.TEST_ALERTDIALOG_DEPRECATED);
+        doTestAlertDialog(DialogStubActivity.TEST_ALERTDIALOG_DEPRECATED);
     }
 
     public void testAlertDialogDeprecatedAPIWithMessage() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_ALERTDIALOG_DEPRECATED_WITH_MESSAGE);
+        startDialogActivity(DialogStubActivity.TEST_ALERTDIALOG_DEPRECATED_WITH_MESSAGE);
         assertTrue(mActivity.getDialog().isShowing());
 
         mPositiveButton = ((AlertDialog) (mActivity.getDialog())).getButton(
                 DialogInterface.BUTTON_POSITIVE);
         assertNotNull(mPositiveButton);
-        assertEquals(mActivity.getString(com.android.cts.app.R.string.alert_dialog_positive),
+        assertEquals(mActivity.getString(com.android.cts.app.stub.R.string.alert_dialog_positive),
                 mPositiveButton.getText());
         mNegativeButton = ((AlertDialog) (mActivity.getDialog())).getButton(
                 DialogInterface.BUTTON_NEGATIVE);
         assertNotNull(mNegativeButton);
-        assertEquals(mActivity.getString(com.android.cts.app.R.string.alert_dialog_negative),
+        assertEquals(mActivity.getString(com.android.cts.app.stub.R.string.alert_dialog_negative),
                 mNegativeButton.getText());
         mNeutralButton = ((AlertDialog) (mActivity.getDialog())).getButton(
                 DialogInterface.BUTTON_NEUTRAL);
         assertNotNull(mNeutralButton);
-        assertEquals(mActivity.getString(com.android.cts.app.R.string.alert_dialog_neutral),
+        assertEquals(mActivity.getString(com.android.cts.app.stub.R.string.alert_dialog_neutral),
                 mNeutralButton.getText());
 
-        DialogCtsActivity.buttonIndex = 0;
+        DialogStubActivity.buttonIndex = 0;
         performClick(mPositiveButton);
-        assertEquals(DialogInterface.BUTTON_POSITIVE, DialogCtsActivity.buttonIndex);
+        assertEquals(DialogInterface.BUTTON_POSITIVE, DialogStubActivity.buttonIndex);
 
-        DialogCtsActivity.buttonIndex = 0;
+        DialogStubActivity.buttonIndex = 0;
         performClick(mNeutralButton);
-        assertEquals(DialogInterface.BUTTON_NEUTRAL, DialogCtsActivity.buttonIndex);
+        assertEquals(DialogInterface.BUTTON_NEUTRAL, DialogStubActivity.buttonIndex);
 
-        DialogCtsActivity.buttonIndex = 0;
+        DialogStubActivity.buttonIndex = 0;
         performClick(mNegativeButton);
-        assertEquals(DialogInterface.BUTTON_NEGATIVE, DialogCtsActivity.buttonIndex);
+        assertEquals(DialogInterface.BUTTON_NEGATIVE, DialogStubActivity.buttonIndex);
     }
 
     private void performClick(final Button button) throws Throwable {
@@ -148,18 +148,18 @@
     }
 
     public void testCustomAlertDialog() {
-        startDialogActivity(DialogCtsActivity.TEST_CUSTOM_ALERTDIALOG);
+        startDialogActivity(DialogStubActivity.TEST_CUSTOM_ALERTDIALOG);
         assertTrue(mActivity.getDialog().isShowing());
     }
 
     public void testCustomAlertDialogView() {
-        startDialogActivity(DialogCtsActivity.TEST_CUSTOM_ALERTDIALOG_VIEW);
+        startDialogActivity(DialogStubActivity.TEST_CUSTOM_ALERTDIALOG_VIEW);
         assertTrue(mActivity.getDialog().isShowing());
     }
 
 
     public void testCallback() {
-        startDialogActivity(DialogCtsActivity.TEST_ALERTDIALOG_CALLBACK);
+        startDialogActivity(DialogStubActivity.TEST_ALERTDIALOG_CALLBACK);
         assertTrue(mActivity.onCreateCalled);
 
         mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_0);
@@ -169,12 +169,12 @@
     }
 
     public void testAlertDialogTheme() throws Exception {
-        startDialogActivity(DialogCtsActivity.TEST_ALERTDIALOG_THEME);
+        startDialogActivity(DialogStubActivity.TEST_ALERTDIALOG_THEME);
         assertTrue(mActivity.getDialog().isShowing());
     }
 
     public void testAlertDialogCancelable() throws Exception {
-        startDialogActivity(DialogCtsActivity.TEST_ALERTDIALOG_CANCELABLE);
+        startDialogActivity(DialogStubActivity.TEST_ALERTDIALOG_CANCELABLE);
         assertTrue(mActivity.getDialog().isShowing());
         assertFalse(mActivity.onCancelCalled);
         mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
@@ -183,7 +183,7 @@
     }
 
     public void testAlertDialogNotCancelable() throws Exception {
-        startDialogActivity(DialogCtsActivity.TEST_ALERTDIALOG_NOT_CANCELABLE);
+        startDialogActivity(DialogStubActivity.TEST_ALERTDIALOG_NOT_CANCELABLE);
         assertTrue(mActivity.getDialog().isShowing());
         assertFalse(mActivity.onCancelCalled);
         mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
diff --git a/tests/tests/app/src/android/app/cts/AlertDialog_BuilderTest.java b/tests/tests/app/src/android/app/cts/AlertDialog_BuilderTest.java
index b07a4d5..9554438 100644
--- a/tests/tests/app/src/android/app/cts/AlertDialog_BuilderTest.java
+++ b/tests/tests/app/src/android/app/cts/AlertDialog_BuilderTest.java
@@ -47,7 +47,7 @@
 import android.widget.AdapterView.OnItemSelectedListener;
 
 
-public class AlertDialog_BuilderTest extends ActivityInstrumentationTestCase2<DialogCtsActivity> {
+public class AlertDialog_BuilderTest extends ActivityInstrumentationTestCase2<DialogStubActivity> {
     private Builder mBuilder;
     private Context mContext;
     private Instrumentation mInstrumentation;
@@ -127,7 +127,7 @@
     }
 
     public AlertDialog_BuilderTest() {
-        super("com.android.cts.app", DialogCtsActivity.class);
+        super("com.android.cts.app.stub", DialogStubActivity.class);
     }
 
     public void testConstructor() {
@@ -208,14 +208,14 @@
         runTestOnUiThread(new Runnable() {
             public void run() {
                 mBuilder = new AlertDialog.Builder(mContext);
-                mBuilder.setNegativeButton(com.android.cts.app.R.string.notify, mOnClickListener);
+                mBuilder.setNegativeButton(com.android.cts.app.stub.R.string.notify, mOnClickListener);
                 mDialog = mBuilder.show();
                 mButton = mDialog.getButton(DialogInterface.BUTTON_NEGATIVE);
                 mButton.performClick();
             }
         });
         mInstrumentation.waitForIdleSync();
-        assertEquals(mContext.getText(com.android.cts.app.R.string.notify), mButton.getText());
+        assertEquals(mContext.getText(com.android.cts.app.stub.R.string.notify), mButton.getText());
         assertTrue(mResult);
     }
 
@@ -223,14 +223,14 @@
         runTestOnUiThread(new Runnable() {
             public void run() {
                 mBuilder = new AlertDialog.Builder(mContext);
-                mBuilder.setNeutralButton(com.android.cts.app.R.string.notify, mOnClickListener);
+                mBuilder.setNeutralButton(com.android.cts.app.stub.R.string.notify, mOnClickListener);
                 mDialog = mBuilder.show();
                 mButton = mDialog.getButton(DialogInterface.BUTTON_NEUTRAL);
                 mButton.performClick();
             }
         });
         mInstrumentation.waitForIdleSync();
-        assertEquals(mContext.getText(com.android.cts.app.R.string.notify), mButton.getText());
+        assertEquals(mContext.getText(com.android.cts.app.stub.R.string.notify), mButton.getText());
         assertTrue(mResult);
     }
 
@@ -321,7 +321,7 @@
         runTestOnUiThread(new Runnable() {
             public void run() {
                 mBuilder = new AlertDialog.Builder(mContext);
-                mBuilder.setItems(com.android.cts.app.R.array.difficultyLevel, mOnClickListener);
+                mBuilder.setItems(com.android.cts.app.stub.R.array.difficultyLevel, mOnClickListener);
                 mDialog = mBuilder.show();
                 mListView = mDialog.getListView();
             }
@@ -329,13 +329,13 @@
         mInstrumentation.waitForIdleSync();
 
         final CharSequence[] levels = mContext.getResources().getTextArray(
-                com.android.cts.app.R.array.difficultyLevel);
+                com.android.cts.app.stub.R.array.difficultyLevel);
         assertEquals(levels[0], mListView.getItemAtPosition(0));
     }
 
     public void testSetItemsWithParamCharSequence() throws Throwable {
         final CharSequence[] expect = mContext.getResources().getTextArray(
-                com.android.cts.app.R.array.difficultyLevel);
+                com.android.cts.app.stub.R.array.difficultyLevel);
 
         runTestOnUiThread(new Runnable() {
             public void run() {
@@ -386,12 +386,12 @@
     public void testSetMultiChoiceItemsWithParamInt() throws Throwable {
 
         final CharSequence[] items = mContext.getResources().getTextArray(
-                com.android.cts.app.R.array.difficultyLevel);
+                com.android.cts.app.stub.R.array.difficultyLevel);
 
         runTestOnUiThread(new Runnable() {
             public void run() {
                 mBuilder = new AlertDialog.Builder(mContext);
-                mBuilder.setMultiChoiceItems(com.android.cts.app.R.array.difficultyLevel, null,
+                mBuilder.setMultiChoiceItems(com.android.cts.app.stub.R.array.difficultyLevel, null,
                         mOnMultiChoiceClickListener);
                 mDialog = mBuilder.show();
                 mListView = mDialog.getListView();
@@ -409,7 +409,7 @@
 
     public void testSetMultiChoiceItemsWithParamCharSequence() throws Throwable {
         final CharSequence[] items = mContext.getResources().getTextArray(
-                com.android.cts.app.R.array.difficultyLevel);
+                com.android.cts.app.stub.R.array.difficultyLevel);
 
         runTestOnUiThread(new Runnable() {
             public void run() {
@@ -454,12 +454,12 @@
 
     public void testSetSingleChoiceItemsWithParamInt() throws Throwable {
         final CharSequence[] items = mContext.getResources().getTextArray(
-                com.android.cts.app.R.array.difficultyLevel);
+                com.android.cts.app.stub.R.array.difficultyLevel);
 
         runTestOnUiThread(new Runnable() {
             public void run() {
                 mBuilder = new AlertDialog.Builder(mContext);
-                mBuilder.setSingleChoiceItems(com.android.cts.app.R.array.difficultyLevel, 0,
+                mBuilder.setSingleChoiceItems(com.android.cts.app.stub.R.array.difficultyLevel, 0,
                         mOnClickListener);
                 mDialog = mBuilder.show();
                 mListView = mDialog.getListView();
@@ -507,7 +507,7 @@
 
     public void testSetSingleChoiceItemsWithParamCharSequence() throws Throwable {
         final CharSequence[] items = mContext.getResources().getTextArray(
-                com.android.cts.app.R.array.difficultyLevel);
+                com.android.cts.app.stub.R.array.difficultyLevel);
 
         runTestOnUiThread(new Runnable() {
             public void run() {
@@ -527,7 +527,7 @@
 
     public void testSetSingleChoiceItems() throws Throwable {
         final CharSequence[] items = mContext.getResources().getTextArray(
-                com.android.cts.app.R.array.difficultyLevel);
+                com.android.cts.app.stub.R.array.difficultyLevel);
 
         runTestOnUiThread(new Runnable() {
             public void run() {
@@ -552,7 +552,7 @@
             public void run() {
                 mBuilder = new AlertDialog.Builder(mContext);
                 mBuilder.setOnItemSelectedListener(mOnItemSelectedListener);
-                mBuilder.setItems(com.android.cts.app.R.array.difficultyLevel, mOnClickListener);
+                mBuilder.setItems(com.android.cts.app.stub.R.array.difficultyLevel, mOnClickListener);
                 mDialog = mBuilder.show();
                 mListView = mDialog.getListView();
                 mListView.pointToPosition(0, 0);
diff --git a/tests/tests/app/src/android/app/cts/DialogTest.java b/tests/tests/app/src/android/app/cts/DialogTest.java
index 2bbe346..56e731b 100644
--- a/tests/tests/app/src/android/app/cts/DialogTest.java
+++ b/tests/tests/app/src/android/app/cts/DialogTest.java
@@ -15,7 +15,7 @@
  */
 package android.app.cts;
 
-import com.android.cts.app.R;
+import com.android.cts.app.stub.R;
 
 import android.app.Dialog;
 import android.app.Instrumentation;
@@ -50,10 +50,10 @@
 
 import java.lang.ref.WeakReference;
 
-public class DialogTest extends ActivityInstrumentationTestCase2<DialogCtsActivity> {
+public class DialogTest extends ActivityInstrumentationTestCase2<DialogStubActivity> {
 
     protected static final long SLEEP_TIME = 200;
-    private static final String STUB_ACTIVITY_PACKAGE = "com.android.cts.app";
+    private static final String STUB_ACTIVITY_PACKAGE = "com.android.cts.app.stub";
     private static final long TEST_TIMEOUT = 1000L;
 
     /**
@@ -69,11 +69,11 @@
 
     private Instrumentation mInstrumentation;
     private Context mContext;
-    private DialogCtsActivity mActivity;
+    private DialogStubActivity mActivity;
 
 
     public DialogTest() {
-        super(STUB_ACTIVITY_PACKAGE, DialogCtsActivity.class);
+        super(STUB_ACTIVITY_PACKAGE, DialogStubActivity.class);
     }
 
     @Override
@@ -84,7 +84,7 @@
     }
 
     private void startDialogActivity(int dialogNumber) {
-        mActivity = DialogCtsActivity.startDialogActivity(this, dialogNumber);
+        mActivity = DialogStubActivity.startDialogActivity(this, dialogNumber);
     }
 
     @UiThreadTest
@@ -106,14 +106,14 @@
     }
 
     public void testConstructor_protectedCancellable() {
-        startDialogActivity(DialogCtsActivity.TEST_PROTECTED_CANCELABLE);
+        startDialogActivity(DialogStubActivity.TEST_PROTECTED_CANCELABLE);
         mActivity.onCancelListenerCalled = false;
         sendKeys(KeyEvent.KEYCODE_BACK);
         assertTrue(mActivity.onCancelListenerCalled);
     }
 
     public void testConstructor_protectedNotCancellable() {
-        startDialogActivity(DialogCtsActivity.TEST_PROTECTED_NOT_CANCELABLE);
+        startDialogActivity(DialogStubActivity.TEST_PROTECTED_NOT_CANCELABLE);
         mActivity.onCancelListenerCalled = false;
         sendKeys(KeyEvent.KEYCODE_BACK);
         assertFalse(mActivity.onCancelListenerCalled);
@@ -142,7 +142,7 @@
     }
 
     public void testOnStartCreateStop(){
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
 
         assertTrue(d.isOnStartCalled);
@@ -154,7 +154,7 @@
     }
 
     public void testAccessOwnerActivity() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
         Dialog d = mActivity.getDialog();
         assertNotNull(d);
         assertSame(mActivity, d.getOwnerActivity());
@@ -178,7 +178,7 @@
     }
 
     public void testShow() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
         final Dialog d = mActivity.getDialog();
         final View decor = d.getWindow().getDecorView();
 
@@ -206,7 +206,7 @@
     }
 
     public void testOnSaveInstanceState() {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
 
         assertFalse(d.isOnSaveInstanceStateCalled);
@@ -226,7 +226,7 @@
     }
 
     public void testGetCurrentFocus() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
         assertNull(d.getCurrentFocus());
         runTestOnUiThread(new Runnable() {
@@ -243,7 +243,7 @@
     }
 
     public void testSetContentView() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
         final Dialog d = mActivity.getDialog();
         assertNotNull(d);
 
@@ -317,7 +317,7 @@
 
     public void testSetTitle() {
         final String expectedTitle = "Test Dialog Without theme";
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
 
         assertNotNull(mActivity.getDialog());
         mActivity.setUpTitle(expectedTitle);
@@ -333,7 +333,7 @@
     }
 
     public void testOnKeyDownKeyUp() {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
         assertFalse(d.isOnKeyDownCalled);
         assertFalse(d.isOnKeyUpCalled);
@@ -352,7 +352,7 @@
     }
 
      public void testOnKeyMultiple() {
-         startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+         startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
          final TestDialog d = (TestDialog) mActivity.getDialog();
 
          assertNull(d.keyMultipleEvent);
@@ -364,7 +364,7 @@
      }
 
     public void testTouchEvent() {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
 
         assertNull(d.onTouchEvent);
@@ -415,7 +415,7 @@
     }
 
     public void testTrackballEvent() {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
         long eventTime = SystemClock.uptimeMillis();
         final MotionEvent trackBallEvent = MotionEvent.obtain(eventTime, eventTime,
@@ -444,7 +444,7 @@
     }
 
     public void testOnWindowAttributesChanged() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
 
         assertTrue(d.isOnWindowAttributesChangedCalled);
@@ -464,7 +464,7 @@
     }
 
     public void testOnContentChanged() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
         assertNotNull(d);
 
@@ -481,7 +481,7 @@
     }
 
     public void testOnWindowFocusChanged() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
         assertTrue(d.isOnWindowFocusChangedCalled);
         d.isOnWindowFocusChangedCalled = false;
@@ -489,7 +489,7 @@
         // show a new dialog, the new dialog get focus
         runTestOnUiThread(new Runnable() {
             public void run() {
-                mActivity.showDialog(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+                mActivity.showDialog(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
             }
         });
         mInstrumentation.waitForIdleSync();
@@ -503,7 +503,7 @@
     }
 
     public void testDispatchKeyEvent() {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
 
         sendKeys(KeyEvent.KEYCODE_0);
@@ -551,7 +551,7 @@
      * the user canceling the menu with the back/menu button, or when an item is selected).
      */
     public void testContextMenu() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
         final LinearLayout parent = new LinearLayout(mContext);
         final MockView v = new MockView(mContext);
@@ -627,7 +627,7 @@
     }
 
     public void testTakeKeyEvents() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
         final View v = d.getWindow().getDecorView();
         assertNull(d.getCurrentFocus());
@@ -654,13 +654,13 @@
     }
 
     public void testRequestWindowFeature() {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         // called requestWindowFeature at TestDialog onCreate method
         assertTrue(((TestDialog) mActivity.getDialog()).isRequestWindowFeature);
     }
 
     public void testSetFeatureDrawableResource() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         runTestOnUiThread(new Runnable() {
             public void run() {
                 mActivity.getDialog().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
@@ -671,28 +671,28 @@
     }
 
     public void testSetFeatureDrawableUri() {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         mActivity.getDialog().setFeatureDrawableUri(0, Uri.parse("http://www.google.com"));
     }
 
     public void testSetFeatureDrawable() {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         mActivity.getDialog().setFeatureDrawable(0, new MockDrawable());
     }
 
     public void testSetFeatureDrawableAlpha() {
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         mActivity.getDialog().setFeatureDrawableAlpha(0, 0);
     }
 
     public void testGetLayoutInflater() {
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
         final Dialog d = mActivity.getDialog();
         assertEquals(d.getWindow().getLayoutInflater(), d.getLayoutInflater());
     }
 
     public void testSetCancelable_true() {
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
         final Dialog d = mActivity.getDialog();
 
         d.setCancelable(true);
@@ -702,7 +702,7 @@
     }
 
     public void testSetCancellable_false() {
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
         final Dialog d = mActivity.getDialog();
 
         d.setCancelable(false);
@@ -717,7 +717,7 @@
      * 2. Set a listener to be invoked when the dialog is canceled.
      */
     public void testCancel_listener() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
         final Dialog d = mActivity.getDialog();
 
         assertTrue(d.isShowing());
@@ -734,7 +734,7 @@
     }
 
     public void testCancel_noListener() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
         final Dialog d = mActivity.getDialog();
 
         assertTrue(d.isShowing());
@@ -748,7 +748,7 @@
 
     public void testSetCancelMessage() throws Exception {
         mCalledCallback = false;
-        startDialogActivity(DialogCtsActivity.TEST_ONSTART_AND_ONSTOP);
+        startDialogActivity(DialogStubActivity.TEST_ONSTART_AND_ONSTOP);
         final TestDialog d = (TestDialog) mActivity.getDialog();
         final HandlerThread ht = new HandlerThread("DialogTest");
         ht.start();
@@ -775,7 +775,7 @@
      */
     public void testSetOnDismissListener_listener() throws Throwable {
         mCalledCallback = false;
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
         final Dialog d = mActivity.getDialog();
 
         d.setOnDismissListener(new OnDismissListener() {
@@ -792,7 +792,7 @@
     }
 
     public void testSetOnDismissListener_noListener() throws Throwable {
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
         final Dialog d = mActivity.getDialog();
         assertTrue(d.isShowing());
         mCalledCallback = false;
@@ -804,7 +804,7 @@
 
     public void testSetDismissMessage() throws Throwable {
         mCalledCallback = false;
-        startDialogActivity(DialogCtsActivity.TEST_DIALOG_WITHOUT_THEME);
+        startDialogActivity(DialogStubActivity.TEST_DIALOG_WITHOUT_THEME);
         final Dialog d = mActivity.getDialog();
 
         final HandlerThread ht = new HandlerThread("DialogTest");
diff --git a/tests/tests/app/src/android/app/cts/InstrumentationTest.java b/tests/tests/app/src/android/app/cts/InstrumentationTest.java
index f528789..0c2e9fa 100644
--- a/tests/tests/app/src/android/app/cts/InstrumentationTest.java
+++ b/tests/tests/app/src/android/app/cts/InstrumentationTest.java
@@ -16,7 +16,7 @@
 
 package android.app.cts;
 
-import com.android.cts.app.R;
+import com.android.cts.app.stub.R;
 
 import android.app.Activity;
 import android.app.Application;
diff --git a/tests/tests/app/src/android/app/cts/KeyguardManagerTest.java b/tests/tests/app/src/android/app/cts/KeyguardManagerTest.java
index 3f04340..cb7cd4a 100644
--- a/tests/tests/app/src/android/app/cts/KeyguardManagerTest.java
+++ b/tests/tests/app/src/android/app/cts/KeyguardManagerTest.java
@@ -27,7 +27,7 @@
     private static final String TAG = "KeyguardManagerTest";
 
     public KeyguardManagerTest() {
-        super("com.android.cts.app", KeyguardManagerActivity.class);
+        super("com.android.cts.app.stub", KeyguardManagerActivity.class);
     }
 
     public void testNewKeyguardLock() {
diff --git a/tests/tests/app/src/android/app/cts/LauncherActivityTest.java b/tests/tests/app/src/android/app/cts/LauncherActivityTest.java
index 040ff83..3eea0b7 100644
--- a/tests/tests/app/src/android/app/cts/LauncherActivityTest.java
+++ b/tests/tests/app/src/android/app/cts/LauncherActivityTest.java
@@ -36,7 +36,7 @@
     private LauncherActivityStub mActivity;
 
     public LauncherActivityTest() {
-        super("com.android.cts.app", LauncherActivityStub.class);
+        super("com.android.cts.app.stub", LauncherActivityStub.class);
     }
 
     @Override
diff --git a/tests/tests/app/src/android/app/cts/LauncherActivity_IconResizerTest.java b/tests/tests/app/src/android/app/cts/LauncherActivity_IconResizerTest.java
index e36cf57..2fdc8ec 100644
--- a/tests/tests/app/src/android/app/cts/LauncherActivity_IconResizerTest.java
+++ b/tests/tests/app/src/android/app/cts/LauncherActivity_IconResizerTest.java
@@ -16,7 +16,7 @@
 
 package android.app.cts;
 
-import com.android.cts.app.R;
+import com.android.cts.app.stub.R;
 
 
 import android.app.LauncherActivity;
@@ -27,7 +27,7 @@
 public class LauncherActivity_IconResizerTest extends
         ActivityInstrumentationTestCase2<LauncherActivityStub> {
 
-    private static final String PACKAGE = "com.android.cts.app";
+    private static final String PACKAGE = "com.android.cts.app.stub";
     private LauncherActivityStub mActivity;
 
     public LauncherActivity_IconResizerTest() {
diff --git a/tests/tests/app/src/android/app/cts/NotificationManagerTest.java b/tests/tests/app/src/android/app/cts/NotificationManagerTest.java
index 94b410f..9a895ea 100644
--- a/tests/tests/app/src/android/app/cts/NotificationManagerTest.java
+++ b/tests/tests/app/src/android/app/cts/NotificationManagerTest.java
@@ -24,7 +24,7 @@
 import android.provider.Telephony.Threads;
 import android.test.AndroidTestCase;
 
-import com.android.cts.app.R;
+import com.android.cts.app.stub.R;
 
 
 public class NotificationManagerTest extends AndroidTestCase {
diff --git a/tests/tests/app/src/android/app/cts/PendingIntentTest.java b/tests/tests/app/src/android/app/cts/PendingIntentTest.java
index fb32291..d2c1b31 100644
--- a/tests/tests/app/src/android/app/cts/PendingIntentTest.java
+++ b/tests/tests/app/src/android/app/cts/PendingIntentTest.java
@@ -95,11 +95,11 @@
     }
 
     public void testGetActivity() throws InterruptedException, CanceledException {
-        PendingIntentCtsActivity.status = PendingIntentCtsActivity.INVALIDATE;
+        PendingIntentStubActivity.status = PendingIntentStubActivity.INVALIDATE;
         mPendingIntent = null;
         mIntent = new Intent();
 
-        mIntent.setClass(mContext, PendingIntentCtsActivity.class);
+        mIntent.setClass(mContext, PendingIntentStubActivity.class);
         mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mPendingIntent = PendingIntent.getActivity(mContext, 1, mIntent,
                 PendingIntent.FLAG_CANCEL_CURRENT);
@@ -109,7 +109,7 @@
 
         Thread.sleep(WAIT_TIME);
         assertNotNull(mPendingIntent);
-        assertEquals(PendingIntentCtsActivity.status, PendingIntentCtsActivity.ON_CREATE);
+        assertEquals(PendingIntentStubActivity.status, PendingIntentStubActivity.ON_CREATE);
 
         // test getActivity return null
         mPendingIntent.cancel();
diff --git a/tests/tests/app/src/android/app/cts/ProgressDialogTest.java b/tests/tests/app/src/android/app/cts/ProgressDialogTest.java
index 106b504..038b57b 100644
--- a/tests/tests/app/src/android/app/cts/ProgressDialogTest.java
+++ b/tests/tests/app/src/android/app/cts/ProgressDialogTest.java
@@ -50,7 +50,7 @@
     private MockActivity mActivity;
 
     public ProgressDialogTest() {
-        super("com.android.cts.app", MockActivity.class);
+        super("com.android.cts.app.stub", MockActivity.class);
     }
 
     @Override
@@ -62,7 +62,7 @@
         mActivity = getActivity();
         mContext = mActivity;
         mDrawable = getActivity().getResources().getDrawable(
-                com.android.cts.app.R.drawable.yellow);
+                com.android.cts.app.stub.R.drawable.yellow);
     }
 
     @UiThreadTest
@@ -72,7 +72,7 @@
 
     @UiThreadTest
     public void testProgressDialog2(){
-        new ProgressDialog(mContext, com.android.cts.app.R.style.Theme_AlertDialog);
+        new ProgressDialog(mContext, com.android.cts.app.stub.R.style.Theme_AlertDialog);
     }
 
     @UiThreadTest
diff --git a/tests/tests/app/src/android/app/cts/SearchManagerTest.java b/tests/tests/app/src/android/app/cts/SearchManagerTest.java
index ef7a0e0..8e465e8 100644
--- a/tests/tests/app/src/android/app/cts/SearchManagerTest.java
+++ b/tests/tests/app/src/android/app/cts/SearchManagerTest.java
@@ -24,25 +24,25 @@
         Intent intent = new Intent();
         intent.setAction(action);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-        intent.setClass(getInstrumentation().getTargetContext(), SearchManagerCtsActivity.class);
+        intent.setClass(getInstrumentation().getTargetContext(), SearchManagerStubActivity.class);
         getInstrumentation().getTargetContext().startActivity(intent);
     }
 
     public void testStopSearch() throws InterruptedException {
-        SearchManagerCtsActivity.setCTSResult(this);
-        setupActivity(SearchManagerCtsActivity.TEST_STOP_SEARCH);
+        SearchManagerStubActivity.setCTSResult(this);
+        setupActivity(SearchManagerStubActivity.TEST_STOP_SEARCH);
         waitForResult();
     }
 
     public void testSetOnDismissListener() throws InterruptedException {
-        SearchManagerCtsActivity.setCTSResult(this);
-        setupActivity(SearchManagerCtsActivity.TEST_ON_DISMISSLISTENER);
+        SearchManagerStubActivity.setCTSResult(this);
+        setupActivity(SearchManagerStubActivity.TEST_ON_DISMISSLISTENER);
         waitForResult();
     }
 
     public void testSetOnCancelListener() throws InterruptedException {
-        SearchManagerCtsActivity.setCTSResult(this);
-        setupActivity(SearchManagerCtsActivity.TEST_ON_CANCELLISTENER);
+        SearchManagerStubActivity.setCTSResult(this);
+        setupActivity(SearchManagerStubActivity.TEST_ON_CANCELLISTENER);
         waitForResult();
     }
 }
diff --git a/tests/tests/app/src/android/app/cts/TabActivityTest.java b/tests/tests/app/src/android/app/cts/TabActivityTest.java
index 403b393..9c028a1 100644
--- a/tests/tests/app/src/android/app/cts/TabActivityTest.java
+++ b/tests/tests/app/src/android/app/cts/TabActivityTest.java
@@ -61,7 +61,7 @@
             }
         });
         mInstrumentation.waitForIdleSync();
-        final String packageName = "com.android.cts.app";
+        final String packageName = "com.android.cts.app.stub";
         final Intent intent = new Intent(Intent.ACTION_MAIN);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         intent.setClassName(packageName, MockTabActivity.class.getName());
diff --git a/tests/tests/app/src/android/app/cts/TimePickerDialogTest.java b/tests/tests/app/src/android/app/cts/TimePickerDialogTest.java
index 2fe2d69..79a91a1 100644
--- a/tests/tests/app/src/android/app/cts/TimePickerDialogTest.java
+++ b/tests/tests/app/src/android/app/cts/TimePickerDialogTest.java
@@ -28,7 +28,7 @@
 /**
  * Test {@link TimePickerDialog}.
  */
-public class TimePickerDialogTest extends ActivityInstrumentationTestCase2<DialogCtsActivity> {
+public class TimePickerDialogTest extends ActivityInstrumentationTestCase2<DialogStubActivity> {
     private static final String HOUR = "hour";
     private static final String MINUTE = "minute";
     private static final String IS_24_HOUR = "is24hour";
@@ -42,10 +42,10 @@
     private OnTimeSetListener mOnTimeSetListener;
 
     private Context mContext;
-    private DialogCtsActivity mActivity;
+    private DialogStubActivity mActivity;
 
     public TimePickerDialogTest() {
-        super("com.android.cts.app", DialogCtsActivity.class);
+        super("com.android.cts.app.stub", DialogStubActivity.class);
     }
 
     @Override
@@ -74,7 +74,7 @@
 
         int minute = 13;
         tD = new TimePickerDialog(
-                mContext, com.android.cts.app.R.style.Theme_AlertDialog,
+                mContext, com.android.cts.app.stub.R.style.Theme_AlertDialog,
                     mOnTimeSetListener, TARGET_HOUR, minute, false);
 
         b = tD.onSaveInstanceState();
@@ -95,7 +95,7 @@
 
     public void testOnTimeChanged() throws Throwable {
         final int minute = 34;
-        startDialogActivity(DialogCtsActivity.TEST_TIMEPICKERDIALOG);
+        startDialogActivity(DialogStubActivity.TEST_TIMEPICKERDIALOG);
         final TimePickerDialog d = (TimePickerDialog) mActivity.getDialog();
 
         runTestOnUiThread(new Runnable() {
@@ -140,7 +140,7 @@
     }
 
     private void startDialogActivity(int dialogNumber) {
-        mActivity = DialogCtsActivity.startDialogActivity(this, dialogNumber);
+        mActivity = DialogStubActivity.startDialogActivity(this, dialogNumber);
     }
 
     private TimePickerDialog buildDialog() {
diff --git a/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java b/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
index e2f75c6..82e3204 100644
--- a/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
+++ b/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
@@ -60,6 +60,7 @@
         allowedDensities.add(DisplayMetrics.DENSITY_XHIGH);
         allowedDensities.add(DisplayMetrics.DENSITY_400);
         allowedDensities.add(DisplayMetrics.DENSITY_XXHIGH);
+        allowedDensities.add(DisplayMetrics.DENSITY_560);
         allowedDensities.add(DisplayMetrics.DENSITY_XXXHIGH);
         assertTrue("DisplayMetrics#densityDpi must be one of the DisplayMetrics.DENSITY_* values: "
                 + allowedDensities, allowedDensities.contains(metrics.densityDpi));
diff --git a/tests/tests/hardware/src/android/hardware/camera2/cts/ImageReaderTest.java b/tests/tests/hardware/src/android/hardware/camera2/cts/ImageReaderTest.java
index 7d2341a..a68f78d 100644
--- a/tests/tests/hardware/src/android/hardware/camera2/cts/ImageReaderTest.java
+++ b/tests/tests/hardware/src/android/hardware/camera2/cts/ImageReaderTest.java
@@ -284,7 +284,7 @@
                 int numFrameVerified = repeating ? NUM_FRAME_VERIFIED : 1;
 
                 // Validate images.
-                validateImage(sz, format, numFrameVerified);
+                validateImage(sz, format, numFrameVerified, repeating);
 
                 // Validate capture result.
                 validateCaptureResult(format, sz, listener, numFrameVerified);
@@ -385,25 +385,43 @@
         return captureBuilder;
     }
 
-    private void validateImage(Size sz, int format, int captureCount) throws Exception {
+    private void validateImage(Size sz, int format, int captureCount,  boolean repeating)
+            throws Exception {
         // TODO: Add more format here, and wrap each one as a function.
         Image img;
-
-        for (int i = 0; i < captureCount; i++) {
+        final int MAX_RETRY_COUNT = 20;
+        int numImageVerified = 0;
+        int reTryCount = 0;
+        while (numImageVerified < captureCount) {
             assertNotNull("Image listener is null", mListener);
             if (VERBOSE) Log.v(TAG, "Waiting for an Image");
             mListener.waitForAnyImageAvailable(CAPTURE_WAIT_TIMEOUT_MS);
-            /**
-             * Acquire the latest image in case the validation is slower than
-             * the image producing rate.
-             */
-            img = mReader.acquireLatestImage();
+            if (repeating) {
+                /**
+                 * Acquire the latest image in case the validation is slower than
+                 * the image producing rate.
+                 */
+                img = mReader.acquireLatestImage();
+                /**
+                 * Sometimes if multiple onImageAvailable callbacks being queued,
+                 * acquireLatestImage will clear all buffer before corresponding callback is
+                 * executed. Wait for a new frame in that case.
+                 */
+                if (img == null && reTryCount < MAX_RETRY_COUNT) {
+                    reTryCount++;
+                    continue;
+                }
+            } else {
+                img = mReader.acquireNextImage();
+            }
             assertNotNull("Unable to acquire the latest image", img);
             if (VERBOSE) Log.v(TAG, "Got the latest image");
             CameraTestUtils.validateImage(img, sz.getWidth(), sz.getHeight(), format,
                     DEBUG_FILE_NAME_BASE);
-            if (VERBOSE) Log.v(TAG, "finish vaildation of image " + i);
+            if (VERBOSE) Log.v(TAG, "finish vaildation of image " + numImageVerified);
             img.close();
+            numImageVerified++;
+            reTryCount = 0;
         }
 
         // Return all pending images to the ImageReader as the validateImage may
diff --git a/tests/tests/hardware/src/android/hardware/camera2/cts/RecordingTest.java b/tests/tests/hardware/src/android/hardware/camera2/cts/RecordingTest.java
index eeccda2..7a6e088 100644
--- a/tests/tests/hardware/src/android/hardware/camera2/cts/RecordingTest.java
+++ b/tests/tests/hardware/src/android/hardware/camera2/cts/RecordingTest.java
@@ -289,15 +289,17 @@
                     // Start recording
                     startSlowMotionRecording(/*useMediaRecorder*/true, videoFramerate, captureRate,
                             fpsRange);
+                    long startTime = SystemClock.elapsedRealtime();
 
                     // Record certain duration.
                     SystemClock.sleep(RECORDING_DURATION_MS);
 
                     // Stop recording and preview
                     stopRecording(/*useMediaRecorder*/true);
+                    int duration = (int) (SystemClock.elapsedRealtime() - startTime);
 
                     // Validation.
-                    validateRecording(size, RECORDING_DURATION_MS * SLOWMO_SLOW_FACTOR);
+                    validateRecording(size, duration * SLOWMO_SLOW_FACTOR);
 
                 }
 
@@ -414,15 +416,17 @@
 
             // Start recording
             startRecording(/* useMediaRecorder */true);
+            long startTime = SystemClock.elapsedRealtime();
 
             // Record certain duration.
             SystemClock.sleep(RECORDING_DURATION_MS);
 
             // Stop recording and preview
             stopRecording(/* useMediaRecorder */true);
+            int duration = (int) (SystemClock.elapsedRealtime() - startTime);
 
             // Validation.
-            validateRecording(videoSz, RECORDING_DURATION_MS);
+            validateRecording(videoSz, duration);
         }
     }
 
@@ -455,15 +459,17 @@
 
             // Start recording
             startRecording(/* useMediaRecorder */true);
+            long startTime = SystemClock.elapsedRealtime();
 
             // Record certain duration.
             SystemClock.sleep(RECORDING_DURATION_MS);
 
             // Stop recording and preview
             stopRecording(/* useMediaRecorder */true);
+            int duration = (int) (SystemClock.elapsedRealtime() - startTime);
 
             // Validation.
-            validateRecording(sz, RECORDING_DURATION_MS);
+            validateRecording(sz, duration);
         }
     }
 
@@ -546,13 +552,11 @@
 
             CamcorderProfile profile = CamcorderProfile.get(cameraId, profileId);
             Size videoSz = new Size(profile.videoFrameWidth, profile.videoFrameHeight);
-            assertTrue("Video size " + videoSz.toString() + " for profile ID " + profileId +
-                            " must be one of the camera device supported video size!",
-                            mSupportedVideoSizes.contains(videoSz));
-            assertTrue("Video size " + videoSz.toString() + " for profile ID " + profileId +
-                            " must be one of the camera device supported JPEG sizes!",
-                            mStaticInfo.isHardwareLevelLegacy() ||
-                            mOrderedStillSizes.contains(videoSz));
+            if (!mSupportedVideoSizes.contains(videoSz)) {
+                mCollector.addMessage("Video size " + videoSz.toString() + " for profile ID " +
+                        profileId + " must be one of the camera device supported video size!");
+                continue;
+            }
 
             Size maxPreviewSize = mOrderedPreviewSizes.get(0);
 
@@ -610,6 +614,7 @@
 
             // Start recording
             startRecording(/* useMediaRecorder */true, resultListener);
+            long startTime = SystemClock.elapsedRealtime();
 
             // Record certain duration.
             SystemClock.sleep(RECORDING_DURATION_MS / 2);
@@ -632,9 +637,10 @@
 
             // Stop recording and preview
             stopRecording(/* useMediaRecorder */true);
+            int duration = (int) (SystemClock.elapsedRealtime() - startTime);
 
             // Validation recorded video
-            validateRecording(videoSz, RECORDING_DURATION_MS);
+            validateRecording(videoSz, duration);
 
             if (burstTest) {
                 for (int i = 0; i < BURST_VIDEO_SNAPSHOT_NUM; i++) {
diff --git a/tests/tests/hardware/src/android/hardware/cts/Camera_SizeTest.java b/tests/tests/hardware/src/android/hardware/cts/Camera_SizeTest.java
index 827ab76..2f9c94b 100644
--- a/tests/tests/hardware/src/android/hardware/cts/Camera_SizeTest.java
+++ b/tests/tests/hardware/src/android/hardware/cts/Camera_SizeTest.java
@@ -22,6 +22,7 @@
 import android.hardware.Camera.Parameters;
 import android.hardware.cts.helpers.CameraUtils;
 import android.test.suitebuilder.annotation.LargeTest;
+import android.util.Log;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -41,6 +42,8 @@
 
     private static final float ASPECT_RATIO_TOLERANCE = 0.05f;
 
+    private static final String TAG = "Camera_SizeTest";
+
     public void testConstructor() {
         if (Camera.getNumberOfCameras() < 1) {
             return;
@@ -88,12 +91,13 @@
                 float previewAspect =
                         largestPreviewDimen.width / (float) largestPreviewDimen.height;
 
-                assertTrue("Largest preview dimension (w=" + largestPreviewDimen.width + ", h=" +
-                                largestPreviewDimen.height + ") must have the same aspect ratio " +
-                                "as the largest Jpeg dimension (w=" + largestJpegDimen.width +
-                                ", h=" + largestJpegDimen.height + ")",
-                        Math.abs(jpegAspect - previewAspect) < ASPECT_RATIO_TOLERANCE
-                );
+                if (Math.abs(jpegAspect - previewAspect) >= ASPECT_RATIO_TOLERANCE) {
+                    Log.w(TAG,
+                            "Largest preview dimension (w=" + largestPreviewDimen.width + ", h=" +
+                            largestPreviewDimen.height + ") should have the same aspect ratio " +
+                            "as the largest Jpeg dimension (w=" + largestJpegDimen.width +
+                            ", h=" + largestJpegDimen.height + ")");
+                }
 
 
                 camera.release();
@@ -113,4 +117,3 @@
         testSuite.addTest(test);
     }
 }
-
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/ActivityResultMultiplexedLatch.java b/tests/tests/hardware/src/android/hardware/cts/helpers/ActivityResultMultiplexedLatch.java
new file mode 100644
index 0000000..bfc59c4
--- /dev/null
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/ActivityResultMultiplexedLatch.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 android.hardware.cts.helpers;
+
+import android.app.Activity;
+import android.util.Log;
+
+import java.util.HashMap;
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * An abstraction on top of {@link CountDownLatch} to synchronize the results of Activities
+ * started by a parent activity.
+ *
+ * It holds a {@link CountDownLatch} latch for each thread that requests synchronization.
+ *
+ * Each thread requests a {@link Latch} to synchronize an Activity that will be started, by invoking
+ * {@link #bindThread()}, this guarantees that a latch is associated with the thread, and the result
+ * can be retrieved.
+ */
+public class ActivityResultMultiplexedLatch {
+    private static final String TAG = "ActivityResultMultiplexedLatch";
+
+    private final HashMap<Integer, Entry> mActivityEntries = new HashMap<Integer, Entry>();
+
+    /**
+     * A latch for a bound thread.
+     * Applications get an instance by invoking {@link ActivityResultMultiplexedLatch#bindThread()}.
+     */
+    public class Latch {
+        private Entry mEntry;
+
+        private Latch(Entry entry) {
+            mEntry = entry;
+        }
+
+        /**
+         * Awaits for the Activity bound to unblock the current thread.
+         *
+         * @return The result code of the Activity executed.
+         */
+        public int await() {
+            try {
+                mEntry.latch.await();
+            } catch (InterruptedException e) {
+                Log.e(TAG, "Error waiting for Activity result.", e);
+                return Activity.RESULT_CANCELED;
+            }
+            return mEntry.resultCode;
+        }
+
+        /**
+         * @return A request code for the bound thread. It can be passed to the Activity to start.
+         */
+        public int getRequestCode() {
+            return mEntry.requestCode;
+        }
+    }
+
+    /**
+     * A class that represents the state for each thread/Activity being tracked.
+     */
+    private class Entry {
+        public final CountDownLatch latch = new CountDownLatch(1);
+        public final int requestCode;
+
+        public volatile int resultCode;
+
+        public Entry(int requestCode) {
+            this.requestCode = requestCode;
+        }
+    }
+
+    /**
+     * Binds a thread with this object.
+     *
+     * @return A request code (or session Id) for the bound thread.
+     */
+    public Latch bindThread() {
+        Entry entry;
+        int requestCode = getRequestCode();
+
+        synchronized (mActivityEntries) {
+            if (mActivityEntries.containsKey(requestCode)) {
+                throw new IllegalStateException("The thread has already been bound.");
+            }
+            entry = new Entry(requestCode);
+            mActivityEntries.put(requestCode, entry);
+        }
+
+        return new Latch(entry);
+    }
+
+    /**
+     * Used by the owner of the instance to record an Activity's result.
+     */
+    public void onActivityResult(int requestCode, int resultCode) {
+        Entry entry;
+        synchronized (mActivityEntries) {
+            entry = mActivityEntries.remove(requestCode);
+        }
+        if (entry == null) {
+            return;
+        }
+
+        entry.resultCode = resultCode;
+        entry.latch.countDown();
+    }
+
+    // there is no need for a better request Id, only one Activity can be launched at any time
+    private int getRequestCode() {
+        return Thread.currentThread().hashCode();
+    }
+}
diff --git a/tests/tests/media/src/android/media/cts/AudioEffectTest.java b/tests/tests/media/src/android/media/cts/AudioEffectTest.java
index 27189a1..7ff78d8 100644
--- a/tests/tests/media/src/android/media/cts/AudioEffectTest.java
+++ b/tests/tests/media/src/android/media/cts/AudioEffectTest.java
@@ -169,42 +169,11 @@
         }
     }
 
-    //Test case 1.1: test constructor from effect uuid
-    public void test1_1ConstructorFromUuid() throws Exception {
-        AudioEffect.Descriptor[] desc = AudioEffect.queryEffects();
-        assertTrue("no effects found", (desc.length != 0));
-        for (int i = 0; i < desc.length; i++) {
-            try {
-                int sessionId;
-                AudioRecord ar = null;
-                if (AudioEffect.EFFECT_PRE_PROCESSING.equals(desc[i].connectMode)) {
-                    ar =  getAudioRecord();
-                    sessionId = ar.getAudioSessionId();
-                } else {
-                    sessionId = 0;
-                }
-                AudioEffect effect = new AudioEffect(AudioEffect.EFFECT_TYPE_NULL,
-                        desc[i].uuid,
-                        0,
-                        sessionId);
-                assertNotNull("could not create AudioEffect", effect);
-                try {
-                    assertTrue("invalid effect ID", (effect.getId() != 0));
-                } catch (IllegalStateException e) {
-                    fail("AudioEffect not initialized");
-                } finally {
-                    effect.release();
-                    if (ar != null) {
-                        ar.release();
-                    }
-                }
-            } catch (IllegalArgumentException e) {
-                fail("Effect not found: "+desc[i].name);
-            } catch (UnsupportedOperationException e) {
-                fail("Effect library not loaded");
-            }
-        }
-    }
+//    //Test case 1.1: test constructor from effect uuid
+//    public void test1_1ConstructorFromUuid() ...
+//    Note: This test was removed because:
+//     1. will fail in devices that offload effects
+//     2. it used hidden api's.
 
     //Test case 1.2: test constructor failure from unknown type
     public void test1_2ConstructorUnknownType() throws Exception {
diff --git a/tests/tests/media/src/android/media/cts/AudioTrack_ListenerTest.java b/tests/tests/media/src/android/media/cts/AudioTrack_ListenerTest.java
index 54b119e..eb675fc 100644
--- a/tests/tests/media/src/android/media/cts/AudioTrack_ListenerTest.java
+++ b/tests/tests/media/src/android/media/cts/AudioTrack_ListenerTest.java
@@ -35,7 +35,7 @@
     private final int TEST_FORMAT = AudioFormat.ENCODING_PCM_8BIT;
     private final int TEST_MODE = AudioTrack.MODE_STREAM;
     private final int TEST_STREAM_TYPE1 = AudioManager.STREAM_MUSIC;
-    private Handler mHandler = new Handler() {
+    private Handler mHandler = new Handler(Looper.getMainLooper()) {
         @Override
         public void handleMessage(Message msg) {
             mIsHandleMessageCalled = true;
diff --git a/tests/tests/media/src/android/media/cts/DecoderTest.java b/tests/tests/media/src/android/media/cts/DecoderTest.java
index f418649..ba70f32 100644
--- a/tests/tests/media/src/android/media/cts/DecoderTest.java
+++ b/tests/tests/media/src/android/media/cts/DecoderTest.java
@@ -20,6 +20,8 @@
 
 import android.content.res.AssetFileDescriptor;
 import android.content.res.Resources;
+import android.graphics.ImageFormat;
+import android.media.Image;
 import android.media.MediaCodec;
 import android.media.MediaCodecInfo;
 import android.media.MediaExtractor;
@@ -1326,12 +1328,19 @@
                     if ((checkFlags & (CHECKFLAG_SETCHECKSUM | CHECKFLAG_COMPARECHECKSUM)) != 0) {
                         long sum = 0;   // note: checksum is 0 if buffer format unrecognized
                         if (dochecksum) {
-                            // TODO: add stride - right now just use info.size (as before)
-                            //sum = checksum(codecOutputBuffers[outputBufIndex], width, height,
-                            //        stride);
-                            ByteBuffer outputBuffer = codecOutputBuffers[outputBufIndex];
-                            outputBuffer.position(info.offset);
-                            sum = checksum(outputBuffer, info.size);
+                            Image image = codec.getOutputImage(outputBufIndex);
+                            // use image to do crc if it's available
+                            // fall back to buffer if image is not available
+                            if (image != null) {
+                                sum = checksum(image);
+                            } else {
+                                // TODO: add stride - right now just use info.size (as before)
+                                //sum = checksum(codecOutputBuffers[outputBufIndex], width, height,
+                                //        stride);
+                                ByteBuffer outputBuffer = codec.getOutputBuffer(outputBufIndex);
+                                outputBuffer.position(info.offset);
+                                sum = checksum(outputBuffer, info.size);
+                            }
                         }
                         if ((checkFlags & CHECKFLAG_COMPARECHECKSUM) != 0) {
                             assertTrue("number of frames (" + numframes
@@ -1506,13 +1515,13 @@
             if (true) { // this {} is 80x times faster than else {} below.
                 byte[] bb = new byte[width]; // local line buffer
                 for (int i = 0; i < height; i += lineinterval) {
-                    buf.position(i * stride);
+                    buf.position(pos + i * stride);
                     buf.get(bb, 0, width);
                     crc.update(bb, 0, width);
                 }
             } else {
                 for (int i = 0; i < height; i += lineinterval) {
-                    buf.position(i * stride);
+                    buf.position(pos + i * stride);
                     for (int j = 0; j < width; ++j) {
                         crc.update(buf.get());
                     }
@@ -1525,6 +1534,75 @@
         return crc.getValue();
     }
 
+    private static long checksum(Image image) {
+        int format = image.getFormat();
+        assertEquals("unsupported image format", ImageFormat.YUV_420_888, format);
+
+        CRC32 crc = new CRC32();
+
+        int imageWidth = image.getWidth();
+        int imageHeight = image.getHeight();
+
+        Image.Plane[] planes = image.getPlanes();
+        for (int i = 0; i < planes.length; ++i) {
+            ByteBuffer buf = planes[i].getBuffer();
+
+            int width, height, rowStride, pixelStride, x, y;
+            rowStride = planes[i].getRowStride();
+            pixelStride = planes[i].getPixelStride();
+            if (i == 0) {
+                width = imageWidth;
+                height = imageHeight;
+            } else {
+                width = imageWidth / 2;
+                height = imageHeight /2;
+            }
+            // local contiguous pixel buffer
+            byte[] bb = new byte[width * height];
+            if (buf.hasArray()) {
+                byte b[] = buf.array();
+                int offs = buf.arrayOffset();
+                if (pixelStride == 1) {
+                    for (y = 0; y < height; ++y) {
+                        System.arraycopy(bb, y * width, b, y * rowStride + offs, width);
+                    }
+                } else {
+                    // do it pixel-by-pixel
+                    for (y = 0; y < height; ++y) {
+                        int lineOffset = offs + y * rowStride;
+                        for (x = 0; x < width; ++x) {
+                            bb[y * width + x] = b[lineOffset + x * pixelStride];
+                        }
+                    }
+                }
+            } else { // almost always ends up here due to direct buffers
+                int pos = buf.position();
+                if (pixelStride == 1) {
+                    for (y = 0; y < height; ++y) {
+                        buf.position(pos + y * rowStride);
+                        buf.get(bb, y * width, width);
+                    }
+                } else {
+                    // local line buffer
+                    byte[] lb = new byte[rowStride];
+                    // do it pixel-by-pixel
+                    for (y = 0; y < height; ++y) {
+                        buf.position(pos + y * rowStride);
+                        // we're only guaranteed to have pixelStride * (width - 1) + 1 bytes
+                        buf.get(lb, 0, pixelStride * (width - 1) + 1);
+                        for (x = 0; x < width; ++x) {
+                            bb[y * width + x] = lb[x * pixelStride];
+                        }
+                    }
+                }
+                buf.position(pos);
+            }
+            crc.update(bb, 0, width * height);
+        }
+
+        return crc.getValue();
+    }
+
     public void testFlush() throws Exception {
         testFlush(R.raw.loudsoftwav);
         testFlush(R.raw.loudsoftogg);
diff --git a/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java b/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java
index b2b6620..50f1575 100644
--- a/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java
+++ b/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java
@@ -140,8 +140,7 @@
         Log.i(TAG, "testRendering800x480Locally");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
         if (maxRes == null) {
-            Log.i(TAG, "codec not supported, skipping the test");
-            return;
+            fail("codec not supported");
         }
         if (maxRes.first >= 800 && maxRes.second >= 480) {
             runTestRenderingInSeparateThread(800, 480, false, false);
@@ -154,8 +153,7 @@
         Log.i(TAG, "testRenderingMaxResolutionLocally");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
         if (maxRes == null) {
-            Log.i(TAG, "codec not supported, skipping the test");
-            return;
+            fail("codec not supported");
         }
         Log.w(TAG, "Trying resolution w:" + maxRes.first + " h:" + maxRes.second);
         runTestRenderingInSeparateThread(maxRes.first, maxRes.second, false, false);
@@ -165,8 +163,7 @@
         Log.i(TAG, "testRendering800x480Remotely");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
         if (maxRes == null) {
-            Log.i(TAG, "codec not supported, skipping the test");
-            return;
+            fail("codec not supported");
         }
         if (maxRes.first >= 800 && maxRes.second >= 480) {
             runTestRenderingInSeparateThread(800, 480, true, false);
@@ -179,8 +176,7 @@
         Log.i(TAG, "testRenderingMaxResolutionRemotely");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
         if (maxRes == null) {
-            Log.i(TAG, "codec not supported, skipping the test");
-            return;
+            fail("codec not supported");
         }
         Log.w(TAG, "Trying resolution w:" + maxRes.first + " h:" + maxRes.second);
         runTestRenderingInSeparateThread(maxRes.first, maxRes.second, true, false);
@@ -190,8 +186,7 @@
         Log.i(TAG, "testRendering800x480RemotelyWith3Windows");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
         if (maxRes == null) {
-            Log.i(TAG, "codec not supported, skipping the test");
-            return;
+            fail("codec not supported");
         }
         if (maxRes.first >= 800 && maxRes.second >= 480) {
             runTestRenderingInSeparateThread(800, 480, true, true);
@@ -204,8 +199,7 @@
         Log.i(TAG, "testRendering800x480LocallyWith3Windows");
         Pair<Integer, Integer> maxRes = checkMaxConcurrentEncodingDecodingResolution();
         if (maxRes == null) {
-            Log.i(TAG, "codec not supported, skipping the test");
-            return;
+            fail("codec not supported");
         }
         if (maxRes.first >= 800 && maxRes.second >= 480) {
             runTestRenderingInSeparateThread(800, 480, false, true);
diff --git a/tests/tests/media/src/android/media/cts/JetPlayerTest.java b/tests/tests/media/src/android/media/cts/JetPlayerTest.java
index 07f1c1b..fc03bcc 100644
--- a/tests/tests/media/src/android/media/cts/JetPlayerTest.java
+++ b/tests/tests/media/src/android/media/cts/JetPlayerTest.java
@@ -24,6 +24,7 @@
 import android.media.JetPlayer.OnJetEventListener;
 import android.os.Environment;
 import android.os.Handler;
+import android.os.Looper;
 import android.test.AndroidTestCase;
 
 import java.io.File;
@@ -39,15 +40,8 @@
     private boolean mOnJetNumQueuedSegmentUpdateCalled;
     private boolean mOnJetEventCalled;
     private String mJetFile;
-
-    /*
-     * InstrumentationTestRunner.onStart() calls Looper.prepare(), which creates a looper
-     * for the current thread. However, since we don't actually call loop() in the test,
-     * any messages queued with that looper will never be consumed. By instantiating the
-     * handler and the JetPlayer in the constructor, before setUp(), they will not be bound
-     * to the nonfunctional looper.
-     */
-    private Handler mHandler = new Handler();
+    /* JetPlayer and Handler will be on the Main Looper */
+    private Handler mHandler = new Handler(Looper.getMainLooper());
     private final JetPlayer mJetPlayer = JetPlayer.getJetPlayer();
 
     @Override
diff --git a/tests/tests/media/src/android/media/cts/MediaSessionManagerTest.java b/tests/tests/media/src/android/media/cts/MediaSessionManagerTest.java
index 2656136..b10d9df 100644
--- a/tests/tests/media/src/android/media/cts/MediaSessionManagerTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaSessionManagerTest.java
@@ -18,17 +18,18 @@
 import android.content.Context;
 import android.media.session.MediaController;
 import android.media.session.MediaSessionManager;
-import android.test.AndroidTestCase;
+import android.test.InstrumentationTestCase;
+import android.test.UiThreadTest;
 
 import java.util.List;
 
-public class MediaSessionManagerTest extends AndroidTestCase {
+public class MediaSessionManagerTest extends InstrumentationTestCase {
     private MediaSessionManager mSessionManager;
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        mSessionManager = (MediaSessionManager) mContext
+        mSessionManager = (MediaSessionManager) getInstrumentation().getTargetContext()
                 .getSystemService(Context.MEDIA_SESSION_SERVICE);
     }
 
@@ -42,6 +43,7 @@
         // TODO enable a notification listener, test again, disable, test again
     }
 
+    @UiThreadTest
     public void testAddOnActiveSessionsListener() throws Exception {
         try {
             mSessionManager.addOnActiveSessionsChangedListener(null, null);
diff --git a/tests/tests/media/src/android/media/cts/MediaSessionTest.java b/tests/tests/media/src/android/media/cts/MediaSessionTest.java
index 7409ff5..df68392 100644
--- a/tests/tests/media/src/android/media/cts/MediaSessionTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaSessionTest.java
@@ -20,6 +20,7 @@
 import android.content.Intent;
 import android.media.AudioAttributes;
 import android.media.AudioManager;
+import android.media.MediaDescription;
 import android.media.MediaMetadata;
 import android.media.Rating;
 import android.media.VolumeProvider;
@@ -30,6 +31,7 @@
 import android.os.Bundle;
 import android.test.AndroidTestCase;
 
+import java.util.ArrayList;
 import java.util.Set;
 
 public class MediaSessionTest extends AndroidTestCase {
@@ -121,7 +123,24 @@
         assertNotNull(tags);
         assertTrue(tags.contains(val));
 
-        // TODO test Queue APIs after fixing b/17205016
+        // test setQueue and setQueueTitle
+        ArrayList<MediaSession.QueueItem> queue = new ArrayList<MediaSession.QueueItem>();
+        MediaSession.QueueItem item = new MediaSession.QueueItem(new MediaDescription.Builder()
+                .setMediaId(val).setTitle("title").build(), 11);
+        queue.add(item);
+        session.setQueue(queue);
+        session.setQueueTitle(val);
+
+        assertEquals(val, controller.getQueueTitle());
+        assertEquals(1, controller.getQueue().size());
+        assertEquals(11, controller.getQueue().get(0).getQueueId());
+        assertEquals(val, controller.getQueue().get(0).getDescription().getMediaId());
+
+        session.setQueue(null);
+        session.setQueueTitle(null);
+
+        assertNull(controller.getQueueTitle());
+        assertNull(controller.getQueue());
 
         // test setSessionActivity
         Intent intent = new Intent("cts.MEDIA_SESSION_ACTION");
diff --git a/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
index 5656119..d79ecdd 100644
--- a/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
+++ b/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
@@ -16,7 +16,6 @@
 
 package android.net.cts;
 
-
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -31,6 +30,8 @@
 import android.test.AndroidTestCase;
 import android.util.Log;
 
+import com.android.internal.telephony.PhoneConstants;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -115,34 +116,9 @@
     }
 
     public void testSetNetworkPreference() {
-        // verify swtiching between two default networks - need to connectable networks though
-        // could use test and whatever the current active network is
-        int originalPref = mCm.getNetworkPreference();
-        int currentPref = originalPref;
-        for (int type = -1; type <= ConnectivityManager.MAX_NETWORK_TYPE+1; type++) {
-            mCm.setNetworkPreference(type);
-            NetworkConfig c = mNetworks.get(type);
-            boolean expectWorked = (c != null && c.isDefault());
-            int totalSleep = 0;
-            int foundType = ConnectivityManager.TYPE_NONE;
-            while (totalSleep < 1000) {
-                try {
-                    Thread.currentThread().sleep(100);
-                } catch (InterruptedException e) {}
-                totalSleep += 100;
-                foundType = mCm.getNetworkPreference();
-                if (currentPref != foundType) break;
-            }
-            if (expectWorked) {
-                assertTrue("We should have been able to switch prefered type " + type,
-                        foundType == type);
-            } else {
-                assertTrue("We should not have been able to switch type " + type,
-                        foundType != type);
-            }
-            currentPref = foundType;
-        }
-        mCm.setNetworkPreference(originalPref);
+        // getNetworkPreference() and setNetworkPreference() are both deprecated so they do
+        // not preform any action.  Verify they are at least still callable.
+        mCm.setNetworkPreference(mCm.getNetworkPreference());
     }
 
     public void testGetActiveNetworkInfo() {
@@ -194,13 +170,13 @@
         final String invalidateFeature = "invalidateFeature";
         final String mmsFeature = "enableMMS";
         final int failureCode = -1;
-        final int wifiOnlyStartFailureCode = 3;
-        final int wifiOnlyStopFailureCode = 1;
+        final int wifiOnlyStartFailureCode = PhoneConstants.APN_REQUEST_FAILED;
+        final int wifiOnlyStopFailureCode = -1;
 
         NetworkInfo ni = mCm.getNetworkInfo(TYPE_MOBILE);
         if (ni != null) {
-            assertEquals(failureCode, mCm.startUsingNetworkFeature(TYPE_MOBILE,
-                    invalidateFeature));
+            assertEquals(PhoneConstants.APN_REQUEST_FAILED,
+                    mCm.startUsingNetworkFeature(TYPE_MOBILE, invalidateFeature));
             assertEquals(failureCode, mCm.stopUsingNetworkFeature(TYPE_MOBILE,
                     invalidateFeature));
         } else {
@@ -212,8 +188,8 @@
 
         ni = mCm.getNetworkInfo(TYPE_WIFI);
         if (ni != null) {
-            // Should return failure(-1) because MMS is not supported on WIFI.
-            assertEquals(failureCode, mCm.startUsingNetworkFeature(TYPE_WIFI,
+            // Should return failure because MMS is not supported on WIFI.
+            assertEquals(PhoneConstants.APN_REQUEST_FAILED, mCm.startUsingNetworkFeature(TYPE_WIFI,
                     mmsFeature));
             assertEquals(failureCode, mCm.stopUsingNetworkFeature(TYPE_WIFI,
                     mmsFeature));
diff --git a/tests/tests/os/src/android/os/cts/ReadElf.java b/tests/tests/os/src/android/os/cts/ReadElf.java
index 89e9d48..2f64e03 100644
--- a/tests/tests/os/src/android/os/cts/ReadElf.java
+++ b/tests/tests/os/src/android/os/cts/ReadElf.java
@@ -19,6 +19,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.RandomAccessFile;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -27,497 +28,449 @@
  * designed to parse ELF (Executable and Linkable Format) files.
  */
 public class ReadElf implements AutoCloseable {
-    /** The magic values for the ELF identification. */
-    private static final byte[] ELF_IDENT = {
-            (byte) 0x7F, (byte) 'E', (byte) 'L', (byte) 'F',
-    };
+  /** The magic values for the ELF identification. */
+  private static final byte[] ELFMAG = { (byte) 0x7F, (byte) 'E', (byte) 'L', (byte) 'F', };
 
-    private static final int EI_CLASS = 4;
-    private static final int EI_DATA = 5;
+  private static final int EI_NIDENT = 16;
 
-    private static final int EM_386 = 3;
-    private static final int EM_MIPS = 8;
-    private static final int EM_ARM = 40;
-    // http://en.wikipedia.org/wiki/Qualcomm_Hexagon
-    private static final int EM_QDSP6 = 164;
+  private static final int EI_CLASS = 4;
+  private static final int EI_DATA = 5;
 
-    /** Size of the e_ident[] structure in the ELF header. */
-    private static final int EI_NIDENT = 16;
+  private static final int EM_386 = 3;
+  private static final int EM_MIPS = 8;
+  private static final int EM_ARM = 40;
+  private static final int EM_X86_64 = 62;
+  // http://en.wikipedia.org/wiki/Qualcomm_Hexagon
+  private static final int EM_QDSP6 = 164;
+  private static final int EM_AARCH64 = 183;
 
-    /** Offset from end of ident structure in half-word sizes. */
-    private static final int OFFSET_TYPE = 0;
+  private static final int ELFCLASS32 = 1;
+  private static final int ELFCLASS64 = 2;
 
-    /** Machine type. */
-    private static final int OFFSET_MACHINE = 1;
+  private static final int ELFDATA2LSB = 1;
+  private static final int ELFDATA2MSB = 2;
 
-    /** ELF version. */
-    private static final int OFFSET_VERSION = 2;
+  private static final int EV_CURRENT = 1;
 
-    /**
-     * The offset to which the system transfers control. e.g., the first thing
-     * executed.
-     */
-    private static final int OFFSET_ENTRY = 4;
+  private static final long PT_LOAD = 1;
 
-    /** Program header offset in bytes. */
-    private static final int OFFSET_PHOFF = 6;
+  private static final int SHT_SYMTAB = 2;
+  private static final int SHT_STRTAB = 3;
+  private static final int SHT_DYNAMIC = 6;
+  private static final int SHT_DYNSYM = 11;
 
-    /** Segment header offset in bytes. */
-    private static final int OFFSET_SHOFF = 8;
+  public static class Symbol {
+    public static final int STB_LOCAL = 0;
+    public static final int STB_GLOBAL = 1;
+    public static final int STB_WEAK = 2;
+    public static final int STB_LOPROC = 13;
+    public static final int STB_HIPROC = 15;
 
-    /** Processor-specific flags for binary. */
-    private static final int OFFSET_FLAGS = 10;
+    public static final int STT_NOTYPE = 0;
+    public static final int STT_OBJECT = 1;
+    public static final int STT_FUNC = 2;
+    public static final int STT_SECTION = 3;
+    public static final int STT_FILE = 4;
+    public static final int STT_COMMON = 5;
+    public static final int STT_TLS = 6;
 
-    /** ELF header size in bytes. */
-    private static final int OFFSET_EHSIZE = 12;
+    public final String name;
+    public final int bind;
+    public final int type;
 
-    /** All program headers entry size in bytes. */
-    private static final int OFFSET_PHENTSIZE = 13;
+    Symbol(String name, int st_info) {
+      this.name = name;
+      this.bind = (st_info >> 4) & 0x0F;
+      this.type = st_info & 0x0F;
+    }
 
-    /** Number of program headers in ELF. */
-    private static final int OFFSET_PHNUM = 14;
+    public String toString() {
+      return "Symbol[" + name + "," + toBind() + "," + toType() + "]";
+    }
 
-    /** All segment headers entry size in bytes. */
-    private static final int OFFSET_SHENTSIZE = 15;
+    private String toBind() {
+      switch (bind) {
+        case STB_LOCAL: return "LOCAL";
+        case STB_GLOBAL: return "GLOBAL";
+        case STB_WEAK: return "WEAK";
+      }
+      return "STB_??? (" + bind + ")";
+    }
 
-    /** Number of segment headers in ELF. */
-    private static final int OFFSET_SHNUM = 16;
+    private String toType() {
+      switch (type) {
+        case STT_NOTYPE: return "NOTYPE";
+        case STT_OBJECT: return "OBJECT";
+        case STT_FUNC: return "FUNC";
+        case STT_SECTION: return "SECTION";
+        case STT_FILE: return "FILE";
+        case STT_COMMON: return "COMMON";
+        case STT_TLS: return "TLS";
+      }
+      return "STT_??? (" + type + ")";
+    }
+  }
 
-    /** The section header index that refers to string table. */
-    private static final int OFFSET_SHSTRNDX = 17;
+  private final String mPath;
+  private final RandomAccessFile mFile;
+  private final byte[] mBuffer = new byte[512];
+  private int mEndian;
+  private boolean mIsDynamic;
+  private boolean mIsPIE;
+  private int mType;
+  private int mAddrSize;
 
-    /** Program header offset for type of this program header. */
-    private static final int PHOFF_TYPE = 0;
+  /** Symbol Table offset */
+  private long mSymTabOffset;
 
-    /** Program header offset for absolute offset in file. */
-    private static final int PHOFF_OFFSET = 2;
+  /** Symbol Table size */
+  private long mSymTabSize;
 
-    /** Program header offset for virtual address. */
-    private static final int PHOFF_VADDR = 4;
+  /** Dynamic Symbol Table offset */
+  private long mDynSymOffset;
 
-    /** Program header offset for physical address. */
-    private static final int PHOFF_PADDR = 6;
+  /** Dynamic Symbol Table size */
+  private long mDynSymSize;
 
-    /** Program header offset for file size in bytes. */
-    private static final int PHOFF_FILESZ = 8;
+  /** Section Header String Table offset */
+  private long mShStrTabOffset;
 
-    /** Program header offset for memory size in bytes. */
-    private static final int PHOFF_MEMSZ = 10;
+  /** Section Header String Table size */
+  private long mShStrTabSize;
 
-    /** Program header offset for flags. */
-    private static final int PHOFF_FLAGS = 12;
+  /** String Table offset */
+  private long mStrTabOffset;
 
-    /**
-     * Program header offset for required alignment. 0 or 1 means no alignment
-     * necessary.
-     */
-    private static final int PHOFF_ALIGN = 14;
+  /** String Table size */
+  private long mStrTabSize;
 
-    /** Index into string pool for segment name. */
-    private static final long SHOFF_NAME = 0;
+  /** Dynamic String Table offset */
+  private long mDynStrOffset;
 
-    /** Segment header offset for type (half-words) */
-    private static final long SHOFF_TYPE = 2;
+  /** Dynamic String Table size */
+  private long mDynStrSize;
 
-    /** Segment header offset for offset (meta!) (half-words) */
-    private static final long SHOFF_OFFSET = 8;
+  /** Symbol Table symbol names */
+  private Map<String, Symbol> mSymbols;
 
-    /** Segment header offset for size (half-words) */
-    private static final long SHOFF_SIZE = 10;
+  /** Dynamic Symbol Table symbol names */
+  private Map<String, Symbol> mDynamicSymbols;
 
-    /** Data is presented in LSB format. */
-    private static final int ELFDATA2LSB = 1;
+  public static ReadElf read(File file) throws IOException {
+    return new ReadElf(file);
+  }
 
-    /** Date is presented in MSB format. */
-    private static final int ELFDATA2MSB = 2;
+  public static void main(String[] args) throws IOException {
+    for (String arg : args) {
+      ReadElf re = new ReadElf(new File(arg));
+      re.getSymbol("x");
+      re.getDynamicSymbol("x");
+    }
+  }
 
-    private static final int ELFCLASS32 = 1;
+  public boolean isDynamic() {
+    return mIsDynamic;
+  }
 
-    private static final int ELFCLASS64 = 2;
+  public int getType() {
+    return mType;
+  }
 
-    private static final long PT_LOAD = 1;
+  public boolean isPIE() {
+    return mIsPIE;
+  }
 
-    /** Section Type: Symbol Table */
-    private static final int SHT_SYMTAB = 2;
+  private ReadElf(File file) throws IOException {
+    mPath = file.getPath();
+    mFile = new RandomAccessFile(file, "r");
 
-    /** Section Type: String Table */
-    private static final int SHT_STRTAB = 3;
+    if (mFile.length() < EI_NIDENT) {
+      throw new IllegalArgumentException("Too small to be an ELF file: " + file);
+    }
 
-    /** Section Type: Dynamic **/
-    private static final int SHT_DYNAMIC = 6;
+    readHeader();
+  }
 
-    /** Section Type: Dynamic Symbol Table */
-    private static final int SHT_DYNSYM = 11;
+  public void close() {
+    try {
+      mFile.close();
+    } catch (IOException ignored) {
+    }
+  }
 
-    /** Symbol Table Entry: Name offset */
-    private static final int SYMTAB_NAME = 0;
+  protected void finalize() throws Throwable {
+    try {
+      close();
+    } finally {
+      super.finalize();
+    }
+  }
 
-    /** Symbol Table Entry: SymTab Info */
-    private static final int SYMTAB_ST_INFO = 6;
+  private void readHeader() throws IOException {
+    mFile.seek(0);
+    mFile.readFully(mBuffer, 0, EI_NIDENT);
 
-    /** Symbol Table Entry size (half-words) */
-    private static final int SYMTAB_ENTRY_HALFWORD_SIZE = 7;
+    if (mBuffer[0] != ELFMAG[0] || mBuffer[1] != ELFMAG[1] ||
+        mBuffer[2] != ELFMAG[2] || mBuffer[3] != ELFMAG[3]) {
+      throw new IllegalArgumentException("Invalid ELF file: " + mPath);
+    }
 
-    /**
-     * Symbol Table Entry size (extra in bytes) to cover "st_info" and
-     * "st_other"
-     */
-    private static final int SYMTAB_ENTRY_BYTE_EXTRA_SIZE = 2;
+    int elfClass = mBuffer[EI_CLASS];
+    if (elfClass == ELFCLASS32) {
+      mAddrSize = 4;
+    } else if (elfClass == ELFCLASS64) {
+      mAddrSize = 8;
+    } else {
+      throw new IOException("Invalid ELF EI_CLASS: " + elfClass + ": " + mPath);
+    }
 
-    public static class Symbol {
-        public static final int STB_LOCAL = 0;
+    mEndian = mBuffer[EI_DATA];
+    if (mEndian == ELFDATA2LSB) {
+    } else if (mEndian == ELFDATA2MSB) {
+      throw new IOException("Unsupported ELFDATA2MSB file: " + mPath);
+    } else {
+      throw new IOException("Invalid ELF EI_DATA: " + mEndian + ": " + mPath);
+    }
 
-        public static final int STB_GLOBAL = 1;
+    mType = readHalf();
 
-        public static final int STB_WEAK = 2;
+    int e_machine = readHalf();
+    if (e_machine != EM_386 && e_machine != EM_X86_64 &&
+        e_machine != EM_AARCH64 && e_machine != EM_ARM &&
+        e_machine != EM_MIPS &&
+        e_machine != EM_QDSP6) {
+      throw new IOException("Invalid ELF e_machine: " + e_machine + ": " + mPath);
+    }
 
-        public static final int STB_LOPROC = 13;
+    // AbiTest relies on us rejecting any unsupported combinations.
+    if ((e_machine == EM_386 && elfClass != ELFCLASS32) ||
+        (e_machine == EM_X86_64 && elfClass != ELFCLASS64) ||
+        (e_machine == EM_AARCH64 && elfClass != ELFCLASS64) ||
+        (e_machine == EM_ARM && elfClass != ELFCLASS32) ||
+        (e_machine == EM_QDSP6 && elfClass != ELFCLASS32)) {
+      throw new IOException("Invalid e_machine/EI_CLASS ELF combination: " +
+                            e_machine + "/" + elfClass + ": " + mPath);
+    }
 
-        public static final int STB_HIPROC = 15;
+    long e_version = readWord();
+    if (e_version != EV_CURRENT) {
+      throw new IOException("Invalid e_version: " + e_version + ": " + mPath);
+    }
 
-        public final String name;
+    long e_entry = readAddr();
 
-        public final int bind;
+    long ph_off = readOff();
+    long sh_off = readOff();
 
-        public final int type;
+    long e_flags = readWord();
+    int e_ehsize = readHalf();
+    int e_phentsize = readHalf();
+    int e_phnum = readHalf();
+    int e_shentsize = readHalf();
+    int e_shnum = readHalf();
+    int e_shstrndx = readHalf();
 
-        Symbol(String name, int st_info) {
-            this.name = name;
-            this.bind = (st_info >> 4) & 0x0F;
-            this.type = st_info & 0x0F;
+    readSectionHeaders(sh_off, e_shnum, e_shentsize, e_shstrndx);
+    readProgramHeaders(ph_off, e_phnum, e_phentsize);
+  }
+
+  private void readSectionHeaders(long sh_off, int e_shnum, int e_shentsize, int e_shstrndx) throws IOException {
+    // Read the Section Header String Table offset first.
+    {
+      mFile.seek(sh_off + e_shstrndx * e_shentsize);
+
+      long sh_name = readWord();
+      long sh_type = readWord();
+      long sh_flags = readX(mAddrSize);
+      long sh_addr = readAddr();
+      long sh_offset = readOff();
+      long sh_size = readX(mAddrSize);
+      // ...
+
+      if (sh_type == SHT_STRTAB) {
+        mShStrTabOffset = sh_offset;
+        mShStrTabSize = sh_size;
+      }
+    }
+
+    for (int i = 0; i < e_shnum; ++i) {
+      // Don't bother to re-read the Section Header StrTab.
+      if (i == e_shstrndx) {
+        continue;
+      }
+
+      mFile.seek(sh_off + i * e_shentsize);
+
+      long sh_name = readWord();
+      long sh_type = readWord();
+      long sh_flags = readX(mAddrSize);
+      long sh_addr = readAddr();
+      long sh_offset = readOff();
+      long sh_size = readX(mAddrSize);
+
+      if (sh_type == SHT_SYMTAB || sh_type == SHT_DYNSYM) {
+        final String symTabName = readShStrTabEntry(sh_name);
+        if (".symtab".equals(symTabName)) {
+          mSymTabOffset = sh_offset;
+          mSymTabSize = sh_size;
+        } else if (".dynsym".equals(symTabName)) {
+          mDynSymOffset = sh_offset;
+          mDynSymSize = sh_size;
         }
-    };
-
-    private final String mPath;
-    private final RandomAccessFile mFile;
-    private final byte[] mBuffer = new byte[512];
-    private int mEndian;
-    private boolean mIsDynamic;
-    private boolean mIsPIE;
-    private int mType;
-    private int mWordSize;
-    private int mHalfWordSize;
-
-    /** Symbol Table offset */
-    private long mSymTabOffset;
-
-    /** Symbol Table size */
-    private long mSymTabSize;
-
-    /** Dynamic Symbol Table offset */
-    private long mDynSymOffset;
-
-    /** Dynamic Symbol Table size */
-    private long mDynSymSize;
-
-    /** Section Header String Table offset */
-    private long mShStrTabOffset;
-
-    /** Section Header String Table size */
-    private long mShStrTabSize;
-
-    /** String Table offset */
-    private long mStrTabOffset;
-
-    /** String Table size */
-    private long mStrTabSize;
-
-    /** Dynamic String Table offset */
-    private long mDynStrOffset;
-
-    /** Dynamic String Table size */
-    private long mDynStrSize;
-
-    /** Symbol Table symbol names */
-    private Map<String, Symbol> mSymbols;
-
-    /** Dynamic Symbol Table symbol names */
-    private Map<String, Symbol> mDynamicSymbols;
-
-    public static ReadElf read(File file) throws IOException {
-        return new ReadElf(file);
-    }
-
-    public boolean isDynamic() {
-        return mIsDynamic;
-    }
-
-    public int getType() {
-        return mType;
-    }
-
-    public boolean isPIE() {
-        return mIsPIE;
-    }
-
-    private ReadElf(File file) throws IOException {
-        mPath = file.getPath();
-        mFile = new RandomAccessFile(file, "r");
-
-        if (mFile.length() < EI_NIDENT) {
-            throw new IllegalArgumentException("Too small to be an ELF file: " + file);
+      } else if (sh_type == SHT_STRTAB) {
+        final String strTabName = readShStrTabEntry(sh_name);
+        if (".strtab".equals(strTabName)) {
+          mStrTabOffset = sh_offset;
+          mStrTabSize = sh_size;
+        } else if (".dynstr".equals(strTabName)) {
+          mDynStrOffset = sh_offset;
+          mDynStrSize = sh_size;
         }
-
-        readIdent();
-        readHeader();
+      } else if (sh_type == SHT_DYNAMIC) {
+        mIsDynamic = true;
+      }
     }
+  }
 
-    public void close() {
-        try {
-            mFile.close();
-        } catch (IOException ignored) {
+  private void readProgramHeaders(long ph_off, int e_phnum, int e_phentsize) throws IOException {
+    for (int i = 0; i < e_phnum; ++i) {
+      mFile.seek(ph_off + i * e_phentsize);
+
+      long p_type = readWord();
+      if (p_type == PT_LOAD) {
+        if (mAddrSize == 8) {
+          long p_flags = readWord(); // Only in Elf64_phdr; in Elf32_phdr p_flags is at the end.
         }
-    }
+        long p_offset = readOff();
+        long p_vaddr = readAddr();
+        // ...
 
-    protected void finalize() throws Throwable {
-        try {
-            close();
-        } finally {
-            super.finalize();
+        if (p_vaddr == 0) {
+          mIsPIE = true;
         }
+      }
+    }
+  }
+
+  private HashMap<String, Symbol> readSymbolTable(long symStrOffset, long symStrSize,
+                                                  long tableOffset, long tableSize) throws IOException {
+    HashMap<String, Symbol> result = new HashMap<String, Symbol>();
+    mFile.seek(tableOffset);
+    while (mFile.getFilePointer() < tableOffset + tableSize) {
+      long st_name = readWord();
+      int st_info;
+      if (mAddrSize == 8) {
+        st_info = readByte();
+        int st_other = readByte();
+        int st_shndx = readHalf();
+        long st_value = readAddr();
+        long st_size = readX(mAddrSize);
+      } else {
+        long st_value = readAddr();
+        long st_size = readWord();
+        st_info = readByte();
+        int st_other = readByte();
+        int st_shndx = readHalf();
+      }
+      if (st_name == 0) {
+        continue;
+      }
+
+      final String symName = readStrTabEntry(symStrOffset, symStrSize, st_name);
+      if (symName != null) {
+        Symbol s = new Symbol(symName, st_info);
+        result.put(symName, s);
+      }
+    }
+    return result;
+  }
+
+  private String readShStrTabEntry(long strOffset) throws IOException {
+    if (mShStrTabOffset == 0 || strOffset < 0 || strOffset >= mShStrTabSize) {
+      return null;
+    }
+    return readString(mShStrTabOffset + strOffset);
+  }
+
+  private String readStrTabEntry(long tableOffset, long tableSize, long strOffset) throws IOException {
+    if (tableOffset == 0 || strOffset < 0 || strOffset >= tableSize) {
+      return null;
+    }
+    return readString(tableOffset + strOffset);
+  }
+
+  private int readHalf() throws IOException {
+    return (int) readX(2);
+  }
+
+  private long readWord() throws IOException {
+    return readX(4);
+  }
+
+  private long readOff() throws IOException {
+    return readX(mAddrSize);
+  }
+
+  private long readAddr() throws IOException {
+    return readX(mAddrSize);
+  }
+
+  private long readX(int byteCount) throws IOException {
+    mFile.readFully(mBuffer, 0, byteCount);
+
+    int answer = 0;
+    if (mEndian == ELFDATA2LSB) {
+      for (int i = byteCount - 1; i >= 0; i--) {
+        answer = (answer << 8) | (mBuffer[i] & 0xff);
+      }
+    } else {
+      final int N = byteCount - 1;
+      for (int i = 0; i <= N; ++i) {
+        answer = (answer << 8) | (mBuffer[i] & 0xff);
+      }
     }
 
-    private void readHeader() throws IOException {
-        mType = readHalf(getHeaderOffset(OFFSET_TYPE));
-        int e_machine = readHalf(getHeaderOffset(OFFSET_MACHINE));
-        if (e_machine != EM_386 && e_machine != EM_MIPS && e_machine != EM_ARM &&
-                e_machine != EM_QDSP6) {
-            throw new IOException("Invalid ELF e_machine: " + e_machine + ": " + mPath);
-        }
+    return answer;
+  }
 
-        final long shOffset = readWord(getHeaderOffset(OFFSET_SHOFF));
-        final int shNumber = readHalf(getHeaderOffset(OFFSET_SHNUM));
-        final int shSize = readHalf(getHeaderOffset(OFFSET_SHENTSIZE));
-        final int shStrIndex = readHalf(getHeaderOffset(OFFSET_SHSTRNDX));
+  private String readString(long offset) throws IOException {
+    long originalOffset = mFile.getFilePointer();
+    mFile.seek(offset);
+    mFile.readFully(mBuffer, 0, (int) Math.min(mBuffer.length, mFile.length() - offset));
+    mFile.seek(originalOffset);
 
-        readSectionHeaders(shOffset, shNumber, shSize, shStrIndex);
-
-        final long phOffset = readWord(getHeaderOffset(OFFSET_PHOFF));
-        final int phNumber = readHalf(getHeaderOffset(OFFSET_PHNUM));
-        final int phSize = readHalf(getHeaderOffset(OFFSET_PHENTSIZE));
-
-        readProgramHeaders(phOffset, phNumber, phSize);
+    for (int i = 0; i < mBuffer.length; ++i) {
+      if (mBuffer[i] == 0) {
+        return new String(mBuffer, 0, i);
+      }
     }
 
-    private void readSectionHeaders(long tableOffset, int shNumber, int shSize, int shStrIndex)
-            throws IOException {
-        // Read the Section Header String Table offset first.
-        {
-            final long shStrTabShOffset = tableOffset + shStrIndex * shSize;
-            final long type = readWord(shStrTabShOffset + mHalfWordSize * SHOFF_TYPE);
+    return null;
+  }
 
-            if (type == SHT_STRTAB) {
-                mShStrTabOffset = readWord(shStrTabShOffset + mHalfWordSize * SHOFF_OFFSET);
-                mShStrTabSize = readWord(shStrTabShOffset + mHalfWordSize * SHOFF_SIZE);
-            }
-        }
+  private int readByte() throws IOException {
+    return mFile.read() & 0xff;
+  }
 
-        for (int i = 0; i < shNumber; i++) {
-            // Don't bother to re-read the Section Header StrTab.
-            if (i == shStrIndex) {
-                continue;
-            }
-
-            final long shOffset = tableOffset + i * shSize;
-
-            final long type = readWord(shOffset + mHalfWordSize * SHOFF_TYPE);
-            if ((type == SHT_SYMTAB) || (type == SHT_DYNSYM)) {
-                final long nameOffset = readWord(shOffset + mHalfWordSize * SHOFF_NAME);
-                final long offset = readWord(shOffset + mHalfWordSize * SHOFF_OFFSET);
-                final long size = readWord(shOffset + mHalfWordSize * SHOFF_SIZE);
-
-                final String symTabName = readShStrTabEntry(nameOffset);
-                if (".symtab".equals(symTabName)) {
-                    mSymTabOffset = offset;
-                    mSymTabSize = size;
-                } else if (".dynsym".equals(symTabName)) {
-                    mDynSymOffset = offset;
-                    mDynSymSize = size;
-                }
-            } else if (type == SHT_STRTAB) {
-                final long nameOffset = readWord(shOffset + mHalfWordSize * SHOFF_NAME);
-                final long offset = readWord(shOffset + mHalfWordSize * SHOFF_OFFSET);
-                final long size = readWord(shOffset + mHalfWordSize * SHOFF_SIZE);
-
-                final String strTabName = readShStrTabEntry(nameOffset);
-                if (".strtab".equals(strTabName)) {
-                    mStrTabOffset = offset;
-                    mStrTabSize = size;
-                } else if (".dynstr".equals(strTabName)) {
-                    mDynStrOffset = offset;
-                    mDynStrSize = size;
-                }
-            } else if (type == SHT_DYNAMIC) {
-                mIsDynamic = true;
-            }
-        }
-    }
-
-    private void readProgramHeaders(long phOffset, int phNumber, int phSize) throws IOException {
-        for (int i = 0; i < phNumber; i++) {
-            final long baseOffset = phOffset + i * phSize;
-            final long type = readWord(baseOffset);
-            if (type == PT_LOAD) {
-                final long virtAddress = readWord(baseOffset + mHalfWordSize * PHOFF_VADDR);
-                if (virtAddress == 0) {
-                    mIsPIE = true;
-                }
-            }
-        }
-    }
-
-    private void readSymbolTable(Map<String, Symbol> symbolMap, long symStrOffset, long symStrSize,
-            long symOffset, long symSize) throws IOException {
-        final long symEnd = symOffset + symSize;
-        for (long off = symOffset; off < symEnd; off += SYMTAB_ENTRY_HALFWORD_SIZE * mHalfWordSize
-                + SYMTAB_ENTRY_BYTE_EXTRA_SIZE) {
-            long strOffset = readWord(off + SYMTAB_NAME);
-            if (strOffset == 0) {
-                continue;
-            }
-
-            final String symName = readStrTabEntry(symStrOffset, symStrSize, strOffset);
-            if (symName != null) {
-                final int st_info = readByte(off + SYMTAB_ST_INFO);
-                symbolMap.put(symName, new Symbol(symName, st_info));
-            }
-        }
-    }
-
-    private String readShStrTabEntry(long strOffset) throws IOException {
-        if ((mShStrTabOffset == 0) || (strOffset < 0) || (strOffset >= mShStrTabSize)) {
-            return null;
-        }
-
-        return readString(mShStrTabOffset + strOffset);
-    }
-
-    private String readStrTabEntry(long tableOffset, long tableSize, long strOffset)
-            throws IOException {
-        if ((tableOffset == 0) || (strOffset < 0) || (strOffset >= tableSize)) {
-            return null;
-        }
-
-        return readString(tableOffset + strOffset);
-    }
-
-    private int getHeaderOffset(int halfWorldOffset) {
-        return EI_NIDENT + halfWorldOffset * mHalfWordSize;
-    }
-
-    private int readByte(long offset) throws IOException {
-        mFile.seek(offset);
-        mFile.readFully(mBuffer, 0, 1);
-
-        return mBuffer[0] & 0xff;
-    }
-
-    private int readHalf(long offset) throws IOException {
-        mFile.seek(offset);
-        mFile.readFully(mBuffer, 0, mWordSize);
-
-        final int answer;
-        if (mEndian == ELFDATA2LSB) {
-            answer = mBuffer[1] << 8 | (mBuffer[0] & 0xff);
-        } else {
-            answer = mBuffer[0] << 8 | (mBuffer[1] & 0xff);
-        }
-
-        return answer;
-    }
-
-    private long readWord(long offset) throws IOException {
-        mFile.seek(offset);
-        mFile.readFully(mBuffer, 0, mWordSize);
-
-        int answer = 0;
-        if (mEndian == ELFDATA2LSB) {
-            for (int i = mWordSize - 1; i >= 0; i--) {
-                answer = (answer << 8) | (mBuffer[i] & 0xff);
-            }
-        } else {
-            final int N = mWordSize - 1;
-            for (int i = 0; i <= N; i++) {
-                answer = (answer << 8) | (mBuffer[i] & 0xff);
-            }
-        }
-
-        return answer;
-    }
-
-    private String readString(long offset) throws IOException {
-        mFile.seek(offset);
-        mFile.readFully(mBuffer, 0, (int) Math.min(mBuffer.length, mFile.length() - offset));
-
-        for (int i = 0; i < mBuffer.length; i++) {
-            if (mBuffer[i] == 0) {
-                return new String(mBuffer, 0, i);
-            }
-        }
-
+  public Symbol getSymbol(String name) {
+    if (mSymbols == null) {
+      try {
+        mSymbols = readSymbolTable(mStrTabOffset, mStrTabSize, mSymTabOffset, mSymTabSize);
+      } catch (IOException e) {
         return null;
+      }
     }
+    return mSymbols.get(name);
+  }
 
-    private void readIdent() throws IOException {
-        mFile.seek(0);
-        mFile.readFully(mBuffer, 0, EI_NIDENT);
-
-        if ((mBuffer[0] != ELF_IDENT[0]) || (mBuffer[1] != ELF_IDENT[1])
-                || (mBuffer[2] != ELF_IDENT[2]) || (mBuffer[3] != ELF_IDENT[3])) {
-            throw new IllegalArgumentException("Invalid ELF file: " + mPath);
-        }
-
-        int elfClass = mBuffer[EI_CLASS];
-        if (elfClass == ELFCLASS32) {
-            mWordSize = 4;
-            mHalfWordSize = 2;
-        } else if (elfClass == ELFCLASS64) {
-            throw new IOException("Unsupported ELFCLASS64 file: " + mPath);
-        } else {
-            throw new IOException("Invalid ELF EI_CLASS: " + elfClass + ": " + mPath);
-        }
-
-        mEndian = mBuffer[EI_DATA];
-        if (mEndian == ELFDATA2LSB) {
-        } else if (mEndian == ELFDATA2MSB) {
-            throw new IOException("Unsupported ELFDATA2MSB file: " + mPath);
-        } else {
-            throw new IOException("Invalid ELF EI_DATA: " + mEndian + ": " + mPath);
-        }
+  public Symbol getDynamicSymbol(String name) {
+    if (mDynamicSymbols == null) {
+      try {
+        mDynamicSymbols = readSymbolTable(mDynStrOffset, mDynStrSize, mDynSymOffset, mDynSymSize);
+      } catch (IOException e) {
+        return null;
+      }
     }
-
-    public Symbol getSymbol(String name) {
-        if ((mSymTabOffset == 0) && (mSymTabSize == 0)) {
-            return null;
-        }
-
-        if (mSymbols == null) {
-            mSymbols = new HashMap<String, Symbol>();
-            try {
-                readSymbolTable(mSymbols, mStrTabOffset, mStrTabSize, mSymTabOffset, mSymTabSize);
-            } catch (IOException e) {
-                return null;
-            }
-        }
-
-        return mSymbols.get(name);
-    }
-
-    public Symbol getDynamicSymbol(String name) {
-        if ((mDynSymOffset == 0) && (mDynSymSize == 0)) {
-            return null;
-        }
-
-        if (mDynamicSymbols == null) {
-            mDynamicSymbols = new HashMap<String, Symbol>();
-            try {
-                readSymbolTable(mDynamicSymbols, mDynStrOffset, mDynStrSize, mDynSymOffset,
-                        mDynSymSize);
-            } catch (IOException e) {
-                return null;
-            }
-        }
-
-        return mDynamicSymbols.get(name);
-    }
+    return mDynamicSymbols.get(name);
+  }
 }
diff --git a/tests/tests/os/src/android/os/storage/cts/StorageManagerTest.java b/tests/tests/os/src/android/os/storage/cts/StorageManagerTest.java
index 4183c2d..7d2d4ff 100644
--- a/tests/tests/os/src/android/os/storage/cts/StorageManagerTest.java
+++ b/tests/tests/os/src/android/os/storage/cts/StorageManagerTest.java
@@ -30,7 +30,6 @@
 import android.util.Log;
 
 import libcore.io.Streams;
-import org.junit.Assert;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -168,7 +167,10 @@
     private static void assertFileContains(File file, String contents) throws IOException {
         byte[] actual = Streams.readFully(new FileInputStream(file));
         byte[] expected = contents.getBytes("UTF-8");
-        Assert.assertArrayEquals(expected, actual);
+        assertEquals("unexpected size", expected.length, actual.length);
+        for (int i = 0; i < expected.length; i++) {
+            assertEquals("unexpected value at offset " + i, expected[i], actual[i]);
+        }
     }
 
     private static class ObbObserver extends OnObbStateChangeListener {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestGetSet.java b/tests/tests/renderscript/src/android/renderscript/cts/TestGetSet.java
new file mode 100644
index 0000000..d11de84
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/TestGetSet.java
@@ -0,0 +1,1084 @@
+ /*
+ * 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.renderscript.cts;
+
+import android.renderscript.*;
+
+public class TestGetSet extends RSBaseCompute {
+
+    private ScriptC_getset script;
+    private ScriptC_getset_relaxed scriptRelaxed;
+    Allocation walkAlloc;
+    Allocation in1DAlloc;
+    Allocation out1DAlloc;
+    Allocation in2DAlloc;
+    Allocation out2DAlloc;
+    Allocation in3DAlloc;
+    Allocation out3DAlloc;
+    private static java.util.Random random = new java.util.Random();
+
+    final int gWidth = 252;
+    final int gHeight = 31;
+    final int gDepth = 4;
+    final int gCount = gWidth * gHeight * gDepth;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        random.setSeed(10);
+        script = new ScriptC_getset(mRS);
+        scriptRelaxed = new ScriptC_getset_relaxed(mRS);
+        script.set_gWidth(gWidth);
+        script.set_gHeight(gHeight);
+        scriptRelaxed.set_gWidth(gWidth);
+        scriptRelaxed.set_gHeight(gHeight);
+    }
+
+
+
+    protected void createWalk(int vsize) {
+        // We do a random copy order to attempt to get multiple threads
+        // reading and writing the same cache line
+        // We could do this as a simple walk but that would likely miss
+        // some caching issues.
+        final int tw = gCount / vsize;
+        int tmp[] = new int[tw];
+        boolean b[] = new boolean[tw];
+        int toCopy = tw;
+        int i = 0;
+
+        while (toCopy > 0) {
+            int x = random.nextInt(tw);
+
+            while ((x < tw) && b[x]) {
+                x++;
+                if (x >= tw) {
+                    x = 0;
+                }
+            }
+
+            b[x] = true;
+            toCopy --;
+
+            //android.util.Log.v("rs", "walk  " + i + ", " + x);
+            tmp[i++] = x;
+        }
+
+        walkAlloc = Allocation.createSized(mRS, Element.I32(mRS), tw);
+        walkAlloc.copy1DRangeFrom(0, tw, tmp);
+    }
+
+    private void testSetup(Element e) {
+        int vs = e.getVectorSize();
+        if (vs == 3) {
+            vs = 4;
+        }
+        createWalk(vs);
+
+        Type t1 = Type.createX(mRS, e, gWidth * gHeight * gDepth / vs);
+        in1DAlloc = Allocation.createTyped(mRS, t1);
+        out1DAlloc = Allocation.createTyped(mRS, t1);
+        script.set_gAlloc1DIn(in1DAlloc);
+        script.set_gAlloc1DOut(out1DAlloc);
+        scriptRelaxed.set_gAlloc1DIn(in1DAlloc);
+        scriptRelaxed.set_gAlloc1DOut(out1DAlloc);
+
+        Type t2 = Type.createXY(mRS, e, gWidth / vs, gHeight * gDepth);
+        in2DAlloc = Allocation.createTyped(mRS, t2);
+        out2DAlloc = Allocation.createTyped(mRS, t2);
+        script.set_gAlloc2DIn(in2DAlloc);
+        script.set_gAlloc2DOut(out2DAlloc);
+        scriptRelaxed.set_gAlloc2DIn(in2DAlloc);
+        scriptRelaxed.set_gAlloc2DOut(out2DAlloc);
+
+        Type t3 = Type.createXYZ(mRS, e, gWidth / vs, gHeight, gDepth);
+        in3DAlloc = Allocation.createTyped(mRS, t3);
+        out3DAlloc = Allocation.createTyped(mRS, t3);
+        script.set_gAlloc3DIn(in3DAlloc);
+        script.set_gAlloc3DOut(out3DAlloc);
+        scriptRelaxed.set_gAlloc3DIn(in3DAlloc);
+        scriptRelaxed.set_gAlloc3DOut(out3DAlloc);
+    }
+
+    private void verify(byte[] a1, byte[] a2, Allocation alloc, String s, int vsize) {
+        alloc.copyTo(a2);
+        for (int i=0; i < gWidth; i++) {
+            if (a1[i] != a2[i]) {
+                if ((vsize == 3) && ((i % 4) == 3)) {
+                    continue;
+                }
+                throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i);
+            }
+            a2[i] = 0;
+        }
+        alloc.copyFrom(a2);
+    }
+
+    private void verify(short[] a1, short[] a2, Allocation alloc, String s, int vsize) {
+        alloc.copyTo(a2);
+        for (int i=0; i < gWidth; i++) {
+            if (a1[i] != a2[i]) {
+                if ((vsize == 3) && ((i % 4) == 3)) {
+                    continue;
+                }
+                throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i);
+            }
+            a2[i] = 0;
+        }
+        alloc.copyFrom(a2);
+    }
+
+    private void verify(int[] a1, int[] a2, Allocation alloc, String s, int vsize) {
+        alloc.copyTo(a2);
+        for (int i=0; i < gWidth; i++) {
+            if (a1[i] != a2[i]) {
+                if ((vsize == 3) && ((i % 4) == 3)) {
+                    continue;
+                }
+                throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i);
+            }
+            a2[i] = 0;
+        }
+        alloc.copyFrom(a2);
+    }
+
+    private void verify(long[] a1, long[] a2, Allocation alloc, String s, int vsize) {
+        alloc.copyTo(a2);
+        for (int i=0; i < gWidth; i++) {
+            if (a1[i] != a2[i]) {
+                if ((vsize == 3) && ((i % 4) == 3)) {
+                    continue;
+                }
+                throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i);
+            }
+            a2[i] = 0;
+        }
+        alloc.copyFrom(a2);
+    }
+
+    private void verify(float[] a1, float[] a2, Allocation alloc, String s, int vsize) {
+        alloc.copyTo(a2);
+        for (int i=0; i < gWidth; i++) {
+            if (a1[i] != a2[i]) {
+                if ((vsize == 3) && ((i % 4) == 3)) {
+                    continue;
+                }
+                throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i);
+            }
+            a2[i] = 0;
+        }
+        alloc.copyFrom(a2);
+    }
+
+    private void verify(double[] a1, double[] a2, Allocation alloc, String s, int vsize) {
+        alloc.copyTo(a2);
+        for (int i=0; i < gWidth; i++) {
+            if (a1[i] != a2[i]) {
+                if ((vsize == 3) && ((i % 4) == 3)) {
+                    continue;
+                }
+                throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i);
+            }
+            a2[i] = 0;
+        }
+        alloc.copyFrom(a2);
+    }
+
+    private byte[] randomByteArray(int len) {
+        byte t[] = new byte[len];
+        random.nextBytes(t);
+        in1DAlloc.copyFrom(t);
+        in2DAlloc.copyFrom(t);
+        in3DAlloc.copyFrom(t);
+        return t;
+    }
+
+    private short[] randomShortArray(int len) {
+        short t[] = new short[len];
+        for (int i = 0; i < t.length; i++) {
+            t[i] = (short)(random.nextInt() & 0xffff);
+        }
+        in1DAlloc.copyFrom(t);
+        in2DAlloc.copyFrom(t);
+        in3DAlloc.copyFrom(t);
+        return t;
+    }
+
+    private int[] randomIntArray(int len) {
+        int t[] = new int[len];
+        for (int i = 0; i < t.length; i++) {
+            t[i] = random.nextInt();
+        }
+        in1DAlloc.copyFrom(t);
+        in2DAlloc.copyFrom(t);
+        in3DAlloc.copyFrom(t);
+        return t;
+    }
+
+    private long[] randomLongArray(int len) {
+        long t[] = new long[len];
+        for (int i = 0; i < t.length; i++) {
+            t[i] = random.nextLong();
+        }
+        in1DAlloc.copyFrom(t);
+        in2DAlloc.copyFrom(t);
+        in3DAlloc.copyFrom(t);
+        return t;
+    }
+
+    private float[] randomFloatArray(int len) {
+        float t[] = new float[len];
+        for (int i = 0; i < t.length; i++) {
+            t[i] = random.nextFloat();
+        }
+        in1DAlloc.copyFrom(t);
+        in2DAlloc.copyFrom(t);
+        in3DAlloc.copyFrom(t);
+        return t;
+    }
+
+    private double[] randomDoubleArray(int len) {
+        double t[] = new double[len];
+        for (int i = 0; i < t.length; i++) {
+            t[i] = random.nextDouble();
+        }
+        in1DAlloc.copyFrom(t);
+        in2DAlloc.copyFrom(t);
+        in3DAlloc.copyFrom(t);
+        return t;
+    }
+
+    public void testGetSet_char() {
+        testSetup(Element.I8(mRS));
+        byte tmp[] = randomByteArray(gCount);
+        byte tmp2[] = new byte[gCount];
+
+        script.forEach_copy1D_char(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch char: ", 1);
+        scriptRelaxed.forEach_copy1D_char(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed char: ", 1);
+
+        script.forEach_copy2D_char(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch char: ", 1);
+        scriptRelaxed.forEach_copy2D_char(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed char: ", 1);
+
+        script.forEach_copy3D_char(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch char: ", 1);
+        scriptRelaxed.forEach_copy3D_char(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed char: ", 1);
+    }
+
+    public void testGetSet_char2() {
+        testSetup(Element.I8_2(mRS));
+        byte tmp[] = randomByteArray(gCount);
+        byte tmp2[] = new byte[gCount];
+        script.forEach_copy1D_char2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch char2: ", 2);
+        scriptRelaxed.forEach_copy1D_char2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed char2: ", 2);
+
+        script.forEach_copy2D_char2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch char2: ", 2);
+        scriptRelaxed.forEach_copy2D_char2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed char2: ", 2);
+
+        script.forEach_copy3D_char2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch char2: ", 2);
+        scriptRelaxed.forEach_copy3D_char2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed char2: ", 2);
+    }
+
+    public void testGetSet_char3() {
+        testSetup(Element.I8_3(mRS));
+        byte tmp[] = randomByteArray(gCount);
+        byte tmp2[] = new byte[gCount];
+        script.forEach_copy1D_char3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch char3: ", 3);
+        scriptRelaxed.forEach_copy1D_char3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed char3: ", 3);
+
+        script.forEach_copy2D_char3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch char3: ", 3);
+        scriptRelaxed.forEach_copy2D_char3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed char3: ", 3);
+
+        script.forEach_copy3D_char3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch char3: ", 3);
+        scriptRelaxed.forEach_copy3D_char3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed char3: ", 3);
+    }
+
+    public void testGetSet_char4() {
+        testSetup(Element.I8_4(mRS));
+        byte tmp[] = randomByteArray(gCount);
+        byte tmp2[] = new byte[gCount];
+        script.forEach_copy1D_char4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch char4: ", 4);
+        scriptRelaxed.forEach_copy1D_char4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed char4: ", 4);
+
+        script.forEach_copy2D_char4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch char4: ", 4);
+        scriptRelaxed.forEach_copy2D_char4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed char4: ", 4);
+
+        script.forEach_copy3D_char4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch char4: ", 4);
+        scriptRelaxed.forEach_copy3D_char4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed char4: ", 4);
+    }
+
+    public void testGetSet_uchar() {
+        testSetup(Element.U8(mRS));
+        byte tmp[] = randomByteArray(gCount);
+        byte tmp2[] = new byte[gCount];
+        script.forEach_copy1D_uchar(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch uchar: ", 1);
+        scriptRelaxed.forEach_copy1D_uchar(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uchar: ", 1);
+
+        script.forEach_copy2D_uchar(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch uchar: ", 1);
+        scriptRelaxed.forEach_copy2D_uchar(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uchar: ", 1);
+
+        script.forEach_copy3D_uchar(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch uchar: ", 1);
+        scriptRelaxed.forEach_copy3D_uchar(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uchar: ", 1);
+    }
+
+    public void testGetSet_uchar2() {
+        testSetup(Element.U8_2(mRS));
+        byte tmp[] = randomByteArray(gCount);
+        byte tmp2[] = new byte[gCount];
+        script.forEach_copy1D_uchar2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch uchar2: ", 2);
+        scriptRelaxed.forEach_copy1D_uchar2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uchar2: ", 2);
+
+        script.forEach_copy2D_uchar2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch uchar2: ", 2);
+        scriptRelaxed.forEach_copy2D_uchar2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uchar2: ", 2);
+
+        script.forEach_copy3D_uchar2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch uchar2: ", 2);
+        scriptRelaxed.forEach_copy3D_uchar2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uchar2: ", 2);
+    }
+
+    public void testGetSet_uchar3() {
+        testSetup(Element.U8_3(mRS));
+        byte tmp[] = randomByteArray(gCount);
+        byte tmp2[] = new byte[gCount];
+        script.forEach_copy1D_uchar3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch uchar3: ", 3);
+        scriptRelaxed.forEach_copy1D_uchar3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uchar3: ", 3);
+
+        script.forEach_copy2D_uchar3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch uchar3: ", 3);
+        scriptRelaxed.forEach_copy2D_uchar3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uchar3: ", 3);
+
+        script.forEach_copy3D_uchar3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch uchar3: ", 3);
+        scriptRelaxed.forEach_copy3D_uchar3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uchar3: ", 3);
+    }
+
+    public void testGetSet_uchar4() {
+        testSetup(Element.U8_4(mRS));
+        byte tmp[] = randomByteArray(gCount);
+        byte tmp2[] = new byte[gCount];
+        script.forEach_copy1D_uchar4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch uchar4: ", 4);
+        scriptRelaxed.forEach_copy1D_uchar4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uchar4: ", 4);
+
+        script.forEach_copy2D_uchar4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch uchar4: ", 4);
+        scriptRelaxed.forEach_copy2D_uchar4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uchar4: ", 4);
+
+        script.forEach_copy3D_uchar4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch uchar4: ", 4);
+        scriptRelaxed.forEach_copy3D_uchar4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uchar4: ", 4);
+    }
+
+
+
+
+
+
+    public void testGetSet_short() {
+        testSetup(Element.I16(mRS));
+        short tmp[] = randomShortArray(gCount);
+        short tmp2[] = new short[gCount];
+        script.forEach_copy1D_short(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch short: ", 1);
+        scriptRelaxed.forEach_copy1D_short(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed short: ", 1);
+
+        script.forEach_copy2D_short(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch short: ", 1);
+        scriptRelaxed.forEach_copy2D_short(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed short: ", 1);
+
+        script.forEach_copy3D_short(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch short: ", 1);
+        scriptRelaxed.forEach_copy3D_short(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed short: ", 1);
+    }
+
+    public void testGetSet_short2() {
+        testSetup(Element.I16_2(mRS));
+        short tmp[] = randomShortArray(gCount);
+        short tmp2[] = new short[gCount];
+        script.forEach_copy1D_short2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch short2: ", 2);
+        scriptRelaxed.forEach_copy1D_short2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed short2: ", 2);
+
+        script.forEach_copy2D_short2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch short2: ", 2);
+        scriptRelaxed.forEach_copy2D_short2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed short2: ", 2);
+
+        script.forEach_copy3D_short2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch short2: ", 2);
+        scriptRelaxed.forEach_copy3D_short2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed short2: ", 2);
+    }
+
+    public void testGetSet_short3() {
+        testSetup(Element.I16_3(mRS));
+        short tmp[] = randomShortArray(gCount);
+        short tmp2[] = new short[gCount];
+        script.forEach_copy1D_short3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch short3: ", 3);
+        scriptRelaxed.forEach_copy1D_short3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed short3: ", 3);
+
+        script.forEach_copy2D_short3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch short3: ", 3);
+        scriptRelaxed.forEach_copy2D_short3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed short3: ", 3);
+
+        script.forEach_copy3D_short3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch short3: ", 3);
+        scriptRelaxed.forEach_copy3D_short3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed short3: ", 3);
+    }
+
+    public void testGetSet_short4() {
+        testSetup(Element.I16_4(mRS));
+        short tmp[] = randomShortArray(gCount);
+        short tmp2[] = new short[gCount];
+        script.forEach_copy1D_short4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch short4: ", 4);
+        scriptRelaxed.forEach_copy1D_short4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed short4: ", 4);
+
+        script.forEach_copy2D_short4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch short4: ", 4);
+        scriptRelaxed.forEach_copy2D_short4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed short4: ", 4);
+
+        script.forEach_copy3D_short4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch short4: ", 4);
+        scriptRelaxed.forEach_copy3D_short4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed short4: ", 4);
+    }
+
+    public void testGetSet_ushort() {
+        testSetup(Element.U16(mRS));
+        short tmp[] = randomShortArray(gCount);
+        short tmp2[] = new short[gCount];
+        script.forEach_copy1D_ushort(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch ushort: ", 1);
+        scriptRelaxed.forEach_copy1D_ushort(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ushort: ", 1);
+
+        script.forEach_copy2D_ushort(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch ushort: ", 1);
+        scriptRelaxed.forEach_copy2D_ushort(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ushort: ", 1);
+
+        script.forEach_copy3D_ushort(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch ushort: ", 1);
+        scriptRelaxed.forEach_copy3D_ushort(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ushort: ", 1);
+    }
+
+    public void testGetSet_ushort2() {
+        testSetup(Element.U16_2(mRS));
+        short tmp[] = randomShortArray(gCount);
+        short tmp2[] = new short[gCount];
+        script.forEach_copy1D_ushort2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch ushort2: ", 2);
+        scriptRelaxed.forEach_copy1D_ushort2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ushort2: ", 2);
+
+        script.forEach_copy2D_ushort2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch ushort2: ", 2);
+        scriptRelaxed.forEach_copy2D_ushort2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ushort2: ", 2);
+
+        script.forEach_copy3D_ushort2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch ushort2: ", 2);
+        scriptRelaxed.forEach_copy3D_ushort2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ushort2: ", 2);
+    }
+
+    public void testGetSet_ushort3() {
+        testSetup(Element.U16_3(mRS));
+        short tmp[] = randomShortArray(gCount);
+        short tmp2[] = new short[gCount];
+        script.forEach_copy1D_ushort3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch ushort3: ", 3);
+        scriptRelaxed.forEach_copy1D_ushort3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ushort3: ", 3);
+
+        script.forEach_copy2D_ushort3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch ushort3: ", 3);
+        scriptRelaxed.forEach_copy2D_ushort3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ushort3: ", 3);
+
+        script.forEach_copy3D_ushort3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch ushort3: ", 3);
+        scriptRelaxed.forEach_copy3D_ushort3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ushort3: ", 3);
+    }
+
+    public void testGetSet_ushort4() {
+        testSetup(Element.U16_4(mRS));
+        short tmp[] = randomShortArray(gCount);
+        short tmp2[] = new short[gCount];
+        script.forEach_copy1D_ushort4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch ushort4: ", 4);
+        scriptRelaxed.forEach_copy1D_ushort4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ushort4: ", 4);
+
+        script.forEach_copy2D_ushort4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch ushort4: ", 4);
+        scriptRelaxed.forEach_copy2D_ushort4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ushort4: ", 4);
+
+        script.forEach_copy3D_ushort4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch ushort4: ", 4);
+        scriptRelaxed.forEach_copy3D_ushort4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ushort4: ", 4);
+    }
+
+
+
+
+    public void testGetSet_int() {
+        testSetup(Element.I32(mRS));
+        int tmp[] = randomIntArray(gCount);
+        int tmp2[] = new int[gCount];
+        script.forEach_copy1D_int(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch int: ", 1);
+        scriptRelaxed.forEach_copy1D_int(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed int: ", 1);
+
+        script.forEach_copy2D_int(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch int: ", 1);
+        scriptRelaxed.forEach_copy2D_int(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed int: ", 1);
+
+        script.forEach_copy3D_int(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch int: ", 1);
+        scriptRelaxed.forEach_copy3D_int(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed int: ", 1);
+    }
+
+    public void testGetSet_int2() {
+        testSetup(Element.I32_2(mRS));
+        int tmp[] = randomIntArray(gCount);
+        int tmp2[] = new int[gCount];
+        script.forEach_copy1D_int2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch int2: ", 2);
+        scriptRelaxed.forEach_copy1D_int2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed int2: ", 2);
+
+        script.forEach_copy2D_int2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch int2: ", 2);
+        scriptRelaxed.forEach_copy2D_int2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed int2: ", 2);
+
+        script.forEach_copy3D_int2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch int2: ", 2);
+        scriptRelaxed.forEach_copy3D_int2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed int2: ", 2);
+    }
+
+    public void testGetSet_int3() {
+        testSetup(Element.I32_3(mRS));
+        int tmp[] = randomIntArray(gCount);
+        int tmp2[] = new int[gCount];
+        script.forEach_copy1D_int3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch int3: ", 3);
+        scriptRelaxed.forEach_copy1D_int3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed int3: ", 3);
+
+        script.forEach_copy2D_int3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch int3: ", 3);
+        scriptRelaxed.forEach_copy2D_int3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed int3: ", 3);
+
+        script.forEach_copy3D_int3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch int3: ", 3);
+        scriptRelaxed.forEach_copy3D_int3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed int3: ", 3);
+    }
+
+    public void testGetSet_int4() {
+        testSetup(Element.I32_4(mRS));
+        int tmp[] = randomIntArray(gCount);
+        int tmp2[] = new int[gCount];
+        script.forEach_copy1D_int4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch int4: ", 4);
+        scriptRelaxed.forEach_copy1D_int4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed int4: ", 4);
+
+        script.forEach_copy2D_int4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch int4: ", 4);
+        scriptRelaxed.forEach_copy2D_int4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed int4: ", 4);
+
+        script.forEach_copy3D_int4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch int4: ", 4);
+        scriptRelaxed.forEach_copy3D_int4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed int4: ", 4);
+    }
+
+    public void testGetSet_uint() {
+        testSetup(Element.U32(mRS));
+        int tmp[] = randomIntArray(gCount);
+        int tmp2[] = new int[gCount];
+        script.forEach_copy1D_uint(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch uint: ", 1);
+        scriptRelaxed.forEach_copy1D_uint(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uint: ", 1);
+
+        script.forEach_copy2D_uint(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch uint: ", 1);
+        scriptRelaxed.forEach_copy2D_uint(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uint: ", 1);
+
+        script.forEach_copy3D_uint(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch uint: ", 1);
+        scriptRelaxed.forEach_copy3D_uint(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uint: ", 1);
+    }
+
+    public void testGetSet_uint2() {
+        testSetup(Element.U32_2(mRS));
+        int tmp[] = randomIntArray(gCount);
+        int tmp2[] = new int[gCount];
+        script.forEach_copy1D_uint2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch uint2: ", 2);
+        scriptRelaxed.forEach_copy1D_uint2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uint2: ", 2);
+
+        script.forEach_copy2D_uint2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch uint2: ", 2);
+        scriptRelaxed.forEach_copy2D_uint2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uint2: ", 2);
+
+        script.forEach_copy3D_uint2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch uint2: ", 2);
+        scriptRelaxed.forEach_copy3D_uint2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uint2: ", 2);
+    }
+
+    public void testGetSet_uint3() {
+        testSetup(Element.U32_3(mRS));
+        int tmp[] = randomIntArray(gCount);
+        int tmp2[] = new int[gCount];
+        script.forEach_copy1D_uint3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch uint3: ", 3);
+        scriptRelaxed.forEach_copy1D_uint3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uint3: ", 3);
+
+        script.forEach_copy2D_uint3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch uint3: ", 3);
+        scriptRelaxed.forEach_copy2D_uint3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uint3: ", 3);
+
+        script.forEach_copy3D_uint3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch uint3: ", 3);
+        scriptRelaxed.forEach_copy3D_uint3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uint3: ", 3);
+    }
+
+    public void testGetSet_uint4() {
+        testSetup(Element.U32_4(mRS));
+        int tmp[] = randomIntArray(gCount);
+        int tmp2[] = new int[gCount];
+        script.forEach_copy1D_uint4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch uint4: ", 4);
+        scriptRelaxed.forEach_copy1D_uint4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed uint4: ", 4);
+
+        script.forEach_copy2D_uint4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch uint4: ", 4);
+        scriptRelaxed.forEach_copy2D_uint4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed uint4: ", 4);
+
+        script.forEach_copy3D_uint4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch uint4: ", 4);
+        scriptRelaxed.forEach_copy3D_uint4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed uint4: ", 4);
+    }
+
+
+
+
+    public void testGetSet_long() {
+        testSetup(Element.I64(mRS));
+        long tmp[] = randomLongArray(gCount);
+        long tmp2[] = new long[gCount];
+        script.forEach_copy1D_long(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch long: ", 1);
+        scriptRelaxed.forEach_copy1D_long(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed long: ", 1);
+
+        script.forEach_copy2D_long(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch long: ", 1);
+        scriptRelaxed.forEach_copy2D_long(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed long: ", 1);
+
+        script.forEach_copy3D_long(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch long: ", 1);
+        scriptRelaxed.forEach_copy3D_long(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed long: ", 1);
+    }
+
+    public void testGetSet_long2() {
+        testSetup(Element.I64_2(mRS));
+        long tmp[] = randomLongArray(gCount);
+        long tmp2[] = new long[gCount];
+        script.forEach_copy1D_long2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch long2: ", 2);
+        scriptRelaxed.forEach_copy1D_long2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed long2: ", 2);
+
+        script.forEach_copy2D_long2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch long2: ", 2);
+        scriptRelaxed.forEach_copy2D_long2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed long2: ", 2);
+
+        script.forEach_copy3D_long2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch long2: ", 2);
+        scriptRelaxed.forEach_copy3D_long2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed long2: ", 2);
+    }
+
+    public void testGetSet_long3() {
+        testSetup(Element.I64_3(mRS));
+        long tmp[] = randomLongArray(gCount);
+        long tmp2[] = new long[gCount];
+        script.forEach_copy1D_long3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch long3: ", 3);
+        scriptRelaxed.forEach_copy1D_long3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed long3: ", 3);
+
+        script.forEach_copy2D_long3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch long3: ", 3);
+        scriptRelaxed.forEach_copy2D_long3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed long3: ", 3);
+
+        script.forEach_copy3D_long3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch long3: ", 3);
+        scriptRelaxed.forEach_copy3D_long3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed long3: ", 3);
+    }
+
+    public void testGetSet_long4() {
+        testSetup(Element.I64_4(mRS));
+        long tmp[] = randomLongArray(gCount);
+        long tmp2[] = new long[gCount];
+        script.forEach_copy1D_long4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch long4: ", 4);
+        scriptRelaxed.forEach_copy1D_long4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed long4: ", 4);
+
+        script.forEach_copy2D_long4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch long4: ", 4);
+        scriptRelaxed.forEach_copy2D_long4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed long4: ", 4);
+
+        script.forEach_copy3D_long4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch long4: ", 4);
+        scriptRelaxed.forEach_copy3D_long4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed long4: ", 4);
+    }
+
+    public void testGetSet_ulong() {
+        testSetup(Element.U64(mRS));
+        long tmp[] = randomLongArray(gCount);
+        long tmp2[] = new long[gCount];
+        script.forEach_copy1D_ulong(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch ulong: ", 1);
+        scriptRelaxed.forEach_copy1D_ulong(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ulong: ", 1);
+
+        script.forEach_copy2D_ulong(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch ulong: ", 1);
+        scriptRelaxed.forEach_copy2D_ulong(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ulong: ", 1);
+
+        script.forEach_copy3D_ulong(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch ulong: ", 1);
+        scriptRelaxed.forEach_copy3D_ulong(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ulong: ", 1);
+    }
+
+    public void testGetSet_ulong2() {
+        testSetup(Element.U64_2(mRS));
+        long tmp[] = randomLongArray(gCount);
+        long tmp2[] = new long[gCount];
+        script.forEach_copy1D_ulong2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch ulong2: ", 2);
+        scriptRelaxed.forEach_copy1D_ulong2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ulong2: ", 2);
+
+        script.forEach_copy2D_ulong2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch ulong2: ", 2);
+        scriptRelaxed.forEach_copy2D_ulong2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ulong2: ", 2);
+
+        script.forEach_copy3D_ulong2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch ulong2: ", 2);
+        scriptRelaxed.forEach_copy3D_ulong2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ulong2: ", 2);
+    }
+
+    public void testGetSet_ulong3() {
+        testSetup(Element.U64_3(mRS));
+        long tmp[] = randomLongArray(gCount);
+        long tmp2[] = new long[gCount];
+        script.forEach_copy1D_ulong3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch ulong3: ", 3);
+        scriptRelaxed.forEach_copy1D_ulong3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ulong3: ", 3);
+
+        script.forEach_copy2D_ulong3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch ulong3: ", 3);
+        scriptRelaxed.forEach_copy2D_ulong3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ulong3: ", 3);
+
+        script.forEach_copy3D_ulong3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch ulong3: ", 3);
+        scriptRelaxed.forEach_copy3D_ulong3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ulong3: ", 3);
+    }
+
+    public void testGetSet_ulong4() {
+        testSetup(Element.U64_4(mRS));
+        long tmp[] = randomLongArray(gCount);
+        long tmp2[] = new long[gCount];
+        script.forEach_copy1D_ulong4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch ulong4: ", 4);
+        scriptRelaxed.forEach_copy1D_ulong4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed ulong4: ", 4);
+
+        script.forEach_copy2D_ulong4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch ulong4: ", 4);
+        scriptRelaxed.forEach_copy2D_ulong4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed ulong4: ", 4);
+
+        script.forEach_copy3D_ulong4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch ulong4: ", 4);
+        scriptRelaxed.forEach_copy3D_ulong4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed ulong4: ", 4);
+    }
+
+
+
+
+    public void testGetSet_float() {
+        testSetup(Element.F32(mRS));
+        float tmp[] = randomFloatArray(gCount);
+        float tmp2[] = new float[gCount];
+        script.forEach_copy1D_float(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch float: ", 1);
+        scriptRelaxed.forEach_copy1D_float(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed float: ", 1);
+
+        script.forEach_copy2D_float(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch float: ", 1);
+        scriptRelaxed.forEach_copy2D_float(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed float: ", 1);
+
+        script.forEach_copy3D_float(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch float: ", 1);
+        scriptRelaxed.forEach_copy3D_float(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed float: ", 1);
+    }
+
+    public void testGetSet_float2() {
+        testSetup(Element.F32_2(mRS));
+        float tmp[] = randomFloatArray(gCount);
+        float tmp2[] = new float[gCount];
+        script.forEach_copy1D_float2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch float2: ", 2);
+        scriptRelaxed.forEach_copy1D_float2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed float2: ", 2);
+
+        script.forEach_copy2D_float2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch float2: ", 2);
+        scriptRelaxed.forEach_copy2D_float2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed float2: ", 2);
+
+        script.forEach_copy3D_float2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch float2: ", 2);
+        scriptRelaxed.forEach_copy3D_float2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed float2: ", 2);
+    }
+
+    public void testGetSet_float3() {
+        testSetup(Element.F32_3(mRS));
+        float tmp[] = randomFloatArray(gCount);
+        float tmp2[] = new float[gCount];
+        script.forEach_copy1D_float3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch float3: ", 3);
+        scriptRelaxed.forEach_copy1D_float3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed float3: ", 3);
+
+        script.forEach_copy2D_float3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch float3: ", 3);
+        scriptRelaxed.forEach_copy2D_float3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed float3: ", 3);
+
+        script.forEach_copy3D_float3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch float3: ", 3);
+        scriptRelaxed.forEach_copy3D_float3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed float3: ", 3);
+    }
+
+    public void testGetSet_float4() {
+        testSetup(Element.F32_4(mRS));
+        float tmp[] = randomFloatArray(gCount);
+        float tmp2[] = new float[gCount];
+        script.forEach_copy1D_float4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch float4: ", 4);
+        scriptRelaxed.forEach_copy1D_float4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed float4: ", 4);
+
+        script.forEach_copy2D_float4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch float4: ", 4);
+        scriptRelaxed.forEach_copy2D_float4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed float4: ", 4);
+
+        script.forEach_copy3D_float4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch float4: ", 4);
+        scriptRelaxed.forEach_copy3D_float4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed float4: ", 4);
+    }
+
+
+    public void testGetSet_double() {
+        testSetup(Element.F64(mRS));
+        double tmp[] = randomDoubleArray(gCount);
+        double tmp2[] = new double[gCount];
+        script.forEach_copy1D_double(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch double: ", 1);
+        scriptRelaxed.forEach_copy1D_double(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed double: ", 1);
+
+        script.forEach_copy2D_double(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch double: ", 1);
+        scriptRelaxed.forEach_copy2D_double(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed double: ", 1);
+
+        script.forEach_copy3D_double(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch double: ", 1);
+        scriptRelaxed.forEach_copy3D_double(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed double: ", 1);
+    }
+
+    public void testGetSet_double2() {
+        testSetup(Element.F64_2(mRS));
+        double tmp[] = randomDoubleArray(gCount);
+        double tmp2[] = new double[gCount];
+        script.forEach_copy1D_double2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch double2: ", 2);
+        scriptRelaxed.forEach_copy1D_double2(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed double2: ", 2);
+
+        script.forEach_copy2D_double2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch double2: ", 2);
+        scriptRelaxed.forEach_copy2D_double2(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed double2: ", 2);
+
+        script.forEach_copy3D_double2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch double2: ", 2);
+        scriptRelaxed.forEach_copy3D_double2(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed double2: ", 2);
+    }
+
+    public void testGetSet_double3() {
+        testSetup(Element.F64_3(mRS));
+        double tmp[] = randomDoubleArray(gCount);
+        double tmp2[] = new double[gCount];
+        script.forEach_copy1D_double3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch double3: ", 3);
+        scriptRelaxed.forEach_copy1D_double3(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed double3: ", 3);
+
+        script.forEach_copy2D_double3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch double3: ", 3);
+        scriptRelaxed.forEach_copy2D_double3(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed double3: ", 3);
+
+        script.forEach_copy3D_double3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch double3: ", 3);
+        scriptRelaxed.forEach_copy3D_double3(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed double3: ", 3);
+    }
+
+    public void testGetSet_double4() {
+        testSetup(Element.F64_4(mRS));
+        double tmp[] = randomDoubleArray(gCount);
+        double tmp2[] = new double[gCount];
+        script.forEach_copy1D_double4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch double4: ", 4);
+        scriptRelaxed.forEach_copy1D_double4(walkAlloc);
+        verify(tmp, tmp2, out1DAlloc, "Data mismatch relaxed double4: ", 4);
+
+        script.forEach_copy2D_double4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch double4: ", 4);
+        scriptRelaxed.forEach_copy2D_double4(walkAlloc);
+        verify(tmp, tmp2, out2DAlloc, "Data mismatch relaxed double4: ", 4);
+
+        script.forEach_copy3D_double4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch double4: ", 4);
+        scriptRelaxed.forEach_copy3D_double4(walkAlloc);
+        verify(tmp, tmp2, out3DAlloc, "Data mismatch relaxed double4: ", 4);
+    }
+
+
+}
+
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/getset.rs b/tests/tests/renderscript/src/android/renderscript/cts/getset.rs
new file mode 100644
index 0000000..4a8fa7f
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/getset.rs
@@ -0,0 +1,143 @@
+ /*
+ * 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.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+rs_allocation gAlloc1DIn;
+rs_allocation gAlloc1DOut;
+rs_allocation gAlloc2DIn;
+rs_allocation gAlloc2DOut;
+rs_allocation gAlloc3DIn;
+rs_allocation gAlloc3DOut;
+
+uint gWidth;
+uint gHeight;
+
+
+
+
+#define COPY_1D(ty)                                                 \
+    void __attribute__((kernel)) copy1D_##ty(int idx) {             \
+        ty i = rsGetElementAt_##ty(gAlloc1DIn, idx);                  \
+        rsSetElementAt_##ty(gAlloc1DOut, i, idx);                     \
+    }                                                               \
+    void __attribute__((kernel)) copy1D_##ty##2(int idx) {          \
+        ty##2 i = rsGetElementAt_##ty##2(gAlloc1DIn, idx);            \
+        rsSetElementAt_##ty##2(gAlloc1DOut, i, idx);                  \
+    }                                                               \
+    void __attribute__((kernel)) copy1D_##ty##3(int idx) {          \
+        ty##3 i = rsGetElementAt_##ty##3(gAlloc1DIn, idx);            \
+        rsSetElementAt_##ty##3(gAlloc1DOut, i, idx);                  \
+    }                                                               \
+    void __attribute__((kernel)) copy1D_##ty##4(int idx) {          \
+        ty##4 i = rsGetElementAt_##ty##4(gAlloc1DIn, idx);            \
+        rsSetElementAt_##ty##4(gAlloc1DOut, i, idx);                  \
+    }
+
+COPY_1D(char)
+COPY_1D(uchar)
+COPY_1D(short)
+COPY_1D(ushort)
+COPY_1D(int)
+COPY_1D(uint)
+COPY_1D(long)
+COPY_1D(ulong)
+COPY_1D(float)
+COPY_1D(double)
+
+
+
+#define COPY_2D(ty)                                                 \
+    void __attribute__((kernel)) copy2D_##ty(int idx) {             \
+        uint x = idx % gWidth;                                      \
+        uint y = idx / gWidth;                                      \
+        ty i = rsGetElementAt_##ty(gAlloc2DIn, x, y);                 \
+        rsSetElementAt_##ty(gAlloc2DOut, i, x, y);                    \
+    }                                                               \
+    void __attribute__((kernel)) copy2D_##ty##2(int idx) {          \
+        uint x = idx % gWidth;                                      \
+        uint y = idx / gWidth;                                      \
+        ty##2 i = rsGetElementAt_##ty##2(gAlloc2DIn, x, y);           \
+        rsSetElementAt_##ty##2(gAlloc2DOut, i, x, y);                 \
+    }                                                               \
+    void __attribute__((kernel)) copy2D_##ty##3(int idx) {          \
+        uint x = idx % gWidth;                                      \
+        uint y = idx / gWidth;                                      \
+        ty##3 i = rsGetElementAt_##ty##3(gAlloc2DIn, x, y);           \
+        rsSetElementAt_##ty##3(gAlloc2DOut, i, x, y);                 \
+    }                                                               \
+    void __attribute__((kernel)) copy2D_##ty##4(int idx) {          \
+        uint x = idx % gWidth;                                      \
+        uint y = idx / gWidth;                                      \
+        ty##4 i = rsGetElementAt_##ty##4(gAlloc2DIn, x, y);           \
+        rsSetElementAt_##ty##4(gAlloc2DOut, i, x, y);                 \
+    }
+
+COPY_2D(char)
+COPY_2D(uchar)
+COPY_2D(short)
+COPY_2D(ushort)
+COPY_2D(int)
+COPY_2D(uint)
+COPY_2D(long)
+COPY_2D(ulong)
+COPY_2D(float)
+COPY_2D(double)
+
+
+
+#define COPY_3D(ty)                                                 \
+    void __attribute__((kernel)) copy3D_##ty(int idx) {             \
+        uint x = idx % gWidth;                                      \
+        uint y = (idx / gWidth) % gHeight;                          \
+        uint z = idx / (gWidth * gHeight);                          \
+        ty i = rsGetElementAt_##ty(gAlloc3DIn, x, y, z);              \
+        rsSetElementAt_##ty(gAlloc3DOut, i, x, y, z);                 \
+    }                                                               \
+    void __attribute__((kernel)) copy3D_##ty##2(int idx) {          \
+        uint x = idx % gWidth;                                      \
+        uint y = (idx / gWidth) % gHeight;                          \
+        uint z = idx / (gWidth * gHeight);                          \
+        ty##2 i = rsGetElementAt_##ty##2(gAlloc3DIn, x, y, z);        \
+        rsSetElementAt_##ty##2(gAlloc3DOut, i, x, y, z);              \
+    }                                                               \
+    void __attribute__((kernel)) copy3D_##ty##3(int idx) {          \
+        uint x = idx % gWidth;                                      \
+        uint y = (idx / gWidth) % gHeight;                          \
+        uint z = idx / (gWidth * gHeight);                          \
+        ty##3 i = rsGetElementAt_##ty##3(gAlloc3DIn, x, y, z);        \
+        rsSetElementAt_##ty##3(gAlloc3DOut, i, x, y, z);              \
+    }                                                               \
+    void __attribute__((kernel)) copy3D_##ty##4(int idx) {          \
+        uint x = idx % gWidth;                                      \
+        uint y = (idx / gWidth) % gHeight;                          \
+        uint z = idx / (gWidth * gHeight);                          \
+        ty##4 i = rsGetElementAt_##ty##4(gAlloc3DIn, x, y, z);        \
+        rsSetElementAt_##ty##4(gAlloc3DOut, i, x, y, z);              \
+    }
+
+COPY_3D(char)
+COPY_3D(uchar)
+COPY_3D(short)
+COPY_3D(ushort)
+COPY_3D(int)
+COPY_3D(uint)
+COPY_3D(long)
+COPY_3D(ulong)
+COPY_3D(float)
+COPY_3D(double)
+
diff --git a/tests/res/xml/pm_test.xml b/tests/tests/renderscript/src/android/renderscript/cts/getset_relaxed.rs
similarity index 74%
rename from tests/res/xml/pm_test.xml
rename to tests/tests/renderscript/src/android/renderscript/cts/getset_relaxed.rs
index 4db24cf..6b62faf 100644
--- a/tests/res/xml/pm_test.xml
+++ b/tests/tests/renderscript/src/android/renderscript/cts/getset_relaxed.rs
@@ -1,6 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2008 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.
@@ -13,7 +12,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.
- -->
- <!-- This xml is just test for PackageManager Test -->
-<resources>
-</resources>
+ */
+
+#pragma rs_fp_relaxed
+
+#include "getset.rs"
+
diff --git a/tests/tests/security/src/android/security/cts/CertificateData.java b/tests/tests/security/src/android/security/cts/CertificateData.java
index 2912b19..da098f3 100644
--- a/tests/tests/security/src/android/security/cts/CertificateData.java
+++ b/tests/tests/security/src/android/security/cts/CertificateData.java
@@ -69,6 +69,7 @@
       "77:47:4F:C6:30:E4:0F:4C:47:64:3F:84:BA:B8:C6:95:4A:8A:41:EC",
       "8C:F4:27:FD:79:0C:3A:D1:66:06:8D:E8:1E:57:EF:BB:93:22:72:D4",
       "2F:78:3D:25:52:18:A7:4A:65:39:71:B5:2C:A2:9C:45:15:6F:E9:19",
+      "97:81:79:50:D8:1C:96:70:CC:34:D8:09:CF:79:44:31:36:7E:F4:74",
       "85:A4:08:C0:9C:19:3E:5D:51:58:7D:CD:D6:13:30:FD:8C:DE:37:BF",
       "58:11:9F:0E:12:82:87:EA:50:FD:D9:87:45:6F:4F:78:DC:FA:D6:D4",
       "6B:2F:34:AD:89:58:BE:62:FD:B0:6B:5C:CE:BB:9D:D9:4F:4E:39:F3",
@@ -93,11 +94,13 @@
       "85:37:1C:A6:E5:50:14:3D:CE:28:03:47:1B:DE:3A:09:E8:F8:77:0F",
       "7E:78:4A:10:1C:82:65:CC:2D:E1:F1:6D:47:B4:40:CA:D9:0A:19:45",
       "D1:EB:23:A4:6D:17:D6:8F:D9:25:64:C2:F1:F1:60:17:64:D8:E3:49",
+      "A1:DB:63:93:91:6F:17:E4:18:55:09:40:04:15:C7:02:40:B0:AE:6B",
       "B8:01:86:D1:EB:9C:86:A5:41:04:CF:30:54:F3:4C:52:B7:E5:58:C6",
       "2E:14:DA:EC:28:F0:FA:1E:8E:38:9A:4E:AB:EB:26:C0:0A:D3:83:C3",
       "DE:28:F4:A4:FF:E5:B9:2F:A3:C5:03:D1:A3:49:A7:F9:96:2A:82:12",
       "80:25:EF:F4:6E:70:C8:D4:72:24:65:84:FE:40:3B:8A:8D:6A:DB:F5",
       "CA:3A:FB:CF:12:40:36:4B:44:B2:16:20:88:80:48:39:19:93:7C:F7",
+      "69:BD:8C:F4:9C:D3:00:FB:59:2E:17:93:CA:55:6A:F3:EC:AA:35:FB",
       "13:2D:0D:45:53:4B:69:97:CD:B2:D5:C3:39:E2:55:76:60:9B:5C:C6",
       "5F:B7:EE:06:33:E2:59:DB:AD:0C:4C:9A:E6:D3:8F:1A:61:C7:DC:25",
       "49:0A:75:74:DE:87:0A:47:FE:58:EE:F6:C7:6B:EB:C6:0B:12:40:99",
@@ -168,6 +171,7 @@
       "E0:B4:32:2E:B2:F6:A5:68:B6:54:53:84:48:18:4A:50:36:87:43:84",
       "61:57:3A:11:DF:0E:D8:7E:D5:92:65:22:EA:D0:56:D7:44:B3:23:71",
       "7E:04:DE:89:6A:3E:66:6D:00:E6:87:D3:3F:FA:D9:3B:E8:3D:34:9E",
+      "99:A6:9B:E6:1A:FE:88:6B:4D:2B:82:00:7C:B8:54:FC:31:7E:15:39",
       "6E:3A:55:A4:19:0C:19:5C:93:84:3C:C0:DB:72:2E:31:30:61:F0:B1",
       "31:F1:FD:68:22:63:20:EE:C6:3B:3F:9D:EA:4A:3E:53:7C:7C:39:17",
       "F9:CD:0E:2C:DA:76:24:C1:8F:BD:F0:F0:AB:B6:45:B8:F7:FE:D5:7A",
diff --git a/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java b/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java
deleted file mode 100644
index 18b0d12..0000000
--- a/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * 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.telephony.cts;
-
-import android.telephony.SmsManager;
-import android.telephony.TelephonyManager;
-import android.test.AndroidTestCase;
-
-public class SimRestrictedApisTest extends AndroidTestCase {
-    private static final byte[] TEST_PDU = {0,0};
-
-    /**
-     * Tests the SmsManager.injectSmsPdu() API. This makes a call to injectSmsPdu() API and expects
-     * a SecurityException since the test apk is not signed by a certificate on the SIM.
-     */
-    public void testInjectSmsPdu() {
-        try {
-            SmsManager.getDefault().injectSmsPdu(TEST_PDU, "3gpp", null);
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the SmsManager.updateMmsDownloadStatus() API. This makes a call to
-     * updateMmsDownloadStatus() API and expects a SecurityException since the test apk is not
-     * signed by a certificate on the SIM.
-     */
-    public void testUpdateMmsDownloadStatus() {
-        try {
-            SmsManager.getDefault().updateMmsDownloadStatus(null, 0, 0, null);
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the SmsManager.updateMmsSendStatus() API. This makes a call to updateMmsSendStatus()
-     * API and expects a SecurityException since the test apk is not signed by a certificate
-     * on the SIM.
-     */
-    public void testUpdateMmsSendStatus() {
-        try {
-            SmsManager.getDefault().updateMmsSendStatus(null, 0, TEST_PDU, 0, null);
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the SmsManager.updateSmsSendStatus() API. This makes a call to updateSmsSendStatus()
-     * API and expects a SecurityException since the test apk is not signed by a
-     * certificate on the SIM.
-     */
-    public void testUpdateSmsSendStatus() {
-        try {
-            SmsManager.getDefault().updateSmsSendStatus(0, false);
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.setLine1NumberForDisplay() API. This makes a call to
-     * setLine1NumberForDisplay() API and expects a SecurityException since the test apk is not
-     * signed by a certificate on the SIM.
-     */
-    public void testSetLine1NumberForDisplay() {
-        try {
-            TelephonyManager.getDefault().setLine1NumberForDisplay("", "");
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.setLine1NumberForDisplay(long, string, string) API. This makes a
-     * call to setLine1NumberForDisplay() API and expects a SecurityException since the test apk is
-     * not signed by the certificate on the SIM.
-     */
-    public void testSetLine1NumberForDisplay2() {
-        try {
-            TelephonyManager.getDefault().setLine1NumberForDisplayForSubscriber(0, "", "");
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.iccOpenLogicalChannel() API. This makes a call to
-     * iccOpenLogicalChannel() API and expects a SecurityException since the test apk
-     * is not signed by certificate on the SIM.
-     */
-    public void testIccOpenLogicalChannel() {
-        try {
-            TelephonyManager.getDefault().iccOpenLogicalChannel("");
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.iccCloseLogicalChannel() API. This makes a call to
-     * iccCloseLogicalChannel() API and expects a SecurityException since the test apk
-     * is not signed by certificate on the SIM.
-     */
-    public void testIccCloseLogicalChannel() {
-        try {
-            TelephonyManager.getDefault().iccCloseLogicalChannel(0);
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.iccTransmitApduLogicalChannel() API. This makes a call to
-     * iccTransmitApduLogicalChannel() API and expects a SecurityException since the test apk
-     * is not signed by a certificate on the SIM.
-     */
-    public void testIccTransmitApduLogicalChannel() {
-        try {
-            TelephonyManager.getDefault().iccTransmitApduLogicalChannel(
-                    0, 0, 0, 0, 0, 0, "");
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.iccTransmitApduBasicChannel() API. This makes a call to
-     * iccTransmitApduBasicChannel() API and expects a SecurityException since the test apk
-     * is not signed by a certificate on the SIM.
-     */
-    public void testIccTransmitApduBasicChannel() {
-        try {
-            TelephonyManager.getDefault().iccTransmitApduBasicChannel(
-                    0, 0, 0, 0, 0, "");
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.sendEnvelopeWithStatus() API. This makes a call to
-     * sendEnvelopeWithStatus() API and expects a SecurityException since the test apk is not
-     * signed by certificate on the SIM.
-     */
-    public void testSendEnvelopeWithStatus() {
-        try {
-            TelephonyManager.getDefault().sendEnvelopeWithStatus("");
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.nvReadItem() API. This makes a call to nvReadItem() API and
-     * expects a SecurityException since the test apk is not signed by a certificate on the SIM.
-     */
-    public void testNvReadItem() {
-        try {
-            TelephonyManager.getDefault().nvReadItem(0);
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.nvWriteItem() API. This makes a call to nvWriteItem() API and
-     * expects a SecurityException since the test apk is not signed by a certificate on the SIM.
-     */
-    public void testNvWriteItem() {
-        try {
-            TelephonyManager.getDefault().nvWriteItem(0, "");
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.nvWriteCdmaPrl() API. This makes a call to nvWriteCdmaPrl() API
-     * and expects a SecurityException since the test apk is not signed by a certificate
-     * on the SIM.
-     */
-    public void testNvWriteCdmaPrl() {
-        try {
-            TelephonyManager.getDefault().nvWriteCdmaPrl(null);
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.nvResetConfig() API. This makes a call to nvResetConfig() API and
-     * expects a SecurityException since the test apk is not signed by a certificate on the SIM.
-     */
-    public void testNvResetConfig() {
-        try {
-            TelephonyManager.getDefault().nvResetConfig(0);
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.getPreferredNetworkType() API. This makes a call to
-     * getPreferredNetworkType() API and expects a SecurityException since the test apk
-     * is not signed by certificate on the SIM.
-     */
-    public void testGetPreferredNetworkType() {
-        try {
-            TelephonyManager.getDefault().getPreferredNetworkType();
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.setGlobalPreferredNetworkType() API. This makes a call to
-     * setGlobalPreferredNetworkType() API and expects a SecurityException since the test apk
-     * is not signed by certificate on the SIM.
-     */
-    public void testSetGlobalPreferredNetworkType() {
-        try {
-            TelephonyManager.getDefault().setGlobalPreferredNetworkType();
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests that the test apk doesn't  have carrier previliges.
-     */
-    public void testHasCarrierPrivileges() {
-        int previlegeStatus = TelephonyManager.getDefault().hasCarrierPrivileges();
-        if(previlegeStatus != TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS &&
-                previlegeStatus != TelephonyManager.CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED) {
-            fail("Unexpected carrier previlege status");
-        }
-    }
-
-    /**
-     * Tests the TelephonyManager.setOperatorBrandOverride() API. This makes a call to
-     * setOperatorBrandOverride() API and expects a SecurityException since the test apk
-     * is not signed by certificate on the SIM.
-     */
-    public void testSetOperatorBrandOverride() {
-        try {
-            TelephonyManager.getDefault().setOperatorBrandOverride("");
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-
-    /**
-     * Tests the TelephonyManager.enableSimplifiedNetworkSettings() API. This makes a call to
-     * enableSimplifiedNetworkSettings() API and expects a SecurityException since the test apk
-     * is not signed by a certificate on the SIM.
-     */
-    public void testEnableSimplifiedNetworkSettings() {
-        try {
-            TelephonyManager.getDefault().enableSimplifiedNetworkSettingsForSubscriber(0, false);
-            fail("Expected SecurityException. App doesn't have carrier privileges.");
-        } catch (SecurityException expected) {}
-    }
-}
diff --git a/tests/tests/util/src/android/util/cts/EventLogTest.java b/tests/tests/util/src/android/util/cts/EventLogTest.java
index 318b010..12df64f 100644
--- a/tests/tests/util/src/android/util/cts/EventLogTest.java
+++ b/tests/tests/util/src/android/util/cts/EventLogTest.java
@@ -69,7 +69,8 @@
         EventLog.writeEvent(ANSWER_TAG, 12345L, longString.toString());
         EventLog.writeEvent(ANSWER_TAG, longString.toString(), longString.toString());
         EventLog.writeEvent(ANSWER_TAG, longArray);
-
+        // Give the message some time to show up in the log
+        Thread.sleep(10);
         List<Event> events = getEventsAfterMarker(markerData, ANSWER_TAG);
         assertEquals(6, events.size());
 
diff --git a/tests/tests/widget/res/layout/textview_layout.xml b/tests/tests/widget/res/layout/textview_layout.xml
index c2cd159..419bbf9 100644
--- a/tests/tests/widget/res/layout/textview_layout.xml
+++ b/tests/tests/widget/res/layout/textview_layout.xml
@@ -36,6 +36,7 @@
                     android:typeface="normal"
                     android:textSize="20px"
                     android:textStyle="normal"
+                    android:textAppearance="@null"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"/>
 
diff --git a/tests/webgl/Android.mk b/tests/webgl/Android.mk
index 624d82a..ce22dd8 100755
--- a/tests/webgl/Android.mk
+++ b/tests/webgl/Android.mk
@@ -24,8 +24,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
 
-LOCAL_SRC_FILES := $(call all-java-files-under, src)\
-		../src/android/webkit/cts/NullWebViewUtils.java
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 # Must match the package name in CtsTestCaseList.mk
 LOCAL_PACKAGE_NAME := CtsWebGLTestCases
diff --git a/tests/webgl/src/android/webgl/WebGLActivity.java b/tests/webgl/src/android/webgl/WebGLActivity.java
index f851a76..e88de16 100644
--- a/tests/webgl/src/android/webgl/WebGLActivity.java
+++ b/tests/webgl/src/android/webgl/WebGLActivity.java
@@ -21,11 +21,11 @@
 import android.content.res.Resources;
 import android.os.Bundle;
 import android.util.Log;
+import android.webgl.cts.NullWebViewUtils;
 import android.webgl.cts.R;
 import android.webkit.WebView;
 import android.webkit.JavascriptInterface;
 import android.webkit.WebViewClient;
-import android.webkit.cts.NullWebViewUtils;
 import android.widget.Toast;
 import java.lang.Override;
 import java.io.InputStream;
diff --git a/tests/src/android/webkit/cts/NullWebViewUtils.java b/tests/webgl/src/android/webgl/cts/NullWebViewUtils.java
similarity index 98%
rename from tests/src/android/webkit/cts/NullWebViewUtils.java
rename to tests/webgl/src/android/webgl/cts/NullWebViewUtils.java
index c52219f..861cc22 100644
--- a/tests/src/android/webkit/cts/NullWebViewUtils.java
+++ b/tests/webgl/src/android/webgl/cts/NullWebViewUtils.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.webkit.cts;
+package android.webgl.cts;
 
 import android.content.Context;
 import android.content.pm.PackageManager;
@@ -85,4 +85,4 @@
                     !checkCauseWasUnsupportedOperation(mPendingException);
         }
     }
-}
\ No newline at end of file
+}
diff --git a/tools/cts-native-scanner/tests/Android.mk b/tools/cts-native-scanner/tests/Android.mk
index 6044b0d..29c5514 100644
--- a/tools/cts-native-scanner/tests/Android.mk
+++ b/tools/cts-native-scanner/tests/Android.mk
@@ -21,7 +21,7 @@
 
 LOCAL_MODULE := cts-native-scanner-tests
 LOCAL_MODULE_TAGS := optional
-LOCAL_JAVA_LIBRARIES := ddmlib-prebuilt tradefed-prebuilt cts-native-scanner
+LOCAL_JAVA_LIBRARIES := tradefed-prebuilt cts-native-scanner
 
 include $(BUILD_HOST_JAVA_LIBRARY)
 
diff --git a/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/CtsXmlGenerator.java b/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/CtsXmlGenerator.java
index 384466a..f194edf 100644
--- a/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/CtsXmlGenerator.java
+++ b/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/CtsXmlGenerator.java
@@ -36,10 +36,10 @@
 
     private static void usage(String[] args) {
         System.err.println("Arguments: " + Arrays.asList(args));
-        System.err.println("Usage: cts-xml-generator -p PACKAGE_NAME -n NAME [-s APP_NAME_SPACE]"
-                + " [-t TEST_TYPE] [-j JAR_PATH] [-i INSTRUMENTATION] [-m MANIFEST_FILE]"
-                + " [-e EXPECTATION_FILE] [-b UNSUPPORTED_ABI_FILE] [-o OUTPUT_FILE]"
-                + " [-x ADDITIONAL_ATTRIBUTE_KEY->VALUE]");
+        System.err.println("Usage: cts-xml-generator -p PACKAGE_NAME -n NAME [-t TEST_TYPE]"
+                + " [-j JAR_PATH] [-i INSTRUMENTATION] [-m MANIFEST_FILE] [-e EXPECTATION_FILE]"
+                + " [-b UNSUPPORTED_ABI_FILE] [-a ARCHITECTURE] [-o OUTPUT_FILE]"
+                + " [-s APP_NAME_SPACE] [-x ADDITIONAL_ATTRIBUTE_KEY->VALUE]");
         System.exit(1);
     }
 
@@ -49,6 +49,7 @@
         String outputPath = null;
         Set<File> expectationFiles = new HashSet<File>();
         Set<File> abiFiles = new HashSet<File>();
+        String architecture = null;
         File manifestFile = null;
         String instrumentation = null;
         String testType = null;
@@ -75,6 +76,8 @@
                         "Missing value for expectation store")));
             } else if ("-b".equals(args[i])) {
                 abiFiles.add(new File(getArg(args, ++i, "Missing value for abi store")));
+            } else if ("-a".equals(args[i])) {
+                architecture = getArg(args, ++i, "Missing value for architecture");
             } else if ("-o".equals(args[i])) {
                 outputPath = getArg(args, ++i, "Missing value for output file");
             } else if ("-s".equals(args[i])) {
@@ -124,9 +127,9 @@
 
         ExpectationStore failuresStore = ExpectationStore.parse(expectationFiles, ModeId.DEVICE);
         ExpectationStore abiStore = ExpectationStore.parse(abiFiles, ModeId.DEVICE);
-        XmlGenerator generator = new XmlGenerator(failuresStore, abiStore, appNameSpace,
-                appPackageName, name, runner, instrumentation, targetNameSpace, jarPath, testType,
-                outputPath, additionalAttributes);
+        XmlGenerator generator = new XmlGenerator(failuresStore, abiStore, architecture,
+                appNameSpace, appPackageName, name, runner, instrumentation, targetNameSpace,
+                jarPath, testType, outputPath, additionalAttributes);
         generator.writePackageXml();
     }
 
diff --git a/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/XmlGenerator.java b/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/XmlGenerator.java
index 4a56a8e..1680cae 100644
--- a/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/XmlGenerator.java
+++ b/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/XmlGenerator.java
@@ -79,12 +79,14 @@
     /** ExpectationStore to filter out unsupported abis. */
     private final ExpectationStore mUnsupportedAbis;
 
+    private final String mArchitecture;
+
     private final Map<String, String> mAdditionalAttributes;
 
     XmlGenerator(ExpectationStore knownFailures, ExpectationStore unsupportedAbis,
-            String appNameSpace, String appPackageName, String name, String runner,
-            String targetBinaryName, String targetNameSpace, String jarPath, String testType,
-            String outputPath, Map<String, String> additionalAttributes) {
+            String architecture, String appNameSpace, String appPackageName, String name,
+            String runner, String targetBinaryName, String targetNameSpace, String jarPath,
+            String testType, String outputPath, Map<String, String> additionalAttributes) {
         mAppNamespace = appNameSpace;
         mAppPackageName = appPackageName;
         mName = name;
@@ -96,6 +98,7 @@
         mOutputPath = outputPath;
         mKnownFailures = knownFailures;
         mUnsupportedAbis = unsupportedAbis;
+        mArchitecture = architecture;
         mAdditionalAttributes = additionalAttributes;
     }
 
@@ -202,7 +205,7 @@
             String className = nameCollector.toString();
             nameCollector.append('#').append(test.getName());
             writer.append("<Test name=\"").append(test.getName()).append("\"");
-            String abis = getSupportedAbis(mUnsupportedAbis, className).toString();
+            String abis = getSupportedAbis(mUnsupportedAbis, mArchitecture, className).toString();
             writer.append(" abis=\"" + abis.substring(1, abis.length() - 1) + "\"");
             if (isKnownFailure(mKnownFailures, nameCollector.toString())) {
                 writer.append(" expectation=\"failure\"");
@@ -229,8 +232,8 @@
 
     // Returns the list of ABIs supported by this TestCase on this architecture.
     public static Set<String> getSupportedAbis(ExpectationStore expectationStore,
-            String className) {
-        Set<String> supportedAbis = AbiUtils.getAbisSupportedByCts();
+            String architecture, String className) {
+        Set<String> supportedAbis = AbiUtils.getAbisForArch(architecture);
         Expectation e = (expectationStore == null) ? null : expectationStore.get(className);
         if (e != null && !e.getDescription().isEmpty()) {
             // Description should be written in the form "blah blah: abi1, abi2..."
diff --git a/tools/tradefed-host/.classpath b/tools/tradefed-host/.classpath
index b82e340..e716219 100644
--- a/tools/tradefed-host/.classpath
+++ b/tools/tradefed-host/.classpath
@@ -5,8 +5,7 @@
 	<classpathentry kind="src" path="commonutil-src"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry exported="true" kind="var" path="CTS_SRC_ROOT/out/host/common/obj/JAVA_LIBRARIES/ctsdeviceinfolib_intermediates/javalib.jar"/>
-	<classpathentry exported="true" kind="var" path="CTS_SRC_ROOT/out/host/common/obj/JAVA_LIBRARIES/hosttestlib_intermediates/javalib.jar"/>
-	<classpathentry kind="var" path="CTS_SRC_ROOT/out/host/common/obj/JAVA_LIBRARIES/ddmlib-prebuilt_intermediates/ddmlib-prebuilt.jar" sourcepath="/SDK_SRC_ROOT"/>
-        <classpathentry kind="var" path="CTS_SRC_ROOT/out/host/common/obj/JAVA_LIBRARIES/tradefed-prebuilt_intermediates/tradefed-prebuilt.jar" sourcepath="/TRADEFED_ROOT/tools/tradefederation/src"/>
+	<classpathentry kind="var" path="CTS_SRC_ROOT/out/host/common/obj/JAVA_LIBRARIES/hosttestlib_intermediates/javalib.jar"/>
+	<classpathentry kind="var" path="CTS_SRC_ROOT/prebuilts/misc/common/tradefed/tradefed-prebuilt.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/tools/tradefed-host/Android.mk b/tools/tradefed-host/Android.mk
index 0b5d764..bd28575 100644
--- a/tools/tradefed-host/Android.mk
+++ b/tools/tradefed-host/Android.mk
@@ -24,7 +24,7 @@
 
 LOCAL_MODULE := cts-tradefed
 LOCAL_MODULE_TAGS := optional
-LOCAL_JAVA_LIBRARIES := ddmlib-prebuilt tradefed-prebuilt hosttestlib
+LOCAL_JAVA_LIBRARIES := tradefed-prebuilt hosttestlib
 LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceinfolib
 
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
diff --git a/tools/tradefed-host/etc/cts-tradefed b/tools/tradefed-host/etc/cts-tradefed
index 485740ed..f9f43bb 100755
--- a/tools/tradefed-host/etc/cts-tradefed
+++ b/tools/tradefed-host/etc/cts-tradefed
@@ -78,7 +78,7 @@
 fi;
 
 JAR_DIR=${CTS_ROOT}/android-cts/tools
-JARS="ddmlib-prebuilt.jar tradefed-prebuilt.jar hosttestlib.jar cts-tradefed.jar"
+JARS="tradefed-prebuilt.jar hosttestlib.jar cts-tradefed.jar"
 
 for JAR in $JARS; do
     checkFile ${JAR_DIR}/${JAR}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsTestLogReporter.java b/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsTestLogReporter.java
index 4a1bfb5..5029dfe 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsTestLogReporter.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsTestLogReporter.java
@@ -87,7 +87,16 @@
      * {@inheritDoc}
      */
     @Override
-    public void testFailed(TestFailure status, TestIdentifier test, String trace) {
+    public void testFailed(TestIdentifier test, String trace) {
+        mCurrentPkgResult.reportTestFailure(test, CtsTestStatus.FAIL, trace);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void testAssumptionFailure(TestIdentifier test, String trace) {
+        // TODO: do something different here?
         mCurrentPkgResult.reportTestFailure(test, CtsTestStatus.FAIL, trace);
     }
 
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 0d21fc6..e8d6e71 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
@@ -239,7 +239,7 @@
      * {@inheritDoc}
      */
     @Override
-    public void testFailed(TestFailure status, TestIdentifier test, String trace) {
+    public void testFailed(TestIdentifier test, String trace) {
         mCurrentPkgResult.reportTestFailure(test, CtsTestStatus.FAIL, trace);
     }
 
@@ -247,6 +247,23 @@
      * {@inheritDoc}
      */
     @Override
+    public void testAssumptionFailure(TestIdentifier test, String trace) {
+        // TODO: do something different here?
+        mCurrentPkgResult.reportTestFailure(test, CtsTestStatus.FAIL, trace);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void testIgnored(TestIdentifier test) {
+        // TODO: ??
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public void testEnded(TestIdentifier test, Map<String, String> testMetrics) {
         mCurrentPkgResult.reportTestEnded(test, testMetrics);
     }
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/result/IssueReporter.java b/tools/tradefed-host/src/com/android/cts/tradefed/result/IssueReporter.java
index 319dd54..ed5f238 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/result/IssueReporter.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/result/IssueReporter.java
@@ -58,13 +58,25 @@
     private String mProductName;
 
     @Override
-    public void testFailed(TestFailure status, TestIdentifier test, String trace) {
+    public void testFailed(TestIdentifier test, String trace) {
         mCurrentIssue = new Issue();
         mCurrentIssue.mTestName = test.toString();
         mCurrentIssue.mStackTrace = trace;
     }
 
     @Override
+    public void testAssumptionFailure(TestIdentifier test, String trace) {
+        mCurrentIssue = new Issue();
+        mCurrentIssue.mTestName = test.toString();
+        mCurrentIssue.mStackTrace = trace;
+    }
+
+    @Override
+    public void testIgnored(TestIdentifier test) {
+        // TODO: ??
+    }
+
+    @Override
     public void testLog(String dataName, LogDataType dataType, InputStreamSource dataStream) {
         if (dataName.startsWith("bug-")) {
             try {
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/result/Test.java b/tools/tradefed-host/src/com/android/cts/tradefed/result/Test.java
index 8c5b8d1..023cfcb 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/result/Test.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/result/Test.java
@@ -16,7 +16,6 @@
 package com.android.cts.tradefed.result;
 
 import com.android.ddmlib.Log;
-import com.android.tradefed.result.TestResult;
 
 import org.kxml2.io.KXmlSerializer;
 import org.xmlpull.v1.XmlPullParser;
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/result/TestSuite.java b/tools/tradefed-host/src/com/android/cts/tradefed/result/TestSuite.java
index df1dceb..ca287ca 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/result/TestSuite.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/result/TestSuite.java
@@ -16,7 +16,6 @@
 package com.android.cts.tradefed.result;
 
 import com.android.ddmlib.testrunner.TestIdentifier;
-import com.android.tradefed.result.TestResult;
 
 import org.kxml2.io.KXmlSerializer;
 import org.xmlpull.v1.XmlPullParser;
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsInstrumentationApkTest.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsInstrumentationApkTest.java
index 6765305..66d1135f 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsInstrumentationApkTest.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsInstrumentationApkTest.java
@@ -77,9 +77,9 @@
     @Override
     public void run(final ITestInvocationListener listener)
             throws DeviceNotAvailableException {
-        ITestDevice mTestDevice = getDevice();
+        ITestDevice testDevice = getDevice();
 
-        if (mTestDevice == null) {
+        if (testDevice == null) {
             Log.e(LOG_TAG, "Missing device.");
             return;
         }
@@ -87,28 +87,32 @@
             Log.e(LOG_TAG, "Missing build");
             return;
         }
-
+        boolean success = true;
         for (String apkFileName : mInstallFileNames) {
             Log.d(LOG_TAG, String.format("Installing %s on %s", apkFileName,
-                    mTestDevice.getSerialNumber()));
+                    testDevice.getSerialNumber()));
             try {
                 File apkFile = mCtsBuild.getTestApp(apkFileName);
                 String errorCode = null;
                 String[] options = {AbiUtils.createAbiFlag(mAbi.getName())};
-                errorCode = mTestDevice.installPackage(apkFile, true, options);
+                errorCode = testDevice.installPackage(apkFile, true, options);
                 if (errorCode != null) {
                     Log.e(LOG_TAG, String.format("Failed to install %s on %s. Reason: %s",
-                          apkFileName, mTestDevice.getSerialNumber(), errorCode));
+                          apkFileName, testDevice.getSerialNumber(), errorCode));
+                    success = false;
                 }
             } catch (FileNotFoundException e) {
                 Log.e(LOG_TAG, String.format("Could not find file %s", apkFileName));
+                success = false;
             }
         }
-        super.run(listener);
+        if (success) {
+            super.run(listener);
+        }
         for (String packageName : mUninstallPackages) {
             Log.d(LOG_TAG, String.format("Uninstalling %s on %s", packageName,
-                    mTestDevice.getSerialNumber()));
-            mTestDevice.uninstallPackage(packageName);
+                    testDevice.getSerialNumber()));
+            testDevice.uninstallPackage(packageName);
         }
     }
 }
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 fe92243..a91fdca 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
@@ -78,6 +78,7 @@
     private static final String PACKAGE_OPTION = "package";
     private static final String CLASS_OPTION = "class";
     private static final String METHOD_OPTION = "method";
+    private static final String TEST_OPTION = "test";
     public static final String CONTINUE_OPTION = "continue-session";
     public static final String RUN_KNOWN_FAILURES_OPTION = "run-known-failures";
 
@@ -107,6 +108,10 @@
             importance = Importance.IF_UNSET)
     private String mMethodName = null;
 
+    @Option(name = TEST_OPTION, shortName = 't', description = "run a specific test",
+            importance = Importance.IF_UNSET)
+    private String mTestName = null;
+
     @Option(name = CONTINUE_OPTION,
             description = "continue a previous test session.",
             importance = Importance.IF_UNSET)
@@ -223,8 +228,8 @@
         }
 
         @Override
-        public void testFailed(TestFailure status, TestIdentifier test, String trace) {
-            super.testFailed(status, test, trace);
+        public void testFailed(TestIdentifier test, String trace) {
+            super.testFailed(test, trace);
             InputStreamSource bugSource = mDevice.getBugreport();
             super.testLog(String.format("bug-%s_%s", test.getClassName(), test.getTestName()),
                     LogDataType.TEXT, bugSource);
@@ -247,8 +252,8 @@
         }
 
         @Override
-        public void testFailed(TestFailure status, TestIdentifier test, String trace) {
-            super.testFailed(status, test, trace);
+        public void testFailed(TestIdentifier test, String trace) {
+            super.testFailed(test, trace);
             // sleep a small amount of time to ensure test failure stack trace makes it into logcat
             // capture
             RunUtil.getDefault().sleep(10);
@@ -272,8 +277,8 @@
         }
 
         @Override
-        public void testFailed(TestFailure status, TestIdentifier test, String trace) {
-            super.testFailed(status, test, trace);
+        public void testFailed(TestIdentifier test, String trace) {
+            super.testFailed(test, trace);
 
             try {
                 InputStreamSource screenSource = mDevice.getScreenshot();
@@ -365,6 +370,15 @@
     }
 
     /**
+     * Set the test name to run e.g. android.test.cts.SampleTest#testSample
+     * <p/>
+     * Exposed for unit testing
+     */
+    void setTestName(String testName) {
+        mTestName = testName;
+    }
+
+    /**
      * Sets the test session id to continue.
      * <p/>
      * Exposed for unit testing
@@ -568,10 +582,14 @@
      * @throws DeviceNotAvailableException
      */
     private List<TestPackage> buildTestsToRun() throws DeviceNotAvailableException {
+        Set<String> abis = getAbis();
+        if (abis == null || abis.isEmpty()) {
+            throw new IllegalArgumentException("could not get device's ABIs");
+        }
         List<TestPackage> testPkgList = new LinkedList<TestPackage>();
         try {
-            ITestPackageRepo testRepo = createTestCaseRepo();
-            Collection<ITestPackageDef> testPkgDefs = getTestPackagesToRun(testRepo);
+            ITestPackageRepo testRepo = createTestCaseRepo(abis);
+            Collection<ITestPackageDef> testPkgDefs = getTestPackagesToRun(testRepo, abis);
             for (ITestPackageDef testPkgDef : testPkgDefs) {
                 addTestPackage(testPkgList, testPkgDef);
             }
@@ -609,16 +627,15 @@
      * @throws ParseException
      * @throws FileNotFoundException
      * @throws ConfigurationException
-     * @throws DeviceNotAvailableException
      */
-    private Collection<ITestPackageDef> getTestPackagesToRun(ITestPackageRepo testRepo)
-            throws ParseException, FileNotFoundException, ConfigurationException, DeviceNotAvailableException {
+    private Collection<ITestPackageDef> getTestPackagesToRun(ITestPackageRepo testRepo,
+            Set<String> abis) throws ParseException, FileNotFoundException, ConfigurationException {
         // use LinkedHashSet to have predictable iteration order
         Set<ITestPackageDef> testPkgDefs = new LinkedHashSet<ITestPackageDef>();
         if (mPlanName != null) {
             Log.i(LOG_TAG, String.format("Executing CTS test plan %s", mPlanName));
             File ctsPlanFile = mCtsBuild.getTestPlanFile(mPlanName);
-            ITestPlan plan = createPlan(mPlanName);
+            ITestPlan plan = createPlan(mPlanName, abis);
             plan.parse(createXmlStream(ctsPlanFile));
             for (String id : plan.getTestIds()) {
                 if (!mExcludedPackageNames.contains(AbiUtils.parseId(id)[1])) {
@@ -660,13 +677,37 @@
                 Log.logAndDisplay(LogLevel.WARN, LOG_TAG, String.format(
                         "Could not find package for test class %s", mClassName));
             }
+        } else if (mTestName != null) {
+            Log.i(LOG_TAG, String.format("Executing CTS test %s", mTestName));
+            String [] split = mTestName.split("#");
+            if (split.length != 2) {
+                Log.logAndDisplay(LogLevel.WARN, LOG_TAG, String.format(
+                        "Could not parse class and method from test %s", mTestName));
+            } else {
+                String className = split[0];
+                String methodName = split[1];
+                // try to find packages to run from class name
+                List<String> packageIds = testRepo.findPackageIdsForTest(className);
+                if (!packageIds.isEmpty()) {
+                    for (String packageId: packageIds) {
+                        ITestPackageDef testPackageDef = testRepo.getTestPackage(packageId);
+                        if (testPackageDef != null) {
+                            testPackageDef.setClassName(className, methodName);
+                            testPkgDefs.add(testPackageDef);
+                        }
+                    }
+                } else {
+                    Log.logAndDisplay(LogLevel.WARN, LOG_TAG, String.format(
+                            "Could not find package for test class %s", mTestName));
+                }
+            }
         } else if (mContinueSessionId != null) {
             // create an in-memory derived plan that contains the notExecuted tests from previous
             // session use timestamp as plan name so it will hopefully be unique
             String uniquePlanName = Long.toString(System.currentTimeMillis());
             PlanCreator planCreator = new PlanCreator(uniquePlanName, mContinueSessionId,
                     CtsTestStatus.NOT_EXECUTED);
-            ITestPlan plan = createPlan(planCreator);
+            ITestPlan plan = createPlan(planCreator, abis);
             for (String id : plan.getTestIds()) {
                 if (!mExcludedPackageNames.contains(AbiUtils.parseId(id)[1])) {
                     ITestPackageDef testPackageDef = testRepo.getTestPackage(id);
@@ -812,20 +853,18 @@
      * Factory method for creating a {@link ITestPackageRepo}.
      * <p/>
      * Exposed for unit testing
-     * @throws DeviceNotAvailableException
      */
-    ITestPackageRepo createTestCaseRepo() throws DeviceNotAvailableException {
-        return new TestPackageRepo(mCtsBuild.getTestCasesDir(), getAbis(), mIncludeKnownFailures);
+    ITestPackageRepo createTestCaseRepo(Set<String> abis) {
+        return new TestPackageRepo(mCtsBuild.getTestCasesDir(), abis, mIncludeKnownFailures);
     }
 
     /**
      * Factory method for creating a {@link TestPlan}.
      * <p/>
      * Exposed for unit testing
-     * @throws DeviceNotAvailableException
      */
-    ITestPlan createPlan(String planName) throws DeviceNotAvailableException {
-        return new TestPlan(planName, getAbis());
+    ITestPlan createPlan(String planName, Set<String> abis) {
+        return new TestPlan(planName, abis);
     }
 
     /**
@@ -852,11 +891,10 @@
      * <p/>
      * Exposed for unit testing
      * @throws ConfigurationException
-     * @throws DeviceNotAvailableException
      */
-    ITestPlan createPlan(PlanCreator planCreator)
-            throws ConfigurationException, DeviceNotAvailableException {
-        return planCreator.createDerivedPlan(mCtsBuild, getAbis());
+    ITestPlan createPlan(PlanCreator planCreator, Set<String> abis)
+            throws ConfigurationException {
+        return planCreator.createDerivedPlan(mCtsBuild, abis);
     }
 
     /**
@@ -869,10 +907,10 @@
     }
 
     private void checkFields() {
-        // for simplicity of command line usage, make --plan, --package, and --class mutually
+        // for simplicity of command line usage, make --plan, --package, --test and --class mutually
         // exclusive
         boolean mutualExclusiveArgs = xor(mPlanName != null, mPackageNames.size() > 0,
-                mClassName != null, mContinueSessionId != null);
+                mClassName != null, mContinueSessionId != null, mTestName != null);
 
         if (!mutualExclusiveArgs) {
             throw new IllegalArgumentException(String.format(
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/DeqpTestRunner.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/DeqpTestRunner.java
index 9077b89..a981d96 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/DeqpTestRunner.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/DeqpTestRunner.java
@@ -2,7 +2,6 @@
 
 import com.android.cts.util.AbiUtils;
 import com.android.ddmlib.MultiLineReceiver;
-import com.android.ddmlib.testrunner.ITestRunListener;
 import com.android.ddmlib.testrunner.TestIdentifier;
 import com.android.tradefed.device.DeviceNotAvailableException;
 import com.android.tradefed.device.ITestDevice;
@@ -200,7 +199,7 @@
         Map <String, String> emptyMap = Collections.emptyMap();
 
         if (!mGotTestResult) {
-            mListener.testFailed(ITestRunListener.TestFailure.ERROR, mCurrentTestId,
+            mListener.testFailed(mCurrentTestId,
                     "Log doesn't contain test result");
         }
 
@@ -236,11 +235,11 @@
         } else if (code.compareTo("Fail") == 0 || code.compareTo("ResourceError") == 0
                 || code.compareTo("InternalError") == 0 || code.compareTo("Crash") == 0
                 || code.compareTo("Timeout") == 0) {
-            mListener.testFailed(ITestRunListener.TestFailure.ERROR, mCurrentTestId,
+            mListener.testFailed(mCurrentTestId,
                     code + ":" + details);
             mGotTestResult = true;
         } else {
-            mListener.testFailed(ITestRunListener.TestFailure.ERROR, mCurrentTestId,
+            mListener.testFailed(mCurrentTestId,
                     "Unknown result code: " + code + ":" + details);
             mGotTestResult = true;
         }
@@ -253,7 +252,7 @@
         Map <String, String> emptyMap = Collections.emptyMap();
 
         String reason = values.get("dEQP-TerminateTestCase-Reason");
-        mListener.testFailed(ITestRunListener.TestFailure.ERROR, mCurrentTestId,
+        mListener.testFailed(mCurrentTestId,
                 "Terminated: " + reason);
         mListener.testEnded(mCurrentTestId, emptyMap);
 
@@ -444,12 +443,10 @@
 
                         source.cancel();
                     }
-
-
-                    if (!mGotTestResult) {
-                        mListener.testFailed(ITestRunListener.TestFailure.ERROR, mCurrentTestId,
-                            "Log doesn't contain test result");
-                    }
+                if (!mGotTestResult) {
+                    mListener.testFailed(mCurrentTestId,
+                        "Log doesn't contain test result");
+                }
 
                     mListener.testEnded(mCurrentTestId, emptyMap);
                     mCurrentTestId = null;
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/GeeTestResultParser.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/GeeTestResultParser.java
index 67bef35..d0ea0cf 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/GeeTestResultParser.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/GeeTestResultParser.java
@@ -311,6 +311,7 @@
      *
      * @see IShellOutputReceiver#isCancelled()
      */
+    @Override
     public boolean isCancelled() {
         return mIsCancelled;
     }
@@ -548,14 +549,12 @@
             // If the test name of the result changed from what we started with, report that
             // the last known test failed, regardless of whether we received a pass or fail tag.
             for (ITestRunListener listener : mTestListeners) {
-                listener.testFailed(ITestRunListener.TestFailure.ERROR, testId,
-                                mCurrentTestResult.getTrace());
+                listener.testFailed(testId, mCurrentTestResult.getTrace());
             }
         }
         else if (!testPassed) {  // test failed
             for (ITestRunListener listener : mTestListeners) {
-                listener.testFailed(ITestRunListener.TestFailure.FAILURE, testId,
-                                mCurrentTestResult.getTrace());
+                listener.testFailed(testId, mCurrentTestResult.getTrace());
             }
         }
         // For all cases (pass or fail), we ultimately need to report test has ended
@@ -629,8 +628,7 @@
                 testRunStackTrace = mCurrentTestResult.getTrace();
             }
             for (ITestRunListener listener : mTestListeners) {
-                listener.testFailed(ITestRunListener.TestFailure.ERROR, testId,
-                        "No test results.\r\n" + testRunStackTrace);
+                listener.testFailed(testId, "No test results.\r\n" + testRunStackTrace);
                 listener.testEnded(testId, emptyMap);
             }
             clearCurrentTestResult();
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ResultFilter.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ResultFilter.java
index e3fcdc4..7931660 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ResultFilter.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ResultFilter.java
@@ -86,9 +86,9 @@
      * {@inheritDoc}
      */
     @Override
-    public void testFailed(TestFailure status, TestIdentifier test, String trace) {
+    public void testFailed(TestIdentifier test, String trace) {
         if (isKnownTest(test)) {
-            super.testFailed(status, test, trace);
+            super.testFailed(test, trace);
         }
     }
 
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/SingleJUnitTestResultParser.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/SingleJUnitTestResultParser.java
index 117a974..150d265 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/SingleJUnitTestResultParser.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/SingleJUnitTestResultParser.java
@@ -19,6 +19,7 @@
 import com.android.ddmlib.MultiLineReceiver;
 import com.android.ddmlib.testrunner.ITestRunListener;
 import com.android.ddmlib.testrunner.TestIdentifier;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -83,8 +84,7 @@
         // If test failed.
         if (!testPassed) {
             for (ITestRunListener listener : mTestListeners) {
-                listener.testFailed(ITestRunListener.TestFailure.FAILURE, mTestId,
-                        mStackTrace.toString());
+                listener.testFailed(mTestId, mStackTrace.toString());
             }
         }
         Map<String, String> emptyMap = Collections.emptyMap();
diff --git a/tools/tradefed-host/tests/Android.mk b/tools/tradefed-host/tests/Android.mk
index d3b94cd..7d4ab4a 100644
--- a/tools/tradefed-host/tests/Android.mk
+++ b/tools/tradefed-host/tests/Android.mk
@@ -21,7 +21,7 @@
 
 LOCAL_MODULE := cts-tradefed-tests
 LOCAL_MODULE_TAGS := optional
-LOCAL_JAVA_LIBRARIES := ddmlib-prebuilt tradefed-prebuilt cts-tradefed
+LOCAL_JAVA_LIBRARIES := tradefed-prebuilt cts-tradefed
 LOCAL_STATIC_JAVA_LIBRARIES := easymock
 
 include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/tools/tradefed-host/tests/run_unit_tests.sh b/tools/tradefed-host/tests/run_unit_tests.sh
index fc19a02..771dc75 100755
--- a/tools/tradefed-host/tests/run_unit_tests.sh
+++ b/tools/tradefed-host/tests/run_unit_tests.sh
@@ -37,7 +37,7 @@
 fi;
 
 JAR_DIR=${ANDROID_BUILD_TOP}/out/host/$OS/framework
-JARS="ddmlib-prebuilt.jar tradefed-prebuilt.jar hosttestlib.jar cts-tradefed.jar cts-tradefed-tests.jar"
+JARS="tradefed-prebuilt.jar hosttestlib.jar cts-tradefed.jar cts-tradefed-tests.jar"
 
 for JAR in $JARS; do
     checkFile ${JAR_DIR}/${JAR}
diff --git a/tools/tradefed-host/tests/src/com/android/cts/tradefed/UnitTests.java b/tools/tradefed-host/tests/src/com/android/cts/tradefed/UnitTests.java
index e46cfae..22dd6d9 100644
--- a/tools/tradefed-host/tests/src/com/android/cts/tradefed/UnitTests.java
+++ b/tools/tradefed-host/tests/src/com/android/cts/tradefed/UnitTests.java
@@ -30,7 +30,6 @@
 import com.android.cts.tradefed.testtype.TestPackageXmlParserTest;
 import com.android.cts.tradefed.testtype.TestPlanTest;
 import com.android.cts.tradefed.testtype.WrappedGTestResultParserTest;
-import com.android.cts.util.AbiUtils;
 import com.android.tradefed.testtype.IAbi;
 
 import junit.framework.Test;
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 b312526..48f1ba5 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
@@ -19,7 +19,6 @@
 
 import com.android.cts.tradefed.UnitTests;
 import com.android.cts.util.AbiUtils;
-import com.android.ddmlib.testrunner.ITestRunListener.TestFailure;
 import com.android.ddmlib.testrunner.TestIdentifier;
 import com.android.tradefed.build.IFolderBuildInfo;
 import com.android.tradefed.log.LogUtil.CLog;
@@ -160,7 +159,7 @@
         mResultReporter.invocationStarted(mMockBuild);
         mResultReporter.testRunStarted(AbiUtils.createId(UnitTests.ABI.getName(), "run"), 1);
         mResultReporter.testStarted(testId);
-        mResultReporter.testFailed(TestFailure.FAILURE, testId, trace);
+        mResultReporter.testFailed(testId, trace);
         mResultReporter.testEnded(testId, emptyMap);
         mResultReporter.testRunEnded(3, emptyMap);
         mResultReporter.invocationEnded(1);
diff --git a/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/CtsTestTest.java b/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/CtsTestTest.java
index 80f9e8c..42c2ed1 100644
--- a/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/CtsTestTest.java
+++ b/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/CtsTestTest.java
@@ -85,17 +85,17 @@
 
         mCtsTest = new CtsTest() {
             @Override
-            ITestPackageRepo createTestCaseRepo() {
+            ITestPackageRepo createTestCaseRepo(Set<String> abis) {
                 return mMockRepo;
             }
 
             @Override
-            ITestPlan createPlan(String planName) {
+            ITestPlan createPlan(String planName, Set<String> abis) {
                 return mMockPlan;
             }
 
             @Override
-            ITestPlan createPlan(PlanCreator planCreator) {
+            ITestPlan createPlan(PlanCreator planCreator, Set<String> abis) {
                 return mMockPlan;
             }
 
@@ -189,6 +189,26 @@
     }
 
     /**
+     * Test normal case {@link CtsTest#run(ITestInvocationListener)} when running a class.
+     */
+    @SuppressWarnings("unchecked")
+    public void testRun_test() throws DeviceNotAvailableException {
+        final String className = "className";
+        final String methodName = "methodName";
+        final String testName = String.format("%s#%s", className, methodName);
+        mCtsTest.setTestName(testName);
+
+        EasyMock.expect(mMockRepo.findPackageIdsForTest(className)).andReturn(IDS);
+        mMockPackageDef.setClassName(className, methodName);
+
+        setCreateAndRunTestExpectations();
+
+        replayMocks();
+        mCtsTest.run(mMockListener);
+        verifyMocks();
+    }
+
+    /**
      * Test {@link CtsTest#run(ITestInvocationListener)} when --excluded-package is specified
      */
     public void testRun_excludedPackage() throws DeviceNotAvailableException, ParseException {
diff --git a/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/DeqpTestRunnerTest.java b/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/DeqpTestRunnerTest.java
index 03ebfc5..1a92a39 100644
--- a/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/DeqpTestRunnerTest.java
+++ b/tools/tradefed-host/tests/src/com/android/cts/tradefed/testtype/DeqpTestRunnerTest.java
@@ -258,7 +258,7 @@
         EasyMock.expectLastCall().once();
 
         if (!pass) {
-            mockListener.testFailed(ITestRunListener.TestFailure.ERROR, testId,
+            mockListener.testFailed(testId,
                     resultCode + ":Detail" + resultCode);
 
             EasyMock.expectLastCall().once();
diff --git a/tools/utils/buildCts.py b/tools/utils/buildCts.py
index f9228d7..cdd6e10 100755
--- a/tools/utils/buildCts.py
+++ b/tools/utils/buildCts.py
@@ -180,6 +180,7 @@
 
     small_tests = BuildAospSmallSizeTestList()
     medium_tests = BuildAospMediumSizeTestList()
+    new_test_packages = BuildCtsVettedNewPackagesList()
 
     # CTS - sub plan for public, small size tests
     plan = tools.TestPlan(packages)
@@ -223,12 +224,23 @@
       plan.ExcludeTests(package, test_list)
     self.__WritePlan(plan, 'CTS-mediastress')
 
+    # CTS - sub plan for new tests that is vetted for L launch
+    plan = tools.TestPlan(packages)
+    plan.Exclude('.*')
+    for package, test_list in new_test_packages.iteritems():
+      plan.Include(package+'$')
+    for package, test_list in flaky_tests.iteritems():
+      plan.ExcludeTests(package, test_list)
+    self.__WritePlan(plan, 'CTS-l-tests')
+
     #CTS - sub plan for new test packages added for staging
     plan = tools.TestPlan(packages)
     for package, test_list in small_tests.iteritems():
       plan.Exclude(package+'$')
     for package, test_list in medium_tests.iteritems():
       plan.Exclude(package+'$')
+    for package, tests_list in new_test_packages.iteritems():
+      plan.Exclude(package+'$')
     plan.Exclude(r'android\.hardware$')
     plan.Exclude(r'android\.media$')
     plan.Exclude(r'android\.mediastress$')
@@ -236,6 +248,23 @@
       plan.ExcludeTests(package, test_list)
     self.__WritePlan(plan, 'CTS-staging')
 
+    plan = tools.TestPlan(packages)
+    plan.Exclude('.*')
+    plan.Include(r'android\.core\.tests\.libcore\.')
+    plan.Include(r'android\.jdwp')
+    self.__WritePlan(plan, 'CTS-ART')
+
+    plan = tools.TestPlan(packages)
+    plan.Exclude('.*')
+    plan.Include(r'com\.drawelements\.')
+    self.__WritePlan(plan, 'CTS-DEQP')
+
+    plan = tools.TestPlan(packages)
+    plan.Exclude('.*')
+    plan.Include(r'android\.webgl')
+    self.__WritePlan(plan, 'CTS-webview')
+
+
 def BuildAospMediumSizeTestList():
   """ Construct a defaultdic that lists package names of medium tests
       already published to aosp. """
@@ -317,6 +346,36 @@
       'com.android.cts.videoperf' : [],
       'zzz.android.monkey' : []}
 
+def BuildCtsVettedNewPackagesList():
+  """ Construct a defaultdict that maps package names that is vetted for L. """
+  return {
+      'android.appwidget' : [],
+      'android.core.tests.libcore.package.harmony_annotation' : [],
+      'android.core.tests.libcore.package.harmony_beans' : [],
+      'android.core.tests.libcore.package.harmony_java_io' : [],
+      'android.core.tests.libcore.package.harmony_java_lang' : [],
+      'android.core.tests.libcore.package.harmony_java_math' : [],
+      'android.core.tests.libcore.package.harmony_java_net' : [],
+      'android.core.tests.libcore.package.harmony_java_nio' : [],
+      'android.core.tests.libcore.package.harmony_java_util' : [],
+      'android.core.tests.libcore.package.harmony_javax_security' : [],
+      'android.core.tests.libcore.package.harmony_logging' : [],
+      'android.core.tests.libcore.package.harmony_prefs' : [],
+      'android.core.tests.libcore.package.harmony_sql' : [],
+      'android.core.tests.libcore.package.jsr166' : [],
+      'android.core.tests.libcore.package.okhttp' : [],
+      'android.display' : [],
+      'android.host.theme' : [],
+      'android.jdwp' : [],
+      'android.location2' : [],
+      'android.print' : [],
+      'android.renderscriptlegacy' : [],
+      'android.tests.sigtest' : [],
+      'android.tv' : [],
+      'android.uiautomation' : [],
+      'android.uirendering' : [],
+      'android.webgl' : []}
+
 def BuildCtsFlakyTestList():
   """ Construct a defaultdict that maps package name to a list of tests
       that are known to be flaky. """