diff options
author | Jeff Sharkey <jsharkey@google.com> | 2014-08-21 17:42:01 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-21 17:42:02 +0000 |
commit | a0b805715a12391b6b06c0be8a85db51d6785343 (patch) | |
tree | a2d6cc127893c030c0f543fbaac0cd5ca40702a5 /services | |
parent | 223ddaa74d39cb0afabd2d3f3e4ae3ae4bdba572 (diff) | |
parent | e812d9096915ad165de125520ed7371009587d1f (diff) | |
download | frameworks_base-a0b805715a12391b6b06c0be8a85db51d6785343.zip frameworks_base-a0b805715a12391b6b06c0be8a85db51d6785343.tar.gz frameworks_base-a0b805715a12391b6b06c0be8a85db51d6785343.tar.bz2 |
Merge "Clear identity before calling out to PackageHelper" into lmp-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/pm/PackageInstallerService.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java index 03cb2e9..5e802de 100644 --- a/services/core/java/com/android/server/pm/PackageInstallerService.java +++ b/services/core/java/com/android/server/pm/PackageInstallerService.java @@ -485,17 +485,22 @@ public class PackageInstallerService extends IPackageInstaller.Stub { if (params.mode == SessionParams.MODE_FULL_INSTALL) { // Brand new install, use best resolved location. This also verifies // that target has enough free space for the install. - final int resolved = PackageHelper.resolveInstallLocation(mContext, - params.appPackageName, params.installLocation, params.sizeBytes, - params.installFlags); - if (resolved == PackageHelper.RECOMMEND_INSTALL_INTERNAL) { - stageInternal = true; - } else if (resolved == PackageHelper.RECOMMEND_INSTALL_EXTERNAL) { - stageInternal = false; - } else { - throw new IOException("No storage with enough free space; res=" + resolved); + final long ident = Binder.clearCallingIdentity(); + try { + final int resolved = PackageHelper.resolveInstallLocation(mContext, + params.appPackageName, params.installLocation, params.sizeBytes, + params.installFlags); + + if (resolved == PackageHelper.RECOMMEND_INSTALL_INTERNAL) { + stageInternal = true; + } else if (resolved == PackageHelper.RECOMMEND_INSTALL_EXTERNAL) { + stageInternal = false; + } else { + throw new IOException("No storage with enough free space; res=" + resolved); + } + } finally { + Binder.restoreCallingIdentity(ident); } - } else if (params.mode == SessionParams.MODE_INHERIT_EXISTING) { // We always stage inheriting sessions on internal storage first, // since we don't want to grow containers until we're sure that |