diff options
author | Jacek Surazski <jaceks@google.com> | 2009-05-13 14:52:19 +0200 |
---|---|---|
committer | Jacek Surazski <jaceks@google.com> | 2009-05-13 14:52:19 +0200 |
commit | fe069ea729efec01a8b6f16f9e76a2db4988404a (patch) | |
tree | b541fa036ba3763dd5f0f640f99773ad0190a699 /src | |
parent | c0d65ae569b5f6188383a0d0ec253b6131203f30 (diff) | |
download | packages_apps_packageinstaller-fe069ea729efec01a8b6f16f9e76a2db4988404a.zip packages_apps_packageinstaller-fe069ea729efec01a8b6f16f9e76a2db4988404a.tar.gz packages_apps_packageinstaller-fe069ea729efec01a8b6f16f9e76a2db4988404a.tar.bz2 |
PackageInstaller honors Intent.EXTRA_INSTALLER_PACKAGE_NAME
If this extra is set in the Intent which launches PackageInstaller,
PackageInstaller passes it in the call to PackageManager.installPackage().
Diffstat (limited to 'src')
-rwxr-xr-x | src/com/android/packageinstaller/InstallAppProgress.java | 5 | ||||
-rw-r--r-- | src/com/android/packageinstaller/PackageInstallerActivity.java | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/packageinstaller/InstallAppProgress.java b/src/com/android/packageinstaller/InstallAppProgress.java index 5f71a85..5b92d09 100755 --- a/src/com/android/packageinstaller/InstallAppProgress.java +++ b/src/com/android/packageinstaller/InstallAppProgress.java @@ -108,7 +108,10 @@ public class InstallAppProgress extends Activity { if((installFlags & PackageManager.INSTALL_REPLACE_EXISTING )!= 0) { Log.w(TAG, "Replacing package:"+mAppInfo.packageName); } + String installerPackageName = getIntent().getStringExtra( + Intent.EXTRA_INSTALLER_PACKAGE_NAME); + PackageInstallObserver observer = new PackageInstallObserver(); - pm.installPackage(mPackageURI, observer, installFlags, null); + pm.installPackage(mPackageURI, observer, installFlags, installerPackageName); } } diff --git a/src/com/android/packageinstaller/PackageInstallerActivity.java b/src/com/android/packageinstaller/PackageInstallerActivity.java index 29f05b4..613432c 100644 --- a/src/com/android/packageinstaller/PackageInstallerActivity.java +++ b/src/com/android/packageinstaller/PackageInstallerActivity.java @@ -113,6 +113,13 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen mPkgInfo.applicationInfo); newIntent.setData(mPackageURI); newIntent.setClass(this, cls); + + String installerPackageName = getIntent().getStringExtra( + Intent.EXTRA_INSTALLER_PACKAGE_NAME); + if (installerPackageName != null) { + newIntent.putExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME, installerPackageName); + } + if(localLOGV) Log.i(TAG, "downloaded app uri="+mPackageURI); startActivityForResult(newIntent, requestCode); } |