Methods Summary |
---|
private void | cancelShowRunnable()
mChoreographer.removeCallbacks(Choreographer.CALLBACK_ANIMATION, mShowRunnable, null);
mShowingSoon = false;
|
private void | ensureView()
if (mRoot == null) {
inflateView();
}
|
public long | getUserActivityTimeout()
if (mKeyguardView != null) {
long timeout = mKeyguardView.getUserActivityTimeout();
if (timeout >= 0) {
return timeout;
}
}
return KeyguardViewMediator.AWAKE_INTERVAL_DEFAULT_MS;
|
public void | hide(boolean destroyView)
cancelShowRunnable();
if (mKeyguardView != null) {
mKeyguardView.setOnDismissAction(null);
mKeyguardView.cleanUp();
}
if (destroyView) {
removeView();
} else if (mRoot != null) {
mRoot.setVisibility(View.INVISIBLE);
}
|
private void | inflateView()
removeView();
mRoot = (ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.keyguard_bouncer, null);
mKeyguardView = (KeyguardViewBase) mRoot.findViewById(R.id.keyguard_host_view);
mKeyguardView.setLockPatternUtils(mLockPatternUtils);
mKeyguardView.setViewMediatorCallback(mCallback);
mContainer.addView(mRoot, mContainer.getChildCount());
mRoot.setVisibility(View.INVISIBLE);
mRoot.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME);
|
public boolean | interceptMediaKey(android.view.KeyEvent event)
ensureView();
return mKeyguardView.interceptMediaKey(event);
|
public boolean | isFullscreenBouncer()Like {@link #needsFullscreenBouncer}, but uses the currently visible security method, which
makes this method much faster.
if (mKeyguardView != null) {
SecurityMode mode = mKeyguardView.getCurrentSecurityMode();
return mode == SecurityMode.SimPin || mode == SecurityMode.SimPuk;
}
return false;
|
public boolean | isSecure()WARNING: This method might cause Binder calls.
return mKeyguardView == null || mKeyguardView.getSecurityMode() != SecurityMode.None;
|
public boolean | isShowing()
return mShowingSoon || (mRoot != null && mRoot.getVisibility() == View.VISIBLE);
|
public boolean | needsFullscreenBouncer()
if (mKeyguardView != null) {
SecurityMode mode = mKeyguardView.getSecurityMode();
return mode == SecurityMode.SimPin || mode == SecurityMode.SimPuk;
}
return false;
|
public boolean | onBackPressed()
return mKeyguardView != null && mKeyguardView.handleBackKey();
|
public boolean | onMenuPressed()
ensureView();
if (mKeyguardView.handleMenuKey()) {
// We need to show it in case it is secure. If not, it will get dismissed in any case.
mRoot.setVisibility(View.VISIBLE);
mKeyguardView.requestFocus();
mKeyguardView.onResume();
return true;
} else {
return false;
}
|
public void | onScreenTurnedOff()
if (mKeyguardView != null && mRoot != null && mRoot.getVisibility() == View.VISIBLE) {
mKeyguardView.onPause();
}
|
public void | prepare()
boolean wasInitialized = mRoot != null;
ensureView();
if (wasInitialized) {
mKeyguardView.showPrimarySecurityScreen();
}
|
private void | removeView()
if (mRoot != null && mRoot.getParent() == mContainer) {
mContainer.removeView(mRoot);
mRoot = null;
}
|
public void | reset()Reset the state of the view.
cancelShowRunnable();
inflateView();
|
public void | show(boolean resetSecuritySelection)
ensureView();
if (resetSecuritySelection) {
// showPrimarySecurityScreen() updates the current security method. This is needed in
// case we are already showing and the current security method changed.
mKeyguardView.showPrimarySecurityScreen();
}
if (mRoot.getVisibility() == View.VISIBLE || mShowingSoon) {
return;
}
// Try to dismiss the Keyguard. If no security pattern is set, this will dismiss the whole
// Keyguard. If we need to authenticate, show the bouncer.
if (!mKeyguardView.dismiss()) {
mShowingSoon = true;
// Split up the work over multiple frames.
mChoreographer.postCallbackDelayed(Choreographer.CALLBACK_ANIMATION, mShowRunnable,
null, 16);
}
|
public void | showWithDismissAction(com.android.keyguard.KeyguardHostView.OnDismissAction r)
ensureView();
mKeyguardView.setOnDismissAction(r);
show(false /* resetSecuritySelection */);
|
public void | startPreHideAnimation(java.lang.Runnable runnable)See {@link StatusBarKeyguardViewManager#startPreHideAnimation}.
if (mKeyguardView != null) {
mKeyguardView.startDisappearAnimation(runnable);
} else if (runnable != null) {
runnable.run();
}
|