Convert the "FilePicker:Show" event used in FilePicker and
testFilePicker to use GeckoBundle/BundleEventListener. UI event is used
because the listener performs Intent operations, which is best for the
UI thread. "FilePicker:Result" notification is removed in favor of
using a callback.
Convert events used in MulticastDNSManager to
GeckoBundle/BundleEventListener events. MulticastDNSManager also sends
observer notifications from Java to Gecko, and that converts nicely to
using the new unified EventDispatcher on both sides. The patch also
hides some logging behind a flag to reduce logcat clutter.
Convert events used in the two JavaAddonManager implementations to
GeckoBundle/BundleEventListener events. Gecko thread events are used to
keep with previous behavior. The external interface for addons is kept
the same (using Bundle/JSONObject as container objects), in order to
preserve compatibility, while the internal implementation is changed to
use GeckoBundle.
Fix the issue that RemoteManager.init() will be block for 5s when onServiceConnected() is
finished before latch creation.
MozReview-Commit-ID: CYYpLpY7Ns9
--HG--
extra : rebase_source : cfb6a6aa25d1f274418f879e8a536dbdff664615
2 birds with 1 stone:
- according to MediaCodec doc, when running in async mode start() must be called after flush() to 'resume receiving input buffers'.
- in JellyBeanAsyncCodec's case, explicit resuming polling input buffers helps Codec decide which buffers are invalid by flush().
MozReview-Commit-ID: Ee5QbppgsVf
--HG--
extra : rebase_source : e1593952f0dbbdeabd07e014482bc161315b83de
When clearing private data on exit, Gecko sends a "Sanitize:ClearHistory" message back to the Java UI, so the latter can clear the history DB if necessary.
For some users, this process is not working, presumably because there is a race condition depending on whether Gecko gets as far as sending that message before the background thread responsible for receiving that message has already shut down/had its listener unregistered, or not.
Therefore, we now wait until the UI's sanitize handlers have been called before starting to shut it down as well.
MozReview-Commit-ID: HoifMYv3spA
--HG--
extra : rebase_source : de4bb656c67104b9d5b1ea83329b77de0688a5d6
Convert the "TextSelection:*" events to use BundleEventListener /
GeckoBundle, in both ActionBarTextSelection.java and
FloatingToolbarTextSelection.java. UI events are used because the
listeners require the UI thread. The "TextSelection:Update" listeners
are removed because the event is no longer sent by ActionBarHandler.
Convert NotificationHelper events to use BundleEventListener and
GeckoBundle. UI events are used to perform notification operations, and
to keep access to mClearableNotifications to the UI thread. Also,
refactor some recently-added code in NotificationHelper.
Convert "Doorhanger:Add" and "Doorhanger:Remove" to bundle events. UI
events are used because the listener performs UI operations. As part of
the refactoring, DoorHangerConfig was refactored to use GeckoBundle, and
due to that change, a lot of other doorhanger-related classes also had
to be refactored to use GeckoBundle.
General concept is to populate the "extras" field with a stringified JSON object
which contains bunch of additional data which, in aggregate, might give insight
into user's actions.
A builder is used in order to make constructing the extras json string easier.
This builder has a concept of a "global state" which lets us easily include some information
with every A-S telemetry ping.
Currently this is used to track whether or not user has a firefox account.
An instance of a builder is passed around, augmented as more information becomes known,
and is materialized into an "extras" string whenever an action occurs and telemetry
event needs to be sent.
MozReview-Commit-ID: GDmxkWChnnA
--HG--
extra : rebase_source : 025d198e16d3a8af8b6e94bd531e916b80f9841a