Merge "Enable "PASS" button on proto params reader." into klp-dev
diff --git a/Android.mk b/Android.mk
index dbcc97b..4251262 100644
--- a/Android.mk
+++ b/Android.mk
@@ -14,7 +14,6 @@
 # limitations under the License.
 #
 
-include cts/suite/pts/PtsBenchmarkingList.mk
 include cts/CtsBuild.mk
 include cts/CtsCoverage.mk
 include $(call all-subdir-makefiles)
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index 5d23eb5..dab7b67 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -30,18 +30,22 @@
 	CtsMultiUserStorageApp
 
 cts_support_packages := \
-	$(PTS_SUPPORT_PACKAGES) \
-	CtsAccelerationTestStubs \
-	CtsDeviceAdmin \
-	CtsMonkeyApp \
-	CtsMonkeyApp2 \
-	CtsSomeAccessibilityServices \
-	CtsTestStubs \
-	SignatureTest \
-	TestDeviceSetup \
-	CtsUiAutomatorApp \
-	CtsUsbSerialTestApp \
-	$(cts_security_apps_list)
+    CtsDeviceOpenGl \
+    CtsDeviceTaskswitchingAppA \
+    CtsDeviceTaskswitchingAppB \
+    CtsDeviceTaskswitchingControl \
+    CtsDeviceUi \
+    CtsAccelerationTestStubs \
+    CtsDeviceAdmin \
+    CtsMonkeyApp \
+    CtsMonkeyApp2 \
+    CtsSomeAccessibilityServices \
+    CtsTestStubs \
+    SignatureTest \
+    TestDeviceSetup \
+    CtsUiAutomatorApp \
+    CtsUsbSerialTestApp \
+    $(cts_security_apps_list)
 
 cts_external_packages := \
 	com.replica.replicaisland
@@ -54,60 +58,66 @@
 
 # Test packages that require an associated test package XML.
 cts_test_packages := \
-	$(PTS_TEST_PACKAGES) \
-	CtsAccelerationTestCases \
-	CtsAccountManagerTestCases \
-	CtsAccessibilityServiceTestCases \
-	CtsAccessibilityTestCases \
-	CtsAdminTestCases \
-	CtsAnimationTestCases \
-	CtsAppTestCases \
-	CtsBluetoothTestCases \
-	CtsCalendarcommon2TestCases \
-	CtsContentTestCases \
-	CtsDatabaseTestCases \
-	CtsDisplayTestCases \
-	CtsDpiTestCases \
-	CtsDpiTestCases2 \
-	CtsDreamsTestCases \
-	CtsDrmTestCases \
-	CtsEffectTestCases \
-	CtsExampleTestCases \
-	CtsGestureTestCases \
-	CtsGraphicsTestCases \
-	CtsGraphics2TestCases \
-	CtsHardwareTestCases \
-	CtsHoloTestCases \
-	CtsJniTestCases \
-	CtsKeystoreTestCases \
-	CtsLocationTestCases \
-	CtsMediaStressTestCases \
-	CtsMediaTestCases \
-	CtsNativeOpenGLTestCases \
-	CtsNdefTestCases \
-	CtsNetTestCases \
-	CtsOpenGLTestCases \
-	CtsOpenGlPerfTestCases \
-	CtsOsTestCases \
-	CtsPermissionTestCases \
-	CtsPermission2TestCases \
-	CtsPreferenceTestCases \
-	CtsPreference2TestCases \
-	CtsProviderTestCases \
-	CtsRenderscriptTestCases \
-	CtsRenderscriptGraphicsTestCases \
-	CtsRsCppTestCases \
-	CtsSaxTestCases \
-	CtsSecurityTestCases \
-	CtsSpeechTestCases \
-	CtsTelephonyTestCases \
-	CtsTextTestCases \
-	CtsTextureViewTestCases \
-	CtsThemeTestCases \
-	CtsUtilTestCases \
-	CtsViewTestCases \
-	CtsWebkitTestCases \
-	CtsWidgetTestCases
+    CtsDeviceFilePerf \
+    CtsDeviceUi \
+    CtsDeviceDram \
+    CtsDeviceSimpleCpu \
+    CtsDeviceBrowserBench \
+    CtsDeviceVideoPerf \
+    CtsDeviceOpenGl \
+    CtsAccelerationTestCases \
+    CtsAccountManagerTestCases \
+    CtsAccessibilityServiceTestCases \
+    CtsAccessibilityTestCases \
+    CtsAdminTestCases \
+    CtsAnimationTestCases \
+    CtsAppTestCases \
+    CtsBluetoothTestCases \
+    CtsCalendarcommon2TestCases \
+    CtsContentTestCases \
+    CtsDatabaseTestCases \
+    CtsDisplayTestCases \
+    CtsDpiTestCases \
+    CtsDpiTestCases2 \
+    CtsDreamsTestCases \
+    CtsDrmTestCases \
+    CtsEffectTestCases \
+    CtsExampleTestCases \
+    CtsGestureTestCases \
+    CtsGraphicsTestCases \
+    CtsGraphics2TestCases \
+    CtsHardwareTestCases \
+    CtsHoloTestCases \
+    CtsJniTestCases \
+    CtsKeystoreTestCases \
+    CtsLocationTestCases \
+    CtsMediaStressTestCases \
+    CtsMediaTestCases \
+    CtsNativeOpenGLTestCases \
+    CtsNdefTestCases \
+    CtsNetTestCases \
+    CtsOpenGLTestCases \
+    CtsOpenGlPerfTestCases \
+    CtsOsTestCases \
+    CtsPermissionTestCases \
+    CtsPermission2TestCases \
+    CtsPreferenceTestCases \
+    CtsPreference2TestCases \
+    CtsProviderTestCases \
+    CtsRenderscriptTestCases \
+    CtsRenderscriptGraphicsTestCases \
+    CtsRsCppTestCases \
+    CtsSaxTestCases \
+    CtsSecurityTestCases \
+    CtsSpeechTestCases \
+    CtsTelephonyTestCases \
+    CtsTextTestCases \
+    CtsTextureViewTestCases \
+    CtsThemeTestCases \
+    CtsUtilTestCases \
+    CtsViewTestCases \
+    CtsWebkitTestCases \
+    CtsWidgetTestCases
 
 # All APKs that need to be scanned by the coverage utilities.
 CTS_COVERAGE_TEST_CASE_LIST := \
@@ -117,11 +127,12 @@
 
 # Host side only tests
 cts_host_libraries := \
-	$(PTS_HOST_CASES) \
-	CtsAdbTests \
-	CtsAppSecurityTests \
-	CtsMonkeyTestCases \
-	CtsUsbTests
+    CtsHostUi \
+    CtsHostJank \
+    CtsAdbTests \
+    CtsAppSecurityTests \
+    CtsMonkeyTestCases \
+    CtsUsbTests
 
 
 # Native test executables that need to have associated test XMLs.
@@ -131,23 +142,26 @@
 	bionic-unit-tests-cts \
 
 cts_ui_tests := \
-	CtsUiAutomatorTests
+    CtsUiAutomatorTests
+
+cts_device_jars := \
+    CtsDeviceJank
 
 # All the files that will end up under the repository/testcases
 # directory of the final CTS distribution.
 CTS_TEST_CASES := $(call cts-get-lib-paths,$(cts_host_libraries)) \
-		$(call cts-get-package-paths,$(cts_test_packages)) \
-		$(call cts-get-native-paths,$(cts_native_exes)) \
-		$(call cts-get-ui-lib-paths,$(cts_ui_tests)) \
-		$(call cts-get-ui-lib-paths,$(pts_device_lib_tests))
+    $(call cts-get-package-paths,$(cts_test_packages)) \
+    $(call cts-get-native-paths,$(cts_native_exes)) \
+    $(call cts-get-ui-lib-paths,$(cts_ui_tests)) \
+    $(call cts-get-ui-lib-paths,$(cts_device_jars))
 
 # All the XMLs that will end up under the repository/testcases
 # and that need to be created before making the final CTS distribution.
 CTS_TEST_XMLS := $(call cts-get-test-xmls,$(cts_host_libraries)) \
-		$(call cts-get-test-xmls,$(cts_test_packages)) \
-		$(call cts-get-test-xmls,$(cts_native_exes)) \
-		$(call cts-get-test-xmls,$(cts_ui_tests))
+    $(call cts-get-test-xmls,$(cts_test_packages)) \
+    $(call cts-get-test-xmls,$(cts_native_exes)) \
+    $(call cts-get-test-xmls,$(cts_ui_tests))
 
 
 # The following files will be placed in the tools directory of the CTS distribution
-CTS_TOOLS_LIST :=
+CTS_TOOLS_LIST :=
\ No newline at end of file
diff --git a/apps/CtsVerifier/AndroidManifest.xml b/apps/CtsVerifier/AndroidManifest.xml
index d0fd269..ff79003 100644
--- a/apps/CtsVerifier/AndroidManifest.xml
+++ b/apps/CtsVerifier/AndroidManifest.xml
@@ -18,7 +18,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
       package="com.android.cts.verifier"
       android:versionCode="1"
-      android:versionName="4.4_r0">
+      android:versionName="4.4_r1">
 
     <!-- Using 10+ for more complete NFC support... -->
     <uses-sdk android:minSdkVersion="12"></uses-sdk>
@@ -503,6 +503,7 @@
             <meta-data android:name="test_required_features" android:value="android.hardware.camera.any"/>
         </activity>
 
+
         <activity android:name=".camera.orientation.CameraOrientationActivity"
                  android:label="@string/camera_orientation"
                  android:screenOrientation="landscape">
@@ -539,6 +540,19 @@
             android:label="@string/camera_fov_label_options" >
         </activity>
 
+
+        <activity android:name=".camera.video.CameraVideoActivity"
+                 android:label="@string/camera_video"
+                 android:screenOrientation="landscape">
+            <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_camera" />
+            <meta-data android:name="test_required_features"
+                    android:value="android.hardware.camera.any"/>
+        </activity>
+
         <activity android:name=".usb.UsbAccessoryTestActivity"
                 android:label="@string/usb_accessory_test"
                 android:configChanges="keyboardHidden|orientation|screenSize">
@@ -579,7 +593,7 @@
             </intent-filter>
         </service>
 
-        <service  android:name="nls.NotificationListenerVerifierActivity$DismissService"/>
+        <service  android:name=".nls.NotificationListenerVerifierActivity$DismissService"/>
         <activity android:name=".security.CAInstallNotificationVerifierActivity"
                 android:label="@string/cacert_test">
             <intent-filter>
diff --git a/apps/CtsVerifier/res/layout/camera_video.xml b/apps/CtsVerifier/res/layout/camera_video.xml
new file mode 100644
index 0000000..b81721b
--- /dev/null
+++ b/apps/CtsVerifier/res/layout/camera_video.xml
@@ -0,0 +1,108 @@
+<?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">
+
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="fill_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1" >
+
+        <LinearLayout
+            android:orientation="vertical"
+            android:layout_width="0dp"
+            android:layout_height="fill_parent"
+            android:layout_weight="3"
+            android:gravity="center" >
+
+            <TextureView
+                android:id="@+id/video_capture"
+                android:layout_height="0dp"
+                android:layout_width="fill_parent"
+                android:layout_weight="3" />
+            <TextView
+                android:id="@+id/camera_video_capture_label"
+                android:layout_height="wrap_content"
+                android:layout_width="fill_parent"
+                android:text="@string/video_capture_label"
+                android:padding="2dp"
+                android:textSize="16sp"
+                android:gravity="center" />
+
+        </LinearLayout>
+        <LinearLayout
+            android:orientation="vertical"
+            android:layout_width="0dp"
+            android:layout_height="fill_parent"
+            android:layout_weight="3"
+            android:gravity="center" >
+
+            <VideoView
+                android:id="@+id/video_playback"
+                android:layout_height="0dp"
+                android:layout_width="fill_parent"
+                android:layout_weight="3" />
+            <TextView
+                android:id="@+id/camera_video_playback_label"
+                android:layout_height="wrap_content"
+                android:layout_width="fill_parent"
+                android:text="@string/video_playback_label"
+                android:padding="2dp"
+                android:textSize="16sp"
+                android:gravity="center" />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:orientation="vertical"
+            android:layout_width="0dp"
+            android:layout_height="fill_parent"
+            android:layout_weight="2" >
+
+            <Spinner
+                android:id="@+id/cameras_selection"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"/>
+            <Spinner
+                android:id="@+id/resolution_selection"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"/>
+            <Button
+                android:id="@+id/record_button"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/record_button_text"/>
+            <TextView
+                android:id="@+id/status_label"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/status_ready"
+                android:padding="2dp"
+                android:textSize="16sp"
+                android:gravity="center" />
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+    <include layout="@layout/pass_fail_buttons" />
+
+</LinearLayout>
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index 840c369..854744d 100644
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -480,6 +480,29 @@
     <string name="cf_preview_label">Normal preview</string>
     <string name="cf_format_label">Processed callback data</string>
 
+    <!-- Strings for Camera Video -->
+    <string name="record_button_text">Test</string>
+    <string name="camera_video">Camera Video</string>
+    <string name="video_info"> This test checks video capture
+    at different resolutions. \n - The left view window shows the preview.
+    \n - Pressing the test button will trigger three
+    seconds of video recording. Playback will show up in the right view
+    window after recording is complete. \n - Use the spinners to choose
+    camera and resolution combinations. The playback should be similar
+    to what you saw in preview. \n - After all possible combinations
+    are tested, the pass button will be enabled. You may press the pass
+    button to indicate a pass. \n - You may press fail button any time during
+    the test to indicate failure.
+    </string>
+    <string name="video_capture_label">Video capture</string>
+    <string name="video_playback_label">Video playback</string>
+    <string name="dialog_fail_test">Test failed</string>
+    <string name="fail_quit">Fail and quit</string>
+    <string name="cancel">Cancel</string>
+    <string name="status_ready">Ready</string>
+    <string name="status_recording">Recording</string>
+    <string name="status_playback">Playing back</string>
+
     <!-- Strings for USB accessory test activity -->
     <string name="usb_accessory_test">USB Accessory Test</string>
     <string name="usb_accessory_test_info">
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/formats/CameraFormatsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/formats/CameraFormatsActivity.java
index 9989057..7856591 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/formats/CameraFormatsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/formats/CameraFormatsActivity.java
@@ -172,6 +172,7 @@
         super.onPause();
 
         shutdownCamera();
+        mPreviewTexture = null;
     }
 
     @Override
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java
new file mode 100644
index 0000000..22f1813
--- /dev/null
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/video/CameraVideoActivity.java
@@ -0,0 +1,770 @@
+/*
+ * 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.camera.video;
+
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.graphics.Matrix;
+import android.graphics.SurfaceTexture;
+import android.hardware.Camera;
+import android.hardware.Camera.CameraInfo;
+import android.hardware.Camera.Size;
+import android.media.CamcorderProfile;
+import android.media.MediaPlayer;
+import android.media.MediaRecorder;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.Handler;
+import android.util.Log;
+import android.view.Surface;
+import android.view.TextureView;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.VideoView;
+
+import com.android.cts.verifier.PassFailButtons;
+import com.android.cts.verifier.R;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.TreeSet;
+
+
+/**
+ * Tests for manual verification of camera video capture
+ */
+public class CameraVideoActivity extends PassFailButtons.Activity
+        implements TextureView.SurfaceTextureListener {
+
+    private static final String TAG = "CtsCameraVideo";
+    private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
+    private static final int MEDIA_TYPE_IMAGE = 1;
+    private static final int MEDIA_TYPE_VIDEO = 2;
+    private static final int VIDEO_LENGTH = 3000; // in ms
+
+    private TextureView mPreviewView;
+    private SurfaceTexture mPreviewTexture;
+    private int mPreviewTexWidth;
+    private int mPreviewTexHeight;
+    private int mPreviewRotation;
+
+    private VideoView mPlaybackView;
+
+    private Spinner mCameraSpinner;
+    private Spinner mResolutionSpinner;
+
+    private int mCurrentCameraId = -1;
+    private Camera mCamera;
+
+    private MediaRecorder mMediaRecorder;
+
+    private List<Size> mPreviewSizes;
+    private Size mNextPreviewSize;
+    private Size mPreviewSize;
+    private List<Integer> mVideoSizeIds;
+    private int mCurrentVideoSizeId;
+
+    private boolean isRecording = false;
+    private boolean isPlayingBack = false;
+    private Button captureButton;
+    private Button mPassButton;
+    private Button mFailButton;
+
+    private TextView mStatusLabel;
+
+    private TreeSet<String> mTestedCombinations = new TreeSet<String>();
+    private TreeSet<String> mUntestedCombinations = new TreeSet<String>();
+
+    private File outputVideoFile;
+
+    /**
+     * @see #MEDIA_TYPE_IMAGE
+     * @see #MEDIA_TYPE_VIDEO
+     */
+    private static File getOutputMediaFile(int type) {
+        // Question: why do I need to comment this to get it working?
+        // Logcat says "external storage not ready"
+        // if (Environment.getExternalStorageState() != Environment.MEDIA_MOUNTED) {
+        //     Log.e(TAG, "external storage not ready");
+        //     return null;
+        // }
+
+        File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(
+                Environment.DIRECTORY_MOVIES), TAG);
+
+        if (!mediaStorageDir.exists()) {
+            if (!mediaStorageDir.mkdirs()) {
+                Log.d(TAG, "failed to create directory");
+                return null;
+            }
+        }
+
+        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
+        File mediaFile;
+        if (type == MEDIA_TYPE_IMAGE) {
+            mediaFile = new File(mediaStorageDir.getPath() + File.separator +
+                    "IMG_" + timeStamp + ".jpg");
+        } else if (type == MEDIA_TYPE_VIDEO) {
+            mediaFile = new File(mediaStorageDir.getPath() + File.separator +
+                    "VID_" + timeStamp + ".mp4");
+            if (VERBOSE) {
+                Log.v(TAG, "getOutputMediaFile: output file " + mediaFile.getPath());
+            }
+        } else {
+            return null;
+        }
+
+        return mediaFile;
+    }
+
+    private boolean prepareVideoRecorder() {
+
+        mMediaRecorder = new MediaRecorder();
+
+        // Step 1: unlock and set camera to MediaRecorder
+        mCamera.unlock();
+        mMediaRecorder.setCamera(mCamera);
+
+        // Step 2: set sources
+        mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
+        mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
+
+        // Step 3: set a CamcorderProfile
+        mMediaRecorder.setProfile(CamcorderProfile.get(mCurrentCameraId, mCurrentVideoSizeId));
+
+        // Step 4: set output file
+        outputVideoFile = getOutputMediaFile(MEDIA_TYPE_VIDEO);
+        mMediaRecorder.setOutputFile(outputVideoFile.toString());
+
+        // Step 5: set preview output
+        // This is not necessary since preview has been taken care of
+
+        // Step 6: prepare configured MediaRecorder
+        try {
+            mMediaRecorder.prepare();
+        } catch (IOException e) {
+            Log.e(TAG, "IOException preparing MediaRecorder: ", e);
+            releaseMediaRecorder();
+            throw new AssertionError(e);
+        }
+
+        mMediaRecorder.setOnErrorListener(
+                new MediaRecorder.OnErrorListener() {
+                    @Override
+                    public void onError(MediaRecorder mr, int what, int extra) {
+                        if (what == MediaRecorder.MEDIA_RECORDER_ERROR_UNKNOWN) {
+                            Log.e(TAG, "unknown error in media recorder, error: " + extra);
+                        } else {
+                            Log.e(TAG, "media recorder server died, error: " + extra);
+                        }
+
+                        failTest("Media recorder error.");
+                    }
+                });
+
+        if (VERBOSE) {
+            Log.v(TAG, "prepareVideoRecorder: prepared configured MediaRecorder");
+        }
+
+        return true;
+    }
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.camera_video);
+        setPassFailButtonClickListeners();
+        setInfoResources(R.string.camera_video, R.string.video_info, /*viewId*/-1);
+
+        mPreviewView = (TextureView) findViewById(R.id.video_capture);
+        mPlaybackView = (VideoView) findViewById(R.id.video_playback);
+        mPlaybackView.setOnCompletionListener(mPlaybackViewListener);
+
+        captureButton = (Button) findViewById(R.id.record_button);
+        mPassButton = (Button) findViewById(R.id.pass_button);
+        mFailButton = (Button) findViewById(R.id.fail_button);
+        mPassButton.setEnabled(false);
+        mFailButton.setEnabled(true);
+
+        mPreviewView.setSurfaceTextureListener(this);
+
+        int numCameras = Camera.getNumberOfCameras();
+        String[] cameraNames = new String[numCameras];
+        for (int i = 0; i < numCameras; i++) {
+            cameraNames[i] = "Camera " + i;
+            mUntestedCombinations.add("All combinations for Camera " + i + "\n");
+        }
+        if (VERBOSE) {
+            Log.v(TAG, "onCreate: number of cameras=" + numCameras);
+        }
+        mCameraSpinner = (Spinner) findViewById(R.id.cameras_selection);
+        mCameraSpinner.setAdapter(
+            new ArrayAdapter<String>(
+                this, R.layout.cf_format_list_item, cameraNames));
+        mCameraSpinner.setOnItemSelectedListener(mCameraSpinnerListener);
+
+        mResolutionSpinner = (Spinner) findViewById(R.id.resolution_selection);
+        mResolutionSpinner.setOnItemSelectedListener(mResolutionSelectedListener);
+
+        mStatusLabel = (TextView) findViewById(R.id.status_label);
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+
+        setUpCamera(mCameraSpinner.getSelectedItemPosition());
+        if (VERBOSE) {
+            Log.v(TAG, "onResume: camera has been setup");
+        }
+
+        setUpCaptureButton();
+        if (VERBOSE) {
+            Log.v(TAG, "onResume: captureButton has been setup");
+        }
+
+    }
+
+    @Override
+    public void onPause() {
+        super.onPause();
+
+        releaseMediaRecorder();
+        shutdownCamera();
+        mPreviewTexture = null;
+    }
+
+    private MediaPlayer.OnCompletionListener mPlaybackViewListener =
+            new MediaPlayer.OnCompletionListener() {
+
+                @Override
+                public void onCompletion(MediaPlayer mp) {
+                    isPlayingBack = false;
+                    captureButton.setEnabled(true);
+                    mStatusLabel.setText(getResources().getString(R.string.status_ready));
+                }
+
+    };
+
+    private void releaseMediaRecorder() {
+        if (mMediaRecorder != null) {
+            mMediaRecorder.reset();
+            mMediaRecorder.release();
+            mMediaRecorder = null;
+            mCamera.lock(); // check here, lock camera for later use
+        }
+    }
+
+    @Override
+    public String getTestDetails() {
+        StringBuilder reportBuilder = new StringBuilder();
+        reportBuilder.append("Tested combinations:\n");
+        for (String combination : mTestedCombinations) {
+            reportBuilder.append(combination);
+        }
+        reportBuilder.append("Untested combinations:\n");
+        for (String combination : mUntestedCombinations) {
+            reportBuilder.append(combination);
+        }
+        return reportBuilder.toString();
+    }
+
+    @Override
+    public void onSurfaceTextureAvailable(SurfaceTexture surface,
+            int width, int height) {
+        mPreviewTexture = surface;
+        mPreviewTexWidth = width;
+        mPreviewTexHeight = height;
+        if (mCamera != null) {
+            startPreview();
+        }
+    }
+
+    @Override
+    public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {
+        // Ignored, Camera does all the work for us
+    }
+
+    @Override
+    public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
+        return true;
+    }
+
+
+    @Override
+    public void onSurfaceTextureUpdated(SurfaceTexture surface) {
+        // Invoked every time there's a new Camera preview frame
+    }
+
+    private AdapterView.OnItemSelectedListener mCameraSpinnerListener =
+            new AdapterView.OnItemSelectedListener() {
+                @Override
+                public void onItemSelected(AdapterView<?> parent,
+                        View view, int pos, long id) {
+                    if (mCurrentCameraId != pos) {
+                        setUpCamera(pos);
+                    }
+                }
+
+                @Override
+                public void onNothingSelected(AdapterView<?> parent) {
+                    // Intentionally left blank
+                }
+
+            };
+
+    private AdapterView.OnItemSelectedListener mResolutionSelectedListener =
+            new AdapterView.OnItemSelectedListener() {
+                @Override
+                public void onItemSelected(AdapterView<?> parent,
+                        View view, int position, long id) {
+                    if (mVideoSizeIds.get(position) != mCurrentVideoSizeId) {
+                        mCurrentVideoSizeId = mVideoSizeIds.get(position);
+                        if (VERBOSE) {
+                            Log.v(TAG, "onItemSelected: mCurrentVideoSizeId = " +
+                                    mCurrentVideoSizeId);
+                        }
+                        mNextPreviewSize = matchPreviewRecordSize();
+                        if (VERBOSE) {
+                            Log.v(TAG, "onItemSelected: setting preview size "
+                                    + mNextPreviewSize.width + "x" + mNextPreviewSize.height);
+                        }
+
+                        startPreview();
+                        if (VERBOSE) {
+                            Log.v(TAG, "onItemSelected: started new preview");
+                        }
+                    }
+                }
+
+                @Override
+                public void onNothingSelected(AdapterView<?> parent) {
+                    // Intentionally left blank
+                }
+
+            };
+
+
+    private void setUpCaptureButton() {
+        captureButton.setOnClickListener (
+                new View.OnClickListener() {
+                    @Override
+                    public void onClick(View V) {
+                        if ((!isRecording) && (!isPlayingBack)) {
+                            if (prepareVideoRecorder()) {
+                                mMediaRecorder.start();
+                                if (VERBOSE) {
+                                    Log.v(TAG, "onClick: started mMediaRecorder");
+                                }
+                                isRecording = true;
+                                captureButton.setEnabled(false);
+                                mStatusLabel.setText(getResources()
+                                        .getString(R.string.status_recording));
+                            } else {
+                                releaseMediaRecorder();
+                                Log.e(TAG, "media recorder cannot be set up");
+                                failTest("Unable to set up media recorder.");
+                            }
+                            Handler h = new Handler();
+                            Runnable mDelayedPreview = new Runnable() {
+                                @Override
+                                public void run() {
+                                    mMediaRecorder.stop();
+                                    releaseMediaRecorder();
+
+                                    mPlaybackView.setVideoPath(outputVideoFile.getPath());
+                                    mPlaybackView.start();
+                                    isRecording = false;
+                                    isPlayingBack = true;
+                                    mStatusLabel.setText(getResources()
+                                            .getString(R.string.status_playback));
+                                    String combination = "Camera " + mCurrentCameraId + ", " +
+                                            mCurrentVideoSizeId + "\n";
+                                    mUntestedCombinations.remove(combination);
+                                    mTestedCombinations.add(combination);
+
+                                    if (mUntestedCombinations.isEmpty()) {
+                                        mPassButton.setEnabled(true);
+                                        if (VERBOSE) {
+                                            Log.v(TAG, "run: test success");
+                                        }
+                                    }
+                                }
+                            };
+                            h.postDelayed(mDelayedPreview, VIDEO_LENGTH);
+                        }
+
+                    }
+                }
+        );
+    }
+
+    private class VideoSizeNamePair {
+        private int sizeId;
+        private String sizeName;
+
+        public VideoSizeNamePair(int id, String name) {
+            sizeId = id;
+            sizeName = name;
+        }
+
+        public int getSizeId() {
+            return sizeId;
+        }
+
+        public String getSizeName() {
+            return sizeName;
+        }
+    }
+
+    private ArrayList<VideoSizeNamePair> getVideoSizeNamePairs(int cameraId) {
+        int[] qualityArray = {
+                CamcorderProfile.QUALITY_LOW,
+                CamcorderProfile.QUALITY_HIGH,
+                CamcorderProfile.QUALITY_QCIF,
+                CamcorderProfile.QUALITY_CIF,
+                CamcorderProfile.QUALITY_480P,
+                CamcorderProfile.QUALITY_720P,
+                CamcorderProfile.QUALITY_1080P
+        };
+
+        String[] nameArray = {
+                "LOW",
+                "HIGH",
+                "QCIF",
+                "CIF",
+                "480P",
+                "720P",
+                "1080P"
+        };
+
+        ArrayList<VideoSizeNamePair> availableSizes =
+                new ArrayList<VideoSizeNamePair> ();
+
+        for (int i = 0; i < qualityArray.length; i++) {
+            if (CamcorderProfile.hasProfile(cameraId, qualityArray[i])) {
+                VideoSizeNamePair pair = new VideoSizeNamePair(qualityArray[i], nameArray[i]);
+                availableSizes.add(pair);
+            }
+        }
+        return availableSizes;
+    }
+
+    static class ResolutionQuality {
+        private int videoSizeId;
+        private int width;
+        private int height;
+
+        public ResolutionQuality() {
+            // intentionally left blank
+        }
+        public ResolutionQuality(int newSizeId, int newWidth, int newHeight) {
+            videoSizeId = newSizeId;
+            width = newWidth;
+            height = newHeight;
+        }
+    }
+
+    private Size findRecordSize() {
+        int[] possibleQuality = {
+                CamcorderProfile.QUALITY_QCIF,
+                CamcorderProfile.QUALITY_CIF,
+                CamcorderProfile.QUALITY_480P,
+                CamcorderProfile.QUALITY_720P,
+                CamcorderProfile.QUALITY_1080P
+        };
+
+        Size[] sizes = new Size[] {
+                mCamera.new Size(176, 144),
+                mCamera.new Size(352, 288),
+                mCamera.new Size(720, 480),
+                mCamera.new Size(1280, 720),
+                mCamera.new Size(1920, 1080)
+        };
+
+        Size minSize = mCamera.new Size(Integer.MAX_VALUE, Integer.MAX_VALUE);
+        Size maxSize = mCamera.new Size(0, 0);
+
+        for (int i = 0; i < possibleQuality.length; i++) {
+            if (mVideoSizeIds.contains(possibleQuality[i])) {
+                if (sizes[i].height < minSize.height) {
+                    minSize = sizes[i];
+                }
+                if (sizes[i].height > maxSize.height) {
+                    maxSize = sizes[i];
+                }
+            }
+        }
+
+        ArrayList<ResolutionQuality> qualityList = new ArrayList<ResolutionQuality>();
+        qualityList.add(new ResolutionQuality(CamcorderProfile.QUALITY_LOW, minSize.width,
+                minSize.height));
+        qualityList.add(new ResolutionQuality(CamcorderProfile.QUALITY_HIGH, maxSize.width,
+                maxSize.height));
+        for (int i = 0; i < possibleQuality.length; i++) {
+            qualityList.add(new ResolutionQuality(possibleQuality[i], sizes[i].width,
+                    sizes[i].height));
+        }
+
+        Size recordSize = null;
+        for (int i = 0; i < qualityList.size(); i++) {
+            if (mCurrentVideoSizeId == qualityList.get(i).videoSizeId) {
+                recordSize = mCamera.new Size(qualityList.get(i).width,
+                        qualityList.get(i).height);
+                break;
+            }
+        }
+
+        if (recordSize == null) {
+            Log.e(TAG, "findRecordSize: did not find a match");
+            failTest("Cannot find video size");
+        }
+        return recordSize;
+    }
+
+    // Match preview size with current recording size mCurrentVideoSizeId
+    private Size matchPreviewRecordSize() {
+        Size recordSize = findRecordSize();
+
+        Size matchedSize = null;
+        // First try to find exact match in size
+        for (int i = 0; i < mPreviewSizes.size(); i++) {
+            if (mPreviewSizes.get(i).equals(recordSize)) {
+                matchedSize = mCamera.new Size(recordSize.width, recordSize.height);
+                break;
+            }
+        }
+        // Second try to find one with similar if not the same aspect ratio
+        if (matchedSize == null) {
+            for (int i = mPreviewSizes.size() - 1; i >= 0; i--) {
+                if (Math.abs((float)mPreviewSizes.get(i).width * recordSize.height /
+                        mPreviewSizes.get(i).height / recordSize.width - 1) < 0.1) {
+                    matchedSize = mCamera.new Size(mPreviewSizes.get(i).width,
+                            mPreviewSizes.get(i).height);
+                    break;
+                }
+            }
+        }
+        // Last resort, just use the first preview size
+        if (matchedSize == null) {
+            matchedSize = mCamera.new Size(mPreviewSizes.get(0).width,
+                    mPreviewSizes.get(0).height);
+        }
+
+        if (VERBOSE) {
+            Log.v(TAG, "matchPreviewRecordSize " + matchedSize.width + "x" + matchedSize.height);
+        }
+
+        return matchedSize;
+    }
+
+    private void setUpCamera(int id) {
+        shutdownCamera();
+
+        mCurrentCameraId = id;
+        try {
+            mCamera = Camera.open(id);
+        }
+        catch (Exception e) {
+            Log.e(TAG, "camera is not available", e);
+            failTest("camera not available" + e.getMessage());
+            return;
+        }
+
+        Camera.Parameters p = mCamera.getParameters();
+        if (VERBOSE) {
+            Log.v(TAG, "setUpCamera: setUpCamera got camera parameters");
+        }
+
+        // Get preview resolutions
+        List<Size> unsortedSizes = p.getSupportedPreviewSizes();
+
+        class SizeCompare implements Comparator<Size> {
+            @Override
+            public int compare(Size lhs, Size rhs) {
+                if (lhs.width < rhs.width) return -1;
+                if (lhs.width > rhs.width) return 1;
+                if (lhs.height < rhs.height) return -1;
+                if (lhs.height > rhs.height) return 1;
+                return 0;
+            }
+        };
+
+        SizeCompare s = new SizeCompare();
+        TreeSet<Size> sortedResolutions = new TreeSet<Size>(s);
+        sortedResolutions.addAll(unsortedSizes);
+
+        mPreviewSizes = new ArrayList<Size>(sortedResolutions);
+
+        ArrayList<VideoSizeNamePair> availableVideoSizes = getVideoSizeNamePairs(id);
+        String[] availableVideoSizeNames = new String[availableVideoSizes.size()];
+        mVideoSizeIds = new ArrayList<Integer>();
+        for (int i = 0; i < availableVideoSizes.size(); i++) {
+            availableVideoSizeNames[i] = availableVideoSizes.get(i).getSizeName();
+            mVideoSizeIds.add(availableVideoSizes.get(i).getSizeId());
+        }
+
+        mResolutionSpinner.setAdapter(
+            new ArrayAdapter<String>(
+                this, R.layout.cf_format_list_item, availableVideoSizeNames));
+
+        // Update untested
+        mUntestedCombinations.remove("All combinations for Camera " + id + "\n");
+        for (int videoSizeId: mVideoSizeIds) {
+            String combination = "Camera " + id + ", " + videoSizeId + "\n";
+            if (!mTestedCombinations.contains(combination)) {
+                mUntestedCombinations.add(combination);
+            }
+        }
+
+        // Set initial values
+        mCurrentVideoSizeId = mVideoSizeIds.get(0);
+        mNextPreviewSize = matchPreviewRecordSize();
+        mResolutionSpinner.setSelection(0);
+
+        // Set up correct display orientation
+        CameraInfo info = new CameraInfo();
+        Camera.getCameraInfo(id, info);
+        int rotation = getWindowManager().getDefaultDisplay().getRotation();
+        int degrees = 0;
+        switch (rotation) {
+            case Surface.ROTATION_0: degrees = 0; break;
+            case Surface.ROTATION_90: degrees = 90; break;
+            case Surface.ROTATION_180: degrees = 180; break;
+            case Surface.ROTATION_270: degrees = 270; break;
+        }
+
+        if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
+            mPreviewRotation = (info.orientation + degrees) % 360;
+            mPreviewRotation = (360 - mPreviewRotation) % 360;  // compensate the mirror
+        } else {  // back-facing
+            mPreviewRotation = (info.orientation - degrees + 360) % 360;
+        }
+        if (mPreviewRotation != 0 && mPreviewRotation != 180) {
+            Log.w(TAG,
+                "Display orientation correction is not 0 or 180, as expected!");
+        }
+
+        mCamera.setDisplayOrientation(mPreviewRotation);
+
+        // Start up preview if display is ready
+        if (mPreviewTexture != null) {
+            startPreview();
+        }
+    }
+
+    private void shutdownCamera() {
+        if (mCamera != null) {
+            mCamera.setPreviewCallback(null);
+            mCamera.stopPreview();
+            mCamera.release();
+            mCamera = null;
+        }
+    }
+
+    /**
+     * starts capturing and drawing frames on screen
+     */
+    private void startPreview() {
+
+        mCamera.stopPreview();
+
+        Matrix transform = new Matrix();
+        float widthRatio = mNextPreviewSize.width / (float)mPreviewTexWidth;
+        float heightRatio = mNextPreviewSize.height / (float)mPreviewTexHeight;
+        if (VERBOSE) {
+            Log.v(TAG, "startPreview: widthRatio=" + widthRatio + " " + "heightRatio=" +
+                    heightRatio);
+        }
+
+        if (heightRatio < widthRatio) {
+            transform.setScale(1, heightRatio / widthRatio);
+            transform.postTranslate(0,
+                    mPreviewTexHeight * (1 - heightRatio / widthRatio) / 2);
+            if (VERBOSE) {
+                Log.v(TAG, "startPreview: shrink vertical by " + heightRatio / widthRatio);
+            }
+        } else {
+            transform.setScale(widthRatio / heightRatio, 1);
+            transform.postTranslate(mPreviewTexWidth * (1 - widthRatio / heightRatio) / 2, 0);
+            if (VERBOSE) {
+                Log.v(TAG, "startPreview: shrink horizontal by " + widthRatio / heightRatio);
+            }
+        }
+
+        mPreviewView.setTransform(transform);
+
+        mPreviewSize = mNextPreviewSize;
+
+        Camera.Parameters p = mCamera.getParameters();
+        p.setPreviewSize(mPreviewSize.width, mPreviewSize.height);
+        mCamera.setParameters(p);
+
+        try {
+            mCamera.setPreviewTexture(mPreviewTexture);
+            if (mPreviewTexture == null) {
+                Log.e(TAG, "preview texture is null.");
+            }
+            if (VERBOSE) {
+                Log.v(TAG, "startPreview: set preview texture in startPreview");
+            }
+            mCamera.startPreview();
+            if (VERBOSE) {
+                Log.v(TAG, "startPreview: started preview in startPreview");
+            }
+        } catch (IOException ioe) {
+            Log.e(TAG, "Unable to start up preview", ioe);
+            // Show a dialog box to tell user test failed
+            failTest("Unable to start preview.");
+        }
+    }
+
+    private void failTest(String failMessage) {
+        DialogInterface.OnClickListener dialogClickListener =
+                new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+                        switch (which) {
+                            case DialogInterface.BUTTON_POSITIVE:
+                                PassFailButtons.setTestResultAndFinish(CameraVideoActivity.this,
+                                        CameraVideoActivity.this.getTestId(),
+                                        CameraVideoActivity.this.getTestDetails(),
+                                        /* passed */false);
+                                break;
+                            case DialogInterface.BUTTON_NEGATIVE:
+                                break;
+                        }
+                    }
+                };
+
+        AlertDialog.Builder builder = new AlertDialog.Builder(CameraVideoActivity.this);
+        builder.setMessage(getString(R.string.dialog_fail_test) + ". " + failMessage)
+                .setPositiveButton(R.string.fail_quit, dialogClickListener)
+                .setNegativeButton(R.string.cancel, dialogClickListener)
+                .show();
+    }
+
+}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/BaseSensorSemiAutomatedTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/BaseSensorSemiAutomatedTestActivity.java
index 9f4b2b2..c634e16 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/BaseSensorSemiAutomatedTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/BaseSensorSemiAutomatedTestActivity.java
@@ -117,6 +117,15 @@
         this.runOnUiThread(new TextAppender(mLogView, text));
     }
 
+    protected void clearText() {
+        this.runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                mLogView.setText("");
+            }
+        });
+    }
+
     protected void updateButton(boolean enabled) {
         this.runOnUiThread(new ButtonEnabler(this.mNextView, enabled));
     }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagneticFieldMeasurementTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagneticFieldMeasurementTestActivity.java
index e3d2f68..713710d 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagneticFieldMeasurementTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagneticFieldMeasurementTestActivity.java
@@ -16,8 +16,11 @@
 
 package com.android.cts.verifier.sensors;
 
+import android.graphics.Color;
 import android.hardware.Sensor;
+import android.hardware.SensorEvent;
 import android.hardware.SensorManager;
+import android.hardware.cts.helpers.SensorManagerTestVerifier;
 import android.hardware.cts.helpers.sensorTestOperations.VerifyNormOperation;
 import android.hardware.cts.helpers.sensorTestOperations.VerifyStandardDeviationOperation;
 
@@ -30,10 +33,7 @@
 public class MagneticFieldMeasurementTestActivity extends BaseSensorSemiAutomatedTestActivity {
     @Override
     protected void onRun() throws Throwable {
-        appendText("Please calibrate the Magnetometer by moving it in 8 shapes in different " +
-                "orientations.");
-        appendText("Then leave the device in a flat surface and press Next...\n");
-        waitForUser();
+        calibrateMagnetometer();
 
         appendText("Verifying the Norm...");
         verifyNorm();
@@ -42,6 +42,30 @@
         verifyStandardDeviation();
     }
 
+    private void calibrateMagnetometer() {
+        SensorManagerTestVerifier magnetometer = new SensorManagerTestVerifier(
+                this.getApplicationContext(),
+                Sensor.TYPE_MAGNETIC_FIELD,
+                SensorManager.SENSOR_DELAY_NORMAL,
+                0 /*reportLatencyInUs*/) {
+            @Override
+            public void onSensorChanged(SensorEvent event) {
+                float values[] = event.values;
+                clearText();
+                appendText(
+                        "Please calibrate the Magnetometer by moving it in 8 shapes in different " +
+                                "orientations.");
+                appendText(
+                        String.format("->  (%.2f, %.2f, %.2f) uT", values[0], values[1], values[2]),
+                        Color.GRAY);
+                appendText("Then leave the device in a flat surface and press Next...\n");
+            }
+        };
+        magnetometer.registerListener();
+        waitForUser();
+        magnetometer.unregisterListener();
+    }
+
     /**
      * This test verifies that the Norm of the sensor data is close to the expected reference value.
      * The units of the reference value are dependent on the type of sensor.
diff --git a/build/test_package.mk b/build/test_package.mk
index 46718a8..73f2a13 100644
--- a/build/test_package.mk
+++ b/build/test_package.mk
@@ -36,11 +36,11 @@
 $(cts_package_xml): PRIVATE_PATH := $(LOCAL_PATH)
 $(cts_package_xml): PRIVATE_INSTRUMENTATION := $(LOCAL_INSTRUMENTATION_FOR)
 $(cts_package_xml): PRIVATE_PACKAGE := $(LOCAL_PACKAGE_NAME)
-ifneq ($(filter cts/suite/pts/%, $(LOCAL_PATH)),) # PTS
-PRIVATE_CTS_TEST_PACKAGE_NANE_ := com.android.pts.$(notdir $(LOCAL_PATH))
+ifneq ($(filter cts/suite/cts/%, $(LOCAL_PATH)),) # CTS
+PRIVATE_CTS_TEST_PACKAGE_NANE_ := com.android.cts.$(notdir $(LOCAL_PATH))
 else # CTS
 PRIVATE_CTS_TEST_PACKAGE_NANE_ := android.$(notdir $(LOCAL_PATH))
-endif # PTS
+endif # CTS
 $(cts_package_xml): PRIVATE_TEST_PACKAGE := $(PRIVATE_CTS_TEST_PACKAGE_NANE_)
 $(cts_package_xml): PRIVATE_MANIFEST := $(LOCAL_PATH)/AndroidManifest.xml
 $(cts_package_xml): PRIVATE_TEST_TYPE := $(if $(LOCAL_CTS_TEST_RUNNER),$(LOCAL_CTS_TEST_RUNNER),'')
diff --git a/suite/pts/lib/commonutil/Android.mk b/libs/commonutil/Android.mk
similarity index 78%
rename from suite/pts/lib/commonutil/Android.mk
rename to libs/commonutil/Android.mk
index 73df09b..bf6985f 100644
--- a/suite/pts/lib/commonutil/Android.mk
+++ b/libs/commonutil/Android.mk
@@ -20,7 +20,7 @@
 
 LOCAL_MODULE_TAGS := optional
 
-LOCAL_MODULE := ptscommonutil
+LOCAL_MODULE := ctscommonutil
 
 include $(BUILD_STATIC_JAVA_LIBRARY)
 
@@ -28,15 +28,12 @@
 
 include $(CLEAR_VARS)
 
-# only TimeoutReq annotation used from the libs/util, so add it here
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-    ../../../../libs/util/src/android/cts/util/TimeoutReq.java
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_MODULE_TAGS := optional
 
 LOCAL_JAVA_LIBRARIES := junit
 
-LOCAL_MODULE := ptscommonutilhost
+LOCAL_MODULE := ctscommonutilhost
 
 include $(BUILD_HOST_JAVA_LIBRARY)
\ No newline at end of file
diff --git a/suite/pts/lib/commonutil/src/com/android/pts/util/PtsException.java b/libs/commonutil/src/com/android/cts/util/CtsException.java
similarity index 80%
rename from suite/pts/lib/commonutil/src/com/android/pts/util/PtsException.java
rename to libs/commonutil/src/com/android/cts/util/CtsException.java
index e8ec5be..7e79590 100644
--- a/suite/pts/lib/commonutil/src/com/android/pts/util/PtsException.java
+++ b/libs/commonutil/src/com/android/cts/util/CtsException.java
@@ -14,15 +14,15 @@
  * limitations under the License.
  */
 
-package com.android.pts.util;
+package com.android.cts.util;
 
 /**
- * Exception throw by PTS test to pass the result to host
+ * Exception throw by CTS test to pass the result to host
  * This should not be thrown by test app unless the result is complete.
  */
 @SuppressWarnings("serial")
-public class PtsException extends Exception {
-    public PtsException(String message) {
+public class CtsException extends Exception {
+    public CtsException(String message) {
         super(message);
     }
 }
diff --git a/suite/pts/lib/commonutil/src/com/android/pts/util/MeasureRun.java b/libs/commonutil/src/com/android/cts/util/MeasureRun.java
similarity index 96%
rename from suite/pts/lib/commonutil/src/com/android/pts/util/MeasureRun.java
rename to libs/commonutil/src/com/android/cts/util/MeasureRun.java
index 3add474..43b5acf 100644
--- a/suite/pts/lib/commonutil/src/com/android/pts/util/MeasureRun.java
+++ b/libs/commonutil/src/com/android/cts/util/MeasureRun.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.util;
+package com.android.cts.util;
 
 /**
  * interface for measuring time for each run.
diff --git a/suite/pts/lib/commonutil/src/com/android/pts/util/MeasureTime.java b/libs/commonutil/src/com/android/cts/util/MeasureTime.java
similarity index 97%
rename from suite/pts/lib/commonutil/src/com/android/pts/util/MeasureTime.java
rename to libs/commonutil/src/com/android/cts/util/MeasureTime.java
index 595e6a5..c158228 100644
--- a/suite/pts/lib/commonutil/src/com/android/pts/util/MeasureTime.java
+++ b/libs/commonutil/src/com/android/cts/util/MeasureTime.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.util;
+package com.android.cts.util;
 
 
 public class MeasureTime {
diff --git a/suite/pts/lib/commonutil/src/com/android/pts/util/ReportLog.java b/libs/commonutil/src/com/android/cts/util/ReportLog.java
similarity index 99%
rename from suite/pts/lib/commonutil/src/com/android/pts/util/ReportLog.java
rename to libs/commonutil/src/com/android/cts/util/ReportLog.java
index 63f5589..115cec6 100644
--- a/suite/pts/lib/commonutil/src/com/android/pts/util/ReportLog.java
+++ b/libs/commonutil/src/com/android/cts/util/ReportLog.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.util;
+package com.android.cts.util;
 
 import java.util.LinkedList;
 import java.util.List;
diff --git a/suite/pts/lib/commonutil/src/com/android/pts/util/ResultType.java b/libs/commonutil/src/com/android/cts/util/ResultType.java
similarity index 97%
rename from suite/pts/lib/commonutil/src/com/android/pts/util/ResultType.java
rename to libs/commonutil/src/com/android/cts/util/ResultType.java
index cdf448b..a5a388c 100644
--- a/suite/pts/lib/commonutil/src/com/android/pts/util/ResultType.java
+++ b/libs/commonutil/src/com/android/cts/util/ResultType.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.util;
+package com.android.cts.util;
 
 /**
  * Enum for distinguishing performance results.
diff --git a/suite/pts/lib/commonutil/src/com/android/pts/util/ResultUnit.java b/libs/commonutil/src/com/android/cts/util/ResultUnit.java
similarity index 97%
rename from suite/pts/lib/commonutil/src/com/android/pts/util/ResultUnit.java
rename to libs/commonutil/src/com/android/cts/util/ResultUnit.java
index b234cb5..a216a7e 100644
--- a/suite/pts/lib/commonutil/src/com/android/pts/util/ResultUnit.java
+++ b/libs/commonutil/src/com/android/cts/util/ResultUnit.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.util;
+package com.android.cts.util;
 
 /**
  * Enum for representing the unit of performance results.
diff --git a/suite/pts/lib/commonutil/src/com/android/pts/util/Stat.java b/libs/commonutil/src/com/android/cts/util/Stat.java
similarity index 98%
rename from suite/pts/lib/commonutil/src/com/android/pts/util/Stat.java
rename to libs/commonutil/src/com/android/cts/util/Stat.java
index 5560292..ceafa4e 100644
--- a/suite/pts/lib/commonutil/src/com/android/pts/util/Stat.java
+++ b/libs/commonutil/src/com/android/cts/util/Stat.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.util;
+package com.android.cts.util;
 
 import java.util.Arrays;
 
diff --git a/libs/util/src/android/cts/util/TimeoutReq.java b/libs/commonutil/src/com/android/cts/util/TimeoutReq.java
similarity index 100%
rename from libs/util/src/android/cts/util/TimeoutReq.java
rename to libs/commonutil/src/com/android/cts/util/TimeoutReq.java
diff --git a/libs/util/Android.mk b/libs/deviceutil/Android.mk
similarity index 86%
copy from libs/util/Android.mk
copy to libs/deviceutil/Android.mk
index b3e128c..8b81247 100644
--- a/libs/util/Android.mk
+++ b/libs/deviceutil/Android.mk
@@ -18,8 +18,12 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
+LOCAL_STATIC_JAVA_LIBRARIES := ctscommonutil
+
+LOCAL_JAVA_LIBRARIES := android.test.runner
+
 LOCAL_MODULE_TAGS := optional
 
-LOCAL_MODULE := ctsutil
+LOCAL_MODULE := ctsdeviceutil
 
 include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/libs/util/src/android/app/cts/CTSResult.java b/libs/deviceutil/src/android/app/cts/CTSResult.java
similarity index 100%
rename from libs/util/src/android/app/cts/CTSResult.java
rename to libs/deviceutil/src/android/app/cts/CTSResult.java
diff --git a/suite/pts/deviceTests/ptsutil/src/com/android/pts/util/PtsActivityInstrumentationTestCase2.java b/libs/deviceutil/src/android/cts/util/CtsActivityInstrumentationTestCase2.java
similarity index 84%
rename from suite/pts/deviceTests/ptsutil/src/com/android/pts/util/PtsActivityInstrumentationTestCase2.java
rename to libs/deviceutil/src/android/cts/util/CtsActivityInstrumentationTestCase2.java
index a14be01..e039407 100644
--- a/suite/pts/deviceTests/ptsutil/src/com/android/pts/util/PtsActivityInstrumentationTestCase2.java
+++ b/libs/deviceutil/src/android/cts/util/CtsActivityInstrumentationTestCase2.java
@@ -15,18 +15,20 @@
  */
 
 
-package com.android.pts.util;
+package android.cts.util;
+
+import com.android.cts.util.ReportLog;
 
 import android.app.Activity;
 import android.test.ActivityInstrumentationTestCase2;
 
 
-public class PtsActivityInstrumentationTestCase2<T extends Activity> extends
+public class CtsActivityInstrumentationTestCase2<T extends Activity> extends
         ActivityInstrumentationTestCase2<T> {
 
     private DeviceReportLog mReportLog = new DeviceReportLog();
 
-    public PtsActivityInstrumentationTestCase2(Class<T> activityClass) {
+    public CtsActivityInstrumentationTestCase2(Class<T> activityClass) {
         super(activityClass);
     }
 
diff --git a/suite/pts/deviceTests/ptsutil/src/com/android/pts/util/PtsAndroidTestCase.java b/libs/deviceutil/src/android/cts/util/CtsAndroidTestCase.java
similarity index 85%
rename from suite/pts/deviceTests/ptsutil/src/com/android/pts/util/PtsAndroidTestCase.java
rename to libs/deviceutil/src/android/cts/util/CtsAndroidTestCase.java
index 6da7bdc..b1164bc 100644
--- a/suite/pts/deviceTests/ptsutil/src/com/android/pts/util/PtsAndroidTestCase.java
+++ b/libs/deviceutil/src/android/cts/util/CtsAndroidTestCase.java
@@ -15,18 +15,17 @@
  */
 
 
-package com.android.pts.util;
+package android.cts.util;
 
 import android.content.Context;
-import android.test.AndroidTestCase;
 
 /**
  *  This class emulates AndroidTestCase, but internally it is ActivityInstrumentationTestCase2
  *  to access Instrumentation.
  *  DummyActivity is not supposed to be accessed.
  */
-public class PtsAndroidTestCase extends PtsActivityInstrumentationTestCase2<DummyActivity> {
-    public PtsAndroidTestCase() {
+public class CtsAndroidTestCase extends CtsActivityInstrumentationTestCase2<DummyActivity> {
+    public CtsAndroidTestCase() {
         super(DummyActivity.class);
     }
 
diff --git a/suite/pts/deviceTests/ptsutil/src/com/android/pts/util/DeviceReportLog.java b/libs/deviceutil/src/android/cts/util/DeviceReportLog.java
similarity index 84%
rename from suite/pts/deviceTests/ptsutil/src/com/android/pts/util/DeviceReportLog.java
rename to libs/deviceutil/src/android/cts/util/DeviceReportLog.java
index 80f3850..b707fc8 100644
--- a/suite/pts/deviceTests/ptsutil/src/com/android/pts/util/DeviceReportLog.java
+++ b/libs/deviceutil/src/android/cts/util/DeviceReportLog.java
@@ -14,17 +14,17 @@
  * limitations under the License.
  */
 
-package com.android.pts.util;
+package android.cts.util;
+
+import com.android.cts.util.ReportLog;
 
 import android.app.Instrumentation;
 import android.os.Bundle;
 import android.util.Log;
 
-import java.lang.Exception;
-
 public class DeviceReportLog extends ReportLog {
-    private static final String TAG = "DevicePtsReport";
-    private static final String PTS_RESULT = "PTS_RESULT";
+    private static final String TAG = "DeviceCtsReport";
+    private static final String CTS_RESULT = "CTS_RESULT";
     private static final int INST_STATUS_IN_PROGRESS = 2;
 
     DeviceReportLog() {
@@ -41,7 +41,7 @@
         String report = generateReport();
         if (!report.equals("")) {
             Bundle output = new Bundle();
-            output.putString(PTS_RESULT, report);
+            output.putString(CTS_RESULT, report);
             instrumentation.sendStatus(INST_STATUS_IN_PROGRESS, output);
         }
     }
diff --git a/suite/pts/deviceTests/ptsutil/src/com/android/pts/util/DummyActivity.java b/libs/deviceutil/src/android/cts/util/DummyActivity.java
similarity index 95%
rename from suite/pts/deviceTests/ptsutil/src/com/android/pts/util/DummyActivity.java
rename to libs/deviceutil/src/android/cts/util/DummyActivity.java
index c3ceb9f..16e3507 100644
--- a/suite/pts/deviceTests/ptsutil/src/com/android/pts/util/DummyActivity.java
+++ b/libs/deviceutil/src/android/cts/util/DummyActivity.java
@@ -15,7 +15,7 @@
  */
 
 
-package com.android.pts.util;
+package android.cts.util;
 
 import android.app.Activity;
 
diff --git a/libs/deviceutil/src/android/cts/util/EvaluateJsResultPollingCheck.java b/libs/deviceutil/src/android/cts/util/EvaluateJsResultPollingCheck.java
new file mode 100644
index 0000000..17d6a73
--- /dev/null
+++ b/libs/deviceutil/src/android/cts/util/EvaluateJsResultPollingCheck.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.cts.util;
+
+import android.webkit.ValueCallback;
+
+public class EvaluateJsResultPollingCheck  extends PollingCheck
+        implements ValueCallback<String> {
+    private String mActualResult;
+    private String mExpectedResult;
+
+    public EvaluateJsResultPollingCheck(String expected) {
+        mExpectedResult = expected;
+    }
+
+    @Override
+    public synchronized boolean check() {
+        return mExpectedResult.equals(mActualResult);
+    }
+
+    @Override
+    public synchronized void onReceiveValue(String result) {
+        mActualResult = result;
+    }
+}
\ No newline at end of file
diff --git a/libs/util/src/android/cts/util/PollingCheck.java b/libs/deviceutil/src/android/cts/util/PollingCheck.java
similarity index 100%
rename from libs/util/src/android/cts/util/PollingCheck.java
rename to libs/deviceutil/src/android/cts/util/PollingCheck.java
diff --git a/suite/pts/deviceTests/ptsutil/src/com/android/pts/util/SystemUtil.java b/libs/deviceutil/src/android/cts/util/SystemUtil.java
similarity index 97%
rename from suite/pts/deviceTests/ptsutil/src/com/android/pts/util/SystemUtil.java
rename to libs/deviceutil/src/android/cts/util/SystemUtil.java
index 7975463..e6222cb 100644
--- a/suite/pts/deviceTests/ptsutil/src/com/android/pts/util/SystemUtil.java
+++ b/libs/deviceutil/src/android/cts/util/SystemUtil.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.util;
+package android.cts.util;
 
 import android.app.ActivityManager;
 import android.app.ActivityManager.MemoryInfo;
diff --git a/libs/util/src/android/cts/util/WatchDog.java b/libs/deviceutil/src/android/cts/util/WatchDog.java
similarity index 100%
rename from libs/util/src/android/cts/util/WatchDog.java
rename to libs/deviceutil/src/android/cts/util/WatchDog.java
diff --git a/libs/util/src/android/provider/cts/FileCopyHelper.java b/libs/deviceutil/src/android/provider/cts/FileCopyHelper.java
similarity index 100%
rename from libs/util/src/android/provider/cts/FileCopyHelper.java
rename to libs/deviceutil/src/android/provider/cts/FileCopyHelper.java
diff --git a/libs/util/Android.mk b/libs/hostutil/Android.mk
similarity index 87%
rename from libs/util/Android.mk
rename to libs/hostutil/Android.mk
index b3e128c..44a4a30 100644
--- a/libs/util/Android.mk
+++ b/libs/hostutil/Android.mk
@@ -18,8 +18,10 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
+LOCAL_JAVA_LIBRARIES := ctscommonutilhost
+
 LOCAL_MODULE_TAGS := optional
 
-LOCAL_MODULE := ctsutil
+LOCAL_MODULE := ctshostutil
 
-include $(BUILD_STATIC_JAVA_LIBRARY)
+include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/result/PtsHostStore.java b/libs/hostutil/src/com/android/cts/util/CtsHostStore.java
similarity index 67%
rename from tools/tradefed-host/src/com/android/cts/tradefed/result/PtsHostStore.java
rename to libs/hostutil/src/com/android/cts/util/CtsHostStore.java
index 5944c66..e943133 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/result/PtsHostStore.java
+++ b/libs/hostutil/src/com/android/cts/util/CtsHostStore.java
@@ -13,18 +13,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.cts.tradefed.result;
-
-import com.android.ddmlib.testrunner.TestIdentifier;
-import com.android.tradefed.device.ITestDevice;
+package com.android.cts.util;
 
 import java.util.concurrent.ConcurrentHashMap;
 
 /**
- * Utility class for storing Pts Results.
+ * Utility class for storing Cts Results.
  * This is necessary for host tests where test metrics cannot be passed.
  */
-public class PtsHostStore {
+public class CtsHostStore {
 
     // needs concurrent verion as there can be multiple client accessing this.
     // But there is no additional protection for the same key as that should not happen.
@@ -32,31 +29,23 @@
             new ConcurrentHashMap<String, String>();
 
     /**
-     * Stores PTS result. Existing result with the same key will be replaced.
+     * Stores CTS result. Existing result with the same key will be replaced.
      * Note that key is generated in the form of device_serial#class#method name.
      * So there should be no concurrent test for the same (serial, class, method).
      * @param device
      * @param test
-     * @param result PTS result string
+     * @param result CTS result string
      */
-    public static void storePtsResult(String deviceSerial, String classMethodName, String result) {
+    public static void storeCtsResult(String deviceSerial, String classMethodName, String result) {
         mMap.put(generateTestKey(deviceSerial, classMethodName), result);
     }
 
     /**
-     * retrieves a PTS result for the given condition and remove it from the internal
+     * retrieves a CTS result for the given condition and remove it from the internal
      * storage. If there is no result for the given condition, it will return null.
      */
-    public static String removePtsResult(String deviceSerial, TestIdentifier test) {
-        return mMap.remove(generateTestKey(deviceSerial, test));
-    }
-
-    /**
-     * return test key in the form of device_serial#class_name#method_name
-     */
-    private static String generateTestKey(String deviceSerial, TestIdentifier test) {
-        return String.format("%s#%s", deviceSerial, test.toString());
-
+    public static String removeCtsResult(String deviceSerial, String classMethodName) {
+        return mMap.remove(generateTestKey(deviceSerial, classMethodName));
     }
 
     /**
diff --git a/suite/pts/hostTests/ptshostutil/src/com/android/pts/util/HostReportLog.java b/libs/hostutil/src/com/android/cts/util/HostReportLog.java
similarity index 89%
rename from suite/pts/hostTests/ptshostutil/src/com/android/pts/util/HostReportLog.java
rename to libs/hostutil/src/com/android/cts/util/HostReportLog.java
index 49f24fe..72bcc4c 100644
--- a/suite/pts/hostTests/ptshostutil/src/com/android/pts/util/HostReportLog.java
+++ b/libs/hostutil/src/com/android/cts/util/HostReportLog.java
@@ -14,10 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.util;
-
-import com.android.cts.tradefed.result.PtsHostStore;
-
+package com.android.cts.util;
 
 /**
  * ReportLog for host tests
@@ -38,6 +35,6 @@
     }
 
     public void deliverReportToHost() {
-        PtsHostStore.storePtsResult(mDeviceSerial, mClassMethodName, generateReport());
+        CtsHostStore.storeCtsResult(mDeviceSerial, mClassMethodName, generateReport());
     }
 }
diff --git a/suite/pts/Android.mk b/suite/cts/Android.mk
similarity index 100%
rename from suite/pts/Android.mk
rename to suite/cts/Android.mk
diff --git a/suite/pts/deviceTests/Android.mk b/suite/cts/deviceTests/Android.mk
similarity index 100%
rename from suite/pts/deviceTests/Android.mk
rename to suite/cts/deviceTests/Android.mk
diff --git a/suite/pts/deviceTests/browserbench/Android.mk b/suite/cts/deviceTests/browserbench/Android.mk
similarity index 88%
rename from suite/pts/deviceTests/browserbench/Android.mk
rename to suite/cts/deviceTests/browserbench/Android.mk
index 1ce0e49..6b241a9 100644
--- a/suite/pts/deviceTests/browserbench/Android.mk
+++ b/suite/cts/deviceTests/browserbench/Android.mk
@@ -20,11 +20,11 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner ctstestserver
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner ctstestserver
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := PtsDeviceBrowserBench
+LOCAL_PACKAGE_NAME := CtsDeviceBrowserBench
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/pts/deviceTests/browserbench/AndroidManifest.xml b/suite/cts/deviceTests/browserbench/AndroidManifest.xml
similarity index 91%
rename from suite/pts/deviceTests/browserbench/AndroidManifest.xml
rename to suite/cts/deviceTests/browserbench/AndroidManifest.xml
index 1950c84..16626ad 100644
--- a/suite/pts/deviceTests/browserbench/AndroidManifest.xml
+++ b/suite/cts/deviceTests/browserbench/AndroidManifest.xml
@@ -15,7 +15,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.pts.browser">
+        package="com.android.cts.browser">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
     <uses-permission android:name="android.permission.INTERNET" />
@@ -25,5 +25,5 @@
         <uses-library android:name="android.test.runner" />
     </application>
     <instrumentation android:name="android.test.InstrumentationCtsTestRunner"
-            android:targetPackage="com.android.pts.browser" />
+            android:targetPackage="com.android.cts.browser" />
 </manifest>
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/base.js b/suite/cts/deviceTests/browserbench/assets/octane/base.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/base.js
rename to suite/cts/deviceTests/browserbench/assets/octane/base.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/box2d.js b/suite/cts/deviceTests/browserbench/assets/octane/box2d.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/box2d.js
rename to suite/cts/deviceTests/browserbench/assets/octane/box2d.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/code-load.js b/suite/cts/deviceTests/browserbench/assets/octane/code-load.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/code-load.js
rename to suite/cts/deviceTests/browserbench/assets/octane/code-load.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/crypto.js b/suite/cts/deviceTests/browserbench/assets/octane/crypto.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/crypto.js
rename to suite/cts/deviceTests/browserbench/assets/octane/crypto.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/css/bootstrap-responsive.css b/suite/cts/deviceTests/browserbench/assets/octane/css/bootstrap-responsive.css
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/css/bootstrap-responsive.css
rename to suite/cts/deviceTests/browserbench/assets/octane/css/bootstrap-responsive.css
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/css/bootstrap.css b/suite/cts/deviceTests/browserbench/assets/octane/css/bootstrap.css
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/css/bootstrap.css
rename to suite/cts/deviceTests/browserbench/assets/octane/css/bootstrap.css
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/css/docs.css b/suite/cts/deviceTests/browserbench/assets/octane/css/docs.css
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/css/docs.css
rename to suite/cts/deviceTests/browserbench/assets/octane/css/docs.css
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/pts_report.html b/suite/cts/deviceTests/browserbench/assets/octane/cts_report.html
similarity index 69%
rename from suite/pts/deviceTests/browserbench/assets/octane/pts_report.html
rename to suite/cts/deviceTests/browserbench/assets/octane/cts_report.html
index 40e2de68..6dc6f42 100644
--- a/suite/pts/deviceTests/browserbench/assets/octane/pts_report.html
+++ b/suite/cts/deviceTests/browserbench/assets/octane/cts_report.html
@@ -1,7 +1,7 @@
 <!doctype html>
 <html>
   <head>
-    <title>pts_report</title>
+    <title>cts_report</title>
   </head>
   <body>
   </body>
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/pts_report.js b/suite/cts/deviceTests/browserbench/assets/octane/cts_report.js
similarity index 88%
rename from suite/pts/deviceTests/browserbench/assets/octane/pts_report.js
rename to suite/cts/deviceTests/browserbench/assets/octane/cts_report.js
index fb320ae..ca15479 100644
--- a/suite/pts/deviceTests/browserbench/assets/octane/pts_report.js
+++ b/suite/cts/deviceTests/browserbench/assets/octane/cts_report.js
@@ -16,15 +16,15 @@
 
 /**
  *  Utility to report benchmarking result via HTTP POST
- *  to PTS.
+ *  to CTS.
  * @param msg message to add to the report
  * @param score resulting score
  * @param isFinal true if this is the last / final score
  */
-function PtsReport(msg, score, isFinal)
+function CtsReport(msg, score, isFinal)
 {
     req = new XMLHttpRequest();
-    req.open("POST", "pts_report.html?final=" + (isFinal ? "1" : "0") +
+    req.open("POST", "cts_report.html?final=" + (isFinal ? "1" : "0") +
              "&score=" + score + "&message=" + msg, false);
     req.send(null)
 }
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/deltablue.js b/suite/cts/deviceTests/browserbench/assets/octane/deltablue.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/deltablue.js
rename to suite/cts/deviceTests/browserbench/assets/octane/deltablue.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/earley-boyer.js b/suite/cts/deviceTests/browserbench/assets/octane/earley-boyer.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/earley-boyer.js
rename to suite/cts/deviceTests/browserbench/assets/octane/earley-boyer.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/gbemu.js b/suite/cts/deviceTests/browserbench/assets/octane/gbemu.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/gbemu.js
rename to suite/cts/deviceTests/browserbench/assets/octane/gbemu.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-114-precomposed.png b/suite/cts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-114-precomposed.png
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-114-precomposed.png
rename to suite/cts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-114-precomposed.png
Binary files differ
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-144-precomposed.png b/suite/cts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-144-precomposed.png
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-144-precomposed.png
rename to suite/cts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-144-precomposed.png
Binary files differ
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-57-precomposed.png b/suite/cts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-57-precomposed.png
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-57-precomposed.png
rename to suite/cts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-57-precomposed.png
Binary files differ
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-72-precomposed.png b/suite/cts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-72-precomposed.png
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-72-precomposed.png
rename to suite/cts/deviceTests/browserbench/assets/octane/ico/apple-touch-icon-72-precomposed.png
Binary files differ
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/ico/favicon.ico b/suite/cts/deviceTests/browserbench/assets/octane/ico/favicon.ico
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/ico/favicon.ico
rename to suite/cts/deviceTests/browserbench/assets/octane/ico/favicon.ico
Binary files differ
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/index.html b/suite/cts/deviceTests/browserbench/assets/octane/index.html
similarity index 98%
rename from suite/pts/deviceTests/browserbench/assets/octane/index.html
rename to suite/cts/deviceTests/browserbench/assets/octane/index.html
index 9c072d6..228d1a9 100644
--- a/suite/pts/deviceTests/browserbench/assets/octane/index.html
+++ b/suite/cts/deviceTests/browserbench/assets/octane/index.html
@@ -15,8 +15,8 @@
 <script src="js/bootstrap-transition.js"></script>
 <script src="js/bootstrap-collapse.js"></script>
 <!-- Octane benchmark code -->
-<!-- PTS -->
-<script type="text/javascript" src="pts_report.js"></script>
+<!-- CTS -->
+<script type="text/javascript" src="cts_report.js"></script>
 <script type="text/javascript" src="base.js"></script>
 <script type="text/javascript" src="richards.js"></script>
 <script type="text/javascript" src="deltablue.js"></script>
@@ -45,8 +45,8 @@
   }
 
   function AddResult(name, result) {
-    //PTS
-    PtsReport(name, result, false);
+    //CTS
+    CtsReport(name, result, false);
     var box = document.getElementById("Result-" + name);
     box.innerHTML = result;
   }
@@ -68,8 +68,8 @@
     } else {
       status.innerHTML = "Octane Score (incomplete): " + score;
     }
-    //PTS
-    PtsReport("Octane Score" + (success ? " " : "(incomplete)"), score, true);
+    //CTS
+    CtsReport("Octane Score" + (success ? " " : "(incomplete)"), score, true);
     document.getElementById("progress-bar-container").style.visibility = 'hidden';
     document.getElementById("bottom-text").style.visibility = 'visible';
     document.getElementById("inside-anchor").removeChild(document.getElementById("bar-appendix"));
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/js/bootstrap-collapse.js b/suite/cts/deviceTests/browserbench/assets/octane/js/bootstrap-collapse.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/js/bootstrap-collapse.js
rename to suite/cts/deviceTests/browserbench/assets/octane/js/bootstrap-collapse.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/js/bootstrap-transition.js b/suite/cts/deviceTests/browserbench/assets/octane/js/bootstrap-transition.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/js/bootstrap-transition.js
rename to suite/cts/deviceTests/browserbench/assets/octane/js/bootstrap-transition.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/js/jquery.js b/suite/cts/deviceTests/browserbench/assets/octane/js/jquery.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/js/jquery.js
rename to suite/cts/deviceTests/browserbench/assets/octane/js/jquery.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/mandreel.js b/suite/cts/deviceTests/browserbench/assets/octane/mandreel.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/mandreel.js
rename to suite/cts/deviceTests/browserbench/assets/octane/mandreel.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/navier-stokes.js b/suite/cts/deviceTests/browserbench/assets/octane/navier-stokes.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/navier-stokes.js
rename to suite/cts/deviceTests/browserbench/assets/octane/navier-stokes.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/pdfjs.js b/suite/cts/deviceTests/browserbench/assets/octane/pdfjs.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/pdfjs.js
rename to suite/cts/deviceTests/browserbench/assets/octane/pdfjs.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/raytrace.js b/suite/cts/deviceTests/browserbench/assets/octane/raytrace.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/raytrace.js
rename to suite/cts/deviceTests/browserbench/assets/octane/raytrace.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/regexp.js b/suite/cts/deviceTests/browserbench/assets/octane/regexp.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/regexp.js
rename to suite/cts/deviceTests/browserbench/assets/octane/regexp.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/richards.js b/suite/cts/deviceTests/browserbench/assets/octane/richards.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/richards.js
rename to suite/cts/deviceTests/browserbench/assets/octane/richards.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/run.js b/suite/cts/deviceTests/browserbench/assets/octane/run.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/run.js
rename to suite/cts/deviceTests/browserbench/assets/octane/run.js
diff --git a/suite/pts/deviceTests/browserbench/assets/octane/splay.js b/suite/cts/deviceTests/browserbench/assets/octane/splay.js
similarity index 100%
rename from suite/pts/deviceTests/browserbench/assets/octane/splay.js
rename to suite/cts/deviceTests/browserbench/assets/octane/splay.js
diff --git a/suite/pts/deviceTests/browserbench/src/com/android/pts/browser/BrowserBenchTest.java b/suite/cts/deviceTests/browserbench/src/com/android/cts/browser/BrowserBenchTest.java
similarity index 92%
rename from suite/pts/deviceTests/browserbench/src/com/android/pts/browser/BrowserBenchTest.java
rename to suite/cts/deviceTests/browserbench/src/com/android/cts/browser/BrowserBenchTest.java
index 07f7763..b2f2309 100644
--- a/suite/pts/deviceTests/browserbench/src/com/android/pts/browser/BrowserBenchTest.java
+++ b/suite/cts/deviceTests/browserbench/src/com/android/cts/browser/BrowserBenchTest.java
@@ -14,11 +14,9 @@
  * limitations under the License.
  */
 
-package com.android.pts.browser;
+package com.android.cts.browser;
 
-import android.content.Context;
 import android.content.Intent;
-import android.content.IntentFilter;
 import android.cts.util.TimeoutReq;
 import android.cts.util.WatchDog;
 import android.net.Uri;
@@ -26,16 +24,15 @@
 import android.util.Log;
 import android.webkit.cts.CtsTestServer;
 
-import com.android.pts.util.PtsAndroidTestCase;
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
-import com.android.pts.util.Stat;
+import android.cts.util.CtsAndroidTestCase;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
+import com.android.cts.util.Stat;
 
 import java.net.URLDecoder;
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -47,12 +44,12 @@
  * Browser benchmarking.
  * It launches an activity with URL and wait for POST from the client.
  */
-public class BrowserBenchTest extends PtsAndroidTestCase {
-    private static final String TAG = "BrowserBench";
+public class BrowserBenchTest extends CtsAndroidTestCase {
+    private static final String TAG = BrowserBenchTest.class.getSimpleName();
     private static final boolean DEBUG = false;
     private static final String OCTANE_START_FILE = "octane/index.html";
     private static final String ROBOHORNET_START_FILE = "robohornet/robohornet.html";
-    private static final String HOST_COMPLETION_BROADCAST = "com.android.pts.browser.completion";
+    private static final String HOST_COMPLETION_BROADCAST = "com.android.cts.browser.completion";
     // time-out for watch-dog. POST should happen within this time.
     private static long BROWSER_POST_TIMEOUT_IN_MS = 10 * 60 * 1000L;
     // watch-dog will time-out first. So make it long enough.
@@ -80,14 +77,14 @@
         mWebServer = new CtsTestServer(getContext()) {
             @Override
             protected HttpResponse onPost(HttpRequest request) throws Exception {
-                // post uri will look like "pts_report.html?final=1&score=10.1&message=hello"
+                // post uri will look like "cts_report.html?final=1&score=10.1&message=hello"
                 RequestLine requestLine = request.getRequestLine();
                 String uriString = URLDecoder.decode(requestLine.getUri(), "UTF-8");
                 if (DEBUG) {
                     Log.i(TAG, "uri:" + uriString);
                 }
                 String resultRe =
-                        ".*pts_report.html\\?final=([\\d])&score=([\\d]+\\.?[\\d]*)&message=([\\w][\\w ]*)";
+                        ".*cts_report.html\\?final=([\\d])&score=([\\d]+\\.?[\\d]*)&message=([\\w][\\w ]*)";
                 Pattern resultPattern = Pattern.compile(resultRe);
                 Matcher matchResult = resultPattern.matcher(uriString);
                 if (matchResult.find()) {
diff --git a/suite/pts/deviceTests/browserbench/Android.mk b/suite/cts/deviceTests/dram/Android.mk
similarity index 86%
copy from suite/pts/deviceTests/browserbench/Android.mk
copy to suite/cts/deviceTests/dram/Android.mk
index 1ce0e49..1935483 100644
--- a/suite/pts/deviceTests/browserbench/Android.mk
+++ b/suite/cts/deviceTests/dram/Android.mk
@@ -20,11 +20,13 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner ctstestserver
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
+
+LOCAL_JNI_SHARED_LIBRARIES := libctsdram_jni
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := PtsDeviceBrowserBench
+LOCAL_PACKAGE_NAME := CtsDeviceDram
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/pts/deviceTests/dram/AndroidManifest.xml b/suite/cts/deviceTests/dram/AndroidManifest.xml
similarity index 91%
rename from suite/pts/deviceTests/dram/AndroidManifest.xml
rename to suite/cts/deviceTests/dram/AndroidManifest.xml
index b3ee2f0..70f6b11 100644
--- a/suite/pts/deviceTests/dram/AndroidManifest.xml
+++ b/suite/cts/deviceTests/dram/AndroidManifest.xml
@@ -15,7 +15,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.pts.dram">
+        package="com.android.cts.dram">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -24,6 +24,6 @@
         <uses-library android:name="android.test.runner" />
     </application>
     <instrumentation android:name="android.test.InstrumentationCtsTestRunner"
-            android:targetPackage="com.android.pts.dram"
+            android:targetPackage="com.android.cts.dram"
             android:label="DRAM bandwidth measurement" />
 </manifest>
diff --git a/suite/pts/deviceTests/dram/jni/Android.mk b/suite/cts/deviceTests/dram/jni/Android.mk
similarity index 95%
rename from suite/pts/deviceTests/dram/jni/Android.mk
rename to suite/cts/deviceTests/dram/jni/Android.mk
index a3dc698..a86d4da 100644
--- a/suite/pts/deviceTests/dram/jni/Android.mk
+++ b/suite/cts/deviceTests/dram/jni/Android.mk
@@ -16,7 +16,7 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_MODULE    := libptsdram_jni
+LOCAL_MODULE    := libctsdram_jni
 
 LOCAL_MODULE_TAGS := optional
 
diff --git a/suite/pts/deviceTests/dram/jni/MemoryNativeJni.cpp b/suite/cts/deviceTests/dram/jni/MemoryNativeJni.cpp
similarity index 94%
rename from suite/pts/deviceTests/dram/jni/MemoryNativeJni.cpp
rename to suite/cts/deviceTests/dram/jni/MemoryNativeJni.cpp
index a54ab71..7d9a5fc 100644
--- a/suite/pts/deviceTests/dram/jni/MemoryNativeJni.cpp
+++ b/suite/cts/deviceTests/dram/jni/MemoryNativeJni.cpp
@@ -26,7 +26,7 @@
     return tv.tv_sec * 1000.0 + tv.tv_usec / 1000.0;
 }
 
-extern "C" JNIEXPORT jdouble JNICALL Java_com_android_pts_dram_MemoryNative_runMemcpy(JNIEnv* env,
+extern "C" JNIEXPORT jdouble JNICALL Java_com_android_cts_dram_MemoryNative_runMemcpy(JNIEnv* env,
         jclass clazz, jint bufferSize, jint repetition)
 {
     char* src = new char[bufferSize];
@@ -50,7 +50,7 @@
     return end - start;
 }
 
-extern "C" JNIEXPORT jdouble JNICALL Java_com_android_pts_dram_MemoryNative_runMemset(JNIEnv* env,
+extern "C" JNIEXPORT jdouble JNICALL Java_com_android_cts_dram_MemoryNative_runMemset(JNIEnv* env,
         jclass clazz, jint bufferSize, jint repetition, jint c)
 {
     char* dst = new char[bufferSize];
diff --git a/suite/pts/deviceTests/dram/src/com/android/pts/dram/BandwidthTest.java b/suite/cts/deviceTests/dram/src/com/android/cts/dram/BandwidthTest.java
similarity index 94%
rename from suite/pts/deviceTests/dram/src/com/android/pts/dram/BandwidthTest.java
rename to suite/cts/deviceTests/dram/src/com/android/cts/dram/BandwidthTest.java
index 62b0163..eeb7f9b 100644
--- a/suite/pts/deviceTests/dram/src/com/android/pts/dram/BandwidthTest.java
+++ b/suite/cts/deviceTests/dram/src/com/android/cts/dram/BandwidthTest.java
@@ -14,18 +14,18 @@
  * limitations under the License.
  */
 
-package com.android.pts.dram;
+package com.android.cts.dram;
 
 import android.content.Context;
 import android.graphics.Point;
 import android.util.Log;
 import android.view.WindowManager;
 
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
-import com.android.pts.util.PtsAndroidTestCase;
-import com.android.pts.util.ReportLog;
-import com.android.pts.util.Stat;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
+import android.cts.util.CtsAndroidTestCase;
+import com.android.cts.util.ReportLog;
+import com.android.cts.util.Stat;
 
 /**
  * check how many screens the memcpy function can copy in a sec.
@@ -33,8 +33,8 @@
  * as typically CPU cannot use the whole bandwidth.
  * Smaller buffers can fit into L1 or L2 cache, which can show big boost.
  */
-public class BandwidthTest extends PtsAndroidTestCase {
-    private static final String TAG = "BandwidthTest";
+public class BandwidthTest extends CtsAndroidTestCase {
+    private static final String TAG = BandwidthTest.class.getSimpleName();
     private static final int MEMCPY_REPETITION = 10;
     private static final int MEMSET_REPETITION = 30;
     private static final int REPEAT_IN_EACH_CALL = 100;
diff --git a/suite/pts/deviceTests/dram/src/com/android/pts/dram/MemoryNative.java b/suite/cts/deviceTests/dram/src/com/android/cts/dram/MemoryNative.java
similarity index 94%
rename from suite/pts/deviceTests/dram/src/com/android/pts/dram/MemoryNative.java
rename to suite/cts/deviceTests/dram/src/com/android/cts/dram/MemoryNative.java
index 71b60a0..e55127d 100644
--- a/suite/pts/deviceTests/dram/src/com/android/pts/dram/MemoryNative.java
+++ b/suite/cts/deviceTests/dram/src/com/android/cts/dram/MemoryNative.java
@@ -14,11 +14,11 @@
  * limitations under the License.
  */
 
-package com.android.pts.dram;
+package com.android.cts.dram;
 
 public class MemoryNative {
     static {
-        System.loadLibrary("ptsdram_jni");
+        System.loadLibrary("ctsdram_jni");
     }
     /**
      * run memcpy for given number of repetition from a source to a destination buffers
diff --git a/suite/pts/deviceTests/filesystemperf/Android.mk b/suite/cts/deviceTests/filesystemperf/Android.mk
similarity index 89%
rename from suite/pts/deviceTests/filesystemperf/Android.mk
rename to suite/cts/deviceTests/filesystemperf/Android.mk
index ca7996c..5f0606e 100644
--- a/suite/pts/deviceTests/filesystemperf/Android.mk
+++ b/suite/cts/deviceTests/filesystemperf/Android.mk
@@ -20,11 +20,11 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := PtsDeviceFilePerf
+LOCAL_PACKAGE_NAME := CtsDeviceFilePerf
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/pts/deviceTests/filesystemperf/AndroidManifest.xml b/suite/cts/deviceTests/filesystemperf/AndroidManifest.xml
similarity index 90%
rename from suite/pts/deviceTests/filesystemperf/AndroidManifest.xml
rename to suite/cts/deviceTests/filesystemperf/AndroidManifest.xml
index 8cdeb45..dc90a94 100644
--- a/suite/pts/deviceTests/filesystemperf/AndroidManifest.xml
+++ b/suite/cts/deviceTests/filesystemperf/AndroidManifest.xml
@@ -15,7 +15,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.pts.filesystemperf">
+        package="com.android.cts.filesystemperf">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -24,6 +24,6 @@
         <uses-library android:name="android.test.runner" />
     </application>
     <instrumentation android:name="android.test.InstrumentationCtsTestRunner"
-            android:targetPackage="com.android.pts.filesystemperf"
+            android:targetPackage="com.android.cts.filesystemperf"
             android:label="UI Latency measurement" />
 </manifest>
diff --git a/suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/AlmostFullTest.java b/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/AlmostFullTest.java
similarity index 96%
rename from suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/AlmostFullTest.java
rename to suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/AlmostFullTest.java
index 1f65e7d..1f65e57 100644
--- a/suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/AlmostFullTest.java
+++ b/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/AlmostFullTest.java
@@ -14,18 +14,18 @@
  * limitations under the License.
  */
 
-package com.android.pts.filesystemperf;
+package com.android.cts.filesystemperf;
 
 import android.cts.util.TimeoutReq;
 import android.util.Log;
 
-import com.android.pts.util.PtsAndroidTestCase;
-import com.android.pts.util.SystemUtil;
+import android.cts.util.CtsAndroidTestCase;
+import android.cts.util.SystemUtil;
 
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
-public class AlmostFullTest extends PtsAndroidTestCase {
+public class AlmostFullTest extends CtsAndroidTestCase {
 
     private static final String DIR_INITIAL_FILL = "INITIAL_FILL";
     private static final String DIR_SEQ_UPDATE = "SEQ_UPDATE";
diff --git a/suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/FileUtil.java b/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/FileUtil.java
similarity index 97%
rename from suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/FileUtil.java
rename to suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/FileUtil.java
index 2119ee5..b342b61 100644
--- a/suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/FileUtil.java
+++ b/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/FileUtil.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.filesystemperf;
+package com.android.cts.filesystemperf;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -25,13 +25,13 @@
 import java.io.RandomAccessFile;
 import java.util.Random;
 
-import com.android.pts.util.MeasureRun;
-import com.android.pts.util.MeasureTime;
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
-import com.android.pts.util.ReportLog;
-import com.android.pts.util.Stat;
-import com.android.pts.util.SystemUtil;
+import com.android.cts.util.MeasureRun;
+import com.android.cts.util.MeasureTime;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
+import com.android.cts.util.ReportLog;
+import com.android.cts.util.Stat;
+import android.cts.util.SystemUtil;
 
 import android.content.Context;
 import android.util.Log;
diff --git a/suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/RandomRWTest.java b/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/RandomRWTest.java
similarity index 92%
rename from suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/RandomRWTest.java
rename to suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/RandomRWTest.java
index 6b6086b..93d5396 100644
--- a/suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/RandomRWTest.java
+++ b/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/RandomRWTest.java
@@ -14,14 +14,14 @@
  * limitations under the License.
  */
 
-package com.android.pts.filesystemperf;
+package com.android.cts.filesystemperf;
 
 import android.cts.util.TimeoutReq;
 
-import com.android.pts.util.PtsAndroidTestCase;
+import android.cts.util.CtsAndroidTestCase;
 
 
-public class RandomRWTest extends PtsAndroidTestCase {
+public class RandomRWTest extends CtsAndroidTestCase {
     private static final String DIR_RANDOM_WR = "RANDOM_WR";
     private static final String DIR_RANDOM_RD = "RANDOM_RD";
 
diff --git a/suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/SequentialRWTest.java b/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/SequentialRWTest.java
similarity index 91%
rename from suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/SequentialRWTest.java
rename to suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/SequentialRWTest.java
index d36b45c..6f1f9cd 100644
--- a/suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/SequentialRWTest.java
+++ b/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/SequentialRWTest.java
@@ -14,24 +14,22 @@
  * limitations under the License.
  */
 
-package com.android.pts.filesystemperf;
+package com.android.cts.filesystemperf;
 
 import android.cts.util.TimeoutReq;
-import com.android.pts.util.MeasureRun;
-import com.android.pts.util.MeasureTime;
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
-import com.android.pts.util.PtsAndroidTestCase;
-import com.android.pts.util.ReportLog;
-import com.android.pts.util.Stat;
-import com.android.pts.util.SystemUtil;
+import com.android.cts.util.MeasureRun;
+import com.android.cts.util.MeasureTime;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
+import android.cts.util.CtsAndroidTestCase;
+import com.android.cts.util.ReportLog;
+import com.android.cts.util.Stat;
 
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 
-public class SequentialRWTest extends PtsAndroidTestCase {
+public class SequentialRWTest extends CtsAndroidTestCase {
     private static final String DIR_SEQ_WR = "SEQ_WR";
     private static final String DIR_SEQ_UPDATE = "SEQ_UPDATE";
     private static final String DIR_SEQ_RD = "SEQ_RD";
diff --git a/suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/TestTest.java b/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/TestTest.java
similarity index 83%
rename from suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/TestTest.java
rename to suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/TestTest.java
index e333200..052c054 100644
--- a/suite/pts/deviceTests/filesystemperf/src/com/android/pts/filesystemperf/TestTest.java
+++ b/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/TestTest.java
@@ -17,21 +17,20 @@
 
 // code for testing, will be removed / moved before release
 
-package com.android.pts.filesystemperf;
+package com.android.cts.filesystemperf;
 
-import android.cts.util.TimeoutReq;
-import com.android.pts.util.PtsAndroidTestCase;
+import android.cts.util.CtsAndroidTestCase;
 
 /**
- * This class is for testing PTS itself. Will be disabled in release.
+ * This class is for testing CTS logging. Will be disabled in release.
  *
  */
-public class TestTest extends PtsAndroidTestCase {
+public class TestTest extends CtsAndroidTestCase {
     @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
-/* code for testing PTS logging. Disabled.
+/* code for testing CTS logging. Disabled.
     @TimeoutReq(minutes = 15)
     public void testPass() {
         double[] array = new double[] {1.0, 2.0, 3.0};
diff --git a/suite/pts/deviceTests/opengl/Android.mk b/suite/cts/deviceTests/opengl/Android.mk
similarity index 86%
rename from suite/pts/deviceTests/opengl/Android.mk
rename to suite/cts/deviceTests/opengl/Android.mk
index 9346724..1b7d42b 100644
--- a/suite/pts/deviceTests/opengl/Android.mk
+++ b/suite/cts/deviceTests/opengl/Android.mk
@@ -20,13 +20,13 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
 
-LOCAL_JNI_SHARED_LIBRARIES := libptsopengl_jni
+LOCAL_JNI_SHARED_LIBRARIES := libctsopengl_jni
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := PtsDeviceOpenGl
+LOCAL_PACKAGE_NAME := CtsDeviceOpenGl
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/pts/deviceTests/opengl/AndroidManifest.xml b/suite/cts/deviceTests/opengl/AndroidManifest.xml
similarity index 86%
rename from suite/pts/deviceTests/opengl/AndroidManifest.xml
rename to suite/cts/deviceTests/opengl/AndroidManifest.xml
index 6aa50cf..db75371 100644
--- a/suite/pts/deviceTests/opengl/AndroidManifest.xml
+++ b/suite/cts/deviceTests/opengl/AndroidManifest.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.pts.opengl"
+    package="com.android.cts.opengl"
     android:versionCode="1"
     android:versionName="1.0" >
 
@@ -19,7 +19,7 @@
         <uses-library android:name="android.test.runner" />
 
         <activity
-            android:name="com.android.pts.opengl.primitive.GLPrimitiveActivity"
+            android:name="com.android.cts.opengl.primitive.GLPrimitiveActivity"
             android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
             android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
             <intent-filter>
@@ -29,7 +29,7 @@
             </intent-filter>
         </activity>
         <activity
-            android:name="com.android.pts.opengl.reference.GLReferenceActivity"
+            android:name="com.android.cts.opengl.reference.GLReferenceActivity"
             android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
             android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
             <intent-filter>
@@ -39,7 +39,7 @@
             </intent-filter>
         </activity>
         <activity
-            android:name="com.android.pts.opengl.reference.GLGameActivity"
+            android:name="com.android.cts.opengl.reference.GLGameActivity"
             android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
             android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
         </activity>
@@ -48,6 +48,6 @@
     <instrumentation
         android:name="android.test.InstrumentationCtsTestRunner"
         android:label="OpenGL ES 2.0 Benchmark"
-        android:targetPackage="com.android.pts.opengl" />
+        android:targetPackage="com.android.cts.opengl" />
 
 </manifest>
\ No newline at end of file
diff --git a/suite/pts/deviceTests/opengl/README b/suite/cts/deviceTests/opengl/README
similarity index 100%
rename from suite/pts/deviceTests/opengl/README
rename to suite/cts/deviceTests/opengl/README
diff --git a/suite/pts/deviceTests/opengl/assets/fragment/basic b/suite/cts/deviceTests/opengl/assets/fragment/basic
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/fragment/basic
rename to suite/cts/deviceTests/opengl/assets/fragment/basic
diff --git a/suite/pts/deviceTests/opengl/assets/fragment/blur b/suite/cts/deviceTests/opengl/assets/fragment/blur
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/fragment/blur
rename to suite/cts/deviceTests/opengl/assets/fragment/blur
diff --git a/suite/pts/deviceTests/opengl/assets/fragment/perspective b/suite/cts/deviceTests/opengl/assets/fragment/perspective
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/fragment/perspective
rename to suite/cts/deviceTests/opengl/assets/fragment/perspective
diff --git a/suite/pts/deviceTests/opengl/assets/fragment/water b/suite/cts/deviceTests/opengl/assets/fragment/water
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/fragment/water
rename to suite/cts/deviceTests/opengl/assets/fragment/water
diff --git a/suite/pts/deviceTests/opengl/assets/mesh/arc.cob b/suite/cts/deviceTests/opengl/assets/mesh/arc.cob
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/mesh/arc.cob
rename to suite/cts/deviceTests/opengl/assets/mesh/arc.cob
Binary files differ
diff --git a/suite/pts/deviceTests/opengl/assets/mesh/fish.cob b/suite/cts/deviceTests/opengl/assets/mesh/fish.cob
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/mesh/fish.cob
rename to suite/cts/deviceTests/opengl/assets/mesh/fish.cob
Binary files differ
diff --git a/suite/pts/deviceTests/opengl/assets/mesh/plane.cob b/suite/cts/deviceTests/opengl/assets/mesh/plane.cob
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/mesh/plane.cob
rename to suite/cts/deviceTests/opengl/assets/mesh/plane.cob
Binary files differ
diff --git a/suite/pts/deviceTests/opengl/assets/texture/arc.png b/suite/cts/deviceTests/opengl/assets/texture/arc.png
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/texture/arc.png
rename to suite/cts/deviceTests/opengl/assets/texture/arc.png
Binary files differ
diff --git a/suite/pts/deviceTests/opengl/assets/texture/background.png b/suite/cts/deviceTests/opengl/assets/texture/background.png
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/texture/background.png
rename to suite/cts/deviceTests/opengl/assets/texture/background.png
Binary files differ
diff --git a/suite/pts/deviceTests/opengl/assets/texture/fish.png b/suite/cts/deviceTests/opengl/assets/texture/fish.png
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/texture/fish.png
rename to suite/cts/deviceTests/opengl/assets/texture/fish.png
Binary files differ
diff --git a/suite/pts/deviceTests/opengl/assets/texture/fish_dark.png b/suite/cts/deviceTests/opengl/assets/texture/fish_dark.png
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/texture/fish_dark.png
rename to suite/cts/deviceTests/opengl/assets/texture/fish_dark.png
Binary files differ
diff --git a/suite/pts/deviceTests/opengl/assets/texture/water1.png b/suite/cts/deviceTests/opengl/assets/texture/water1.png
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/texture/water1.png
rename to suite/cts/deviceTests/opengl/assets/texture/water1.png
Binary files differ
diff --git a/suite/pts/deviceTests/opengl/assets/texture/water2.png b/suite/cts/deviceTests/opengl/assets/texture/water2.png
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/texture/water2.png
rename to suite/cts/deviceTests/opengl/assets/texture/water2.png
Binary files differ
diff --git a/suite/pts/deviceTests/opengl/assets/vertex/basic b/suite/cts/deviceTests/opengl/assets/vertex/basic
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/vertex/basic
rename to suite/cts/deviceTests/opengl/assets/vertex/basic
diff --git a/suite/pts/deviceTests/opengl/assets/vertex/blur b/suite/cts/deviceTests/opengl/assets/vertex/blur
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/vertex/blur
rename to suite/cts/deviceTests/opengl/assets/vertex/blur
diff --git a/suite/pts/deviceTests/opengl/assets/vertex/perspective b/suite/cts/deviceTests/opengl/assets/vertex/perspective
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/vertex/perspective
rename to suite/cts/deviceTests/opengl/assets/vertex/perspective
diff --git a/suite/pts/deviceTests/opengl/assets/vertex/water b/suite/cts/deviceTests/opengl/assets/vertex/water
similarity index 100%
rename from suite/pts/deviceTests/opengl/assets/vertex/water
rename to suite/cts/deviceTests/opengl/assets/vertex/water
diff --git a/suite/pts/deviceTests/opengl/cob_exporter.py b/suite/cts/deviceTests/opengl/cob_exporter.py
similarity index 100%
rename from suite/pts/deviceTests/opengl/cob_exporter.py
rename to suite/cts/deviceTests/opengl/cob_exporter.py
diff --git a/suite/pts/deviceTests/opengl/jni/Android.mk b/suite/cts/deviceTests/opengl/jni/Android.mk
similarity index 96%
rename from suite/pts/deviceTests/opengl/jni/Android.mk
rename to suite/cts/deviceTests/opengl/jni/Android.mk
index edefdca..8f10509 100644
--- a/suite/pts/deviceTests/opengl/jni/Android.mk
+++ b/suite/cts/deviceTests/opengl/jni/Android.mk
@@ -16,7 +16,7 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_MODULE := libptsopengl_jni
+LOCAL_MODULE := libctsopengl_jni
 
 LOCAL_MODULE_TAGS := optional
 
diff --git a/suite/pts/deviceTests/opengl/jni/Trace.h b/suite/cts/deviceTests/opengl/jni/Trace.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/Trace.h
rename to suite/cts/deviceTests/opengl/jni/Trace.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/GLUtils.cpp b/suite/cts/deviceTests/opengl/jni/graphics/GLUtils.cpp
similarity index 98%
rename from suite/pts/deviceTests/opengl/jni/graphics/GLUtils.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/GLUtils.cpp
index 43aa47d..9076f39 100644
--- a/suite/pts/deviceTests/opengl/jni/graphics/GLUtils.cpp
+++ b/suite/cts/deviceTests/opengl/jni/graphics/GLUtils.cpp
@@ -18,7 +18,7 @@
 
 #include <android/asset_manager_jni.h>
 
-#define LOG_TAG "PTS_OPENGL"
+#define LOG_TAG "CTS_OPENGL"
 #define LOG_NDEBUG 0
 #include <utils/Log.h>
 
@@ -59,7 +59,7 @@
 
 GLuint GLUtils::loadTexture(const char* path) {
     GLuint textureId = 0;
-    jclass activityClass = sEnv->FindClass("com/android/pts/opengl/reference/GLGameActivity");
+    jclass activityClass = sEnv->FindClass("com/android/cts/opengl/reference/GLGameActivity");
     if (activityClass == NULL) {
         ALOGE("Couldn't find activity class");
         return -1;
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/GLUtils.h b/suite/cts/deviceTests/opengl/jni/graphics/GLUtils.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/GLUtils.h
rename to suite/cts/deviceTests/opengl/jni/graphics/GLUtils.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/Matrix.cpp b/suite/cts/deviceTests/opengl/jni/graphics/Matrix.cpp
similarity index 99%
rename from suite/pts/deviceTests/opengl/jni/graphics/Matrix.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/Matrix.cpp
index 422c93c..0097a5d 100644
--- a/suite/pts/deviceTests/opengl/jni/graphics/Matrix.cpp
+++ b/suite/cts/deviceTests/opengl/jni/graphics/Matrix.cpp
@@ -16,7 +16,7 @@
 #include <string.h>
 #include <cmath>
 
-#define LOG_TAG "PTS_OPENGL"
+#define LOG_TAG "CTS_OPENGL"
 #define LOG_NDEBUG 0
 #include "utils/Log.h"
 
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/Matrix.h b/suite/cts/deviceTests/opengl/jni/graphics/Matrix.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/Matrix.h
rename to suite/cts/deviceTests/opengl/jni/graphics/Matrix.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/Mesh.cpp b/suite/cts/deviceTests/opengl/jni/graphics/Mesh.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/Mesh.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/Mesh.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/Mesh.h b/suite/cts/deviceTests/opengl/jni/graphics/Mesh.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/Mesh.h
rename to suite/cts/deviceTests/opengl/jni/graphics/Mesh.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/MeshNode.cpp b/suite/cts/deviceTests/opengl/jni/graphics/MeshNode.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/MeshNode.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/MeshNode.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/MeshNode.h b/suite/cts/deviceTests/opengl/jni/graphics/MeshNode.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/MeshNode.h
rename to suite/cts/deviceTests/opengl/jni/graphics/MeshNode.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.cpp b/suite/cts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.h b/suite/cts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.h
rename to suite/cts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/PerspectiveProgram.cpp b/suite/cts/deviceTests/opengl/jni/graphics/PerspectiveProgram.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/PerspectiveProgram.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/PerspectiveProgram.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/PerspectiveProgram.h b/suite/cts/deviceTests/opengl/jni/graphics/PerspectiveProgram.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/PerspectiveProgram.h
rename to suite/cts/deviceTests/opengl/jni/graphics/PerspectiveProgram.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/Program.cpp b/suite/cts/deviceTests/opengl/jni/graphics/Program.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/Program.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/Program.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/Program.h b/suite/cts/deviceTests/opengl/jni/graphics/Program.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/Program.h
rename to suite/cts/deviceTests/opengl/jni/graphics/Program.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/ProgramNode.cpp b/suite/cts/deviceTests/opengl/jni/graphics/ProgramNode.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/ProgramNode.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/ProgramNode.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/ProgramNode.h b/suite/cts/deviceTests/opengl/jni/graphics/ProgramNode.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/ProgramNode.h
rename to suite/cts/deviceTests/opengl/jni/graphics/ProgramNode.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/Renderer.cpp b/suite/cts/deviceTests/opengl/jni/graphics/Renderer.cpp
similarity index 99%
rename from suite/pts/deviceTests/opengl/jni/graphics/Renderer.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/Renderer.cpp
index bdb6b5d..b8e2acf 100644
--- a/suite/pts/deviceTests/opengl/jni/graphics/Renderer.cpp
+++ b/suite/cts/deviceTests/opengl/jni/graphics/Renderer.cpp
@@ -14,7 +14,7 @@
 #include "Renderer.h"
 #include <graphics/GLUtils.h>
 
-#define LOG_TAG "PTS_OPENGL"
+#define LOG_TAG "CTS_OPENGL"
 #define LOG_NDEBUG 0
 #include <utils/Log.h>
 
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/Renderer.h b/suite/cts/deviceTests/opengl/jni/graphics/Renderer.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/Renderer.h
rename to suite/cts/deviceTests/opengl/jni/graphics/Renderer.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/SceneGraphNode.cpp b/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/SceneGraphNode.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/SceneGraphNode.h b/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/SceneGraphNode.h
rename to suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/TexturedMeshNode.cpp b/suite/cts/deviceTests/opengl/jni/graphics/TexturedMeshNode.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/TexturedMeshNode.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/TexturedMeshNode.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/TexturedMeshNode.h b/suite/cts/deviceTests/opengl/jni/graphics/TexturedMeshNode.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/TexturedMeshNode.h
rename to suite/cts/deviceTests/opengl/jni/graphics/TexturedMeshNode.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/TransformationNode.cpp b/suite/cts/deviceTests/opengl/jni/graphics/TransformationNode.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/TransformationNode.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/TransformationNode.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/TransformationNode.h b/suite/cts/deviceTests/opengl/jni/graphics/TransformationNode.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/TransformationNode.h
rename to suite/cts/deviceTests/opengl/jni/graphics/TransformationNode.h
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/Vector2D.cpp b/suite/cts/deviceTests/opengl/jni/graphics/Vector2D.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/Vector2D.cpp
rename to suite/cts/deviceTests/opengl/jni/graphics/Vector2D.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/graphics/Vector2D.h b/suite/cts/deviceTests/opengl/jni/graphics/Vector2D.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/graphics/Vector2D.h
rename to suite/cts/deviceTests/opengl/jni/graphics/Vector2D.h
diff --git a/suite/pts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp b/suite/cts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
similarity index 91%
rename from suite/pts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
rename to suite/cts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
index 0891830..9d39af9 100644
--- a/suite/pts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
+++ b/suite/cts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
@@ -30,7 +30,7 @@
 Renderer* gRenderer = NULL;
 
 extern "C" JNIEXPORT jboolean JNICALL
-Java_com_android_pts_opengl_primitive_GLPrimitiveActivity_startBenchmark(
+Java_com_android_cts_opengl_primitive_GLPrimitiveActivity_startBenchmark(
         JNIEnv* env, jclass clazz, jint numFrames, jdoubleArray frameTimes) {
     if (gRenderer == NULL) {
         return false;
@@ -69,28 +69,28 @@
 
 // The following functions create the renderers for the various benchmarks.
 extern "C" JNIEXPORT void JNICALL
-Java_com_android_pts_opengl_primitive_GLPrimitiveActivity_setupFullPipelineBenchmark(
+Java_com_android_cts_opengl_primitive_GLPrimitiveActivity_setupFullPipelineBenchmark(
         JNIEnv* env, jclass clazz, jobject surface, jboolean offscreen, jint workload) {
     gRenderer = new FullPipelineRenderer(
             ANativeWindow_fromSurface(env, surface), offscreen, workload);
 }
 
 extern "C" JNIEXPORT void JNICALL
-Java_com_android_pts_opengl_primitive_GLPrimitiveActivity_setupPixelOutputBenchmark(
+Java_com_android_cts_opengl_primitive_GLPrimitiveActivity_setupPixelOutputBenchmark(
         JNIEnv* env, jclass clazz, jobject surface, jboolean offscreen, jint workload) {
     gRenderer = new PixelOutputRenderer(
             ANativeWindow_fromSurface(env, surface), offscreen, workload);
 }
 
 extern "C" JNIEXPORT void JNICALL
-Java_com_android_pts_opengl_primitive_GLPrimitiveActivity_setupShaderPerfBenchmark(
+Java_com_android_cts_opengl_primitive_GLPrimitiveActivity_setupShaderPerfBenchmark(
         JNIEnv* env, jclass clazz, jobject surface, jboolean offscreen, jint workload) {
     gRenderer = new ShaderPerfRenderer(
             ANativeWindow_fromSurface(env, surface), offscreen, workload);
 }
 
 extern "C" JNIEXPORT void JNICALL
-Java_com_android_pts_opengl_primitive_GLPrimitiveActivity_setupContextSwitchBenchmark(
+Java_com_android_cts_opengl_primitive_GLPrimitiveActivity_setupContextSwitchBenchmark(
         JNIEnv* env, jclass clazz, jobject surface, jboolean offscreen, jint workload) {
     if (workload <= 8) {
         // This test uses 8 iterations, so workload can't be more than 8.
diff --git a/suite/pts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.cpp b/suite/cts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.cpp
similarity index 99%
rename from suite/pts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.cpp
rename to suite/cts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.cpp
index 232cd9d..171f8fe 100644
--- a/suite/pts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.cpp
+++ b/suite/cts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.cpp
@@ -24,7 +24,7 @@
 #include "ContextSwitchRenderer.h"
 #include <graphics/GLUtils.h>
 
-#define LOG_TAG "PTS_OPENGL"
+#define LOG_TAG "CTS_OPENGL"
 #define LOG_NDEBUG 0
 #include <utils/Log.h>
 #include <Trace.h>
diff --git a/suite/pts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.h b/suite/cts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.h
rename to suite/cts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.h
diff --git a/suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.cpp b/suite/cts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.cpp
rename to suite/cts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.h b/suite/cts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.h
rename to suite/cts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.h
diff --git a/suite/pts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.cpp b/suite/cts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.cpp
rename to suite/cts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.h b/suite/cts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.h
rename to suite/cts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.h
diff --git a/suite/pts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.cpp b/suite/cts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.cpp
rename to suite/cts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.h b/suite/cts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.h
rename to suite/cts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.h
diff --git a/suite/pts/deviceTests/opengl/jni/reference/GLReference.cpp b/suite/cts/deviceTests/opengl/jni/reference/GLReference.cpp
similarity index 96%
rename from suite/pts/deviceTests/opengl/jni/reference/GLReference.cpp
rename to suite/cts/deviceTests/opengl/jni/reference/GLReference.cpp
index 7bcca20..1857848 100644
--- a/suite/pts/deviceTests/opengl/jni/reference/GLReference.cpp
+++ b/suite/cts/deviceTests/opengl/jni/reference/GLReference.cpp
@@ -22,7 +22,7 @@
 #include "ReferenceRenderer.h"
 
 extern "C" JNIEXPORT jboolean JNICALL
-Java_com_android_pts_opengl_reference_GLGameActivity_startBenchmark(
+Java_com_android_cts_opengl_reference_GLGameActivity_startBenchmark(
         JNIEnv* env, jclass clazz, jobject assetManager, jobject surface, jint numFrames,
         jdoubleArray setUpTimes, jdoubleArray updateTimes, jdoubleArray renderTimes) {
 
diff --git a/suite/pts/deviceTests/opengl/jni/reference/ReferenceRenderer.cpp b/suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/ReferenceRenderer.cpp
rename to suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/reference/ReferenceRenderer.h b/suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/ReferenceRenderer.h
rename to suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.h
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/Scene.cpp b/suite/cts/deviceTests/opengl/jni/reference/scene/Scene.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/Scene.cpp
rename to suite/cts/deviceTests/opengl/jni/reference/scene/Scene.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/Scene.h b/suite/cts/deviceTests/opengl/jni/reference/scene/Scene.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/Scene.h
rename to suite/cts/deviceTests/opengl/jni/reference/scene/Scene.h
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/flocking/Boid.cpp b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/flocking/Boid.cpp
rename to suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/flocking/Boid.h b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/flocking/Boid.h
rename to suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.h
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.cpp b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.cpp
rename to suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.h b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.h
rename to suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.h
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.cpp b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.cpp
rename to suite/cts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.h b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.h
rename to suite/cts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.h
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.cpp b/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.cpp
rename to suite/cts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.h b/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.h
rename to suite/cts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.h
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.cpp b/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.cpp
rename to suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.h b/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.h
rename to suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.h
diff --git a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/GLActivityIntentKeys.java b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/GLActivityIntentKeys.java
similarity index 97%
rename from suite/pts/deviceTests/opengl/src/com/android/pts/opengl/GLActivityIntentKeys.java
rename to suite/cts/deviceTests/opengl/src/com/android/cts/opengl/GLActivityIntentKeys.java
index da5de80..9a29caf 100644
--- a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/GLActivityIntentKeys.java
+++ b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/GLActivityIntentKeys.java
@@ -11,7 +11,7 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.pts.opengl;
+package com.android.cts.opengl;
 
 public class GLActivityIntentKeys {
     /**
diff --git a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/primitive/BenchmarkName.java b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/BenchmarkName.java
similarity index 94%
rename from suite/pts/deviceTests/opengl/src/com/android/pts/opengl/primitive/BenchmarkName.java
rename to suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/BenchmarkName.java
index e9f219b..a6bd6db 100644
--- a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/primitive/BenchmarkName.java
+++ b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/BenchmarkName.java
@@ -11,7 +11,7 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.pts.opengl.primitive;
+package com.android.cts.opengl.primitive;
 
 /**
  * Represents the different primitive benchmarks.
diff --git a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/primitive/GLPrimitiveActivity.java b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveActivity.java
similarity index 95%
rename from suite/pts/deviceTests/opengl/src/com/android/pts/opengl/primitive/GLPrimitiveActivity.java
rename to suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveActivity.java
index ac5222c..5dc9b88 100644
--- a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/primitive/GLPrimitiveActivity.java
+++ b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveActivity.java
@@ -11,7 +11,7 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.pts.opengl.primitive;
+package com.android.cts.opengl.primitive;
 
 import android.app.Activity;
 import android.content.Intent;
@@ -22,11 +22,8 @@
 import android.view.SurfaceView;
 import android.view.Surface;
 
-import com.android.pts.opengl.GLActivityIntentKeys;
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
+import com.android.cts.opengl.GLActivityIntentKeys;
 
-import java.util.ArrayList;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Semaphore;
 
@@ -49,7 +46,7 @@
     @Override
     public void onCreate(Bundle data) {
         super.onCreate(data);
-        System.loadLibrary("ptsopengl_jni");
+        System.loadLibrary("ctsopengl_jni");
         Intent intent = getIntent();
         mBenchmark = BenchmarkName.valueOf(
                 intent.getStringExtra(GLActivityIntentKeys.INTENT_EXTRA_BENCHMARK_NAME));
diff --git a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/primitive/GLPrimitiveBenchmark.java b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveBenchmark.java
similarity index 93%
rename from suite/pts/deviceTests/opengl/src/com/android/pts/opengl/primitive/GLPrimitiveBenchmark.java
rename to suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveBenchmark.java
index 4477f3b..2e7efbe 100644
--- a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/primitive/GLPrimitiveBenchmark.java
+++ b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveBenchmark.java
@@ -11,22 +11,20 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.pts.opengl.primitive;
+package com.android.cts.opengl.primitive;
 
-import com.android.pts.opengl.GLActivityIntentKeys;
-import com.android.pts.util.PtsActivityInstrumentationTestCase2;
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
+import com.android.cts.opengl.GLActivityIntentKeys;
+import android.cts.util.CtsActivityInstrumentationTestCase2;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
 
 import android.content.Intent;
 import android.cts.util.TimeoutReq;
 
-import java.util.Arrays;
-
 /**
  * Runs the Primitive OpenGL ES 2.0 Benchmarks.
  */
-public class GLPrimitiveBenchmark extends PtsActivityInstrumentationTestCase2<GLPrimitiveActivity> {
+public class GLPrimitiveBenchmark extends CtsActivityInstrumentationTestCase2<GLPrimitiveActivity> {
 
     private static final int NUM_FRAMES = 100;
     private static final int NUM_ITERATIONS = 8;
diff --git a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/reference/GLGameActivity.java b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLGameActivity.java
similarity index 96%
rename from suite/pts/deviceTests/opengl/src/com/android/pts/opengl/reference/GLGameActivity.java
rename to suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLGameActivity.java
index 29b79f4..3b310f9 100644
--- a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/reference/GLGameActivity.java
+++ b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLGameActivity.java
@@ -11,9 +11,9 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.pts.opengl.reference;
+package com.android.cts.opengl.reference;
 
-import com.android.pts.opengl.GLActivityIntentKeys;
+import com.android.cts.opengl.GLActivityIntentKeys;
 
 import android.app.Activity;
 import android.content.Intent;
@@ -32,9 +32,7 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.HashMap;
 import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Semaphore;
 
 public class GLGameActivity extends Activity {
 
@@ -53,7 +51,7 @@
     @Override
     public void onCreate(Bundle data) {
         super.onCreate(data);
-        System.loadLibrary("ptsopengl_jni");
+        System.loadLibrary("ctsopengl_jni");
 
         Intent intent = getIntent();
         mNumFrames = intent.getIntExtra(GLActivityIntentKeys.INTENT_EXTRA_NUM_FRAMES, 1000);
diff --git a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/reference/GLReferenceActivity.java b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceActivity.java
similarity index 84%
rename from suite/pts/deviceTests/opengl/src/com/android/pts/opengl/reference/GLReferenceActivity.java
rename to suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceActivity.java
index 09f97c5..8d34535 100644
--- a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/reference/GLReferenceActivity.java
+++ b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceActivity.java
@@ -11,25 +11,24 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.pts.opengl.reference;
+package com.android.cts.opengl.reference;
 
-import com.android.pts.opengl.GLActivityIntentKeys;
+import com.android.cts.opengl.GLActivityIntentKeys;
 
 import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 
-import java.util.HashMap;
 import java.util.concurrent.Semaphore;
 
 public class GLReferenceActivity extends Activity {
 
     private final static int GAME_ACTIVITY_CODE = 1;
 
+    private volatile Exception mException;
     private int mNumFrames;
     private int mTimeout;
 
-    public boolean mSuccess = false;
     public double[] mSetUpTimes;
     public double[] mUpdateTimes;
     public double[] mRenderTimes;
@@ -53,16 +52,26 @@
     public void waitForCompletion() throws Exception {
         // Wait for semiphore.
         mSemaphore.acquire();
+        if (mException != null) {
+            throw mException;
+        }
+    }
+
+    private synchronized void setException(Exception e) {
+        if (mException == null) {
+            mException = e;
+        }
     }
 
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         if (requestCode == GAME_ACTIVITY_CODE) {
             if (resultCode == RESULT_OK) {
                 // Benchmark passed
-                mSuccess = true;
                 mSetUpTimes = data.getDoubleArrayExtra(GLGameActivity.SET_UP_TIME);
                 mUpdateTimes = data.getDoubleArrayExtra(GLGameActivity.UPDATE_TIMES);
                 mRenderTimes = data.getDoubleArrayExtra(GLGameActivity.RENDER_TIMES);
+            } else {
+                setException(new Exception("Benchmark failed to run"));
             }
             // Release semiphore.
             mSemaphore.release();
diff --git a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceBenchmark.java b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceBenchmark.java
new file mode 100644
index 0000000..39f6d89
--- /dev/null
+++ b/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceBenchmark.java
@@ -0,0 +1,86 @@
+/*
+ * 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.opengl.reference;
+
+import com.android.cts.opengl.GLActivityIntentKeys;
+
+import android.cts.util.CtsActivityInstrumentationTestCase2;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
+import android.cts.util.TimeoutReq;
+
+import android.content.Intent;
+
+/**
+ * Runs the Reference OpenGL ES 2.0 Benchmark.
+ */
+public class GLReferenceBenchmark extends CtsActivityInstrumentationTestCase2<GLReferenceActivity> {
+
+    private static final int NUM_FRAMES_PER_SCENE = 500;
+    private static final int NUM_SCENES = 2;
+    private static final int NUM_FRAMES = NUM_FRAMES_PER_SCENE * NUM_SCENES;
+    private static final int TIMEOUT = 1000000;
+
+    public GLReferenceBenchmark() {
+        super(GLReferenceActivity.class);
+    }
+
+    /**
+     * Runs the reference benchmark.
+     */
+    @TimeoutReq(minutes = 30)
+    public void testReferenceBenchmark() throws Exception {
+        Intent intent = new Intent();
+        intent.putExtra(GLActivityIntentKeys.INTENT_EXTRA_NUM_FRAMES, NUM_FRAMES);
+        intent.putExtra(GLActivityIntentKeys.INTENT_EXTRA_TIMEOUT, TIMEOUT);
+
+        GLReferenceActivity activity = null;
+        setActivityIntent(intent);
+        activity = getActivity();
+        if (activity != null) {
+            activity.waitForCompletion();
+            double totalTime = 0;
+            double[] setUpTimes = activity.mSetUpTimes;
+            double[] updateTimes = activity.mUpdateTimes;
+            double[] renderTimes = activity.mRenderTimes;
+
+            // Calculate update and render average.
+            double updateSum = updateTimes[0];
+            double renderSum = renderTimes[0];
+            for (int i = 0; i < NUM_FRAMES - 1; i++) {
+                updateSum += updateTimes[i + 1];
+                renderSum += renderTimes[i + 1];
+            }
+            double updateAverage = updateSum / NUM_FRAMES;
+            double renderAverage = renderSum / NUM_FRAMES;
+
+            getReportLog().printArray(
+                    "Set Up Times", setUpTimes, ResultType.LOWER_BETTER, ResultUnit.MS);
+            getReportLog().printArray(
+                    "Update Times", updateTimes, ResultType.LOWER_BETTER, ResultUnit.MS);
+            getReportLog().printValue(
+                    "Update Time Average", updateAverage, ResultType.LOWER_BETTER,
+                    ResultUnit.MS);
+            getReportLog().printArray(
+                    "Render Times", renderTimes, ResultType.LOWER_BETTER, ResultUnit.MS);
+            getReportLog().printValue(
+                    "Render Time Average", renderAverage, ResultType.LOWER_BETTER,
+                    ResultUnit.MS);
+            totalTime = setUpTimes[0] + setUpTimes[1] + setUpTimes[2] +
+                    setUpTimes[3] + updateAverage + renderAverage;
+            getReportLog().printSummary(
+                    "Total Time", totalTime, ResultType.LOWER_BETTER, ResultUnit.MS);
+        }
+    }
+}
diff --git a/suite/pts/deviceTests/opengl/test/Android.mk b/suite/cts/deviceTests/opengl/test/Android.mk
similarity index 96%
rename from suite/pts/deviceTests/opengl/test/Android.mk
rename to suite/cts/deviceTests/opengl/test/Android.mk
index faf5f16..b571dbf 100644
--- a/suite/pts/deviceTests/opengl/test/Android.mk
+++ b/suite/cts/deviceTests/opengl/test/Android.mk
@@ -28,7 +28,7 @@
 LOCAL_C_INCLUDES += external/gtest/include $(LOCAL_PATH)/../jni/graphics/
 LOCAL_STATIC_LIBRARIES := libutils libcutils libgtest_host libgtest_main_host liblog
 LOCAL_LDFLAGS:= -g -lrt -ldl -lstdc++ -lm -fno-exceptions
-LOCAL_MODULE:= pts_device_opengl_test
+LOCAL_MODULE:= cts_device_opengl_test
 include $(BUILD_HOST_EXECUTABLE)
 
 endif # linux
diff --git a/suite/pts/deviceTests/opengl/test/MatrixTest.cpp b/suite/cts/deviceTests/opengl/test/MatrixTest.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/test/MatrixTest.cpp
rename to suite/cts/deviceTests/opengl/test/MatrixTest.cpp
diff --git a/suite/pts/deviceTests/browserbench/Android.mk b/suite/cts/deviceTests/simplecpu/Android.mk
similarity index 86%
copy from suite/pts/deviceTests/browserbench/Android.mk
copy to suite/cts/deviceTests/simplecpu/Android.mk
index 1ce0e49..003b0f2 100644
--- a/suite/pts/deviceTests/browserbench/Android.mk
+++ b/suite/cts/deviceTests/simplecpu/Android.mk
@@ -20,11 +20,13 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner ctstestserver
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
+
+LOCAL_JNI_SHARED_LIBRARIES := libctscpu_jni
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := PtsDeviceBrowserBench
+LOCAL_PACKAGE_NAME := CtsDeviceSimpleCpu
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/pts/deviceTests/filesystemperf/AndroidManifest.xml b/suite/cts/deviceTests/simplecpu/AndroidManifest.xml
similarity index 86%
copy from suite/pts/deviceTests/filesystemperf/AndroidManifest.xml
copy to suite/cts/deviceTests/simplecpu/AndroidManifest.xml
index 8cdeb45..69e4ad2 100644
--- a/suite/pts/deviceTests/filesystemperf/AndroidManifest.xml
+++ b/suite/cts/deviceTests/simplecpu/AndroidManifest.xml
@@ -15,7 +15,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.pts.filesystemperf">
+        package="com.android.cts.simplecpu">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -24,6 +24,6 @@
         <uses-library android:name="android.test.runner" />
     </application>
     <instrumentation android:name="android.test.InstrumentationCtsTestRunner"
-            android:targetPackage="com.android.pts.filesystemperf"
-            android:label="UI Latency measurement" />
+            android:targetPackage="com.android.cts.simplecpu"
+            android:label="Very simple CPU benchmarking" />
 </manifest>
diff --git a/suite/pts/deviceTests/simplecpu/jni/Android.mk b/suite/cts/deviceTests/simplecpu/jni/Android.mk
similarity index 96%
rename from suite/pts/deviceTests/simplecpu/jni/Android.mk
rename to suite/cts/deviceTests/simplecpu/jni/Android.mk
index 9c34e0e..946aa37 100644
--- a/suite/pts/deviceTests/simplecpu/jni/Android.mk
+++ b/suite/cts/deviceTests/simplecpu/jni/Android.mk
@@ -16,7 +16,7 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_MODULE    := libptscpu_jni
+LOCAL_MODULE    := libctscpu_jni
 
 LOCAL_MODULE_TAGS := optional
 
diff --git a/suite/pts/deviceTests/simplecpu/jni/CpuNativeJni.cpp b/suite/cts/deviceTests/simplecpu/jni/CpuNativeJni.cpp
similarity index 98%
rename from suite/pts/deviceTests/simplecpu/jni/CpuNativeJni.cpp
rename to suite/cts/deviceTests/simplecpu/jni/CpuNativeJni.cpp
index 851f35e..e0be7f3 100644
--- a/suite/pts/deviceTests/simplecpu/jni/CpuNativeJni.cpp
+++ b/suite/cts/deviceTests/simplecpu/jni/CpuNativeJni.cpp
@@ -182,7 +182,7 @@
     return *(int*)p1 - *(int*)p2;
 }
 
-extern "C" JNIEXPORT jdouble JNICALL Java_com_android_pts_simplecpu_CpuNative_runSort(JNIEnv* env,
+extern "C" JNIEXPORT jdouble JNICALL Java_com_android_cts_simplecpu_CpuNative_runSort(JNIEnv* env,
         jclass clazz, jint numberElements, jint repetition)
 {
     int* data = new int[numberElements];
@@ -239,7 +239,7 @@
     }
 }
 
-extern "C" JNIEXPORT jdouble JNICALL Java_com_android_pts_simplecpu_CpuNative_runMatrixMultiplication(
+extern "C" JNIEXPORT jdouble JNICALL Java_com_android_cts_simplecpu_CpuNative_runMatrixMultiplication(
         JNIEnv* env, jclass clazz, jint n, jint repetition)
 {
     // C = A x B
diff --git a/suite/pts/deviceTests/simplecpu/src/com/android/pts/simplecpu/CpuNative.java b/suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/CpuNative.java
similarity index 94%
rename from suite/pts/deviceTests/simplecpu/src/com/android/pts/simplecpu/CpuNative.java
rename to suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/CpuNative.java
index 43c4b50..8b48623 100644
--- a/suite/pts/deviceTests/simplecpu/src/com/android/pts/simplecpu/CpuNative.java
+++ b/suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/CpuNative.java
@@ -14,11 +14,11 @@
  * limitations under the License.
  */
 
-package com.android.pts.simplecpu;
+package com.android.cts.simplecpu;
 
 public class CpuNative {
     static {
-        System.loadLibrary("ptscpu_jni");
+        System.loadLibrary("ctscpu_jni");
     }
     /**
      * run qsort for given number of repetition
diff --git a/suite/pts/deviceTests/simplecpu/src/com/android/pts/simplecpu/SimpleCpuTest.java b/suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/SimpleCpuTest.java
similarity index 93%
rename from suite/pts/deviceTests/simplecpu/src/com/android/pts/simplecpu/SimpleCpuTest.java
rename to suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/SimpleCpuTest.java
index 8278618..2a1ca3c 100644
--- a/suite/pts/deviceTests/simplecpu/src/com/android/pts/simplecpu/SimpleCpuTest.java
+++ b/suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/SimpleCpuTest.java
@@ -14,16 +14,15 @@
  * limitations under the License.
  */
 
-package com.android.pts.simplecpu;
+package com.android.cts.simplecpu;
 
 import android.cts.util.TimeoutReq;
 import android.util.Log;
 
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
-import com.android.pts.util.PtsAndroidTestCase;
-import com.android.pts.util.ReportLog;
-import com.android.pts.util.Stat;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
+import android.cts.util.CtsAndroidTestCase;
+import com.android.cts.util.Stat;
 
 /**
  * Very simple CPU benchmarking to check the basic capability of CPU.
@@ -31,7 +30,7 @@
  *   qsort
  *   matrix multiplication (for floating point performance)
  */
-public class SimpleCpuTest extends PtsAndroidTestCase {
+public class SimpleCpuTest extends CtsAndroidTestCase {
     private static final String TAG = "BandwidthTest";
     private static final int KB = 1024;
     private static final int MB = 1024 * 1024;
diff --git a/suite/pts/deviceTests/ui/Android.mk b/suite/cts/deviceTests/ui/Android.mk
similarity index 90%
rename from suite/pts/deviceTests/ui/Android.mk
rename to suite/cts/deviceTests/ui/Android.mk
index d9b17aa..17287b2 100644
--- a/suite/pts/deviceTests/ui/Android.mk
+++ b/suite/cts/deviceTests/ui/Android.mk
@@ -22,11 +22,11 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := PtsDeviceUi
+LOCAL_PACKAGE_NAME := CtsDeviceUi
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/pts/deviceTests/ui/AndroidManifest.xml b/suite/cts/deviceTests/ui/AndroidManifest.xml
similarity index 94%
rename from suite/pts/deviceTests/ui/AndroidManifest.xml
rename to suite/cts/deviceTests/ui/AndroidManifest.xml
index 2a74791..1be3eed 100644
--- a/suite/pts/deviceTests/ui/AndroidManifest.xml
+++ b/suite/cts/deviceTests/ui/AndroidManifest.xml
@@ -16,7 +16,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.pts.ui" >
+    package="com.android.cts.ui" >
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -38,6 +38,6 @@
     <instrumentation
         android:name="android.test.InstrumentationCtsTestRunner"
         android:label="UI Latency measurement"
-        android:targetPackage="com.android.pts.ui" />
+        android:targetPackage="com.android.cts.ui" />
 
 </manifest>
\ No newline at end of file
diff --git a/suite/pts/deviceTests/ui/src/com/android/pts/ui/ScrollingActivity.java b/suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingActivity.java
similarity index 98%
rename from suite/pts/deviceTests/ui/src/com/android/pts/ui/ScrollingActivity.java
rename to suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingActivity.java
index c69b4c5..2229e97 100644
--- a/suite/pts/deviceTests/ui/src/com/android/pts/ui/ScrollingActivity.java
+++ b/suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingActivity.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.ui;
+package com.android.cts.ui;
 
 import android.app.ListActivity;
 import android.os.Bundle;
diff --git a/suite/pts/deviceTests/ui/src/com/android/pts/ui/ScrollingTest.java b/suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingTest.java
similarity index 84%
rename from suite/pts/deviceTests/ui/src/com/android/pts/ui/ScrollingTest.java
rename to suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingTest.java
index 9fd43de..759c421 100644
--- a/suite/pts/deviceTests/ui/src/com/android/pts/ui/ScrollingTest.java
+++ b/suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingTest.java
@@ -13,20 +13,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.pts.ui;
+package com.android.cts.ui;
 
 import android.cts.util.TimeoutReq;
-import com.android.pts.util.MeasureRun;
-import com.android.pts.util.MeasureTime;
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
-import com.android.pts.util.PtsActivityInstrumentationTestCase2;
-import com.android.pts.util.ReportLog;
-import com.android.pts.util.Stat;
+import com.android.cts.util.MeasureRun;
+import com.android.cts.util.MeasureTime;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
+import android.cts.util.CtsActivityInstrumentationTestCase2;
+import com.android.cts.util.Stat;
 
 import java.io.IOException;
 
-public class ScrollingTest extends PtsActivityInstrumentationTestCase2<ScrollingActivity> {
+public class ScrollingTest extends CtsActivityInstrumentationTestCase2<ScrollingActivity> {
     private ScrollingActivity mActivity;
 
     public ScrollingTest() {
diff --git a/suite/pts/deviceTests/videoperf/Android.mk b/suite/cts/deviceTests/videoperf/Android.mk
similarity index 89%
rename from suite/pts/deviceTests/videoperf/Android.mk
rename to suite/cts/deviceTests/videoperf/Android.mk
index 055c9f7..6ace48f 100644
--- a/suite/pts/deviceTests/videoperf/Android.mk
+++ b/suite/cts/deviceTests/videoperf/Android.mk
@@ -20,11 +20,11 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := PtsDeviceVideoPerf
+LOCAL_PACKAGE_NAME := CtsDeviceVideoPerf
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/pts/deviceTests/videoperf/AndroidManifest.xml b/suite/cts/deviceTests/videoperf/AndroidManifest.xml
similarity index 91%
rename from suite/pts/deviceTests/videoperf/AndroidManifest.xml
rename to suite/cts/deviceTests/videoperf/AndroidManifest.xml
index fdef1ef..631141d 100644
--- a/suite/pts/deviceTests/videoperf/AndroidManifest.xml
+++ b/suite/cts/deviceTests/videoperf/AndroidManifest.xml
@@ -15,7 +15,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.pts.videoperf">
+        package="com.android.cts.videoperf">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -24,6 +24,6 @@
         <uses-library android:name="android.test.runner" />
     </application>
     <instrumentation android:name="android.test.InstrumentationCtsTestRunner"
-            android:targetPackage="com.android.pts.videoperf"
+            android:targetPackage="com.android.cts.videoperf"
             android:label="UI Latency measurement" />
 </manifest>
diff --git a/suite/pts/deviceTests/videoperf/src/com/android/pts/videoperf/CodecInfo.java b/suite/cts/deviceTests/videoperf/src/com/android/cts/videoperf/CodecInfo.java
similarity index 99%
rename from suite/pts/deviceTests/videoperf/src/com/android/pts/videoperf/CodecInfo.java
rename to suite/cts/deviceTests/videoperf/src/com/android/cts/videoperf/CodecInfo.java
index 9952148..b9edfa4 100644
--- a/suite/pts/deviceTests/videoperf/src/com/android/pts/videoperf/CodecInfo.java
+++ b/suite/cts/deviceTests/videoperf/src/com/android/cts/videoperf/CodecInfo.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.videoperf;
+package com.android.cts.videoperf;
 
 import android.media.MediaCodecInfo;
 import android.media.MediaCodecInfo.CodecCapabilities;
diff --git a/suite/pts/deviceTests/videoperf/src/com/android/pts/videoperf/VideoEncoderDecoderTest.java b/suite/cts/deviceTests/videoperf/src/com/android/cts/videoperf/VideoEncoderDecoderTest.java
similarity index 98%
rename from suite/pts/deviceTests/videoperf/src/com/android/pts/videoperf/VideoEncoderDecoderTest.java
rename to suite/cts/deviceTests/videoperf/src/com/android/cts/videoperf/VideoEncoderDecoderTest.java
index 0a03ff3..bf82067 100644
--- a/suite/pts/deviceTests/videoperf/src/com/android/pts/videoperf/VideoEncoderDecoderTest.java
+++ b/suite/cts/deviceTests/videoperf/src/com/android/cts/videoperf/VideoEncoderDecoderTest.java
@@ -14,21 +14,18 @@
  * limitations under the License.
  */
 
-package com.android.pts.videoperf;
+package com.android.cts.videoperf;
 
 import android.graphics.Point;
 import android.media.MediaCodec;
-import android.media.MediaCodecInfo;
 import android.media.MediaCodecInfo.CodecCapabilities;
-import android.media.MediaCodecInfo.CodecProfileLevel;
-import android.media.MediaCodecList;
 import android.media.MediaFormat;
 import android.util.Log;
 
-import com.android.pts.util.PtsAndroidTestCase;
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
-import com.android.pts.util.Stat;
+import android.cts.util.CtsAndroidTestCase;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
+import com.android.cts.util.Stat;
 
 import java.nio.ByteBuffer;
 import java.lang.System;
@@ -46,7 +43,7 @@
  * only some randomly selected pixels are compared. As there can be only one performance index,
  * error above certain threshold in pixel value will be treated as an error.
  */
-public class VideoEncoderDecoderTest extends PtsAndroidTestCase {
+public class VideoEncoderDecoderTest extends CtsAndroidTestCase {
     private static final String TAG = "VideoEncoderDecoderTest";
     // this wait time affects fps as too big value will work as a blocker if device fps
     // is not very high.
diff --git a/suite/pts/hostTests/Android.mk b/suite/cts/hostTests/Android.mk
similarity index 100%
rename from suite/pts/hostTests/Android.mk
rename to suite/cts/hostTests/Android.mk
diff --git a/suite/pts/hostTests/jank/Android.mk b/suite/cts/hostTests/jank/Android.mk
similarity index 85%
rename from suite/pts/hostTests/jank/Android.mk
rename to suite/cts/hostTests/jank/Android.mk
index c1fd2d6..a530912 100644
--- a/suite/pts/hostTests/jank/Android.mk
+++ b/suite/cts/hostTests/jank/Android.mk
@@ -20,22 +20,22 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_MODULE := PtsHostJank
+LOCAL_MODULE := CtsHostJank
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt ptscommonutilhost
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt ctshostutil ctscommonutilhost
 
-LOCAL_CTS_TEST_PACKAGE := com.android.pts.jank
+LOCAL_CTS_TEST_PACKAGE := com.android.cts.jank
 
-LOCAL_DEVICE_JAR_ := PtsDeviceJank
+LOCAL_DEVICE_JAR_ := CtsDeviceJank
 cts_library_jar_ := $(CTS_TESTCASES_OUT)/$(LOCAL_DEVICE_JAR_).jar
 
 $(cts_library_jar_): $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_DEVICE_JAR_))/javalib.jar | $(ACP)
 	$(hide) mkdir -p $(CTS_TESTCASES_OUT)
 	$(hide) $(ACP) -fp $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_DEVICE_JAR_))/javalib.jar $@
 
-$(CTS_TESTCASES_OUT)/PtsHostJank.xml: $(cts_library_jar_)
+$(CTS_TESTCASES_OUT)/CtsHostJank.xml: $(cts_library_jar_)
 
 include $(BUILD_CTS_HOST_JAVA_LIBRARY)
 
 # Build the library using its own makefile
-include $(call all-makefiles-under,$(LOCAL_PATH))
\ No newline at end of file
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/suite/pts/hostTests/jank/app/Android.mk b/suite/cts/hostTests/jank/app/Android.mk
similarity index 96%
rename from suite/pts/hostTests/jank/app/Android.mk
rename to suite/cts/hostTests/jank/app/Android.mk
index 62b950d7..8f4fce6 100644
--- a/suite/pts/hostTests/jank/app/Android.mk
+++ b/suite/cts/hostTests/jank/app/Android.mk
@@ -18,7 +18,7 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := PtsDeviceJank
+LOCAL_MODULE := CtsDeviceJank
 LOCAL_DEX_PREOPT := false
 
 LOCAL_JAVA_LIBRARIES := uiautomator.core
diff --git a/suite/pts/hostTests/jank/app/src/com/android/pts/jank/PtsJankTestBase.java b/suite/cts/hostTests/jank/app/src/com/android/cts/jank/CtsJankTestBase.java
similarity index 93%
rename from suite/pts/hostTests/jank/app/src/com/android/pts/jank/PtsJankTestBase.java
rename to suite/cts/hostTests/jank/app/src/com/android/cts/jank/CtsJankTestBase.java
index cbb6969..6d5162b 100644
--- a/suite/pts/hostTests/jank/app/src/com/android/pts/jank/PtsJankTestBase.java
+++ b/suite/cts/hostTests/jank/app/src/com/android/cts/jank/CtsJankTestBase.java
@@ -12,20 +12,19 @@
  * the License.
  */
 
-package com.android.pts.jank;
+package com.android.cts.jank;
 
 import android.os.Bundle;
 import android.util.Log;
 
 import com.android.uiautomator.platform.JankTestBase;
-import com.android.uiautomator.platform.SurfaceFlingerHelper;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.Scanner;
 
-public class PtsJankTestBase extends JankTestBase {
-    private final static String TAG = PtsJankTestBase.class.getName();
+public class CtsJankTestBase extends JankTestBase {
+    private final static String TAG = CtsJankTestBase.class.getName();
     protected final static String START_CMD = "am start -W -a android.intent.action.MAIN -n %s";
     protected final static String STOP_CMD = "am force-stop %s";
     protected final static String INTENT_STRING_EXTRA = " --es %s %s";
diff --git a/suite/pts/hostTests/jank/app/src/com/android/pts/jank/opengl/PtsDeviceJankOpenGl.java b/suite/cts/hostTests/jank/app/src/com/android/cts/jank/opengl/CtsDeviceJankOpenGl.java
similarity index 92%
rename from suite/pts/hostTests/jank/app/src/com/android/pts/jank/opengl/PtsDeviceJankOpenGl.java
rename to suite/cts/hostTests/jank/app/src/com/android/cts/jank/opengl/CtsDeviceJankOpenGl.java
index 715de4b..00bb73b 100644
--- a/suite/pts/hostTests/jank/app/src/com/android/pts/jank/opengl/PtsDeviceJankOpenGl.java
+++ b/suite/cts/hostTests/jank/app/src/com/android/cts/jank/opengl/CtsDeviceJankOpenGl.java
@@ -12,16 +12,16 @@
  * the License.
  */
 
-package com.android.pts.jank.opengl;
+package com.android.cts.jank.opengl;
 
 import android.util.Log;
 
-import com.android.pts.jank.PtsJankTestBase;
+import com.android.cts.jank.CtsJankTestBase;
 import com.android.uiautomator.platform.SurfaceFlingerHelper;
 
-public class PtsDeviceJankOpenGl extends PtsJankTestBase {
-    private final static String TAG = PtsDeviceJankOpenGl.class.getName();
-    private final static String PACKAGE = "com.android.pts.opengl";
+public class CtsDeviceJankOpenGl extends CtsJankTestBase {
+    private final static String TAG = CtsDeviceJankOpenGl.class.getName();
+    private final static String PACKAGE = "com.android.cts.opengl";
     private final static String COMPONENT =
             PACKAGE + "/" + PACKAGE + ".primitive.GLPrimitiveActivity";
     private static String APP_WINDOW_NAME = "SurfaceView";
diff --git a/suite/pts/hostTests/jank/app/src/com/android/pts/jank/ui/PtsDeviceJankUi.java b/suite/cts/hostTests/jank/app/src/com/android/cts/jank/ui/CtsDeviceJankUi.java
similarity index 91%
rename from suite/pts/hostTests/jank/app/src/com/android/pts/jank/ui/PtsDeviceJankUi.java
rename to suite/cts/hostTests/jank/app/src/com/android/cts/jank/ui/CtsDeviceJankUi.java
index 02d466e..ea1f685 100644
--- a/suite/pts/hostTests/jank/app/src/com/android/pts/jank/ui/PtsDeviceJankUi.java
+++ b/suite/cts/hostTests/jank/app/src/com/android/cts/jank/ui/CtsDeviceJankUi.java
@@ -12,19 +12,19 @@
  * the License.
  */
 
-package com.android.pts.jank.ui;
+package com.android.cts.jank.ui;
 
 import android.util.Log;
 import android.widget.ListView;
 
-import com.android.pts.jank.PtsJankTestBase;
+import com.android.cts.jank.CtsJankTestBase;
 import com.android.uiautomator.core.UiScrollable;
 import com.android.uiautomator.core.UiSelector;
 import com.android.uiautomator.platform.SurfaceFlingerHelper;
 
-public class PtsDeviceJankUi extends PtsJankTestBase {
-    private final static String TAG = PtsDeviceJankUi.class.getName();
-    private final static String PACKAGE = "com.android.pts.ui";
+public class CtsDeviceJankUi extends CtsJankTestBase {
+    private final static String TAG = CtsDeviceJankUi.class.getName();
+    private final static String PACKAGE = "com.android.cts.ui";
     private final static String COMPONENT =
             PACKAGE + "/" + PACKAGE + ".ScrollingActivity";
     private final static int NUM_ELEMENTS = 1000;
diff --git a/suite/pts/hostTests/jank/src/com/android/pts/jank/PtsHostJankTest.java b/suite/cts/hostTests/jank/src/com/android/cts/jank/CtsHostJankTest.java
similarity index 92%
rename from suite/pts/hostTests/jank/src/com/android/pts/jank/PtsHostJankTest.java
rename to suite/cts/hostTests/jank/src/com/android/cts/jank/CtsHostJankTest.java
index 9c2b481..1cf3dd7 100644
--- a/suite/pts/hostTests/jank/src/com/android/pts/jank/PtsHostJankTest.java
+++ b/suite/cts/hostTests/jank/src/com/android/cts/jank/CtsHostJankTest.java
@@ -11,16 +11,15 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.pts.jank;
+package com.android.cts.jank;
 
 import com.android.cts.tradefed.build.CtsBuildHelper;
 import com.android.ddmlib.IShellOutputReceiver;
 import com.android.ddmlib.Log;
 import com.android.ddmlib.Log.LogLevel;
-import com.android.pts.util.HostReportLog;
-import com.android.pts.util.ReportLog;
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
+import com.android.cts.util.HostReportLog;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
 import com.android.tradefed.build.IBuildInfo;
 import com.android.tradefed.device.ITestDevice;
 import com.android.tradefed.testtype.DeviceTestCase;
@@ -30,9 +29,9 @@
 import java.util.HashMap;
 import java.util.Scanner;
 
-public class PtsHostJankTest extends DeviceTestCase implements IBuildReceiver {
+public class CtsHostJankTest extends DeviceTestCase implements IBuildReceiver {
 
-    private static final String TAG = "PtsHostJankTest";
+    private static final String TAG = CtsHostJankTest.class.getSimpleName();
     private static final String DEVICE_LOCATION = "/data/local/tmp/";
     private static final String RUN_UI_AUTOMATOR_CMD = "uiautomator runtest %s -c %s";
     private final String mHostTestClass;
@@ -42,7 +41,7 @@
     protected ITestDevice mDevice;
     protected CtsBuildHelper mBuild;
 
-    public PtsHostJankTest(String jarName, String deviceTestClass, String hostTestClass) {
+    public CtsHostJankTest(String jarName, String deviceTestClass, String hostTestClass) {
         this.mHostTestClass = hostTestClass;
         this.mDeviceTestClass = deviceTestClass;
         this.mJarName = jarName;
diff --git a/suite/pts/hostTests/jank/src/com/android/pts/jank/opengl/PtsHostJankOpenGl.java b/suite/cts/hostTests/jank/src/com/android/cts/jank/opengl/CtsHostJankOpenGl.java
similarity index 74%
rename from suite/pts/hostTests/jank/src/com/android/pts/jank/opengl/PtsHostJankOpenGl.java
rename to suite/cts/hostTests/jank/src/com/android/cts/jank/opengl/CtsHostJankOpenGl.java
index 8d9c3e72..ebd5bfa 100644
--- a/suite/pts/hostTests/jank/src/com/android/pts/jank/opengl/PtsHostJankOpenGl.java
+++ b/suite/cts/hostTests/jank/src/com/android/cts/jank/opengl/CtsHostJankOpenGl.java
@@ -11,22 +11,22 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.pts.jank.opengl;
+package com.android.cts.jank.opengl;
 
-import com.android.pts.jank.PtsHostJankTest;
+import com.android.cts.jank.CtsHostJankTest;
 
 import java.io.File;
 
-public class PtsHostJankOpenGl extends PtsHostJankTest {
+public class CtsHostJankOpenGl extends CtsHostJankTest {
 
-    private static final String APK_PACKAGE = "com.android.pts";
-    private static final String APK = "PtsDeviceOpenGl.apk";
-    private static final String PACKAGE = "com.android.pts.jank.opengl";
-    private static final String HOST_CLASS = PtsHostJankOpenGl.class.getName();
-    private static final String DEVICE_CLASS = PACKAGE + ".PtsDeviceJankOpenGl";
-    private static final String JAR_NAME = "PtsDeviceJank.jar";
+    private static final String APK_PACKAGE = "com.android.cts";
+    private static final String APK = "CtsDeviceOpenGl.apk";
+    private static final String PACKAGE = "com.android.cts.jank.opengl";
+    private static final String HOST_CLASS = CtsHostJankOpenGl.class.getName();
+    private static final String DEVICE_CLASS = PACKAGE + ".CtsDeviceJankOpenGl";
+    private static final String JAR_NAME = "CtsDeviceJank.jar";
 
-    public PtsHostJankOpenGl() {
+    public CtsHostJankOpenGl() {
         super(JAR_NAME, DEVICE_CLASS, HOST_CLASS);
     }
 
diff --git a/suite/pts/hostTests/jank/src/com/android/pts/jank/ui/PtsHostJankUi.java b/suite/cts/hostTests/jank/src/com/android/cts/jank/ui/CtsHostJankUi.java
similarity index 69%
rename from suite/pts/hostTests/jank/src/com/android/pts/jank/ui/PtsHostJankUi.java
rename to suite/cts/hostTests/jank/src/com/android/cts/jank/ui/CtsHostJankUi.java
index 245a892..3027899 100644
--- a/suite/pts/hostTests/jank/src/com/android/pts/jank/ui/PtsHostJankUi.java
+++ b/suite/cts/hostTests/jank/src/com/android/cts/jank/ui/CtsHostJankUi.java
@@ -11,22 +11,22 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.pts.jank.ui;
+package com.android.cts.jank.ui;
 
-import com.android.pts.jank.PtsHostJankTest;
+import com.android.cts.jank.CtsHostJankTest;
 
 import java.io.File;
 
-public class PtsHostJankUi extends PtsHostJankTest {
+public class CtsHostJankUi extends CtsHostJankTest {
 
-    private static final String APK_PACKAGE = "com.android.pts";
-    private static final String APK = "PtsDeviceUi.apk";
-    private static final String PACKAGE = "com.android.pts.jank.ui";
-    private static final String HOST_CLASS = PtsHostJankUi.class.getName();
-    private static final String DEVICE_CLASS = PACKAGE + ".PtsDeviceJankUi";
-    private static final String JAR_NAME = "PtsDeviceJank.jar";
+    private static final String APK_PACKAGE = "com.android.cts";
+    private static final String APK = "CtsDeviceUi.apk";
+    private static final String PACKAGE = "com.android.cts.jank.ui";
+    private static final String HOST_CLASS = CtsHostJankUi.class.getName();
+    private static final String DEVICE_CLASS = PACKAGE + ".CtsDeviceJankUi";
+    private static final String JAR_NAME = "CtsDeviceJank.jar";
 
-    public PtsHostJankUi() {
+    public CtsHostJankUi() {
         super(JAR_NAME, DEVICE_CLASS, HOST_CLASS);
     }
 
diff --git a/suite/pts/hostTests/uihost/Android.mk b/suite/cts/hostTests/uihost/Android.mk
similarity index 88%
rename from suite/pts/hostTests/uihost/Android.mk
rename to suite/cts/hostTests/uihost/Android.mk
index 65742e2..85a7a92 100644
--- a/suite/pts/hostTests/uihost/Android.mk
+++ b/suite/cts/hostTests/uihost/Android.mk
@@ -20,11 +20,11 @@
 
 LOCAL_MODULE_TAGS := optional
 
-LOCAL_MODULE := PtsHostUi
+LOCAL_MODULE := CtsHostUi
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt junit ptscommonutilhost
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt junit ctshostutil ctscommonutilhost
 
-LOCAL_CTS_TEST_PACKAGE := com.android.pts.uihost
+LOCAL_CTS_TEST_PACKAGE := com.android.cts.uihost
 
 include $(BUILD_CTS_HOST_JAVA_LIBRARY)
 
diff --git a/suite/pts/deviceTests/ui/Android.mk b/suite/cts/hostTests/uihost/appA/Android.mk
similarity index 89%
copy from suite/pts/deviceTests/ui/Android.mk
copy to suite/cts/hostTests/uihost/appA/Android.mk
index d9b17aa..48d9009 100644
--- a/suite/pts/deviceTests/ui/Android.mk
+++ b/suite/cts/hostTests/uihost/appA/Android.mk
@@ -22,11 +22,11 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := PtsDeviceUi
+LOCAL_PACKAGE_NAME := CtsDeviceTaskswitchingAppA
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/pts/hostTests/uihost/appA/AndroidManifest.xml b/suite/cts/hostTests/uihost/appA/AndroidManifest.xml
similarity index 95%
rename from suite/pts/hostTests/uihost/appA/AndroidManifest.xml
rename to suite/cts/hostTests/uihost/appA/AndroidManifest.xml
index 847487d..b97325c 100644
--- a/suite/pts/hostTests/uihost/appA/AndroidManifest.xml
+++ b/suite/cts/hostTests/uihost/appA/AndroidManifest.xml
@@ -16,7 +16,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.pts.taskswitching.appa" >
+    package="com.android.cts.taskswitching.appa" >
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
 
diff --git a/suite/pts/hostTests/uihost/appA/src/com/android/pts/taskswitching/appa/AppAActivity.java b/suite/cts/hostTests/uihost/appA/src/com/android/cts/taskswitching/appa/AppAActivity.java
similarity index 92%
rename from suite/pts/hostTests/uihost/appA/src/com/android/pts/taskswitching/appa/AppAActivity.java
rename to suite/cts/hostTests/uihost/appA/src/com/android/cts/taskswitching/appa/AppAActivity.java
index bb0c158..a4207a0 100644
--- a/suite/pts/hostTests/uihost/appA/src/com/android/pts/taskswitching/appa/AppAActivity.java
+++ b/suite/cts/hostTests/uihost/appA/src/com/android/cts/taskswitching/appa/AppAActivity.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.taskswitching.appa;
+package com.android.cts.taskswitching.appa;
 
 
 import android.app.ListActivity;
@@ -23,8 +23,6 @@
 import android.os.Bundle;
 import android.os.Handler;
 import android.view.WindowManager;
-import android.widget.AbsListView;
-import android.widget.AbsListView.OnScrollListener;
 import android.widget.ArrayAdapter;
 import android.widget.ListView;
 
@@ -35,7 +33,7 @@
 public class AppAActivity extends ListActivity {
     static final String TAG = "AppAActivity";
     private static final int NUMBER_ELEMENTS = 1000;
-    private static final String TASKSWITCHING_INTENT = "com.android.pts.taskswitching.appa";
+    private static final String TASKSWITCHING_INTENT = "com.android.cts.taskswitching.appa";
     private Handler mHandler;
 
     private String[] mItems = new String[NUMBER_ELEMENTS];
diff --git a/suite/pts/deviceTests/ui/Android.mk b/suite/cts/hostTests/uihost/appB/Android.mk
similarity index 89%
copy from suite/pts/deviceTests/ui/Android.mk
copy to suite/cts/hostTests/uihost/appB/Android.mk
index d9b17aa..812637e 100644
--- a/suite/pts/deviceTests/ui/Android.mk
+++ b/suite/cts/hostTests/uihost/appB/Android.mk
@@ -22,11 +22,11 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := PtsDeviceUi
+LOCAL_PACKAGE_NAME := CtsDeviceTaskswitchingAppB
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/pts/hostTests/uihost/appB/AndroidManifest.xml b/suite/cts/hostTests/uihost/appB/AndroidManifest.xml
similarity index 95%
rename from suite/pts/hostTests/uihost/appB/AndroidManifest.xml
rename to suite/cts/hostTests/uihost/appB/AndroidManifest.xml
index d0c0bb7..b96afe5 100644
--- a/suite/pts/hostTests/uihost/appB/AndroidManifest.xml
+++ b/suite/cts/hostTests/uihost/appB/AndroidManifest.xml
@@ -15,7 +15,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.pts.taskswitching.appb">
+        package="com.android.cts.taskswitching.appb">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
 
diff --git a/suite/pts/hostTests/uihost/appB/src/com/android/pts/taskswitching/appb/AppBActivity.java b/suite/cts/hostTests/uihost/appB/src/com/android/cts/taskswitching/appb/AppBActivity.java
similarity index 92%
rename from suite/pts/hostTests/uihost/appB/src/com/android/pts/taskswitching/appb/AppBActivity.java
rename to suite/cts/hostTests/uihost/appB/src/com/android/cts/taskswitching/appb/AppBActivity.java
index 22ebdac..4df5e98 100644
--- a/suite/pts/hostTests/uihost/appB/src/com/android/pts/taskswitching/appb/AppBActivity.java
+++ b/suite/cts/hostTests/uihost/appB/src/com/android/cts/taskswitching/appb/AppBActivity.java
@@ -14,15 +14,13 @@
  * limitations under the License.
  */
 
-package com.android.pts.taskswitching.appb;
+package com.android.cts.taskswitching.appb;
 
 import android.app.ListActivity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
 import android.view.WindowManager;
-import android.widget.AbsListView;
-import android.widget.AbsListView.OnScrollListener;
 import android.widget.ArrayAdapter;
 import android.widget.ListView;
 
@@ -33,7 +31,7 @@
 public class AppBActivity extends ListActivity {
     static final String TAG = "AppBActivity";
     private static final int NUMBER_ELEMENTS = 1000;
-    private static final String TASKSWITCHING_INTENT = "com.android.pts.taskswitching.appb";
+    private static final String TASKSWITCHING_INTENT = "com.android.cts.taskswitching.appb";
     private Handler mHandler;
 
     private String[] mItems = new String[NUMBER_ELEMENTS];
diff --git a/suite/pts/deviceTests/ui/Android.mk b/suite/cts/hostTests/uihost/control/Android.mk
similarity index 88%
copy from suite/pts/deviceTests/ui/Android.mk
copy to suite/cts/hostTests/uihost/control/Android.mk
index d9b17aa..565e2c0 100644
--- a/suite/pts/deviceTests/ui/Android.mk
+++ b/suite/cts/hostTests/uihost/control/Android.mk
@@ -22,14 +22,12 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := PtsDeviceUi
+LOCAL_PACKAGE_NAME := CtsDeviceTaskswitchingControl
 
 LOCAL_SDK_VERSION := 16
 
 include $(BUILD_CTS_PACKAGE)
-
-
diff --git a/suite/pts/hostTests/uihost/control/AndroidManifest.xml b/suite/cts/hostTests/uihost/control/AndroidManifest.xml
similarity index 89%
rename from suite/pts/hostTests/uihost/control/AndroidManifest.xml
rename to suite/cts/hostTests/uihost/control/AndroidManifest.xml
index a7ab928..9901d50 100644
--- a/suite/pts/hostTests/uihost/control/AndroidManifest.xml
+++ b/suite/cts/hostTests/uihost/control/AndroidManifest.xml
@@ -15,7 +15,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.pts.taskswitching.control">
+        package="com.android.cts.taskswitching.control">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
 
@@ -23,6 +23,6 @@
         <uses-library android:name="android.test.runner" />
     </application>
     <instrumentation
-        android:targetPackage="com.android.pts.taskswitching.control"
+        android:targetPackage="com.android.cts.taskswitching.control"
         android:name="android.test.InstrumentationCtsTestRunner" />
 </manifest>
diff --git a/suite/pts/hostTests/uihost/control/src/com/android/pts/taskswitching/control/TaskswitchingDeviceTest.java b/suite/cts/hostTests/uihost/control/src/com/android/cts/taskswitching/control/TaskswitchingDeviceTest.java
similarity index 88%
rename from suite/pts/hostTests/uihost/control/src/com/android/pts/taskswitching/control/TaskswitchingDeviceTest.java
rename to suite/cts/hostTests/uihost/control/src/com/android/cts/taskswitching/control/TaskswitchingDeviceTest.java
index 5147eaf..bdb3132 100644
--- a/suite/pts/hostTests/uihost/control/src/com/android/pts/taskswitching/control/TaskswitchingDeviceTest.java
+++ b/suite/cts/hostTests/uihost/control/src/com/android/cts/taskswitching/control/TaskswitchingDeviceTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.pts.taskswitching.control;
+package com.android.cts.taskswitching.control;
 
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
@@ -25,12 +25,12 @@
 import android.content.Intent;
 import android.content.IntentFilter;
 
-import com.android.pts.util.MeasureRun;
-import com.android.pts.util.MeasureTime;
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
-import com.android.pts.util.PtsAndroidTestCase;
-import com.android.pts.util.Stat;
+import com.android.cts.util.MeasureRun;
+import com.android.cts.util.MeasureTime;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
+import android.cts.util.CtsAndroidTestCase;
+import com.android.cts.util.Stat;
 
 
 /**
@@ -38,9 +38,9 @@
  * measure time for switching.
  * Completion of launch is notified via broadcast.
  */
-public class TaskswitchingDeviceTest extends PtsAndroidTestCase {
-    private static final String PKG_A = "com.android.pts.taskswitching.appa";
-    private static final String PKG_B = "com.android.pts.taskswitching.appb";
+public class TaskswitchingDeviceTest extends CtsAndroidTestCase {
+    private static final String PKG_A = "com.android.cts.taskswitching.appa";
+    private static final String PKG_B = "com.android.cts.taskswitching.appb";
     private static final String ACTIVITY_A = "AppAActivity";
     private static final String ACTIVITY_B = "AppBActivity";
     private static final long TASK_SWITCHING_WAIT_TIME = 5;
diff --git a/suite/pts/hostTests/uihost/src/com/android/pts/uihost/InstallTimeTest.java b/suite/cts/hostTests/uihost/src/com/android/cts/uihost/InstallTimeTest.java
similarity index 89%
rename from suite/pts/hostTests/uihost/src/com/android/pts/uihost/InstallTimeTest.java
rename to suite/cts/hostTests/uihost/src/com/android/cts/uihost/InstallTimeTest.java
index b6f8f40..1ff31bf 100644
--- a/suite/pts/hostTests/uihost/src/com/android/pts/uihost/InstallTimeTest.java
+++ b/suite/cts/hostTests/uihost/src/com/android/cts/uihost/InstallTimeTest.java
@@ -14,18 +14,17 @@
  * limitations under the License.
  */
 
-package com.android.pts.uihost;
+package com.android.cts.uihost;
 
 import com.android.cts.tradefed.build.CtsBuildHelper;
 import com.android.ddmlib.Log;
-import com.android.pts.util.HostReportLog;
-import com.android.pts.util.MeasureRun;
-import com.android.pts.util.MeasureTime;
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
-import com.android.pts.util.ReportLog;
-import com.android.pts.util.Stat;
-import com.android.pts.util.Stat.StatResult;
+import com.android.cts.util.HostReportLog;
+import com.android.cts.util.MeasureRun;
+import com.android.cts.util.MeasureTime;
+import com.android.cts.util.ResultType;
+import com.android.cts.util.ResultUnit;
+import com.android.cts.util.ReportLog;
+import com.android.cts.util.Stat;
 import com.android.tradefed.build.IBuildInfo;
 import com.android.tradefed.device.ITestDevice;
 import com.android.tradefed.testtype.DeviceTestCase;
diff --git a/suite/pts/hostTests/uihost/src/com/android/pts/uihost/TaskSwitchingTest.java b/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java
similarity index 80%
rename from suite/pts/hostTests/uihost/src/com/android/pts/uihost/TaskSwitchingTest.java
rename to suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java
index f1eb80a..323d9a9 100644
--- a/suite/pts/hostTests/uihost/src/com/android/pts/uihost/TaskSwitchingTest.java
+++ b/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java
@@ -14,19 +14,19 @@
  * limitations under the License.
  */
 
-package com.android.pts.uihost;
+package com.android.cts.uihost;
 
 import android.cts.util.TimeoutReq;
 
 import com.android.cts.tradefed.build.CtsBuildHelper;
-import com.android.cts.tradefed.result.PtsReportUtil;
-import com.android.cts.tradefed.result.PtsHostStore;
+import com.android.cts.tradefed.result.CtsReportUtil;
+import com.android.cts.util.CtsHostStore;
+import com.android.cts.util.HostReportLog;
+import com.android.cts.util.ReportLog;
 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.pts.util.HostReportLog;
-import com.android.pts.util.ReportLog;
 import com.android.tradefed.build.IBuildInfo;
 import com.android.tradefed.device.DeviceNotAvailableException;
 import com.android.tradefed.device.ITestDevice;
@@ -44,24 +44,24 @@
 /**
  * Measure time to taskswitching between two Apps: A & B
  * Actual test is done in device, but this host side code installs all necessary APKs
- * and starts device test which is in PtsDeviceTaskswitchingControl.
+ * and starts device test which is in CtsDeviceTaskswitchingControl.
  */
 public class TaskSwitchingTest extends DeviceTestCase implements IBuildReceiver {
     private static final String TAG = "TaskSwitchingTest";
     private final static String CTS_RUNNER = "android.test.InstrumentationCtsTestRunner";
     private CtsBuildHelper mBuild;
     private ITestDevice mDevice;
-    private String mPtsReport = null;
+    private String mCtsReport = null;
 
     static final String[] PACKAGES = {
-        "com.android.pts.taskswitching.control",
-        "com.android.pts.taskswitching.appa",
-        "com.android.pts.taskswitching.appb"
+        "com.android.cts.taskswitching.control",
+        "com.android.cts.taskswitching.appa",
+        "com.android.cts.taskswitching.appb"
     };
     static final String[] APKS = {
-        "PtsDeviceTaskswitchingControl.apk",
-        "PtsDeviceTaskswitchingAppA.apk",
-        "PtsDeviceTaskswitchingAppB.apk"
+        "CtsDeviceTaskswitchingControl.apk",
+        "CtsDeviceTaskswitchingAppA.apk",
+        "CtsDeviceTaskswitchingAppB.apk"
     };
 
     @Override
@@ -101,9 +101,9 @@
         if (result.isRunFailure()) {
             fail(result.getRunFailureMessage());
         }
-        assertNotNull("no performance data", mPtsReport);
-        PtsHostStore.storePtsResult(mDevice.getSerialNumber(),
-                ReportLog.getClassMethodNames(), mPtsReport);
+        assertNotNull("no performance data", mCtsReport);
+        CtsHostStore.storeCtsResult(mDevice.getSerialNumber(),
+                ReportLog.getClassMethodNames(), mCtsReport);
 
     }
 
@@ -111,7 +111,7 @@
         @Override
         public void testEnded(TestIdentifier test, Map<String, String> testMetrics) {
             // necessary as testMetrics passed from CollectingTestListerner is empty
-            mPtsReport = PtsReportUtil.getPtsResultFromMetrics(testMetrics);
+            mCtsReport = CtsReportUtil.getCtsResultFromMetrics(testMetrics);
             super.testEnded(test, testMetrics);
         }
     }
diff --git a/suite/pts/utils/get_csv_report.py b/suite/cts/utils/get_csv_report.py
similarity index 98%
rename from suite/pts/utils/get_csv_report.py
rename to suite/cts/utils/get_csv_report.py
index b22665d..a1f5dd0 100755
--- a/suite/pts/utils/get_csv_report.py
+++ b/suite/cts/utils/get_csv_report.py
@@ -188,7 +188,7 @@
 
 def main(argv):
   if len(argv) < 3:
-    print "get_csv_report.py pts_report_dir output_file"
+    print "get_csv_report.py cts_report_dir output_file"
     sys.exit(1)
   reportPath = os.path.abspath(argv[1])
   outputCsv = os.path.abspath(argv[2])
diff --git a/suite/pts/utils/grapher.py b/suite/cts/utils/grapher.py
similarity index 95%
rename from suite/pts/utils/grapher.py
rename to suite/cts/utils/grapher.py
index 12976ec..d7de86e 100755
--- a/suite/pts/utils/grapher.py
+++ b/suite/cts/utils/grapher.py
@@ -35,14 +35,14 @@
 
 def main(argv):
   if len(argv) != 2:
-    print "grapher.py pts_report_dir"
+    print "grapher.py cts_report_dir"
     sys.exit(1)
 
   (_, tests) = psr.parseReports(os.path.abspath(argv[1]))
 
   # For each of the benchmarks
   for benchmark in tests:
-    if benchmark.startswith('com.android.pts.opengl.primitive'):
+    if benchmark.startswith('com.android.cts.opengl.primitive'):
       results = tests[benchmark]
       legend = []
       # Create a new figure
diff --git a/suite/pts/PtsBenchmarkingList.mk b/suite/pts/PtsBenchmarkingList.mk
deleted file mode 100644
index 6b97329..0000000
--- a/suite/pts/PtsBenchmarkingList.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# 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.
-#
-
-# package definitions for PTS
-
-# New packages should be added here
-PTS_TEST_PACKAGES := \
-    PtsDeviceFilePerf \
-    PtsDeviceUi \
-    PtsDeviceDram \
-    PtsDeviceSimpleCpu \
-    PtsDeviceBrowserBench \
-    PtsDeviceVideoPerf \
-    PtsDeviceOpenGl
-
-PTS_SUPPORT_PACKAGES := \
-    PtsDeviceTaskswitchingAppA \
-    PtsDeviceTaskswitchingAppB \
-    PtsDeviceTaskswitchingControl \
-    PtsDeviceUi \
-    PtsDeviceOpenGl
-
-PTS_HOST_CASES := \
-    PtsHostUi \
-    PtsHostJank
-
-pts_device_lib_tests := \
-    PtsDeviceJank
diff --git a/suite/pts/deviceTests/dram/Android.mk b/suite/pts/deviceTests/dram/Android.mk
deleted file mode 100644
index 47e5b52..0000000
--- a/suite/pts/deviceTests/dram/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := android.test.runner
-
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
-
-LOCAL_JNI_SHARED_LIBRARIES := libptsdram_jni
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := PtsDeviceDram
-
-LOCAL_SDK_VERSION := 16
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/reference/GLReferenceBenchmark.java b/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/reference/GLReferenceBenchmark.java
deleted file mode 100644
index 0f01759..0000000
--- a/suite/pts/deviceTests/opengl/src/com/android/pts/opengl/reference/GLReferenceBenchmark.java
+++ /dev/null
@@ -1,98 +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.pts.opengl.reference;
-
-import com.android.pts.opengl.GLActivityIntentKeys;
-import com.android.pts.util.PtsActivityInstrumentationTestCase2;
-import com.android.pts.util.ResultType;
-import com.android.pts.util.ResultUnit;
-
-import android.content.Context;
-import android.content.Intent;
-import android.cts.util.TimeoutReq;
-import android.view.Display;
-import android.view.WindowManager;
-
-import java.util.Arrays;
-
-/**
- * Runs the Reference OpenGL ES 2.0 Benchmark.
- */
-public class GLReferenceBenchmark extends PtsActivityInstrumentationTestCase2<GLReferenceActivity> {
-
-    private static final int NUM_FRAMES_PER_SCENE = 500;
-    private static final int NUM_SCENES = 2;
-    private static final int NUM_FRAMES = NUM_FRAMES_PER_SCENE * NUM_SCENES;
-    private static final int TIMEOUT = 1000000;
-
-    public GLReferenceBenchmark() {
-        super(GLReferenceActivity.class);
-    }
-
-    /**
-     * Runs the reference benchmark.
-     */
-    @TimeoutReq(minutes = 30)
-    public void testReferenceBenchmark() throws Exception {
-        Intent intent = new Intent();
-        intent.putExtra(GLActivityIntentKeys.INTENT_EXTRA_NUM_FRAMES, NUM_FRAMES);
-        intent.putExtra(GLActivityIntentKeys.INTENT_EXTRA_TIMEOUT, TIMEOUT);
-
-        GLReferenceActivity activity = null;
-        setActivityIntent(intent);
-        activity = getActivity();
-        if (activity != null) {
-            activity.waitForCompletion();
-            double totalTime = 0;
-            if (activity.mSuccess) {
-                double[] setUpTimes = activity.mSetUpTimes;
-                double[] updateTimes = activity.mUpdateTimes;
-                double[] renderTimes = activity.mRenderTimes;
-
-                // Calculate update and render average.
-                double updateSum = updateTimes[0];
-                double renderSum = renderTimes[0];
-                for (int i = 0; i < NUM_FRAMES - 1; i++) {
-                    updateSum += updateTimes[i + 1];
-                    renderSum += renderTimes[i + 1];
-                }
-                double updateAverage = updateSum / NUM_FRAMES;
-                double renderAverage = renderSum / NUM_FRAMES;
-
-                /* Held back for now
-                getReportLog().printArray(
-                        "Set Up Times", setUpTimes, ResultType.LOWER_BETTER, ResultUnit.MS);
-                getReportLog().printArray(
-                        "Update Times", updateTimes, ResultType.LOWER_BETTER, ResultUnit.MS);
-                getReportLog().printValue(
-                        "Update Time Average", updateAverage, ResultType.LOWER_BETTER,
-                        ResultUnit.MS);
-                getReportLog().printArray(
-                        "Render Times", renderTimes, ResultType.LOWER_BETTER, ResultUnit.MS);
-                getReportLog().printValue(
-                        "Render Time Average", renderAverage, ResultType.LOWER_BETTER,
-                        ResultUnit.MS);
-                totalTime = setUpTimes[0] + setUpTimes[1] + setUpTimes[2] +
-                        setUpTimes[3] + updateAverage + renderAverage;
-                 */
-            } else {
-                // TODO benchmark failed to run
-            }
-            /*
-            getReportLog().printSummary(
-                    "Total Time", totalTime, ResultType.LOWER_BETTER, ResultUnit.MS);
-             */
-        }
-    }
-}
diff --git a/suite/pts/deviceTests/ptsutil/Android.mk b/suite/pts/deviceTests/ptsutil/Android.mk
deleted file mode 100644
index d488442..0000000
--- a/suite/pts/deviceTests/ptsutil/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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.
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_MODULE := ptsutil
-
-LOCAL_STATIC_JAVA_LIBRARIES := ptscommonutil
-
-LOCAL_SDK_VERSION := 16
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/suite/pts/deviceTests/simplecpu/Android.mk b/suite/pts/deviceTests/simplecpu/Android.mk
deleted file mode 100644
index 69db471..0000000
--- a/suite/pts/deviceTests/simplecpu/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := android.test.runner
-
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
-
-LOCAL_JNI_SHARED_LIBRARIES := libptscpu_jni
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := PtsDeviceSimpleCpu
-
-LOCAL_SDK_VERSION := 16
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/suite/pts/deviceTests/simplecpu/AndroidManifest.xml b/suite/pts/deviceTests/simplecpu/AndroidManifest.xml
deleted file mode 100644
index 930bcbd..0000000
--- a/suite/pts/deviceTests/simplecpu/AndroidManifest.xml
+++ /dev/null
@@ -1,29 +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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.pts.simplecpu">
-
-    <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-
-    <application>
-        <uses-library android:name="android.test.runner" />
-    </application>
-    <instrumentation android:name="android.test.InstrumentationCtsTestRunner"
-            android:targetPackage="com.android.pts.simplecpu"
-            android:label="Vesy simple CPU benchmarking" />
-</manifest>
diff --git a/suite/pts/hostTests/uihost/appA/Android.mk b/suite/pts/hostTests/uihost/appA/Android.mk
deleted file mode 100644
index 4d31cb4..0000000
--- a/suite/pts/hostTests/uihost/appA/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner
-
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := PtsDeviceTaskswitchingAppA
-
-LOCAL_SDK_VERSION := 16
-
-include $(BUILD_CTS_PACKAGE)
-
-
diff --git a/suite/pts/hostTests/uihost/appB/Android.mk b/suite/pts/hostTests/uihost/appB/Android.mk
deleted file mode 100644
index bb1b5d7..0000000
--- a/suite/pts/hostTests/uihost/appB/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner
-
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := PtsDeviceTaskswitchingAppB
-
-LOCAL_SDK_VERSION := 16
-
-include $(BUILD_CTS_PACKAGE)
-
-
diff --git a/suite/pts/hostTests/uihost/control/Android.mk b/suite/pts/hostTests/uihost/control/Android.mk
deleted file mode 100644
index dec5ad1..0000000
--- a/suite/pts/hostTests/uihost/control/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# 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.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner
-
-LOCAL_STATIC_JAVA_LIBRARIES := ptsutil ctsutil ctstestrunner
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := PtsDeviceTaskswitchingControl
-
-LOCAL_SDK_VERSION := 16
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/suite/pts/lib/Android.mk b/suite/pts/lib/Android.mk
deleted file mode 100644
index c141484..0000000
--- a/suite/pts/lib/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# 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.
-#
-
-include $(call all-subdir-makefiles)
diff --git a/tests/Android.mk b/tests/Android.mk
index 4a87b07..a4cc38f 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -35,7 +35,7 @@
 
 LOCAL_PACKAGE_NAME := CtsTestStubs
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctsutil ctstestserver ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestserver ctstestrunner
 
 LOCAL_DEX_PREOPT := false
 
diff --git a/tests/assets/webkit/blank_tag.html b/tests/assets/webkit/blank_tag.html
new file mode 100644
index 0000000..628ff28
--- /dev/null
+++ b/tests/assets/webkit/blank_tag.html
@@ -0,0 +1,24 @@
+<!-- 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.
+-->
+
+<html>
+  <body>
+    <div>
+      <a href="test_hello_world.html" target="_blank" id="link">_blank anchor tag</a><br>
+    </div>
+    <iframe src="iframe_blank_tag.html"></iframe>
+  </body>
+</html>
+
diff --git a/tests/assets/webkit/iframe_blank_tag.html b/tests/assets/webkit/iframe_blank_tag.html
new file mode 100644
index 0000000..55ff410d
--- /dev/null
+++ b/tests/assets/webkit/iframe_blank_tag.html
@@ -0,0 +1,22 @@
+<!-- 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+  <script type='text/javascript'> window.open('test_hello_world.html'); </script>
+</head>
+</html>
+
diff --git a/tests/expectations/knownfailures.txt b/tests/expectations/knownfailures.txt
index 8d4433f..abe53f4 100644
--- a/tests/expectations/knownfailures.txt
+++ b/tests/expectations/knownfailures.txt
@@ -8,6 +8,15 @@
   bug: 8148617
 },
 {
+  name: "android.tests.sigtest.SimpleSignatureTest.testSignature",
+  bug: 11436500
+},
+{
+  name: "android.nativeopengl.EGLCleanupTest#TestCorrect",
+  name: "android.nativeopengl.EGLCreateContextTest#BadAttributeFails",
+  bug: 11652564
+},
+{
   name: "android.hardware.camera2.cts.ImageReaderTest",
   name: "android.hardware.camera2.cts.CameraCharacteristicsTest",
   name: "android.hardware.camera2.cts.CameraCaptureResultTest",
@@ -16,8 +25,8 @@
   bug: 11141002
 },
 {
-  name: "com.android.pts.opengl.primitive.GLPrimitiveBenchmark#testFullPipelineOffscreen",
-  name: "com.android.pts.opengl.primitive.GLPrimitiveBenchmark#testPixelOutputOffscreen",
+  name: "com.android.cts.opengl.primitive.GLPrimitiveBenchmark#testFullPipelineOffscreen",
+  name: "com.android.cts.opengl.primitive.GLPrimitiveBenchmark#testPixelOutputOffscreen",
   bug: 11238219
 },
 {
diff --git a/tests/plans/CTS-stable.xml b/tests/plans/CTS-stable.xml
index d8634fa..b9e7321 100644
--- a/tests/plans/CTS-stable.xml
+++ b/tests/plans/CTS-stable.xml
@@ -70,15 +70,16 @@
   <Entry uri="android.view"/>
   <Entry uri="android.webkit" exclude="android.webkit.cts.WebViewClientTest#testDoUpdateVisitedHistory;android.webkit.cts.WebViewClientTest#testLoadPage;android.webkit.cts.WebViewClientTest#testOnFormResubmission;android.webkit.cts.WebViewClientTest#testOnReceivedError;android.webkit.cts.WebViewClientTest#testOnReceivedHttpAuthRequest;android.webkit.cts.WebViewClientTest#testOnScaleChanged;android.webkit.cts.WebViewClientTest#testOnUnhandledKeyEvent;android.webkit.cts.WebViewTest#testSetInitialScale" />
   <Entry uri="android.widget" exclude="android.widget.cts.GridViewTest#testSetNumColumns" />
-  <Entry uri="com.android.pts.bootup"/>
-  <Entry uri="com.android.pts.browserbench"/>
-  <Entry uri="com.android.pts.dram"/>
-  <Entry uri="com.android.pts.filesystemperf"/>
-  <Entry uri="com.android.pts.jank"/>
-  <Entry uri="com.android.pts.opengl"/>
-  <Entry uri="com.android.pts.simplecpu"/>
-  <Entry uri="com.android.pts.ui"/>
-  <Entry uri="com.android.pts.uihost"/>
-  <Entry uri="com.android.pts.videoperf"/>
+  <Entry uri="com.android.cts.bootup"/>
+  <Entry uri="com.android.cts.browserbench"/>
+  <Entry uri="com.android.cts.dram"/>
+  <Entry uri="com.android.cts.filesystemperf"/>
+  <Entry uri="com.android.cts.jank.opengl"/>
+  <Entry uri="com.android.cts.jank.ui"/>
+  <Entry uri="com.android.cts.opengl"/>
+  <Entry uri="com.android.cts.simplecpu"/>
+  <Entry uri="com.android.cts.ui"/>
+  <Entry uri="com.android.cts.uihost"/>
+  <Entry uri="com.android.cts.videoperf"/>
   <Entry uri="zzz.android.monkey"/>
 </TestPlan>
diff --git a/tests/res/drawable/padding_0.9.png b/tests/res/drawable/padding_0.9.png
new file mode 100644
index 0000000..0127bf4
--- /dev/null
+++ b/tests/res/drawable/padding_0.9.png
Binary files differ
diff --git a/tests/res/layout/view_layout.xml b/tests/res/layout/view_layout.xml
index 4443ba8..cb444a5 100644
--- a/tests/res/layout/view_layout.xml
+++ b/tests/res/layout/view_layout.xml
@@ -50,4 +50,39 @@
         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="0dp"
+            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="0dp"
+            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="0dp"
+            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="0dp"
+            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" />
+
 </LinearLayout>
diff --git a/tests/src/android/os/cts/ReadElf.java b/tests/src/android/os/cts/ReadElf.java
index b43fd36..b4041d2 100644
--- a/tests/src/android/os/cts/ReadElf.java
+++ b/tests/src/android/os/cts/ReadElf.java
@@ -252,8 +252,11 @@
         mPath = file.getPath();
         mFile = new RandomAccessFile(file, "r");
 
-        readIdent();
+        if (mFile.length() < EI_NIDENT) {
+            throw new IllegalArgumentException("Too small to be an ELF file: " + file);
+        }
 
+        readIdent();
         readHeader();
     }
 
diff --git a/tests/systemAppTest/test/Android.mk b/tests/systemAppTest/test/Android.mk
index b24e3b3..3354886 100644
--- a/tests/systemAppTest/test/Android.mk
+++ b/tests/systemAppTest/test/Android.mk
@@ -26,7 +26,7 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner ctsutil
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner ctsdeviceutil
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/accessibility/Android.mk b/tests/tests/accessibility/Android.mk
index ee50eef..abd6f4b 100644
--- a/tests/tests/accessibility/Android.mk
+++ b/tests/tests/accessibility/Android.mk
@@ -26,7 +26,7 @@
 
 LOCAL_PACKAGE_NAME := CtsAccessibilityTestCases
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctsutil ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
 
 # This test runner sets up/cleans up the device before/after running the tests.
 LOCAL_CTS_TEST_RUNNER := com.android.cts.tradefed.testtype.AccessibilityTestRunner
diff --git a/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java b/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java
index 62e00e9..fdf3cac 100644
--- a/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java
+++ b/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java
@@ -17,7 +17,11 @@
 package android.app.cts;
 
 import android.app.WallpaperManager;
+import android.content.Context;
+import android.graphics.Point;
 import android.test.AndroidTestCase;
+import android.view.Display;
+import android.view.WindowManager;
 
 public class WallpaperManagerTest extends AndroidTestCase {
 
@@ -30,10 +34,32 @@
     }
 
     public void testSuggestDesiredDimensions() {
-        mWallpaperManager.suggestDesiredDimensions(320, 480);
-        int desiredMinimumWidth = mWallpaperManager.getDesiredMinimumWidth();
-        int desiredMinimumHeight = mWallpaperManager.getDesiredMinimumHeight();
-        assertEquals(320, desiredMinimumWidth);
-        assertEquals(480, desiredMinimumHeight);
+        Point min = getScreenSize();
+        int w = min.x * 3;
+        int h = min.y * 2;
+
+        mWallpaperManager.suggestDesiredDimensions(min.x / 2, min.y / 2);
+        assertEquals(min.x, mWallpaperManager.getDesiredMinimumWidth());
+        assertEquals(min.y, mWallpaperManager.getDesiredMinimumHeight());
+
+        mWallpaperManager.suggestDesiredDimensions(w, h);
+        assertEquals(w, mWallpaperManager.getDesiredMinimumWidth());
+        assertEquals(h, mWallpaperManager.getDesiredMinimumHeight());
+
+        mWallpaperManager.suggestDesiredDimensions(min.x / 2, h);
+        assertEquals(min.x, mWallpaperManager.getDesiredMinimumWidth());
+        assertEquals(h, mWallpaperManager.getDesiredMinimumHeight());
+
+        mWallpaperManager.suggestDesiredDimensions(w, min.y / 2);
+        assertEquals(w, mWallpaperManager.getDesiredMinimumWidth());
+        assertEquals(min.y, mWallpaperManager.getDesiredMinimumHeight());
+    }
+
+    private Point getScreenSize() {
+        WindowManager wm = (WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
+        Display d = wm.getDefaultDisplay();
+        Point p = new Point();
+        d.getRealSize(p);
+        return p;
     }
 }
diff --git a/tests/tests/hardware/src/android/hardware/cts/CameraTest.java b/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
index f877d8b..802fa5c 100644
--- a/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
+++ b/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
@@ -345,6 +345,17 @@
         mCamera.setPreviewCallback(null);
     }
 
+    /**
+     * Start preview and wait for the first preview callback, which indicates the
+     * preview becomes active.
+     */
+    private void blockingStartPreview() {
+        mCamera.setPreviewCallback(new SimplePreviewStreamCb(/*Id*/0));
+        mCamera.startPreview();
+        waitForPreviewDone();
+        mCamera.setPreviewCallback(null);
+    }
+
     /*
      * Test case 1: Take a picture and verify all the callback
      * functions are called properly.
@@ -1152,8 +1163,7 @@
             for (int i = 0; i < ratios.size() - 1; i++) {
                 assertTrue(ratios.get(i) < ratios.get(i + 1));
             }
-            mCamera.startPreview();
-            waitForPreviewDone();
+            blockingStartPreview();
 
             // Test each zoom step.
             for (int i = 0; i <= maxZoom; i++) {
@@ -1316,8 +1326,8 @@
 
     private void testFocusDistancesByCamera(int cameraId) throws Exception {
         initializeMessageLooper(cameraId);
-        mCamera.startPreview();
-        waitForPreviewDone();
+        blockingStartPreview();
+
         Parameters parameters = mCamera.getParameters();
 
         // Test every supported focus mode.
@@ -1901,8 +1911,7 @@
 
             // Make sure scene mode settings are consistent before preview and
             // after preview.
-            mCamera.startPreview();
-            waitForPreviewDone();
+            blockingStartPreview();
             for (int i = 0; i < supportedSceneModes.size(); i++) {
                 String sceneMode = supportedSceneModes.get(i);
                 parameters.setSceneMode(sceneMode);
diff --git a/tests/tests/hardware/src/android/hardware/cts/SensorTest.java b/tests/tests/hardware/src/android/hardware/cts/SensorTest.java
index 2be8d6b..24dd368 100644
--- a/tests/tests/hardware/src/android/hardware/cts/SensorTest.java
+++ b/tests/tests/hardware/src/android/hardware/cts/SensorTest.java
@@ -233,7 +233,7 @@
             handlerThread.start();
             Handler handler = new Handler(handlerThread.getLooper());
             boolean result = mSensorManager.registerListener(listener, sensor,
-                                            SensorManager.SENSOR_DELAY_FASTEST, 15000000,
+                                            SensorManager.SENSOR_DELAY_NORMAL, 15000000,
                                             handler);
             assertTrue(result);
             // Wait for 25 events and call flush.
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/SensorManagerTestVerifier.java b/tests/tests/hardware/src/android/hardware/cts/helpers/SensorManagerTestVerifier.java
index b46b06d..6e8b758 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/SensorManagerTestVerifier.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/SensorManagerTestVerifier.java
@@ -22,11 +22,10 @@
 import android.hardware.SensorEvent;
 import android.hardware.SensorEventListener2;
 import android.hardware.SensorManager;
-import android.hardware.TriggerEvent;
-import android.hardware.TriggerEventListener;
 
 import java.io.Closeable;
 
+import java.security.InvalidParameterException;
 import java.util.concurrent.ConcurrentLinkedDeque;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
@@ -40,7 +39,7 @@
  * An object can be used to quickly writing tests that focus on the scenario that needs to be
  * verified, and not in the implicit verifications that need to take place at any step.
  */
-public class SensorManagerTestVerifier implements Closeable {
+public class SensorManagerTestVerifier implements Closeable, SensorEventListener2 {
     private final int WAIT_TIMEOUT_IN_SECONDS = 30;
 
     private final SensorManager mSensorManager;
@@ -63,10 +62,23 @@
         mSamplingRateInUs = samplingRateInUs;
         mReportLatencyInUs = reportLatencyInUs;
 
-        mEventListener = new TestSensorListener(mSensorUnderTest);
+        mEventListener = new TestSensorListener(mSensorUnderTest, this);
     }
 
     /**
+     * Public listeners for Sensor events, these are available for subclasses to implement if they
+     * need access to the raw eventing model.
+     */
+    @Override
+    public void onAccuracyChanged(Sensor sensor, int accuracy) {}
+
+    @Override
+    public void onSensorChanged(SensorEvent event) {}
+
+    @Override
+    public void onFlushCompleted(Sensor sensor) {}
+
+    /**
      * Members
      */
     public void close() {
@@ -149,6 +161,7 @@
      */
     private class TestSensorListener implements SensorEventListener2 {
         private final Sensor mSensorUnderTest;
+        private final SensorEventListener2 mListener;
 
         private final ConcurrentLinkedDeque<TestSensorEvent> mSensorEventsList =
                 new ConcurrentLinkedDeque<TestSensorEvent>();
@@ -156,8 +169,15 @@
         private volatile CountDownLatch mEventLatch;
         private volatile CountDownLatch mFlushLatch = new CountDownLatch(1);
 
-        public TestSensorListener(Sensor sensor) {
+        public TestSensorListener(Sensor sensor, SensorEventListener2 listener) {
+            if(sensor == null) {
+                throw new InvalidParameterException("sensor cannot be null");
+            }
+            if(listener == null) {
+                throw new InvalidParameterException("listener cannot be null");
+            }
             mSensorUnderTest = sensor;
+            mListener = listener;
         }
 
         @Override
@@ -167,20 +187,22 @@
             if(mEventLatch != null) {
                 mEventLatch.countDown();
             }
+            mListener.onSensorChanged(event);
         }
 
         @Override
         public void onAccuracyChanged(Sensor sensor, int accuracy) {
+            mListener.onAccuracyChanged(sensor, accuracy);
         }
 
         @Override
         public void onFlushCompleted(Sensor sensor) {
             CountDownLatch latch = mFlushLatch;
             mFlushLatch = new CountDownLatch(1);
-
             if(latch != null) {
                 latch.countDown();
             }
+            mListener.onFlushCompleted(sensor);
         }
 
         public void waitForFlushComplete() throws InterruptedException {
@@ -194,10 +216,6 @@
             }
         }
 
-        public void waitForEvents(int eventCount) {
-            waitForEvents(eventCount, "");
-        }
-
         public void waitForEvents(int eventCount, String timeoutInfo) {
             mEventLatch = new CountDownLatch(eventCount);
             this.clearEvents();
@@ -219,10 +237,6 @@
             }
         }
 
-        public TestSensorEvent getLastEvent() {
-            return mSensorEventsList.getLast();
-        }
-
         public TestSensorEvent[] getAllEvents() {
             return mSensorEventsList.toArray(new TestSensorEvent[0]);
         }
@@ -231,10 +245,4 @@
             mSensorEventsList.clear();
         }
     }
-
-    public class TestTriggerListener extends TriggerEventListener {
-        @Override
-        public void onTrigger(TriggerEvent event) {
-        }
-    }
 }
diff --git a/tests/tests/media/Android.mk b/tests/tests/media/Android.mk
index f7639a4..4474b4a 100644
--- a/tests/tests/media/Android.mk
+++ b/tests/tests/media/Android.mk
@@ -22,7 +22,7 @@
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := ctsutil ctstestserver ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestserver ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/mediastress/Android.mk b/tests/tests/mediastress/Android.mk
index 7f75501..9f43597 100644
--- a/tests/tests/mediastress/Android.mk
+++ b/tests/tests/mediastress/Android.mk
@@ -22,7 +22,7 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner ctsutil
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner ctsdeviceutil
 
 LOCAL_JNI_SHARED_LIBRARIES := libctsmediastress_jni
 
diff --git a/tests/tests/nativeopengl/standalone/jni/tests/EGLCleanup_test.cpp b/tests/tests/nativeopengl/standalone/jni/tests/EGLCleanup_test.cpp
index 1227d42..db39798 100644
--- a/tests/tests/nativeopengl/standalone/jni/tests/EGLCleanup_test.cpp
+++ b/tests/tests/nativeopengl/standalone/jni/tests/EGLCleanup_test.cpp
@@ -328,9 +328,8 @@
     ASSERT_TRUE(result);
 }
 
-#if 0
-/* try it without un-currenting the surfaces and context */
-TEST_F(EGLCleanupTest, TestNoReleaseCurrent) {
+/* try it without un-currenting the surfaces and context
+TEST _F(EGLCleanupTest, TestNoReleaseCurrent) {
     ALOGI("Starting TEST_NO_RELEASE_CURRENT");
     ChainedThread cht(ChainedThread::TEST_NO_RELEASE_CURRENT);
 
@@ -342,6 +341,6 @@
     bool result = cht.getResult();
     ASSERT_TRUE(result);
 }
-#endif
+*/
 
 } // namespace android
diff --git a/tests/tests/net/Android.mk b/tests/tests/net/Android.mk
index a6543b3..7219fc4 100644
--- a/tests/tests/net/Android.mk
+++ b/tests/tests/net/Android.mk
@@ -30,7 +30,7 @@
 
 LOCAL_PACKAGE_NAME := CtsNetTestCases
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestserver ctsutil ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestserver ctsdeviceutil ctstestrunner
 
 # uncomment when dalvik.annotation.Test* are removed or part of SDK
 #LOCAL_SDK_VERSION := current
diff --git a/tests/tests/openglperf/Android.mk b/tests/tests/openglperf/Android.mk
index e10d1c7..55c39f2 100644
--- a/tests/tests/openglperf/Android.mk
+++ b/tests/tests/openglperf/Android.mk
@@ -23,7 +23,7 @@
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner ctsutil
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner ctsdeviceutil
 
 LOCAL_JNI_SHARED_LIBRARIES := libctsopenglperf_jni
 
diff --git a/tests/tests/permission/src/android/permission/cts/PackageManagerRequiringPermissionsTest.java b/tests/tests/permission/src/android/permission/cts/PackageManagerRequiringPermissionsTest.java
index 7ff67eb..6f4c11a 100644
--- a/tests/tests/permission/src/android/permission/cts/PackageManagerRequiringPermissionsTest.java
+++ b/tests/tests/permission/src/android/permission/cts/PackageManagerRequiringPermissionsTest.java
@@ -16,6 +16,8 @@
 
 package android.permission.cts;
 
+import android.content.Intent;
+import android.content.IntentFilter;
 import android.content.pm.PackageManager;
 import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.SmallTest;
@@ -59,7 +61,9 @@
      */
     public void testAddPreferredActivity() {
         try {
-            mPackageManager.addPreferredActivity(null, 0, null, null);
+            IntentFilter filter = new IntentFilter(Intent.ACTION_MAIN);
+            filter.addCategory(Intent.CATEGORY_HOME);
+            mPackageManager.addPreferredActivity(filter, 0, null, null);
             fail("PackageManager.addPreferredActivity did not throw" +
                     " SecurityException as expected");
         } catch (SecurityException e) {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/IntrinsicHistogram.java b/tests/tests/renderscript/src/android/renderscript/cts/IntrinsicHistogram.java
new file mode 100644
index 0000000..e970291
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/IntrinsicHistogram.java
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.renderscript.cts;
+
+import android.renderscript.*;
+import android.util.Log;
+
+public class IntrinsicHistogram extends IntrinsicBase {
+    private Allocation mAin;
+    private Allocation mAout;
+
+    private void createAllocations(int inVSize, int outVSize, int w, int h) {
+        Element e1;
+        Element e2;
+
+        switch (inVSize) {
+        case 4: e1 = Element.U8_4(mRS); break;
+        case 3: e1 = Element.U8_3(mRS); break;
+        case 2: e1 = Element.U8_2(mRS); break;
+        default: e1 = Element.U8(mRS); break;
+        }
+
+        switch (outVSize) {
+        case 4: e2 = Element.I32_4(mRS); break;
+        case 3: e2 = Element.I32_3(mRS); break;
+        case 2: e2 = Element.I32_2(mRS); break;
+        default: e2 = Element.I32(mRS); break;
+        }
+
+        Type.Builder tb = new Type.Builder(mRS, e1);
+        tb.setX(w).setY(h);
+
+        mAin = Allocation.createTyped(mRS, tb.create());
+        mAout = Allocation.createSized(mRS, e2, 256);
+    }
+
+    private void testNorm(int inVSize, int outVSize, int w, int h) {
+        createAllocations(inVSize, outVSize, w, h);
+
+        int invs2 = (inVSize != 3) ? inVSize : 4;
+        int outvs2 = (outVSize != 3) ? outVSize : 4;
+
+        byte i[] = new byte[w * h * invs2];
+        int res[] = new int[256 * outvs2];
+        int ref[] = new int[256 * outvs2];
+
+        java.util.Random r = new java.util.Random();
+        r.nextBytes(i);
+
+        for (int ct=0; ct < i.length; ct++) {
+            int t = i[ct];
+            if (t < 0) t = 256 + t;
+            if ((ct % invs2) < outVSize) {
+                ref[(t * outvs2) + (ct % invs2)] ++;
+            }
+        }
+
+        mAin.copyFrom(i);
+        ScriptIntrinsicHistogram hist =
+                ScriptIntrinsicHistogram.create(mRS, mAin.getType().getElement());
+        hist.setOutput(mAout);
+        hist.forEach(mAin);
+
+        mAin.copyFrom(i);
+        mAout.copyTo(res);
+        for (int ct=0; ct < res.length; ct++) {
+            assertTrue(res[ct] == ref[ct]);
+        }
+    }
+
+    public void test_norm_4_4() {
+        testNorm(4, 4, 101, 101);
+    }
+    public void test_norm_4_3() {
+        testNorm(4, 3, 101, 101);
+    }
+    public void test_norm_4_2() {
+        testNorm(4, 2, 101, 101);
+    }
+    public void test_norm_4_1() {
+        testNorm(4, 1, 101, 101);
+    }
+
+    public void test_norm_3_3() {
+        testNorm(3, 3, 101, 101);
+    }
+    public void test_norm_3_2() {
+        testNorm(3, 2, 101, 101);
+    }
+    public void test_norm_3_1() {
+        testNorm(3, 1, 101, 101);
+    }
+
+    public void test_norm_2_2() {
+        testNorm(2, 2, 101, 101);
+    }
+    public void test_norm_2_1() {
+        testNorm(2, 1, 101, 101);
+    }
+
+    public void test_norm_1_1() {
+        testNorm(1, 1, 101, 101);
+    }
+
+
+
+    private void testDot(int inVSize, int w, int h) {
+        createAllocations(inVSize, 1, w, h);
+
+        int invs2 = (inVSize != 3) ? inVSize : 4;
+
+        byte i[] = new byte[w * h * invs2];
+        int res[] = new int[256];
+        int ref[] = new int[256];
+
+        java.util.Random r = new java.util.Random();
+        r.nextBytes(i);
+
+        float dotVals[] = {0.2501f, 0.1251f, 0.06251f, 0.1251f};
+        int doti[] = new int[4];
+        for (int ct=0; ct < 4; ct++) {
+            doti[ct] = (int)((dotVals[ct] * 256.f) + 0.5f);
+        }
+
+        for (int ct=0; ct < i.length; ct+=invs2) {
+            int v = 0;
+            for (int c = 0; c < inVSize; c++) {
+                int t = i[ct + c];
+                if (t < 0) t = 256 + t;
+                v += doti[c] * t;
+            }
+            ref[(v + 0x7f) >> 8] ++;
+        }
+
+        mAin.copyFrom(i);
+        ScriptIntrinsicHistogram hist =
+                ScriptIntrinsicHistogram.create(mRS, mAin.getType().getElement());
+        hist.setOutput(mAout);
+        hist.setDotCoefficients(dotVals[0], dotVals[1], dotVals[2], dotVals[3]);
+        hist.forEach_Dot(mAin);
+
+        mAin.copyFrom(i);
+        mAout.copyTo(res);
+        for (int ct=0; ct < res.length; ct++) {
+            assertTrue(res[ct] == ref[ct]);
+        }
+    }
+
+    public void test_dot_1() {
+        testDot(1, 101, 101);
+    }
+    public void test_dot_2() {
+        testDot(2, 101, 101);
+    }
+    public void test_dot_3() {
+        testDot(3, 101, 101);
+    }
+    public void test_dot_4() {
+        testDot(4, 101, 101);
+    }
+
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/LeakTest.java b/tests/tests/renderscript/src/android/renderscript/cts/LeakTest.java
index ce9153b..b8c133a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/LeakTest.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/LeakTest.java
@@ -16,10 +16,12 @@
 
 package android.renderscript.cts;
 
+import android.app.ActivityManager;
 import android.renderscript.Allocation;
 import android.renderscript.Element;
 import android.renderscript.Type;
 import android.util.Log;
+import android.content.Context;
 
 /*
 // -target-api 11
@@ -44,10 +46,16 @@
  * bug, since it may have been compiled without .rs.dtor() support.
  */
 public class LeakTest extends RSBaseCompute {
-    private final static int x = 16 * 1024 * 1024;
     private static final String TAG = "LeakTest";
 
     public void testForLeaks() {
+        ActivityManager am = (ActivityManager) getContext().getSystemService("activity");
+        int mc = am.getLargeMemoryClass() / 32;
+        if (mc < 1) {
+            mc = 1;
+        }
+        int x = mc * 1024 * 1024;
+
         for (int i = 0; i < 100; i++) {
             Log.w(TAG, "Leak test iteration " + i);
             ScriptC_leak leak = new ScriptC_leak(mRS);
diff --git a/tests/tests/security/src/android/security/cts/CertificateTest.java b/tests/tests/security/src/android/security/cts/CertificateTest.java
index 844621b..e6e2a2b 100644
--- a/tests/tests/security/src/android/security/cts/CertificateTest.java
+++ b/tests/tests/security/src/android/security/cts/CertificateTest.java
@@ -28,6 +28,7 @@
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
@@ -35,11 +36,26 @@
 
 public class CertificateTest extends AndroidTestCase {
 
-    public void testCertificates() throws Exception {
-        Set<String> expectedCertificates = getExpectedCertificates();
+    public void testNoRemovedCertificates() throws Exception {
+        Set<String> expectedCertificates = new HashSet<String>(
+                Arrays.asList(CertificateData.CERTIFICATE_DATA));
         Set<String> deviceCertificates = getDeviceCertificates();
         expectedCertificates.removeAll(deviceCertificates);
-        assertTrue("Missing certificates: " + expectedCertificates, expectedCertificates.isEmpty());
+        assertEquals("Missing CA certificates", Collections.EMPTY_SET, expectedCertificates);
+    }
+
+    /**
+     * {@see OEMCertificateWhitelist#OEM_CERTIFICATE_WHITELIST} for more information on this test.
+     */
+    public void testNoAddedCertificates() throws Exception {
+        Set<String> oemCertificateWhitelist = new HashSet<String>(
+                Arrays.asList(OEMCertificateWhitelist.OEM_CERTIFICATE_WHITELIST));
+        Set<String> expectedCertificates = new HashSet<String>(
+                Arrays.asList(CertificateData.CERTIFICATE_DATA));
+        Set<String> deviceCertificates = getDeviceCertificates();
+        deviceCertificates.removeAll(expectedCertificates);
+        deviceCertificates.removeAll(oemCertificateWhitelist);
+        assertEquals("Unknown CA certificates", Collections.EMPTY_SET, deviceCertificates);
     }
 
     public void testBlockCertificates() throws Exception {
@@ -48,15 +64,7 @@
 
         Set<String> deviceCertificates = getDeviceCertificates();
         deviceCertificates.retainAll(blockCertificates);
-        assertTrue("Blocked certificates: " + deviceCertificates, deviceCertificates.isEmpty());
-    }
-
-    private Set<String> getExpectedCertificates() {
-        Set<String> certificates = new HashSet<String>();
-        for (int i = 0; i < CertificateData.CERTIFICATE_DATA.length; i++) {
-            certificates.add(CertificateData.CERTIFICATE_DATA[i]);
-        }
-        return certificates;
+        assertEquals("Blocked CA certificates", Collections.EMPTY_SET, deviceCertificates);
     }
 
     private Set<String> getDeviceCertificates() throws KeyStoreException,
diff --git a/tests/tests/security/src/android/security/cts/OEMCertificateWhitelist.java b/tests/tests/security/src/android/security/cts/OEMCertificateWhitelist.java
new file mode 100644
index 0000000..024c15f
--- /dev/null
+++ b/tests/tests/security/src/android/security/cts/OEMCertificateWhitelist.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.cts;
+
+class OEMCertificateWhitelist {
+
+  /**
+   * If you fail CTS as a result of adding a root CA that is not part
+   * of the Android root CA store, please see the following.
+   *
+   * First, this test exists because adding untrustworthy root CAs
+   * to a device has a very significant security impact. In the worst
+   * case, adding a rogue CA to this list can permanently compromise
+   * the confidentiality and integrity of your users' network traffic.
+   * Because of this risk, adding new certificates should be done
+   * sparingly and as a last resort- never as a first response or
+   * short term fix. Before attempting to modify this test, please
+   * consider whether adding a new certificate authority is in your
+   * users' best interests.
+   *
+   * Second, because the addition of a new root CA by an OEM can have
+   * such dire consequences for so many people it is imperative that
+   * it be done transparently and in the open. Any request to modify
+   * this list must have a corresponding change in AOSP authored by
+   * the OEM in question and including:
+   *
+   *     - the certificate in question.
+   *
+   *     - information about who created and maintains
+   *       both the certificate and the corresponding keypair.
+   *
+   *     - information about what the certificate is to be used
+   *       for and why the certificate is appropriate for inclusion.
+   *
+   *     - a statement from the OEM indicating that they have
+   *       sufficient confidence in the security of the key, the
+   *       security practices of the issuer, and the validity
+   *       of the intended use that they believe adding the
+   *       certificate is not detrimental to the security of the
+   *       user.
+   *
+   * Finally, please note that this is not the usual process for
+   * adding root CAs to Android. If you have a certificate that you
+   * believe should be present on all Android devices, please file a
+   * public bug at https://code.google.com/p/android/issues/entry or
+   * http://b.android.com to seek resolution.
+   *
+   * For questions, comments, and code reviews please contact
+   * security@android.com.
+   */
+  static final String[] OEM_CERTIFICATE_WHITELIST = {};
+
+}
diff --git a/tests/tests/view/src/android/view/cts/ViewTest.java b/tests/tests/view/src/android/view/cts/ViewTest.java
index 5913892..5e0dbe9 100644
--- a/tests/tests/view/src/android/view/cts/ViewTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewTest.java
@@ -2744,6 +2744,103 @@
         assertFalse(view.isPaddingOffsetRequired());
     }
 
+    @UiThreadTest
+    public void testPadding() {
+        MockView view = (MockView) mActivity.findViewById(R.id.mock_view_padding_full);
+        Drawable background = view.getBackground();
+        Rect backgroundPadding = new Rect();
+        background.getPadding(backgroundPadding);
+
+        // There is some background with a non null padding
+        assertNotNull(background);
+        assertTrue(backgroundPadding.left != 0);
+        assertTrue(backgroundPadding.right != 0);
+        assertTrue(backgroundPadding.top != 0);
+        assertTrue(backgroundPadding.bottom != 0);
+
+        // The XML defines android:padding="0dp" and that should be the resulting padding
+        assertEquals(0, view.getPaddingLeft());
+        assertEquals(0, view.getPaddingTop());
+        assertEquals(0, view.getPaddingRight());
+        assertEquals(0, view.getPaddingBottom());
+
+        // LEFT case
+        view = (MockView) mActivity.findViewById(R.id.mock_view_padding_left);
+        background = view.getBackground();
+        backgroundPadding = new Rect();
+        background.getPadding(backgroundPadding);
+
+        // There is some background with a non null padding
+        assertNotNull(background);
+        assertTrue(backgroundPadding.left != 0);
+        assertTrue(backgroundPadding.right != 0);
+        assertTrue(backgroundPadding.top != 0);
+        assertTrue(backgroundPadding.bottom != 0);
+
+        // The XML defines android:paddingLeft="0dp" and that should be the resulting padding
+        assertEquals(0, view.getPaddingLeft());
+        assertEquals(backgroundPadding.top, view.getPaddingTop());
+        assertEquals(backgroundPadding.right, view.getPaddingRight());
+        assertEquals(backgroundPadding.bottom, view.getPaddingBottom());
+
+        // RIGHT case
+        view = (MockView) mActivity.findViewById(R.id.mock_view_padding_right);
+        background = view.getBackground();
+        backgroundPadding = new Rect();
+        background.getPadding(backgroundPadding);
+
+        // There is some background with a non null padding
+        assertNotNull(background);
+        assertTrue(backgroundPadding.left != 0);
+        assertTrue(backgroundPadding.right != 0);
+        assertTrue(backgroundPadding.top != 0);
+        assertTrue(backgroundPadding.bottom != 0);
+
+        // The XML defines android:paddingRight="0dp" and that should be the resulting padding
+        assertEquals(backgroundPadding.left, view.getPaddingLeft());
+        assertEquals(backgroundPadding.top, view.getPaddingTop());
+        assertEquals(0, view.getPaddingRight());
+        assertEquals(backgroundPadding.bottom, view.getPaddingBottom());
+
+        // TOP case
+        view = (MockView) mActivity.findViewById(R.id.mock_view_padding_top);
+        background = view.getBackground();
+        backgroundPadding = new Rect();
+        background.getPadding(backgroundPadding);
+
+        // There is some background with a non null padding
+        assertNotNull(background);
+        assertTrue(backgroundPadding.left != 0);
+        assertTrue(backgroundPadding.right != 0);
+        assertTrue(backgroundPadding.top != 0);
+        assertTrue(backgroundPadding.bottom != 0);
+
+        // The XML defines android:paddingTop="0dp" and that should be the resulting padding
+        assertEquals(backgroundPadding.left, view.getPaddingLeft());
+        assertEquals(0, view.getPaddingTop());
+        assertEquals(backgroundPadding.right, view.getPaddingRight());
+        assertEquals(backgroundPadding.bottom, view.getPaddingBottom());
+
+        // BOTTOM case
+        view = (MockView) mActivity.findViewById(R.id.mock_view_padding_bottom);
+        background = view.getBackground();
+        backgroundPadding = new Rect();
+        background.getPadding(backgroundPadding);
+
+        // There is some background with a non null padding
+        assertNotNull(background);
+        assertTrue(backgroundPadding.left != 0);
+        assertTrue(backgroundPadding.right != 0);
+        assertTrue(backgroundPadding.top != 0);
+        assertTrue(backgroundPadding.bottom != 0);
+
+        // The XML defines android:paddingBottom="0dp" and that should be the resulting padding
+        assertEquals(backgroundPadding.left, view.getPaddingLeft());
+        assertEquals(backgroundPadding.top, view.getPaddingTop());
+        assertEquals(backgroundPadding.right, view.getPaddingRight());
+        assertEquals(0, view.getPaddingBottom());
+    }
+
     public void testGetWindowVisibleDisplayFrame() {
         Rect outRect = new Rect();
         View view = new View(mActivity);
diff --git a/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java b/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java
index 47ec475..11cc1a5 100644
--- a/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java
+++ b/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java
@@ -64,6 +64,7 @@
     public static final String IFRAME_ACCESS_URL = "webkit/test_iframeaccess.html";
     public static final String DATABASE_ACCESS_URL = "webkit/test_databaseaccess.html";
     public static final String STOP_LOADING_URL = "webkit/test_stop_loading.html";
+    public static final String BLANK_TAG_URL = "webkit/blank_tag.html";
 
     // Must match the title of the page at
     // android/frameworks/base/core/res/res/raw/loaderror.html
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
index efd3aef..f78c126 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
@@ -16,12 +16,16 @@
 
 package android.webkit.cts;
 
+import android.cts.util.EvaluateJsResultPollingCheck;
 import android.cts.util.PollingCheck;
 import android.graphics.Bitmap;
 import android.os.Message;
 import android.test.ActivityInstrumentationTestCase2;
 import android.view.KeyEvent;
+import android.view.ViewGroup;
 import android.webkit.HttpAuthHandler;
+import android.webkit.ValueCallback;
+import android.webkit.WebChromeClient;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
@@ -30,6 +34,7 @@
 
 public class WebViewClientTest extends ActivityInstrumentationTestCase2<WebViewStubActivity> {
     private static final long TEST_TIMEOUT = 5000;
+    private static final String TEST_URL = "http://foo.com/";
 
     private WebViewOnUiThread mOnUiThread;
     private CtsTestServer mWebServer;
@@ -60,9 +65,70 @@
         super.tearDown();
     }
 
+    // Verify that the shouldoverrideurlloading is false by default
+    public void testShouldOverrideUrlLoadingDefault() {
+        final WebViewClient webViewClient = new WebViewClient();
+        assertFalse(webViewClient.shouldOverrideUrlLoading(mOnUiThread.getWebView(), null));
+    }
+
+    // Verify shouldoverrideurlloading called on top level navigation
     public void testShouldOverrideUrlLoading() {
         final MockWebViewClient webViewClient = new MockWebViewClient();
-        assertFalse(webViewClient.shouldOverrideUrlLoading(mOnUiThread.getWebView(), null));
+        mOnUiThread.setWebViewClient(webViewClient);
+        mOnUiThread.getSettings().setJavaScriptEnabled(true);
+        String data = "<html><body>" +
+                "<a href=\"" + TEST_URL + "\" id=\"link\">new page</a>" +
+                "</body></html>";
+        mOnUiThread.loadDataAndWaitForCompletion(data, "text/html", null);
+        clickOnLinkUsingJs("link");
+        assertEquals(TEST_URL, webViewClient.getLastShouldOverrideUrl());
+    }
+
+    // Verify shouldoverrideurlloading called on webview called via onCreateWindow
+    public void testShouldOverrideUrlLoadingOnCreateWindow() throws Exception {
+        mWebServer = new CtsTestServer(getActivity());
+        // WebViewClient for main window
+        final MockWebViewClient mainWebViewClient = new MockWebViewClient();
+        // WebViewClient for child window
+        final MockWebViewClient childWebViewClient = new MockWebViewClient();
+        mOnUiThread.setWebViewClient(mainWebViewClient);
+        mOnUiThread.getSettings().setJavaScriptEnabled(true);
+        mOnUiThread.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
+        mOnUiThread.getSettings().setSupportMultipleWindows(true);
+        mOnUiThread.setWebChromeClient(new WebChromeClient() {
+            @Override
+            public boolean onCreateWindow(
+                WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
+                WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
+                WebView childWebView = new WebView(view.getContext());
+                childWebView.setWebViewClient(childWebViewClient);
+                childWebView.getSettings().setJavaScriptEnabled(true);
+                transport.setWebView(childWebView);
+                getActivity().addContentView(childWebView, new ViewGroup.LayoutParams(
+                            ViewGroup.LayoutParams.FILL_PARENT,
+                            ViewGroup.LayoutParams.WRAP_CONTENT));
+                resultMsg.sendToTarget();
+                return true;
+            }
+        });
+        mOnUiThread.loadUrl(mWebServer.getAssetUrl(TestHtmlConstants.BLANK_TAG_URL));
+
+        new PollingCheck(TEST_TIMEOUT) {
+            @Override
+            protected boolean check() {
+                return childWebViewClient.hasOnPageFinishedCalled();
+            }
+        }.run();
+        assertEquals(mWebServer.getAssetUrl(TestHtmlConstants.HELLO_WORLD_URL),
+                childWebViewClient.getLastShouldOverrideUrl());
+    }
+
+    private void clickOnLinkUsingJs(final String linkId) {
+        EvaluateJsResultPollingCheck jsResult = new EvaluateJsResultPollingCheck("null");
+        mOnUiThread.evaluateJavascript(
+                "document.getElementById('" + linkId + "').click();" +
+                "console.log('element with id [" + linkId + "] clicked');", jsResult);
+        jsResult.run();
     }
 
     public void testLoadPage() throws Exception {
@@ -221,6 +287,7 @@
         private boolean mOnReceivedHttpAuthRequestCalled;
         private boolean mOnUnhandledKeyEventCalled;
         private boolean mOnScaleChangedCalled;
+        private String mLastShouldOverrideUrl;
 
         public MockWebViewClient() {
             super(mOnUiThread);
@@ -262,6 +329,10 @@
             return mOnScaleChangedCalled;
         }
 
+        public String getLastShouldOverrideUrl() {
+            return mLastShouldOverrideUrl;
+        }
+
         @Override
         public void onPageStarted(WebView view, String url, Bitmap favicon) {
             super.onPageStarted(view, url, favicon);
@@ -320,5 +391,11 @@
             super.onScaleChanged(view, oldScale, newScale);
             mOnScaleChangedCalled = true;
         }
+
+        @Override
+        public boolean shouldOverrideUrlLoading(WebView view, String url) {
+            mLastShouldOverrideUrl = url;
+            return false;
+        }
     }
 }
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
index 7347ae0..1bec05c 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
@@ -18,6 +18,7 @@
 
 import android.content.Context;
 import android.content.res.AssetManager;
+import android.cts.util.EvaluateJsResultPollingCheck;
 import android.cts.util.PollingCheck;
 import android.graphics.Bitmap;
 import android.graphics.Bitmap.Config;
@@ -2259,26 +2260,6 @@
         }
     }
 
-    private static class EvaluateJsResultPollingCheck  extends PollingCheck
-            implements ValueCallback<String> {
-        private String mActualResult;
-        private String mExpectedResult;
-
-        public EvaluateJsResultPollingCheck(String expected) {
-            mExpectedResult = expected;
-        }
-
-        @Override
-        public synchronized boolean check() {
-            return mExpectedResult.equals(mActualResult);
-        }
-
-        @Override
-        public synchronized void onReceiveValue(String result) {
-            mActualResult = result;
-        }
-    }
-
     final class ScaleChangedWebViewClient extends WaitForLoadedClient {
         private boolean mOnScaleChangedCalled = false;
         public ScaleChangedWebViewClient() {
diff --git a/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java b/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java
index 8c3cc8f..7e44e49 100644
--- a/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java
+++ b/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java
@@ -51,6 +51,9 @@
 
     private static final String SCREEN_SHOT_FILE_PATH_NAME = "/data/local/tmp/ctsScreenShot";
 
+    // Should match the value defined in UiObject
+    private static final int FINGER_TOUCH_HALF_WIDTH = 20;
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -885,10 +888,10 @@
                 withinMarginOfError(0.1f, screenRect.right, p2s.x));
 
         assertTrue("Touch-up X coordinate for pointer 1 is invalid",
-                withinMarginOfError(0.1f, screenRect.centerX(), p1e.x));
+                withinMarginOfError(0.1f, screenRect.centerX() - FINGER_TOUCH_HALF_WIDTH, p1e.x));
 
         assertTrue("Touch-up X coordinate for pointer 2 is invalid",
-                withinMarginOfError(0.1f, screenRect.centerX(), p2e.x));
+                withinMarginOfError(0.1f, screenRect.centerX() + FINGER_TOUCH_HALF_WIDTH, p2e.x));
     }
 
     /**
diff --git a/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java b/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java
index 621c8cd..436b609 100644
--- a/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java
+++ b/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java
@@ -69,9 +69,9 @@
         sourcePath.add("./development/tools/hosttestlib/src");
         sourcePath.add("./libcore/dalvik/src/main/java");
         sourcePath.add("./cts/tests/src");
-        // PTS adds PtsAndroidTestCase
-        sourcePath.add("./cts/suite/pts/deviceTests/ptsutil/src");
-        sourcePath.add("./cts/libs/util/src");
+        sourcePath.add("./cts/libs/commonutil/src");
+        sourcePath.add("./cts/libs/deviceutil//src");
+        sourcePath.add("./cts/libs/hostutil/src");
         sourcePath.add("./frameworks/testing/uiautomator/library/testrunner-src");
         sourcePath.add("./frameworks/testing/uiautomator_test_libraries/src");
         sourcePath.add(sourceDir.toString());
diff --git a/tools/tradefed-host/Android.mk b/tools/tradefed-host/Android.mk
index 4a9e2fc..3f5fc74 100644
--- a/tools/tradefed-host/Android.mk
+++ b/tools/tradefed-host/Android.mk
@@ -16,18 +16,16 @@
 
 include $(CLEAR_VARS)
 
-# suite/pts/hostTests/ptshostutil is treated specially
-# as it cannot be put into ptscommonutilhost due to dependency on cts-tradefed
-LOCAL_SRC_FILES := \
-	$(call all-java-files-under, src) \
-	$(call all-java-files-under, ../../suite/pts/hostTests/ptshostutil/src)
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_JAVA_RESOURCE_DIRS := res
 
 LOCAL_MODULE := cts-tradefed
 LOCAL_MODULE_TAGS := optional
 LOCAL_JAVA_LIBRARIES := ddmlib-prebuilt tradefed-prebuilt hosttestlib
-LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceinfolib ptscommonutilhost
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceinfolib ctshostutil
+
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
 include $(BUILD_HOST_JAVA_LIBRARY)
 
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java b/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
index 59b9d3c..59d966e 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/build/CtsBuildProvider.java
@@ -31,7 +31,7 @@
     @Option(name="cts-install-path", description="the path to the cts installation to use")
     private String mCtsRootDirPath = System.getProperty("CTS_ROOT");
 
-    public static final String CTS_BUILD_VERSION = "4.4_r0";
+    public static final String CTS_BUILD_VERSION = "4.4_r1";
 
     /**
      * {@inheritDoc}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/result/PtsReportUtil.java b/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsReportUtil.java
similarity index 67%
rename from tools/tradefed-host/src/com/android/cts/tradefed/result/PtsReportUtil.java
rename to tools/tradefed-host/src/com/android/cts/tradefed/result/CtsReportUtil.java
index 2e3dab1..97f607e 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/result/PtsReportUtil.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsReportUtil.java
@@ -15,26 +15,22 @@
  */
 package com.android.cts.tradefed.result;
 
-import com.android.ddmlib.testrunner.TestIdentifier;
-import com.android.tradefed.device.ITestDevice;
-
 import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
 
 /**
- * Static utility class for handling Pts Results.
+ * Static utility class for handling Cts Results.
  */
-public class PtsReportUtil {
-    private static final String PTS_RESULT_KEY = "PTS_RESULT";
+public class CtsReportUtil {
+    private static final String CTS_RESULT_KEY = "CTS_RESULT";
 
     /**
-     * Utility method to extract PTS result from test metrics
+     * Utility method to extract CTS result from test metrics
      * @param testMetrics
      * @return result or null if not found
      */
-    public static String getPtsResultFromMetrics(Map<String, String> testMetrics) {
+    public static String getCtsResultFromMetrics(Map<String, String> testMetrics) {
         for (Map.Entry<String, String> entry: testMetrics.entrySet()) {
-            if (PTS_RESULT_KEY.equals(entry.getKey())) {
+            if (CTS_RESULT_KEY.equals(entry.getKey())) {
                 return entry.getValue();
             }
         }
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 71c093b..58b746d 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
@@ -19,6 +19,7 @@
 import com.android.cts.tradefed.build.CtsBuildHelper;
 import com.android.cts.tradefed.device.DeviceInfoCollector;
 import com.android.cts.tradefed.testtype.CtsTest;
+import com.android.cts.util.CtsHostStore;
 import com.android.ddmlib.Log;
 import com.android.ddmlib.Log.LogLevel;
 import com.android.ddmlib.testrunner.TestIdentifier;
@@ -26,7 +27,6 @@
 import com.android.tradefed.build.IFolderBuildInfo;
 import com.android.tradefed.config.Option;
 import com.android.tradefed.log.LogUtil.CLog;
-import com.android.tradefed.result.ILogFileSaver;
 import com.android.tradefed.result.ITestInvocationListener;
 import com.android.tradefed.result.InputStreamSource;
 import com.android.tradefed.result.LogDataType;
@@ -99,7 +99,7 @@
     private File mLogDir;
     private String mSuiteName;
 
-    private static final Pattern mPtsLogPattern = Pattern.compile("(.*)\\+\\+\\+\\+(.*)");
+    private static final Pattern mCtsLogPattern = Pattern.compile("(.*)\\+\\+\\+\\+(.*)");
 
     public void setReportDir(File reportDir) {
         mReportDir = reportDir;
@@ -212,11 +212,11 @@
     }
 
     /**
-     * Return the {@link ILogFileSaver} to use.
+     * Return the {@link LogFileSaver} to use.
      * <p/>
      * Exposed for unit testing.
      */
-    ILogFileSaver getLogFileSaver() {
+    LogFileSaver getLogFileSaver() {
         return new LogFileSaver(mLogDir);
     }
 
@@ -264,7 +264,7 @@
      */
     @Override
     public void testEnded(TestIdentifier test, Map<String, String> testMetrics) {
-        collectPtsResults(test, testMetrics);
+        collectCtsResults(test, testMetrics);
         mCurrentPkgResult.reportTestEnded(test);
         Test result = mCurrentPkgResult.findTest(test);
         String stack = result.getStackTrace() == null ? "" : "\n" + result.getStackTrace();
@@ -273,26 +273,26 @@
     }
 
     /**
-     * Collect Pts results for both device and host tests to the package result.
+     * Collect Cts results for both device and host tests to the package result.
      * @param test test ran
      * @param testMetrics test metrics which can contain performance result for device tests
      */
-    private void collectPtsResults(TestIdentifier test, Map<String, String> testMetrics) {
+    private void collectCtsResults(TestIdentifier test, Map<String, String> testMetrics) {
         // device test can have performance results in testMetrics
-        String perfResult = PtsReportUtil.getPtsResultFromMetrics(testMetrics);
-        // host test should be checked in PtsHostStore.
+        String perfResult = CtsReportUtil.getCtsResultFromMetrics(testMetrics);
+        // host test should be checked in CtsHostStore.
         if (perfResult == null) {
-            perfResult = PtsHostStore.removePtsResult(mDeviceSerial, test);
+            perfResult = CtsHostStore.removeCtsResult(mDeviceSerial, test.toString());
         }
         if (perfResult != null) {
-            // PTS result is passed in Summary++++Details format.
+            // CTS result is passed in Summary++++Details format.
             // Extract Summary and Details, and pass them.
-            Matcher m = mPtsLogPattern.matcher(perfResult);
+            Matcher m = mCtsLogPattern.matcher(perfResult);
             if (m.find()) {
                 mCurrentPkgResult.reportPerformanceResult(test, CtsTestStatus.PASS, m.group(1),
                         m.group(2));
             } else {
-                logResult("PTS Result unrecognizable:" + perfResult);
+                logResult("CTS Result unrecognizable:" + perfResult);
             }
         }
     }
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 72e2e27..8c5b8d1 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
@@ -44,7 +44,7 @@
     private static final String SCORETYPE_ATTR = "scoreType";
     private static final String UNIT_ATTR = "unit";
     private static final String SOURCE_ATTR = "source";
-    // separators for the message from PTS
+    // separators for the message
     private static final String LOG_SEPARATOR = "\\+\\+\\+";
     private static final String LOG_ELEM_SEPARATOR = "\\|";
 
@@ -54,7 +54,7 @@
     private String mEndTime;
     private String mMessage;
     private String mStackTrace;
-    // summary and details passed from pts
+    // summary and details passed from cts
     private String mSummary;
     private String mDetails;
 
@@ -184,7 +184,7 @@
                 serializer.endTag(CtsXmlResultReporter.ns, SUMMARY_TAG);
                 // add details only if summary is present
                 // <Details>
-                //   <ValueArray source=”com.android.pts.dram.BandwidthTest#doRunMemcpy:98”
+                //   <ValueArray source=”com.android.cts.dram.BandwidthTest#doRunMemcpy:98”
                 //                    message=”measure1” unit="ms" scoretype="higherBetter">
                 //     <Value>0.0</Value>
                 //     <Value>0.1</Value>
diff --git a/tools/utils/buildCts.py b/tools/utils/buildCts.py
index 4721234..63c8abe 100755
--- a/tools/utils/buildCts.py
+++ b/tools/utils/buildCts.py
@@ -105,19 +105,12 @@
     # sort the list to give the same sequence based on name
     packages.sort()
 
-    ptsPattern = r'com\.android\.pts\..*'
-    plan = tools.TestPlan(packages)
-    plan.Exclude('.*')
-    plan.Include(ptsPattern)
-    self.__WritePlan(plan, 'PTS')
-
     plan = tools.TestPlan(packages)
     plan.Exclude('android\.performance.*')
     self.__WritePlan(plan, 'CTS')
     self.__WritePlan(plan, 'CTS-TF')
 
     plan = tools.TestPlan(packages)
-    plan.Exclude(ptsPattern)
     plan.Exclude('android\.performance.*')
     plan.Exclude('android\.media\.cts\.StreamingMediaPlayerTest.*')
     # Test plan to not include media streaming tests
@@ -160,8 +153,8 @@
     plan.Include('android\.renderscript')
     plan.Include('android\.telephony')
     plan.Include('android\.nativemedia.*')
-    plan.Include('com\.android\.pts\..*')
-    plan.Exclude('com\.android\.pts\.bootup')
+    plan.Include('com\.android\.cts\..*')#TODO(stuartscott): Should PDK have all these?
+    #TODO(stuartscott): Maybe move away from com.android.* to android.* - less typing
     self.__WritePlan(plan, 'PDK')
 
     #dirty hack to copy over pre-populated CTS plans - flaky vs stable - to streamline autoCTS