Fix the issue that RemoteManager.init() will be block for 5s when onServiceConnected() is
finished before latch creation.
MozReview-Commit-ID: CYYpLpY7Ns9
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
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
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
Convert "SearchEngines:Data" to use BundleEventListener/GeckoBundle,
including usages in BrowserSearch, SearchPreferenceCategory,
testAddSearchEngine, testDistribution, etc. Also, convert JSON parsing
code in various classes. UI thread is used because the event listeners
perform various UI operations based on the event data.
preferences_general_tablet.xml actually only applies on tablets with enough room
for multiple panes, otherwise preferences_general.xml is used; so the fix here
is necessary to remove the pref on tablets not large enough for multiple
preferences panes.
MozReview-Commit-ID: Ff7VebVYV10
This is the first, mostly mechanical, introduction of a GeckoView
specific BuildConfig.
We have a few "debug logging" like checks. I introduced a
MOZILLA_OFFICIAL abstraction and removed some of the checks as I saw
fit. Subsequent patches will remove more of these checks.
With this change applied, Gradle is broken, because there will be
duplicate BuildConfig files included in the build. That will be fixed
in subsequent patches.
MozReview-Commit-ID: KHhV32o5j5A
This patch abstracts setting the screen orientation into an interface
(but not into the already overloaded GeckoInterface).
I feel this form obscures the (eventual) connection between the
GeckoView widget and its embedding Activity, but it removes the
explicit getActivity() and it's certainly simpler than previous
iterations.
MozReview-Commit-ID: 8a8bPTlcp3T