Closed Bug 1298500 Opened 3 years ago Closed 3 years ago

Showing start wizard can't be overridden via distribution

Categories

(Firefox for Android :: First Run, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 51
Tracking Status
firefox51 --- fixed

People

(Reporter: mkaply, Assigned: mkaply)

References

Details

Attachments

(1 file, 1 obsolete file)

The pref for the start wizard is explicitly written as true:

https://dxr.mozilla.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoProfile.java#974

So it can't be overridden at all.

There's no need to explicitly set the preference, just treat it as true if it isn't there.
This refers to the first run screen so I'm changing it to First Run component.
Component: General → First Run
Now that we have an intent to not show the first run wizard for testing, we should not be explicitly setting the startpage_enabled pref on profile creation.

This allows distributions to turn off the wizard.

I didn't make a change to the first run intent, because it specifically says this:

// Note that we don't set the pref, so subsequent launches can result
// in the firstrun pane being shown.

https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java#899
Attachment #8786000 - Flags: review?(liuche)
Comment on attachment 8786000 [details] [diff] [review]
Don't set startpage_enabled on profile creation

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

This looks good to me.

::: mobile/android/base/java/org/mozilla/gecko/GeckoProfile.java
@@ -1080,5 @@
>          persistClientId(generateNewClientId());
>  
> -        // Initialize pref flag for displaying the start pane for a new profile.
> -        final SharedPreferences prefs = GeckoSharedPrefs.forProfile(mApplicationContext);
> -        prefs.edit().putBoolean(FirstrunAnimationContainer.PREF_FIRSTRUN_ENABLED, true).apply();

Where was the code where you set this off by default in the distribution code? Just curious.
Attachment #8786000 - Flags: review?(liuche) → review+
> Where was the code where you set this off by default in the distribution code? Just curious.

We have an AndroidPreferences section where I set startpane_enabled to false.
This also gets rid of the dependency on the org.mozilla.gecko.firstrun package in GeckoProfile :) Don't forget to remove the `import org.mozilla.gecko.firstrun.FirstrunAnimationContainer` line at the start of GeckoProfile.java!
> We have an AndroidPreferences section where I set startpane_enabled to false.

Actually, this doesn't work after all, but I still think this is a good patch.

The reason it doesn't work is because startpane_enabled is queried very early.

New patch coming because of tree reorg
Carrying over r+
Assignee: nobody → mozilla
Attachment #8786000 - Attachment is obsolete: true
Attachment #8788926 - Flags: review+
FYI, I tested:

New install.
Second start after install.
The "no wizard" intent.
Start after the "no wizard" intent.

Everything worked as before.
https://hg.mozilla.org/mozilla-central/rev/cf134ae84918
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Blocks: 1301901
Blocks: 1330714
You need to log in before you can comment on or make changes to this bug.