Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de203c37 authored by Ahaan Ugale's avatar Ahaan Ugale
Browse files

VIMS: Decouple recognizer init from interactor in PackageMonitor.

On package modification, set the recognizer independently of the
interactor.
This will allow keeping the default recognizer provider a different
package from the interactor.
There should be no change to how the interactor is set.

Bug: 167597525
Test: manual
Test: atest CtsVoiceInteractionTestCases
Change-Id: Ib24f077365cbb0850c61196c2825737db1c1c090
parent 50cabe92
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -1787,6 +1787,9 @@ public class VoiceInteractionManagerService extends SystemService {
                if (isPackageAppearing(pkgName) != PACKAGE_UNCHANGED) {
                    return;
                }
                if (getCurRecognizer(mCurUser) == null) {
                    initRecognizer(mCurUser);
                }
                final String curInteractorStr = Settings.Secure.getStringForUser(
                        mContext.getContentResolver(),
                        Settings.Secure.VOICE_INTERACTION_SERVICE, mCurUser);
@@ -1801,12 +1804,6 @@ public class VoiceInteractionManagerService extends SystemService {
                                availInteractorInfo.getServiceInfo().packageName,
                                availInteractorInfo.getServiceInfo().name);
                        setCurInteractor(availInteractor, mCurUser);
                        if (getCurRecognizer(mCurUser) == null &&
                                availInteractorInfo.getRecognitionService() != null) {
                            setCurRecognizer(new ComponentName(
                                    availInteractorInfo.getServiceInfo().packageName,
                                    availInteractorInfo.getRecognitionService()), mCurUser);
                        }
                    }
                } else {
                    if (didSomePackagesChange()) {