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

Commit 250e18c4 authored by Ajay Panicker's avatar Ajay Panicker
Browse files

Add default value to Bluetooth AVRCP version property get

When the property isn't set a crash can occur since we try to look up an
empty property value.

Bug: 36531010
Test: Open Developer options after a factory reset
Change-Id: I82c0fde00774ab1a4f3e4c44a715c74d4a7804e9
parent db66a7b6
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1789,7 +1789,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
        // Init the AVRCP Version - Default
        // Init the AVRCP Version - Default
        values = getResources().getStringArray(R.array.bluetooth_avrcp_version_values);
        values = getResources().getStringArray(R.array.bluetooth_avrcp_version_values);
        summaries = getResources().getStringArray(R.array.bluetooth_avrcp_versions);
        summaries = getResources().getStringArray(R.array.bluetooth_avrcp_versions);
        String value = SystemProperties.get(BLUETOOTH_AVRCP_VERSION_PROPERTY);
        String value = SystemProperties.get(BLUETOOTH_AVRCP_VERSION_PROPERTY, values[0]);
        index = mBluetoothSelectAvrcpVersion.findIndexOfValue(value);
        index = mBluetoothSelectAvrcpVersion.findIndexOfValue(value);
        mBluetoothSelectAvrcpVersion.setValue(values[index]);
        mBluetoothSelectAvrcpVersion.setValue(values[index]);
        mBluetoothSelectAvrcpVersion.setSummary(summaries[index]);
        mBluetoothSelectAvrcpVersion.setSummary(summaries[index]);