summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/pm
diff options
context:
space:
mode:
authorSuchi Amalapurapu <asuchitra@google.com>2010-02-12 09:43:29 -0800
committerSuchi Amalapurapu <asuchitra@google.com>2010-02-12 18:50:47 -0800
commit5b993ce7bc29e43a3215a50ce6ce5d6550d4e5e2 (patch)
treefc25f9f6adee005c287454a74837f6cbc1a072a0 /core/java/android/content/pm
parent70251b1704b9bb81443e7533d365400645dd5eaa (diff)
downloadframeworks_base-5b993ce7bc29e43a3215a50ce6ce5d6550d4e5e2.zip
frameworks_base-5b993ce7bc29e43a3215a50ce6ce5d6550d4e5e2.tar.gz
frameworks_base-5b993ce7bc29e43a3215a50ce6ce5d6550d4e5e2.tar.bz2
Include install location preference when installing packages.
Changes include Add new remote call in default container service to determine install location. Rename INSTALL_ON_SDCARD Remove recommentAppInstall method Add some additional flags used in remote stubs. Move check for protected apps prior to copy. Unit tests DefaultContainerService first parses the file uri(if content uri is specified it returns a default install internal only value) and returns a recommended location. Based on which the temporary id is determined either a file name or a container id and the file is copied there. This is then later renamed during install. Todo's light weight parsing of package when determining location since we just need the install location attribute only when finding out recomended location. This will also enable to move the check for updated system apps(cannot be on sdcard) prior to copying.
Diffstat (limited to 'core/java/android/content/pm')
-rw-r--r--core/java/android/content/pm/PackageManager.java34
1 files changed, 9 insertions, 25 deletions
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 17bee48..ff2ed3d 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -258,14 +258,7 @@ public abstract class PackageManager {
* package has to be installed on the sdcard.
* @hide
*/
- public static final int INSTALL_ON_SDCARD = 0x00000008;
-
- /**
- * Convenience flag parameter to indicate that this package has to be installed
- * on internal flash.
- * @hide
- */
- public static final int INSTALL_ON_INTERNAL_FLASH = 0x00000000;
+ public static final int INSTALL_EXTERNAL = 0x00000008;
/**
* Flag parameter for
@@ -529,6 +522,14 @@ public abstract class PackageManager {
public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109;
/**
+ * Installation failed return code: this is passed to the {@link IPackageInstallObserver} by
+ * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
+ * if the system failed to install the package because of system issues.
+ * @hide
+ */
+ public static final int INSTALL_FAILED_INTERNAL_ERROR = -110;
+
+ /**
* Indicates the state of installation. Used by PackageManager to
* figure out incomplete installations. Say a package is being installed
* (the state is set to PKG_INSTALL_INCOMPLETE) and remains so till
@@ -627,23 +628,6 @@ public abstract class PackageManager {
*/
public static final String ACTION_CLEAN_EXTERNAL_STORAGE
= "android.content.pm.CLEAN_EXTERNAL_STORAGE";
-
- /**
- * Determines best place to install an application: either SD or internal FLASH.
- * If applications explicitly set installLocation in their manifest, that
- * preference takes precedence. If not a recommended location is returned
- * based on current available storage on internal flash or sdcard.
- * @param pkgInfo PackageParser.Package of the package that is to be installed.
- * Call utility method to obtain.
- * @return {@link INSTALL_ON_INTERNAL_FLASH} if it is best to install package on internal
- * storage, {@link INSTALL_ON_SDCARD} if it is best to install package on SD card,
- * and {@link INSTALL_FAILED_INSUFFICIENT_STORAGE} if insufficient space to safely install
- * the application. {@link INSTALL_PARSE_FAILED_NOT_APK} Is returned if any input
- * parameter is <code>null</code>.
- * This recommendation does take into account the package's own flags.
- * @hide
- */
- public abstract int recommendAppInstallLocation(PackageParser.Package pkg);
/**
* Retrieve overall information about an application package that is