AAConnectionCallback

Callback interface for Android Auto session connection lifecycle events.

This interface handles the fundamental connection state changes between the phone app and Android Auto, as well as screen state transitions within a connected session.

Responsibility

Manages AA session-level events:

  • Session creation (user opened app on AA)

  • Session destruction (user exited app on AA)

  • Screen state changes within an active session

Callers

Methods in this interface are called by AndroidAutoSurfaceManager:

Usage

Implement this interface to react to AA connection changes:

class MyCallback : AAConnectionCallback {
override fun onAAConnected() {
// Show "Connected to Android Auto" notification
}

override fun onAADisconnected() {
// Dismiss notification, re-attach MapView
}

override fun onAAScreenStateChanged(state: AndroidAutoScreenState) {
// Update phone UI to match AA screen
}
}

See also

Inheritors

Functions

Link copied to clipboard
abstract fun onAAConnected()

Called when Android Auto session is created (user opened app on AA).

Link copied to clipboard
abstract fun onAADisconnected()

Called when Android Auto session is destroyed (user exited app on AA).

Link copied to clipboard

Called when Android Auto screen state changes.