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

Commit ce88fd7b authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12033399 from c5002e47 to 24Q4-release

Change-Id: Ib4a80fb94c01961fbc48b5a7c1a706c3058fe630
parents 240df108 c5002e47
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -103,8 +103,8 @@ final class AutofillSuggestionsController {

        // Note that current user ID is guaranteed to be userId.
        final var imeId = mBindingController.getSelectedMethodId();
        final InputMethodInfo imi = InputMethodSettingsRepository.get(mBindingController.mUserId)
                .getMethodMap().get(imeId);
        final InputMethodInfo imi = InputMethodSettingsRepository.get(
                mBindingController.getUserId()).getMethodMap().get(imeId);
        if (imi == null || !isInlineSuggestionsEnabled(imi, touchExplorationEnabled)) {
            callback.onInlineSuggestionsUnsupported();
            return;
+1 −8
Original line number Diff line number Diff line
@@ -141,14 +141,7 @@ final class DefaultImeVisibilityApplier implements ImeVisibilityApplier {

    @GuardedBy("ImfLock.class")
    @Override
    public void applyImeVisibility(IBinder windowToken, @NonNull ImeTracker.Token statsToken,
            @ImeVisibilityStateComputer.VisibilityState int state, @UserIdInt int userId) {
        applyImeVisibility(windowToken, statsToken, state,
                SoftInputShowHideReason.NOT_SET /* ignore reason */, userId);
    }

    @GuardedBy("ImfLock.class")
    void applyImeVisibility(IBinder windowToken, @Nullable ImeTracker.Token statsToken,
    public void applyImeVisibility(IBinder windowToken, @Nullable ImeTracker.Token statsToken,
            @ImeVisibilityStateComputer.VisibilityState int state,
            @SoftInputShowHideReason int reason, @UserIdInt int userId) {
        final var bindingController = mService.getInputMethodBindingController(userId);
+3 −1
Original line number Diff line number Diff line
@@ -67,10 +67,12 @@ interface ImeVisibilityApplier {
     * @param windowToken the token of a window for applying the IME visibility
     * @param statsToken  the token tracking the current IME request
     * @param state       the new IME visibility state for the applier to handle
     * @param reason      the reason why the input window is visible or hidden
     * @param userId      the target user when applying the IME visibility state
     */
    default void applyImeVisibility(IBinder windowToken, @NonNull ImeTracker.Token statsToken,
            @ImeVisibilityStateComputer.VisibilityState int state, @UserIdInt int userId) {
            @ImeVisibilityStateComputer.VisibilityState int state,
            @SoftInputShowHideReason int reason, @UserIdInt int userId) {
    }

    /**
+6 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ final class InputMethodBindingController {
    /** Time in milliseconds that the IME service has to bind before it is reconnected. */
    static final long TIME_TO_RECONNECT = 3 * 1000;

    @UserIdInt final int mUserId;
    @UserIdInt private final int mUserId;
    @NonNull private final InputMethodManagerService mService;
    @NonNull private final Context mContext;
    @NonNull private final AutofillSuggestionsController mAutofillController;
@@ -657,4 +657,9 @@ final class InputMethodBindingController {
    int getDeviceIdToShowIme() {
        return mDeviceIdToShowIme;
    }

    @UserIdInt
    int getUserId() {
        return mUserId;
    }
}
+10 −8
Original line number Diff line number Diff line
@@ -1868,7 +1868,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            final var statsToken = createStatsTokenForFocusedClient(false /* show */,
                    SoftInputShowHideReason.UNBIND_CURRENT_METHOD, userId);
            mVisibilityApplier.applyImeVisibility(userData.mImeBindingState.mFocusedWindow,
                    statsToken, STATE_HIDE_IME, userId);
                    statsToken, STATE_HIDE_IME, SoftInputShowHideReason.NOT_SET /* ignore reason */,
                    userId);
        }
    }

@@ -2041,7 +2042,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            @NonNull ImeOnBackInvokedDispatcher imeDispatcher,
            @NonNull InputMethodBindingController bindingController) {

        final int userId = bindingController.mUserId;
        final int userId = bindingController.getUserId();
        final var userData = getUserData(userId);

        // Compute the final shown display ID with validated cs.selfReportedDisplayId for this
@@ -2058,8 +2059,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        // Potentially override the selected input method if the new display belongs to a virtual
        // device with a custom IME.
        String selectedMethodId = bindingController.getSelectedMethodId();
        final String deviceMethodId = computeCurrentDeviceMethodIdLocked(bindingController.mUserId,
                selectedMethodId);
        final String deviceMethodId = computeCurrentDeviceMethodIdLocked(
                bindingController.getUserId(), selectedMethodId);
        if (deviceMethodId == null) {
            mVisibilityStateComputer.getImePolicy().setImeHiddenByDisplayPolicy(true);
        } else if (!Objects.equals(deviceMethodId, selectedMethodId)) {
@@ -2557,7 +2558,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.

    @GuardedBy("ImfLock.class")
    void clearClientSessionsLocked(@NonNull InputMethodBindingController bindingController) {
        final int userId = bindingController.mUserId;
        final int userId = bindingController.getUserId();
        final var userData = getUserData(userId);
        if (bindingController.getCurMethod() != null) {
            // TODO(b/324907325): Remove the suppress warnings once b/324907325 is fixed.
@@ -3849,7 +3850,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    + " cs=" + cs);
        }

        final int userId = bindingController.mUserId;
        final int userId = bindingController.getUserId();
        final var userData = getUserData(userId);
        final boolean sameWindowFocused = userData.mImeBindingState.mFocusedWindow == windowToken;
        final boolean isTextEditor = (startInputFlags & StartInputFlags.IS_TEXT_EDITOR) != 0;
@@ -3883,7 +3884,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    null, null, null, null, -1, false);
        }

        userData.mImeBindingState = new ImeBindingState(bindingController.mUserId, windowToken,
        userData.mImeBindingState = new ImeBindingState(bindingController.getUserId(), windowToken,
                softInputMode, cs, editorInfo);
        mFocusedWindowPerceptible.put(windowToken, true);

@@ -4662,7 +4663,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                        windowToken, userId);
                mVisibilityApplier.applyImeVisibility(requestToken, statsToken,
                        setVisible ? ImeVisibilityStateComputer.STATE_SHOW_IME
                                : ImeVisibilityStateComputer.STATE_HIDE_IME, userId);
                                : ImeVisibilityStateComputer.STATE_HIDE_IME,
                        SoftInputShowHideReason.NOT_SET /* ignore reason */, userId);
            }
        } finally {
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
Loading