Clear calling identity before calling mountService

Apps that change the password shouldn't need the STORAGE_INTERNAL
permission.

Bug: 27600227
Change-Id: I73e86c3400c19e9b1cea786dc472ab571ac18803
This commit is contained in:
Paul Crowley
2016-03-29 14:14:48 -07:00
parent 11c041576d
commit 815036f055

View File

@@ -787,7 +787,13 @@ public class LockSettingsService extends ILockSettings.Stub {
private void changeUserKey(int userId, byte[] token, byte[] secret)
throws RemoteException {
final UserInfo userInfo = UserManager.get(mContext).getUserInfo(userId);
getMountService().changeUserKey(userId, userInfo.serialNumber, token, null, secret);
final IMountService mountService = getMountService();
final long callingId = Binder.clearCallingIdentity();
try {
mountService.changeUserKey(userId, userInfo.serialNumber, token, null, secret);
} finally {
Binder.restoreCallingIdentity(callingId);
}
}
@Override