speech: queryIntentService-AsUser-

Use queryIntentServicesAsUser rather than queryIntentServices.
This will allow to run the check in multiuser scenarios.

Bug: 193607146
Test: CtsVoiceRecognitionTestCases
Change-Id: I9386bcc04bcaa210e681e109c5cbbfa8695fb38a
This commit is contained in:
Andrea Ambu
2021-07-15 17:53:23 +01:00
parent ac77fab34c
commit c4c411202f

View File

@@ -255,8 +255,8 @@ final class SpeechRecognitionManagerServiceImpl extends
private boolean componentMapsToRecognitionService(@NonNull ComponentName serviceComponent) {
List<ResolveInfo> resolveInfos =
getContext().getPackageManager().queryIntentServices(
new Intent(RecognitionService.SERVICE_INTERFACE), 0);
getContext().getPackageManager().queryIntentServicesAsUser(
new Intent(RecognitionService.SERVICE_INTERFACE), 0, getUserId());
if (resolveInfos == null) {
return false;
}