Update logic for determining if an USB device is a headset or not.
Update the function of calculating likelihood of being an output headset. 1. Change the function name from probability to likelihood. It is fine to have the value be negative or greater than 1.0f. 2. If there is an output terminal with type as HEADPHONES or BIDIR_HEADSET, likelihood += 0.75, goto 5. Otherwise, goto 2. 3. If there is an output terminal with type as SPEAKER, likelihood += 0.5. Goto 3. 4. If there is associated input terminal for an output terminal exists, likelihood += 0.25. Goto 4. 5. If multiple channels are supported, likelihood -= 0.25. Goto 5. 6. If there is an output terminal with type as SPEAKER, HEADPHONES or BIDIR_HEADSET and there is HID interface, likelihood += 0.25. Test: connect USB devices and check the reported device type. Bug: 231973571 Change-Id: I98e433b5333f8bb317b6ae89bd65fee2c42236eb
Loading
Please register or sign in to comment