Apply RichInputRangeBuilder

-Add volume control
-Add test case

Bug: 146813957
Test: make -j42 RunSettingsRoboTests
Change-Id: I250b8447ed133212b6325eff5122ca39069c99d9
This commit is contained in:
timhypeng
2020-02-03 13:47:30 +08:00
parent 07c1cdb77e
commit 6fc2f84a4e
3 changed files with 67 additions and 10 deletions

View File

@@ -146,6 +146,19 @@ public class MediaDeviceUpdateWorker extends SliceBackgroundWorker
return mTopDevice;
}
/**
* Request to set volume.
*
* @param device for the targeted device.
* @param volume for the new value.
*
*/
public void adjustVolume(MediaDevice device, int volume) {
ThreadUtils.postOnBackgroundThread(() -> {
device.requestSetVolume(volume);
});
}
private class DevicesChangedBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {