summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Montemayor <oam@google.com>2010-01-28 15:12:14 -0800
committerOscar Montemayor <oam@google.com>2010-01-28 21:03:52 -0800
commit2f32397f47118c6e870421965fba650a51886ffc (patch)
treee43d3d0d368c6897cf8a292c70d1b58069b17c20
parent9629a925eded634556b444d6d11985894dfb9f6a (diff)
downloadandroid_packages_apps_PackageInstaller-2f32397f47118c6e870421965fba650a51886ffc.zip
android_packages_apps_PackageInstaller-2f32397f47118c6e870421965fba650a51886ffc.tar.gz
android_packages_apps_PackageInstaller-2f32397f47118c6e870421965fba650a51886ffc.tar.bz2
Apps on SD card project.
Modifying sideload app to recommend location where to install application package, based on application flags, total space and available space on internal and SD card storage. Currently ignoring "Do not install" recommendation.
-rwxr-xr-xsrc/com/android/packageinstaller/InstallAppProgress.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/packageinstaller/InstallAppProgress.java b/src/com/android/packageinstaller/InstallAppProgress.java
index 96fe7a7..3ef3750 100755
--- a/src/com/android/packageinstaller/InstallAppProgress.java
+++ b/src/com/android/packageinstaller/InstallAppProgress.java
@@ -29,7 +29,6 @@ import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
-import android.os.FileUtils;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
@@ -158,6 +157,16 @@ public class InstallAppProgress extends Activity implements View.OnClickListener
String installerPackageName = getIntent().getStringExtra(
Intent.EXTRA_INSTALLER_PACKAGE_NAME);
+ ApplicationInfo appInfo = PackageUtil.getApplicationInfo(mPackageURI);
+ int bestInstallLoc =
+ PackageManager.recommendAppInstallLocation(appInfo, mPackageURI);
+
+ // If best location is SD card, mark it in package flags.
+ // for the time being, ignore if the application does not fit.
+ if (bestInstallLoc != (-1)) {
+ installFlags = installFlags | bestInstallLoc;
+ }
+
PackageInstallObserver observer = new PackageInstallObserver();
pm.installPackage(mPackageURI, observer, installFlags, installerPackageName);
}