Skip to content

Commit 6dff041

Browse files
Close BufferedReader and use primitive boolean for isInBackground.
1 parent 6966468 commit 6dff041

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

firebase-config/src/main/java/com/google/firebase/remoteconfig/internal/ConfigAutoFetch.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class ConfigAutoFetch {
5454
private final ConfigUpdateListener retryCallback;
5555
private final ScheduledExecutorService scheduledExecutorService;
5656
private final Random random;
57-
private Boolean isInBackground;
57+
private boolean isInBackground;
5858

5959
public ConfigAutoFetch(
6060
HttpURLConnection httpURLConnection,
@@ -204,6 +204,8 @@ private void handleNotifications(InputStream inputStream) throws IOException {
204204
currentConfigUpdateMessage = "";
205205
}
206206
}
207+
208+
reader.close();
207209
}
208210

209211
private void autoFetch(int remainingAttempts, long targetVersion) {

firebase-config/src/main/java/com/google/firebase/remoteconfig/internal/ConfigRealtimeHttpClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public class ConfigRealtimeHttpClient {
9898
private boolean isRealtimeDisabled;
9999

100100
/** Flag to indicate whether or not the app is in the background or not. */
101-
private Boolean isInBackground;
101+
private boolean isInBackground;
102102

103103
// The HttpUrlConnection and auto-fetcher for this client. Only one of each exist at a time.
104104
private HttpURLConnection httpURLConnection;

firebase-config/src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ public void realtime_stream_listen_and_end_connection() throws Exception {
12881288
.thenReturn(Tasks.forResult(realtimeFetchedContainerResponse));
12891289
configAutoFetch.listenForNotifications();
12901290

1291-
verify(inputStreamSpy, times(1)).close();
1291+
verify(inputStreamSpy, times(2)).close();
12921292
}
12931293

12941294
@Test

0 commit comments

Comments
 (0)