Check Null-safeness when switching optional-codecs state
When checking the codecs type (if it was SBC or not), there's
a chance that they'll throw an NPE and fails to either raise
or lowering the SBC priority.
Bug:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothCodecConfig.isMandatoryCodec()' on a null object reference
at com.android.bluetooth.a2dp.A2dpCodecConfig.enableOptionalCodecs(A2dpCodecConfig.java:108)
....
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothCodecConfig.isMandatoryCodec()' on a null object reference
at com.android.bluetooth.a2dp.A2dpCodecConfig.disableOptionalCodecs(A2dpCodecConfig.java:129)
....
Signed-off-by: Nauval Rizky <enuma.alrizky@gmail.com>
Signed-off-by: spezi77 <spezi7713@gmx.net>
1 file changed