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
Loading
Please register or sign in to comment