QuickAccessItem

data class QuickAccessItem(val id: String, val title: String, val subtitle: String?, val latitude: Double, val longitude: Double, val type: QuickAccessType, val timestamp: Long = System.currentTimeMillis())

Represents a quick access destination item for Android Auto display.

This is a clean data class with no dependencies on app-side modules, making it suitable for inclusion in the MSDK. It provides a unified representation for Home, Work, and Recent destination addresses.

Purpose

  • Abstraction: Decouples Android Auto quick access UI from specific data types

  • MSDK-ready: No dependencies on app-side modules like favorites_address_domain

  • Unified: Single type for Home, Work, and Recent destinations

Usage

The app's QuickAccessProvider implementation converts its internal types (e.g., FavoriteAddress, RecentDestination) to this class:

fun FavoriteAddress.toQuickAccessItem(type: QuickAccessType) = QuickAccessItem(
id = "favorite_$id",
title = name,
subtitle = address.addressLabel,
latitude = address.coordinates.latitude(),
longitude = address.coordinates.longitude(),
type = type
)

Android Auto Display

Quick access items appear at the top of the search screen when the query is empty:

  • Home: Appears with home icon for instant navigation to home address

  • Work: Appears with work icon for instant navigation to work address

  • Recent: List of last navigated destinations (max 5, 30-day expiration)

See also

Constructors

Link copied to clipboard
constructor(id: String, title: String, subtitle: String?, latitude: Double, longitude: Double, type: QuickAccessType, timestamp: Long = System.currentTimeMillis())

Properties

Link copied to clipboard
val id: String

Unique identifier for this item (e.g., "home", "work", "recent_lat_lon")

Link copied to clipboard

Latitude coordinate of the location

Link copied to clipboard

Longitude coordinate of the location

Link copied to clipboard

Secondary display text (full address label), nullable

Link copied to clipboard

When this item was created/accessed (used for Recent expiration)

Link copied to clipboard

Primary display text (place name, e.g., "Home", "Work", or "Paris Office")

Link copied to clipboard

The type of quick access item (HOME, WORK, or RECENT)