diff options
author | Jeff Sharkey <jsharkey@android.com> | 2015-07-17 23:29:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-17 23:29:54 +0000 |
commit | c9eb398a1b0d7954b0d4f13fb46cae3042a99a75 (patch) | |
tree | a38551a5bca08ea99ce982b22d20047683f57d1e /services | |
parent | d3f327be2d1f8facd709895f2d05757351e8be07 (diff) | |
parent | b3cf95334551e55e068bf6f9d7640681cdc05e07 (diff) | |
download | frameworks_base-c9eb398a1b0d7954b0d4f13fb46cae3042a99a75.zip frameworks_base-c9eb398a1b0d7954b0d4f13fb46cae3042a99a75.tar.gz frameworks_base-c9eb398a1b0d7954b0d4f13fb46cae3042a99a75.tar.bz2 |
Merge "Clear identity when killing media provider." into mnc-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/MountService.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java index 0e158a2..92b98a7 100644 --- a/services/core/java/com/android/server/MountService.java +++ b/services/core/java/com/android/server/MountService.java @@ -740,15 +740,20 @@ class MountService extends IMountService.Stub */ @Deprecated private void killMediaProvider() { - final ProviderInfo provider = mPms.resolveContentProvider(MediaStore.AUTHORITY, 0, - UserHandle.USER_OWNER); - if (provider != null) { - final IActivityManager am = ActivityManagerNative.getDefault(); - try { - am.killApplicationWithAppId(provider.applicationInfo.packageName, - UserHandle.getAppId(provider.applicationInfo.uid), "vold reset"); - } catch (RemoteException e) { + final long token = Binder.clearCallingIdentity(); + try { + final ProviderInfo provider = mPms.resolveContentProvider(MediaStore.AUTHORITY, 0, + UserHandle.USER_OWNER); + if (provider != null) { + final IActivityManager am = ActivityManagerNative.getDefault(); + try { + am.killApplicationWithAppId(provider.applicationInfo.packageName, + UserHandle.getAppId(provider.applicationInfo.uid), "vold reset"); + } catch (RemoteException e) { + } } + } finally { + Binder.restoreCallingIdentity(token); } } |