[Android Auto] Simplify search implementation
Description
Resolves https://github.com/mapbox/mapbox-navigation-android/issues/6154
Defining an api for search that works simple and by default. This adds the CarPlaceSearchOptions as something that can be overridden so that we can declare a stable api for supporting a place search screen.
I'm also moving CarSearchLocationProvider from the qa-test-app into the :libnavui-androidauto internal packages. That way it can be deleted from the examples
Code sample
When building the MainCarContext from the MainCarScreen, you can specify an access token for search like this. If none is specified, the MapboxNavigation access token will be used.
val mainCarContext = MainCarContext(
carContext = carContext,
mapboxCarMap = mapboxCarMap,
carPlaceSearchOptions = CarPlaceSearchOptions.Builder()
.accessToken(mySearchAccessToken)
.build()
)
Codecov Report
Merging #6165 (a3c5418) into main (d8d04fe) will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## main #6165 +/- ##
=========================================
Coverage 68.89% 68.89%
Complexity 4255 4255
=========================================
Files 639 639
Lines 25643 25643
Branches 3003 3003
=========================================
Hits 17668 17668
Misses 6828 6828
Partials 1147 1147
Also noting that unit-tests-androidauto are ❌
> Task :libnavui-androidauto:compileDebugUnitTestKotlin FAILED
e: /root/code/libnavui-androidauto/src/test/java/com/******/androidauto/car/search/SearchScreenTest.kt: (23, 17): Unresolved reference: carPlaceSearchApi
e: /root/code/libnavui-androidauto/src/test/java/com/******/androidauto/car/search/SearchScreenTest.kt: (63, 30): Unresolved reference: carPlaceSearchApi
FAILURE: Build failed with an exception.
Added some more tests for the internal implementation CarPlaceSearchImplTest