summaryrefslogtreecommitdiffstats
path: root/sched/src/com/android/sched/vfs/InMemoryVDir.java
diff options
context:
space:
mode:
Diffstat (limited to 'sched/src/com/android/sched/vfs/InMemoryVDir.java')
-rw-r--r--sched/src/com/android/sched/vfs/InMemoryVDir.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/sched/src/com/android/sched/vfs/InMemoryVDir.java b/sched/src/com/android/sched/vfs/InMemoryVDir.java
index 6d05a3f8..4ace1fcd 100644
--- a/sched/src/com/android/sched/vfs/InMemoryVDir.java
+++ b/sched/src/com/android/sched/vfs/InMemoryVDir.java
@@ -26,6 +26,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/**
@@ -113,7 +114,9 @@ abstract class InMemoryVDir extends BaseVDir {
@Override
@Nonnull
public synchronized Collection<? extends BaseVElement> list() {
- assert !vfs.isClosed();
+// assert !vfs.isClosed();
+ // STOPSHIP: There is a problem with this assertion, likely due to PrefixedFS that has a close()
+ // method that is not related to the the close() method of the underlying VFS.
return Collections.unmodifiableCollection(map.values());
}
@@ -126,5 +129,18 @@ abstract class InMemoryVDir extends BaseVDir {
synchronized void internalDelete(@Nonnull String name) {
map.remove(name);
}
+
+ @CheckForNull
+ synchronized BaseVElement getFromCache(@Nonnull String name) {
+ return map.get(name);
+ }
+
+ synchronized void putInCache(@Nonnull String name, @Nonnull BaseVElement vElement) {
+ map.put(name, vElement);
+ }
+
+ synchronized Collection<? extends BaseVElement> getAllFromCache() {
+ return map.values();
+ }
}