summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/inputmethod/AutofillSuggestionsController.java4
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodBindingController.java6
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodManagerService.java6
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodMenuController.java3
4 files changed, 11 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/inputmethod/AutofillSuggestionsController.java b/services/core/java/com/android/server/inputmethod/AutofillSuggestionsController.java
index 2d6b013d11c1..035a7485fe86 100644
--- a/services/core/java/com/android/server/inputmethod/AutofillSuggestionsController.java
+++ b/services/core/java/com/android/server/inputmethod/AutofillSuggestionsController.java
@@ -39,7 +39,6 @@ final class AutofillSuggestionsController {
private static final String TAG = AutofillSuggestionsController.class.getSimpleName();
@NonNull private final InputMethodManagerService mService;
- @NonNull private final InputMethodUtils.InputMethodSettings mSettings;
private static final class CreateInlineSuggestionsRequest {
@NonNull final InlineSuggestionsRequestInfo mRequestInfo;
@@ -76,7 +75,6 @@ final class AutofillSuggestionsController {
AutofillSuggestionsController(@NonNull InputMethodManagerService service) {
mService = service;
- mSettings = mService.mSettings;
}
@GuardedBy("ImfLock.class")
@@ -88,7 +86,7 @@ final class AutofillSuggestionsController {
final InputMethodInfo imi = mService.queryInputMethodForCurrentUserLocked(
mService.getSelectedMethodIdLocked());
try {
- if (userId == mSettings.getCurrentUserId()
+ if (userId == mService.getCurrentImeUserIdLocked()
&& imi != null && isInlineSuggestionsEnabled(imi, touchExplorationEnabled)) {
mPendingInlineSuggestionsRequest = new CreateInlineSuggestionsRequest(
requestInfo, callback, imi.getPackageName());
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java
index e76aa1aad0cc..c8c0482f5a9d 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java
@@ -63,7 +63,6 @@ final class InputMethodBindingController {
@NonNull private final InputMethodManagerService mService;
@NonNull private final Context mContext;
- @NonNull private final InputMethodUtils.InputMethodSettings mSettings;
@NonNull private final PackageManagerInternal mPackageManagerInternal;
@NonNull private final WindowManagerInternal mWindowManagerInternal;
@@ -113,7 +112,6 @@ final class InputMethodBindingController {
int imeConnectionBindFlags, CountDownLatch latchForTesting) {
mService = service;
mContext = mService.mContext;
- mSettings = mService.mSettings;
mPackageManagerInternal = mService.mPackageManagerInternal;
mWindowManagerInternal = mService.mWindowManagerInternal;
mImeConnectionBindFlags = imeConnectionBindFlags;
@@ -322,7 +320,7 @@ final class InputMethodBindingController {
private void updateCurrentMethodUid() {
final String curMethodPackage = mCurIntent.getComponent().getPackageName();
final int curMethodUid = mPackageManagerInternal.getPackageUid(
- curMethodPackage, 0 /* flags */, mSettings.getCurrentUserId());
+ curMethodPackage, 0 /* flags */, mService.getCurrentImeUserIdLocked());
if (curMethodUid < 0) {
Slog.e(TAG, "Failed to get UID for package=" + curMethodPackage);
mCurMethodUid = Process.INVALID_UID;
@@ -478,7 +476,7 @@ final class InputMethodBindingController {
return false;
}
return mContext.bindServiceAsUser(mCurIntent, conn, flags,
- new UserHandle(mSettings.getCurrentUserId()));
+ new UserHandle(mService.getCurrentImeUserIdLocked()));
}
@GuardedBy("ImfLock.class")
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index 1ae67dd8add9..438c8f951eb6 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -1727,6 +1727,12 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
registerDeviceListenerAndCheckStylusSupport();
}
+ @GuardedBy("ImfLock.class")
+ @UserIdInt
+ int getCurrentImeUserIdLocked() {
+ return mSettings.getCurrentUserId();
+ }
+
private final class InkWindowInitializer implements Runnable {
public void run() {
synchronized (ImfLock.class) {
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodMenuController.java b/services/core/java/com/android/server/inputmethod/InputMethodMenuController.java
index 3b5ef4cadfdf..efa1e0d66f35 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodMenuController.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodMenuController.java
@@ -79,7 +79,8 @@ final class InputMethodMenuController {
synchronized (ImfLock.class) {
final boolean isScreenLocked = mWindowManagerInternal.isKeyguardLocked()
- && mWindowManagerInternal.isKeyguardSecure(mSettings.getCurrentUserId());
+ && mWindowManagerInternal.isKeyguardSecure(
+ mService.getCurrentImeUserIdLocked());
final String lastInputMethodId = mSettings.getSelectedInputMethod();
int lastInputMethodSubtypeId =
mSettings.getSelectedInputMethodSubtypeId(lastInputMethodId);