Merge commit '0a4730f8889bd98e272bd5e7e0fedb6a69d33f54'
* commit '0a4730f8889bd98e272bd5e7e0fedb6a69d33f54':
add some more defensiveness to SuggestionsAdapter to avoid system process crashes.
Bad Things(tm) happen if some of the lifecycle interfaces on IActivityThread are
oneway but others are not [notably, out-of-order method delivery, i.e.
catastrophe]. This change makes the methods added for backup-agent management
oneway like the rest of the API.
use by SearchDialog. SearchDialog wants to be able to say a dropdown should
not always be visible but still let it ignore outside touch when it does
show.
Fixes http://b/1997170
Merge commit '5e21a11f00e3e65f6d7681e2519677329f0a92b2'
* commit '5e21a11f00e3e65f6d7681e2519677329f0a92b2':
Work around StateListDrawable padding in search suggestions
Sometimes when searching, some of the suggestions had no left padding.
The left-hand side icons were flush with the left edge of the screen.
The problems was that setting a StateListDrawable as a background
will always set the padding of a View, because of a problem in
DrawableContainer.
DrawableContainer.DrawableContainerState.getConstantPadding()
will always return a Rect if mVariablePadding is false, which
makes DrawableContainer.getPadding() return true, which
causes View to change the padding.
As a workaround, we use setVariablePadding(true) on the background
that we create.
Fixes http://b/editIssue?id=1984813
Merge commit '7e71fb284d5997bff7e359edc8e1b19cbfb1c9ca'
* commit '7e71fb284d5997bff7e359edc8e1b19cbfb1c9ca':
Don't start search from a dialog if there is no activity associated with
the search manager at that point.
Still works:
- hitting search when a managed dialog of an app is showing will dismiss
the dialog and start in-app search (if it supports it), falling back
on global search
- hitting search when a dialog of an app (not managed by the activity) will
dismiss the dialog and start global search
- hitting search when a system dialog is showing will just dismiss the dialog.
Merge commit '2a1aa6acbba5a3a9142d3e8bd6fe6e19d5fae6be'
* commit '2a1aa6acbba5a3a9142d3e8bd6fe6e19d5fae6be':
Define a broadcast intent for the web search provider changing. Unhide
Merge commit '2acbec4918db4ab6eca32cf427ffd771c9efe35f'
* commit '2acbec4918db4ab6eca32cf427ffd771c9efe35f':
add comment to illuminate why we only dismiss the dialog when launching an intent for in app search
Merge commit '9ff71d38a060476ba19deacf12ddaeef3cbac00d'
* commit '9ff71d38a060476ba19deacf12ddaeef3cbac00d':
whoops, still need to dismiss when launching an intent for in-app search
Now that the search manager service handles hiding (not dismissing) and reshowing it
when the user hits back after launching a result, search manager can't cache
"mShowing". Also noticed a few other minor problems that was hosing the handling
of pause / resume to reshow the dialog, like moving some logic to onHide instead
of onDismiss.
Merge commit 'f32f746b83826303350417ff9937a6f9e5488f24'
* commit 'f32f746b83826303350417ff9937a6f9e5488f24':
Make the SearchDialog's AutoCompleteTextView dropdown respect the
Before, Drawables for cached icons were reused. This is not good,
since they can then share mutable state information. This change
copies all Drawables when getting them from the cache, storing
only the constant state in the cache.
Hopefully fixes http://b/issue?id=1984813
IME again when the user presses right or left from a query-jammed
suggestion to continue editing. Previously we required the user
to press on the text field again in order to get the IME to show.
We accomplish this by factoring out the code to 'ensureImeVisible'
into a separate method and calling that from SearchDialog.
Fixes http://b/1976338
Merge commit '9ce081aa2493dc163a42decfd4e1756b5c55a834'
* commit '9ce081aa2493dc163a42decfd4e1756b5c55a834':
Add ability to delay messages in Filter based on constraint. Use this to delay 500ms for delete keys in the search dialog.
Merge commit 'eb09c6a07abf58b4da2c4baf3800a1f96e3b0731'
* commit 'eb09c6a07abf58b4da2c4baf3800a1f96e3b0731':
Issue #1969025: need api for launching intent as if it were coming from another component
Merge commit '8e3c3f6461b53dc587ba92b3fe8cfbeb985f8514'
* commit '8e3c3f6461b53dc587ba92b3fe8cfbeb985f8514':
Only parse search suggestions that look like HTML
Merge commit '5380aa29470274de5b3e445d577ef0834cfacb71'
* commit '5380aa29470274de5b3e445d577ef0834cfacb71':
Get rid of drawing hacks for search dialog suggestions
HTML parsing of search suggestions is still a major
CPU hog in the search dialog. This change first
checks if the text contains any HTML markup
(by looking for < and &) before bothering to
treat it as HTML.
Before, SuggestionsAdapter parsed every HTML formatted
string three times, to support state-dependent colors
in <font> tags. Now that there is support in Html
for color resources (added in
https://android-git.corp.google.com/g/7441),
we can get rid of this code.
Also, SuggestionsAdapter had a special purpose view
for drawing background colors when suggestion items
were not selected or pressed. This change replaces that
code with a StateListDrawable of ColorDrawables.
Before this change, HTML parsing used ~17% (uncontrolled benchmark,
just did some random searching) of the system_process CPU.
This change should reduce that by 2/3, i.e. about ~11% total
system_process reduction.
This change adds checking that the searchdialog is initialized
properly to a few key event listeners where it was missing
before.
Also makes sure that the search dialog is not shown if the
global search is requested but the global search provider
cannot be found.
Should fix http://b/issue?id=1982128
"Device rebooting after search results"
where SearchDialog.onKeyDown() threw an NPE
Merge commit '82b283a9bf8e3508e1b5c6d4b6b8cae04597b83c'
* commit '82b283a9bf8e3508e1b5c6d4b6b8cae04597b83c':
Include 'calling_package' extra for uses of in-app voice search so that
Merge commit '1fffbd97fa756ef7d3e7e885a5c1c8bb64380c20'
* commit '1fffbd97fa756ef7d3e7e885a5c1c8bb64380c20':
Fix keyboard not showing for global search on Dream. Rather than trying to
call the hidden showSoftInputUnchecked method to show the IME in SearchDialog#show(),
override onWindowFocusChanged in our subclass of AutoCompleteTextView so that whenever
it gets focus, we call the public showSoftInput method, passing in the ACTV, which is
the correct way to do this.
This fixes http://b/1930989.