Merge "Merge "Merge "CtsVerifier: Improve CA cert on boot instructions" into oreo-cts-dev am: 65d9081c66" into oreo-mr1-cts-dev am: b7feb1019b"
diff --git a/apps/CtsVerifier/res/layout/ca_boot_notify.xml b/apps/CtsVerifier/res/layout/ca_boot_notify.xml
index 262c6ad..52df1f1 100644
--- a/apps/CtsVerifier/res/layout/ca_boot_notify.xml
+++ b/apps/CtsVerifier/res/layout/ca_boot_notify.xml
@@ -47,6 +47,11 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="@string/caboot_if_not_installed" />
+            <TextView
+                android:id="@+id/need_to_install_cert_instructions"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/cacert_install_cert" />
 
             <Button
                 android:id="@+id/install"
@@ -55,6 +60,18 @@
                 android:text="@string/caboot_install_cert" />
 
             <TextView
+                android:id="@+id/remove_screen_lock_description"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/cacert_remove_screen_lock" />
+
+            <Button
+                android:id="@+id/remove_screen_lock"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/caboot_remove_screen_lock" />
+
+            <TextView
                 android:id="@+id/reboot"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index 5327357..378cdda 100755
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -1695,10 +1695,11 @@
 
     <string name="caboot_test">CA Cert Notification on Boot test</string>
     <string name="caboot_info">This test is to confirm that when the user has installed a trusted credential, the system notifies the user when it boots.</string>
-    <string name="caboot_check_cert_installed">Please check here to see whether a certificate is already installed. (If this button does nothing, pass the test and move on.)</string>
+    <string name="caboot_check_cert_installed">Please check here to see whether a certificate is already installed. If this button does nothing, pass the test and move on.</string>
     <string name="caboot_check_creds">Check Credentials</string>
-    <string name="caboot_if_not_installed">Only if there is no credential currently installed, install one. (If this button does nothing, pass the test and move on.)</string>
+    <string name="caboot_if_not_installed">Only if there is no credential currently installed, install one.</string>
     <string name="caboot_install_cert">Install credential</string>
+    <string name="caboot_remove_screen_lock">Remove screen lock</string>
     <string name="caboot_reboot_desc">Please reboot the device and return to this test.</string>
     <string name="caboot_after_boot">AFTER REBOOTING: Check that there is a notification that the network may be monitored. Opening that notification should show a dialog box giving more information, with a button to check trusted credentials. This should open up the same view of trusted credentials that you get via the "Check credentials" button.</string>
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
index 5537b15..a4f63ad 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
@@ -1,5 +1,6 @@
 package com.android.cts.verifier.security;
 
+import android.app.admin.DevicePolicyManager;
 import android.content.ActivityNotFoundException;
 import android.content.Intent;
 import android.os.Bundle;
@@ -32,6 +33,9 @@
         Button installButton = (Button) view.findViewById(R.id.install);
         checkCredsButton.setOnClickListener(new OpenTrustedCredentials());
         installButton.setOnClickListener(new InstallCert());
+        Button removeScreenLockButton = (Button) view.findViewById(R.id.remove_screen_lock);
+        removeScreenLockButton.setOnClickListener(
+                v -> startActivity(new Intent(DevicePolicyManager.ACTION_SET_NEW_PASSWORD)));
 
         setContentView(view);