Skip to content
Commit 78c84e15 authored by lpeter's avatar lpeter
Browse files

Follow HotwordDetector / DetectorFailure API feedback

By API Council feedback, there are two suggestions instead of
using instanceof.
(1) Use multiple methods in the callback.
(2) Use one big failure class which has a field for the failure type.

For suggestion 1, the assistant application can easy know the failure
comes from which module and take its next action in the different
callback method. Currently there are three kinds of detectors, I list
what callbacks will be used by different detectors.
(1)AlwaysOnHotwordDetector:
    onFailure(HotwordDetectionServiceFailure)
    onFailure(SoundTriggerFailure)
    onUnknownFailure(String)
(2)SoftwareHotwordDetector
    onFailure(HotwordDetectionServiceFailure)
    onUnknownFailure(String)
(3)VisualQueryDetector
    onFailure(VisualQueryDetectionServiceFailure)
    onUnknownFailure(String)

For suggestion 2, it seems that the assistant application still needs
to take the action first to know the failure comes from which module
in this one callback method.

We think that the suggestion 1 is better than suggestion 2.

Bug: 271107031
Test: atest CtsVoiceInteractionTestCases
Change-Id: I57fa93d5a0c2919ce762688f1d97766e531ccfb3
Merged-In: I57fa93d5a0c2919ce762688f1d97766e531ccfb3
parent 52cef828
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment