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

Commit 44ff0dd9 authored by Cosmin Băieș's avatar Cosmin Băieș
Browse files

Revert^2 "Input latency & reliability tracking - hide flow"

d638a60a

Test: atest CtsSystemApiSignatureTestCases:android.signature.cts.api.system.SignatureTest#testRuntimeCompatibilityWithCurrentApi
Change-Id: I1ee7224b40fa3f4b744311eb4145fa13a87d835a
parent 16194823
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -234,9 +234,13 @@ class IInputMethodWrapper extends IInputMethod.Stub
            }
            case DO_HIDE_SOFT_INPUT: {
                final SomeArgs args = (SomeArgs) msg.obj;
                final ImeTracker.Token statsToken = (ImeTracker.Token) args.arg3;
                if (isValid(inputMethod, target, "DO_HIDE_SOFT_INPUT")) {
                    ImeTracker.get().onProgress(statsToken, ImeTracker.PHASE_IME_WRAPPER_DISPATCH);
                    inputMethod.hideSoftInputWithToken(msg.arg1, (ResultReceiver) args.arg2,
                            (IBinder) args.arg1);
                            (IBinder) args.arg1, statsToken);
                } else {
                    ImeTracker.get().onFailed(statsToken, ImeTracker.PHASE_IME_WRAPPER_DISPATCH);
                }
                args.recycle();
                return;
@@ -431,9 +435,11 @@ class IInputMethodWrapper extends IInputMethod.Stub

    @BinderThread
    @Override
    public void hideSoftInput(IBinder hideInputToken, int flags, ResultReceiver resultReceiver) {
        mCaller.executeOrSendMessage(mCaller.obtainMessageIOO(DO_HIDE_SOFT_INPUT,
                flags, hideInputToken, resultReceiver));
    public void hideSoftInput(IBinder hideInputToken, @Nullable ImeTracker.Token statsToken,
            int flags, ResultReceiver resultReceiver) {
        ImeTracker.get().onProgress(statsToken, ImeTracker.PHASE_IME_WRAPPER);
        mCaller.executeOrSendMessage(mCaller.obtainMessageIOOO(DO_HIDE_SOFT_INPUT,
                flags, hideInputToken, resultReceiver, statsToken));
    }

    @BinderThread
+8 −7
Original line number Diff line number Diff line
@@ -670,7 +670,7 @@ public class InputMethodService extends AbstractInputMethodService {
     */
    private IBinder mCurHideInputToken;

    /** The token tracking the current IME show request or {@code null} otherwise. */
    /** The token tracking the current IME request or {@code null} otherwise. */
    @Nullable
    private ImeTracker.Token mCurStatsToken;

@@ -875,10 +875,12 @@ public class InputMethodService extends AbstractInputMethodService {
        @MainThread
        @Override
        public void hideSoftInputWithToken(int flags, ResultReceiver resultReceiver,
                IBinder hideInputToken) {
                IBinder hideInputToken, @Nullable ImeTracker.Token statsToken) {
            mSystemCallingHideSoftInput = true;
            mCurHideInputToken = hideInputToken;
            mCurStatsToken = statsToken;
            hideSoftInput(flags, resultReceiver);
            mCurStatsToken = null;
            mCurHideInputToken = null;
            mSystemCallingHideSoftInput = false;
        }
@@ -889,6 +891,7 @@ public class InputMethodService extends AbstractInputMethodService {
        @MainThread
        @Override
        public void hideSoftInput(int flags, ResultReceiver resultReceiver) {
            ImeTracker.get().onProgress(mCurStatsToken, ImeTracker.PHASE_IME_HIDE_SOFT_INPUT);
            if (DEBUG) Log.v(TAG, "hideSoftInput()");
            if (getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.R
                    && !mSystemCallingHideSoftInput) {
@@ -930,9 +933,9 @@ public class InputMethodService extends AbstractInputMethodService {
            try {
                showSoftInput(flags, resultReceiver);
            } finally {
                mCurStatsToken = null;
                mCurShowInputToken = null;
                mSystemCallingShowSoftInput = false;
                mCurStatsToken = null;
            }
        }

@@ -2939,10 +2942,8 @@ public class InputMethodService extends AbstractInputMethodService {
        ImeTracing.getInstance().triggerServiceDump(
                "InputMethodService#applyVisibilityInInsetsConsumerIfNecessary", mDumper,
                null /* icProto */);
        if (setVisible) {
        ImeTracker.get().onProgress(mCurStatsToken,
                ImeTracker.PHASE_IME_APPLY_VISIBILITY_INSETS_CONSUMER);
        }
        mPrivOps.applyImeVisibilityAsync(setVisible
                ? mCurShowInputToken : mCurHideInputToken, setVisible, mCurStatsToken);
    }
+1 −1
Original line number Diff line number Diff line
@@ -54,5 +54,5 @@ oneway interface IDisplayWindowInsetsController {
    /**
     * @see IWindow#hideInsets
     */
    void hideInsets(int types, boolean fromIme);
    void hideInsets(int types, boolean fromIme, in @nullable ImeTracker.Token statsToken);
}
+2 −1
Original line number Diff line number Diff line
@@ -78,8 +78,9 @@ oneway interface IWindow {
     *
     * @param types internal insets types (WindowInsets.Type.InsetsType) to hide
     * @param fromIme true if this request originated from IME (InputMethodService).
     * @param statsToken the token tracking the current IME hide request or {@code null} otherwise.
     */
    void hideInsets(int types, boolean fromIme);
    void hideInsets(int types, boolean fromIme, in @nullable ImeTracker.Token statsToken);

    void moved(int newX, int newY);
    void dispatchAppVisibility(boolean visible);
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ public interface InsetsAnimationControlRunner {
    @AnimationType int getAnimationType();

    /**
     * @return The token tracking the current IME show request or {@code null} otherwise.
     * @return The token tracking the current IME request or {@code null} otherwise.
     */
    @Nullable
    ImeTracker.Token getStatsToken();
Loading