Merge "Remove dependency on IWindowManager from InputMethodBindingController"

This commit is contained in:
TreeHugger Robot
2022-10-06 22:16:27 +00:00
committed by Android (Google) Code Review

View File

@@ -31,7 +31,6 @@ import android.inputmethodservice.InputMethodService;
import android.os.Binder;
import android.os.IBinder;
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.Trace;
import android.os.UserHandle;
@@ -39,7 +38,6 @@ import android.provider.Settings;
import android.util.ArrayMap;
import android.util.EventLog;
import android.util.Slog;
import android.view.IWindowManager;
import android.view.WindowManager;
import android.view.inputmethod.InputMethod;
import android.view.inputmethod.InputMethodInfo;
@@ -66,7 +64,6 @@ final class InputMethodBindingController {
@NonNull private final ArrayMap<String, InputMethodInfo> mMethodMap;
@NonNull private final InputMethodUtils.InputMethodSettings mSettings;
@NonNull private final PackageManagerInternal mPackageManagerInternal;
@NonNull private final IWindowManager mIWindowManager;
@NonNull private final WindowManagerInternal mWindowManagerInternal;
@NonNull private final Resources mRes;
@@ -107,7 +104,6 @@ final class InputMethodBindingController {
mMethodMap = mService.mMethodMap;
mSettings = mService.mSettings;
mPackageManagerInternal = mService.mPackageManagerInternal;
mIWindowManager = mService.mIWindowManager;
mWindowManagerInternal = mService.mWindowManagerInternal;
mRes = mService.mRes;
}
@@ -432,17 +428,13 @@ final class InputMethodBindingController {
mService.setCurTokenDisplayIdLocked(displayIdToShowIme);
try {
if (DEBUG) {
Slog.v(TAG, "Adding window token: " + mCurToken + " for display: "
+ displayIdToShowIme);
}
mIWindowManager.addWindowToken(mCurToken, WindowManager.LayoutParams.TYPE_INPUT_METHOD,
displayIdToShowIme, null /* options */);
} catch (RemoteException e) {
Slog.e(TAG, "Could not add window token " + mCurToken + " for display "
+ displayIdToShowIme, e);
if (DEBUG) {
Slog.v(TAG, "Adding window token: " + mCurToken + " for display: "
+ displayIdToShowIme);
}
mWindowManagerInternal.addWindowToken(mCurToken,
WindowManager.LayoutParams.TYPE_INPUT_METHOD,
displayIdToShowIme, null /* options */);
}
@GuardedBy("ImfLock.class")