public class KeyguardViewMediator extends SystemUI
setKeyguardEnabled(boolean)
. When
false, this will override all other conditions for turning on the keyguard.
Threading and synchronization:
This class is created by the initialization routine of the WindowManagerPolicy
,
and runs on its thread. The keyguard UI is created from that thread in the
constructor of this class. The apis may be called from other threads, including the
InputManagerService
's and WindowManager
's.
Therefore, methods on this class are synchronized, and any action that is pointed
directly to the keyguard UI is posted to a Handler
to ensure it is taken on the UI
thread of the keyguard.Modifier and Type | Field and Description |
---|---|
static int |
AWAKE_INTERVAL_DEFAULT_MS
The default amount of time we stay awake (used for all key input)
|
mComponents, mContext
Constructor and Description |
---|
KeyguardViewMediator() |
Modifier and Type | Method and Description |
---|---|
void |
addStateMonitorCallback(IKeyguardStateCallback callback) |
void |
dismiss(boolean allowWhileOccluded) |
void |
doKeyguardTimeout(Bundle options)
Used by PhoneWindowManager to enable the keyguard due to a user activity timeout.
|
void |
dump(FileDescriptor fd,
PrintWriter pw,
String[] args) |
LockPatternUtils |
getLockPatternUtils() |
ViewMediatorCallback |
getViewMediatorCallback() |
void |
handleDismiss(boolean allowWhileOccluded)
Dismiss the keyguard through the security layers.
|
boolean |
isInputRestricted()
Given the state of the keyguard, is the input restricted?
|
boolean |
isSecure() |
boolean |
isShowingAndNotOccluded()
Is the keyguard currently showing and not being force hidden?
|
void |
keyguardDone(boolean authenticated) |
void |
onActivityDrawn() |
void |
onBootCompleted() |
void |
onDreamingStarted()
A dream started.
|
void |
onDreamingStopped()
A dream stopped.
|
void |
onFinishedGoingToSleep(int why,
boolean cameraGestureTriggered) |
void |
onScreenTurnedOff() |
void |
onScreenTurnedOn() |
void |
onScreenTurningOn(IKeyguardDrawnCallback callback) |
void |
onStartedGoingToSleep(int why)
Called to let us know the screen was turned off.
|
void |
onStartedWakingUp()
Let's us know when the device is waking up.
|
void |
onSystemReady()
Let us know that the system is ready after startup.
|
void |
onWakeAndUnlocking() |
StatusBarKeyguardViewManager |
registerStatusBar(PhoneStatusBar phoneStatusBar,
ViewGroup container,
StatusBarWindowManager statusBarWindowManager,
ScrimController scrimController,
FingerprintUnlockController fingerprintUnlockController) |
void |
setCurrentUser(int newUserId)
Update the newUserId.
|
void |
setKeyguardEnabled(boolean enabled)
Same semantics as
WindowManagerPolicy.enableKeyguard(boolean) ; provide
a way for external stuff to override normal keyguard behavior. |
void |
setOccluded(boolean isOccluded,
boolean animate)
Notify us when the keyguard is occluded by another window
|
void |
start() |
void |
startKeyguardExitAnimation(long startTime,
long fadeoutDuration) |
void |
userActivity() |
void |
verifyUnlock(IKeyguardExitCallback callback) |
getComponent, onConfigurationChanged, overrideNotificationAppName, putComponent
public static final int AWAKE_INTERVAL_DEFAULT_MS
public void userActivity()
public void onSystemReady()
public void onStartedGoingToSleep(int why)
why
- either WindowManagerPolicy.OFF_BECAUSE_OF_USER
or
WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT
.public void onFinishedGoingToSleep(int why, boolean cameraGestureTriggered)
public void onStartedWakingUp()
public void onScreenTurningOn(IKeyguardDrawnCallback callback)
public void onScreenTurnedOn()
public void onScreenTurnedOff()
public void onDreamingStarted()
public void onDreamingStopped()
public void setKeyguardEnabled(boolean enabled)
WindowManagerPolicy.enableKeyguard(boolean)
; provide
a way for external stuff to override normal keyguard behavior. For instance
the phone app disables the keyguard when it receives incoming calls.public void verifyUnlock(IKeyguardExitCallback callback)
public boolean isShowingAndNotOccluded()
public void setOccluded(boolean isOccluded, boolean animate)
public void doKeyguardTimeout(Bundle options)
public boolean isInputRestricted()
public void handleDismiss(boolean allowWhileOccluded)
allowWhileOccluded
- if true, dismiss the keyguard even if it's currently occluded.public void dismiss(boolean allowWhileOccluded)
public boolean isSecure()
public void setCurrentUser(int newUserId)
newUserId
- The id of the incoming user.public void keyguardDone(boolean authenticated)
public void onBootCompleted()
onBootCompleted
in class SystemUI
public void onWakeAndUnlocking()
public StatusBarKeyguardViewManager registerStatusBar(PhoneStatusBar phoneStatusBar, ViewGroup container, StatusBarWindowManager statusBarWindowManager, ScrimController scrimController, FingerprintUnlockController fingerprintUnlockController)
public void startKeyguardExitAnimation(long startTime, long fadeoutDuration)
public void onActivityDrawn()
public ViewMediatorCallback getViewMediatorCallback()
public LockPatternUtils getLockPatternUtils()
public void dump(FileDescriptor fd, PrintWriter pw, String[] args)
public void addStateMonitorCallback(IKeyguardStateCallback callback)