policy: Offload enhancements

 * Port changes from audio-caf to the generic HAL to bring
   support for these features to more devices.

Change-Id: I74ff10dd7574498654d4771a74285e0875dd8580
audio: Fix to update devices for all non-primary outputs

-Incorrect routing is observed, after call disconnection, due to
 devices not being updated for non-primary outputs.
-Update devices for non-primary outputs as well.

Change-Id: I424f980e3a26f57e7655b5fd10bb54e73cca3a57
CRs-Fixed: 592604
audio: update srcOutputs based on current outputs

- Issue: Direct outputs are also opened to query
  for dynamic parameters in checkOutputsForDevice
  and will be closed later by setDeviceConnectionState.
  There is a mismatch between srcOutputs and dstOutputs
  in checkOutputForStrategy which results in a temp
  mute while moving tracks from one output to another
- Fix this issue by updating srcOutputs based on mOutputs
  instead of mPreviousOutputs

Change-Id: Ie716e33606985ae93f31abbf8aac506c935840db
CRs-Fixed: 591339
audio: primary desc check for sonification

- Audio glitches on alarm expiry if alarm starts
  on screen lock/standby mode

- On alarm expiry alarm tone will start play on combo device
  &screen unlock tone try to play on headset which results
  multiple device switch, as a result audio glitches are audible

- If sonfication strategy is used by primary desc , we will
  treat all non music streams with sonfication stragey which
  will avoid device switch

Change-Id: Id7d8dfa75f8d881549d57f01e3bb1025135d4b2c
CRs-Fixed: 514467
CRs-Fixed: 657274
uevent: Allow multiple uevent listeners from the same process

The netlink socket created by uevent_init sets the nl_pid to the
current PID. nl_pid must be unique per-process, however it does not
have to do with the PID. From the documentation:

"
For a user-space process, nl_pid
is usually the PID of the process owning the destination socket.
However, nl_pid identifies a netlink socket, not a process.  If a
process owns several netlink sockets, then nl_pid can be equal to the
process ID only for at most one socket.
"

In use cases where a single process calls uevent_init more than one
time, the second one will always fail. This patch sets the nl_pid
to 0, which lets the kernel pick its own unique identifier as per the
documentation:

"
If the application sets it to 0, the kernel takes
care of assigning it.  The kernel assigns the process ID to the first
netlink socket the process opens and assigns a unique nl_pid to every
netlink socket that the process subsequently creates.
"

The behavior stays the same for the first socket but will also succeed
in subsequent calls.

Change-Id: I6fa74adc9d5835ff39b86187799998111fc12001