AASurfaceLifecycleCallback

Callback interface for Android Auto MapView surface lifecycle events.

This interface handles the initialization and release of the map surface, which is separate from the connection lifecycle. The surface can be created and destroyed multiple times within a single AA session.

Responsibility

Manages MapView surface-level events:

  • Surface initialization (AA ready to display map)

  • Surface release (AA surface destroyed)

Callers

Methods in this interface are called by AndroidAutoSurfaceCallback:

MapView Coordination

Since both phone and AA share the same Navigation instance, only one MapView can be actively attached at a time. This interface coordinates the handoff:

  1. onAARequestingInit: Phone detaches its MapView, AA attaches its MapView

  2. onAAReleasing: AA detaches its MapView, phone re-attaches its MapView

Usage

class MyCallback : AASurfaceLifecycleCallback {
override fun onAARequestingInit() {
// Detach phone MapView, show placeholder screen
}

override fun onAAReleasing() {
// Re-attach phone MapView, hide placeholder
}
}

See also

Inheritors

Functions

Link copied to clipboard
abstract fun onAAReleasing()

Called when Android Auto is releasing its MapView (surface destroyed).

Link copied to clipboard
abstract fun onAARequestingInit()

Called when Android Auto is ready to initialize its MapView.