diff options
| author | Yohei Yukawa <yukawa@google.com> | 2016-06-27 20:34:58 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2016-06-27 20:34:58 +0000 |
| commit | a3fd8bfdfeb1cb54da6d6803a97708199efa92a7 (patch) | |
| tree | 279fa2e96ab009c722fb430f38729113d90e0416 /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | 5df32fd4d301d3322e27f6b1ca5e78de714c51fc (diff) | |
| parent | c58ffb3f9cc7d446e01f070fbb5a9a30293c6e30 (diff) | |
Merge \"Merge \\"Use a flag to grant a temporary URI permission.\\" into nyc-mr1-dev am: cb56978912\" into nyc-mr1-dev-plus-aosp
am: c58ffb3f9c
Change-Id: Iddc693412d20b86c3a916dd09764d14d23c4fcf4
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 6594c0912551..ad3f4d296c67 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -2604,33 +2604,23 @@ public class InputMethodService extends AbstractInputMethodService { * Allow the receiver of {@link InputContentInfo} to obtain a temporary read-only access * permission to the content. * - * <p>Make sure that the content provider owning the Uri sets the - * {@link android.R.styleable#AndroidManifestProvider_grantUriPermissions - * grantUriPermissions} attribute in its manifest or included the - * {@link android.R.styleable#AndroidManifestGrantUriPermission - * <grant-uri-permissions>} tag. Otherwise {@link InputContentInfo#requestPermission()} - * can fail.</p> - * - * <p>Although calling this API 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 {@link InputContentInfo} object.</p> - * * @param inputContentInfo Content to be temporarily exposed from the input method to the * application. * This cannot be {@code null}. - * @param editorInfo The editor that receives {@link InputContentInfo}. - * @return {@code false} if we cannot allow a temporary access permission. + * @param inputConnection {@link InputConnection} with which + * {@link InputConnection#commitContent(InputContentInfo, Bundle)} will be called. + * @hide */ - public final boolean exposeContent(@NonNull InputContentInfo inputContentInfo, - @NonNull EditorInfo editorInfo) { - if (inputContentInfo == null) { - throw new NullPointerException("inputContentInfo"); + @Override + public final void exposeContent(@NonNull InputContentInfo inputContentInfo, + @NonNull InputConnection inputConnection) { + if (inputConnection == null) { + return; } - if (editorInfo == null) { - throw new NullPointerException("editorInfo"); + if (getCurrentInputConnection() != inputConnection) { + return; } - - return mImm.exposeContent(mToken, inputContentInfo, editorInfo); + mImm.exposeContent(mToken, inputContentInfo, getCurrentInputEditorInfo()); } /** |
