addRecentDestination

Adds a destination to the recent destinations list.

This should be called when the user starts navigation to a destination. The implementation handles:

  • FIFO Queue: If 5 items exist, removes the oldest

  • Deduplication: If the destination already exists, moves it to front

  • Timestamp: Sets the current timestamp for expiration tracking

  • Persistence: Saves to SharedPreferences

Usage

// When navigation starts
val quickAccessItem = QuickAccessItem(
id = "recent_${destination.coordinate.latitude}_${destination.coordinate.longitude}",
title = destination.placeName,
subtitle = destination.addressLabel,
latitude = destination.coordinate.latitude(),
longitude = destination.coordinate.longitude(),
type = QuickAccessType.RECENT
)
quickAccessProvider.addRecentDestination(quickAccessItem)

Parameters

item

The QuickAccessItem to add (should have type QuickAccessType.RECENT)