cad-pulse: stop tracking the "default" port
Tracking the default port (which is actually the non-speaker active output port) can be tedious and prone to errors. Instead of trying to track which port was in use when we switched to speaker, we can simply check, when it's time to switch back, which available port has higher priority and use this one. This will also help solve corner cases: switch to call mode (earpiece), enable speaker, plug in headphones, then disable speaker: the current code will automatically switch back to headphones instead of the earpiece, which sounds like the good thing to do in that case.
Showing with 22 additions and 24 deletions