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

Commit a1422149 authored by Shunkai Yao's avatar Shunkai Yao
Browse files

Use getParameter return value for the preset length

as per documented by AudioEffect.getParameter return value

Flag: EXEMPT bugfix
Bug: 372771511
Test: atest CtsSecurityTestCases:android.security.cts.EffectBundleTest
Change-Id: Ia14d57a7a8818f1b9c4a2884bb8da120658d8441
Merged-In: Ia14d57a7a8818f1b9c4a2884bb8da120658d8441
parent b1071dc6
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -153,9 +153,8 @@ public class Equalizer extends AudioEffect {
            param[0] = PARAM_GET_PRESET_NAME;
            for (int i = 0; i < mNumPresets; i++) {
                param[1] = i;
                checkStatus(getParameter(param, value));
                int length = 0;
                while (value[length] != 0) length++;
                final int length = getParameter(param, value);
                checkStatus(length);
                try {
                    mPresetNames[i] = new String(value, 0, length, "ISO-8859-1");
                } catch (java.io.UnsupportedEncodingException e) {