Focus-android: Use Mozilla's location service for search country code

Created on 15 Mar 2017  路  12Comments  路  Source: mozilla-mobile/focus-android

Currently we use the device's locale for determining the search engines and default. However Fennec asks Mozilla's GeoIP service to determine the country code. So that I get German search engines / defaults in Germany even with en_US locale. That's something we probably should copy.

Related code:
https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/search/SearchEngineManager.java?q=path%3ASearchEngineManager&redirect_type=single#428

P3 feature

Most helpful comment

I consider this to be an anti-feature (called 'Tracking' in the F-Droid store) because it builds up a connection without the user's consent.
Using the system's locale setting is the right way to determine the country for a privacy-focused app.

All 12 comments

Focus for iOS seems to pick the search engines solely based on the region setting.

We do not use this service in Focus for iOS currently. Let's ask @mkaply if he thinks this is a requirement for Focus for Android v1.0 or if we are good with the locale detection that we currently do.

The reason Focus for iOS doesn't use the search service is because we never ported any of the search service work over to iOS at all.

If we could use the search services in Focus, that would be helpful so we don't end up with a technical debt there.

The code to query the search service is pretty self contained in https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/search/SearchEngineManager.java.

From talking on Slack: Should be implemented - but can be in the next release.

I consider this to be an anti-feature (called 'Tracking' in the F-Droid store) because it builds up a connection without the user's consent.
Using the system's locale setting is the right way to determine the country for a privacy-focused app.

Why would an en_US user in Germany want to use a German language search engine? If they spoke or preferred German, they could set their device locale to de_DE or manually navigate to a German language search engine like google.de.

What is the behavior of Chrome on Android and Safari on iOS?

Using the system's locale setting is the right way to determine the country for a privacy-focused app.

Unfortunately in our testing, 50% of users have en-US set as their locale but are not located in the US. So using the system locale is very unreliable.

The issue here is not the language of the search per say, it's about agreements we have to use a particular search engine (or search code) in a particular region. So we need to know someone is in Ireland so we can give them the Irish eBay, for instance.

Again, locale is completely unreliable.

I did not know that the agreements also affect Firefox Focus/Klar and have to be enforced.

Other (no-network) ways of determining the location:

  • "Choose your country" dialog
  • Request coarse/fine location

A choice of a dialog and the network-based locating would be acceptable in my opinion. Otherwise the app implys that the user agreed to "coarse location" and considers the use of Mozilla's service safe for their means (including letting the network infrastructure and DNS servers know).

I definitely don't want to ask for coarse/fine location because it gives us data we aren't going to use (too fine).

  • "Choose your country" dialog

This would make an _excellent_ addition/replacement to #1692 as some way to use all that 1st-open blank space!

@pocmo can this be closed in favour of #2374?

Yep.

Was this page helpful?
0 / 5 - 0 ratings