diff options
author | Adrian Roos <roosa@google.com> | 2014-11-20 21:38:16 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-11-20 21:38:17 +0000 |
commit | 4e312d81c18b286170c904659e78cab4fdf27200 (patch) | |
tree | f7134b4d7650776c04d572dba7549a43bb212df0 /packages/SystemUI | |
parent | af6e657ab873623ed0e94bc8bcf8ed03f6bbe167 (diff) | |
parent | 481a6df99fea124bc4354da34ff668750cdc9041 (diff) | |
download | frameworks_base-4e312d81c18b286170c904659e78cab4fdf27200.zip frameworks_base-4e312d81c18b286170c904659e78cab4fdf27200.tar.gz frameworks_base-4e312d81c18b286170c904659e78cab4fdf27200.tar.bz2 |
Merge "Add device locked API for TrustAgentService" into lmp-mr1-dev
Diffstat (limited to 'packages/SystemUI')
-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(); + } + } } |