Use the new RecognitionService.SERVICE_INTERFACE instead of
RecognizerIntent.ACTION_RECOGNIZE_SPEECH when finding a voice recognition service.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user