Merge "Verify preinstalled apps don't have debuggable set." into froyo
diff --git a/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java b/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java
index 8540a7c..f5f2286 100644
--- a/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java
+++ b/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java
@@ -345,6 +345,7 @@
     public void testReportFullscreenMode() {
         InputMethodManager imManager = (InputMethodManager) mInstrumentation.getTargetContext()
                 .getSystemService(Context.INPUT_METHOD_SERVICE);
+        mConnection.reportFullscreenMode(false);
         assertFalse(imManager.isFullscreenMode());
         mConnection.reportFullscreenMode(true);
         assertTrue(imManager.isFullscreenMode());
diff --git a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
index d92f446..5b7940f 100755
--- a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
+++ b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
@@ -164,9 +164,6 @@
         connection.reportFullscreenMode(true);
         assertTrue(imManager.isFullscreenMode());
 
-        // Currently can't set this status, always false.
-        assertFalse(imManager.isWatchingCursor(view));
-
         IBinder token = view.getWindowToken();
 
         // Show and hide input method.
diff --git a/tools/host/src/com/android/cts/DeviceManager.java b/tools/host/src/com/android/cts/DeviceManager.java
index 528036e..c164ac1 100644
--- a/tools/host/src/com/android/cts/DeviceManager.java
+++ b/tools/host/src/com/android/cts/DeviceManager.java
@@ -218,7 +218,7 @@
                     try {
                         Thread.sleep(100);
                     } catch (InterruptedException e) {
-                        Log.e("", e);
+                        Log.d("polling for device sync service interrupted");
                     }
                 }
                 CUIOutputStream.println("Device(" + mDevice + ") connected");
diff --git a/tools/host/src/com/android/cts/Log.java b/tools/host/src/com/android/cts/Log.java
index 9ee99c8..4c6e2c8 100644
--- a/tools/host/src/com/android/cts/Log.java
+++ b/tools/host/src/com/android/cts/Log.java
@@ -73,7 +73,7 @@
         if (!HostConfig.DEBUG) {
             CUIOutputStream.println(ERROR_PREFIX + msg);
             if (e != null) {
-                CUIOutputStream.println(e.getMessage());
+                CUIOutputStream.println(e.toString());
             }
             return;
         }
diff --git a/tools/host/src/com/android/cts/TestDevice.java b/tools/host/src/com/android/cts/TestDevice.java
index 9c82af1..49e32d4 100644
--- a/tools/host/src/com/android/cts/TestDevice.java
+++ b/tools/host/src/com/android/cts/TestDevice.java
@@ -1673,7 +1673,8 @@
                 try {
                     mDevice.executeShellCommand(cmd, receiver);
                 } catch (IOException e) {
-                    Log.e("", e);
+                    Log.e(String.format("Failed to execute shell command %s on device %s", cmd,
+                            mDevice.getSerialNumber()), e);
                 }
             }
         }.start();
diff --git a/tools/host/src/com/android/cts/TestPackage.java b/tools/host/src/com/android/cts/TestPackage.java
index db1e449..f98628b 100644
--- a/tools/host/src/com/android/cts/TestPackage.java
+++ b/tools/host/src/com/android/cts/TestPackage.java
@@ -641,7 +641,7 @@
             CUIOutputStream.println("Test stopped.");
             mTestThread.join();
         } catch (InterruptedException e) {
-            Log.e("", e);
+            Log.d("test thread interrupted");
         }
     }
 
@@ -753,14 +753,14 @@
                 try {
                     wait();
                 } catch (InterruptedException e) {
-                    Log.e("", e);
+                    Log.d("interrupted while waiting for package action complete");
                 }
             }
         }
         try {
             Thread.sleep(HostConfig.Ints.postInstallWaitMs.value());
         } catch (InterruptedException e) {
-            Log.e("", e);
+            Log.d("sleeping after package action complete interrupted");
         }
         Log.d("Leave waitPackageActionComplete()");
     }
diff --git a/tools/host/test/com/android/cts/TestSessionBuilderTests.java b/tools/host/test/com/android/cts/TestSessionBuilderTests.java
index 26eb561..d0f5230 100644
--- a/tools/host/test/com/android/cts/TestSessionBuilderTests.java
+++ b/tools/host/test/com/android/cts/TestSessionBuilderTests.java
@@ -34,6 +34,8 @@
 import org.w3c.dom.Node;
 import org.xml.sax.SAXException;
 
+import android.annotation.cts.Profile;
+
 import com.android.cts.TestDevice.DeviceParameterCollector;
 
 /**
@@ -107,7 +109,7 @@
         createTestPackage(descriptionConfigStr, mTestPackageBinaryName);
         HostConfig.getInstance().loadTestPackages();
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -288,7 +290,7 @@
         createTestPackage(descriptionConfigStr, mTestPackageBinaryName);
         HostConfig.getInstance().loadTestPackages();
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -369,7 +371,7 @@
         createTestPackage(descriptionConfigStr, mTestPackageBinaryName);
         HostConfig.getInstance().loadTestPackages();
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -474,7 +476,7 @@
         createTestPackage(descriptionConfigStr, mTestPackageBinaryName);
         HostConfig.getInstance().loadTestPackages();
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -558,7 +560,7 @@
         String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
         TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -640,7 +642,7 @@
         String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
         TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -706,7 +708,7 @@
         String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
         TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -787,7 +789,7 @@
         String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
         TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -848,7 +850,7 @@
         String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
         TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -923,7 +925,7 @@
         String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
         TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -996,7 +998,7 @@
         String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
         TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -1091,7 +1093,7 @@
         String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
         TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -1172,7 +1174,7 @@
         createTestPackage(descriptionConfigStr, mTestPackageBinaryName);
         HostConfig.getInstance().loadTestPackages();
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(2, ts.getNumOfRequiredDevices());
 
         TestSessionLog tsl = ts.getSessionLog();
@@ -1201,7 +1203,7 @@
      * Test serializing the test plan.
      */
     public void testSerialize() throws Exception {
-        final String srcStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+        final String srcStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
             + "<TestPlan version=\"1.0\">\n"
             + "<PlanSettings/>\n"
             + "<Entry uri=\"com.google.android.cts.CtsTest\"/>\n"
@@ -1284,7 +1286,7 @@
         String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
         TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         assertEquals(1, ts.getNumOfRequiredDevices());
 
         ts.getSessionLog().setStartTime(System.currentTimeMillis());
@@ -1423,7 +1425,7 @@
         String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
         TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
 
-        TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+        TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
         ts.getSessionLog().setStartTime(System.currentTimeMillis());
         TestSessionLog tsl = ts.getSessionLog();
         TestPackage testPackage = tsl.getTestPackages().iterator().next();
diff --git a/tools/host/test/com/android/cts/TestSessionLogBuilderTests.java b/tools/host/test/com/android/cts/TestSessionLogBuilderTests.java
index 7deb9af..a2b5274 100644
--- a/tools/host/test/com/android/cts/TestSessionLogBuilderTests.java
+++ b/tools/host/test/com/android/cts/TestSessionLogBuilderTests.java
@@ -40,7 +40,7 @@
             "<?xml-stylesheet type=\"text/xsl\"  href=\"cts_result.xsl\"?>\n" +
             "\n" +
             "<TestResult endtime=\"Wed Apr 29 10:36:47 CST 2009\" " +
-            "starttime=\"Wed Apr 29 10:36:30 CST 2009\" testPlan=\"location\" version=\"1.0\">\n" +
+            "starttime=\"Wed Apr 29 10:36:30 CST 2009\" testPlan=\"location\" version=\"1.0\" profile=\"ALL\">\n" +
             "  <DeviceInfo>\n" +
             "    <Screen resolution=\"480x320\"/>\n" +
             "    <PhoneSubInfo subscriberId=\"15555218135\"/>\n" +