aconfig: flag java lib enable optimization
This change adds annotation in the generated code. If the flag is read only, annotations @com.android.aconfig.annotations.AssumeTrueForR8 or @com.android.aconfig.annotations.AssumeFalseForR8 will be added in to the corresponding methods in the interface FeatureFlags, and class Flags. Test: atest aconfig aconfig.test.java Bug: 295328116 Change-Id: Ic1b62a86f0945a5e72ae2c4987cce77fe3f172e9
This commit is contained in:
@@ -119,9 +119,12 @@ mod tests {
|
||||
const EXPECTED_FEATUREFLAGS_COMMON_CONTENT: &str = r#"
|
||||
package com.android.aconfig.test;
|
||||
public interface FeatureFlags {
|
||||
@com.android.aconfig.annotations.AssumeFalseForR8
|
||||
boolean disabledRo();
|
||||
boolean disabledRw();
|
||||
@com.android.aconfig.annotations.AssumeTrueForR8
|
||||
boolean enabledFixedRo();
|
||||
@com.android.aconfig.annotations.AssumeTrueForR8
|
||||
boolean enabledRo();
|
||||
boolean enabledRw();
|
||||
}
|
||||
@@ -136,15 +139,18 @@ mod tests {
|
||||
public static final String FLAG_ENABLED_RO = "com.android.aconfig.test.enabled_ro";
|
||||
public static final String FLAG_ENABLED_RW = "com.android.aconfig.test.enabled_rw";
|
||||
|
||||
@com.android.aconfig.annotations.AssumeFalseForR8
|
||||
public static boolean disabledRo() {
|
||||
return FEATURE_FLAGS.disabledRo();
|
||||
}
|
||||
public static boolean disabledRw() {
|
||||
return FEATURE_FLAGS.disabledRw();
|
||||
}
|
||||
@com.android.aconfig.annotations.AssumeTrueForR8
|
||||
public static boolean enabledFixedRo() {
|
||||
return FEATURE_FLAGS.enabledFixedRo();
|
||||
}
|
||||
@com.android.aconfig.annotations.AssumeTrueForR8
|
||||
public static boolean enabledRo() {
|
||||
return FEATURE_FLAGS.enabledRo();
|
||||
}
|
||||
|
Reference in New Issue
Block a user