public class TestNavigationManager
extends NavigationManager

   ↳ androidx.car.app.navigation.NavigationManager
     ↳ androidx.car.app.testing.navigation.TestNavigationManager

The NavigationManager that is used for testing.

This class will track the following usages of the NavigationManager throughout your test:


Public constructors

TestNavigationManager(TestCarContext testCarContext, HostDispatcher hostDispatcher)

Public methods

void clearNavigationManagerCallback()

Clears the callback for receiving navigation manager events.

int getNavigationEndedCount()

Returns the number of times that navigation was ended via NavigationManager.navigationEnded() since creation or the last call to reset().

NavigationManagerCallback getNavigationManagerCallback()

Returns the callback set via NavigationManager.setNavigationManagerCallback(NavigationManagerCallback).

int getNavigationStartedCount()

Returns the number of times that navigation was started via NavigationManager.navigationStarted() since creation or the last call to reset().

List<Trip> getTripsSent()

Returns all the Trips sent via NavigationManager.updateTrip(Trip).

void navigationEnded()

Notifies the host that the app has ended active navigation.

void navigationStarted()

Notifies the host that the app has started active navigation.

void reset()

Resets the values tracked by this TestNavigationManager.

void setNavigationManagerCallback(Executor executor, NavigationManagerCallback callback)

Sets a callback to start receiving navigation manager events.

void updateTrip(Trip trip)

Sends the destinations, steps, and trip estimates to the host.

Inherited methods

Public constructors


public TestNavigationManager (TestCarContext testCarContext, 
                HostDispatcher hostDispatcher)

testCarContext TestCarContext

hostDispatcher HostDispatcher

Public methods