Merge "Build system_ext build.prop with Soong" into main
diff --git a/core/ravenwood_test_config_template.xml b/core/ravenwood_test_config_template.xml
index 088a55a..2f21bae 100644
--- a/core/ravenwood_test_config_template.xml
+++ b/core/ravenwood_test_config_template.xml
@@ -21,7 +21,6 @@
<option name="java-folder" value="prebuilts/jdk/jdk21/linux-x86/" />
<option name="use-ravenwood-resources" value="true" />
<option name="exclude-paths" value="java" />
- <option name="socket-timeout" value="10000" />
<option name="null-device" value="true" />
{EXTRA_CONFIGS}
diff --git a/tools/aconfig/aconfig_storage_read_api/srcs/android/aconfig/storage/StorageInternalReader.java b/tools/aconfig/aconfig_storage_read_api/srcs/android/aconfig/storage/StorageInternalReader.java
index 07558ee..f73f35e 100644
--- a/tools/aconfig/aconfig_storage_read_api/srcs/android/aconfig/storage/StorageInternalReader.java
+++ b/tools/aconfig/aconfig_storage_read_api/srcs/android/aconfig/storage/StorageInternalReader.java
@@ -19,9 +19,10 @@
import android.compat.annotation.UnsupportedAppUsage;
import java.io.Closeable;
-import java.io.FileInputStream;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
/** @hide */
public class StorageInternalReader {
@@ -69,16 +70,15 @@
// Map a storage file given file path
private static MappedByteBuffer mapStorageFile(String file) {
- FileInputStream stream = null;
+ FileChannel channel = null;
try {
- stream = new FileInputStream(file);
- FileChannel channel = stream.getChannel();
+ channel = FileChannel.open(Paths.get(file), StandardOpenOption.READ);
return channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
} catch (Exception e) {
throw new AconfigStorageException(
String.format("Fail to mmap storage file %s", file), e);
} finally {
- quietlyDispose(stream);
+ quietlyDispose(channel);
}
}