Unable to adjust remote session volume in Sound Setting
-It is incorrect to compare the device ID with session ID
-The preference key is the session ID and we should adjust remote session volume by it
Fix: 158956140
Test: make -j42 RunSettingsRoboTests
Change-Id: Ia815b7bfdf6d7e44aca9832f11371669e973d363
diff --git a/src/com/android/settings/notification/RemoteVolumeGroupController.java b/src/com/android/settings/notification/RemoteVolumeGroupController.java
index 4b045e2..6d3c96d 100644
--- a/src/com/android/settings/notification/RemoteVolumeGroupController.java
+++ b/src/com/android/settings/notification/RemoteVolumeGroupController.java
@@ -20,7 +20,6 @@
import android.content.Intent;
import android.media.RoutingSessionInfo;
import android.text.TextUtils;
-import android.util.Log;
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
@@ -136,11 +135,6 @@
@Override
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(() -> {
mLocalMediaManager.adjustSessionVolume(preference.getKey(), (int) newValue);
});
@@ -184,6 +178,5 @@
@Override
public void onSelectedDeviceStateChanged(MediaDevice device, int state) {
-
}
}