Disable keyguard while docked when the lock screen is insecure.

Change-Id: If6e11bb49a2cbbe904517e6037d1e8b99fe2717c
Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2009-09-28 19:08:53 -04:00
parent c031981f23
commit 733fdf34b6
2 changed files with 31 additions and 4 deletions

View File

@@ -3965,7 +3965,7 @@ public class WindowManagerService extends IWindowManager.Stub
// -------------------------------------------------------------
public void disableKeyguard(IBinder token, String tag) {
if (mContext.checkCallingPermission(android.Manifest.permission.DISABLE_KEYGUARD)
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD)
!= PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Requires DISABLE_KEYGUARD permission");
}
@@ -3973,7 +3973,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
public void reenableKeyguard(IBinder token) {
if (mContext.checkCallingPermission(android.Manifest.permission.DISABLE_KEYGUARD)
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD)
!= PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Requires DISABLE_KEYGUARD permission");
}
@@ -3999,7 +3999,7 @@ public class WindowManagerService extends IWindowManager.Stub
* @see android.app.KeyguardManager#exitKeyguardSecurely
*/
public void exitKeyguardSecurely(final IOnKeyguardExitResult callback) {
if (mContext.checkCallingPermission(android.Manifest.permission.DISABLE_KEYGUARD)
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD)
!= PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Requires DISABLE_KEYGUARD permission");
}