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

Commit 29e2529c authored by Nikolas Havrikov's avatar Nikolas Havrikov
Browse files

Introduce InputMethodBindingController

Bug: 205676419
Test: make
Change-Id: I29f4969147305674a2bc2204ba2c657f374aaaf3
parent 91944cec
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.server.inputmethod;

import android.annotation.NonNull;

/**
 * A controller managing the state of the input method binding.
 */
final class InputMethodBindingController {
    static final boolean DEBUG = false;
    private static final String TAG = InputMethodBindingController.class.getSimpleName();

    private final InputMethodManagerService mService;

    InputMethodBindingController(@NonNull InputMethodManagerService service) {
        mService = service;
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -325,6 +325,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
    private final UserManager mUserManager;
    private final UserManagerInternal mUserManagerInternal;
    private final InputMethodMenuController mMenuController;
    private final InputMethodBindingController mBindingController;

    /**
     * Cache the result of {@code LocalServices.getService(AudioManagerInternal.class)}.
@@ -1725,6 +1726,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        mSwitchingController = InputMethodSubtypeSwitchingController.createInstanceLocked(
                mSettings, context);
        mMenuController = new InputMethodMenuController(this);
        mBindingController = new InputMethodBindingController(this);

        // If configured, use low priority flags to make the IME killable by the lowmemorykiller
        final boolean lowerIMEPriority = mRes.getBoolean(