AudioService: optimize vol change logs

  When logging the previous volume index for the
AudioService events and media.metrics, obtaining
the current volume index (in getStreamVolume() for
the logging) before it is changed requires finding
the current device for that stream type.
  This is repeated again when changing the volume.

This change queries the device at logging time,
but then passes it to the next internal method.
Doing so requires differentiating the code path
that is used for setStreamVolume, and setDeviceVolume,
which was previously done by checking if the passed
device was null or not. This is replaced by a boolean,
the "canChangeMuteAndUpdateController" parameter.

Bug: 239091512
Test: adb shell dumpsys audio | grep -A 50  "volume changes"
Test: adb shell dumpsys media.metrics
Change-Id: Ifd0a7dfafb044f2591fcc2d8ecdb6de998582584
2 files changed