Merge "Unable to adjust remote session volume in Sound Setting" into rvc-dev am: e5c9b113b6

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11862419

Change-Id: I98ea63c8fce726891bd60918be64ead454b13f52
This commit is contained in:
tim peng
2020-06-15 06:40:19 +00:00
committed by Automerger Merge Worker

View File

@@ -20,7 +20,6 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.media.RoutingSessionInfo; import android.media.RoutingSessionInfo;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
@@ -136,11 +135,6 @@ public class RemoteVolumeGroupController extends BasePreferenceController implem
@Override @Override
public boolean onPreferenceChange(Preference preference, Object newValue) { public boolean onPreferenceChange(Preference preference, Object newValue) {
final MediaDevice device = mLocalMediaManager.getMediaDeviceById(preference.getKey());
if (device == null) {
Log.e(TAG, "Unable to find " + preference.getKey() + " to set volume");
return false;
}
ThreadUtils.postOnBackgroundThread(() -> { ThreadUtils.postOnBackgroundThread(() -> {
mLocalMediaManager.adjustSessionVolume(preference.getKey(), (int) newValue); mLocalMediaManager.adjustSessionVolume(preference.getKey(), (int) newValue);
}); });
@@ -184,6 +178,5 @@ public class RemoteVolumeGroupController extends BasePreferenceController implem
@Override @Override
public void onSelectedDeviceStateChanged(MediaDevice device, int state) { public void onSelectedDeviceStateChanged(MediaDevice device, int state) {
} }
} }