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

Commit a23eaa77 authored by Ytai Ben-Tsvi's avatar Ytai Ben-Tsvi
Browse files

Fix bug in recovering from HAL crash

Since the SoundTriggerModule remains alive, we need to clear its state
whenever recovering from a crash. The only missing piece was resetting
mNumLoadedModels.

Change-Id: I57bb5d2337cdc34f7c233fcaebd6f0512202a8a0
Bug: 147993017
parent 83d3fb18
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -174,7 +174,17 @@ class SoundTriggerModule implements IHwBinder.DeathRecipient {
        for (Session session : mActiveSessions) {
            session.moduleDied();
        }
        reset();
    }

    /**
     * Resets the transient state of this object.
     */
    private void reset() {
        attachToHal();
        // We conservatively assume that external capture is active until explicitly told otherwise.
        mRecognitionAvailable = mProperties.concurrentCapture;
        mNumLoadedModels = 0;
    }

    /**