Support collaborative audio focus handling

Add new flag for an app to define it doesn't duck, but rather
  pauses when losing focus with AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK.
  This flag is to be used when requesting focus.
Add support for AudioPolicy to specify whether it will implement
  ducking itself, rather than it being handled by an app.
When ducking is handled by a policy, do not notify focus owners
  when they lose audio focus with LOSS_TRANSIENT_CAN_DUCK, unless
  they would have paused, as expressed with the
  AUDIOFOCUS_FLAG_PAUSES_ON_DUCKABLE_LOSS flag.
Add a focus listener for a policy to be notified of focus changes
  so it can properly implement its own ducking.

Bug 16010554

Change-Id: I11d7cdb85c52fd086128a44f4d938aaa44db5c25
11 files changed