Summary:
Speculative fix.
initialize() is called by Gecko on it's background thread after it started.
The value for the "dom.audiochannel.mediaControl" preference also comes on a
background thread.
This both can end up registering the HeadSetStateReceiver while unregistering it
happens only on the main thread.
The patch tries to avoid the race condition by making sure Receiver's
registering and unregistering is done serially on the main thread.
Depends on D12032
Reviewers: JanH
Reviewed By: JanH
Subscribers: jya
Bug #: 1505685
Differential Revision: https://phabricator.services.mozilla.com/D12033
Summary:
Speculative fix.
initialize() is called by Gecko on it's background thread after it started.
The value for the "dom.audiochannel.mediaControl" preference also comes on a
background thread.
This both can end up registering the HeadSetStateReceiver while unregistering it
happens only on the main thread.
The patch tries to avoid the race condition by making sure Receiver's
registering and unregistering is done serially on the main thread.
Depends on D12032
Reviewers: JanH
Reviewed By: JanH
Subscribers: jya
Bug #: 1505685
Differential Revision: https://phabricator.services.mozilla.com/D12033
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