diff options
author | Adrian Roos <roosa@google.com> | 2014-11-20 19:48:56 +0100 |
---|---|---|
committer | Adrian Roos <roosa@google.com> | 2014-11-20 21:48:38 +0100 |
commit | 481a6df99fea124bc4354da34ff668750cdc9041 (patch) | |
tree | cfdf0dafeb00887d67fbb02d8046fba0dfab4685 /packages/SystemUI/src/com/android/systemui/keyguard | |
parent | 50bfeec868157106e8b60abf8964cb24462af182 (diff) | |
download | frameworks_base-481a6df99fea124bc4354da34ff668750cdc9041.zip frameworks_base-481a6df99fea124bc4354da34ff668750cdc9041.tar.gz frameworks_base-481a6df99fea124bc4354da34ff668750cdc9041.tar.bz2 |
Add device locked API for TrustAgentService
Bug: 18414067
Change-Id: I96c68af9ccc9940acf9fab3b5bd39a3485f01045
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/keyguard')
-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(); + } + } } |