Use the new RecognitionService.SERVICE_INTERFACE instead of

RecognizerIntent.ACTION_RECOGNIZE_SPEECH when finding a voice
recognition service.
This commit is contained in:
Mike LeBeau
2010-02-11 15:01:27 -08:00
parent 378ae126d9
commit cb0be8a530
2 changed files with 3 additions and 2 deletions

View File

@@ -221,7 +221,7 @@ public class RecognitionManager {
if (mConnection == null) { // first time connection
mConnection = new Connection();
Intent serviceIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
Intent serviceIntent = new Intent(RecognitionService.SERVICE_INTERFACE);
String serviceComponent = Settings.Secure.getString(mContext.getContentResolver(),
Settings.Secure.VOICE_RECOGNITION_SERVICE);

View File

@@ -38,6 +38,7 @@ import android.net.ConnectivityManager;
import android.os.Environment;
import android.os.SystemProperties;
import android.provider.Settings;
import android.speech.RecognitionService;
import android.speech.RecognizerIntent;
import android.text.TextUtils;
import android.util.Config;
@@ -996,7 +997,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
String selectedService = null;
List<ResolveInfo> availableRecognitionServices =
mContext.getPackageManager().queryIntentServices(
new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
new Intent(RecognitionService.SERVICE_INTERFACE), 0);
int numAvailable = availableRecognitionServices.size();
if (numAvailable == 0) {