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

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

Merge cherrypicks of ['googleplex-android-review.googlesource.com/30803769',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/30803769', 'googleplex-android-review.googlesource.com/30983917', 'googleplex-android-review.googlesource.com/31234195', 'googleplex-android-review.googlesource.com/31234196'] into 25Q1-release.

Change-Id: I13bffdb5ac851386be64bb8985cf50cb3e544764
parents dd0e2338 34def815
Loading
Loading
Loading
Loading
+20 −21
Original line number Diff line number Diff line
@@ -938,27 +938,6 @@ public final class InputMethodManager {
            synchronized (mH) {
                if (mCurRootView == viewRootImpl) {
                    mCurRootViewWindowFocused = false;

                    if (Flags.refactorInsetsController() && mCurRootView != null) {
                        final int softInputMode = mCurRootView.mWindowAttributes.softInputMode;
                        final int state =
                                softInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE;
                        if (state == WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) {
                            // when losing focus (e.g., by going to another window), we reset the
                            // requestedVisibleTypes of WindowInsetsController by hiding the IME
                            final var statsToken = ImeTracker.forLogging().onStart(
                                    ImeTracker.TYPE_HIDE, ImeTracker.ORIGIN_CLIENT,
                                    SoftInputShowHideReason.REASON_HIDE_WINDOW_LOST_FOCUS,
                                    false /* fromUser */);
                            if (DEBUG) {
                                Log.d(TAG, "onWindowLostFocus, hiding IME because "
                                        + "of STATE_ALWAYS_HIDDEN");
                            }
                            mCurRootView.getInsetsController().hide(WindowInsets.Type.ime(),
                                    false /* fromIme */, statsToken);
                        }
                    }

                    clearCurRootViewIfNeeded();
                }
            }
@@ -1012,6 +991,26 @@ public final class InputMethodManager {
        @GuardedBy("mH")
        private void setCurrentRootViewLocked(ViewRootImpl rootView) {
            final boolean wasEmpty = mCurRootView == null;
            if (Flags.refactorInsetsController() && !wasEmpty && mCurRootView != rootView) {
                final int softInputMode = mCurRootView.mWindowAttributes.softInputMode;
                final int state =
                        softInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE;
                if (state == WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) {
                    // when losing input focus (e.g., by going to another window), we reset the
                    // requestedVisibleTypes of WindowInsetsController by hiding the IME
                    final var statsToken = ImeTracker.forLogging().onStart(
                            ImeTracker.TYPE_HIDE, ImeTracker.ORIGIN_CLIENT,
                            SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS,
                            false /* fromUser */);
                    if (DEBUG) {
                        Log.d(TAG, "setCurrentRootViewLocked, hiding IME because "
                                + "of STATE_ALWAYS_HIDDEN");
                    }
                    mCurRootView.getInsetsController().hide(WindowInsets.Type.ime(),
                            false /* fromIme */, statsToken);
                }
            }

            mImeDispatcher.switchRootView(mCurRootView, rootView);
            mCurRootView = rootView;
            if (wasEmpty && mCurRootView != null) {
+6 −0
Original line number Diff line number Diff line
@@ -299,6 +299,12 @@ public final class InputMethodDebug {
                return "SHOW_SOFT_INPUT_IMM_DEPRECATION";
            case SoftInputShowHideReason.CONTROL_WINDOW_INSETS_ANIMATION:
                return "CONTROL_WINDOW_INSETS_ANIMATION";
            case SoftInputShowHideReason.SHOW_INPUT_TARGET_CHANGED:
                return "SHOW_INPUT_TARGET_CHANGED";
            case SoftInputShowHideReason.HIDE_INPUT_TARGET_CHANGED:
                return "HIDE_INPUT_TARGET_CHANGED";
            case SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS:
                return "HIDE_WINDOW_LOST_FOCUS";
            default:
                return "Unknown=" + reason;
        }
+14 −14
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ import java.lang.annotation.Retention;
        SoftInputShowHideReason.CONTROL_WINDOW_INSETS_ANIMATION,
        SoftInputShowHideReason.SHOW_INPUT_TARGET_CHANGED,
        SoftInputShowHideReason.HIDE_INPUT_TARGET_CHANGED,
        SoftInputShowHideReason.REASON_HIDE_WINDOW_LOST_FOCUS,
        SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS,
})
public @interface SoftInputShowHideReason {
    /** Default, undefined reason. */
@@ -339,18 +339,6 @@ public @interface SoftInputShowHideReason {
     */
    int HIDE_WINDOW_LEGACY_DIRECT = ImeProtoEnums.REASON_HIDE_WINDOW_LEGACY_DIRECT;

    /**
     * Show soft input because the input target changed
     * {@link com.android.server.wm.ImeInsetsSourceProvider#onInputTargetChanged}.
     */
    int SHOW_INPUT_TARGET_CHANGED = ImeProtoEnums.REASON_SHOW_INPUT_TARGET_CHANGED;

    /**
     * Hide soft input because the input target changed by
     * {@link com.android.server.wm.ImeInsetsSourceProvider#onInputTargetChanged}.
     */
    int HIDE_INPUT_TARGET_CHANGED = ImeProtoEnums.REASON_HIDE_INPUT_TARGET_CHANGED;

    /**
     * Show / Hide soft input by
     * {@link android.inputmethodservice.InputMethodService#resetStateForNewConfiguration}.
@@ -420,6 +408,18 @@ public @interface SoftInputShowHideReason {
     */
    int CONTROL_WINDOW_INSETS_ANIMATION = ImeProtoEnums.REASON_CONTROL_WINDOW_INSETS_ANIMATION;

    /**
     * Show soft input because the input target changed
     * {@link com.android.server.wm.ImeInsetsSourceProvider#onInputTargetChanged}.
     */
    int SHOW_INPUT_TARGET_CHANGED = ImeProtoEnums.REASON_SHOW_INPUT_TARGET_CHANGED;

    /**
     * Hide soft input because the input target changed by
     * {@link com.android.server.wm.ImeInsetsSourceProvider#onInputTargetChanged}.
     */
    int HIDE_INPUT_TARGET_CHANGED = ImeProtoEnums.REASON_HIDE_INPUT_TARGET_CHANGED;

    /** Hide soft input when the window lost focus. */
    int REASON_HIDE_WINDOW_LOST_FOCUS = ImeProtoEnums.REASON_HIDE_WINDOW_LOST_FOCUS;
    int HIDE_WINDOW_LOST_FOCUS = ImeProtoEnums.REASON_HIDE_WINDOW_LOST_FOCUS;
}
+14 −3
Original line number Diff line number Diff line
@@ -19,10 +19,21 @@ package {
filegroup {
    name: "framework-ondeviceintelligence-sources",
    srcs: [
        "java/**/*.aidl",
        "java/**/*.java",
        "module/java/**/*.aidl",
        "module/java/**/*.java",
    ],
    visibility: [
        "//frameworks/base:__subpackages__",
        "//packages/modules/NeuralNetworks:__subpackages__",
    ],
}

filegroup {
    name: "framework-ondeviceintelligence-sources-platform",
    srcs: [
        "platform/java/**/*.aidl",
        "platform/java/**/*.java",
    ],
    path: "java",
    visibility: [
        "//frameworks/base:__subpackages__",
        "//packages/modules/NeuralNetworks:__subpackages__",
+0 −0

File moved.

Loading