Prevent dumping sound models when max reached
There are currently cases when SoundTriggerHelper may get out of sync
with SoundTriggerHwService, specifically which and how many sound models
are loaded.
If SoundTriggerHelper attempts to load a sound model and it would be
exceeding the maximum allowable number of sound models:
1) If the new sound model is not a KeyphraseSoundModel:
Throw an error
2) If the new sound model is a KeyphraseSoundModel:
See if there is an existing KeyphraseSoundModel to unload
Failing that, unload the first SoundModel in the index
BUG: 27225762
BUG: 22860713
Change-Id: I74db1be36bbc5887f5bf4751c3138de102976722
1 file changed