Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 89d0c849 authored by jiabin's avatar jiabin
Browse files

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
parent f749b885
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