Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b61dddd authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: fix typo in AudioPolicyManager constructor

Fix cut/paste error in new AudioPolicyManager constructor
causing the same index variable to be reused in nested for loops.

Change-Id: Id57ff19bf6dd8974486b07c8252029e377df2747
parent 5e0e2316
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1686,10 +1686,10 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
                          mHwModules[i]->mName);
                    delete outputDesc;
                } else {
                    for (size_t i = 0; i  < outProfile->mSupportedDevices.size(); i++) {
                        audio_devices_t type = outProfile->mSupportedDevices[i]->mType;
                    for (size_t k = 0; k  < outProfile->mSupportedDevices.size(); k++) {
                        audio_devices_t type = outProfile->mSupportedDevices[k]->mType;
                        ssize_t index =
                                mAvailableOutputDevices.indexOf(outProfile->mSupportedDevices[i]);
                                mAvailableOutputDevices.indexOf(outProfile->mSupportedDevices[k]);
                        // give a valid ID to an attached device once confirmed it is reachable
                        if ((index >= 0) && (mAvailableOutputDevices[index]->mId == 0)) {
                            mAvailableOutputDevices[index]->mId = nextUniqueId();
@@ -1731,10 +1731,10 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
                                                    &inputDesc->mChannelMask);

                if (input != 0) {
                    for (size_t i = 0; i  < inProfile->mSupportedDevices.size(); i++) {
                        audio_devices_t type = inProfile->mSupportedDevices[i]->mType;
                    for (size_t k = 0; k  < inProfile->mSupportedDevices.size(); k++) {
                        audio_devices_t type = inProfile->mSupportedDevices[k]->mType;
                        ssize_t index =
                                mAvailableInputDevices.indexOf(inProfile->mSupportedDevices[i]);
                                mAvailableInputDevices.indexOf(inProfile->mSupportedDevices[k]);
                        // give a valid ID to an attached device once confirmed it is reachable
                        if ((index >= 0) && (mAvailableInputDevices[index]->mId == 0)) {
                            mAvailableInputDevices[index]->mId = nextUniqueId();