Cherry pick cts change to fix build

Adjust cts tests to ddms testrunner IOException API change.

Change-Id: I9f4c1b12608a3570ff45b90c53004cdbbc0b8b27
diff --git a/tests/appsecurity-tests/src/com/android/cts/appsecurity/AppSecurityTests.java b/tests/appsecurity-tests/src/com/android/cts/appsecurity/AppSecurityTests.java
index 9862b8de..fe5fb2d8 100644
--- a/tests/appsecurity-tests/src/com/android/cts/appsecurity/AppSecurityTests.java
+++ b/tests/appsecurity-tests/src/com/android/cts/appsecurity/AppSecurityTests.java
@@ -228,8 +228,9 @@
      *
      * @param pkgName Android application package for tests
      * @return <code>true</code> if all tests passed.
+     * @throws IOException if connection to device was lost
      */
-    private boolean runDeviceTests(String pkgName) {
+    private boolean runDeviceTests(String pkgName) throws IOException {
         CollectingTestRunListener listener = doRunTests(pkgName);
         return listener.didAllTestsPass();
     }
@@ -238,8 +239,9 @@
      * Helper method to run tests and return the listener that collected the results.
      * @param pkgName Android application package for tests
      * @return the {@link CollectingTestRunListener}
+     * @throws IOException if connection to device was lost
      */
-    private CollectingTestRunListener doRunTests(String pkgName) {
+    private CollectingTestRunListener doRunTests(String pkgName) throws IOException {
         RemoteAndroidTestRunner testRunner = new RemoteAndroidTestRunner(pkgName, getDevice());
         CollectingTestRunListener listener = new CollectingTestRunListener();
         testRunner.run(listener);
@@ -251,8 +253,9 @@
      *
      * @param pkgName Android application package for tests
      * @return the test run error message or <code>null</code> if test run completed.
+     * @throws IOException if connection to device was lost
      */
-    private String runDeviceTestsWithRunResult(String pkgName) {
+    private String runDeviceTestsWithRunResult(String pkgName) throws IOException {
         CollectingTestRunListener listener = doRunTests(pkgName);
         return listener.getTestRunErrorMessage();
     }