Change keyguard theme when wallpaper colors change

Bug: 38163994
Bug: 37014702
Bug: 62053168
Test: visual
Change-Id: I5a2da4ef2ad6fc1dab71588f2d0f5bd207731900
diff --git a/packages/SystemUI/res-keyguard/values/attrs.xml b/packages/SystemUI/res-keyguard/values/attrs.xml
index 7cfe631..d3d60a1e 100644
--- a/packages/SystemUI/res-keyguard/values/attrs.xml
+++ b/packages/SystemUI/res-keyguard/values/attrs.xml
@@ -35,9 +35,13 @@
         <attr name="android:gravity" />
         <attr name="dotSize" format="dimension" />
         <attr name="charPadding" format="dimension" />
+        <attr name="android:textColor" format="color" />
     </declare-styleable>
 
     <declare-styleable name="CarrierText">
         <attr name="allCaps" format="boolean" />
     </declare-styleable>
+
+    <attr name="pinDividerColor" format="color" />
+    <attr name="pinDeleteColor" format="color" />
 </resources>
diff --git a/packages/SystemUI/res-keyguard/values/colors.xml b/packages/SystemUI/res-keyguard/values/colors.xml
deleted file mode 100644
index 5071594..0000000
--- a/packages/SystemUI/res-keyguard/values/colors.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources>
-    <color name="keyguard_numpad_divider_light">#80FFFFFF</color> <!-- 50% white -->
-    <color name="keyguard_numpad_divider_dark">#FF9FA4A6</color>
-    <color name="keyguard_numpad_delete_light">#FFFFFFFF</color>
-    <color name="keyguard_numpad_delete_dark">@color/material_grey_600</color>
-</resources>
diff --git a/packages/SystemUI/res-keyguard/values/styles.xml b/packages/SystemUI/res-keyguard/values/styles.xml
index 53a559f..d7ff349 100644
--- a/packages/SystemUI/res-keyguard/values/styles.xml
+++ b/packages/SystemUI/res-keyguard/values/styles.xml
@@ -20,11 +20,11 @@
 <resources>
     <!-- Keyguard PIN pad styles -->
     <style name="Keyguard.TextView" parent="@android:style/Widget.DeviceDefault.TextView">
-        <item name="android:textColor">@*android:color/primary_device_default_light</item>
+        <item name="android:textColor">?attr/bgProtectSecondaryTextColor</item>
         <item name="android:textSize">@dimen/kg_status_line_font_size</item>
     </style>
     <style name="Keyguard.TextView.EmergencyButton" parent="@android:style/DeviceDefault.ButtonBar">
-        <item name="android:textColor">@*android:color/primary_device_default_light</item>
+        <item name="android:textColor">?attr/bgProtectSecondaryTextColor</item>
         <item name="android:textSize">@dimen/kg_status_line_font_size</item>
         <item name="android:background">@null</item>
     </style>
@@ -34,13 +34,16 @@
         <item name="android:background">@null</item>
         <item name="android:textSize">36sp</item>
         <item name="android:fontFamily">sans-serif-light</item>
-        <item name="android:textColor">#ffffffff</item>
+        <item name="android:textColor">?attr/bgProtectTextColor</item>
         <item name="android:paddingBottom">-16dp</item>
     </style>
+    <style name="Keyguard.ImageButton.NumPadEnter" parent="@android:style/Widget.ImageButton">
+        <item name="android:tint">?attr/bgProtectTextColor</item>
+    </style>
     <style name="Widget.TextView.NumPadKey.Klondike" parent="Widget.TextView.NumPadKey">
         <item name="android:textSize">12sp</item>
         <item name="android:fontFamily">sans-serif</item>
-        <item name="android:textColor">#80ffffff</item>
+        <item name="android:textColor">?attr/bgProtectSecondaryTextColor</item>
         <item name="android:paddingBottom">0dp</item>
     </style>
 
@@ -58,8 +61,9 @@
     </style>
 
     <style name="PasswordTheme" parent="@android:style/Theme.DeviceDefault">
-        <item name="android:colorControlNormal">#80ffffff</item>
-        <item name="android:colorControlActivated">#80ffffff</item>
+        <item name="android:textColor">?attr/bgProtectTextColor</item>
+        <item name="android:colorControlNormal">?attr/bgProtectTextColor</item>
+        <item name="android:colorControlActivated">?attr/bgProtectTextColor</item>
     </style>
 
     <style name="keyguard_presentation_theme" parent="@android:style/Theme.Material.NoActionBar.Fullscreen">