[geolocation-stumbler] Provide MLS API key to stumbler at build time

RESOLVED DUPLICATE of bug 1038843

Status

()

RESOLVED DUPLICATE of bug 1038843
4 years ago
4 years ago

People

(Reporter: nalexander, Unassigned)

Tracking

Trunk
All
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

The process is described at https://bugzilla.mozilla.org/show_bug.cgi?id=1024708#c38:

> You want to fish the value of MOZ_MOZILLA_API_KEY and add it to the intent, correct?

> So export CONFIG['MOZ_MOZILLA_API_KEY'] to DEFINES in m/a/b/moz.build (lots of examples), and add it to AppConstants.java.in.

Comment 1

4 years ago
Created attachment 8456510 [details] [diff] [review]
mls-api-key-send-to-stumbler.patch

This sends the mlx api key to the stumbler service as an extra on the start intent.
Attachment #8456510 - Flags: review?(nalexander)

Comment 2

4 years ago
... and I see I also snuck in another extra on the intent that isn't really part of this bug:

if (!AppConstants.MOZILLA_OFFICIAL) {
+         intent.putExtra("is_debug", true);
+       }
(Reporter)

Comment 3

4 years ago
Comment on attachment 8456510 [details] [diff] [review]
mls-api-key-send-to-stumbler.patch

Review of attachment 8456510 [details] [diff] [review]:
-----------------------------------------------------------------

The build parts are fine after comments; feel free to land those small tweaks and close this bug.  The pref stuff is building on a test patch that hasn't landed; that's a separate ticket, so it needs to wait.

::: mobile/android/base/moz.build
@@ +657,5 @@
>  if CONFIG['MOZ_ANDROID_MLS_STUMBLER']:
>      main.included_projects += ['../FennecStumbler']
>      main.referenced_projects += ['../FennecStumbler']
> +
> +DEFINES['MOZ_MOZILLA_API_KEY'] = CONFIG['MOZ_MOZILLA_API_KEY']

Do this in the same place as all the other defines are handled.

::: mobile/android/base/preferences/GeckoPreferences.java
@@ +850,5 @@
>       * Broadcast the provided value as the value of the
>       * <code>PREFS_STUMBLER_ENABLED</code> pref.
>       */
>      public static void broadcastStumblerPref(final Context context, final boolean value) {
> +       Intent intent = new Intent(PREFS_STUMBLER_ENABLED)

I haven't landed anything here, so this isn't ready to land yet.  Also, this intent should have an ACTION string, like the others.

@@ +854,5 @@
> +       Intent intent = new Intent(PREFS_STUMBLER_ENABLED)
> +                .putExtra("pref", PREFS_GEO_REPORTING)
> +                .putExtra("branch", GeckoSharedPrefs.APP_PREFS_NAME)
> +                .putExtra("enabled", value);
> +       intent.putExtra("moz_mozilla_api_key", AppConstants.MOZ_MOZILLA_API_KEY);

nit: be consistent with your style here.
Attachment #8456510 - Flags: review?(nalexander) → review+

Updated

4 years ago
Blocks: 1032506

Comment 4

4 years ago
Morphing this into bug 1038843. When all of 1038843 has landed, stumbling is a go.

Marking this as a duplicate, which it only is because it got lumped in to that bug.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1038843
You need to log in before you can comment on or make changes to this bug.