Bug 1850847 Comment 12 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

After a lot of digging,  we found the problem! (Hopefully I explain it correctly):

We never start with telemetry set to true on the content process. `IS_UNIFIED_TELEMETRY` is always false on android. So, [this if statement](https://searchfox.org/mozilla-central/source/toolkit/components/telemetry/app/TelemetryControllerBase.sys.mjs#123) is always skipped. Then, we check `isTelemetryEnabled` enabled and that also returns false. That is  set through `SetupTelemetry` [found here](https://searchfox.org/mozilla-central/source/modules/libpref/Preferences.cpp#3630). Which is gotten from `TelemetryPrefValue()` [found here](https://searchfox.org/mozilla-central/source/modules/libpref/Preferences.cpp#3575). However, `MOZ_TELEMETRY_ON_BY_DEFAULT` is false in release or beta, so we go through the else block, which checks if the product contains the `beta` string. So, we don't see anything happening on release because of that. 

We were able to reproduce this by cloning the release branch and building geckoview_example and hanging the `if(IS_UNIFIED_TELEMETRY)` to `if(true)`  "forced" the telemetry pref to be set to `true`.
After a lot of digging,  we found the problem! (Hopefully I explain it correctly):

We never start with telemetry set to true on the content process. `IS_UNIFIED_TELEMETRY` is always false on android. So, [this if statement](https://searchfox.org/mozilla-central/source/toolkit/components/telemetry/app/TelemetryControllerBase.sys.mjs#123) is always skipped. Then, we check `isTelemetryEnabled` enabled and that also returns false. That is  set through `SetupTelemetry` [found here](https://searchfox.org/mozilla-central/source/modules/libpref/Preferences.cpp#3630). Which is gotten from `TelemetryPrefValue()` [found here](https://searchfox.org/mozilla-central/source/modules/libpref/Preferences.cpp#3575). However, `MOZ_TELEMETRY_ON_BY_DEFAULT` is false in release or beta, so we go through the else block, which checks if the product contains the `beta` string. So, we don't see anything happening on release because of that. 

We were able to reproduce this by cloning the release branch and building geckoview_example and changing the `if(IS_UNIFIED_TELEMETRY)` to `if(true)`  "forced" the telemetry pref to be set to `true`.

Back to Bug 1850847 Comment 12