android-components / mozilla.components.service.location.search / RegionSearchLocalizationProvider

RegionSearchLocalizationProvider

class RegionSearchLocalizationProvider : SearchLocalizationProvider (source)

SearchLocalizationProvider implementation that uses a MozillaLocationService instance to do a region lookup via GeoIP.

Since this provider may do a network request to determine the region, it is important to only use the “async” suspension methods of SearchEngineManager from the main thread when using this provider.

Constructors

Name Summary
<init> RegionSearchLocalizationProvider(service: LocationService)
SearchLocalizationProvider implementation that uses a MozillaLocationService instance to do a region lookup via GeoIP.

Functions

Name Summary
determineRegion suspend fun determineRegion(): SearchLocalization

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.