MCPcopy Create free account
hub / github.com/M66B/FairEmail / onAny

Method onAny

app/src/main/java/eu/faircode/email/SimpleTask.java:279–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277 Log.i("Deferring task " + name + " state=" + state);
278 owner.getLifecycle().addObserver(new LifecycleObserver() {
279 @OnLifecycleEvent(Lifecycle.Event.ON_ANY)
280 public void onAny() {
281 state = owner.getLifecycle().getCurrentState();
282 if (state.equals(Lifecycle.State.DESTROYED)) {
283 Log.i("Destroyed task " + name);
284 onDestroyed(args);
285 owner.getLifecycle().removeObserver(this);
286 cleanup(context);
287 } else if (state.isAtLeast(Lifecycle.State.RESUMED)) {
288 Log.i("Deferred delivery task " + name);
289 owner.getLifecycle().removeObserver(this);
290 deliver();
291 cleanup(context);
292 } else
293 Log.i("Deferring task " + name + " state=" + state);
294 }
295 });
296 }
297 }

Callers

nothing calls this directly

Calls 7

iMethod · 0.95
onDestroyedMethod · 0.95
cleanupMethod · 0.95
deliverMethod · 0.95
getLifecycleMethod · 0.45
equalsMethod · 0.45
removeObserverMethod · 0.45

Tested by

no test coverage detected