Bug 832990 solved the issue of us losing the menu item cache if BrowserApp was
destroyed, however the issue remains that we'll miss any Menu:... messages that
are sent while BrowserApp doesn't exist, e.g. if Gecko is initially loaded
through a GeckoView-based activity.
Therefore we now move the menu item cache and the listener for those messages
into a separate class, whose lifetime better matches that of Gecko.
Apart from any necessary changes, we move the existing code as is. The only
additional change is that we make addAddonMenuItemToMenu() static, because we
can.
MozReview-Commit-ID: BJleonLnjmo
Multidex will now be enabled for all builds, not just for the _local_ ones.
Also added the 'ads-identifier' library needed for the builds with the
MOZ_INSTALL_TRACKING flag case in which the dex limit would be reached.
MozReview-Commit-ID: FRTXBD9Kc6T
Moved notification channels to NotificationHelper and created
new utility methods to retrieve them when needed. Cleaned unused
imports.
MozReview-Commit-ID: L3HnV3nD7Og
Use the fact that a JobIntentService is still a Service to keep most of the
previous implementation and method of starting CrashReportingService.
On 26+ devices it will be called with "start-foreground-service".
This ensures it can be started even from background and the crash reporting
process would work as before but ActivityManager will post an ANR error to
logcat after 5 seconds because we aren't calling Service.startForeground()
(which would mean a user visible notification).
Will use different Job Ids depending on if the app is Firefox Release or
Firefox Beta.
The Job Id will be passed to GeckoThread when first initializing and then be
made available to CrashHandler and nsExceptionHandler.cpp to be sent in the
Intent that starts the CrashReporterService.
MozReview-Commit-ID: GATl6Waa9St
We need to block onSaveInstanceState until we're sure that our private browsing
data is up to date, however we can't block on the whole of our application-
background handling (GeckoThread.onPause), as that will take too much time.
In addition, we need to update the stored tab data not just when the application
goes into the background, but every time we're leaving GeckoApp and onSave-
InstanceState is called, e.g. when visiting our settings activity.
MozReview-Commit-ID: DgtUvatD6h3
We currently initialize PushService on delayed startup, which only
happens when Fennec is launched. This patch makes us also initialize
PushService if needed by web content from custom tabs / PWA, by
listening for the push initialization event in GeckoApplication.
MozReview-Commit-ID: 9CTOEZmOqls
https://m.aliexpress.com is a good target to test. But it sometimes show mixed content, sometimes not.
I also chnage the check when adding a PWA shortcut. Only fail fast in nightly and local build.
MozReview-Commit-ID: 4sLoNERIYuW
Move the "Bookmark:Insert" and "Image:SetAs" events from GeckoApp to
GeckoApplication. These events are global to the application, and they
operate on the background thread, which will no longer be an option for
the GeckoView event dispatcher.
MozReview-Commit-ID: 8kesv8sJ8At
When page option 'add page shortcut' is clicked, creating a shortcut(not PWA) on launcher.
Also make sure that heavy tasks are executed in background thread.
MozReview-Commit-ID: 8KtwdXENtEd
This bug is for the front end work to make users more engaged with PWA.
Requirements
1. When the user goes to a web page that has manifest.json, we show a badge(in the same position of page action).
2. If the user switch to another normal page or other Java UI, the page action should be gone.
3. When the user see the PWA website for the first time, we will display a onboarding prompt to teach him how to add PWA to home screen. This prompt only shows once.
MozReview-Commit-ID: AcyjHPVKg2b
Handle rare cases where GeckoApplication is recreated when Fennec is
alive. In such cases, we need to unregister certain event listeners from
the old GeckoApplication so we can register again under the new one.
Also make GeckoActivityMonitor and TelemetryBackgroundReceiver better
handle GeckoApplication instance changes.
MozReview-Commit-ID: CrV8R9CyCRm
Back out the part 1 diagnostic crash and introduce another diagnostic
crash that will hopefully include more details. r=me for trivial patch.
MozReview-Commit-ID: Ki8BTdTRHlM
Consolidate GeckoAppShell initialization to GeckoApplication.onCreate
instead of spreading it out over different Activities. r=me for trivial
patch.
MozReview-Commit-ID: J0iv3qePlci
When page option 'add page shortcut' is clicked, creating a shortcut(not PWA) on launcher.
Also make sure that heavy tasks are executed in background thread.
MozReview-Commit-ID: 8KtwdXENtEd
Instead of using `getLayerView()` to perform haptic feedback, this patch
adds a `HapticFeedbackDelegate`, which `GeckoApplication` implements to
call `performHapticFeedback()` on the active view. Also, use
HapticFeedbackDelegate elsewhere in the Fennec codebase where we want to
perform haptic feedback.
MozReview-Commit-ID: GAArA6yJFNF
Instead of using `getLayerView()` to perform haptic feedback, this patch
adds a `HapticFeedbackDelegate`, which `GeckoApplication` implements to
call `performHapticFeedback()` on the active view. Also, use
HapticFeedbackDelegate elsewhere in the Fennec codebase where we want to
perform haptic feedback.
MozReview-Commit-ID: GAArA6yJFNF
Move the "Share:Text" event listener from GeckoApp to GeckoApplication,
so ActionBarHandler.js can use it for the Share action from any window.
MozReview-Commit-ID: 8w1llJy4pwy
Right now we have two Snackbar handlers in GeckoApp and
GeckoPreferences, respectively. This patch combines the two handlers
into one inside GeckoApplication, and lets us display Snackbars in other
Activities like custom tabs and PWA.
MozReview-Commit-ID: Iu6p2VNnVVC
Instead of initializing IntentHelper in GeckoApp, initialize it in
GeckoApplication, and make it available globally. This will let custom
tabs / PWA use IntentHelper-provided services.
MozReview-Commit-ID: Icedph6KG4u
Move the check permission event from `GeckoApp` to `GeckoApplication`,
and use the current activity if possible, so that we can use
`RuntimePermissions` in custom tabs and PWA. Also implement
`onRequestPermissionsResult` for custom tabs and PWA, in order to
forward the result back to `RuntimePermissions`.
MozReview-Commit-ID: Bg4BoXAUCz6
This patch includes some "pre" work, which should have been a separate patch (my apologies!):
- telemetry ping is (needlessly) coupled with information about where it should
be uploaded. It wasn't a problem before, since core pings are "upload right away",
and are never bundled together during an upload. However, for sync ping, we need to
bundle a bunch of "syncs" and "events" (down the road) into one single "sync ping", and as such
we need a separate representation for a "ping that is not meant to be uploaded directly".
- instead of dealing with the coupling directly, a simpler approach is taken:
- a "ping" is split into two types of pings: local and outgoing
- outgoing ping is what the old "ping" was - a data bundle that is ready to be uploaded
- local ping is not meant to be uploaded directly, but is intended to be a part of an
outgoing ping, along with other local pings
- the main difference between local and outgoing pings is the URL: local pings don't have
it while outgoing pings do have it.
As background telemetry is received via LocalBroadcastManager, it is processed as follows:
- telemetry data is processed into "local pings" which are stored on disk
- as enough telemetry is gathered, or we hit one of "let's upload now" conditions, the
persisted local pings are gathered into an "outgoing ping" via a SyncPingBundleBuilder,
which is persisted on disk.
- upload of the bundled "sync ping" is attempted
- as individual "local pings" are processed into outgoing "Sync ping" bundles, they are removed
from disk
Hooks for the upcoming event telemetry data are in place to make that follow-up work easier.
MozReview-Commit-ID: 6uXi6pjXiSv