am 2c64b539: am 596532d9: Properly initialize recognition service if the recognizer component changed.

* commit '2c64b53976a99f28bc7c0612648581f9b93bf8b0':
  Properly initialize recognition service if the recognizer component changed.
This commit is contained in:
Amith Yamasani
2013-01-22 15:46:25 -08:00
committed by Android Git Automerger

View File

@ -89,17 +89,15 @@ public class RecognitionManagerService extends Binder {
private void initForUser(int userHandle) { private void initForUser(int userHandle) {
if (DEBUG) Slog.i(TAG, "initForUser user=" + userHandle); if (DEBUG) Slog.i(TAG, "initForUser user=" + userHandle);
ComponentName comp = getCurRecognizer(userHandle); ComponentName comp = getCurRecognizer(userHandle);
ServiceInfo info = null;
if (comp != null) { if (comp != null) {
// See if the current recognizer is no longer available. // See if the current recognizer is still available.
try { try {
mIPm.getServiceInfo(comp, 0, userHandle); info = mIPm.getServiceInfo(comp, 0, userHandle);
} catch (RemoteException e) { } catch (RemoteException e) {
comp = findAvailRecognizer(null, userHandle);
if (comp != null) {
setCurRecognizer(comp, userHandle);
}
} }
} else { }
if (info == null) {
comp = findAvailRecognizer(null, userHandle); comp = findAvailRecognizer(null, userHandle);
if (comp != null) { if (comp != null) {
setCurRecognizer(comp, userHandle); setCurRecognizer(comp, userHandle);