If the main thread has to wait for the session data parsing to finish - which is more likely when you've got many tabs open, meaning a large sessionstore.js file - it does so on "this", i.e. GeckoApp.
The session data parsing itself is done from within a Runnable, so we need to qualify "this" there if we want it to refer to GeckoApp itself, so we can successfully release any waiting threads through notifyAll().
MozReview-Commit-ID: 3LhJsI5rNU3
Currently this service does not implement any of the callbacks. However it is
necessary to be detected as an app supporting custom tabs.
MozReview-Commit-ID: Hz99Gp9aQCX
This activity doesn't do much yet and just has a layout including a GeckoView.
Some basic behavior from GeckoApp is working though: Context menus, floating
text selection, snackbars.
MozReview-Commit-ID: C6SJeYz609h
We will need to dispatch Intent objects to different destinations (Browser, Custom Tab and eventually
progressive web apps).
The logic of TabQueueDispatcher is folded into this new activity.
MozReview-Commit-ID: 3P4eIvtAKEW
By comparing the rates for FENNEC_SESSIONSTORE_DAMAGED_SESSION_FILE and this new probe, we might be able to infer whether there is a failure mode for the session store where the main session store file is completely lost after an interrupted write and doesn't exist even as an empty file of 0 bytes size.
The first run case will be excluded, because in that case both the main and the backup session file won't exist, so neither telemetry probe will be triggered.
MozReview-Commit-ID: JTR54Vk18jW
Since a SessionRestoreException also happens if we deliberately skipped all tabs (because they didn't contain anything interesting apart from about:home) or the session file was valid but didn't contain any tabs (because the user cleared history), we need to ensure that we don't switch to the backup copy in that case.
To that extent, we extend the SessionParser's parse function to return whether any JSON exceptions occured while parsing the session file, which would signify a corrupt session file.
MozReview-Commit-ID: Kdh5d69irqF
Currently, despite its name sessionstore.bak isn't actually a backup copy, but simply contains the last session if we aren't restoring tabs automatically and is used for powering what used to be the "Tabs from last time" section of the Recent Tabs panel.
This patch changes its filename to sessionstore.old, which frees up sessionstore.bak to be used for an actual backup copy of the current session store data.
If we are not restoring tabs automatically, sessionstore.old will be freshly recreated during each app startup by copying from sessionstore.js's contents, whereas if we *are* restoring automatically, any sessionstore.old file older than a day will be expired anyway, therefore no special migration logic is necessary for this change.
MozReview-Commit-ID: H7Gl5MQi2J4
We're now calling setIntent on the background thread. The onTargetSelected callback expects
to be run on the UI thread, and it looks like Android hangs up when we call UI methods
on the background thread. This in turn means the entire background thread gets locked up
(we execute tasks on the background thread sequentially) and no further background runnables
are executed. This breaks anything else requiring use of the background thread, e.g.
favicon generation, search, permissions doorhangers, etc.
MozReview-Commit-ID: CoYUOMqNX0m
In this patch, I move the telemetry server preference from app preferences
to per-profile preferences. We never allowed the user to set the preference
so this should cause no issues.
MozReview-Commit-ID: 7D5y58R2ejd
Edge case: the admin profile can disable health report upload for themselves
but (I assume) the new profile won't automatically match these settings. While
I'm not sure if this is even possible, it's outside the scope of this bug.
MozReview-Commit-ID: 1SkXhL7B5xb
DB access happens deep in the internals of setting a new Intent for our
ActionProvider. Posting this to a background thread here seems to be the simplest
option to ensure correct threading.
MozReview-Commit-ID: 3iS8w5Cxf02
It's possible there are more UI-thread DB accesses lurking. To avoid maintenance burden
we should therefore enable this assert only in debug builds - releases will be
unaffected, but we can still notice incorrect DB access during development.
MozReview-Commit-ID: Kgzf1L3WjIE
Currently we might have old (aka stale) clients appear on the History panel, which could be confusing.
This patch modifies underlying query to select only those clients whose LAST_MODIFIED timestamp
is newer than three weeks ago.
MozReview-Commit-ID: JsZJwNONDJG
For people with customised home panels, we need to explicitly remove the Recent Tabs panel. We also unhide the Combined History panel if it was previously hidden and additionally turn it into the default panel if the Recent Tabs panel was the previous default panel.
MozReview-Commit-ID: 5CSJUTRysQU
By passing the panel types to be removed/set as new default panel as arguments instead of hard coding them, we can reuse that function for our own home panel config migration.
MozReview-Commit-ID: BsMxcbInRbX
After detecting multiple successive crashes in a row, we temporarily switch off automatic session restoring and display the Recent Tabs panel instead. As that panel is going to be removed, we intercept loads of the Recent Tabs panel about:home?panel=... URL and redirect them to the Combined History panel. We also use the facilities provided by bug 1060544 to jump directly to the Recent Tabs folder in that case.
MozReview-Commit-ID: 7dQ7tW2dD1M
This adds telemetry for clicking on a closed tab or the "Open all" button. Methods and extras strings are based on those used for the old Recent Tabs panel.
MozReview-Commit-ID: 1Kc8fACkmIc
Recently closed tabs aren't synced, therefore being able to swipe to refresh within the Recent tabs folder isn't necessary. To avoid triggering a refresh by accident, we restrict swipe to refresh to the Synced devices folder itself.
MozReview-Commit-ID: YwekSwQr2q
Sessionstore.bak is only read when we are initialising the home panels, so after clearing all history from the button in the Combined History panel, the "Tabs from last time" section would still linger around until the home panels have been closed and reopened. To prevent this, we now directly notify the RecentTabsAdapter when all history has been deleted, so it can immediately clear its own copy of the last session's tabs.
MozReview-Commit-ID: 3EFY2WbWqzh
Depending on the History panel's PanelLevel state, we now dynamically set the panel footer button's text and determine its onClick behaviour.
MozReview-Commit-ID: EjesnHsntyC