diff options
author | Kenny Root <kroot@google.com> | 2011-01-16 17:25:18 -0800 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2011-01-17 11:49:22 -0800 |
commit | 34d2b41e48281d1df2c844e004740f008e699093 (patch) | |
tree | 15bb723f523d330dd8eedb0d1ebd022637d2e1b6 /services | |
parent | 4a2e478a5bf6b4650181d1dfa643eadcc387fcec (diff) | |
download | frameworks_base-34d2b41e48281d1df2c844e004740f008e699093.zip frameworks_base-34d2b41e48281d1df2c844e004740f008e699093.tar.gz frameworks_base-34d2b41e48281d1df2c844e004740f008e699093.tar.bz2 |
Revert "Add the {get,set}PackageObbPaths calls to API"
This reverts commit 6c4d904851772313930f800ac7c323cf90c709bb.
Going with a different tactic that doesn't dump stuff on
PackageManagerService.
Bug: 3214719
Change-Id: I0bbeccf3c21d264deda4256eb53713d2c98284f4
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/PackageManagerService.java | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index 39c7540..9b8a605 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -102,7 +102,6 @@ import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; -import java.lang.reflect.Array; import java.security.NoSuchAlgorithmException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -4396,8 +4395,6 @@ class PackageManagerService extends IPackageManager.Stub { } }; - private static final boolean DEBUG_OBB = false; - private static final void sendPackageBroadcast(String action, String pkg, Bundle extras, IIntentReceiver finishedReceiver) { IActivityManager am = ActivityManagerNative.getDefault(); @@ -4573,64 +4570,6 @@ class PackageManagerService extends IPackageManager.Stub { mHandler.sendMessage(msg); } - public void setPackageObbPaths(String packageName, String[] paths) { - if (DEBUG_OBB) - Log.v(TAG, "Setting .obb paths for " + packageName + " to: " + Arrays.toString(paths)); - final int uid = Binder.getCallingUid(); - final int permission = mContext.checkCallingPermission( - android.Manifest.permission.INSTALL_PACKAGES); - final boolean allowedByPermission = (permission == PackageManager.PERMISSION_GRANTED); - if (!allowedByPermission) { - throw new SecurityException("Permission denial: attempt to set .obb file from pid=" - + Binder.getCallingPid()); - } - synchronized (mPackages) { - final PackageSetting pkgSetting = mSettings.mPackages.get(packageName); - if (pkgSetting == null) { - throw new IllegalArgumentException("Unknown package: " + packageName); - } - - if (paths != null) { - if (paths.length == 0) { - // Don't bother storing an empty array. - paths = null; - } else { - // Don't allow the caller to manipulate our copy of the - // list. - paths = paths.clone(); - } - } - - // Only write settings file if the new and old settings are not the - // same. - if (!Arrays.equals(paths, pkgSetting.obbPathStrings)) { - pkgSetting.obbPathStrings = paths; - mSettings.writeLP(); - } - } - } - - public String[] getPackageObbPaths(String packageName) { - if (DEBUG_OBB) - Log.v(TAG, "Getting .obb paths for " + packageName); - final int uid = Binder.getCallingUid(); - final int permission = mContext.checkCallingPermission( - android.Manifest.permission.INSTALL_PACKAGES); - final boolean allowedByPermission = (permission == PackageManager.PERMISSION_GRANTED); - synchronized (mPackages) { - final PackageSetting pkgSetting = mSettings.mPackages.get(packageName); - if (pkgSetting == null) { - throw new IllegalArgumentException("Unknown package: " + packageName); - } - if (!allowedByPermission && (uid != pkgSetting.userId)) { - throw new SecurityException("Permission denial: attempt to set .obb file from pid=" - + Binder.getCallingPid() + ", uid=" + uid + ", package uid=" - + pkgSetting.userId); - } - return pkgSetting.obbPathStrings; - } - } - private void processPendingInstall(final InstallArgs args, final int currentStatus) { // Queue up an async operation since the package installation may take a little while. mHandler.post(new Runnable() { @@ -7200,7 +7139,6 @@ class PackageManagerService extends IPackageManager.Stub { pw.print(" codePath="); pw.println(ps.codePathString); pw.print(" resourcePath="); pw.println(ps.resourcePathString); pw.print(" nativeLibraryPath="); pw.println(ps.nativeLibraryPathString); - pw.print(" obbPaths="); pw.println(Arrays.toString(ps.obbPathStrings)); pw.print(" versionCode="); pw.println(ps.versionCode); if (ps.pkg != null) { pw.print(" versionName="); pw.println(ps.pkg.mVersionName); @@ -7778,7 +7716,6 @@ class PackageManagerService extends IPackageManager.Stub { File resourcePath; String resourcePathString; String nativeLibraryPathString; - String[] obbPathStrings; long timeStamp; long firstInstallTime; long lastUpdateTime; @@ -7824,11 +7761,6 @@ class PackageManagerService extends IPackageManager.Stub { resourcePath = base.resourcePath; resourcePathString = base.resourcePathString; nativeLibraryPathString = base.nativeLibraryPathString; - - if (base.obbPathStrings != null) { - obbPathStrings = base.obbPathStrings.clone(); - } - timeStamp = base.timeStamp; firstInstallTime = base.firstInstallTime; lastUpdateTime = base.lastUpdateTime; @@ -8887,16 +8819,6 @@ class PackageManagerService extends IPackageManager.Stub { if (pkg.installerPackageName != null) { serializer.attribute(null, "installer", pkg.installerPackageName); } - if (pkg.obbPathStrings != null && pkg.obbPathStrings.length > 0) { - int N = pkg.obbPathStrings.length; - serializer.startTag(null, "obbs"); - for (int i = 0; i < N; i++) { - serializer.startTag(null, "obb"); - serializer.attribute(null, "path", pkg.obbPathStrings[i]); - serializer.endTag(null, "obb"); - } - serializer.endTag(null, "obbs"); - } pkg.signatures.writeXml(serializer, "sigs", mPastSignatures); if ((pkg.pkgFlags&ApplicationInfo.FLAG_SYSTEM) == 0) { serializer.startTag(null, "perms"); @@ -9489,8 +9411,6 @@ class PackageManagerService extends IPackageManager.Stub { readGrantedPermissionsLP(parser, packageSetting.grantedPermissions); packageSetting.permissionsFixed = true; - } else if (tagName.equals("obbs")) { - readObbPathsLP(packageSetting, parser); } else { reportSettingsProblem(Log.WARN, "Unknown element under <package>: " @@ -9695,34 +9615,6 @@ class PackageManagerService extends IPackageManager.Stub { } } - private void readObbPathsLP(PackageSettingBase packageSetting, XmlPullParser parser) - throws XmlPullParserException, IOException { - final List<String> obbPaths = new ArrayList<String>(); - final int outerDepth = parser.getDepth(); - int type; - while ((type = parser.next()) != XmlPullParser.END_DOCUMENT - && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { - if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) { - continue; - } - - final String tagName = parser.getName(); - if (tagName.equals("obb")) { - final String path = parser.getAttributeValue(null, "path"); - obbPaths.add(path); - } else { - reportSettingsProblem(Log.WARN, "Unknown element under <obbs>: " - + parser.getName()); - } - XmlUtils.skipCurrentTag(parser); - } - if (obbPaths.size() == 0) { - return; - } else { - packageSetting.obbPathStrings = obbPaths.toArray(new String[obbPaths.size()]); - } - } - // Returns -1 if we could not find an available UserId to assign private int newUserIdLP(Object obj) { // Let's be stupidly inefficient for now... |