Loading tools/aconfig/aconfig_device_paths/src/DeviceProtosTemplate.java +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import java.util.List; /** * @hide * * Note this class does _not_ work on Ravenwood (yet). Contact g/ravenwood if you need it. */ public class DeviceProtos { public static final String[] PATHS = { Loading tools/aconfig/aconfig_device_paths/src/DeviceProtosTestUtilTemplate.java +38 −2 Original line number Diff line number Diff line Loading @@ -25,12 +25,44 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** @hide */ /** * Utility class to load protobuf storage files. * * This class _does_ support Ravenwood. * * In order to avoid adding extra dependencies, this class doesn't use Ravenwood annotations * or RavenwoodHelper.java. Instead, we just hardcode relevant logic. * * @hide */ public class DeviceProtosTestUtil { public static final String[] PATHS = { private static final String[] PATHS_DEVICE = { TEMPLATE }; /** Path to ravenwood runtime, or null on non-ravenwood environment. */ private static final String RAVENWOOD_RUNTIME_PATH = System.getProperty("android.ravenwood.runtime_path"); /** True if on ravenwood */ private static final boolean ON_RAVENWOOD = RAVENWOOD_RUNTIME_PATH != null; private static String[] getPaths() { if (!ON_RAVENWOOD) { return PATHS_DEVICE; } return new String[] { RAVENWOOD_RUNTIME_PATH + "/aconfig/metadata/aconfig/etc/all_aconfig_declarations.pb" }; } /** * Protobuf storage files. On the device side, this array contains multiple files, one * from each partition. On Ravenwood, this contains a single protobuf file containing all the * flags. */ public static final String[] PATHS = getPaths(); private static final String APEX_DIR = "/apex/"; private static final String APEX_ACONFIG_PATH_SUFFIX = "/etc/aconfig_flags.pb"; private static final String SYSTEM_APEX_DIR = "/system/apex"; Loading Loading @@ -67,6 +99,10 @@ public class DeviceProtosTestUtil { public static List<String> parsedFlagsProtoPaths() { ArrayList<String> paths = new ArrayList(Arrays.asList(PATHS)); if (ON_RAVENWOOD) { return paths; // No apexes on Ravenwood. } File apexDirectory = new File(SYSTEM_APEX_DIR); if (!apexDirectory.isDirectory()) { return paths; Loading tools/aconfig/aconfig_storage_file/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,9 @@ java_library { srcs: [ "srcs/**/*.java", ], libs: [ "ravenwood-annotations-lib", ], sdk_version: "core_current", min_sdk_version: "29", host_supported: true, Loading @@ -179,6 +182,9 @@ java_library { srcs: [ "srcs/**/*.java", ], libs: [ "ravenwood-annotations-lib", ], sdk_version: "none", system_modules: "core-all-system-modules", host_supported: true, Loading tools/aconfig/aconfig_storage_file/srcs/android/aconfig/storage/AconfigStorageException.java +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ package android.aconfig.storage; * <p>This exception indicates a general problem with Aconfig Storage, such as an inability to read * or write data. */ @android.ravenwood.annotation.RavenwoodKeepWholeClass public class AconfigStorageException extends RuntimeException { /** Generic error code indicating an unspecified Aconfig Storage error. */ Loading tools/aconfig/aconfig_storage_file/srcs/android/aconfig/storage/ByteBufferReader.java +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import java.nio.ByteOrder; import java.nio.charset.StandardCharsets; import java.util.Objects; @android.ravenwood.annotation.RavenwoodKeepWholeClass public class ByteBufferReader { private ByteBuffer mByteBuffer; Loading Loading
tools/aconfig/aconfig_device_paths/src/DeviceProtosTemplate.java +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import java.util.List; /** * @hide * * Note this class does _not_ work on Ravenwood (yet). Contact g/ravenwood if you need it. */ public class DeviceProtos { public static final String[] PATHS = { Loading
tools/aconfig/aconfig_device_paths/src/DeviceProtosTestUtilTemplate.java +38 −2 Original line number Diff line number Diff line Loading @@ -25,12 +25,44 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** @hide */ /** * Utility class to load protobuf storage files. * * This class _does_ support Ravenwood. * * In order to avoid adding extra dependencies, this class doesn't use Ravenwood annotations * or RavenwoodHelper.java. Instead, we just hardcode relevant logic. * * @hide */ public class DeviceProtosTestUtil { public static final String[] PATHS = { private static final String[] PATHS_DEVICE = { TEMPLATE }; /** Path to ravenwood runtime, or null on non-ravenwood environment. */ private static final String RAVENWOOD_RUNTIME_PATH = System.getProperty("android.ravenwood.runtime_path"); /** True if on ravenwood */ private static final boolean ON_RAVENWOOD = RAVENWOOD_RUNTIME_PATH != null; private static String[] getPaths() { if (!ON_RAVENWOOD) { return PATHS_DEVICE; } return new String[] { RAVENWOOD_RUNTIME_PATH + "/aconfig/metadata/aconfig/etc/all_aconfig_declarations.pb" }; } /** * Protobuf storage files. On the device side, this array contains multiple files, one * from each partition. On Ravenwood, this contains a single protobuf file containing all the * flags. */ public static final String[] PATHS = getPaths(); private static final String APEX_DIR = "/apex/"; private static final String APEX_ACONFIG_PATH_SUFFIX = "/etc/aconfig_flags.pb"; private static final String SYSTEM_APEX_DIR = "/system/apex"; Loading Loading @@ -67,6 +99,10 @@ public class DeviceProtosTestUtil { public static List<String> parsedFlagsProtoPaths() { ArrayList<String> paths = new ArrayList(Arrays.asList(PATHS)); if (ON_RAVENWOOD) { return paths; // No apexes on Ravenwood. } File apexDirectory = new File(SYSTEM_APEX_DIR); if (!apexDirectory.isDirectory()) { return paths; Loading
tools/aconfig/aconfig_storage_file/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,9 @@ java_library { srcs: [ "srcs/**/*.java", ], libs: [ "ravenwood-annotations-lib", ], sdk_version: "core_current", min_sdk_version: "29", host_supported: true, Loading @@ -179,6 +182,9 @@ java_library { srcs: [ "srcs/**/*.java", ], libs: [ "ravenwood-annotations-lib", ], sdk_version: "none", system_modules: "core-all-system-modules", host_supported: true, Loading
tools/aconfig/aconfig_storage_file/srcs/android/aconfig/storage/AconfigStorageException.java +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ package android.aconfig.storage; * <p>This exception indicates a general problem with Aconfig Storage, such as an inability to read * or write data. */ @android.ravenwood.annotation.RavenwoodKeepWholeClass public class AconfigStorageException extends RuntimeException { /** Generic error code indicating an unspecified Aconfig Storage error. */ Loading
tools/aconfig/aconfig_storage_file/srcs/android/aconfig/storage/ByteBufferReader.java +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import java.nio.ByteOrder; import java.nio.charset.StandardCharsets; import java.util.Objects; @android.ravenwood.annotation.RavenwoodKeepWholeClass public class ByteBufferReader { private ByteBuffer mByteBuffer; Loading