Rename IInputConnectionWrapper to RemoteInputConnectionImpl

This is a mechanical refactoring CL that renames

  com.android.internal.view.IInputConnectionWrapper

to

  com.android.internal.inputmethod.RemoteInputConnectionImpl

with no observable behavior change.

Bug: 192412909
Test: presubmit
Test: No lint error under core/java/com/android/internal/inputmethod
Change-Id: I171106ad0b46fbb495a6bf08d10f33915c2d29ac
This commit is contained in:
Yohei Yukawa
2021-08-03 14:34:36 -07:00
parent d6a6037196
commit 5693db4d66
3 changed files with 28 additions and 18 deletions

View File

@@ -43,6 +43,16 @@ import com.android.internal.view.IInputMethod;
import java.lang.ref.WeakReference;
/**
* Takes care of remote method invocations of {@link InputConnection} in the IME side.
*
* <p>This class works as a proxy to forward API calls on {@link InputConnection} to
* {@link com.android.internal.inputmethod.RemoteInputConnectionImpl} running on the IME client
* (editor app) process then waits replies as needed.</p>
*
* <p>See also {@link IInputContext} for the actual {@link android.os.Binder} IPC protocols under
* the hood.</p>
*/
final class RemoteInputConnection implements InputConnection {
private static final String TAG = "RemoteInputConnection";

View File

@@ -90,12 +90,12 @@ import com.android.internal.inputmethod.ImeTracing;
import com.android.internal.inputmethod.InputBindResult;
import com.android.internal.inputmethod.InputMethodDebug;
import com.android.internal.inputmethod.InputMethodPrivilegedOperationsRegistry;
import com.android.internal.inputmethod.RemoteInputConnectionImpl;
import com.android.internal.inputmethod.SoftInputShowHideReason;
import com.android.internal.inputmethod.StartInputFlags;
import com.android.internal.inputmethod.StartInputReason;
import com.android.internal.inputmethod.UnbindReason;
import com.android.internal.os.SomeArgs;
import com.android.internal.view.IInputConnectionWrapper;
import com.android.internal.view.IInputMethodClient;
import com.android.internal.view.IInputMethodManager;
import com.android.internal.view.IInputMethodSession;
@@ -365,7 +365,7 @@ public final class InputMethodManager {
final H mH;
// Our generic input connection if the current target does not have its own.
private final IInputConnectionWrapper mFallbackInputConnection;
private final RemoteInputConnectionImpl mFallbackInputConnection;
private final int mDisplayId;
@@ -407,7 +407,7 @@ public final class InputMethodManager {
/**
* The InputConnection that was last retrieved from the served view.
*/
IInputConnectionWrapper mServedInputConnection;
RemoteInputConnectionImpl mServedInputConnection;
/**
* The completions that were last provided by the served view.
*/
@@ -1120,7 +1120,7 @@ public final class InputMethodManager {
mMainLooper = looper;
mH = new H(looper);
mDisplayId = displayId;
mFallbackInputConnection = new IInputConnectionWrapper(looper,
mFallbackInputConnection = new RemoteInputConnectionImpl(looper,
new BaseInputConnection(this, false), this, null);
}
@@ -1938,7 +1938,7 @@ public final class InputMethodManager {
mServedInputConnection.deactivate();
mServedInputConnection = null;
}
IInputConnectionWrapper servedInputConnection;
RemoteInputConnectionImpl servedInputConnection;
final int missingMethodFlags;
if (ic != null) {
mCursorSelStart = tba.initialSelStart;
@@ -1955,7 +1955,7 @@ public final class InputMethodManager {
} else {
icHandler = ic.getHandler();
}
servedInputConnection = new IInputConnectionWrapper(
servedInputConnection = new RemoteInputConnectionImpl(
icHandler != null ? icHandler.getLooper() : vh.getLooper(), ic, this, view);
} else {
servedInputConnection = null;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.android.internal.view;
package com.android.internal.inputmethod;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -40,21 +40,21 @@ import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.SurroundingText;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.inputmethod.IBooleanResultCallback;
import com.android.internal.inputmethod.ICharSequenceResultCallback;
import com.android.internal.inputmethod.IExtractedTextResultCallback;
import com.android.internal.inputmethod.IIntResultCallback;
import com.android.internal.inputmethod.ISurroundingTextResultCallback;
import com.android.internal.inputmethod.ImeTracing;
import com.android.internal.inputmethod.InputConnectionProtoDumper;
import com.android.internal.view.IInputContext;
import java.lang.ref.WeakReference;
/**
* Takes care of remote method invocations of {@link InputConnection} in the IME client side.
*
* <p>{@link android.inputmethodservice.RemoteInputConnection} code is executed in the IME process.
* It makes IInputContext binder calls under the hood. {@link RemoteInputConnectionImpl} receives
* {@link IInputContext} binder calls in the IME client (editor app) process, and forwards them to
* {@link InputConnection} that the IME client provided, on the {@link Looper} associated to the
* {@link InputConnection}.</p>
*/
public final class IInputConnectionWrapper extends IInputContext.Stub {
private static final String TAG = "IInputConnectionWrapper";
public final class RemoteInputConnectionImpl extends IInputContext.Stub {
private static final String TAG = "RemoteInputConnectionImpl";
private static final boolean DEBUG = false;
@GuardedBy("mLock")
@@ -72,7 +72,7 @@ public final class IInputConnectionWrapper extends IInputContext.Stub {
private final InputMethodManager mParentInputMethodManager;
private final WeakReference<View> mServedView;
public IInputConnectionWrapper(@NonNull Looper looper,
public RemoteInputConnectionImpl(@NonNull Looper looper,
@NonNull InputConnection inputConnection,
@NonNull InputMethodManager inputMethodManager, @Nullable View servedView) {
mInputConnection = inputConnection;
@@ -140,7 +140,7 @@ public final class IInputConnectionWrapper extends IInputContext.Stub {
@Override
public String toString() {
return "IInputConnectionWrapper{"
return "RemoteInputConnectionImpl{"
+ "connection=" + getInputConnection()
+ " finished=" + isFinished()
+ " mParentInputMethodManager.isActive()=" + mParentInputMethodManager.isActive()