Remove dependency on IWindowManager from InputMethodBindingController
With this CL, InputMethodBindingController starts using WindowManagerInternal#addWindowToken() instead of IWindowManager#addWindowToken() for simplicity. There should be no observable behavior change in this CL. Bug: 234882948 Test: presubmit Change-Id: Ib93d0c2b9a9580bbf1d25dda2a044741c265a0b5
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user