summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yohei Yukawa <yukawa@google.com> 2018-09-11 13:34:36 -0700
committer Yohei Yukawa <yukawa@google.com> 2018-09-11 13:34:36 -0700
commit5b83a80aab883e03202a3768caf232cf5d5b9c8d (patch)
treeaa9f80c3ded4a22dd32d736f042a5b465c1f8e3e
parent874e10f4a6dfc64a7516007fd63765b2b1564383 (diff)
Restrict IMM.notifyUserAction() with targetSdkVersion <= P
With my change [1] in Android N, applications no longer need to manually call this hidden API even when directly implementing InputConnection interface without extending BaseInputConnection [2]. So far applications that we have confirmed to be using this hidden API is Chromium and browsers that are supposed to be built on top of Chromium source code [3]. Actually my change [1] was per request from Chromium team and Chromium does not use this hidden API on Android N and later devices [4]. Moving forward, with this CL applications that target API 29 and later are no longer allowed to use this hidden API since we see no actual use case of this hidden API on Android N and later devices so far. If you have any reason to continue relying on this hidden API, please leave a comment in Bug 114740982. [1]: I571d6cc9c6e461d8994aa7496e7e18be13766411 159dd47db34151314e2449347251ad32b30e5ea1 [2]: This scenario had not been suppored until Android N. See also other CLs that are tagged with Bug 24688781. [3]: https://cs.chromium.org/chromium/src/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapperImpl.java?rcl=525c72b0f4694d6b3f93bcc7797d0411c2fa683c&l=113-128 [4]: crbug.com/551193 Bug: 114159783 Bug: 114740982 Test: compile Merged-In: I41d6419438cef92cce81cc33d9db00dd2ee89d33 Change-Id: Iac81f49413605271fccc0b8aec3e6ed95925f061
-rw-r--r--core/java/android/view/inputmethod/InputMethodManager.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 53b224c36cb2..b93afdf3a090 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -30,6 +30,7 @@ import android.content.pm.PackageManager;
import android.graphics.Rect;
import android.inputmethodservice.InputMethodService;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
@@ -2249,7 +2250,7 @@ public final class InputMethodManager {
* Notify that a user took some action with this input method.
* @hide
*/
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 114740982, maxTargetSdk = Build.VERSION_CODES.P)
public void notifyUserAction() {
synchronized (mH) {
if (mLastSentUserActionNotificationSequenceNumber ==