code: public void triggerRegisteredSessionEndedObserver(int observerId) {
      UsageSessionObserver observer = usageSessionObserversById.get(observerId);
      Intent intent = new Intent().putExtra(UsageStatsManager.EXTRA_OBSERVER_ID, observerId);
      try {
        observer.sessionEndedIntent.send(RuntimeEnvironment.application, 0, intent);
      } catch (CanceledException e) {
        throw new RuntimeException(e);
      }
    }
docs: Triggers a currently registered {@link UsageSessionObserver} with {@code observerId}.
  
  <p>The observer SHOULD be registered afterwards.