package Ġcom . mapbox . navigation . instrumentation _ tests . utils . id ling Ċ Ċ import Ġandroidx . test . espress o . Id ling Resource Ċ import Ġcom . mapbox . api . directions . v 5 . models . Directions Route Ċ import Ġcom . mapbox . navigation . base . route . Router Origin Ċ import Ġcom . mapbox . navigation . base . trip . model . Route Progress Ċ import Ġcom . mapbox . navigation . core . Map box Navigation Ċ import Ġcom . mapbox . navigation . core . route altern atives . Route Altern atives Observer Ċ import Ġcom . mapbox . navigation . testing . ui . id ling . Navigation Id ling Resource Ċ Ċ /** Ċ Ġ* ĠBe come s Ġidle Ġwhen Ġ[ Route Altern atives Observer . on Route Altern atives ] Ġis Ġinvoked , Ċ Ġ* Ġand Ġthen Ġit Ġis Ġautomatically Ġun subscribed . ĠThe Ġresults Ġfor Ġthe Ġmoment , Ċ Ġ* Ġcan Ġbe Ġaccessed Ġvia Ġ[ route Progress ] Ġand Ġ[ altern atives ] Ċ Ġ* Ċ Ġ* ĠIf Ġyour Ġtest Ġneeds Ġto Ġreceive Ġthe Ġnext Ġset Ġof Ġalternatives , Ġyou Ġmust Ġcreate Ġa Ġnew Ċ Ġ* Ġinstance Ġof Ġ[ Route Altern atives Id ling Resource ] Ġto Ġcapture Ġthe Ġnext Ġcallback . Ċ Ġ*/ Ċ class ĠRoute Altern atives Id ling Resource ( ĊĠĠĠ Ġval Ġmap box Navigation : ĠMap box Navigation Ċ ) Ġ: ĠNavigation Id ling Resource (), ĠRoute Altern atives Observer Ġ{ ĊĊĠĠĠ Ġvar Ġroute Progress : ĠRoute Progress ? Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġprivate Ġset ĊĠĠĠ Ġvar Ġalternatives : ĠList < Directions Route >? Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġprivate Ġset ĊĊĠĠĠ Ġprivate Ġvar Ġcallback : ĠId ling Resource . Resource Callback ? Ġ= Ġnull ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġmap box Navigation . register Route Altern atives Observer ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetName () Ġ= Ġthis :: class . simple Name ĊĊĠĠĠ Ġoverride Ġfun Ġis Idle Now () Ġ= Ġalternatives Ġ!= Ġnull ĊĊĠĠĠ Ġoverride Ġfun Ġregister Idle Transition Callback ( callback : ĠId ling Resource . Resource Callback ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . callback Ġ= Ġcallback ĊĠĠĠĠĠĠĠ Ġif Ġ( is Idle Now ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcallback ?. on Transition To Idle () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Route Altern atives ( ĊĠĠĠĠĠĠĠ Ġroute Progress : ĠRoute Progress , ĊĠĠĠĠĠĠĠ Ġalternatives : ĠList < Directions Route >, ĊĠĠĠĠĠĠĠ Ġrouter Origin : ĠRouter Origin ĊĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠ Ġmap box Navigation . unregister Route Altern atives Observer ( this ) ĊĠĠĠĠĠĠĠ Ġthis . route Progress Ġ= Ġroute Progress ĊĠĠĠĠĠĠĠ Ġthis . altern atives Ġ= Ġalternatives ĊĠĠĠĠĠĠĠ Ġcallback ?. on Transition To Idle () ĊĠĠĠ Ġ} Ċ } Ċ