()
| 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 | } |
nothing calls this directly
no test coverage detected