diff options
author | Kenny Root <kroot@google.com> | 2011-07-27 11:11:19 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2011-08-15 17:26:31 -0700 |
commit | 5ab2157bf1f105b02d3e2913cd3a33f9765b74ca (patch) | |
tree | 5c2241ddca3526545b73472ed0006eaba0439da1 /cmds/pm/src | |
parent | dd7bc9f457204e60feeea53b0b12ba706d6964df (diff) | |
download | frameworks_base-5ab2157bf1f105b02d3e2913cd3a33f9765b74ca.zip frameworks_base-5ab2157bf1f105b02d3e2913cd3a33f9765b74ca.tar.gz frameworks_base-5ab2157bf1f105b02d3e2913cd3a33f9765b74ca.tar.bz2 |
Infrastructure to support package verifier
Allow a package verifier to approve or disapprove of a package being
installed.
Change-Id: Ibfea0f2b1aaa4ab1589a4e59f96144702b9bf94b
Diffstat (limited to 'cmds/pm/src')
-rw-r--r-- | cmds/pm/src/com/android/commands/pm/Pm.java | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java index c980715..0ec007c 100644 --- a/cmds/pm/src/com/android/commands/pm/Pm.java +++ b/cmds/pm/src/com/android/commands/pm/Pm.java @@ -772,18 +772,33 @@ public final class Pm { } } - String apkFilePath = nextArg(); + final Uri apkURI; + final Uri verificationURI; + + // Populate apkURI, must be present + final String apkFilePath = nextArg(); System.err.println("\tpkg: " + apkFilePath); - if (apkFilePath == null) { + if (apkFilePath != null) { + apkURI = Uri.fromFile(new File(apkFilePath)); + } else { System.err.println("Error: no package specified"); showUsage(); return; } + // Populate verificationURI, optionally present + final String verificationFilePath = nextArg(); + if (verificationFilePath != null) { + System.err.println("\tver: " + verificationFilePath); + verificationURI = Uri.fromFile(new File(verificationFilePath)); + } else { + verificationURI = null; + } + PackageInstallObserver obs = new PackageInstallObserver(); try { - mPm.installPackage(Uri.fromFile(new File(apkFilePath)), obs, installFlags, - installerPackageName); + mPm.installPackageWithVerification(apkURI, obs, installFlags, installerPackageName, + verificationURI, null); synchronized (obs) { while (!obs.finished) { |