summaryrefslogtreecommitdiffstats
path: root/cmds/pm
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2014-07-13 17:33:07 -0700
committerJeff Sharkey <jsharkey@android.com>2014-07-14 10:57:04 -0700
commitad11eb52fe62b6696df2194cb9e176f7d799e844 (patch)
tree440f9699b759d4b14b20a9280234d352faf2b0ce /cmds/pm
parent5c6a8e322227354acbded5c49f44c0b289021bf5 (diff)
downloadframeworks_base-ad11eb52fe62b6696df2194cb9e176f7d799e844.zip
frameworks_base-ad11eb52fe62b6696df2194cb9e176f7d799e844.tar.gz
frameworks_base-ad11eb52fe62b6696df2194cb9e176f7d799e844.tar.bz2
Pass install result message; path selection.
Oops, forgot to include message argument to invoke the new-style callback. Also use more robust way of generating cluster APK directory names, and add more logging details on rename failure. Change-Id: Ifa8abdd1db58b73e13b9a8077ec126cf20a0d90e
Diffstat (limited to 'cmds/pm')
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java40
1 files changed, 19 insertions, 21 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index 3d0eec4..3a2ca30 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -50,6 +50,7 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.UserManager;
+import android.text.TextUtils;
import android.util.Log;
import com.android.internal.content.PackageHelper;
@@ -923,33 +924,13 @@ public final class Pm {
return;
}
} else if (opt.equals("--abi")) {
- abi = nextOptionData();
- if (abi == null) {
- System.err.println("Error: must supply argument for --abi");
- return;
- }
+ abi = checkAbiArgument(nextOptionData());
} else {
System.err.println("Error: Unknown option: " + opt);
return;
}
}
- if (abi != null) {
- final String[] supportedAbis = Build.SUPPORTED_ABIS;
- boolean matched = false;
- for (String supportedAbi : supportedAbis) {
- if (supportedAbi.equals(abi)) {
- matched = true;
- break;
- }
- }
-
- if (!matched) {
- System.err.println("Error: abi " + abi + " not supported on this device.");
- return;
- }
- }
-
final Uri verificationURI;
final Uri originatingURI;
final Uri referrerURI;
@@ -1044,6 +1025,8 @@ public final class Pm {
} else if (opt.equals("-S")) {
params.deltaSize = Long.parseLong(nextOptionData());
params.progressMax = (int) params.deltaSize;
+ } else if (opt.equals("--abi")) {
+ params.abiOverride = checkAbiArgument(nextOptionData());
} else {
throw new IllegalArgumentException("Unknown option " + opt);
}
@@ -1684,6 +1667,21 @@ public final class Pm {
}
}
+ private static String checkAbiArgument(String abi) {
+ if (TextUtils.isEmpty(abi)) {
+ throw new IllegalArgumentException("Missing ABI argument");
+ }
+
+ final String[] supportedAbis = Build.SUPPORTED_ABIS;
+ for (String supportedAbi : supportedAbis) {
+ if (supportedAbi.equals(abi)) {
+ return abi;
+ }
+ }
+
+ throw new IllegalArgumentException("ABI " + abi + " not supported on this device");
+ }
+
private String nextOption() {
if (mNextArg >= mArgs.length) {
return null;