summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author MingWei Liao <mingweiliao@google.com> 2024-05-31 13:54:31 +0000
committer MingWei Liao <mingweiliao@google.com> 2024-05-31 16:12:27 +0000
commitf244554df4c57f4aec8cf3c89cafef374d91aab6 (patch)
treecc9701b15961b5c50bcce2c3548972283c6eac75
parent66199e322d94d38677b967e8a95d7c76546f7f6d (diff)
Revert "Validate the VoiceInteractionService before rebind"
This reverts commit aa1b372570be89484e7fdb33f98f121fd232189f. Reason for revert: Side-effect: b/343854218 Change-Id: If67f2bc32097c37f66695416005baaffee8059f3
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java26
1 files changed, 3 insertions, 23 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
index a7dbecbb5255..1d014201cf46 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
@@ -794,8 +794,9 @@ public class VoiceInteractionManagerService extends SystemService {
if (curService != null && !curService.isEmpty()) {
try {
serviceComponent = ComponentName.unflattenFromString(curService);
- serviceInfo = getValidVoiceInteractionServiceInfo(serviceComponent);
- } catch (RuntimeException e) {
+ serviceInfo = AppGlobals.getPackageManager()
+ .getServiceInfo(serviceComponent, 0, mCurUser);
+ } catch (RuntimeException | RemoteException e) {
Slog.wtf(TAG, "Bad voice interaction service name " + curService, e);
serviceComponent = null;
serviceInfo = null;
@@ -833,27 +834,6 @@ public class VoiceInteractionManagerService extends SystemService {
}
}
- @Nullable
- private ServiceInfo getValidVoiceInteractionServiceInfo(
- @Nullable ComponentName serviceComponent) {
- if (serviceComponent == null) {
- return null;
- }
- List<ResolveInfo> services = queryInteractorServices(
- mCurUser, serviceComponent.getPackageName());
- for (int i = 0; i < services.size(); i++) {
- ResolveInfo service = services.get(i);
- VoiceInteractionServiceInfo info = new VoiceInteractionServiceInfo(
- mContext.getPackageManager(), service.serviceInfo);
- ServiceInfo candidateInfo = info.getServiceInfo();
- if (candidateInfo != null
- && candidateInfo.getComponentName().equals(serviceComponent)) {
- return candidateInfo;
- }
- }
- return null;
- }
-
private List<ResolveInfo> queryInteractorServices(
@UserIdInt int user,
@Nullable String packageName) {