From f9ca70be577b6d6337d323d3cd0c05640d6a7970 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Fri, 23 Jul 2021 09:31:44 -0700 Subject: [PATCH] Clarify on return value of IC#setImeConsumesInput() This CL aims to clarify on what the return value of InputConnection#setImeConsumesInput() means for both the IME authors and editor authors [1][2]. In short, the semantics is exactly the same as InputConnection#performSpellCheck() hence this CL reuses its @return section. Other than clarifying an API doc, this CL changes nothing. [1]: Ic04cacfd73f1f4cb254bb16caf6b04c00c91a318 30fe6aa9648e6138f7cf2e58105a8affbec91364 [2]: I8ac1ea4d53f747b0086ed415ff90793dfc6155bc 66b21086e39ee2f41abaa10a122124b5182be0b8 Bug: 175362887 Fix: 194099171 Test: presubmit Change-Id: Ibdfe81a9dd1448856797aaed2f14de1314da1cac --- core/java/android/view/inputmethod/InputConnection.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/inputmethod/InputConnection.java b/core/java/android/view/inputmethod/InputConnection.java index 38019c9a34f8a..5f036a3488083 100644 --- a/core/java/android/view/inputmethod/InputConnection.java +++ b/core/java/android/view/inputmethod/InputConnection.java @@ -1013,8 +1013,10 @@ public interface InputConnection { * * @param imeConsumesInput {@code true} when the IME is consuming input and the cursor should be * hidden, {@code false} when input to the editor resumes and the cursor should be shown again. - * @return {@code true} on success, {@code false} if the input connection is no longer valid, or - * the protocol is not supported. + * @return For editor authors, the return value will always be ignored. For IME authors, this + * method returns {@code true} if the request was sent (whether or not the associated + * editor does something based on this request), {@code false} if the input connection + * is no longer valid. */ default boolean setImeConsumesInput(boolean imeConsumesInput) { return false;