From 6c8187282ecc20419a5a70371bc6a21af6d364e0 Mon Sep 17 00:00:00 2001 From: Toni Barzic Date: Fri, 27 May 2016 09:18:39 -0700 Subject: [PATCH] Clear calling identity before calling mountService Change I8106bfba28da401b9fd38349c6a9fa9a24f54712 unwittingly reintroduced requirement for apps that change password to have STORAGE_INTERNAL permission. This fixes the problem by clearing calling identity before calling mountServce in fixateNewestUserKeyAuth, like it's done in addUserKeyAuth. BUG=28154455 BUG=27600227 Change-Id: I1bcd9f6eefa892b021d93df2638c8dba4d4b5400 --- .../core/java/com/android/server/LockSettingsService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java index fb1021ee50d71..eeb20bf03d123 100644 --- a/services/core/java/com/android/server/LockSettingsService.java +++ b/services/core/java/com/android/server/LockSettingsService.java @@ -1145,7 +1145,13 @@ public class LockSettingsService extends ILockSettings.Stub { private void fixateNewestUserKeyAuth(int userId) throws RemoteException { - getMountService().fixateNewestUserKeyAuth(userId); + final IMountService mountService = getMountService(); + final long callingId = Binder.clearCallingIdentity(); + try { + mountService.fixateNewestUserKeyAuth(userId); + } finally { + Binder.restoreCallingIdentity(callingId); + } } @Override