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

Commit 68811a45 authored by Craig Mautner's avatar Craig Mautner
Browse files

Add debug for b/8263462.

Look for race condition in soft input method attach.

For bug 8263462.

Change-Id: Id0609a743d57ab685c036372100ddd33819bff03
parent 5aae35d8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.text.method.MovementMethod;
import android.util.Log;
import android.util.PrintWriterPrinter;
import android.util.Printer;
import android.util.Slog;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -351,6 +352,7 @@ public class InputMethodService extends AbstractInputMethodService {
         * Take care of attaching the given window token provided by the system.
         */
        public void attachToken(IBinder token) {
            Slog.i(TAG, "attachToken: b8263462 Existing token=" + mToken + " new token=" + token);
            if (mToken == null) {
                mToken = token;
                mWindow.setToken(token);
+3 −3
Original line number Diff line number Diff line
@@ -1204,7 +1204,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            mCurId = info.getId();
            mCurToken = new Binder();
            try {
                if (DEBUG) Slog.v(TAG, "Adding window token: " + mCurToken);
                if (true || DEBUG) Slog.v(TAG, "b8263462 Adding window token: " + mCurToken);
                mIWindowManager.addWindowToken(mCurToken,
                        WindowManager.LayoutParams.TYPE_INPUT_METHOD);
            } catch (RemoteException e) {
@@ -1248,7 +1248,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                    unbindCurrentMethodLocked(false, false);
                    return;
                }
                if (DEBUG) Slog.v(TAG, "Initiating attach with token: " + mCurToken);
                if (true || DEBUG) Slog.v(TAG, "b8263462 Initiating attach with token: " + mCurToken);
                executeOrSendMessage(mCurMethod, mCaller.obtainMessageOO(
                        MSG_ATTACH_TOKEN, mCurMethod, mCurToken));
                if (mCurClient != null) {
@@ -2324,7 +2324,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            case MSG_ATTACH_TOKEN:
                args = (SomeArgs)msg.obj;
                try {
                    if (DEBUG) Slog.v(TAG, "Sending attach of token: " + args.arg2);
                    if (true || DEBUG) Slog.v(TAG, "b8263462 Sending attach of token: " + args.arg2);
                    ((IInputMethod)args.arg1).attachToken((IBinder)args.arg2);
                } catch (RemoteException e) {
                }