Merge "speech: Mask client identity when running the package manager call" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1517e07b5e
@@ -268,9 +268,17 @@ final class SpeechRecognitionManagerServiceImpl extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean componentMapsToRecognitionService(@NonNull ComponentName serviceComponent) {
|
private boolean componentMapsToRecognitionService(@NonNull ComponentName serviceComponent) {
|
||||||
List<ResolveInfo> resolveInfos =
|
List<ResolveInfo> resolveInfos;
|
||||||
getContext().getPackageManager().queryIntentServicesAsUser(
|
|
||||||
new Intent(RecognitionService.SERVICE_INTERFACE), 0, getUserId());
|
final long identityToken = Binder.clearCallingIdentity();
|
||||||
|
try {
|
||||||
|
resolveInfos =
|
||||||
|
getContext().getPackageManager().queryIntentServicesAsUser(
|
||||||
|
new Intent(RecognitionService.SERVICE_INTERFACE), 0, getUserId());
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(identityToken);
|
||||||
|
}
|
||||||
|
|
||||||
if (resolveInfos == null) {
|
if (resolveInfos == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user