Add keyguard background scrim and protection around keyguard APIs

With this change, the system process will put up a scrim in the
event keyguard crashes to protect underlying content.

It also adds permission checks to prevent unathorized access
through the binder APIs.

Cleaned up KeyguardTestActivity to build separately.

Removed unused resources.

Change-Id: I9e370c6bfb7dca68eae9eae304c815fb84a753d2
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 2ab981b3..83d6061 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2209,6 +2209,13 @@
         android:label="@string/permlab_access_keyguard_secure_storage"
         android:description="@string/permdesc_access_keyguard_secure_storage" />
 
+    <!-- Allows an application to control keyguard.  Only allowed for system processes.
+        @hide -->
+    <permission android:name="android.permission.CONTROL_KEYGUARD"
+        android:protectionLevel="signature"
+        android:label="@string/permlab_control_keyguard"
+        android:description="@string/permdesc_control_keyguard" />
+
     <!-- Must be required by an {@link
          android.service.notification.NotificationListenerService},
          to ensure that only the system can bind to it. -->
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index b832bbe..09be719 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3474,6 +3474,11 @@
     <!-- Description of an application permission that lets an application access keyguard secure storage. -->
     <string name="permdesc_access_keyguard_secure_storage">Allows an application to access keguard secure storage.</string>
 
+    <!-- Title of an application permission that lets it control keyguard. -->
+    <string name="permlab_control_keyguard">Control displaying and hiding keyguard</string>
+    <!-- Description of an application permission that lets it control keyguard. -->
+    <string name="permdesc_control_keyguard">Allows an application to control keguard.</string>
+
     <!-- Shown in the tutorial for tap twice for zoom control. -->
     <string name="tutorial_double_tap_to_zoom_message_short">Touch twice for zoom control</string>