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
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 53b224c..b93afdf 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -30,6 +30,7 @@
 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 @@
      * 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 ==