summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPresubmit Automerger Backend <android-build-presubmit-automerger-backend@system.gserviceaccount.com>2023-03-02 03:37:08 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-03-02 03:37:08 +0000
commitdd2dd29751bcbff01c0df978dae9d71dcf483e7c (patch)
tree3d1e353664f4ee299b593888a77250a3724ebb3a
parent4dd56b9f8dab4d431b8bd19020a6e5ea558183d6 (diff)
parent28aa1271cb92381f86b7456a0975ce1f235376ca (diff)
downloadplatform_testing-dd2dd29751bcbff01c0df978dae9d71dcf483e7c.tar.gz
[automerge] Add Bitness enum to NativePoc. 2p: a4a2a96658 am: 4e4f96510c am: 54f4d5a06e am: 5314644c93 am: 28aa1271cb
Original change: https://googleplex-android-review.googlesource.com/c/platform/platform_testing/+/21619071 Change-Id: Ia05304852fdab10e734a02db2ae0f08eae8f3ac9 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 1aabaa990..1acbdd00b 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
@@ -85,6 +85,12 @@ public abstract 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
+ }
+
@AutoValue.Builder
public abstract static class Builder {
/** Name of executable to be uploaded and run. Do not include "_sts??" suffix. */
@@ -146,6 +152,17 @@ public abstract class NativePoc {
abstract Builder only64(boolean value);
+ /** 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);
+ }
+
/**
* Function to run after the PoC finishes executing but before assertion or cleanups.
*