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

Commit e21c66fb authored by Yohei Yukawa's avatar Yohei Yukawa Committed by Android (Google) Code Review
Browse files

Merge "Add missing @RequiresPermission to IMM"

parents 515e3ce2 e6193303
Loading
Loading
Loading
Loading
+15 −5
Original line number Original line Diff line number Diff line
@@ -107,8 +107,8 @@ final class IInputMethodManagerGlobalInvoker {
     * @param where where the information is coming from.
     * @param where where the information is coming from.
     * @param exceptionHandler an optional {@link RemoteException} handler.
     * @param exceptionHandler an optional {@link RemoteException} handler.
     */
     */
    @RequiresNoPermission
    @AnyThread
    @AnyThread
    @RequiresNoPermission
    static void startProtoDump(byte[] protoDump, int source, String where,
    static void startProtoDump(byte[] protoDump, int source, String where,
            @Nullable Consumer<RemoteException> exceptionHandler) {
            @Nullable Consumer<RemoteException> exceptionHandler) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
@@ -127,8 +127,8 @@ final class IInputMethodManagerGlobalInvoker {
     *
     *
     * @param exceptionHandler an optional {@link RemoteException} handler.
     * @param exceptionHandler an optional {@link RemoteException} handler.
     */
     */
    @RequiresPermission(android.Manifest.permission.CONTROL_UI_TRACING)
    @AnyThread
    @AnyThread
    @RequiresPermission(Manifest.permission.CONTROL_UI_TRACING)
    static void startImeTrace(@Nullable Consumer<RemoteException> exceptionHandler) {
    static void startImeTrace(@Nullable Consumer<RemoteException> exceptionHandler) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
        if (service == null) {
        if (service == null) {
@@ -146,8 +146,8 @@ final class IInputMethodManagerGlobalInvoker {
     *
     *
     * @param exceptionHandler an optional {@link RemoteException} handler.
     * @param exceptionHandler an optional {@link RemoteException} handler.
     */
     */
    @RequiresPermission(android.Manifest.permission.CONTROL_UI_TRACING)
    @AnyThread
    @AnyThread
    @RequiresPermission(Manifest.permission.CONTROL_UI_TRACING)
    static void stopImeTrace(@Nullable Consumer<RemoteException> exceptionHandler) {
    static void stopImeTrace(@Nullable Consumer<RemoteException> exceptionHandler) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
        if (service == null) {
        if (service == null) {
@@ -165,8 +165,8 @@ final class IInputMethodManagerGlobalInvoker {
     *
     *
     * @return The return value of {@link IInputMethodManager#isImeTraceEnabled()}.
     * @return The return value of {@link IInputMethodManager#isImeTraceEnabled()}.
     */
     */
    @RequiresNoPermission
    @AnyThread
    @AnyThread
    @RequiresNoPermission
    static boolean isImeTraceEnabled() {
    static boolean isImeTraceEnabled() {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
        if (service == null) {
        if (service == null) {
@@ -182,8 +182,8 @@ final class IInputMethodManagerGlobalInvoker {
    /**
    /**
     * Invokes {@link IInputMethodManager#removeImeSurface()}
     * Invokes {@link IInputMethodManager#removeImeSurface()}
     */
     */
    @RequiresPermission(android.Manifest.permission.INTERNAL_SYSTEM_WINDOW)
    @AnyThread
    @AnyThread
    @RequiresPermission(Manifest.permission.INTERNAL_SYSTEM_WINDOW)
    static void removeImeSurface(@Nullable Consumer<RemoteException> exceptionHandler) {
    static void removeImeSurface(@Nullable Consumer<RemoteException> exceptionHandler) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
        if (service == null) {
        if (service == null) {
@@ -228,6 +228,7 @@ final class IInputMethodManagerGlobalInvoker {


    @AnyThread
    @AnyThread
    @NonNull
    @NonNull
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    static List<InputMethodInfo> getEnabledInputMethodList(@UserIdInt int userId) {
    static List<InputMethodInfo> getEnabledInputMethodList(@UserIdInt int userId) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
        if (service == null) {
        if (service == null) {
@@ -242,6 +243,7 @@ final class IInputMethodManagerGlobalInvoker {


    @AnyThread
    @AnyThread
    @NonNull
    @NonNull
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    static List<InputMethodSubtype> getEnabledInputMethodSubtypeList(@Nullable String imiId,
    static List<InputMethodSubtype> getEnabledInputMethodSubtypeList(@Nullable String imiId,
            boolean allowsImplicitlyEnabledSubtypes, @UserIdInt int userId) {
            boolean allowsImplicitlyEnabledSubtypes, @UserIdInt int userId) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
@@ -258,6 +260,7 @@ final class IInputMethodManagerGlobalInvoker {


    @AnyThread
    @AnyThread
    @Nullable
    @Nullable
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    static InputMethodSubtype getLastInputMethodSubtype(@UserIdInt int userId) {
    static InputMethodSubtype getLastInputMethodSubtype(@UserIdInt int userId) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
        if (service == null) {
        if (service == null) {
@@ -303,6 +306,7 @@ final class IInputMethodManagerGlobalInvoker {


    @AnyThread
    @AnyThread
    @NonNull
    @NonNull
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    static InputBindResult startInputOrWindowGainedFocus(@StartInputReason int startInputReason,
    static InputBindResult startInputOrWindowGainedFocus(@StartInputReason int startInputReason,
            @NonNull IInputMethodClient client, @Nullable IBinder windowToken,
            @NonNull IInputMethodClient client, @Nullable IBinder windowToken,
            @StartInputFlags int startInputFlags,
            @StartInputFlags int startInputFlags,
@@ -341,6 +345,7 @@ final class IInputMethodManagerGlobalInvoker {
    }
    }


    @AnyThread
    @AnyThread
    @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
    static void showInputMethodPickerFromSystem(@NonNull IInputMethodClient client,
    static void showInputMethodPickerFromSystem(@NonNull IInputMethodClient client,
            int auxiliarySubtypeMode, int displayId) {
            int auxiliarySubtypeMode, int displayId) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
@@ -370,6 +375,7 @@ final class IInputMethodManagerGlobalInvoker {


    @AnyThread
    @AnyThread
    @Nullable
    @Nullable
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    static InputMethodSubtype getCurrentInputMethodSubtype(@UserIdInt int userId) {
    static InputMethodSubtype getCurrentInputMethodSubtype(@UserIdInt int userId) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
        if (service == null) {
        if (service == null) {
@@ -383,6 +389,7 @@ final class IInputMethodManagerGlobalInvoker {
    }
    }


    @AnyThread
    @AnyThread
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    static void setAdditionalInputMethodSubtypes(@NonNull String imeId,
    static void setAdditionalInputMethodSubtypes(@NonNull String imeId,
            @NonNull InputMethodSubtype[] subtypes, @UserIdInt int userId) {
            @NonNull InputMethodSubtype[] subtypes, @UserIdInt int userId) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
@@ -397,6 +404,7 @@ final class IInputMethodManagerGlobalInvoker {
    }
    }


    @AnyThread
    @AnyThread
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    static void setExplicitlyEnabledInputMethodSubtypes(@NonNull String imeId,
    static void setExplicitlyEnabledInputMethodSubtypes(@NonNull String imeId,
            @NonNull int[] subtypeHashCodes, @UserIdInt int userId) {
            @NonNull int[] subtypeHashCodes, @UserIdInt int userId) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
@@ -477,6 +485,7 @@ final class IInputMethodManagerGlobalInvoker {
    }
    }


    @AnyThread
    @AnyThread
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    static boolean isStylusHandwritingAvailableAsUser(@UserIdInt int userId) {
    static boolean isStylusHandwritingAvailableAsUser(@UserIdInt int userId) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
        if (service == null) {
        if (service == null) {
@@ -504,6 +513,7 @@ final class IInputMethodManagerGlobalInvoker {
    }
    }


    @AnyThread
    @AnyThread
    @RequiresPermission(Manifest.permission.TEST_INPUT_METHOD)
    static void setStylusWindowIdleTimeoutForTest(
    static void setStylusWindowIdleTimeoutForTest(
            IInputMethodClient client, @DurationMillisLong long timeout) {
            IInputMethodClient client, @DurationMillisLong long timeout) {
        final IInputMethodManager service = getService();
        final IInputMethodManager service = getService();
+28 −14
Original line number Original line Diff line number Diff line
@@ -16,8 +16,6 @@


package android.view.inputmethod;
package android.view.inputmethod;


import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL;
import static android.Manifest.permission.WRITE_SECURE_SETTINGS;
import static android.view.inputmethod.InputConnection.CURSOR_UPDATE_IMMEDIATE;
import static android.view.inputmethod.InputConnection.CURSOR_UPDATE_IMMEDIATE;
import static android.view.inputmethod.InputConnection.CURSOR_UPDATE_MONITOR;
import static android.view.inputmethod.InputConnection.CURSOR_UPDATE_MONITOR;
import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.DISPLAY_ID;
import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.DISPLAY_ID;
@@ -1525,12 +1523,18 @@ public final class InputMethodManager {
    /**
    /**
     * Returns {@code true} if currently selected IME supports Stylus handwriting & is enabled for
     * Returns {@code true} if currently selected IME supports Stylus handwriting & is enabled for
     * the given userId.
     * the given userId.
     * If the method returns {@code false}, {@link #startStylusHandwriting(View)} shouldn't be
     *
     * called and Stylus touch should continue as normal touch input.
     * <p>If the method returns {@code false}, {@link #startStylusHandwriting(View)} shouldn't be
     * called and Stylus touch should continue as normal touch input.</p>
     *
     * <p>{@link Manifest.permission#INTERACT_ACROSS_USERS_FULL} is required when and only when
     * {@code userId} is different from the user id of the current process.</p>
     *
     * @see #startStylusHandwriting(View)
     * @see #startStylusHandwriting(View)
     * @param userId user ID to query.
     * @param userId user ID to query.
     * @hide
     * @hide
     */
     */
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    public boolean isStylusHandwritingAvailableAsUser(@UserIdInt int userId) {
    public boolean isStylusHandwritingAvailableAsUser(@UserIdInt int userId) {
        final Context fallbackContext = ActivityThread.currentApplication();
        final Context fallbackContext = ActivityThread.currentApplication();
        if (fallbackContext == null) {
        if (fallbackContext == null) {
@@ -1567,14 +1571,17 @@ public final class InputMethodManager {
    /**
    /**
     * Returns the list of installed input methods for the specified user.
     * Returns the list of installed input methods for the specified user.
     *
     *
     * <p>{@link Manifest.permission#INTERACT_ACROSS_USERS_FULL} is required when and only when
     * {@code userId} is different from the user id of the current process.</p>
     *
     * @param userId user ID to query
     * @param userId user ID to query
     * @param directBootAwareness {@code true} if caller want to query installed input methods list
     * @param directBootAwareness {@code true} if caller want to query installed input methods list
     * on user locked state.
     * on user locked state.
     * @return {@link List} of {@link InputMethodInfo}.
     * @return {@link List} of {@link InputMethodInfo}.
     * @hide
     * @hide
     */
     */
    @RequiresPermission(INTERACT_ACROSS_USERS_FULL)
    @NonNull
    @NonNull
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    public List<InputMethodInfo> getInputMethodListAsUser(@UserIdInt int userId,
    public List<InputMethodInfo> getInputMethodListAsUser(@UserIdInt int userId,
            @DirectBootAwareness int directBootAwareness) {
            @DirectBootAwareness int directBootAwareness) {
        return IInputMethodManagerGlobalInvoker.getInputMethodList(userId, directBootAwareness);
        return IInputMethodManagerGlobalInvoker.getInputMethodList(userId, directBootAwareness);
@@ -1598,11 +1605,14 @@ public final class InputMethodManager {
    /**
    /**
     * Returns the list of enabled input methods for the specified user.
     * Returns the list of enabled input methods for the specified user.
     *
     *
     * <p>{@link Manifest.permission#INTERACT_ACROSS_USERS_FULL} is required when and only when
     * {@code userId} is different from the user id of the current process.</p>
     *
     * @param userId user ID to query
     * @param userId user ID to query
     * @return {@link List} of {@link InputMethodInfo}.
     * @return {@link List} of {@link InputMethodInfo}.
     * @hide
     * @hide
     */
     */
    @RequiresPermission(INTERACT_ACROSS_USERS_FULL)
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    public List<InputMethodInfo> getEnabledInputMethodListAsUser(@UserIdInt int userId) {
    public List<InputMethodInfo> getEnabledInputMethodListAsUser(@UserIdInt int userId) {
        return IInputMethodManagerGlobalInvoker.getEnabledInputMethodList(userId);
        return IInputMethodManagerGlobalInvoker.getEnabledInputMethodList(userId);
    }
    }
@@ -2355,7 +2365,11 @@ public final class InputMethodManager {
     * Starts an input connection from the served view that gains the window focus.
     * Starts an input connection from the served view that gains the window focus.
     * Note that this method should *NOT* be called inside of {@code mH} lock to prevent start input
     * Note that this method should *NOT* be called inside of {@code mH} lock to prevent start input
     * background thread may blocked by other methods which already inside {@code mH} lock.
     * background thread may blocked by other methods which already inside {@code mH} lock.
     *
     * <p>{@link Manifest.permission#INTERACT_ACROSS_USERS_FULL} is required when and only when
     * {@code userId} is different from the user id of the current process.</p>
     */
     */
    @RequiresPermission(value = Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)
    private boolean startInputInner(@StartInputReason int startInputReason,
    private boolean startInputInner(@StartInputReason int startInputReason,
            @Nullable IBinder windowGainingFocus, @StartInputFlags int startInputFlags,
            @Nullable IBinder windowGainingFocus, @StartInputFlags int startInputFlags,
            @SoftInputModeFlags int softInputMode, int windowFlags) {
            @SoftInputModeFlags int softInputMode, int windowFlags) {
@@ -2612,8 +2626,8 @@ public final class InputMethodManager {
     * @param timeout to set in milliseconds. To reset to default, use a value <= zero.
     * @param timeout to set in milliseconds. To reset to default, use a value <= zero.
     * @hide
     * @hide
     */
     */
    @RequiresPermission(Manifest.permission.TEST_INPUT_METHOD)
    @TestApi
    @TestApi
    @RequiresPermission(Manifest.permission.TEST_INPUT_METHOD)
    public void setStylusWindowIdleTimeoutForTest(@DurationMillisLong long timeout) {
    public void setStylusWindowIdleTimeoutForTest(@DurationMillisLong long timeout) {
        synchronized (mH) {
        synchronized (mH) {
            IInputMethodManagerGlobalInvoker.setStylusWindowIdleTimeoutForTest(mClient, timeout);
            IInputMethodManagerGlobalInvoker.setStylusWindowIdleTimeoutForTest(mClient, timeout);
@@ -3092,7 +3106,7 @@ public final class InputMethodManager {
     *
     *
     * <p>On Android {@link Build.VERSION_CODES#Q} and later devices, the undocumented behavior that
     * <p>On Android {@link Build.VERSION_CODES#Q} and later devices, the undocumented behavior that
     * token can be {@code null} when the caller has
     * token can be {@code null} when the caller has
     * {@link android.Manifest.permission#WRITE_SECURE_SETTINGS} is deprecated. Instead, update
     * {@link Manifest.permission#WRITE_SECURE_SETTINGS} is deprecated. Instead, update
     * {@link android.provider.Settings.Secure#DEFAULT_INPUT_METHOD} and
     * {@link android.provider.Settings.Secure#DEFAULT_INPUT_METHOD} and
     * {@link android.provider.Settings.Secure#SELECTED_INPUT_METHOD_SUBTYPE} directly.</p>
     * {@link android.provider.Settings.Secure#SELECTED_INPUT_METHOD_SUBTYPE} directly.</p>
     *
     *
@@ -3124,7 +3138,7 @@ public final class InputMethodManager {
            if (fallbackContext == null) {
            if (fallbackContext == null) {
                return;
                return;
            }
            }
            if (fallbackContext.checkSelfPermission(WRITE_SECURE_SETTINGS)
            if (fallbackContext.checkSelfPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
                    != PackageManager.PERMISSION_GRANTED) {
                    != PackageManager.PERMISSION_GRANTED) {
                return;
                return;
            }
            }
@@ -3161,7 +3175,7 @@ public final class InputMethodManager {
     * from an application or a service which has a token of the currently active input method.
     * from an application or a service which has a token of the currently active input method.
     *
     *
     * <p>On Android {@link Build.VERSION_CODES#Q} and later devices, {@code token} cannot be
     * <p>On Android {@link Build.VERSION_CODES#Q} and later devices, {@code token} cannot be
     * {@code null} even with {@link android.Manifest.permission#WRITE_SECURE_SETTINGS}. Instead,
     * {@code null} even with {@link Manifest.permission#WRITE_SECURE_SETTINGS}. Instead,
     * update {@link android.provider.Settings.Secure#DEFAULT_INPUT_METHOD} and
     * update {@link android.provider.Settings.Secure#DEFAULT_INPUT_METHOD} and
     * {@link android.provider.Settings.Secure#SELECTED_INPUT_METHOD_SUBTYPE} directly.</p>
     * {@link android.provider.Settings.Secure#SELECTED_INPUT_METHOD_SUBTYPE} directly.</p>
     *
     *
@@ -3443,7 +3457,7 @@ public final class InputMethodManager {
     * @param displayId The ID of the display where the chooser dialog should be shown.
     * @param displayId The ID of the display where the chooser dialog should be shown.
     * @hide
     * @hide
     */
     */
    @RequiresPermission(WRITE_SECURE_SETTINGS)
    @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
    public void showInputMethodPickerFromSystem(boolean showAuxiliarySubtypes, int displayId) {
    public void showInputMethodPickerFromSystem(boolean showAuxiliarySubtypes, int displayId) {
        final int mode = showAuxiliarySubtypes
        final int mode = showAuxiliarySubtypes
                ? SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES
                ? SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES
@@ -3522,11 +3536,11 @@ public final class InputMethodManager {
     *             {@link InputMethodService#switchInputMethod(String, InputMethodSubtype)}, which
     *             {@link InputMethodService#switchInputMethod(String, InputMethodSubtype)}, which
     *             does not require any permission as long as the caller is the current IME.
     *             does not require any permission as long as the caller is the current IME.
     *             If the calling process is some privileged app that already has
     *             If the calling process is some privileged app that already has
     *             {@link android.Manifest.permission#WRITE_SECURE_SETTINGS} permission, just
     *             {@link Manifest.permission#WRITE_SECURE_SETTINGS} permission, just
     *             directly update {@link Settings.Secure#SELECTED_INPUT_METHOD_SUBTYPE}.
     *             directly update {@link Settings.Secure#SELECTED_INPUT_METHOD_SUBTYPE}.
     */
     */
    @Deprecated
    @Deprecated
    @RequiresPermission(WRITE_SECURE_SETTINGS)
    @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
    public boolean setCurrentInputMethodSubtype(InputMethodSubtype subtype) {
    public boolean setCurrentInputMethodSubtype(InputMethodSubtype subtype) {
        if (Process.myUid() == Process.SYSTEM_UID) {
        if (Process.myUid() == Process.SYSTEM_UID) {
            Log.w(TAG, "System process should not call setCurrentInputMethodSubtype() because "
            Log.w(TAG, "System process should not call setCurrentInputMethodSubtype() because "
@@ -3543,7 +3557,7 @@ public final class InputMethodManager {
        if (fallbackContext == null) {
        if (fallbackContext == null) {
            return false;
            return false;
        }
        }
        if (fallbackContext.checkSelfPermission(WRITE_SECURE_SETTINGS)
        if (fallbackContext.checkSelfPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
                != PackageManager.PERMISSION_GRANTED) {
                != PackageManager.PERMISSION_GRANTED) {
            return false;
            return false;
        }
        }
+6 −5
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.view.inputmethod;
package android.view.inputmethod;


import android.Manifest;
import android.annotation.AnyThread;
import android.annotation.AnyThread;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.annotation.RequiresNoPermission;
import android.annotation.RequiresNoPermission;
@@ -51,8 +52,8 @@ public class InputMethodManagerGlobal {
     * @param where where the information is coming from.
     * @param where where the information is coming from.
     * @param exceptionHandler an optional {@link RemoteException} handler.
     * @param exceptionHandler an optional {@link RemoteException} handler.
     */
     */
    @RequiresNoPermission
    @AnyThread
    @AnyThread
    @RequiresNoPermission
    public static void startProtoDump(byte[] protoDump, int source, String where,
    public static void startProtoDump(byte[] protoDump, int source, String where,
            @Nullable Consumer<RemoteException> exceptionHandler) {
            @Nullable Consumer<RemoteException> exceptionHandler) {
        IInputMethodManagerGlobalInvoker.startProtoDump(protoDump, source, where, exceptionHandler);
        IInputMethodManagerGlobalInvoker.startProtoDump(protoDump, source, where, exceptionHandler);
@@ -63,8 +64,8 @@ public class InputMethodManagerGlobal {
     *
     *
     * @param exceptionHandler an optional {@link RemoteException} handler.
     * @param exceptionHandler an optional {@link RemoteException} handler.
     */
     */
    @RequiresPermission(android.Manifest.permission.CONTROL_UI_TRACING)
    @AnyThread
    @AnyThread
    @RequiresPermission(Manifest.permission.CONTROL_UI_TRACING)
    public static void startImeTrace(@Nullable Consumer<RemoteException> exceptionHandler) {
    public static void startImeTrace(@Nullable Consumer<RemoteException> exceptionHandler) {
        IInputMethodManagerGlobalInvoker.startImeTrace(exceptionHandler);
        IInputMethodManagerGlobalInvoker.startImeTrace(exceptionHandler);
    }
    }
@@ -74,8 +75,8 @@ public class InputMethodManagerGlobal {
     *
     *
     * @param exceptionHandler an optional {@link RemoteException} handler.
     * @param exceptionHandler an optional {@link RemoteException} handler.
     */
     */
    @RequiresPermission(android.Manifest.permission.CONTROL_UI_TRACING)
    @AnyThread
    @AnyThread
    @RequiresPermission(Manifest.permission.CONTROL_UI_TRACING)
    public static void stopImeTrace(@Nullable Consumer<RemoteException> exceptionHandler) {
    public static void stopImeTrace(@Nullable Consumer<RemoteException> exceptionHandler) {
        IInputMethodManagerGlobalInvoker.stopImeTrace(exceptionHandler);
        IInputMethodManagerGlobalInvoker.stopImeTrace(exceptionHandler);
    }
    }
@@ -85,8 +86,8 @@ public class InputMethodManagerGlobal {
     *
     *
     * @return The return value of {@link IInputMethodManager#isImeTraceEnabled()}.
     * @return The return value of {@link IInputMethodManager#isImeTraceEnabled()}.
     */
     */
    @RequiresNoPermission
    @AnyThread
    @AnyThread
    @RequiresNoPermission
    public static boolean isImeTraceEnabled() {
    public static boolean isImeTraceEnabled() {
        return IInputMethodManagerGlobalInvoker.isImeTraceEnabled();
        return IInputMethodManagerGlobalInvoker.isImeTraceEnabled();
    }
    }
@@ -96,8 +97,8 @@ public class InputMethodManagerGlobal {
     *
     *
     * @param exceptionHandler an optional {@link RemoteException} handler.
     * @param exceptionHandler an optional {@link RemoteException} handler.
     */
     */
    @RequiresPermission(android.Manifest.permission.INTERNAL_SYSTEM_WINDOW)
    @AnyThread
    @AnyThread
    @RequiresPermission(Manifest.permission.INTERNAL_SYSTEM_WINDOW)
    public static void removeImeSurface(@Nullable Consumer<RemoteException> exceptionHandler) {
    public static void removeImeSurface(@Nullable Consumer<RemoteException> exceptionHandler) {
        IInputMethodManagerGlobalInvoker.removeImeSurface(exceptionHandler);
        IInputMethodManagerGlobalInvoker.removeImeSurface(exceptionHandler);
    }
    }