diff options
| author | 2020-12-16 00:48:06 -0800 | |
|---|---|---|
| committer | 2020-12-16 16:58:35 +0000 | |
| commit | c962a1acd6bccab27f1268b38468c0d9b67542bb (patch) | |
| tree | 3a0c93a9c20f1521e9e7d4875da7568ddd96eac7 | |
| parent | 83352bf4e13b78acee4e177a4b48f4738d903e5b (diff) | |
Don't change the voice interactor setting if it's explicitly unset.
Test: manual (currently requires hardcoding the assistant role due to b/175747251)
Test: atest CtsAssistTestCases CtsVoiceInteractionTestCases CtsVoiceSettingsTestCases
Bug: 167261484
Change-Id: Ibc2c1675f8b026f2915c3faf55e8ff3c52e1ee32
| -rw-r--r-- | services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java index b5bb2a81a1cd..ec371bf31160 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java @@ -420,8 +420,9 @@ public class VoiceInteractionManagerService extends SystemService { + interactorInfo + ")"); } - // Initializing settings, look for an interactor first (but only on non-svelte). - if (curInteractorInfo == null && mEnableService) { + // Initializing settings. Look for an interactor first, but only on non-svelte and only + // if the user hasn't explicitly unset it. + if (curInteractorInfo == null && mEnableService && !"".equals(curInteractorStr)) { curInteractorInfo = findAvailInteractor(userHandle, null); } @@ -1751,8 +1752,13 @@ public class VoiceInteractionManagerService extends SystemService { if (isPackageAppearing(pkgName) != PACKAGE_UNCHANGED) { return; } + final String curInteractorStr = Settings.Secure.getStringForUser( + mContext.getContentResolver(), + Settings.Secure.VOICE_INTERACTION_SERVICE, mCurUser); final ComponentName curInteractor = getCurInteractor(mCurUser); - if (curInteractor == null) { + // If there's no interactor and the user hasn't explicitly unset it, check if the + // modified package offers one. + if (curInteractor == null && !"".equals(curInteractorStr)) { final VoiceInteractionServiceInfo availInteractorInfo = findAvailInteractor(mCurUser, pkgName); if (availInteractorInfo != null) { |