Fix crash in SthalCli

SthalCli does not set all String fields of Properties, which results in
some fields being null, which causes a NullPointerExecption when the
Properties is converted to a SoundTrigger.ModuleProperties:
https://cs.android.com/android/platform/superproject/+/main:frameworks/base/core/java/android/hardware/soundtrigger/SoundTrigger.java;drc=e6ac0c57d7261d83870571c7198518998e0f1732;l=164

This CL fixes that problem by setting the uuid and model arch fields.
The uuid is set to a static randomly-generated UUID, instead of a
dynamic randomly-generated UUID, so the UUID is more easily grep-able.

Fixes: 300518031
Test: manually
Change-Id: I3746470551aed1e0e5a806195c124a70037f1baf
This commit is contained in:
Tom Bergan 2023-09-11 21:45:21 +00:00
parent b2d5075299
commit 8db0bc0131

View file

@ -289,6 +289,8 @@ public class SthalCli {
Properties properties = new Properties();
properties.implementor = "Android";
properties.description = "Mock STHAL";
properties.uuid = "a5af2d2a-4cc4-4b69-a22f-c9d5b6d492c3";
properties.supportedModelArch = "Mock arch";
properties.maxSoundModels = 2;
properties.maxKeyPhrases = 1;
properties.recognitionModes =