Loading core/java/com/android/internal/widget/LockPatternUtils.java +13 −27 Original line number Diff line number Diff line Loading @@ -215,15 +215,10 @@ 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"); } } 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; Loading @@ -233,20 +228,15 @@ public class LockPatternUtils { } catch (RemoteException re) { return UserHandle.USER_OWNER; } } else { throw new SecurityException("Only the system process can get the current user"); } } 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); } } } private int getCurrentOrCallingUserId() { int callingUid = Binder.getCallingUid(); Loading Loading @@ -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(); Loading Loading
core/java/com/android/internal/widget/LockPatternUtils.java +13 −27 Original line number Diff line number Diff line Loading @@ -215,15 +215,10 @@ 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"); } } 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; Loading @@ -233,20 +228,15 @@ public class LockPatternUtils { } catch (RemoteException re) { return UserHandle.USER_OWNER; } } else { throw new SecurityException("Only the system process can get the current user"); } } 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); } } } private int getCurrentOrCallingUserId() { int callingUid = Binder.getCallingUid(); Loading Loading @@ -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(); Loading