diff options
author | Yohei Yukawa <yukawa@google.com> | 2016-06-23 17:12:59 -0700 |
---|---|---|
committer | Yohei Yukawa <yukawa@google.com> | 2016-06-23 17:12:59 -0700 |
commit | 45700fa135e83ed44e4b69ca60cf12960a5898d7 (patch) | |
tree | e734d40c9a3c23b3d83a8a7fb195986ba7c221ff /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | 9ee8f8066c15f7d4977a26d624baca1210666026 (diff) |
Use a flag to grant a temporary URI permission.
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
25e0813e6eb6315b1016db805fa9b791b4ae5cc2
Bug: 29450031
Change-Id: I99536cd58c9984af30b0bafb4a1dd25a26634a2d
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions