Methods Summary |
---|
private void | callbackAfterDraw(com.android.internal.policy.IKeyguardShowCallback callback)
mContainer.post(new Runnable() {
@Override
public void run() {
try {
callback.onShown(mContainer.getWindowToken());
} catch (RemoteException e) {
Slog.w(TAG, "Exception calling onShown():", e);
}
}
});
|
public void | dismiss()Dismisses the keyguard by going to the next screen or making it gone.
if (mScreenOn) {
showBouncer();
}
|
public void | dismissWithAction(com.android.keyguard.KeyguardHostView.OnDismissAction r, boolean afterKeyguardGone)
if (mShowing) {
if (!afterKeyguardGone) {
mBouncer.showWithDismissAction(r);
} else {
mBouncer.show(false /* resetSecuritySelection */);
mAfterKeyguardGoneAction = r;
}
}
updateStates();
|
private void | executeAfterKeyguardGoneAction()
if (mAfterKeyguardGoneAction != null) {
mAfterKeyguardGoneAction.onDismiss();
mAfterKeyguardGoneAction = null;
}
|
private long | getNavBarShowDelay()
if (mPhoneStatusBar.isKeyguardFadingAway()) {
return mPhoneStatusBar.getKeyguardFadingAwayDelay();
} else {
// Keyguard is not going away, thus we are showing the navigation bar because the
// bouncer is appearing.
return NAV_BAR_SHOW_DELAY_BOUNCER;
}
|
public void | hide(long startTime, long fadeoutDuration)Hides the keyguard view
mShowing = false;
long uptimeMillis = SystemClock.uptimeMillis();
long delay = Math.max(0, startTime + HIDE_TIMING_CORRECTION_MS - uptimeMillis);
if (mPhoneStatusBar.isInLaunchTransition() ) {
mPhoneStatusBar.fadeKeyguardAfterLaunchTransition(new Runnable() {
@Override
public void run() {
mStatusBarWindowManager.setKeyguardShowing(false);
mStatusBarWindowManager.setKeyguardFadingAway(true);
mBouncer.hide(true /* destroyView */);
updateStates();
mScrimController.animateKeyguardFadingOut(
PhoneStatusBar.FADE_KEYGUARD_START_DELAY,
PhoneStatusBar.FADE_KEYGUARD_DURATION, null);
}
}, new Runnable() {
@Override
public void run() {
mPhoneStatusBar.hideKeyguard();
mStatusBarWindowManager.setKeyguardFadingAway(false);
mViewMediatorCallback.keyguardGone();
executeAfterKeyguardGoneAction();
}
});
} else {
mPhoneStatusBar.setKeyguardFadingAway(delay, fadeoutDuration);
boolean staying = mPhoneStatusBar.hideKeyguard();
if (!staying) {
mStatusBarWindowManager.setKeyguardFadingAway(true);
mScrimController.animateKeyguardFadingOut(delay, fadeoutDuration, new Runnable() {
@Override
public void run() {
mStatusBarWindowManager.setKeyguardFadingAway(false);
mPhoneStatusBar.finishKeyguardFadingAway();
WindowManagerGlobal.getInstance().trimMemory(
ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);
}
});
} else {
mScrimController.animateGoingToFullShade(delay, fadeoutDuration);
mPhoneStatusBar.finishKeyguardFadingAway();
}
mStatusBarWindowManager.setKeyguardShowing(false);
mBouncer.hide(true /* destroyView */);
mViewMediatorCallback.keyguardGone();
executeAfterKeyguardGoneAction();
updateStates();
}
|
public boolean | interceptMediaKey(android.view.KeyEvent event)
return mBouncer.interceptMediaKey(event);
|
public boolean | isBouncerShowing()
return mBouncer.isShowing();
|
public boolean | isGoingToNotificationShade()
return mPhoneStatusBar.isGoingToNotificationShade();
|
public boolean | isInputRestricted()
return mViewMediatorCallback.isInputRestricted();
|
public boolean | isOccluded()
return mOccluded;
|
public boolean | isSecure()WARNING: This method might cause Binder calls.
return mBouncer.isSecure();
|
public boolean | isSecure(int userId)
return mBouncer.isSecure() || mLockPatternUtils.isSecure(userId);
|
public boolean | isShowing()
return mShowing;
|
public void | onActivityDrawn()
if (mPhoneStatusBar.isCollapsing()) {
mPhoneStatusBar.addPostCollapseAction(new Runnable() {
@Override
public void run() {
mViewMediatorCallback.readyForKeyguardDone();
}
});
} else {
mViewMediatorCallback.readyForKeyguardDone();
}
|
public boolean | onBackPressed()Notifies this manager that the back button has been pressed.
if (mBouncer.isShowing()) {
reset();
return true;
}
return false;
|
public boolean | onMenuPressed()
return mBouncer.onMenuPressed();
|
public void | onScreenTurnedOff()
mScreenOn = false;
mPhoneStatusBar.onScreenTurnedOff();
mBouncer.onScreenTurnedOff();
|
public void | onScreenTurnedOn(com.android.internal.policy.IKeyguardShowCallback callback)
mScreenOn = true;
mPhoneStatusBar.onScreenTurnedOn();
if (callback != null) {
callbackAfterDraw(callback);
}
|
public void | registerStatusBar(PhoneStatusBar phoneStatusBar, android.view.ViewGroup container, StatusBarWindowManager statusBarWindowManager, ScrimController scrimController)
mPhoneStatusBar = phoneStatusBar;
mContainer = container;
mStatusBarWindowManager = statusBarWindowManager;
mScrimController = scrimController;
mBouncer = new KeyguardBouncer(mContext, mViewMediatorCallback, mLockPatternUtils,
mStatusBarWindowManager, container);
|
public void | reset()Reset the state of the view.
if (mShowing) {
if (mOccluded) {
mPhoneStatusBar.hideKeyguard();
mBouncer.hide(false /* destroyView */);
} else {
showBouncerOrKeyguard();
}
updateStates();
}
|
public void | setNeedsInput(boolean needsInput)
mStatusBarWindowManager.setKeyguardNeedsInput(needsInput);
|
public void | setOccluded(boolean occluded)
if (occluded && !mOccluded && mShowing) {
if (mPhoneStatusBar.isInLaunchTransition()) {
mOccluded = true;
mPhoneStatusBar.fadeKeyguardAfterLaunchTransition(null /* beforeFading */,
new Runnable() {
@Override
public void run() {
mStatusBarWindowManager.setKeyguardOccluded(mOccluded);
reset();
}
});
return;
}
}
mOccluded = occluded;
mStatusBarWindowManager.setKeyguardOccluded(occluded);
reset();
|
public boolean | shouldDisableWindowAnimationsForUnlock()
return mPhoneStatusBar.isInLaunchTransition();
|
public void | show(android.os.Bundle options)Show the keyguard. Will handle creating and attaching to the view manager
lazily.
mShowing = true;
mStatusBarWindowManager.setKeyguardShowing(true);
reset();
|
private void | showBouncer()
if (mShowing) {
mBouncer.show(false /* resetSecuritySelection */);
}
updateStates();
|
private void | showBouncerOrKeyguard()Shows the notification keyguard or the bouncer depending on
{@link KeyguardBouncer#needsFullscreenBouncer()}.
if (mBouncer.needsFullscreenBouncer()) {
// The keyguard might be showing (already). So we need to hide it.
mPhoneStatusBar.hideKeyguard();
mBouncer.show(true /* resetSecuritySelection */);
} else {
mPhoneStatusBar.showKeyguard();
mBouncer.hide(false /* destroyView */);
mBouncer.prepare();
}
|
public void | startPreHideAnimation(java.lang.Runnable finishRunnable)Starts the animation before we dismiss Keyguard, i.e. an disappearing animation on the
security view of the bouncer.
if (mBouncer.isShowing()) {
mBouncer.startPreHideAnimation(finishRunnable);
} else if (finishRunnable != null) {
finishRunnable.run();
}
|
private void | updateStates()
int vis = mContainer.getSystemUiVisibility();
boolean showing = mShowing;
boolean occluded = mOccluded;
boolean bouncerShowing = mBouncer.isShowing();
boolean bouncerDismissible = !mBouncer.isFullscreenBouncer();
if ((bouncerDismissible || !showing) != (mLastBouncerDismissible || !mLastShowing)
|| mFirstUpdate) {
if (bouncerDismissible || !showing) {
mContainer.setSystemUiVisibility(vis & ~View.STATUS_BAR_DISABLE_BACK);
} else {
mContainer.setSystemUiVisibility(vis | View.STATUS_BAR_DISABLE_BACK);
}
}
if ((!(showing && !occluded) || bouncerShowing)
!= (!(mLastShowing && !mLastOccluded) || mLastBouncerShowing) || mFirstUpdate) {
if (mPhoneStatusBar.getNavigationBarView() != null) {
if (!(showing && !occluded) || bouncerShowing) {
mContainer.postOnAnimationDelayed(mMakeNavigationBarVisibleRunnable,
getNavBarShowDelay());
} else {
mContainer.removeCallbacks(mMakeNavigationBarVisibleRunnable);
mPhoneStatusBar.getNavigationBarView().setVisibility(View.GONE);
}
}
}
if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) {
mStatusBarWindowManager.setBouncerShowing(bouncerShowing);
mPhoneStatusBar.setBouncerShowing(bouncerShowing);
mScrimController.setBouncerShowing(bouncerShowing);
}
KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
if ((showing && !occluded) != (mLastShowing && !mLastOccluded) || mFirstUpdate) {
updateMonitor.sendKeyguardVisibilityChanged(showing && !occluded);
}
if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) {
updateMonitor.sendKeyguardBouncerChanged(bouncerShowing);
}
mFirstUpdate = false;
mLastShowing = showing;
mLastOccluded = occluded;
mLastBouncerShowing = bouncerShowing;
mLastBouncerDismissible = bouncerDismissible;
mPhoneStatusBar.onKeyguardViewManagerStatesUpdated();
|
public void | updateUserActivityTimeout()
mStatusBarWindowManager.setKeyguardUserActivityTimeout(mBouncer.getUserActivityTimeout());
|
public void | verifyUnlock()
dismiss();
|