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

Commit 7756bde6 authored by Ming-Shin Lu's avatar Ming-Shin Lu Committed by Android (Google) Code Review
Browse files

Merge changes Ia3594fdd,I08906418

* changes:
  Add TEST_MAPPING file for FrameworkInputMethodSystemServerTests
  Fix some issues in FrameworkInputMethodSystemServerTests
parents babc0ff0 b91d06bc
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -59,13 +59,16 @@ public final class ImeTrackerService extends IImeTracker.Stub {
    private static final long TIMEOUT_MS = 10_000;

    /** Handler for registering timeouts for live entries. */
    private final Handler mHandler =
            new Handler(Looper.myLooper(), null /* callback */, true /* async */);
    private final Handler mHandler;

    /** Singleton instance of the History. */
    @GuardedBy("ImeTrackerService.this")
    private final History mHistory = new History();

    ImeTrackerService(@NonNull Looper looper) {
        mHandler = new Handler(looper, null /* callback */, true /* async */);
    }

    @NonNull
    @Override
    public synchronized IBinder onRequestShow(int uid, @ImeTracker.Origin int origin,
+10 −8
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ import android.os.Debug;
import android.os.Handler;
import android.os.IBinder;
import android.os.LocaleList;
import android.os.Looper;
import android.os.Message;
import android.os.Parcel;
import android.os.Process;
@@ -1105,7 +1106,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
            new SoftInputShowHideHistory();

    @NonNull
    private final ImeTrackerService mImeTrackerService = new ImeTrackerService();
    private final ImeTrackerService mImeTrackerService;

    class SettingsObserver extends ContentObserver {
        int mUserId;
@@ -1662,6 +1663,8 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                                true /* allowIo */);
        thread.start();
        mHandler = Handler.createAsync(thread.getLooper(), this);
        mImeTrackerService = new ImeTrackerService(serviceThreadForTesting != null
                ? serviceThreadForTesting.getLooper() : Looper.getMainLooper());
        // Note: SettingsObserver doesn't register observers in its constructor.
        mSettingsObserver = new SettingsObserver(mHandler);
        mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class);
@@ -4613,8 +4616,10 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                info.requestWindowName, info.imeControlTargetName, info.imeLayerTargetName,
                info.imeSurfaceParentName));

        if (statsToken != null) {
            mImeTrackerService.onImmsUpdate(statsToken.mBinder, info.requestWindowName);
        }
    }

    @BinderThread
    private void hideMySoftInput(@NonNull IBinder token, int flags,
@@ -4654,15 +4659,12 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
        Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
    }

    @VisibleForTesting
    ImeVisibilityStateComputer getVisibilityStateComputer() {
        return mVisibilityStateComputer;
    }

    @VisibleForTesting
    ImeVisibilityApplier getVisibilityApplier() {
        synchronized (ImfLock.class) {
            return mVisibilityApplier;
        }
    }

    @GuardedBy("ImfLock.class")
    void setEnabledSessionLocked(SessionState session) {
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@
 "imports": [
    {
      "path": "frameworks/base/core/java/android/view/inputmethod"
    },
    {
      "path": "frameworks/base/services/tests/InputMethodSystemServerTests"
    }
  ]
}
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ android_test {
    ],

    srcs: [
        "src/server/**/*.java",
        "src/com/android/server/inputmethod/**/*.java",
    ],

    static_libs: [
+13 −0
Original line number Diff line number Diff line
{
  "presubmit": [
    {
      "name": "FrameworksInputMethodSystemServerTests",
      "options": [
        {"include-filter": "com.android.server.inputmethod"},
        {"exclude-annotation": "android.platform.test.annotations.FlakyTest"},
        {"exclude-annotation": "androidx.test.filters.FlakyTest"},
        {"exclude-annotation": "org.junit.Ignore"}
      ]
    }
  ]
}
Loading