@@ -38,13 +38,16 @@ public static final class Builder {
38
38
private String host ;
39
39
private boolean sslEnabled ;
40
40
private boolean persistenceEnabled ;
41
+
42
+ private boolean memoryLruGcEnabled ;
41
43
private long cacheSizeBytes ;
42
44
43
45
/** Constructs a new {@code FirebaseFirestoreSettings} Builder object. */
44
46
public Builder () {
45
47
host = DEFAULT_HOST ;
46
48
sslEnabled = true ;
47
49
persistenceEnabled = true ;
50
+ memoryLruGcEnabled = false ;
48
51
cacheSizeBytes = DEFAULT_CACHE_SIZE_BYTES ;
49
52
}
50
53
@@ -58,6 +61,7 @@ public Builder(@NonNull FirebaseFirestoreSettings settings) {
58
61
sslEnabled = settings .sslEnabled ;
59
62
persistenceEnabled = settings .persistenceEnabled ;
60
63
cacheSizeBytes = settings .cacheSizeBytes ;
64
+ memoryLruGcEnabled = settings .memoryLruGcEnabled ;
61
65
}
62
66
63
67
/**
@@ -95,6 +99,12 @@ public Builder setPersistenceEnabled(boolean value) {
95
99
return this ;
96
100
}
97
101
102
+ @ NonNull
103
+ public Builder setMemoryLruGcEnabled (boolean value ) {
104
+ this .memoryLruGcEnabled = value ;
105
+ return this ;
106
+ }
107
+
98
108
/**
99
109
* Sets an approximate cache size threshold for the on-disk data. If the cache grows beyond this
100
110
* size, Cloud Firestore will start removing data that hasn't been recently used. The size is
@@ -150,6 +160,7 @@ public FirebaseFirestoreSettings build() {
150
160
private final String host ;
151
161
private final boolean sslEnabled ;
152
162
private final boolean persistenceEnabled ;
163
+ private final boolean memoryLruGcEnabled ;
153
164
private final long cacheSizeBytes ;
154
165
155
166
/** Constructs a {@code FirebaseFirestoreSettings} object based on the values in the Builder. */
@@ -158,6 +169,7 @@ private FirebaseFirestoreSettings(Builder builder) {
158
169
sslEnabled = builder .sslEnabled ;
159
170
persistenceEnabled = builder .persistenceEnabled ;
160
171
cacheSizeBytes = builder .cacheSizeBytes ;
172
+ memoryLruGcEnabled = builder .memoryLruGcEnabled ;
161
173
}
162
174
163
175
@ Override
@@ -216,6 +228,10 @@ public boolean isPersistenceEnabled() {
216
228
return persistenceEnabled ;
217
229
}
218
230
231
+ public boolean isMemoryLruGcEnabled () {
232
+ return memoryLruGcEnabled ;
233
+ }
234
+
219
235
/**
220
236
* Returns the threshold for the cache size above which the SDK will attempt to collect the least
221
237
* recently used documents.
0 commit comments