From e515c6495d2ad6317303617ba20509b4e8aa7654 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 28 Aug 2015 11:20:39 -0700 Subject: Give shell permission to move apps. Also clear identity when measuring ASEC sizes to relax a second permission requirement. Bug: 23600574 Change-Id: Ib3a104426758e0e8f35dff0e504fe874bed7311f --- packages/Shell/AndroidManifest.xml | 1 + .../java/com/android/server/pm/PackageManagerService.java | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml index 37e0db0..d785cca 100644 --- a/packages/Shell/AndroidManifest.xml +++ b/packages/Shell/AndroidManifest.xml @@ -65,6 +65,7 @@ + diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 74200cb..6d4d900 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -13600,9 +13600,14 @@ public class PackageManagerService extends IPackageManager.Stub { libDirRoot = ps.legacyNativeLibraryPathString; } if (p != null && (isExternal(p) || p.isForwardLocked())) { - String secureContainerId = cidFromCodePath(p.applicationInfo.getBaseCodePath()); - if (secureContainerId != null) { - asecPath = PackageHelper.getSdFilesystem(secureContainerId); + final long token = Binder.clearCallingIdentity(); + try { + String secureContainerId = cidFromCodePath(p.applicationInfo.getBaseCodePath()); + if (secureContainerId != null) { + asecPath = PackageHelper.getSdFilesystem(secureContainerId); + } + } finally { + Binder.restoreCallingIdentity(token); } } } -- cgit v1.1