diff options
| author | 2020-04-14 13:18:49 -0700 | |
|---|---|---|
| committer | 2020-04-14 13:18:49 -0700 | |
| commit | 58a1c3823f86217e3da79a5958f1c35729bb372e (patch) | |
| tree | 12d96d2f8e8cd290316d648d8ad00130a2dec8ad | |
| parent | 4d38fbb4861388c6055e2ff821a0905fe3207e47 (diff) | |
Print description of loaded models in dumpsys
Bug: 154020971
Test: Manual verification of dumpsys.
Change-Id: Ibae9d41ec7470cc0ddabfe087910e1eac172f39a
| -rw-r--r-- | services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareValidation.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareValidation.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareValidation.java index 220179e218ea..bae244179346 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareValidation.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareValidation.java @@ -313,6 +313,14 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware /** State of a sound model. */ static class ModelState { + ModelState(SoundModel model) { + this.description = ObjectPrinter.print(model, true, 16); + } + + ModelState(PhraseSoundModel model) { + this.description = ObjectPrinter.print(model, true, 16); + } + /** Activity state of a sound model. */ enum Activity { /** Model is loaded, recognition is inactive. */ @@ -324,6 +332,9 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware /** Activity state. */ Activity activityState = Activity.LOADED; + /** Human-readable description of the model. */ + final String description; + /** * A map of known parameter support. A missing key means we don't know yet whether the * parameter is supported. A null value means it is known to not be supported. A non-null @@ -419,7 +430,7 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware // From here on, every exception isn't client's fault. try { int handle = mDelegate.loadModel(model); - mLoadedModels.put(handle, new ModelState()); + mLoadedModels.put(handle, new ModelState(model)); return handle; } catch (Exception e) { throw handleException(e); @@ -443,7 +454,7 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware // From here on, every exception isn't client's fault. try { int handle = mDelegate.loadPhraseModel(model); - mLoadedModels.put(handle, new ModelState()); + mLoadedModels.put(handle, new ModelState(model)); return handle; } catch (Exception e) { throw handleException(e); @@ -711,6 +722,8 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware pw.print(entry.getKey()); pw.print('\t'); pw.print(entry.getValue().activityState.name()); + pw.print('\t'); + pw.print(entry.getValue().description); pw.println(); } } else { |