Closed Bug 763420 Opened 12 years ago Closed 12 years ago

Telemetry doorhanger appears after checking the "Send performance data" in settings

Categories

(Firefox for Android Graveyard :: General, defect)

16 Branch
ARM
Android
defect
Not set
normal

Tracking

(firefox16 verified)

VERIFIED FIXED
Firefox 16
Tracking Status
firefox16 --- verified

People

(Reporter: andreea.pod, Assigned: bnicholson)

References

Details

Attachments

(2 files, 1 obsolete file)

Build: Firefox 16.0a1 (2012-06-10)
Device: LG Optimus 2X (Android 2.2)

Steps to reproduce:
1. Create a new profile
2. Open the browser
3. After the telemetry doorhanger appears tap on back button to dismiss it
4. Go to settings and set to yes the "Send performance data" option
5. Restart the application using the menu > More > Quit button.

Expected results:
- doorhanger should not appear and the "Send performance data" option should be set on yes

Actual result:
- the telemetry prompt appears and the "Send performance data" option is not checked.
I'm not sure this is a bug. I think using the BACK button is not considered a real "no", so the next time the app has a chance it will show the prompt again. Using the "No" button is the explicit "no" action.
(In reply to Mark Finkle (:mfinkle) from comment #1)
> I'm not sure this is a bug. I think using the BACK button is not considered
> a real "no", so the next time the app has a chance it will show the prompt
> again. Using the "No" button is the explicit "no" action.

Yes, you are right here Mark, but the doorhanger reappears at restart after I checked the "Send performance data" option in Fennec settings (meaning it is set on "Yes"), as I mentioned in the description.
Looks like we decided whether or not to prompt purely on the "toolkit.telemetry.prompted" pref, and we only set that if the user explicitly taps a yes/no button [1]. I think it would probably be more correct to just set the pref as soon as we show the doorhanger, since it seems mostly designed to keep track of the version of the privacy message we've shown the user. If we really want to re-show the notification until the user makes a choice, we could just check to see if "toolkit.telemetry.enabled" or "toolkit.telemetry.rejected" were ever set.

[1] http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js#357
This patch does a small amount of refactoring to put the telemetry code in its own Telemetry class. When the telemetry enabled option is changed in the prefs screen, this acts as if a button on the prompt were clicked (in other words, the toolkit.telemetry.prompted pref is set).

I originally wanted to use standard pref observers to implement this, but that would conflict with our call to "Services.prefs.clearUserPref(this._PREF_TELEMETRY_ENABLED)".
Assignee: nobody → bnicholson
Attachment #631966 - Flags: review?(mark.finkle)
Part of another patch got mixed up with this one; fixed.
Attachment #631966 - Attachment is obsolete: true
Attachment #631966 - Flags: review?(mark.finkle)
Attachment #631967 - Flags: review?(mark.finkle)
This code was taken from desktop, so I think the intended behavior is to repeatedly show the prompt until the user makes a decision. AFAIK, there's no desktop setting to disable telemetry like we have on mobile, which is why desktop isn't hitting this issue. We could change this to only prompt once since we do have our own pref in the UI, but we might see a decline in telemetry opt-ins since this defaults to "no".
Comment on attachment 631967 [details] [diff] [review]
Set telemetry prompted when telemetry preference changed

>+var Telemetry = {

>+  observe: function observe(aSubject, aTopic, aData) {
>+    } else if (aTopic == "Telemetry:Add") {
>+      let json = JSON.parse(aData);
>+      var telemetry = Cc["@mozilla.org/base/telemetry;1"]
>+            .getService(Ci.nsITelemetry);

no need to wrap

>+  showTelemetryPrompt: function showTelemetryPrompt() {

Let's rename to "prompt" since the extra "Telemetry" is redundant
Attachment #631967 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/dbf0598205ce
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
This issue is not reproducible anymore on the latest Nightly build. Closing bug as verified fixed on:

Firefox 16.0a1 (2012-06-13)
Device: Galaxy Nexus
OS: Android 4.0.2
Status: RESOLVED → VERIFIED
Comment on attachment 631967 [details] [diff] [review]
Set telemetry prompted when telemetry preference changed

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

telemetry doorhanger buttons no longer work

::: mobile/android/chrome/content/browser.js
@@ +5321,5 @@
> +    let buttons = [
> +      {
> +        label: Strings.browser.GetStringFromName("telemetry.optin.yes"),
> +        callback: function () {
> +          Services.prefs.setIntPref(this._PREF_TELEMETRY_PROMPTED, this._TELEMETRY_PROMPT_REV);

wrong "this" in callback
That explains why the buttons are not working on Nightly.
(In reply to microrffr from comment #11)
> Comment on attachment 631967 [details] [diff] [review]
> Set telemetry prompted when telemetry preference changed
> 
> Review of attachment 631967 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> telemetry doorhanger buttons no longer work
> 
> ::: mobile/android/chrome/content/browser.js
> @@ +5321,5 @@
> > +    let buttons = [
> > +      {
> > +        label: Strings.browser.GetStringFromName("telemetry.optin.yes"),
> > +        callback: function () {
> > +          Services.prefs.setIntPref(this._PREF_TELEMETRY_PROMPTED, this._TELEMETRY_PROMPT_REV);
> 
> wrong "this" in callback

Thanks, nice catch.
Attachment #633947 - Flags: review?(wjohnston)
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Attachment #633947 - Flags: review?(wjohnston) → review+
https://hg.mozilla.org/mozilla-central/rev/68fa58281b57
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Telemetry doorhanger buttons are working again as expected on the latest Nightly build. Closing bug as verified fixed on:


Firefox 16.0a1 (2012-06-19)
Device: Galaxy Nexus
OS: Android 4.0.2
Status: RESOLVED → VERIFIED
Blocks: 764775
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: