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

Commit 153570fb authored by Felix Oghina's avatar Felix Oghina Committed by Automerger Merge Worker
Browse files

Merge "[speech] unbind from recognition service" into udc-qpr-dev am: 1dc216fe

parents e0799b44 1dc216fe
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
@@ -206,22 +206,16 @@ final class RemoteSpeechRecognitionService extends ServiceConnector.Impl<IRecogn
        synchronized (mLock) {
            ClientState clientState = mClients.get(listener.asBinder());

            if (clientState == null) {
                if (DEBUG) {
                    Slog.w(TAG, "#cancel called with no preceding #startListening - ignoring.");
                }
                return;
            }
            if (clientState != null) {
                clientState.mRecordingInProgress = false;

            // Temporary reference to allow for resetting the hard link mDelegatingListener to null.
                // Temporary reference to allow for resetting mDelegatingListener to null.
                final IRecognitionListener delegatingListener = clientState.mDelegatingListener;
                run(service -> service.cancel(delegatingListener, isShutdown));
            }

            // If shutdown, remove the client info from the map. Unbind if that was the last client.
            if (isShutdown) {
                removeClient(listener);

                if (mClients.isEmpty()) {
                    if (DEBUG) {
                        Slog.d(TAG, "Unbinding from the recognition service.");