summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuy Truong <duytruong@google.com>2023-03-02 18:54:40 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-03-02 18:54:40 +0000
commit0a479d069421550411db9c92ec9b88f1cde6da67 (patch)
treec18f0ffcca009025be338c5be6ddb4395c411891
parentf47814948ffe8e3ba6b9ef1a6496443445c7afe9 (diff)
parent3b0ae35d3b82bb80ada4cdab12dbd7e1b55ee44d (diff)
downloadplatform_testing-0a479d069421550411db9c92ec9b88f1cde6da67.tar.gz
Add Bitness enum to NativePoc. am: 3b0ae35d3b
Original change: https://googleplex-android-review.googlesource.com/c/platform/platform_testing/+/21619074 Change-Id: I794458719488121e3f7d4eaeba445e08177fc1ac Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--libraries/sts-common-util/host-side/src/com/android/sts/common/NativePoc.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/libraries/sts-common-util/host-side/src/com/android/sts/common/NativePoc.java b/libraries/sts-common-util/host-side/src/com/android/sts/common/NativePoc.java
index 221c1f7ad..90acdecdf 100644
--- a/libraries/sts-common-util/host-side/src/com/android/sts/common/NativePoc.java
+++ b/libraries/sts-common-util/host-side/src/com/android/sts/common/NativePoc.java
@@ -196,6 +196,12 @@ public class NativePoc {
.assumePocExitSuccess(true);
}
+ public static enum Bitness {
+ AUTO, // push 32 or 64 bit version of PoC depending on device arch
+ ONLY32, // push only 32bit version of PoC
+ ONLY64 // push only 64bit version of PoC; raises error when running on 32bit-only device
+ }
+
public static class Builder {
private String pocName;
private ImmutableList<String> args;
@@ -305,6 +311,17 @@ public class NativePoc {
return this;
}
+ /** Force using 32bit or 64bit version of the native poc */
+ public Builder bitness(Bitness bitness) {
+ if (bitness == Bitness.ONLY32) {
+ return only32(true).only64(false);
+ }
+ if (bitness == Bitness.ONLY64) {
+ return only32(false).only64(true);
+ }
+ return only32(false).only64(false);
+ }
+
public Builder assumePocExitSuccess(boolean assumePocExitSuccess) {
this.assumePocExitSuccess = assumePocExitSuccess;
return this;