Removed final from public sendMessage and sendMessageDelayed commands to
unblock unittest development. This allows tests to verify calls to
sendMessage and sendMessageDelayed.
Also fixed one checkstyle error with import order.
BUG: 28593024
Change-Id: I26e02c3d75049d385ded7891c4fc9967273c27be
TEST: builds
TEST: runtest frameworks-wifi
Required on nyc-mr1-dev since support library branch was reset.
Change-Id: I5b3ba0e7a17ee5ccd93e97b3bd9c519cb8641d97
(cherry picked from commit 80bf1f8a3c)
It turns out that we can let the system to call
InputMethodService#exposeContent(InputContentInfo, EditorInfo), which
added in my previous CL [1], during the IME is calling
InputConnection#commitContent() as follows.
[IME]
InputContentInfo contentInfo = new InputContentInfo(
contentUri,
new ClipDescription(description, new String[]{mimeType}),
linkUrl);
getCurrentInputConnection().commitContent(
inputContentInfo,
InputConnection.INPUT_CONTENT_GRANT_READ_URI_PERMISSION,
null);
[App]
try {
contentInfo.requestPermission();
// Load inputContentInfo.getContentUri() here.
} finally {
contentInfo.releasePermission();
}
This gives us flexibility to let InputConnection#commitContent() do all
the magic for IME developers like other APIs such as
Context#startActivity(), rather than asking them to call one more API to
grant a temporary URI permission like a scenario where
Context#grantUriPermission() is used.
[1]: I2772889ca01f2ecb2cdeed4e04a9319bdf7bc5a6
25e0813e6e
Bug: 29450031
Change-Id: I99536cd58c9984af30b0bafb4a1dd25a26634a2d
Bug: 29586513
Also gives BackdropFrameRenderer a direct-destroy
of Choreographer since it's hammering on new Threads
and we don't want to wait for the GC to release
FDs.
Change-Id: Id2ec0af2ee4d5304961c4ab87a104ccb92f35fc2
This is a follow up CL to my previous CLs [1][2] that introduced
InputConnection#commitContent(InputContentInfo, Bundle) API to enable
IMEs to send a content to the target application.
With this CL, IME developers are able to temporarily expose
InputContentInfo object to the target package without permanently
granting URI permission. Although calling IMS#exposeContent() is
allowed only for the IME that is currently selected, the client is able
to request a temporary read-only access even after the current IME is
switched to any other IME as long as the client keeps InputContentInfo
object.
Here is a sample code snippet about how to use this mechanism.
[IME]
InputContentInfo contentInfo = new InputContentInfo(
contentUri,
new ClipDescription(description, new String[]{mimeType}),
linkUrl);
exposeContent(contentInfo, getCurrentInputEditorInfo());
getCurrentInputConnection().commitContent(inputContentInfo, null);
[App]
try {
contentInfo.requestPermission();
// Load inputContentInfo.getContentUri() here.
} finally {
contentInfo.releasePermission();
}
[1]: Iaadf934a997ffcd6000a516cc3c1873db56e60ad
152944f490
[2]: Ica1ba3154795c1bf44e140dfe639b299f83cd8af
adebb52588
Bug: 29450031
Change-Id: I2772889ca01f2ecb2cdeed4e04a9319bdf7bc5a6
The PowerProfile in BatteryStatsImpl may not be ready when
resetting stats early in the boot sequence.
Bug:29559031
Change-Id: I51bba762231a08804f1b68505bb1b0523476081d
Serbian in Latin script is only partially localized in Android N. We
should not show it as localized in either Setup Wizard or Settings.
Bug: 29460424
Change-Id: I6829a89c49c1b5e8768b1527daa3aa9508deb491
If the zygote dies early enough, certain exceptions disappear and never
result in an error message in the log. Fix the code to catch all
Throwable exceptions so that an error message does not result in a
silent restart of the zygote.
Bug: 29400363
Change-Id: Ib044006629ea4441728921f3c587d0cb295ec745
As shown in below, we have already used commit* naming convention in
InputConnection.
- InputConnection#commitCompletion(CompletionInfo);
- InputConnection#commitCorrection(CorrectionInfo);
- InputConnection#commitText(CharSequence, int);
Hence renaming IC#inputContent() to IC#commitContent() would make the
new method more consistent.
Bug: 29450024
Change-Id: Ica1ba3154795c1bf44e140dfe639b299f83cd8af
Use the new API that contains multiple hash prefixes and a mask. Also
do some small refactoring necessary to handle multiple prefixes and
use a common implementation of the hash generation
Change-Id: Ib52f767ea6aadc30c67c5bdee949e9f9c5f04e44
It turns out that the performance of
InputMethodManager#getCurrentInputMethodSubtype() is regressed from ~1ms
to ~20ms when
- Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE == -1 and
- The active IME supports many subtypes (~100)
because we try to find a fallback subtype based on the system locales
every time when IMM#getCurrentInputMethodSubtype() is called.
This could be contributing UI janks because spell checker clients
running in the UI thread indirectly depend on that method.
Fortunatelly the critical path is in
InputMethodUtils#getImplicitlyApplicableSubtypesLockedImpl(), which is
basically a state-less method. We can easily and safely cache its
result by using LocaleList and InputMethod as cache keys.
With this CL the performance basically recovers to the Android M level.
Bug: 28889203
Change-Id: I5ed16c7f14cc18052854f4fd6c9bae8550c332ee
Fixes a particularly bad transition in the case where there
is one incoming message to a group.
Change-Id: Ieddece4a496292a69e14cdcd74d94986938d8223
Fixes: 29043489
Providing an official protocol for IMEs to insert an image to the
application is something that has been requested from many IME
developers to Android OS. With this CL, IMEs are able to ask
applications to insert a content including image files as follows.
1. An application that opts in to this protocol specifies a list of
supported content MIME types in EditorInfo#contentMimeTypes.
2. When an IME is actively interacting with such an application, the
IME can call InputConnection#insertContent() with a InputContentInfo
that contains content URI, metadata (ClipDescription), and an
optional link URI.
3. The application can read the stream data from the given content URI
to insert the content into somewhere in the application.
Detailed design background can be found in the JavaDoc of
InputConnection#insertContent().
Bug: 22830793
Change-Id: Iaadf934a997ffcd6000a516cc3c1873db56e60ad
When app is resized in multi-window mode we preserve the window along
with the decor view. If action mode view was shown before such config
change, its view is detached, but the mPrimaryActionModeView variable
is not cleared. So when action mode view is shown again after that it
thinks that its view is still alive.
This CL adds additional check to inflate new mPrimaryActionModeView
if it is not attached to any window.
Bug: 28971666
Change-Id: Ia8c24d4322be32e8b2c8967301beb3a4d889d501