Loading tools/aconfig/aconfig_storage_read_api/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ java_library { ], libs: [ "unsupportedappusage", "strict_mode_stub", ], static_libs: [ "aconfig_storage_file_java", Loading @@ -196,6 +197,7 @@ java_library { ], libs: [ "unsupportedappusage-sdk-none", "fake_device_config", ], static_libs: [ "aconfig_storage_file_java_none", Loading tools/aconfig/aconfig_storage_read_api/srcs/android/aconfig/storage/StorageInternalReader.java +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.aconfig.storage; import android.compat.annotation.UnsupportedAppUsage; import android.os.StrictMode; import java.io.Closeable; import java.nio.MappedByteBuffer; Loading @@ -42,8 +43,10 @@ public class StorageInternalReader { @UnsupportedAppUsage public StorageInternalReader(String packageName, String packageMapFile, String flagValueFile) { StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads(); mPackageTable = PackageTable.fromBytes(mapStorageFile(packageMapFile)); mFlagValueList = FlagValueList.fromBytes(mapStorageFile(flagValueFile)); StrictMode.setThreadPolicy(oldPolicy); mPackageBooleanStartOffset = getPackageBooleanStartOffset(packageName); } Loading tools/aconfig/fake_device_config/Android.bp +17 −5 Original line number Diff line number Diff line Loading @@ -14,9 +14,21 @@ java_library { name: "fake_device_config", srcs: ["src/**/*.java"], srcs: [ "src/android/util/Log.java", "src/android/provider/DeviceConfig.java", "src/android/os/StrictMode.java", ], sdk_version: "none", system_modules: "core-all-system-modules", host_supported: true, } java_library { name: "strict_mode_stub", srcs: [ "src/android/os/StrictMode.java", ], sdk_version: "core_current", host_supported: true, } tools/aconfig/fake_device_config/src/android/os/StrictMode.java 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.os; public class StrictMode { public static ThreadPolicy allowThreadDiskReads() { throw new UnsupportedOperationException("Stub!"); } public static void setThreadPolicy(final ThreadPolicy policy) { throw new UnsupportedOperationException("Stub!"); } public static final class ThreadPolicy {} } tools/aconfig/fake_device_config/src/android/provider/Log.java→tools/aconfig/fake_device_config/src/android/util/Log.java +0 −0 File moved. View file Loading
tools/aconfig/aconfig_storage_read_api/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ java_library { ], libs: [ "unsupportedappusage", "strict_mode_stub", ], static_libs: [ "aconfig_storage_file_java", Loading @@ -196,6 +197,7 @@ java_library { ], libs: [ "unsupportedappusage-sdk-none", "fake_device_config", ], static_libs: [ "aconfig_storage_file_java_none", Loading
tools/aconfig/aconfig_storage_read_api/srcs/android/aconfig/storage/StorageInternalReader.java +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.aconfig.storage; import android.compat.annotation.UnsupportedAppUsage; import android.os.StrictMode; import java.io.Closeable; import java.nio.MappedByteBuffer; Loading @@ -42,8 +43,10 @@ public class StorageInternalReader { @UnsupportedAppUsage public StorageInternalReader(String packageName, String packageMapFile, String flagValueFile) { StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads(); mPackageTable = PackageTable.fromBytes(mapStorageFile(packageMapFile)); mFlagValueList = FlagValueList.fromBytes(mapStorageFile(flagValueFile)); StrictMode.setThreadPolicy(oldPolicy); mPackageBooleanStartOffset = getPackageBooleanStartOffset(packageName); } Loading
tools/aconfig/fake_device_config/Android.bp +17 −5 Original line number Diff line number Diff line Loading @@ -14,9 +14,21 @@ java_library { name: "fake_device_config", srcs: ["src/**/*.java"], srcs: [ "src/android/util/Log.java", "src/android/provider/DeviceConfig.java", "src/android/os/StrictMode.java", ], sdk_version: "none", system_modules: "core-all-system-modules", host_supported: true, } java_library { name: "strict_mode_stub", srcs: [ "src/android/os/StrictMode.java", ], sdk_version: "core_current", host_supported: true, }
tools/aconfig/fake_device_config/src/android/os/StrictMode.java 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.os; public class StrictMode { public static ThreadPolicy allowThreadDiskReads() { throw new UnsupportedOperationException("Stub!"); } public static void setThreadPolicy(final ThreadPolicy policy) { throw new UnsupportedOperationException("Stub!"); } public static final class ThreadPolicy {} }
tools/aconfig/fake_device_config/src/android/provider/Log.java→tools/aconfig/fake_device_config/src/android/util/Log.java +0 −0 File moved. View file