onSurfaceDestroyed
Releases the pipeline built on the surface the host is destroying, then the surface itself, and tells the phone app (PhoneAppCallback.onAAReleasing()), which can show the map on the phone again.
The loading state is kept
The host destroys the surface whenever the template on top has no map area (a ListTemplate, a SearchTemplate, a MessageTemplate), which does not end the session. The loading state is left as it is: it tells the root screen which template to return, and a released surface does not change that.
AndroidAutoLoadingState.MAP_READY keeps the root screen on its map template. Back on top, that template makes the host allocate a surface again, and onSurfaceAvailable rebuilds the MapView from the READY phone state. Resetting the state here would deadlock: a root screen showing its loading template never gets a surface back, because the host allocates one only for a map template.
AndroidAutoLoadingState.ERROR, AndroidAutoLoadingState.LICENSE_REQUIRED and AndroidAutoLoadingState.ONBOARDING_REQUIRED keep their message on screen. Their message template is often what made the host destroy the surface in the first place.
The loading state goes back to AndroidAutoLoadingState.IDLE when the session ends.
Called by the host on the main thread.