From e5fbe9b9122e68e16f7657989ab4b2cf5ea88958 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Fri, 5 Feb 2010 13:26:28 -0800 Subject: [PATCH] New "device is locked" status bar icon, part 2. Shown whenever the secure lockscreen is (a) visible, or (b) active but hidden due to a FLAG_SHOW_WHEN_LOCKED Activity. Change-Id: I0e08a952904cc4728621953a42806edf26eb8e46 --- .../policy/impl/KeyguardViewMediator.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java index 85afa81cd6375..b35b3fc3c799b 100644 --- a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java +++ b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java @@ -28,6 +28,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Handler; +import android.os.IBinder; import android.os.LocalPowerManager; import android.os.Message; import android.os.PowerManager; @@ -138,6 +139,7 @@ public class KeyguardViewMediator implements KeyguardViewCallback, private Context mContext; private AlarmManager mAlarmManager; private StatusBarManager mStatusBarManager; + private IBinder mSecureLockIcon = null; private boolean mSystemReady; @@ -965,6 +967,19 @@ public class KeyguardViewMediator implements KeyguardViewCallback, if (mStatusBarManager == null) { Log.w(TAG, "Could not get status bar manager"); } else { + // Give feedback to user when secure keyguard is active and engaged + if (mShowing && isSecure()) { + if (mSecureLockIcon == null) { + mSecureLockIcon = mStatusBarManager.addIcon("secure", + com.android.internal.R.drawable.stat_sys_secure, 0); + } + } else { + if (mSecureLockIcon != null) { + mStatusBarManager.removeIcon(mSecureLockIcon); + mSecureLockIcon = null; + } + } + // if the keyguard is shown, allow the status bar to open // only if the keyguard is insecure and is covered by another window boolean enable = !mShowing || (mHidden && !isSecure());