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

Commit 50bbb66d authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Fix a regression in assist when context is disabled

Fixes: 28293783
 CTS: DisableContextTest#testContextAndScreenshotOff failure

When assist context is disabled, make sure that the handleAssist() is
still called with no data.

Change-Id: I569dd9f6de503e62fb04c590214df0f2ce3aa4f3
parent d67a1ca4
Loading
Loading
Loading
Loading
+20 −12
Original line number Diff line number Diff line
@@ -370,6 +370,13 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
        }
        if (mHaveAssistData) {
            AssistDataForActivity assistData;
            if (mAssistData.isEmpty()) {
                // We're not actually going to get any data, deliver some nothing
                try {
                    mSession.handleAssist(null, null, null, 0, 0);
                } catch (RemoteException e) {
                }
            } else {
                while (!mAssistData.isEmpty()) {
                    if (mPendingAssistDataCount <= 0) {
                        Slog.e(TAG, "mPendingAssistDataCount is " + mPendingAssistDataCount);
@@ -386,6 +393,7 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
                        deliverSessionDataLocked(assistData);
                    }
                }
            }
            if (mPendingAssistDataCount <= 0) {
                mHaveAssistData = false;
            } // else, more to come