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

Commit 7b5a72a3 authored by Michael Wachenschwanz's avatar Michael Wachenschwanz Committed by Android (Google) Code Review
Browse files

Merge "Lower IME background importance" into main

parents 5149fa26 111b03de
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -203,3 +203,14 @@ flag {
  description: "Adding animating insets types and report IME visibility at the beginning of hiding"
  bug: "393049691"
}

flag {
    name: "lower_ime_oom_importance"
    namespace: "input_method"
    description: "Lower keyboard app process oom importance to PERCEPTIBLE_APP_ADJ + 1."
    bug: "372511805"
    is_fixed_read_only: true
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+11 −2
Original line number Diff line number Diff line
@@ -120,12 +120,21 @@ final class InputMethodBindingController {
     * Binding flags for establishing connection to the {@link InputMethodService}.
     */
    @VisibleForTesting
    static final int IME_CONNECTION_BIND_FLAGS =
            Context.BIND_AUTO_CREATE
    static final int IME_CONNECTION_BIND_FLAGS;
    static {
        if (android.view.inputmethod.Flags.lowerImeOomImportance()) {
            IME_CONNECTION_BIND_FLAGS = Context.BIND_AUTO_CREATE
                    | Context.BIND_ALMOST_PERCEPTIBLE
                    | Context.BIND_IMPORTANT_BACKGROUND
                    | Context.BIND_SCHEDULE_LIKE_TOP_APP;
        } else {
            IME_CONNECTION_BIND_FLAGS = Context.BIND_AUTO_CREATE
                    | Context.BIND_NOT_VISIBLE
                    | Context.BIND_NOT_FOREGROUND
                    | Context.BIND_IMPORTANT_BACKGROUND
                    | Context.BIND_SCHEDULE_LIKE_TOP_APP;
        }
    }

    private final int mImeConnectionBindFlags;