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

Commit 8403a137 authored by Antonio Kantek's avatar Antonio Kantek
Browse files

Enabling New Insets API with Multi-Session IME.

New insets based IME requires windows manager to properly link the
assocaited IME window token against the target window token.

Test script:
Step 1: Patch this CL on rvc-dev repo
Step 2: Build and flash Hawk
Step 3: Build and install a sample multi-client IME
  make -j MultiClientInputMethod
  adb install -r $OUT/system/priv-app/MultiClientInputMethod/MultiClientInputMethod.apk
Step 4: Enable multi-client IME for the side-loaded sample multi-client IME
  adb root
  adb shell setprop persist.debug.multi_client_ime com.example.android.multiclientinputmethod/.MultiClientInputMethod
  adb reboot
Step 5: Open KitchenSync app, select carboard, enter text on Plain Text
tab (sample multi-session keyboard doesn't support numeric keyboard yet)

Bug: 123718661
Test: manual (see test script above)
Change-Id: I2a27c0da3a243d9cb3c98541531396cd9ff819a0
parent 38694c29
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1347,13 +1347,14 @@ public final class MultiClientInputMethodManagerService {
                for (WindowInfo windowInfo : clientInfo.mWindowMap.values()) {
                    if (windowInfo.mWindowHandle == targetWindowHandle) {
                        final IBinder targetWindowToken = windowInfo.mWindowToken;
                        // TODO(yukawa): Report targetWindowToken and targetWindowToken to WMS.
                        if (DEBUG) {
                            Slog.v(TAG, "reportImeWindowTarget"
                                    + " clientId=" + clientId
                                    + " imeWindowToken=" + imeWindowToken
                                    + " targetWindowToken=" + targetWindowToken);
                        }
                        mIWindowManagerInternal.updateInputMethodTargetWindow(
                                imeWindowToken, targetWindowToken);
                    }
                }
                // not found.
@@ -1496,6 +1497,9 @@ public final class MultiClientInputMethodManagerService {
                    case InputMethodClientState.ALREADY_SENT_BIND_RESULT:
                        try {
                            clientInfo.mMSInputMethodSession.showSoftInput(flags, resultReceiver);

                            // Forcing WM to show IME on imeTargetWindow
                            mWindowManagerInternal.showImePostLayout(token);
                        } catch (RemoteException e) {
                        }
                        break;