diff options
author | Ahaan Ugale <augale@google.com> | 2020-12-18 08:01:48 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-12-18 08:01:48 +0000 |
commit | aba4253cde4f3c885156e44dd15bb7a3c5194b0b (patch) | |
tree | 783d79e2dd41d8a772c770eae798a713933deea0 | |
parent | 22bf2895bb4d309b4e69e30ebbf4db8ad52a1614 (diff) | |
parent | 8b6f7f10f03e1cda85eb0ba4c22a003635f006c8 (diff) |
Merge "Don't change the voice interactor setting if it's explicitly unset." into rvc-qpr-dev am: 8b6f7f10f0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13234020
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I03779bf004129f03424e6f9af8d75c782965345b
-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) { |