Fix an issue where voice input is not enabled by default for the secondary user
Bug: 8205725 Change-Id: I438daf996ba48cdb34f0a6158a0cbb510aae931b
This commit is contained in:
@@ -731,7 +731,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetAllInternalStateLocked(final boolean updateOnlyWhenLocaleChanged) {
|
private void resetAllInternalStateLocked(final boolean updateOnlyWhenLocaleChanged,
|
||||||
|
final boolean resetDefaultEnabledIme) {
|
||||||
if (!mSystemReady) {
|
if (!mSystemReady) {
|
||||||
// not system ready
|
// not system ready
|
||||||
return;
|
return;
|
||||||
@@ -749,8 +750,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
}
|
}
|
||||||
// InputMethodAndSubtypeListManager should be reset when the locale is changed.
|
// InputMethodAndSubtypeListManager should be reset when the locale is changed.
|
||||||
mImListManager = new InputMethodAndSubtypeListManager(mContext, this);
|
mImListManager = new InputMethodAndSubtypeListManager(mContext, this);
|
||||||
buildInputMethodListLocked(mMethodList, mMethodMap,
|
buildInputMethodListLocked(mMethodList, mMethodMap, resetDefaultEnabledIme);
|
||||||
updateOnlyWhenLocaleChanged /* resetDefaultEnabledIme */);
|
|
||||||
if (!updateOnlyWhenLocaleChanged) {
|
if (!updateOnlyWhenLocaleChanged) {
|
||||||
final String selectedImiId = mSettings.getSelectedInputMethod();
|
final String selectedImiId = mSettings.getSelectedInputMethod();
|
||||||
if (TextUtils.isEmpty(selectedImiId)) {
|
if (TextUtils.isEmpty(selectedImiId)) {
|
||||||
@@ -775,14 +775,21 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void checkCurrentLocaleChangedLocked() {
|
private void checkCurrentLocaleChangedLocked() {
|
||||||
resetAllInternalStateLocked(true);
|
resetAllInternalStateLocked(true /* updateOnlyWhenLocaleChanged */,
|
||||||
|
true /* resetDefaultImeLocked */);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void switchUserLocked(int newUserId) {
|
private void switchUserLocked(int newUserId) {
|
||||||
mSettings.setCurrentUserId(newUserId);
|
mSettings.setCurrentUserId(newUserId);
|
||||||
// InputMethodFileManager should be reset when the user is changed
|
// InputMethodFileManager should be reset when the user is changed
|
||||||
mFileManager = new InputMethodFileManager(mMethodMap, newUserId);
|
mFileManager = new InputMethodFileManager(mMethodMap, newUserId);
|
||||||
resetAllInternalStateLocked(false);
|
final String defaultImiId = mSettings.getSelectedInputMethod();
|
||||||
|
final boolean needsToResetDefaultIme = TextUtils.isEmpty(defaultImiId);
|
||||||
|
if (DEBUG) {
|
||||||
|
Slog.d(TAG, "Switch user: " + newUserId + " current ime = " + defaultImiId);
|
||||||
|
}
|
||||||
|
resetAllInternalStateLocked(false /* updateOnlyWhenLocaleChanged */,
|
||||||
|
needsToResetDefaultIme);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user