• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Programmatically determine if soft keyboard voice to text is enabled

I am writing an app that requires a high level of security. The app will be deployed on a Droid X device. I cannot allow the user to access the voice to text feature of the soft keyboard (by touching the microphone icon) because the audio and text cannot be sent over the internet. There is a way to disable this feature in Settings by going to Language & keyboard --> Multi-touch keyboard --> and then uncheck the Voice dictation checkbox. When this checkbox is unchecked, the microphone icon on the soft keyboard is disabled. What I need is to be able to verify in my app that this feature is still turned off when the user is in any activity in my app where there is a TextView that activates the soft keyboard. I have tried the following code, but it apparently isn't checking the feature I turned off because it still indicates that voice recognition is turned on even when Voice dictation has been disabled. Is there any way programmatically to specifically check if the Voice dictation feature of the soft keyboard is enabled?
Code:
PackageManager pm = getPackageManager();
List activities = pm.queryIntentActivities(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
    if (activities.size() != 0) {[INDENT]     // voice recognition is turned on....NAUGHTY USER!
[/INDENT][INDENT]     displayAlertMessage("You are naughty! You turned on voice recognition...No data entry will be allowed until this feature is turned off!");
[/INDENT]}
 
Back
Top Bottom