Notification of playback activity

AudioService keeps track of status of implementations of PlayerBase.
AudioService's PlaybackActivityMonitor maintains a list of
  playback configurations for each PlayerBase, and a list
  of clients that want to receive updates about the playback.
Playback activity clients can query the playback configuration
  of the system through AudioManager, or register a callback
  for updates. For clients with MODIFY_AUDIO_ROUTING permission
  (system), the playback configurations contain more information
  about each player (player type, uid, pid, state), and can see
  all players, not just the "active" ones. The act of stripping
  off data about the players that is not supposed to be seen
  by non-system clients, is referred to as "anonymization". It
  is implemented in system server, so no system data is ever
  sent to playback activity clients without system permission.
More information about the AudioPlaybackConfiguration is
  available in the SystemApi (uid, pid, player type, player state).

Test: run cts -m CtsMediaTestCases -t android.media.cts.AudioPlaybackConfigurationTest
Bug: 30955183

Change-Id: I85997594c0378216419f5f0fdaa0714996fd3573
19 files changed