ManeuverMapper
Maps MSDK Instruction types to Android Auto Maneuver type constants.
This mapper converts the MSDK's instruction semantic data (instruction type, maneuver type, junction type, bearing type, roundabout exit number) into Android Auto's Maneuver.TYPE_* constants used by the NavigationTemplate and instrument cluster display.
Priority-Based Cascade
The mapping uses a 4-level priority cascade. The first matching level determines the result:
InstructionType special cases: STOP, roundabout, motorway, ferry, ramp
JunctionType special cases: BIFURCATION (fork), EXIT_LEFT/RIGHT (off-ramp)
ManeuverType basic turns: STRAIGHT, LEFT, RIGHT, SHARP, SLIGHT, U_TURN
BearingType refinement: STRAIGHT + LEFT/RIGHT → KEEP_LEFT/KEEP_RIGHT
Falls back to Maneuver.TYPE_UNKNOWN for any unrecognized combination.
Workaround Note
This implementation uses Route.sheet().instructions[currentRouteInstructionIndex] to access the Instruction object during guidance. The proper approach is for the MSDK to expose the Instruction directly in InstructionsListener.onNewInstruction(). This should be updated when the MSDK provides that capability.
See also
Functions
Returns the roundabout exit number from the instruction, or 0 if not applicable.
Maps an MSDK Instruction to an Android Auto Maneuver type constant.