DO NOT MERGE: KeyguardManager: Add isKeyguardLocked() and isKeyguardSecure()
BUG: 3402847 Change-Id: I7cb199763e8d5386914b4c2173c9e1579b08674c Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
@ -116,6 +116,40 @@ public class KeyguardManager {
|
|||||||
return new KeyguardLock(tag);
|
return new KeyguardLock(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* isKeyguardLocked
|
||||||
|
*
|
||||||
|
* Return whether the keyguard is currently locked.
|
||||||
|
*
|
||||||
|
* @return true if in keyguard is locked.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public boolean isKeyguardLocked() {
|
||||||
|
try {
|
||||||
|
return mWM.isKeyguardSecure();
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* isKeyguardSecure
|
||||||
|
*
|
||||||
|
* Return whether the keyguard requires a password to unlock.
|
||||||
|
*
|
||||||
|
* @return true if in keyguard is secure.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public boolean isKeyguardSecure() {
|
||||||
|
try {
|
||||||
|
return mWM.isKeyguardSecure();
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If keyguard screen is showing or in restricted key input mode (i.e. in
|
* If keyguard screen is showing or in restricted key input mode (i.e. in
|
||||||
* keyguard password emergency screen). When in such mode, certain keys,
|
* keyguard password emergency screen). When in such mode, certain keys,
|
||||||
|
@ -100,6 +100,8 @@ interface IWindowManager
|
|||||||
void disableKeyguard(IBinder token, String tag);
|
void disableKeyguard(IBinder token, String tag);
|
||||||
void reenableKeyguard(IBinder token);
|
void reenableKeyguard(IBinder token);
|
||||||
void exitKeyguardSecurely(IOnKeyguardExitResult callback);
|
void exitKeyguardSecurely(IOnKeyguardExitResult callback);
|
||||||
|
boolean isKeyguardLocked();
|
||||||
|
boolean isKeyguardSecure();
|
||||||
boolean inKeyguardRestrictedInputMode();
|
boolean inKeyguardRestrictedInputMode();
|
||||||
|
|
||||||
void closeSystemDialogs(String reason);
|
void closeSystemDialogs(String reason);
|
||||||
|
@ -753,6 +753,24 @@ public interface WindowManagerPolicy {
|
|||||||
*/
|
*/
|
||||||
void exitKeyguardSecurely(OnKeyguardExitResult callback);
|
void exitKeyguardSecurely(OnKeyguardExitResult callback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* isKeyguardLocked
|
||||||
|
*
|
||||||
|
* Return whether the keyguard is currently locked.
|
||||||
|
*
|
||||||
|
* @return true if in keyguard is locked.
|
||||||
|
*/
|
||||||
|
public boolean isKeyguardLocked();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* isKeyguardSecure
|
||||||
|
*
|
||||||
|
* Return whether the keyguard requires a password to unlock.
|
||||||
|
*
|
||||||
|
* @return true if in keyguard is secure.
|
||||||
|
*/
|
||||||
|
public boolean isKeyguardSecure();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* inKeyguardRestrictedKeyInputMode
|
* inKeyguardRestrictedKeyInputMode
|
||||||
*
|
*
|
||||||
|
@ -2430,6 +2430,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
return mKeyguardMediator.isShowingAndNotHidden();
|
return mKeyguardMediator.isShowingAndNotHidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
public boolean isKeyguardLocked() {
|
||||||
|
return keyguardOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
public boolean isKeyguardSecure() {
|
||||||
|
return mKeyguardMediator.isSecure();
|
||||||
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public boolean inKeyguardRestrictedKeyInputMode() {
|
public boolean inKeyguardRestrictedKeyInputMode() {
|
||||||
return mKeyguardMediator.isInputRestricted();
|
return mKeyguardMediator.isInputRestricted();
|
||||||
|
@ -4746,6 +4746,14 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
return mPolicy.inKeyguardRestrictedKeyInputMode();
|
return mPolicy.inKeyguardRestrictedKeyInputMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isKeyguardLocked() {
|
||||||
|
return mPolicy.isKeyguardLocked();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isKeyguardSecure() {
|
||||||
|
return mPolicy.isKeyguardSecure();
|
||||||
|
}
|
||||||
|
|
||||||
public void closeSystemDialogs(String reason) {
|
public void closeSystemDialogs(String reason) {
|
||||||
synchronized(mWindowMap) {
|
synchronized(mWindowMap) {
|
||||||
for (int i=mWindows.size()-1; i>=0; i--) {
|
for (int i=mWindows.size()-1; i>=0; i--) {
|
||||||
|
Reference in New Issue
Block a user