bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

Don't make adjust pings from automation

RESOLVED FIXED in Firefox 49



Firefox for Android
2 years ago
2 years ago


(Reporter: mcomella, Assigned: mcomella)


Firefox 49

Firefox Tracking Flags

(firefox49 fixed)


MozReview Requests


Submitter Diff Changes Open Issues Last Updated
Error loading review requests:


(1 attachment)

tldr; adjust is enabled for local & automation release & beta builds. Investigation:

There are two ways I see that we can disable adjust in automation:

1) PREFS_HEALTH_REPORT_UPLOAD_ENABLED allows the user to opt-out of Adjust [1]. However, it does not appear to be set in anyway in automation either from it's Java constant [2], or the Java constant's value [3].

2) We return a different AdjustHelper instance depending on the flags specified [4] – the stub helper makes the calls have no effect. We return the real helper when MOZ_INSTALL_TRACKING is defined, which occurs when RELEASE_BUILD & MOZ_NATIVE_DEVICES is defined [5].
 - MOZ_NATIVE_DEVICES is defined when we're not resource constrained [6], which is never since we removed Gingerbread (bug 1220184 & I filed bug 1275721 to remove the resource constrained constants).
 - RELEASE_BUILD reads from milestone.txt [7] and is defined when the the version number doesn't include "a". In the beta tree, this is defined as "47.0" [8], meaning both automation & local beta builds have adjust installed.

I also looked when MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN is null, but it throws in that case.

[1]: https://dxr.mozilla.org/mozilla-central/rev/d6d4e8417d2fd71fdf47c319b7a217f6ace9d5a5/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java#707
[2]: https://dxr.mozilla.org/mozilla-central/search?q=PREFS_HEALTHREPORT_UPLOAD_ENABLED&redirect=false
[3]: https://dxr.mozilla.org/mozilla-central/search?q=healthreport.uploadEnabled&redirect=false
[4]: https://dxr.mozilla.org/mozilla-central/rev/d6d4e8417d2fd71fdf47c319b7a217f6ace9d5a5/mobile/android/base/AdjustConstants.java.in#25
[5]: https://dxr.mozilla.org/mozilla-central/rev/5511d54a3f172c1d68f98cc55dce4de1d0ba1b51/mobile/android/confvars.sh#58
[6]: https://dxr.mozilla.org/mozilla-central/rev/5511d54a3f172c1d68f98cc55dce4de1d0ba1b51/mobile/android/confvars.sh#51
[7]: https://dxr.mozilla.org/mozilla-central/rev/5511d54a3f172c1d68f98cc55dce4de1d0ba1b51/build/moz.configure/init.configure#652 
[8]: https://dxr.mozilla.org/mozilla-beta/source/config/milestone.txt
To disable adjust in automation, we can look at the approach of bug 1270191. In that bug, I'm hoping to come up with a more comprehensive solution for disabling features during automation so we should probably wait until it lands before trying to fix this.

Additionally, we have to disable Adjust for local builds, which we should be able to do by taking into account the value of the MOZILLA_OFFICIAL constant (like TelemetryConstants [1]).

[1]: https://dxr.mozilla.org/mozilla-central/rev/d6d4e8417d2fd71fdf47c319b7a217f6ace9d5a5/mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryConstants.java#12
Depends on: 1270191
Created attachment 8759325 [details]
Bug 1275669 - Do not enable adjust if we are in automation.

Review commit: https://reviewboard.mozilla.org/r/57316/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/57316/
Attachment #8759325 - Flags: review?(gkruglov)
Comment on attachment 8759325 [details]
Bug 1275669 - Do not enable adjust if we are in automation.


Looks good to me.
Attachment #8759325 - Flags: review?(gkruglov) → review+

Comment 6

2 years ago
Last Resolved: 2 years ago
status-firefox49: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
Summary: Investigate whether we're making adjust pings from automation → Don't make adjust pings from automation
You need to log in before you can comment on or make changes to this bug.