diff options
author | rich cannings <richc@google.com> | 2012-07-26 14:09:49 -0700 |
---|---|---|
committer | rich cannings <richc@google.com> | 2012-08-02 11:31:17 -0700 |
commit | 076ca8c8373a3d5f3f56103fa85966cc6c34c94a (patch) | |
tree | 92728ab79dec040cbc3d31e8b1dfe1f0be95d028 /src/com/android | |
parent | 879c1fadd28cf825cb22067b405ea86ffd44db80 (diff) | |
download | packages_apps_packageinstaller-076ca8c8373a3d5f3f56103fa85966cc6c34c94a.zip packages_apps_packageinstaller-076ca8c8373a3d5f3f56103fa85966cc6c34c94a.tar.gz packages_apps_packageinstaller-076ca8c8373a3d5f3f56103fa85966cc6c34c94a.tar.bz2 |
Accept and pass URLs to PackageManagerService
This change passes the originating URI and referrer of an apk, when
available, to the package manager.
Bug: 6544677
Change-Id: I6b1036012399f6cd42feceedeca2493b6b20501a
Diffstat (limited to 'src/com/android')
-rwxr-xr-x | src/com/android/packageinstaller/InstallAppProgress.java | 7 | ||||
-rw-r--r-- | src/com/android/packageinstaller/PackageInstallerActivity.java | 12 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/com/android/packageinstaller/InstallAppProgress.java b/src/com/android/packageinstaller/InstallAppProgress.java index 8bfcd4f..6e471cb 100755 --- a/src/com/android/packageinstaller/InstallAppProgress.java +++ b/src/com/android/packageinstaller/InstallAppProgress.java @@ -243,8 +243,13 @@ public class InstallAppProgress extends Activity implements View.OnClickListener String installerPackageName = getIntent().getStringExtra( Intent.EXTRA_INSTALLER_PACKAGE_NAME); + Uri originatingURI = getIntent().getParcelableExtra(Intent.EXTRA_ORIGINATING_URI); + Uri referrer = getIntent().getParcelableExtra(Intent.EXTRA_REFERRER); + PackageInstallObserver observer = new PackageInstallObserver(); - pm.installPackage(mPackageURI, observer, installFlags, installerPackageName); + + pm.installPackageWithOrigin(mPackageURI, observer, installFlags, + installerPackageName, originatingURI, referrer); } @Override diff --git a/src/com/android/packageinstaller/PackageInstallerActivity.java b/src/com/android/packageinstaller/PackageInstallerActivity.java index 9963103..d76295a 100644 --- a/src/com/android/packageinstaller/PackageInstallerActivity.java +++ b/src/com/android/packageinstaller/PackageInstallerActivity.java @@ -60,7 +60,9 @@ import java.util.ArrayList; */ public class PackageInstallerActivity extends Activity implements OnCancelListener, OnClickListener { private static final String TAG = "PackageInstaller"; - private Uri mPackageURI; + private Uri mPackageURI; + private Uri mPackageOriginatingURI; + private Uri mPackageReferrer; private boolean localLOGV = false; PackageManager mPm; PackageParser.Package mPkgInfo; @@ -284,6 +286,8 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen // get intent information final Intent intent = getIntent(); mPackageURI = intent.getData(); + mPackageOriginatingURI = intent.getParcelableExtra(Intent.EXTRA_ORIGINATING_URI); + mPackageReferrer = intent.getParcelableExtra(Intent.EXTRA_REFERRER); mPm = getPackageManager(); final String scheme = mPackageURI.getScheme(); @@ -364,6 +368,12 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen newIntent.setData(mPackageURI); newIntent.setClass(this, InstallAppProgress.class); String installerPackageName = getIntent().getStringExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME); + if (mPackageOriginatingURI != null) { + newIntent.putExtra(Intent.EXTRA_ORIGINATING_URI, mPackageOriginatingURI); + } + if (mPackageReferrer != null) { + newIntent.putExtra(Intent.EXTRA_REFERRER, mPackageReferrer); + } if (installerPackageName != null) { newIntent.putExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME, installerPackageName); } |