public class KeyguardUpdateMonitor extends Object implements TrustManager.TrustListener
handleBatteryUpdate(com.android.keyguard.KeyguardUpdateMonitor.BatteryStatus)
where it shutdowns
the device, and #getFailedUnlockAttempts()
, #reportFailedAttempt()
and clearFailedUnlockAttempts()
. Maybe we should rename this 'KeyguardContext'...Modifier and Type | Class and Description |
---|---|
static class |
KeyguardUpdateMonitor.BatteryStatus |
class |
KeyguardUpdateMonitor.StrongAuthTracker |
Modifier and Type | Method and Description |
---|---|
void |
clearFailedUnlockAttempts() |
void |
clearFingerprintRecognized() |
void |
dispatchBootCompleted()
This is exposed since
Intent.ACTION_BOOT_COMPLETED is not sticky. |
void |
dispatchDreamingStarted() |
void |
dispatchDreamingStopped() |
void |
dispatchFinishedGoingToSleep(int why) |
void |
dispatchScreenTurnedOff() |
void |
dispatchScreenTurnedOn() |
void |
dispatchSetBackground(Bitmap bmp)
IMPORTANT: Must be called from UI thread.
|
void |
dispatchStartedGoingToSleep(int why) |
void |
dispatchStartedWakingUp() |
void |
dump(FileDescriptor fd,
PrintWriter pw,
String[] args) |
com.android.keyguard.KeyguardUpdateMonitor.DisplayClientState |
getCachedDisplayClientState() |
static int |
getCurrentUser() |
int |
getFailedUnlockAttempts(int userId) |
static KeyguardUpdateMonitor |
getInstance(Context context) |
int |
getNextSubIdForState(IccCardConstants.State state)
Find the next SubscriptionId for a SIM in the given state, favoring lower slot numbers first.
|
IccCardConstants.State |
getSimState(int subId) |
KeyguardUpdateMonitor.StrongAuthTracker |
getStrongAuthTracker() |
List<SubscriptionInfo> |
getSubscriptionInfo(boolean forceReload) |
SubscriptionInfo |
getSubscriptionInfoForSubId(int subId) |
boolean |
getUserCanSkipBouncer(int userId) |
boolean |
getUserHasTrust(int userId) |
boolean |
getUserTrustIsManaged(int userId) |
protected void |
handleBootCompleted()
Handle
MSG_BOOT_COMPLETED |
protected void |
handleDevicePolicyManagerStateChanged()
Handle
MSG_DPM_STATE_CHANGED |
protected void |
handleDeviceProvisioned()
Handle
MSG_DEVICE_PROVISIONED |
protected void |
handleFinishedGoingToSleep(int arg1) |
protected void |
handlePhoneStateChanged(String newState)
Handle
MSG_PHONE_STATE_CHANGED |
protected void |
handleRingerModeChange(int mode)
Handle
MSG_RINGER_MODE_CHANGED |
protected void |
handleSimSubscriptionInfoChanged() |
protected void |
handleStartedGoingToSleep(int arg1) |
protected void |
handleStartedWakingUp() |
protected void |
handleUserSwitchComplete(int userId)
Handle
MSG_USER_SWITCH_COMPLETE |
protected void |
handleUserSwitching(int userId,
IRemoteCallback reply)
Handle
MSG_USER_SWITCHING |
boolean |
hasBootCompleted()
We need to store this state in the KeyguardUpdateMonitor since this class will not be
destroyed.
|
boolean |
hasFingerprintUnlockTimedOut(int userId) |
boolean |
hasLockscreenWallpaper() |
boolean |
isDeviceInteractive() |
boolean |
isDeviceProvisioned() |
boolean |
isFaceUnlockRunning(int userId) |
boolean |
isFingerprintDetectionRunning() |
boolean |
isGoingToSleep() |
boolean |
isSimPinSecure() |
static boolean |
isSimPinSecure(IccCardConstants.State state) |
boolean |
isSimPinVoiceSecure() |
boolean |
isUnlockingWithFingerprintAllowed() |
boolean |
isUnlockWithFingerprintPossible(int userId) |
boolean |
needsSlowUnlockTransition() |
void |
onKeyguardVisibilityChanged(boolean showing)
Notifies that the visibility state of Keyguard has changed.
|
void |
onTrustChanged(boolean enabled,
int userId,
int flags)
Reports that the trust state has changed.
|
void |
onTrustManagedChanged(boolean managed,
int userId)
Reports that whether trust is managed has changed
|
void |
registerCallback(KeyguardUpdateMonitorCallback callback)
Register to receive notifications about general keyguard information
(see
InfoCallback . |
void |
removeCallback(KeyguardUpdateMonitorCallback callback)
Remove the given observer's callback.
|
void |
reportEmergencyCallAction(boolean bypassHandler)
Report that the emergency call button has been pressed and the emergency dialer is
about to be displayed.
|
void |
reportFailedStrongAuthUnlockAttempt(int userId) |
void |
reportSimUnlocked(int subId)
Report that the user successfully entered the SIM PIN or PUK/SIM PIN so we
have the information earlier than waiting for the intent
broadcast from the telephony code.
|
void |
reportSuccessfulStrongAuthUnlockAttempt() |
void |
sendKeyguardBouncerChanged(boolean showingBouncer) |
void |
sendKeyguardReset() |
static void |
setCurrentUser(int currentUser) |
void |
setHasLockscreenWallpaper(boolean hasLockscreenWallpaper)
Update the state whether Keyguard currently has a lockscreen wallpaper.
|
public static void setCurrentUser(int currentUser)
public static int getCurrentUser()
public void onTrustChanged(boolean enabled, int userId, int flags)
TrustManager.TrustListener
onTrustChanged
in interface TrustManager.TrustListener
enabled
- if true, the system believes the environment to be trusted.userId
- the user, for which the trust changed.flags
- flags specified by the trust agent when granting trust. See
TrustAgentService.grantTrust(CharSequence, long, int)
.protected void handleSimSubscriptionInfoChanged()
public List<SubscriptionInfo> getSubscriptionInfo(boolean forceReload)
public void onTrustManagedChanged(boolean managed, int userId)
TrustManager.TrustListener
onTrustManagedChanged
in interface TrustManager.TrustListener
managed
- if true, at least one trust agent is managing trust.userId
- the user, for which the state changed.public boolean isFaceUnlockRunning(int userId)
public boolean isFingerprintDetectionRunning()
public boolean getUserCanSkipBouncer(int userId)
public boolean getUserHasTrust(int userId)
public boolean getUserTrustIsManaged(int userId)
public boolean isUnlockingWithFingerprintAllowed()
public boolean needsSlowUnlockTransition()
public KeyguardUpdateMonitor.StrongAuthTracker getStrongAuthTracker()
public boolean hasFingerprintUnlockTimedOut(int userId)
public void reportSuccessfulStrongAuthUnlockAttempt()
public static KeyguardUpdateMonitor getInstance(Context context)
protected void handleStartedWakingUp()
protected void handleStartedGoingToSleep(int arg1)
protected void handleFinishedGoingToSleep(int arg1)
public void dispatchSetBackground(Bitmap bmp)
public boolean isUnlockWithFingerprintPossible(int userId)
public void setHasLockscreenWallpaper(boolean hasLockscreenWallpaper)
hasLockscreenWallpaper
- Whether Keyguard has a lockscreen wallpaper.public boolean hasLockscreenWallpaper()
protected void handleDevicePolicyManagerStateChanged()
MSG_DPM_STATE_CHANGED
protected void handleUserSwitching(int userId, IRemoteCallback reply)
MSG_USER_SWITCHING
protected void handleUserSwitchComplete(int userId)
MSG_USER_SWITCH_COMPLETE
public void dispatchBootCompleted()
Intent.ACTION_BOOT_COMPLETED
is not sticky. If
keyguard crashes sometime after boot, then it will never receive this
broadcast and hence not handle the event. This method is ultimately called by
PhoneWindowManager in this case.protected void handleBootCompleted()
MSG_BOOT_COMPLETED
public boolean hasBootCompleted()
protected void handleDeviceProvisioned()
MSG_DEVICE_PROVISIONED
protected void handlePhoneStateChanged(String newState)
MSG_PHONE_STATE_CHANGED
protected void handleRingerModeChange(int mode)
MSG_RINGER_MODE_CHANGED
public void onKeyguardVisibilityChanged(boolean showing)
Needs to be called from the main thread.
public void removeCallback(KeyguardUpdateMonitorCallback callback)
callback
- The callback to removepublic void registerCallback(KeyguardUpdateMonitorCallback callback)
InfoCallback
.callback
- The callback to registerpublic void sendKeyguardReset()
public void sendKeyguardBouncerChanged(boolean showingBouncer)
handleKeyguardBouncerChanged(int)
public void reportSimUnlocked(int subId)
public void reportEmergencyCallAction(boolean bypassHandler)
bypassHandler
- runs immediately.
NOTE: Must be called from UI thread if bypassHandler == true.public boolean isDeviceProvisioned()
public void clearFailedUnlockAttempts()
public int getFailedUnlockAttempts(int userId)
public void reportFailedStrongAuthUnlockAttempt(int userId)
public void clearFingerprintRecognized()
public boolean isSimPinVoiceSecure()
public boolean isSimPinSecure()
public IccCardConstants.State getSimState(int subId)
public static boolean isSimPinSecure(IccCardConstants.State state)
public com.android.keyguard.KeyguardUpdateMonitor.DisplayClientState getCachedDisplayClientState()
public void dispatchStartedWakingUp()
public void dispatchStartedGoingToSleep(int why)
public void dispatchFinishedGoingToSleep(int why)
public void dispatchScreenTurnedOn()
public void dispatchScreenTurnedOff()
public void dispatchDreamingStarted()
public void dispatchDreamingStopped()
public boolean isDeviceInteractive()
public boolean isGoingToSleep()
public int getNextSubIdForState(IccCardConstants.State state)
state
- SubscriptionManager.INVALID_SUBSCRIPTION_ID
if none foundpublic SubscriptionInfo getSubscriptionInfoForSubId(int subId)
public void dump(FileDescriptor fd, PrintWriter pw, String[] args)