diff options
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 20e418c..5f92dc6 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -23,6 +23,7 @@ import android.app.AlarmManager; import android.app.PendingIntent; import android.app.SearchManager; import android.app.StatusBarManager; +import android.app.trust.TrustManager; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; @@ -187,8 +188,9 @@ public class KeyguardViewMediator extends SystemUI { /** High level access to the window manager for dismissing keyguard animation */ private IWindowManager mWM; - /** UserManager for querying number of users */ - private UserManager mUserManager; + + /** TrustManager for letting it know when we change visibility */ + private TrustManager mTrustManager; /** SearchManager for determining whether or not search assistant is available */ private SearchManager mSearchManager; @@ -484,7 +486,8 @@ public class KeyguardViewMediator extends SystemUI { private void setup() { mPM = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); mWM = WindowManagerGlobal.getWindowManagerService(); - mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); + mTrustManager = (TrustManager) mContext.getSystemService(Context.TRUST_SERVICE); + mShowKeyguardWakeLock = mPM.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "show keyguard"); mShowKeyguardWakeLock.setReferenceCounted(false); @@ -501,6 +504,7 @@ public class KeyguardViewMediator extends SystemUI { // Assume keyguard is showing (unless it's disabled) until we know for sure... mShowing = !shouldWaitForProvisioning() && !mLockPatternUtils.isLockScreenDisabled(); + mTrustManager.reportKeyguardShowingChanged(); mStatusBarKeyguardViewManager = new StatusBarKeyguardViewManager(mContext, mViewMediatorCallback, mLockPatternUtils); @@ -931,7 +935,7 @@ public class KeyguardViewMediator extends SystemUI { if (mLockPatternUtils.checkVoldPassword()) { if (DEBUG) Log.d(TAG, "Not showing lock screen since just decrypted"); // Without this, settings is not enabled until the lock screen first appears - mShowing = false; + setShowing(false); hideLocked(); return; } @@ -1249,7 +1253,7 @@ public class KeyguardViewMediator extends SystemUI { mStatusBarKeyguardViewManager.show(options); mHiding = false; - mShowing = true; + setShowing(true); resetKeyguardDonePendingLocked(); mHideAnimationRun = false; updateActivityLockScreenState(); @@ -1328,7 +1332,7 @@ public class KeyguardViewMediator extends SystemUI { } mStatusBarKeyguardViewManager.hide(startTime, fadeoutDuration); - mShowing = false; + setShowing(false); resetKeyguardDonePendingLocked(); mHideAnimationRun = false; updateActivityLockScreenState(); @@ -1389,7 +1393,7 @@ public class KeyguardViewMediator extends SystemUI { synchronized (KeyguardViewMediator.this) { if (DEBUG) Log.d(TAG, "handleVerifyUnlock"); mStatusBarKeyguardViewManager.verifyUnlock(); - mShowing = true; + setShowing(true); updateActivityLockScreenState(); } } @@ -1471,4 +1475,12 @@ public class KeyguardViewMediator extends SystemUI { this.fadeoutDuration = fadeoutDuration; } } + + private void setShowing(boolean showing) { + boolean changed = (showing != mShowing); + mShowing = showing; + if (changed) { + mTrustManager.reportKeyguardShowingChanged(); + } + } } |