diff options
author | Yohei Yukawa <yukawa@google.com> | 2014-05-22 11:07:13 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-22 11:07:14 +0000 |
commit | 4fae8e165b3e10d8365ab9c08b13704d57e119c7 (patch) | |
tree | b10682a5a669bdae703dbc0443a7b30cfc67dab8 /services | |
parent | 350c73fb404268ca0c3c57dc98c53d5353f08ff6 (diff) | |
parent | 5a647b69be8ac8d40c33ed9abe63e41514699e5b (diff) | |
download | frameworks_base-4fae8e165b3e10d8365ab9c08b13704d57e119c7.zip frameworks_base-4fae8e165b3e10d8365ab9c08b13704d57e119c7.tar.gz frameworks_base-4fae8e165b3e10d8365ab9c08b13704d57e119c7.tar.bz2 |
Merge "Remove unnecessary internal lock"
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/InputMethodManagerService.java | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java index 2d270e7..fb69c86 100644 --- a/services/core/java/com/android/server/InputMethodManagerService.java +++ b/services/core/java/com/android/server/InputMethodManagerService.java @@ -692,8 +692,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mRes, context.getContentResolver(), mMethodMap, mMethodList, userId); updateCurrentProfileIds(); mFileManager = new InputMethodFileManager(mMethodMap, userId); - mSwitchingController = new InputMethodSubtypeSwitchingController(mSettings); - mSwitchingController.resetCircularListLocked(context); + synchronized (mMethodMap) { + mSwitchingController = InputMethodSubtypeSwitchingController.createInstanceLocked( + mSettings, context); + } // Just checking if defaultImiId is empty or not final String defaultImiId = mSettings.getSelectedInputMethod(); @@ -702,17 +704,23 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } mImeSelectedOnBoot = !TextUtils.isEmpty(defaultImiId); - buildInputMethodListLocked(mMethodList, mMethodMap, - !mImeSelectedOnBoot /* resetDefaultEnabledIme */); + synchronized (mMethodMap) { + buildInputMethodListLocked(mMethodList, mMethodMap, + !mImeSelectedOnBoot /* resetDefaultEnabledIme */); + } mSettings.enableAllIMEsIfThereIsNoEnabledIME(); if (!mImeSelectedOnBoot) { Slog.w(TAG, "No IME selected. Choose the most applicable IME."); - resetDefaultImeLocked(context); + synchronized (mMethodMap) { + resetDefaultImeLocked(context); + } } mSettingsObserver = new SettingsObserver(mHandler); - updateFromSettingsLocked(true); + synchronized (mMethodMap) { + updateFromSettingsLocked(true); + } // IMMS wants to receive Intent.ACTION_LOCALE_CHANGED in order to update the current IME // according to the new system locale. @@ -2174,7 +2182,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub return false; } synchronized (mMethodMap) { - final ImeSubtypeListItem nextSubtype = mSwitchingController.getNextInputMethod( + final ImeSubtypeListItem nextSubtype = mSwitchingController.getNextInputMethodLocked( onlyCurrentIme, mMethodMap.get(mCurMethodId), mCurrentSubtype); if (nextSubtype == null) { return false; @@ -2190,7 +2198,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub return false; } synchronized (mMethodMap) { - final ImeSubtypeListItem nextSubtype = mSwitchingController.getNextInputMethod( + final ImeSubtypeListItem nextSubtype = mSwitchingController.getNextInputMethodLocked( false /* onlyCurrentIme */, mMethodMap.get(mCurMethodId), mCurrentSubtype); if (nextSubtype == null) { return false; @@ -2273,9 +2281,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub if (DEBUG) { Slog.d(TAG, "Got the notification of commitText"); } - final InputMethodInfo imi = mMethodMap.get(mCurMethodId); - if (imi != null) { - mSwitchingController.onCommitText(imi, mCurrentSubtype); + synchronized (mMethodMap) { + final InputMethodInfo imi = mMethodMap.get(mCurMethodId); + if (imi != null) { + mSwitchingController.onCommitTextLocked(imi, mCurrentSubtype); + } } } @@ -2698,7 +2708,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub hideInputMethodMenuLocked(); final List<ImeSubtypeListItem> imList = - mSwitchingController.getSortedInputMethodAndSubtypeList( + mSwitchingController.getSortedInputMethodAndSubtypeListLocked( showSubtypes, mInputShown, isScreenLocked); if (lastInputMethodSubtypeId == NOT_A_SUBTYPE_ID) { |