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
This commit is contained in:
Ajay Panicker
2017-03-22 17:43:51 -07:00
committed by Pavlin Radoslavov
parent 07328d3983
commit bb1174de5e

View File

@@ -1794,7 +1794,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
// Init the AVRCP Version - Default
values = getResources().getStringArray(R.array.bluetooth_avrcp_version_values);
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);
mBluetoothSelectAvrcpVersion.setValue(values[index]);
mBluetoothSelectAvrcpVersion.setSummary(summaries[index]);