0

After i flashed my phone with LineageOS which is a custom rom, my equalizer got alot of UnsupportedOperationExceptions.

getStrengthSupported also returns false on custom roms but true on stock android.

For now i just disable my equalizer if i catch this exception in a try-catch.

But i was wondering if there is another way so i can also support custom roms.

if (mBassBoost.getStrengthSupported()) {
        mBassBoost.setEnabled((short) progress > 0);
        mBassBoost.setStrength((short) progress);
        Log.i(TAG, "mBassBoost StrengthSupported: "+ mBassBoost.getStrengthSupported());
}else{
        Log.e(TAG, "mBassBoost StrengthSupported: "+ mBassBoost.getStrengthSupported());
}
        mBassBoostProgress = (int)progress;
        Log.i(TAG, "BassBoost Rounded Strength: " + mBassBoost.getRoundedStrength());
Vince VD
  • 1,506
  • 17
  • 38
  • did you find it?? I am having trouble with `getStrengthSupported()' method.. it randomly returns true or false. – aguagu Dec 10 '19 at 00:48
  • @aguagu also on stock rom? – Vince VD Dec 10 '19 at 11:59
  • I found it depends on which sound output device users use. if headset is connected, and the headset supports bassboost `getStrengthSupported()` returns `true`, but otherwise. so in my case, xiaomi A2's default speaker doesn't support setting bassboost strength. but when i connected headset and created (new BassBoost instance).getStrengthSupported() returned true. – aguagu Dec 11 '19 at 02:20

0 Answers0