diff options
Diffstat (limited to 'services/java/com/android/server/LockSettingsService.java')
| -rw-r--r-- | services/java/com/android/server/LockSettingsService.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/services/java/com/android/server/LockSettingsService.java b/services/java/com/android/server/LockSettingsService.java index d52a8e2..e28a258 100644 --- a/services/java/com/android/server/LockSettingsService.java +++ b/services/java/com/android/server/LockSettingsService.java @@ -57,6 +57,7 @@ import java.util.List; */ public class LockSettingsService extends ILockSettings.Stub { + private static final String PERMISSION = "android.permission.ACCESS_KEYGUARD_SECURE_STORAGE"; private final DatabaseHelper mOpenHelper; private static final String TAG = "LockSettingsService"; @@ -143,20 +144,12 @@ public class LockSettingsService extends ILockSettings.Stub { } } - private static final void checkWritePermission(int userId) { - final int callingUid = Binder.getCallingUid(); - if (UserHandle.getAppId(callingUid) != android.os.Process.SYSTEM_UID) { - throw new SecurityException("uid=" + callingUid - + " not authorized to write lock settings"); - } + private final void checkWritePermission(int userId) { + mContext.checkCallingOrSelfPermission(PERMISSION); } - private static final void checkPasswordReadPermission(int userId) { - final int callingUid = Binder.getCallingUid(); - if (UserHandle.getAppId(callingUid) != android.os.Process.SYSTEM_UID) { - throw new SecurityException("uid=" + callingUid - + " not authorized to read lock password"); - } + private final void checkPasswordReadPermission(int userId) { + mContext.checkCallingOrSelfPermission(PERMISSION); } private final void checkReadPermission(String requestedKey, int userId) { |
