Loading services/appfunctions/java/com/android/server/appfunctions/AppFunctionAgentAllowlistStorage.java +26 −21 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ public final class AppFunctionAgentAllowlistStorage { private static final String TAG = "AppFunctionAgentAllowlistStorage"; @NonNull private final AtomicFile mAtomicFile; @NonNull private final Object mAllowlistStorageLock = new Object(); /** * Creates an instance that manages the allowlist at the specified file path. Loading @@ -57,6 +58,7 @@ public final class AppFunctionAgentAllowlistStorage { @WorkerThread @Nullable public List<SignedPackage> readPreviousValidAllowlist() { synchronized (mAllowlistStorageLock) { if (!mAtomicFile.exists()) { Slog.d(TAG, "Allowlist file does not exist."); return null; Loading @@ -72,6 +74,7 @@ public final class AppFunctionAgentAllowlistStorage { return null; } } } /** * Writes the given allowlist string to persistent storage atomically. Loading @@ -82,6 +85,7 @@ public final class AppFunctionAgentAllowlistStorage { */ @WorkerThread public void writeCurrentAllowlist(@NonNull String allowlistString) { synchronized (mAllowlistStorageLock) { FileOutputStream fos = null; try { fos = mAtomicFile.startWrite(); Loading @@ -95,3 +99,4 @@ public final class AppFunctionAgentAllowlistStorage { } } } } Loading
services/appfunctions/java/com/android/server/appfunctions/AppFunctionAgentAllowlistStorage.java +26 −21 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ public final class AppFunctionAgentAllowlistStorage { private static final String TAG = "AppFunctionAgentAllowlistStorage"; @NonNull private final AtomicFile mAtomicFile; @NonNull private final Object mAllowlistStorageLock = new Object(); /** * Creates an instance that manages the allowlist at the specified file path. Loading @@ -57,6 +58,7 @@ public final class AppFunctionAgentAllowlistStorage { @WorkerThread @Nullable public List<SignedPackage> readPreviousValidAllowlist() { synchronized (mAllowlistStorageLock) { if (!mAtomicFile.exists()) { Slog.d(TAG, "Allowlist file does not exist."); return null; Loading @@ -72,6 +74,7 @@ public final class AppFunctionAgentAllowlistStorage { return null; } } } /** * Writes the given allowlist string to persistent storage atomically. Loading @@ -82,6 +85,7 @@ public final class AppFunctionAgentAllowlistStorage { */ @WorkerThread public void writeCurrentAllowlist(@NonNull String allowlistString) { synchronized (mAllowlistStorageLock) { FileOutputStream fos = null; try { fos = mAtomicFile.startWrite(); Loading @@ -95,3 +99,4 @@ public final class AppFunctionAgentAllowlistStorage { } } } }