audio: Provide operations common to input and output streams am: e9f10fc9dc am: 66b60e7f79 am: e1570b3ff6

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2256002

Change-Id: Ia68482b7645dfaad3aa4a71f2b395ab97fad0856
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>