Allow --user parameter for audio service commands.

This allows testing on secondary users.

Change similar to ag/7022195 and ag/6936694.

Fixes: 139301368
Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioRecordTest#testRecordNoDataForIdleUids

and ...
$ adb install testcases/CtsMediaTestCases.apk
Success
$ adb shell cmd media.audio_policy set-uid-state android.media.cts active
$ adb shell cmd media.audio_policy get-uid-state android.media.cts --user 0
active
$ adb shell cmd media.audio_policy get-uid-state android.media.cts --user 10
idle
$ adb shell cmd media.audio_policy set-uid-state android.media.cts --user 10 active
$ adb shell cmd media.audio_policy get-uid-state android.media.cts --user 10
idle
$ adb shell cmd media.audio_policy set-uid-state android.media.cts active --user 10
$ adb shell cmd media.audio_policy get-uid-state android.media.cts --user 10
active
$ adb shell cmd media.audio_policy set-uid-state android.media.cts idle --user 0
$ adb shell cmd media.audio_policy get-uid-state android.media.cts --user 0
idle
$ adb shell cmd media.audio_policy reset-uid-state android.media.cts --user 10
$ adb shell cmd media.audio_policy get-uid-state android.media.cts --user 10
idle

Change-Id: I17774efa6aca7c9b9d0af9bf9c1e75474e90d990
(cherry picked from commit be066e1a9aa613f4e7e56fbd16b35d8ad377b68f)
1 file changed