diff options
| author | JJ Lee <leejj@google.com> | 2019-06-26 15:42:33 +0800 |
|---|---|---|
| committer | JJ Lee <leejj@google.com> | 2019-06-26 20:33:07 +0800 |
| commit | fb9eb94899399fbbe355ebfc5d3e01a0b8e41e68 (patch) | |
| tree | cfeac64afea17ea5ebf5bcb6eaf7062d74c60897 | |
| parent | 7354bf59f74e3576c510effc26ba528d3ca9e0f4 (diff) | |
| download | android_hardware_knowles_athletico_sound_trigger_hal-fb9eb94899399fbbe355ebfc5d3e01a0b8e41e68.tar.gz android_hardware_knowles_athletico_sound_trigger_hal-fb9eb94899399fbbe355ebfc5d3e01a0b8e41e68.tar.bz2 android_hardware_knowles_athletico_sound_trigger_hal-fb9eb94899399fbbe355ebfc5d3e01a0b8e41e68.zip | |
sthal: Not use the existing handle when CHRE/Oslo unload is in progress
When previous CHRE/Oslo package destroy process is in progress,
we should not skip the new model and return the existing handle
which will be destroyed soon. Let the new model locked in
start_chre_model/start_sensor_model until the previous
destroy process complete.
Bug: 136017164
Test: Oslo/CHRE fast load/unload
Change-Id: I93cab71830952db30e69d559d46c2a426075a42e
Signed-off-by: JJ Lee <leejj@google.com>
| -rw-r--r-- | sound_trigger_hw_iaxxx.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/sound_trigger_hw_iaxxx.c b/sound_trigger_hw_iaxxx.c index 1b95bd4..ce5ff14 100644 --- a/sound_trigger_hw_iaxxx.c +++ b/sound_trigger_hw_iaxxx.c @@ -2342,11 +2342,24 @@ static int stdev_load_sound_model(const struct sound_trigger_hw_device *dev, goto exit; } - i = find_handle_for_uuid(stdev, sound_model->vendor_uuid); - if (i != -1) { - ALOGW("%s: model is existed at index %d", __func__, i); - *handle = i; - goto exit; + // When a delayed CHRE/Oslo destroy process is in progress, + // we should not skip the new model and return the existing handle + // which will be destroyed soon. + if ((check_uuid_equality(sound_model->vendor_uuid, + stdev->chre_model_uuid) && + stdev->is_chre_destroy_in_prog) || + (check_uuid_equality(sound_model->vendor_uuid, + stdev->sensor_model_uuid) && + stdev->is_sensor_destroy_in_prog)) { + ALOGD("%s: CHRE/Oslo destroy in progress, skipped handle check.", + __func__); + } else { + i = find_handle_for_uuid(stdev, sound_model->vendor_uuid); + if (i != -1) { + ALOGW("%s: model is existed at index %d", __func__, i); + *handle = i; + goto exit; + } } // Find an empty slot to load the model |
