Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +33 −17 Original line number Diff line number Diff line Loading @@ -867,7 +867,10 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub if (!mSystemReady) { return; } buildInputMethodListLocked(true); mSettings = queryInputMethodServicesInternal(mContext, mSettings.getUserId(), AdditionalSubtypeMapRepository.get(mSettings.getUserId()), DirectBootAwareness.AUTO); postInputMethodSettingUpdatedLocked(true /* resetDefaultEnabledIme */); // If the locale is changed, needs to reset the default ime resetDefaultImeLocked(mContext); updateFromSettingsLocked(true); Loading Loading @@ -1114,12 +1117,16 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub settings.getMethodMap()); } if (!isCurrentUser || !(additionalSubtypeChanged || shouldRebuildInputMethodListLocked())) { if (!isCurrentUser) { return; } buildInputMethodListLocked(false /* resetDefaultEnabledIme */); if (!(additionalSubtypeChanged || shouldRebuildInputMethodListLocked())) { return; } mSettings = queryInputMethodServicesInternal(mContext, userId, newAdditionalSubtypeMap, DirectBootAwareness.AUTO); postInputMethodSettingUpdatedLocked(false /* resetDefaultEnabledIme */); boolean changed = false; Loading Loading @@ -1278,14 +1285,16 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub if (userId != currentUserId) { return; } mSettings = InputMethodSettings.createEmptyMap(userId); if (mSystemReady) { if (!mSystemReady) { return; } mSettings = queryInputMethodServicesInternal(mContext, userId, AdditionalSubtypeMapRepository.get(userId), DirectBootAwareness.AUTO); // We need to rebuild IMEs. buildInputMethodListLocked(false /* resetDefaultEnabledIme */); postInputMethodSettingUpdatedLocked(false /* resetDefaultEnabledIme */); updateInputMethodsFromSettingsLocked(true /* enabledChanged */); } } } @GuardedBy("ImfLock.class") void scheduleSwitchUserTaskLocked(@UserIdInt int userId, Loading Loading @@ -1515,7 +1524,10 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub // The mSystemReady flag is set during boot phase, // and user switch would not happen at that time. resetCurrentMethodAndClientLocked(UnbindReason.SWITCH_USER); buildInputMethodListLocked(initialUserSwitch); mSettings = queryInputMethodServicesInternal(mContext, newUserId, AdditionalSubtypeMapRepository.get(newUserId), DirectBootAwareness.AUTO); postInputMethodSettingUpdatedLocked(initialUserSwitch /* resetDefaultEnabledIme */); if (TextUtils.isEmpty(mSettings.getSelectedInputMethod())) { // This is the first time of the user switch and // set the current ime to the proper one. Loading Loading @@ -1596,7 +1608,11 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub final String defaultImiId = mSettings.getSelectedInputMethod(); final boolean imeSelectedOnBoot = !TextUtils.isEmpty(defaultImiId); buildInputMethodListLocked(!imeSelectedOnBoot /* resetDefaultEnabledIme */); mSettings = queryInputMethodServicesInternal(mContext, currentUserId, AdditionalSubtypeMapRepository.get(mSettings.getUserId()), DirectBootAwareness.AUTO); postInputMethodSettingUpdatedLocked( !imeSelectedOnBoot /* resetDefaultEnabledIme */); updateFromSettingsLocked(true); InputMethodUtils.setNonSelectedSystemImesDisabledUntilUsed( getPackageManagerForUser(mContext, currentUserId), Loading Loading @@ -4041,7 +4057,11 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub if (isCurrentUser) { final long ident = Binder.clearCallingIdentity(); try { buildInputMethodListLocked(false /* resetDefaultEnabledIme */); mSettings = queryInputMethodServicesInternal(mContext, mSettings.getUserId(), AdditionalSubtypeMapRepository.get(mSettings.getUserId()), DirectBootAwareness.AUTO); postInputMethodSettingUpdatedLocked(false /* resetDefaultEnabledIme */); } finally { Binder.restoreCallingIdentity(ident); } Loading Loading @@ -4969,7 +4989,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub } @GuardedBy("ImfLock.class") void buildInputMethodListLocked(boolean resetDefaultEnabledIme) { void postInputMethodSettingUpdatedLocked(boolean resetDefaultEnabledIme) { if (DEBUG) { Slog.d(TAG, "--- re-buildInputMethodList reset = " + resetDefaultEnabledIme + " \n ------ caller=" + Debug.getCallers(10)); Loading @@ -4981,10 +5001,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub mMethodMapUpdateCount++; mMyPackageMonitor.clearKnownImePackageNamesLocked(); mSettings = queryInputMethodServicesInternal(mContext, mSettings.getUserId(), AdditionalSubtypeMapRepository.get(mSettings.getUserId()), DirectBootAwareness.AUTO); // Construct the set of possible IME packages for onPackageChanged() to avoid false // negatives when the package state remains to be the same but only the component state is // changed. Loading Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +33 −17 Original line number Diff line number Diff line Loading @@ -867,7 +867,10 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub if (!mSystemReady) { return; } buildInputMethodListLocked(true); mSettings = queryInputMethodServicesInternal(mContext, mSettings.getUserId(), AdditionalSubtypeMapRepository.get(mSettings.getUserId()), DirectBootAwareness.AUTO); postInputMethodSettingUpdatedLocked(true /* resetDefaultEnabledIme */); // If the locale is changed, needs to reset the default ime resetDefaultImeLocked(mContext); updateFromSettingsLocked(true); Loading Loading @@ -1114,12 +1117,16 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub settings.getMethodMap()); } if (!isCurrentUser || !(additionalSubtypeChanged || shouldRebuildInputMethodListLocked())) { if (!isCurrentUser) { return; } buildInputMethodListLocked(false /* resetDefaultEnabledIme */); if (!(additionalSubtypeChanged || shouldRebuildInputMethodListLocked())) { return; } mSettings = queryInputMethodServicesInternal(mContext, userId, newAdditionalSubtypeMap, DirectBootAwareness.AUTO); postInputMethodSettingUpdatedLocked(false /* resetDefaultEnabledIme */); boolean changed = false; Loading Loading @@ -1278,14 +1285,16 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub if (userId != currentUserId) { return; } mSettings = InputMethodSettings.createEmptyMap(userId); if (mSystemReady) { if (!mSystemReady) { return; } mSettings = queryInputMethodServicesInternal(mContext, userId, AdditionalSubtypeMapRepository.get(userId), DirectBootAwareness.AUTO); // We need to rebuild IMEs. buildInputMethodListLocked(false /* resetDefaultEnabledIme */); postInputMethodSettingUpdatedLocked(false /* resetDefaultEnabledIme */); updateInputMethodsFromSettingsLocked(true /* enabledChanged */); } } } @GuardedBy("ImfLock.class") void scheduleSwitchUserTaskLocked(@UserIdInt int userId, Loading Loading @@ -1515,7 +1524,10 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub // The mSystemReady flag is set during boot phase, // and user switch would not happen at that time. resetCurrentMethodAndClientLocked(UnbindReason.SWITCH_USER); buildInputMethodListLocked(initialUserSwitch); mSettings = queryInputMethodServicesInternal(mContext, newUserId, AdditionalSubtypeMapRepository.get(newUserId), DirectBootAwareness.AUTO); postInputMethodSettingUpdatedLocked(initialUserSwitch /* resetDefaultEnabledIme */); if (TextUtils.isEmpty(mSettings.getSelectedInputMethod())) { // This is the first time of the user switch and // set the current ime to the proper one. Loading Loading @@ -1596,7 +1608,11 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub final String defaultImiId = mSettings.getSelectedInputMethod(); final boolean imeSelectedOnBoot = !TextUtils.isEmpty(defaultImiId); buildInputMethodListLocked(!imeSelectedOnBoot /* resetDefaultEnabledIme */); mSettings = queryInputMethodServicesInternal(mContext, currentUserId, AdditionalSubtypeMapRepository.get(mSettings.getUserId()), DirectBootAwareness.AUTO); postInputMethodSettingUpdatedLocked( !imeSelectedOnBoot /* resetDefaultEnabledIme */); updateFromSettingsLocked(true); InputMethodUtils.setNonSelectedSystemImesDisabledUntilUsed( getPackageManagerForUser(mContext, currentUserId), Loading Loading @@ -4041,7 +4057,11 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub if (isCurrentUser) { final long ident = Binder.clearCallingIdentity(); try { buildInputMethodListLocked(false /* resetDefaultEnabledIme */); mSettings = queryInputMethodServicesInternal(mContext, mSettings.getUserId(), AdditionalSubtypeMapRepository.get(mSettings.getUserId()), DirectBootAwareness.AUTO); postInputMethodSettingUpdatedLocked(false /* resetDefaultEnabledIme */); } finally { Binder.restoreCallingIdentity(ident); } Loading Loading @@ -4969,7 +4989,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub } @GuardedBy("ImfLock.class") void buildInputMethodListLocked(boolean resetDefaultEnabledIme) { void postInputMethodSettingUpdatedLocked(boolean resetDefaultEnabledIme) { if (DEBUG) { Slog.d(TAG, "--- re-buildInputMethodList reset = " + resetDefaultEnabledIme + " \n ------ caller=" + Debug.getCallers(10)); Loading @@ -4981,10 +5001,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub mMethodMapUpdateCount++; mMyPackageMonitor.clearKnownImePackageNamesLocked(); mSettings = queryInputMethodServicesInternal(mContext, mSettings.getUserId(), AdditionalSubtypeMapRepository.get(mSettings.getUserId()), DirectBootAwareness.AUTO); // Construct the set of possible IME packages for onPackageChanged() to avoid false // negatives when the package state remains to be the same but only the component state is // changed. Loading