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

Commit 431ed944 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Support force-stop IME package for background users" into main

parents da8375e5 a9b40f79
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -702,24 +702,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            super(true);
        }

        @GuardedBy("ImfLock.class")
        private boolean isChangingPackagesOfCurrentUserLocked() {
            final int userId = getChangingUserId();
            final boolean retval = userId == mCurrentUserId;
            if (DEBUG) {
                if (!retval) {
                    Slog.d(TAG, "--- ignore this call back from a background user: " + userId);
                }
            }
            return retval;
        }

        @Override
        public boolean onHandleForceStop(Intent intent, String[] packages, int uid, boolean doit) {
            synchronized (ImfLock.class) {
                if (!isChangingPackagesOfCurrentUserLocked()) {
                    return false;
                }
                final int userId = getChangingUserId();
                final InputMethodSettings settings = InputMethodSettingsRepository.get(userId);
                String curInputMethodId = settings.getSelectedInputMethod();