From 8db0bc013112a463db31f3c50a78a4ff347b7830 Mon Sep 17 00:00:00 2001 From: Tom Bergan Date: Mon, 11 Sep 2023 21:45:21 +0000 Subject: [PATCH] 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 --- .../cli/java/android/hardware/soundtrigger3/cli/SthalCli.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java b/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java index 127f0629ff..41e25336c0 100644 --- a/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java +++ b/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java @@ -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 =