code: public void onSaveInstanceState(Bundle outState) {
      if (state != State.IDLE) {
        throw new IllegalStateException("Cannot handle onSaveInstanceState while " + state);
      }
      rootBundle = outState;
  
      state = State.SAVING;
  
      // Make a dwindling copy of the services, in case one is deleted as a side effect
      // of another's onSave.
      List<Map.Entry<String, BundleService>> servicesToBeSaved =
          new ArrayList<>(scopedServices.entrySet());
  
      while (!servicesToBeSaved.isEmpty()) {
        Map.Entry<String, BundleService> entry = servicesToBeSaved.remove(0);
        if (scopedServices.containsKey(entry.getKey())) entry.getValue().saveToRootBundle(rootBundle);
      }
  
      state = State.IDLE;
    }
docs: To be called from the host {@link android.app.Activity}'s {@link
  android.app.Activity#onSaveInstanceState}. Calls the registrants' {@link Bundler#onSave}
  methods.