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
diff --git a/phone/com/android/internal/policy/impl/KeyguardViewMediator.java b/phone/com/android/internal/policy/impl/KeyguardViewMediator.java
index 85afa81..b35b3fc 100644
--- a/phone/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/phone/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -28,6 +28,7 @@
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 @@
private Context mContext;
private AlarmManager mAlarmManager;
private StatusBarManager mStatusBarManager;
+ private IBinder mSecureLockIcon = null;
private boolean mSystemReady;
@@ -965,6 +967,19 @@
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());