Add remote volume slider to sound settings

1. Add RemoteVolumePreferenceController to control volume through
MediaSessions.
2. Add related preference to skip calling AudioManager.

Bug: 126199571
Test: RunSettingsRoboTests
Change-Id: I9cb85ccf5f49be6d127cb61caf445b2ee7dfb579
This commit is contained in:
jackqdyulei
2019-02-27 10:05:56 -08:00
parent 3329ead489
commit f25c9b0efc
8 changed files with 324 additions and 4 deletions

View File

@@ -40,8 +40,8 @@ import java.util.Objects;
public class VolumeSeekBarPreference extends SeekBarPreference {
private static final String TAG = "VolumeSeekBarPreference";
protected SeekBar mSeekBar;
private int mStream;
private SeekBar mSeekBar;
private SeekBarVolumizer mVolumizer;
private Callback mCallback;
private ImageView mIconView;
@@ -121,7 +121,7 @@ public class VolumeSeekBarPreference extends SeekBarPreference {
init();
}
private void init() {
protected void init() {
if (mSeekBar == null) return;
final SeekBarVolumizer.Callback sbvc = new SeekBarVolumizer.Callback() {
@Override
@@ -158,7 +158,7 @@ public class VolumeSeekBarPreference extends SeekBarPreference {
}
}
private void updateIconView() {
protected void updateIconView() {
if (mIconView == null) return;
if (mIconResId != 0) {
mIconView.setImageResource(mIconResId);
@@ -195,7 +195,7 @@ public class VolumeSeekBarPreference extends SeekBarPreference {
updateSuppressionText();
}
private void updateSuppressionText() {
protected void updateSuppressionText() {
if (mSuppressionTextView != null && mSeekBar != null) {
mSuppressionTextView.setText(mSuppressionText);
final boolean showSuppression = !TextUtils.isEmpty(mSuppressionText);