Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 432cf600 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Enable @MissingMethodFlags annotation in IMMS

This is a preparation to split
com.android.internal.view.InputMethodClient.

When InputConnectionInspector.MissingMethodFlags annotation was
originally introduced [1], somehow we could not use that annotation in
InputMethodManagerService (IMMS) probably because of some build system
or compiler limitation since the attribute belongs to frameworks.jar
while IMMS belongs to services.jar.

Now it seems that such a limitation no longer exists, there is no
reason to not enable @MissingMethodFlags annotation in IMMS.

@MissingMethodFlags is @Retention(SOURCE) anyway. Hence there should
be no behavior difference at run time.

 [1]: I3c58fadd924fad72cb984f0c23d3099fd0295c64
      19a80a1e

Bug: 118040692
Test: compile
Change-Id: I2ecf7a452b088df48f847227faac36062c3b9bc0
parent d2b64d70
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputBinding;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputConnectionInspector;
import android.view.inputmethod.InputConnectionInspector.MissingMethodFlags;
import android.view.inputmethod.InputMethod;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
@@ -517,6 +518,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
     *
     * @see android.view.inputmethod.InputConnectionInspector.MissingMethodFlags
     */
    @MissingMethodFlags
    int mCurInputContextMissingMethods;

    /**
@@ -1886,8 +1888,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
    @GuardedBy("mMethodMap")
    @NonNull
    InputBindResult startInputUncheckedLocked(@NonNull ClientState cs, IInputContext inputContext,
            /* @InputConnectionInspector.missingMethods */ final int missingMethods,
            @NonNull EditorInfo attribute, int controlFlags,
            @MissingMethodFlags int missingMethods, @NonNull EditorInfo attribute, int controlFlags,
            /* @InputMethodClient.StartInputReason */ final int startInputReason) {
        // If no method is currently selected, do nothing.
        if (mCurMethodId == null) {
@@ -2737,8 +2738,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            /* @InputMethodClient.StartInputReason */ final int startInputReason,
            IInputMethodClient client, IBinder windowToken, int controlFlags, int softInputMode,
            int windowFlags, @Nullable EditorInfo attribute, IInputContext inputContext,
            /* @InputConnectionInspector.missingMethods */ final int missingMethods,
            int unverifiedTargetSdkVersion) {
            @MissingMethodFlags int missingMethods, int unverifiedTargetSdkVersion) {
        if (windowToken == null) {
            Slog.e(TAG, "windowToken cannot be null.");
            return InputBindResult.NULL;
@@ -2763,8 +2763,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            IInputMethodClient client, @NonNull IBinder windowToken, int controlFlags,
            /* @android.view.WindowManager.LayoutParams.SoftInputModeFlags */ int softInputMode,
            int windowFlags, EditorInfo attribute, IInputContext inputContext,
            /* @InputConnectionInspector.missingMethods */  final int missingMethods,
            int unverifiedTargetSdkVersion) {
            @MissingMethodFlags int missingMethods, int unverifiedTargetSdkVersion) {
        // Needs to check the validity before clearing calling identity
        final boolean calledFromValidUser = calledFromValidUser();
        InputBindResult res = null;