Disable FIS network calls to use cached response.
* Dropping guava and appcompat dependency from FIS SDK.
* Fix OverlappingFileLockException.
Access the data shared by multiple threads only after acquiring cross-process and multi-thread safe locks.
* Disable FIS network calls to use cached response.
* Setting Request Cache-Control
@@ -70,6 +70,9 @@ public class FirebaseInstallationServiceClient {
private static final String CONTENT_ENCODING_HEADER_KEY = "Content-Encoding";
private static final String GZIP_CONTENT_ENCODING = "gzip";
+ private static final String CACHE_CONTROL_HEADER_KEY = "Cache-Control";
+ private static final String CACHE_CONTROL_DIRECTIVE = "no-cache";
+
/** Heartbeat tag for firebase installations. */
private static final String FIREBASE_INSTALLATIONS_ID_HEARTBEAT_TAG = "fire-installations-id";
@@ -407,10 +410,12 @@ public class FirebaseInstallationServiceClient {
private HttpURLConnection openHttpURLConnection(URL url, String apiKey) throws IOException {
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setConnectTimeout(NETWORK_TIMEOUT_MILLIS);
+ httpURLConnection.setUseCaches(false);
httpURLConnection.setReadTimeout(NETWORK_TIMEOUT_MILLIS);
httpURLConnection.addRequestProperty(CONTENT_TYPE_HEADER_KEY, JSON_CONTENT_TYPE);
httpURLConnection.addRequestProperty(ACCEPT_HEADER_KEY, JSON_CONTENT_TYPE);
httpURLConnection.addRequestProperty(CONTENT_ENCODING_HEADER_KEY, GZIP_CONTENT_ENCODING);
+ httpURLConnection.addRequestProperty(CACHE_CONTROL_HEADER_KEY, CACHE_CONTROL_DIRECTIVE);
httpURLConnection.addRequestProperty(X_ANDROID_PACKAGE_HEADER_KEY, context.getPackageName());
if (heartbeatInfo != null && userAgentPublisher != null) {
HeartBeat heartbeat = heartbeatInfo.getHeartBeatCode(FIREBASE_INSTALLATIONS_ID_HEARTBEAT_TAG);
