Use custom theme for keyguard presentation
The default Material theme for presentations on external displays
has a white background. This changes keyguard to use a custom theme
since we want white lettering on black.
Fixes bug 22305037
Change-Id: Idc6aca2398be34c4603446983e5d276abcace001
diff --git a/packages/Keyguard/res/values/styles.xml b/packages/Keyguard/res/values/styles.xml
index 943c3ea..dede537 100644
--- a/packages/Keyguard/res/values/styles.xml
+++ b/packages/Keyguard/res/values/styles.xml
@@ -52,4 +52,8 @@
<item name="android:colorControlNormal">#80ffffff</item>
<item name="android:colorControlActivated">#80ffffff</item>
</style>
+
+ <style name="keyguard_presentation_theme" parent="@android:style/Theme.Material.NoActionBar.Fullscreen">
+ </style>
+
</resources>
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardDisplayManager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardDisplayManager.java
index 55f965c..8de1d31 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardDisplayManager.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardDisplayManager.java
@@ -105,7 +105,8 @@
if (mPresentation == null && presentationDisplay != null) {
if (DEBUG) Slog.i(TAG, "Keyguard enabled on display: " + presentationDisplay);
- mPresentation = new KeyguardPresentation(mContext, presentationDisplay);
+ mPresentation = new KeyguardPresentation(mContext, presentationDisplay,
+ R.style.keyguard_presentation_theme);
mPresentation.setOnDismissListener(mOnDismissListener);
try {
mPresentation.show();
@@ -141,11 +142,12 @@
}
};
- public KeyguardPresentation(Context context, Display display) {
- super(context, display);
+ public KeyguardPresentation(Context context, Display display, int theme) {
+ super(context, display, theme);
getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
}
+ @Override
public void onDetachedFromWindow() {
mClock.removeCallbacks(mMoveTextRunnable);
}