Merge "PAL: set device rotation with parameters"
diff --git a/session/src/SessionAlsaUtils.cpp b/session/src/SessionAlsaUtils.cpp
index ce1fc9d..8118ead 100644
--- a/session/src/SessionAlsaUtils.cpp
+++ b/session/src/SessionAlsaUtils.cpp
@@ -2313,6 +2313,7 @@
if (strcmp(dAttr.custom_config.custom_key, "mspp") &&
dAttr.id == PAL_DEVICE_OUT_SPEAKER &&
+ dAttr.config.ch_info.channels == 2 &&
((sAttr.type == PAL_STREAM_LOW_LATENCY) ||
(sAttr.type == PAL_STREAM_ULTRA_LOW_LATENCY) ||
(sAttr.type == PAL_STREAM_PCM_OFFLOAD) ||
@@ -2321,9 +2322,7 @@
pal_param_device_rotation_t rotation;
rotation.rotation_type = rm->mOrientation == ORIENTATION_270 ?
PAL_SPEAKER_ROTATION_RL : PAL_SPEAKER_ROTATION_LR;
- status = sess->handleDeviceRotation(streamHandle, rotation.rotation_type,
- pcmDevIds.at(0), mixerHandle, builder,
- aifBackEndsToConnect);
+ status = sess->setParameters(streamHandle, 0, PAL_PARAM_ID_DEVICE_ROTATION, &rotation);
if (status != 0) {
PAL_ERR(LOG_TAG,"handleDeviceRotation failed");
status = 0; //rotaton setting failed is not fatal.