diff options
| author | 2025-03-13 16:38:15 -0700 | |
|---|---|---|
| committer | 2025-03-13 16:38:15 -0700 | |
| commit | eb40419ec3562a0a3b70899a68baaf3d6c99b1a8 (patch) | |
| tree | 8ee0b927e533a6ca80061299fa2db35f91b9b13a | |
| parent | f0d0580b5923f1b6023cc3981ab2d8f466515719 (diff) | |
| parent | 080f5a115cfd2ce1110cf04efe73ff50bb1a58d9 (diff) | |
Merge "[vims] better handle assistant force stop" into udc-qpr-dev
| -rw-r--r-- | services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java | 24 |
1 files changed, 1 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 0de9255e5822..98cc1dab1601 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java @@ -2377,8 +2377,7 @@ public class VoiceInteractionManagerService extends SystemService { } } if (hitInt && doit) { - // The user is force stopping our current interactor. - // Clear the current settings and restore default state. + // The user is force stopping our current interactor, restart the service. synchronized (VoiceInteractionManagerServiceStub.this) { Slog.i(TAG, "Force stopping current voice interactor: " + getCurInteractor(userHandle)); @@ -2387,28 +2386,7 @@ public class VoiceInteractionManagerService extends SystemService { mImpl.shutdownLocked(); setImplLocked(null); } - - setCurInteractor(null, userHandle); - // TODO: should not reset null here. But even remove this line, the - // initForUser() still reset it because the interactor will be null. Keep - // it now but we should still need to fix it. - setCurRecognizer(null, userHandle); - resetCurAssistant(userHandle); - initForUser(userHandle); switchImplementationIfNeededLocked(true); - - // When resetting the interactor, the recognizer and the assistant settings - // value, we also need to reset the assistant role to keep the values - // consistent. Clear the assistant role will reset to the default value. - Context context = getContext(); - context.getSystemService(RoleManager.class).clearRoleHoldersAsUser( - RoleManager.ROLE_ASSISTANT, 0, UserHandle.of(userHandle), - context.getMainExecutor(), successful -> { - if (!successful) { - Slog.e(TAG, - "Failed to clear default assistant for force stop"); - } - }); } } else if (hitRec && doit) { // We are just force-stopping the current recognizer, which is not |