summaryrefslogtreecommitdiffstats
path: root/core/java/com/android/internal/widget/LockPatternUtils.java
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2012-09-21 17:31:08 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-21 17:31:09 -0700
commit6eeff850b245bd3be3a0e782cd9f28daadf922dc (patch)
treede9ddc293506564961d74637cab7c90a1fe9e422 /core/java/com/android/internal/widget/LockPatternUtils.java
parent0a5c5567f2d7e203d95c80a8d3353d0acd98b5f9 (diff)
parent25645d8bbcced4416122d5dadedcf030a7bc12e5 (diff)
downloadframeworks_base-6eeff850b245bd3be3a0e782cd9f28daadf922dc.zip
frameworks_base-6eeff850b245bd3be3a0e782cd9f28daadf922dc.tar.gz
frameworks_base-6eeff850b245bd3be3a0e782cd9f28daadf922dc.tar.bz2
Merge "Remove UID checks from LockPatternUtils" into jb-mr1-dev
Diffstat (limited to 'core/java/com/android/internal/widget/LockPatternUtils.java')
-rw-r--r--core/java/com/android/internal/widget/LockPatternUtils.java40
1 files changed, 13 insertions, 27 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index f3bef08..c08a4b2 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -215,36 +215,26 @@ public class LockPatternUtils {
}
public void setCurrentUser(int userId) {
- if (Process.myUid() == Process.SYSTEM_UID) {
- mCurrentUserId = userId;
- } else {
- throw new SecurityException("Only the system process can set the current user");
- }
+ mCurrentUserId = userId;
}
public int getCurrentUser() {
- if (Process.myUid() == Process.SYSTEM_UID) {
- if (mCurrentUserId != UserHandle.USER_NULL) {
- // Someone is regularly updating using setCurrentUser() use that value.
- return mCurrentUserId;
- }
- try {
- return ActivityManagerNative.getDefault().getCurrentUser().id;
- } catch (RemoteException re) {
- return UserHandle.USER_OWNER;
- }
- } else {
- throw new SecurityException("Only the system process can get the current user");
+ if (mCurrentUserId != UserHandle.USER_NULL) {
+ // Someone is regularly updating using setCurrentUser() use that value.
+ return mCurrentUserId;
+ }
+ try {
+ return ActivityManagerNative.getDefault().getCurrentUser().id;
+ } catch (RemoteException re) {
+ return UserHandle.USER_OWNER;
}
}
public void removeUser(int userId) {
- if (Process.myUid() == Process.SYSTEM_UID) {
- try {
- getLockSettings().removeUser(userId);
- } catch (RemoteException re) {
- Log.e(TAG, "Couldn't remove lock settings for user " + userId);
- }
+ try {
+ getLockSettings().removeUser(userId);
+ } catch (RemoteException re) {
+ Log.e(TAG, "Couldn't remove lock settings for user " + userId);
}
}
@@ -591,10 +581,6 @@ public class LockPatternUtils {
// Compute the hash
final byte[] hash = passwordToHash(password);
try {
- if (Process.myUid() != Process.SYSTEM_UID && userHandle != UserHandle.myUserId()) {
- throw new SecurityException(
- "Only the system process can save lock password for another user");
- }
getLockSettings().setLockPassword(hash, userHandle);
DevicePolicyManager dpm = getDevicePolicyManager();
KeyStore keyStore = KeyStore.getInstance();