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

Commit 57b3fe5a authored by Charles Chen's avatar Charles Chen
Browse files

Perform checking for restarting SandboxedDetectionProcesses

SandboxedDetectionServices should not be started unexpectedly if the
service is not specified. This change adds a checking to fix this.

Bug: 265535257
Test: atest CtsVoiceInteractionTestCases
Change-Id: I6143079bbf3288039246ce5f9af27164a84b0958
parent a95c39d6
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -432,9 +432,15 @@ final class HotwordDetectionConnection {
        mLastRestartInstant = Instant.now();
        mLastRestartInstant = Instant.now();
        // Recreate connection to reset the cache.
        // Recreate connection to reset the cache.


        mRemoteHotwordDetectionService = mHotwordDetectionServiceConnectionFactory.createLocked();
        if (oldHotwordConnection != null) {
            mRemoteHotwordDetectionService =
                    mHotwordDetectionServiceConnectionFactory.createLocked();
        }

        if (oldVisualQueryDetectionConnection != null) {
            mRemoteVisualQueryDetectionService =
            mRemoteVisualQueryDetectionService =
                    mVisualQueryDetectionServiceConnectionFactory.createLocked();
                    mVisualQueryDetectionServiceConnectionFactory.createLocked();
        }


        Slog.v(TAG, "Started the new process, dispatching processRestarted to detector");
        Slog.v(TAG, "Started the new process, dispatching processRestarted to detector");
        runForEachDetectorSessionLocked((session) -> {
        runForEachDetectorSessionLocked((session) -> {