Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 36 additions & 34 deletions dsmgr/dsMgrPwrEventListener.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in dsmgr/dsMgrPwrEventListener.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'ISC' license found in local file 'dsmgr/dsMgrPwrEventListener.c' (Match: rdk/components/generic/iarmmgrs/rdk/components/generic/iarmmgrs/7ff5a0a, 36 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/iarmmgrs/+archive/7ff5a0ad8fb159162bf6e99581c884a2ea97cecb.tar.gz, file: dsmgr/dsMgr.c)
*
* Copyright 2021 RDK Management
*
Expand Down Expand Up @@ -345,21 +345,23 @@
dsAudioPortEnabledParam_t setMode;
int numPorts, i = 0;

numPorts = dsUTL_DIM(kSupportedPortTypes);
device::List<device::AudioOutputPort> aPorts = device::Host::getInstance().getAudioOutputPorts();
numPorts = aPorts.size();
INT_INFO("[%s] Number of Audio Ports: [%d] \r\n", __FUNCTION__, numPorts);
for (i = 0; i < numPorts; i++)
{
const dsAudioPortType_t *audioPort = &kSupportedPortTypes[i];
device::AudioOutputPort aPort = device::Host::getInstance().getAudioOutputPort(*audioPort);
memset(&getHandle, 0, sizeof(getHandle));
getHandle.type = *audioPort;
getHandle.index = 0;
_dsGetAudioPort(&getHandle);

memset(&setMode, 0, sizeof(setMode));
setMode.handle = getHandle.handle;
strncpy(setMode.portName, aPort.getName().c_str(), 32);
setMode.enabled = false;
_dsEnableAudioPort(&setMode);
try
{
INT_INFO("[%s] Current Index [%d] \r\n", __FUNCTION__, i);
device::AudioOutputPort aPort = aPorts.at(i);

INT_INFO("[%s] Audio Port Name: [%s] \r\n", __FUNCTION__, aPort.getName().c_str());
aPort.disable();
}
catch (...)
{
INT_DEBUG("[%s] audio port exception at %d\r\n", __FUNCTION__,i);
}
}
}
catch (...)
Expand All @@ -369,7 +371,6 @@
}
else
{

try
{
device::List<device::VideoOutputPort> videoPorts = device::Host::getInstance().getVideoOutputPorts();
Expand All @@ -383,28 +384,29 @@

int numPorts, i = 0;

numPorts = dsUTL_DIM(kSupportedPortTypes);
device::List<device::AudioOutputPort> aPorts = device::Host::getInstance().getAudioOutputPorts();
numPorts = aPorts.size();
INT_INFO("[%s] numPorts [%d] \r\n", __FUNCTION__, numPorts);
for (i = 0; i < numPorts; i++)
{
const dsAudioPortType_t *audioPort = &kSupportedPortTypes[i];
device::AudioOutputPort aPort = device::Host::getInstance().getAudioOutputPort(*audioPort);
memset(&getHandle, 0, sizeof(getHandle));
getHandle.type = *audioPort;
getHandle.index = 0;
_dsGetAudioPort(&getHandle);

memset(&setMode, 0, sizeof(setMode));
setMode.handle = getHandle.handle;
strncpy(setMode.portName, aPort.getName().c_str(), 32);
setMode.enabled = false;
_dsGetEnablePersist(&setMode);

if (setMode.enabled == true)
try
{
INT_INFO("[%s] Current Index [%d] \r\n", __FUNCTION__, i);
device::AudioOutputPort aPort = aPorts.at(i);
bool isEnablePersist = aPort.getEnablePersist();
INT_INFO("[%s] Audio Port Name: [%s] isEnablePersist[%d]\r\n", __FUNCTION__, aPort.getName().c_str(), isEnablePersist);

if (isEnablePersist)
{
/*Instead of enabling all the audio ports on power transition */
/*Get the values from persistent storage & update */
INT_INFO("[%s] Enabling audio ports %d \r\n", __FUNCTION__, powerState);
aPort.enable();
}
}
catch (...)
{
/*Instead of enabling all the audio ports on power transition */
/*Get the values from persistent storage & update */
INT_INFO("[%s] Enabling audio ports %d \r\n", __FUNCTION__, powerState);
_dsEnableAudioPort(&setMode);
INT_DEBUG("[%s] Audio port exception at %d \r\n",__FUNCTION__, i);
}
}
if (isEAS == IARM_BUS_SYS_MODE_EAS)
Expand All @@ -418,14 +420,14 @@
{
INT_DEBUG("[%s] Audio port exception \r\n",__FUNCTION__);
}

}
}
catch (...)
{
INT_DEBUG("Exception Caught during [%s]\r\n", __FUNCTION__);
return 0;
}
INT_DEBUG("Exiting [%s]\r\n", __FUNCTION__);
return 0;
}

Expand Down
Loading