@Test public void shouldNotRetryWithDisconnectedNetworkInfo() throws Exception { NetworkInfo info = mockNetworkInfo(); when(info.isConnectedOrConnecting()).thenReturn(false); assertThat(networkHandler.shouldRetry(false, info)).isFalse(); assertThat(networkHandler.shouldRetry(true, info)).isFalse(); }
@Override boolean shouldRetry(boolean airplaneMode, NetworkInfo info) { return info == null || info.isConnected(); }
NetworkRequestHandler extends RequestHandler { @Override boolean shouldRetry(boolean airplaneMode, NetworkInfo info) { return info == null || info.isConnected(); } }
NetworkRequestHandler extends RequestHandler { @Override boolean shouldRetry(boolean airplaneMode, NetworkInfo info) { return info == null || info.isConnected(); } NetworkRequestHandler(Downloader downloader, Stats stats); }
NetworkRequestHandler extends RequestHandler { @Override boolean shouldRetry(boolean airplaneMode, NetworkInfo info) { return info == null || info.isConnected(); } NetworkRequestHandler(Downloader downloader, Stats stats); @Override boolean canHandleRequest(Request data); @Override @Nullable Result load(Request request, int networkPolicy); }
NetworkRequestHandler extends RequestHandler { @Override boolean shouldRetry(boolean airplaneMode, NetworkInfo info) { return info == null || info.isConnected(); } NetworkRequestHandler(Downloader downloader, Stats stats); @Override boolean canHandleRequest(Request data); @Override @Nullable Result load(Request request, int networkPolicy);  }