Bug 2046071 - Preserve users initial intent through onboarding and process it on completion. #396 (firefox-autoland@autoland)
|
|
|
| Warnings |
|
| Blockers |
|
| Branches | 2046071 -> autoland |
| Repo | firefox-autoland@autoland (git) (git://github.com/t-p-white/firefox.git) |
| Author | t-p-white |
| State | closed |
| Commit Title |
Bug 2046071 - Preserve users initial intent through onboarding and process it on completion. |
| Commit Body |
### Summary When Firefox is launched through an intent before onboarding is complete, the user is redirected to onboarding. On a cold start, `HomeActivity` skips the intent processors, so the original launch intent—such as a link tap, search widget action, deep link, or custom tab request—was never processed after onboarding finished. `HomeActivity` now registers a preference listener while onboarding is displayed, provided `FenixOnboarding.userHasBeenOnboarded()` returns `false`. When `finish()` updates the stored onboarding version, the listener passes the original launch intent through the usual intent processors. `OnboardingFragment` calls `finish()` after navigating home. This ordering matters because the listener fires synchronously: home must already be on the back stack beneath the destination opened by the replayed intent. --- ### Testing: **Developer prerequistie**: flip the `FeatureFlags.onboardingFeatureEnabled` to show onboarding in debug. 1. `adb shell pm clear org.mozilla.fenix.debug` 2. `adb shell am start -a android.intent.action.VIEW -d https://example.com org.mozilla.fenix.debug` 3. Complete onboarding. The page should load, and back should return to home. Demo https://github.com/user-attachments/assets/bd0426b8-cbf1-4ad0-8c75-13b3ca8dfd09 Repeat with the search widget intent and expect the URL bar to be in focus: `adb shell am start -n org.mozilla.fenix.debug/org.mozilla.fenix.HomeActivity -a android.intent.action.MAIN --es open_to_search search_widget` Demo https://github.com/user-attachments/assets/28ea97c1-52e1-4b1f-9761-8197c200763e ### Notes Relation to [bug 2077533](https://bugzilla.mozilla.org/show_bug.cgi?id=2077533): that bug covers warm starts, where an intent arrives via `onNewIntent` while onboarding is already showing. Those intents are still processed immediately and are not affected by this change. If the user launches via link A and taps link B during onboarding, B opens straight away and A is still replayed on completion. The `StartSearchIntentProcessor` guard from bug 2022523 is left in place for the same reason. |
Landings
Landing requested on , by icedicedcoffee@proton.me.
Landing Job: 107166
Last update:
Result: 0a0d3fc419fa3bca7d00ac5a43a596635bc41b4d on firefox-autoland@autoland (git)
Links: Treeherder