Loading core/java/android/content/res/XmlBlock.java +1 −12 Original line number Diff line number Diff line Loading @@ -349,7 +349,7 @@ public final class XmlBlock implements AutoCloseable { throw new XmlPullParserException("Corrupt XML binary file"); } if (useLayoutReadwrite() && mUsesFeatureFlags && ev == START_TAG) { if (Flags.layoutReadwriteFlags() && mUsesFeatureFlags && ev == START_TAG) { FlagInfo flag = nativeGetFlagInfo(mParseState); if (flag != null && flag.mNameIndex > 0) { AconfigFlags flags = ParsingPackageUtils.getAconfigFlags(); Loading Loading @@ -396,17 +396,6 @@ public final class XmlBlock implements AutoCloseable { return ev; } // Until ravenwood supports AconfigFlags, we just don't do layoutReadwriteFlags(). @android.ravenwood.annotation.RavenwoodReplace( bug = 396458006, blockedBy = AconfigFlags.class) private static boolean useLayoutReadwrite() { return Flags.layoutReadwriteFlags(); } private static boolean useLayoutReadwrite$ravenwood() { return false; } public void require(int type, String namespace, String name) throws XmlPullParserException,IOException { if (type != getEventType() || (namespace != null && !namespace.equals( getNamespace () ) ) Loading core/java/com/android/internal/pm/pkg/component/AconfigFlags.java +1 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import java.util.concurrent.ConcurrentHashMap; * own copy of the code here. * @hide */ @android.ravenwood.annotation.RavenwoodKeepWholeClass public class AconfigFlags { private static final boolean DEBUG = false; private static final String LOG_TAG = "AconfigFlags"; Loading core/java/com/android/internal/pm/pkg/parsing/ParsingPackageUtils.java +3 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,8 @@ import java.util.StringTokenizer; * * @hide */ @android.ravenwood.annotation.RavenwoodKeepPartialClass @android.ravenwood.annotation.RavenwoodKeepStaticInitializer public class ParsingPackageUtils { private static final String TAG = ParsingUtils.TAG; Loading Loading @@ -3624,6 +3626,7 @@ public class ParsingPackageUtils { /** * Getter for the flags object */ @android.ravenwood.annotation.RavenwoodKeep public static AconfigFlags getAconfigFlags() { return sAconfigFlags; } Loading ravenwood/tests/resapk_test/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ android_ravenwood_test { "androidx.annotation_annotation", "androidx.test.ext.junit", "androidx.test.rules", "android.content.res.flags-aconfig-java", "configinfra_framework_flags_java_lib", ], srcs: [ "test/**/*.java", Loading ravenwood/tests/resapk_test/test/com/android/ravenwoodtest/resapk_test/RavenwoodResApkTest.java +8 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import static org.junit.Assert.assertThrows; import android.content.Context; import android.content.res.XmlResourceParser; import android.platform.test.annotations.DisabledOnRavenwood; import android.util.Log; import androidx.test.ext.junit.runners.AndroidJUnit4; Loading @@ -49,6 +48,14 @@ public class RavenwoodResApkTest { private static final Context sContext = InstrumentationRegistry.getInstrumentation().getContext(); // Make sure all the relevant flags are enabled. @Test public void testCheckAconfigFlags() { assertTrue("layoutReadwriteFlags", android.content.res.Flags.layoutReadwriteFlags()); assertTrue("useNewAconfigStorage", android.content.res.Flags.useNewAconfigStorage()); assertTrue("newStoragePublicApi", android.provider.flags.Flags.newStoragePublicApi()); } /** * Ensure the file "ravenwood-res.apk" exists. */ Loading Loading @@ -130,8 +137,6 @@ public class RavenwoodResApkTest { } @Test @DisabledOnRavenwood(bug = 396458006, reason = "RW flags in XML are all handled as enabled for now") public void testElementWithRwFlagDisabled() throws Exception { assertThat(getTextsFromEnabledChildren()).doesNotContain("rw-disabled"); } Loading Loading
core/java/android/content/res/XmlBlock.java +1 −12 Original line number Diff line number Diff line Loading @@ -349,7 +349,7 @@ public final class XmlBlock implements AutoCloseable { throw new XmlPullParserException("Corrupt XML binary file"); } if (useLayoutReadwrite() && mUsesFeatureFlags && ev == START_TAG) { if (Flags.layoutReadwriteFlags() && mUsesFeatureFlags && ev == START_TAG) { FlagInfo flag = nativeGetFlagInfo(mParseState); if (flag != null && flag.mNameIndex > 0) { AconfigFlags flags = ParsingPackageUtils.getAconfigFlags(); Loading Loading @@ -396,17 +396,6 @@ public final class XmlBlock implements AutoCloseable { return ev; } // Until ravenwood supports AconfigFlags, we just don't do layoutReadwriteFlags(). @android.ravenwood.annotation.RavenwoodReplace( bug = 396458006, blockedBy = AconfigFlags.class) private static boolean useLayoutReadwrite() { return Flags.layoutReadwriteFlags(); } private static boolean useLayoutReadwrite$ravenwood() { return false; } public void require(int type, String namespace, String name) throws XmlPullParserException,IOException { if (type != getEventType() || (namespace != null && !namespace.equals( getNamespace () ) ) Loading
core/java/com/android/internal/pm/pkg/component/AconfigFlags.java +1 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import java.util.concurrent.ConcurrentHashMap; * own copy of the code here. * @hide */ @android.ravenwood.annotation.RavenwoodKeepWholeClass public class AconfigFlags { private static final boolean DEBUG = false; private static final String LOG_TAG = "AconfigFlags"; Loading
core/java/com/android/internal/pm/pkg/parsing/ParsingPackageUtils.java +3 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,8 @@ import java.util.StringTokenizer; * * @hide */ @android.ravenwood.annotation.RavenwoodKeepPartialClass @android.ravenwood.annotation.RavenwoodKeepStaticInitializer public class ParsingPackageUtils { private static final String TAG = ParsingUtils.TAG; Loading Loading @@ -3624,6 +3626,7 @@ public class ParsingPackageUtils { /** * Getter for the flags object */ @android.ravenwood.annotation.RavenwoodKeep public static AconfigFlags getAconfigFlags() { return sAconfigFlags; } Loading
ravenwood/tests/resapk_test/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ android_ravenwood_test { "androidx.annotation_annotation", "androidx.test.ext.junit", "androidx.test.rules", "android.content.res.flags-aconfig-java", "configinfra_framework_flags_java_lib", ], srcs: [ "test/**/*.java", Loading
ravenwood/tests/resapk_test/test/com/android/ravenwoodtest/resapk_test/RavenwoodResApkTest.java +8 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import static org.junit.Assert.assertThrows; import android.content.Context; import android.content.res.XmlResourceParser; import android.platform.test.annotations.DisabledOnRavenwood; import android.util.Log; import androidx.test.ext.junit.runners.AndroidJUnit4; Loading @@ -49,6 +48,14 @@ public class RavenwoodResApkTest { private static final Context sContext = InstrumentationRegistry.getInstrumentation().getContext(); // Make sure all the relevant flags are enabled. @Test public void testCheckAconfigFlags() { assertTrue("layoutReadwriteFlags", android.content.res.Flags.layoutReadwriteFlags()); assertTrue("useNewAconfigStorage", android.content.res.Flags.useNewAconfigStorage()); assertTrue("newStoragePublicApi", android.provider.flags.Flags.newStoragePublicApi()); } /** * Ensure the file "ravenwood-res.apk" exists. */ Loading Loading @@ -130,8 +137,6 @@ public class RavenwoodResApkTest { } @Test @DisabledOnRavenwood(bug = 396458006, reason = "RW flags in XML are all handled as enabled for now") public void testElementWithRwFlagDisabled() throws Exception { assertThat(getTextsFromEnabledChildren()).doesNotContain("rw-disabled"); } Loading