idle = true; @Override public String getName() { return IntentServiceIdlingResource.class.getName(); } @Override public void registerIdleTransitionCallback(ResourceCallback resourceCallback) { this.resourceCallback = resourceCallback; } @Override public boolean isIdleNow() { if (idle && resourceCallback != null) { resourceCallback.onTransitionToIdle(); } return idle; } public void setIdle(boolean idle) { this.idle = idle; } }