@Test public void shouldRetryTwiceWithAirplaneModeOffAndNoNetworkInfo() throws Exception { Action action = TestUtils.mockAction(URI_KEY_1, URI_1); BitmapHunter hunter = new BitmapHunter(picasso, dispatcher, cache, stats, action, networkHandler); assertThat(hunter.shouldRetry(false, null)).isTrue(); assertThat(hunter.shouldRetry(false, null)).isTrue(); assertThat(hunter.shouldRetry(false, null)).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);  }