From 29e2529ca4b5a0dd1420ef042c7147dade0dfdeb Mon Sep 17 00:00:00 2001 From: Nikolas Havrikov Date: Fri, 5 Nov 2021 11:37:29 +0100 Subject: [PATCH] Introduce InputMethodBindingController Bug: 205676419 Test: make Change-Id: I29f4969147305674a2bc2204ba2c657f374aaaf3 --- .../InputMethodBindingController.java | 33 +++++++++++++++++++ .../InputMethodManagerService.java | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 services/core/java/com/android/server/inputmethod/InputMethodBindingController.java diff --git a/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java new file mode 100644 index 0000000000000..cb279876b74fd --- /dev/null +++ b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java @@ -0,0 +1,33 @@ +/* + * 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; + } +} diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index df550b510772b..0d9d8b697de30 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -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(