diff options
author | Ahaan Ugale <augale@google.com> | 2020-12-16 00:48:06 -0800 |
---|---|---|
committer | Ahaan Ugale <augale@google.com> | 2020-12-16 17:01:42 +0000 |
commit | 1c475a4b439330adf142f502072455ccc40db0ae (patch) | |
tree | 382b85828d18a4add4c74a1093680c5e36130b99 /services/voiceinteraction | |
parent | 5c2d5cda50f1693dacd7bff1a6051f0ef549ab97 (diff) |
Don't change the voice interactor setting if it's explicitly unset.
Test: manual
Test: atest CtsAssistTestCases CtsVoiceInteractionTestCases CtsVoiceSettingsTestCases
Fix: 167261484
Change-Id: Ibc2c1675f8b026f2915c3faf55e8ff3c52e1ee32
Merged-In: Ibc2c1675f8b026f2915c3faf55e8ff3c52e1ee32
Diffstat (limited to 'services/voiceinteraction')
-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 9621f68f9d6c..0abab087b6d8 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java @@ -395,8 +395,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); } @@ -1692,8 +1693,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) { |