summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhi Dou <zhidou@google.com>2024-03-28 16:34:05 +0000
committerAndroid Build Cherrypicker Worker <android-build-cherrypicker-worker@google.com>2024-03-28 16:34:05 +0000
commit46e31f4d2ec3fee3ebfbf7e571934c2dd5a8149f (patch)
tree73c893d0d440e033fd05540de35c8f29fb16a228
parent01013f3febfb22915493def49460284f58c65b63 (diff)
downloadplatform_testing-46e31f4d2ec3fee3ebfbf7e571934c2dd5a8149f.tar.gz
skip verify optimization if flag is exported
The exported flag doesn't have optimization method. Thus the test should consider the flag is optimized. Test: atest FlagJUnitTests Bug: n/a (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:356c2c7530cb44c000d3df236e914403bd125c40) Merged-In: I87850b03f4b14eece314dc9f1a9ecfafd9cd7299 Change-Id: I87850b03f4b14eece314dc9f1a9ecfafd9cd7299
-rw-r--r--libraries/flag-helpers/junit/src_base/android/platform/test/flag/junit/SetFlagsRule.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/libraries/flag-helpers/junit/src_base/android/platform/test/flag/junit/SetFlagsRule.java b/libraries/flag-helpers/junit/src_base/android/platform/test/flag/junit/SetFlagsRule.java
index 9a9573363..0c8696136 100644
--- a/libraries/flag-helpers/junit/src_base/android/platform/test/flag/junit/SetFlagsRule.java
+++ b/libraries/flag-helpers/junit/src_base/android/platform/test/flag/junit/SetFlagsRule.java
@@ -492,6 +492,13 @@ public final class SetFlagsRule implements TestRule {
.invoke(fakeFeatureFlagsImpl, fullFlagName);
return result;
} catch (NoSuchMethodException e) {
+ // If the flag is generated under exported mode, then it doesn't have this method
+ if (fakeFeatureFlagsImpl
+ .getClass()
+ .getSimpleName()
+ .equals(FAKE_FEATURE_FLAGS_IMPL_CLASS_NAME)) {
+ return false;
+ }
throw new FlagSetException(
fullFlagName,
String.format(