@Test public void detachSingleRequest() { Action action = mockAction(URI_KEY_1, URI_1, mockImageViewTarget()); BitmapHunter hunter = new TestableBitmapHunter(picasso, dispatcher, cache, stats, action); assertThat(hunter.action).isNotNull(); hunter.detach(action); assertThat(hunter.action).isNull(); }
void detach(Action action) { boolean detached = false; if (this.action == action) { this.action = null; detached = true; } else if (actions != null) { detached = actions.remove(action); } if (detached && action.getPriority() == priority) { priority = computeNewPriority(); } if (picasso.loggingEnabled) { log(OWNER_HUNTER, VERB_REMOVED, action.request.logId(), getLogIdsForHunter(this, "from ")); } }
BitmapHunter implements Runnable { void detach(Action action) { boolean detached = false; if (this.action == action) { this.action = null; detached = true; } else if (actions != null) { detached = actions.remove(action); } if (detached && action.getPriority() == priority) { priority = computeNewPriority(); } if (picasso.loggingEnabled) { log(OWNER_HUNTER, VERB_REMOVED, action.request.logId(), getLogIdsForHunter(this, "from ")); } } }
BitmapHunter implements Runnable { void detach(Action action) { boolean detached = false; if (this.action == action) { this.action = null; detached = true; } else if (actions != null) { detached = actions.remove(action); } if (detached && action.getPriority() == priority) { priority = computeNewPriority(); } if (picasso.loggingEnabled) { log(OWNER_HUNTER, VERB_REMOVED, action.request.logId(), getLogIdsForHunter(this, "from ")); } } BitmapHunter(Picasso picasso, Dispatcher dispatcher, Cache cache, Stats stats, Action action,
      RequestHandler requestHandler); }
BitmapHunter implements Runnable { void detach(Action action) { boolean detached = false; if (this.action == action) { this.action = null; detached = true; } else if (actions != null) { detached = actions.remove(action); } if (detached && action.getPriority() == priority) { priority = computeNewPriority(); } if (picasso.loggingEnabled) { log(OWNER_HUNTER, VERB_REMOVED, action.request.logId(), getLogIdsForHunter(this, "from ")); } } BitmapHunter(Picasso picasso, Dispatcher dispatcher, Cache cache, Stats stats, Action action,
      RequestHandler requestHandler); @Override void run(); }
BitmapHunter implements Runnable { void detach(Action action) { boolean detached = false; if (this.action == action) { this.action = null; detached = true; } else if (actions != null) { detached = actions.remove(action); } if (detached && action.getPriority() == priority) { priority = computeNewPriority(); } if (picasso.loggingEnabled) { log(OWNER_HUNTER, VERB_REMOVED, action.request.logId(), getLogIdsForHunter(this, "from ")); } } BitmapHunter(Picasso picasso, Dispatcher dispatcher, Cache cache, Stats stats, Action action,
      RequestHandler requestHandler); @Override void run();  }