androidandroid-studiokotlinintuneandroid-speech-api

What is the package name of android.speech.RecognizerIntent?


I am using Google speech recognizer intent in my application. It is working well in a normal environment.

enter image description here

But this app is being developed for a managed environment Microsoft Intune. As per this link, I need to exempt the speech recognizer intent in Microsoft Intune app protection policy. Intune app protection policy is expecting the package name or identifier such as com.android.browser for the exemption.

I cannot find the correct package name for this speech recognizer intent. Is there any way to find the package id for this? Please help me to solve this. Thanks in Advance


Solution

  • You could get the package names of the components that will resolve the Intent by doing so:

    List<ResolveInfo> resolveInfos = getPackageManager().queryIntentActivities(intent, 0);
    for(ResolveInfo resolveInfo : resolveInfos){
        Log.d(TAG, "Package name resolving the intent:" + resolveInfo.activityInfo.packageName);
    }