summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Sauer <nicksauer@google.com>2014-10-16 12:28:54 -0700
committerThe Android Automerger <android-build@google.com>2014-10-16 17:06:25 -0700
commitbdce0cfa18729ef0757367055c2d02980c1f2822 (patch)
tree6b6ab31b3d3edeb0da82c7d162f2ac17fcd1f241
parent10ea501cd22e8057b376419bd0cbffb52feeb3b5 (diff)
downloadplatform_cts-bdce0cfa18729ef0757367055c2d02980c1f2822.tar.gz
platform_cts-bdce0cfa18729ef0757367055c2d02980c1f2822.tar.bz2
platform_cts-bdce0cfa18729ef0757367055c2d02980c1f2822.zip
Fix failure to install prereq apks on fugu/arm.
bug:18015639 Change-Id: I4f061a677fedf59c07123a9afe66dcb7218824e2
-rw-r--r--tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java23
1 files changed, 17 insertions, 6 deletions
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
index 6d617ea2d1e..7aed84d0e02 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
@@ -762,15 +762,26 @@ public class CtsTest implements IDeviceTest, IResumableTest, IShardableTest, IBu
*/
private void installPrerequisiteApks(Collection<String> prerequisiteApks)
throws DeviceNotAvailableException {
+ Log.logAndDisplay(LogLevel.INFO, LOG_TAG, "Installing prerequisites");
+ Set<String> supportedAbiSet = getAbis();
for (String apkName : prerequisiteApks) {
try {
File apkFile = mCtsBuild.getTestApp(apkName);
- String errorCode = null;
- String abi = AbiFormatter.getDefaultAbi(getDevice(), mForceAbi);
- String[] options = {AbiUtils.createAbiFlag(abi)};
- errorCode = getDevice().installPackage(apkFile, true, options);
- if (errorCode != null) {
- CLog.e("Failed to install %s. Reason: %s", apkName, errorCode);
+ // As a workaround for multi arch support, try to install the APK
+ // for all device supported ABIs. This will generate warning messages
+ // until the above FIXME is resolved.
+ int installFailCount = 0;
+ for (String abi : supportedAbiSet) {
+ String[] options = {AbiUtils.createAbiFlag(abi)};
+ String errorCode = getDevice().installPackage(apkFile, true, options);
+ if (errorCode != null) {
+ installFailCount++;
+ CLog.w("Failed to install %s. Reason: %s", apkName, errorCode);
+ }
+
+ }
+ if (installFailCount >= supportedAbiSet.size()) {
+ CLog.e("Failed to install %s. See warning messages.", apkName);
}
} catch (FileNotFoundException e) {
CLog.e("Could not find test apk %s", apkName);