Merge "Revert "Let IME#onFinishInput called without dup onStartInput wh...""

This commit is contained in:
Jeff DeCew
2020-12-04 01:02:15 +00:00
committed by Android (Google) Code Review
10 changed files with 18 additions and 146 deletions

View File

@@ -54,8 +54,6 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub
private static final int DO_VIEW_CLICKED = 115;
private static final int DO_NOTIFY_IME_HIDDEN = 120;
private static final int DO_REMOVE_IME_SURFACE = 130;
private static final int DO_FINISH_INPUT = 140;
@UnsupportedAppUsage
HandlerCaller mCaller;
@@ -143,10 +141,6 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub
mInputMethodSession.removeImeSurface();
return;
}
case DO_FINISH_INPUT: {
mInputMethodSession.finishInput();
return;
}
}
Log.w(TAG, "Unhandled message code: " + msg.what);
}
@@ -228,10 +222,6 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub
mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_FINISH_SESSION));
}
@Override
public void finishInput() {
mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_FINISH_INPUT));
}
private final class ImeInputEventReceiver extends InputEventReceiver
implements InputMethodSession.EventCallback {
private final SparseArray<InputEvent> mPendingEvents = new SparseArray<InputEvent>();

View File

@@ -62,12 +62,9 @@ import android.annotation.IntDef;
import android.annotation.MainThread;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.TestApi;
import android.annotation.UiContext;
import android.app.ActivityManager;
import android.app.Dialog;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledSince;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -415,29 +412,7 @@ public class InputMethodService extends AbstractInputMethodService {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
int mTheme = 0;
/**
* Finish the {@link InputConnection} when the device becomes
* {@link android.os.PowerManager#isInteractive non-interactive}.
*
* <p>
* If enabled by the current {@link InputMethodService input method}, the current input
* connection will be {@link InputMethodService#onFinishInput finished} whenever the devices
* becomes non-interactive.
*
* <p>
* If not enabled, the current input connection will instead be silently deactivated when the
* devices becomes non-interactive, and an {@link InputMethodService#onFinishInput
* onFinishInput()} {@link InputMethodService#onStartInput onStartInput()} pair is dispatched
* when the device becomes interactive again.
*
* @hide
*/
@TestApi
@ChangeId
@EnabledSince(targetSdkVersion = Build.VERSION_CODES.S)
public static final long FINISH_INPUT_NO_FALLBACK_CONNECTION = 156215187L; // This is a bug id.
LayoutInflater mInflater;
TypedArray mThemeAttrs;
@UnsupportedAppUsage
@@ -2377,7 +2352,7 @@ public class InputMethodService extends AbstractInputMethodService {
}
void doStartInput(InputConnection ic, EditorInfo attribute, boolean restarting) {
if (!restarting && mInputStarted) {
if (!restarting) {
doFinishInput();
}
ImeTracing.getInstance().triggerServiceDump("InputMethodService#doStartInput", this,

View File

@@ -23,7 +23,6 @@ import android.os.Bundle;
import android.os.Debug;
import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
import android.os.ResultReceiver;
import android.util.Log;
import android.view.InputChannel;
@@ -39,8 +38,8 @@ import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.ExtractedText;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.inputmethod.CancellationGroup;
import com.android.internal.inputmethod.IMultiClientInputMethodSession;
import com.android.internal.inputmethod.CancellationGroup;
import com.android.internal.os.SomeArgs;
import com.android.internal.util.function.pooled.PooledLambda;
import com.android.internal.view.IInputContext;
@@ -304,12 +303,6 @@ final class MultiClientInputMethodClientCallbackAdaptor {
// no-op for multi-session
reportNotSupported();
}
@Override
public void finishInput() throws RemoteException {
// no-op for multi-session
reportNotSupported();
}
}
private static final class MultiClientInputMethodSessionImpl