diff options
author | Amith Yamasani <yamasani@google.com> | 2013-01-22 15:46:25 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-01-22 15:46:25 -0800 |
commit | 555b07df08dd4c2472374d0767926ebab928dede (patch) | |
tree | 22b12944168677bcd43dc810bc18455d08abb395 /services | |
parent | fe88f1be3d197987a874f6c29fefdeb11db183f6 (diff) | |
parent | 2c64b53976a99f28bc7c0612648581f9b93bf8b0 (diff) | |
download | frameworks_base-555b07df08dd4c2472374d0767926ebab928dede.zip frameworks_base-555b07df08dd4c2472374d0767926ebab928dede.tar.gz frameworks_base-555b07df08dd4c2472374d0767926ebab928dede.tar.bz2 |
am 2c64b539: am 596532d9: Properly initialize recognition service if the recognizer component changed.
* commit '2c64b53976a99f28bc7c0612648581f9b93bf8b0':
Properly initialize recognition service if the recognizer component changed.
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/RecognitionManagerService.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/services/java/com/android/server/RecognitionManagerService.java b/services/java/com/android/server/RecognitionManagerService.java index 1e0755d..c2e749d 100644 --- a/services/java/com/android/server/RecognitionManagerService.java +++ b/services/java/com/android/server/RecognitionManagerService.java @@ -89,17 +89,15 @@ public class RecognitionManagerService extends Binder { private void initForUser(int userHandle) { if (DEBUG) Slog.i(TAG, "initForUser user=" + userHandle); ComponentName comp = getCurRecognizer(userHandle); + ServiceInfo info = null; if (comp != null) { - // See if the current recognizer is no longer available. + // See if the current recognizer is still available. try { - mIPm.getServiceInfo(comp, 0, userHandle); + info = mIPm.getServiceInfo(comp, 0, userHandle); } catch (RemoteException e) { - comp = findAvailRecognizer(null, userHandle); - if (comp != null) { - setCurRecognizer(comp, userHandle); - } } - } else { + } + if (info == null) { comp = findAvailRecognizer(null, userHandle); if (comp != null) { setCurRecognizer(comp, userHandle); |