We were updating the search engine bar every time the view was created, which
is inefficient because we already have a default state which we laid out and
drew. Since there were no search engines at the time, the search engine bar
would be hidden and another layout and draw would occur. Finally, when the
search engines arrived asynchronously from Gecko, we'd lay out and draw the
search engine bar (again). Obviously, this had had some perf implications.
Instead, now we only update the search engine bar if we explicitly choose not
to update the search engines (in onResume), or when the search engine data
arrives. The default state is to draw the empty search engine bar (including
magnifying glass label), to avoid a layout. We could use INVISIBLE, but then
the initial list of non-search engine results will look misplaced.
When the no search engines are returned (i.e. the user deletes them all), the
empty search engine bar will be briefly shown before hiding.
Once gecko is loaded on my N4, the search engines are received so quickly, the
empty search engine bar flicker only makes a minimal impression, no different
from the search engines appearing asynchronously. The best way to improve this
is probably to cache the search engines in Java (bug 1186703).
This patch assumes that Android M is going to be API level 23 (very likely) and additionally
checks for Android M Preview builds (Build.VERSION.RELEASE set to "M").
GeckoPreferences inherits from GeckoPreferencesBase which inherits from
GeckoBase, avoiding Gecko, where we put the last filterTouches... so it needs
its own filterTouches... TabQueueActivity is addressed and all other activities
inherit from Gecko.
All old sync activities inherit from SyncTheme, which inherits from Gecko on
API < 11 and Gecko.Dialog -> GeckoBaseDialog on v11+.
All fxaccount activities inherit from FxAccountTheme, which inherits from
Gecko.
Note that I don't have an old sync account so I did not test that behavior.
This will affect any activities that do not inherit a theme, which is currently
none of them.
Note that this may affect default inheritance (e.g. we'll no longer inherit
from Holo, if it's the default) but I haven't done the research. To fix it,
you'd have to make the FilteredTouches theme inherit from the default theme
(which could be different for each API level).