Starting SpeechRecognizer during a call

Is there a way to start SpeechRecognizer during a call? I did it as follows:

  • BroadcastReceiver handles a change in the state of the phone (e.g., disconnect).
  • SpeechRecognizerstarts in the current (main) thread, since it can only be started in the main thread. The application context is used for the resolver (the current context provided to the broadcast receiver cannot be used)

But, unfortunately, the person on the other hand does not hear me (speech recognition works fine). In the distance, the recognizer “swallowed” my voice and does not send it.

I know that doing things in the main thread during a call is dangerous, but is there a way to start the recognizer in some way during a call?

Update: I'm trying to listen TelephonyManagerinstead BroadcastReceiver, but some internal services are being removed from NPE.

+5
source share
2 answers

AFAIK voice call is never handled by Android. Any application processor or communication processor has flow control at any given time, not both. Usually, as soon as a voice call begins, the flow control of the microphone and headset is transferred to the communication processor. Strange in your case, the application processor takes control. It looks like an error.

( , , ). , .

+2

, . HTC Rezound android v4, Motorola Bionic android v2.3 , . HTC, . , .

0

All Articles