-
- All Implemented Interfaces:
public interface NavigationSessionThis class allows the user to set up specific parameters for the current navigation session. The user can start, stop, simulate a navigation, update the route, attach audio guidance, \ ADAS or alert services.
!!! APIs in this class are syncronous !!! DO NOT CALL ANY API form NavigationSession in the same callback function receiving navigation status updates. Since all APIs of of NavigationSession are synchronous, calling any of them in the same callback function will cause the internal session working thread hang
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classNavigationSession.FactoryUse this class in order to initiate a navigation session
public final classNavigationSession.SettingsContains the keys to be used for initializing the NavigationSession
-
Method Summary
Modifier and Type Method Description abstract intupdateRouteInfo(@NonNull() Route route)Update route info. abstract intstartNavigation()Start navigation !!! abstract intstartSimulateNavigation()Start simulating navigation !!! abstract intstopNavigation()Stop navigation !!! abstract voidsetSimulateNavSpeed(double speed)Updates simulate speed. abstract voidaddListener(@NonNull() NavigationSessionListener listener)Requesting this API will add a listener for the current navigation session. abstract voidremoveListener(@NonNull() NavigationSessionListener listener)Remove listener for session !!! abstract intgetSessionId()abstract intplayLastAudioGuidance()* !!!This is a synchronous API. abstract NavigationSignalUpdateJunctionViewrenderJunctionView(int legIndex, int stepIndex, int jvWidth, int jvHeight, int dayNightMode)abstract voidacceptBetterRoute(@NonNull() String id, boolean accepted)Accept better route by id. abstract voidsetMinTimeSavedPercentage(int percentage)abstract voidsetShieldIconSize(int width, int height)Set the width and height of shield icon abstract voiddispose()Frees all resources. abstract voidenableLock(boolean isEnabled)Enables synchronization of possible long running navigation APIs with the dispose API. -
-
Method Detail
-
updateRouteInfo
abstract int updateRouteInfo(@NonNull() Route route)
Update route info. !!! This is a synchronous API. This API can be called before and after navigation session is started.
Thread safety of this api can be ensured by enabling synchronization setEnabled.
- Parameters:
route- route info, may contain route and guidance
-
startNavigation
abstract int startNavigation()
Start navigation !!! This is a synchronous API.
This API __MUST__ be called after external services are attached to session.
-
startSimulateNavigation
abstract int startSimulateNavigation()
Start simulating navigation !!! This is a synchronous API.
This API __MUST__ be called after external services are attached to session.
-
stopNavigation
abstract int stopNavigation()
Stop navigation !!! This is a synchronous API.
-
setSimulateNavSpeed
abstract void setSimulateNavSpeed(double speed)
Updates simulate speed. !!! This is a synchronous API. This API __MUST__ be called after position engine has been attached to take effect.
- Parameters:
speed- speed expressed in unit of meter/second.
-
addListener
abstract void addListener(@NonNull() NavigationSessionListener listener)
Requesting this API will add a listener for the current navigation session.
!!! This is a synchronous API. !!! DO NOT CALL ANY API form NavigationSession in the same callback function receiving navigation status updates. Since all APIs of of NavigationSession are synchronous, calling any of them in the same callback function will cause the internal session working thread hang
This API __COULD__ be called at any time.
- Parameters:
listener- session listener
-
removeListener
abstract void removeListener(@NonNull() NavigationSessionListener listener)
Remove listener for session !!! This is a synchronous API.
This API __COULD__ be called at any time.
- Parameters:
listener- session listener
-
getSessionId
abstract int getSessionId()
-
playLastAudioGuidance
abstract int playLastAudioGuidance()
* !!!This is a synchronous API.
-
renderJunctionView
abstract NavigationSignalUpdateJunctionView renderJunctionView(int legIndex, int stepIndex, int jvWidth, int jvHeight, int dayNightMode)
-
acceptBetterRoute
abstract void acceptBetterRoute(@NonNull() String id, boolean accepted)
Accept better route by id.
- Parameters:
id- better route notification id.accepted- accept status
-
setMinTimeSavedPercentage
abstract void setMinTimeSavedPercentage(int percentage)
- Parameters:
percentage- percentage of saved travel time,The default value is 10.
-
setShieldIconSize
abstract void setShieldIconSize(int width, int height)
Set the width and height of shield icon
- Parameters:
width- image width in pixel, default value is 40height- image height in pixel, default value is 40
-
dispose
abstract void dispose()
Frees all resources. Makes references null, removes listeners, calls the underlying C++ layer in order to destroy the C++ objects.
!!!This is a synchronous API.
Thread safety of this api can be ensured by enabling synchronization setEnabled.
-
enableLock
abstract void enableLock(boolean isEnabled)
Enables synchronization of possible long running navigation APIs with the dispose API. This ensures that if a navigation API is called on a thread before
disposeAPI is called on a different thread the disposing does not start until the former API finishes it's execution, preventing NavigationSessionsException to be thrown due to INSTANCE_DISPOSED cause.By default synchronization is disabled.
!!!This is a synchronous API.- Parameters:
isEnabled-trueif the synchronization should be enabled,falseotherwise.
-
-
-
-