Fix UI for jobscheduler CTS on clockwork

BUG: 18178279
BUG: 18178236
Change-Id: I78040556a9796e498d0f3ba157512e50c1ff7f73
diff --git a/apps/CtsVerifier/res/layout/js_charging.xml b/apps/CtsVerifier/res/layout/js_charging.xml
index 4c0e552..5552111 100644
--- a/apps/CtsVerifier/res/layout/js_charging.xml
+++ b/apps/CtsVerifier/res/layout/js_charging.xml
@@ -1,67 +1,72 @@
 <?xml version="1.0" encoding="utf-8"?>
 
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical" android:layout_width="match_parent"
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
     android:layout_height="match_parent">
-    <TextView
+    <LinearLayout
+        android:orientation="vertical"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/js_test_description"
-        android:layout_margin="@dimen/js_padding"/>
-    <TextView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_margin="@dimen/js_padding"
-        android:text="@string/js_charging_description_1"
-        android:textStyle="bold"/>
-    <Button
-        android:id="@+id/js_charging_start_test_button"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center"
-        android:text="@string/js_start_test_text"
-        android:onClick="startTest"
-        android:enabled="false"/>
+        android:layout_height="match_parent">
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/js_test_description"
+            android:layout_margin="@dimen/js_padding"/>
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_margin="@dimen/js_padding"
+            android:text="@string/js_charging_description_1"
+            android:textStyle="bold"/>
+        <Button
+            android:id="@+id/js_charging_start_test_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:text="@string/js_start_test_text"
+            android:onClick="startTest"
+            android:enabled="false"/>
 
-    <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/js_padding"
-        android:layout_marginBottom="@dimen/js_padding">
-        <ImageView
-            android:id="@+id/charging_off_test_image"
+        <LinearLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:src="@drawable/fs_indeterminate"
-            android:layout_marginRight="@dimen/js_padding"/>
+            android:layout_marginTop="@dimen/js_padding"
+            android:layout_marginBottom="@dimen/js_padding">
+            <ImageView
+                android:id="@+id/charging_off_test_image"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/fs_indeterminate"
+                android:layout_marginRight="@dimen/js_padding"/>
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/js_charging_off_test"
+                android:textSize="16dp"/>
+        </LinearLayout>
         <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_margin="@dimen/js_padding"
+            android:text="@string/js_charging_description_2"
+            android:textStyle="bold"/>
+        <LinearLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="@string/js_charging_off_test"
-            android:textSize="16dp"/>
+            android:layout_marginTop="@dimen/js_padding"
+            android:layout_marginBottom="@dimen/js_padding">
+            <ImageView
+                android:id="@+id/charging_on_test_image"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/fs_indeterminate"
+                android:layout_marginRight="@dimen/js_padding"/>
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/js_charging_on_test"
+                android:textSize="16dp"/>
+        </LinearLayout>
+        <include layout="@layout/pass_fail_buttons" />
     </LinearLayout>
-    <TextView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_margin="@dimen/js_padding"
-        android:text="@string/js_charging_description_2"
-        android:textStyle="bold"/>
-    <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/js_padding"
-        android:layout_marginBottom="@dimen/js_padding">
-        <ImageView
-            android:id="@+id/charging_on_test_image"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:src="@drawable/fs_indeterminate"
-            android:layout_marginRight="@dimen/js_padding"/>
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/js_charging_on_test"
-            android:textSize="16dp"/>
-    </LinearLayout>
-    <include layout="@layout/pass_fail_buttons" />
-</LinearLayout>
\ No newline at end of file
+</ScrollView>
\ No newline at end of file
diff --git a/apps/CtsVerifier/res/layout/js_connectivity.xml b/apps/CtsVerifier/res/layout/js_connectivity.xml
index 5208c18..e0fc740 100644
--- a/apps/CtsVerifier/res/layout/js_connectivity.xml
+++ b/apps/CtsVerifier/res/layout/js_connectivity.xml
@@ -1,83 +1,86 @@
 <?xml version="1.0" encoding="utf-8"?>
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical" android:layout_width="match_parent"
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
     android:layout_height="match_parent">
-    <TextView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/js_test_description"
-        android:layout_margin="@dimen/js_padding"/>
-
-    <TextView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/js_connectivity_description_1"
-        android:layout_margin="@dimen/js_padding"
-        android:textStyle="bold"/>
-
-    <Button
-        android:id="@+id/js_connectivity_start_test_button"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center"
-        android:text="@string/js_start_test_text"
-        android:onClick="startTest"
-        android:enabled="false"/>
-
     <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/js_padding"
-        android:layout_marginBottom="@dimen/js_padding">
-        <ImageView
-            android:id="@+id/connectivity_off_test_unmetered_image"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:src="@drawable/fs_indeterminate"
-            android:layout_marginRight="@dimen/js_padding"/>
+        android:orientation="vertical" android:layout_width="match_parent"
+        android:layout_height="match_parent">
         <TextView
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:text="@string/js_unmetered_connectivity_test"
-            android:textSize="16dp"/>
-    </LinearLayout>
+            android:text="@string/js_test_description"
+            android:layout_margin="@dimen/js_padding"/>
 
-    <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/js_padding"
-        android:layout_marginBottom="@dimen/js_padding">
-        <ImageView
-            android:id="@+id/connectivity_off_test_any_connectivity_image"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:src="@drawable/fs_indeterminate"
-            android:layout_marginRight="@dimen/js_padding"/>
         <TextView
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:text="@string/js_any_connectivity_test"
-            android:textSize="16dp"/>
-    </LinearLayout>
+            android:text="@string/js_connectivity_description_1"
+            android:layout_margin="@dimen/js_padding"
+            android:textStyle="bold"/>
 
-    <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/js_padding"
-        android:layout_marginBottom="@dimen/js_padding">
-        <ImageView
-            android:id="@+id/connectivity_off_test_no_connectivity_image"
+        <Button
+            android:id="@+id/js_connectivity_start_test_button"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:src="@drawable/fs_indeterminate"
-            android:layout_marginRight="@dimen/js_padding"/>
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/js_no_connectivity_test"
-            android:textSize="16dp"/>
-    </LinearLayout>
+            android:layout_gravity="center"
+            android:text="@string/js_start_test_text"
+            android:onClick="startTest"
+            android:enabled="false"/>
 
-    <include layout="@layout/pass_fail_buttons" />
-</LinearLayout>
\ No newline at end of file
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/js_padding"
+            android:layout_marginBottom="@dimen/js_padding">
+            <ImageView
+                android:id="@+id/connectivity_off_test_unmetered_image"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/fs_indeterminate"
+                android:layout_marginRight="@dimen/js_padding"/>
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/js_unmetered_connectivity_test"
+                android:textSize="16dp"/>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/js_padding"
+            android:layout_marginBottom="@dimen/js_padding">
+            <ImageView
+                android:id="@+id/connectivity_off_test_any_connectivity_image"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/fs_indeterminate"
+                android:layout_marginRight="@dimen/js_padding"/>
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/js_any_connectivity_test"
+                android:textSize="16dp"/>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/js_padding"
+            android:layout_marginBottom="@dimen/js_padding">
+            <ImageView
+                android:id="@+id/connectivity_off_test_no_connectivity_image"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/fs_indeterminate"
+                android:layout_marginRight="@dimen/js_padding"/>
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/js_no_connectivity_test"
+                android:textSize="16dp"/>
+        </LinearLayout>
+
+        <include layout="@layout/pass_fail_buttons" />
+    </LinearLayout>
+</ScrollView>
\ No newline at end of file
diff --git a/apps/CtsVerifier/res/layout/js_idle.xml b/apps/CtsVerifier/res/layout/js_idle.xml
index 90e55ec..453b638 100644
--- a/apps/CtsVerifier/res/layout/js_idle.xml
+++ b/apps/CtsVerifier/res/layout/js_idle.xml
@@ -1,63 +1,67 @@
 <?xml version="1.0" encoding="utf-8"?>
 
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical" android:layout_width="match_parent"
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
     android:layout_height="match_parent">
-
-    <TextView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/js_test_description"
-        android:layout_margin="@dimen/js_padding"/>
-    <TextView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/js_idle_description_1"
-        android:layout_margin="@dimen/js_padding"
-        android:textStyle="bold"/>
-
-    <Button
-        android:id="@+id/js_idle_start_test_button"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center"
-        android:text="@string/js_start_test_text"
-        android:onClick="startTest"
-        android:enabled="false"/>
-
     <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/js_padding"
-        android:layout_marginBottom="@dimen/js_padding">
-        <ImageView
-            android:id="@+id/idle_off_test_image"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:src="@drawable/fs_indeterminate"
-            android:layout_marginRight="@dimen/js_padding"/>
+        android:orientation="vertical"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
         <TextView
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:text="@string/js_idle_item_idle_off"
-            android:textSize="16dp"/>
-    </LinearLayout>
-    <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/js_padding"
-        android:layout_marginBottom="@dimen/js_padding">
-        <ImageView
-            android:id="@+id/idle_on_test_image"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:src="@drawable/fs_indeterminate"
-            android:layout_marginRight="@dimen/js_padding"/>
+            android:text="@string/js_test_description"
+            android:layout_margin="@dimen/js_padding"/>
         <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/js_idle_description_1"
+            android:layout_margin="@dimen/js_padding"
+            android:textStyle="bold"/>
+
+        <Button
+            android:id="@+id/js_idle_start_test_button"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="@string/js_idle_item_idle_on"
-            android:textSize="16dp"/>
+            android:layout_gravity="center"
+            android:text="@string/js_start_test_text"
+            android:onClick="startTest"
+            android:enabled="false"/>
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/js_padding"
+            android:layout_marginBottom="@dimen/js_padding">
+            <ImageView
+                android:id="@+id/idle_off_test_image"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/fs_indeterminate"
+                android:layout_marginRight="@dimen/js_padding"/>
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/js_idle_item_idle_off"
+                android:textSize="16dp"/>
+        </LinearLayout>
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/js_padding"
+            android:layout_marginBottom="@dimen/js_padding">
+            <ImageView
+                android:id="@+id/idle_on_test_image"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/fs_indeterminate"
+                android:layout_marginRight="@dimen/js_padding"/>
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/js_idle_item_idle_on"
+                android:textSize="16dp"/>
+        </LinearLayout>
+        <include layout="@layout/pass_fail_buttons" />
     </LinearLayout>
-    <include layout="@layout/pass_fail_buttons" />
-</LinearLayout>
\ No newline at end of file
+</ScrollView>
\ No newline at end of file
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index 014191b..2f3d62f 100644
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -1306,7 +1306,7 @@
 
     <string name="js_charging_test">Charging Constraints</string>
     <string name="js_charging_instructions">Verify the behaviour of the JobScheduler API for when the device is on power and unplugged from power. Simply follow the on-screen instructions.</string>
-    <string name="js_charging_description_1">Unplug the phone in order to begin.</string>
+    <string name="js_charging_description_1">Unplug the device in order to begin.</string>
     <string name="js_charging_off_test">Device not charging will not execute a job with a charging constraint.</string>
     <string name="js_charging_on_test">Device when charging will execute a job with a charging constraint.</string>
     <string name="js_charging_description_2">After the above test has passed, plug the device back in to continue. If the above failed, you can simply fail this test.</string>