summaryrefslogtreecommitdiffstats
path: root/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
diff options
context:
space:
mode:
Diffstat (limited to 'policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java')
-rw-r--r--policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java29
1 files changed, 27 insertions, 2 deletions
diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
index 7f79cc2..d635bce 100644
--- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
+++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
@@ -17,6 +17,7 @@
package com.android.internal.policy.impl;
import com.android.internal.R;
+import com.android.internal.app.ThemeUtils;
import com.android.internal.telephony.IccCard;
import com.android.internal.widget.LockPatternUtils;
@@ -28,6 +29,7 @@ import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.app.AlertDialog;
import android.app.admin.DevicePolicyManager;
+import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
@@ -79,6 +81,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
private View mLockScreen;
private View mUnlockScreen;
+ private Context mUiContext;
+
private boolean mScreenOn = false;
private boolean mEnableFallback = false; // assume no fallback UI until we know better
@@ -187,6 +191,12 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
}
};
+ private BroadcastReceiver mThemeChangeReceiver = new BroadcastReceiver() {
+ public void onReceive(Context context, Intent intent) {
+ mUiContext = null;
+ }
+ };
+
/**
* @return Whether we are stuck on the lock screen because the sim is
* missing.
@@ -542,8 +552,16 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
}
@Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ ThemeUtils.registerThemeChangeReceiver(mContext, mThemeChangeReceiver);
+ }
+
+ @Override
protected void onDetachedFromWindow() {
removeCallbacks(mRecreateRunnable);
+ mContext.unregisterReceiver(mThemeChangeReceiver);
+ mUiContext = null;
super.onDetachedFromWindow();
}
@@ -836,7 +854,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
timeoutInSeconds);
}
- final AlertDialog dialog = new AlertDialog.Builder(mContext)
+ final AlertDialog dialog = new AlertDialog.Builder(getUiContext())
.setTitle(null)
.setMessage(message)
.setNeutralButton(R.string.ok, null)
@@ -852,6 +870,13 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
dialog.show();
}
+ private Context getUiContext() {
+ if (mUiContext == null) {
+ mUiContext = ThemeUtils.createUiContext(mContext);
+ }
+ return mUiContext != null ? mUiContext : mContext;
+ }
+
private void showAlmostAtAccountLoginDialog() {
int timeoutInSeconds = (int) LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
String message;
@@ -872,7 +897,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
timeoutInSeconds);
}
- final AlertDialog dialog = new AlertDialog.Builder(mContext)
+ final AlertDialog dialog = new AlertDialog.Builder(getUiContext())
.setTitle(null)
.setMessage(message)
.setNeutralButton(R.string.ok, null)