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

Commit 982a8ec3 authored by Cosmin Băieș's avatar Cosmin Băieș
Browse files

Inline fromUser variants of ImeTracker show/hide

This inlines the variants of ImeTracker onRequestShow/onRequestHide
that passed in fromUser false as default.

Test: n/a
Bug: 303041796
Change-Id: If9ae3728b9291ea171c9d3cf65c39f165348b87d
parent 634dbbcc
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -334,15 +334,6 @@ public interface ImeTracker {
    Token onRequestShow(@Nullable String component, int uid, @Origin int origin,
            @SoftInputShowHideReason int reason, boolean fromUser);

    /**
     * Alias for {@link #onRequestShow(String, int, int, int, boolean)} with
     * {@code fromUser} set to {@code false}.
     */
    default Token onRequestShow(@Nullable String component, int uid, @Origin int origin,
            @SoftInputShowHideReason int reason) {
        return onRequestShow(component, uid, origin, reason, false /* fromUser */);
    }

    /**
     * Creates an IME hide request tracking token.
     *
@@ -359,15 +350,6 @@ public interface ImeTracker {
    Token onRequestHide(@Nullable String component, int uid, @Origin int origin,
            @SoftInputShowHideReason int reason, boolean fromUser);

    /**
     * Alias for {@link #onRequestHide(String, int, int, int, boolean)} with
     * {@code fromUser} set to {@code false}.
     */
    default Token onRequestHide(@Nullable String component, int uid, @Origin int origin,
            @SoftInputShowHideReason int reason) {
        return onRequestHide(component, uid, origin, reason, false /* fromUser */);
    }

    /**
     * Called when an IME request progresses to a further phase.
     *
+3 −3
Original line number Diff line number Diff line
@@ -2199,7 +2199,7 @@ public final class InputMethodManager {
        synchronized (mH) {
            final ImeTracker.Token statsToken = ImeTracker.forLogging().onRequestShow(
                    null /* component */, Process.myUid(), ImeTracker.ORIGIN_CLIENT_SHOW_SOFT_INPUT,
                    SoftInputShowHideReason.SHOW_SOFT_INPUT);
                    SoftInputShowHideReason.SHOW_SOFT_INPUT, false /* fromUser */);

            Log.w(TAG, "showSoftInputUnchecked() is a hidden method, which will be"
                    + " removed soon. If you are using androidx.appcompat.widget.SearchView,"
@@ -3138,7 +3138,7 @@ public final class InputMethodManager {
    void closeCurrentInput() {
        final ImeTracker.Token statsToken = ImeTracker.forLogging().onRequestHide(
                null /* component */, Process.myUid(), ImeTracker.ORIGIN_CLIENT_HIDE_SOFT_INPUT,
                SoftInputShowHideReason.HIDE_CLOSE_CURRENT_SESSION);
                SoftInputShowHideReason.HIDE_CLOSE_CURRENT_SESSION, false /* fromUser */);
        ImeTracker.forLatency().onRequestHide(statsToken, ImeTracker.ORIGIN_CLIENT_HIDE_SOFT_INPUT,
                SoftInputShowHideReason.HIDE_CLOSE_CURRENT_SESSION,
                ActivityThread::currentApplication);
@@ -3238,7 +3238,7 @@ public final class InputMethodManager {
        if (statsToken == null) {
            statsToken = ImeTracker.forLogging().onRequestHide(null /* component */,
                    Process.myUid(), ImeTracker.ORIGIN_CLIENT_HIDE_SOFT_INPUT,
                    SoftInputShowHideReason.HIDE_SOFT_INPUT_BY_INSETS_API);
                    SoftInputShowHideReason.HIDE_SOFT_INPUT_BY_INSETS_API, false /* fromUser */);
        }
        ImeTracker.forLatency().onRequestHide(statsToken, ImeTracker.ORIGIN_CLIENT_HIDE_SOFT_INPUT,
                SoftInputShowHideReason.HIDE_SOFT_INPUT_BY_INSETS_API,