Merge "Catch IllegalStateException when updating Bluetooth A2DP codec info" am: ad62fd52c9
am: 14eb8cfe57
Change-Id: Ie5f7b5157a6034ec7a206758b19cd51e3713fc12
This commit is contained in:
@@ -1825,6 +1825,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
BluetoothCodecConfig[] codecsLocalCapabilities = null;
|
BluetoothCodecConfig[] codecsLocalCapabilities = null;
|
||||||
BluetoothCodecConfig[] codecsSelectableCapabilities = null;
|
BluetoothCodecConfig[] codecsSelectableCapabilities = null;
|
||||||
String streaming;
|
String streaming;
|
||||||
|
Resources resources = null;
|
||||||
|
|
||||||
synchronized (mBluetoothA2dpLock) {
|
synchronized (mBluetoothA2dpLock) {
|
||||||
if (mBluetoothA2dp != null) {
|
if (mBluetoothA2dp != null) {
|
||||||
@@ -1839,6 +1840,15 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
if (codecConfig == null)
|
if (codecConfig == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
resources = getResources();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (resources == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Update the Codec Type
|
// Update the Codec Type
|
||||||
index = -1;
|
index = -1;
|
||||||
switch (codecConfig.getCodecType()) {
|
switch (codecConfig.getCodecType()) {
|
||||||
@@ -1862,8 +1872,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
summaries = getResources().getStringArray(R.array.bluetooth_a2dp_codec_summaries);
|
summaries = resources.getStringArray(R.array.bluetooth_a2dp_codec_summaries);
|
||||||
streaming = getResources().getString(R.string.bluetooth_select_a2dp_codec_streaming_label, summaries[index]);
|
streaming = resources.getString(R.string.bluetooth_select_a2dp_codec_streaming_label, summaries[index]);
|
||||||
mBluetoothSelectA2dpCodec.setSummary(streaming);
|
mBluetoothSelectA2dpCodec.setSummary(streaming);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1889,8 +1899,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
summaries = getResources().getStringArray(R.array.bluetooth_a2dp_codec_sample_rate_summaries);
|
summaries = resources.getStringArray(R.array.bluetooth_a2dp_codec_sample_rate_summaries);
|
||||||
streaming = getResources().getString(R.string.bluetooth_select_a2dp_codec_streaming_label, summaries[index]);
|
streaming = resources.getString(R.string.bluetooth_select_a2dp_codec_streaming_label, summaries[index]);
|
||||||
mBluetoothSelectA2dpSampleRate.setSummary(streaming);
|
mBluetoothSelectA2dpSampleRate.setSummary(streaming);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1911,8 +1921,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
summaries = getResources().getStringArray(R.array.bluetooth_a2dp_codec_bits_per_sample_summaries);
|
summaries = resources.getStringArray(R.array.bluetooth_a2dp_codec_bits_per_sample_summaries);
|
||||||
streaming = getResources().getString(R.string.bluetooth_select_a2dp_codec_streaming_label, summaries[index]);
|
streaming = resources.getString(R.string.bluetooth_select_a2dp_codec_streaming_label, summaries[index]);
|
||||||
mBluetoothSelectA2dpBitsPerSample.setSummary(streaming);
|
mBluetoothSelectA2dpBitsPerSample.setSummary(streaming);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1930,8 +1940,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
summaries = getResources().getStringArray(R.array.bluetooth_a2dp_codec_channel_mode_summaries);
|
summaries = resources.getStringArray(R.array.bluetooth_a2dp_codec_channel_mode_summaries);
|
||||||
streaming = getResources().getString(R.string.bluetooth_select_a2dp_codec_streaming_label, summaries[index]);
|
streaming = resources.getString(R.string.bluetooth_select_a2dp_codec_streaming_label, summaries[index]);
|
||||||
mBluetoothSelectA2dpChannelMode.setSummary(streaming);
|
mBluetoothSelectA2dpChannelMode.setSummary(streaming);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1956,8 +1966,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
summaries = getResources().getStringArray(R.array.bluetooth_a2dp_codec_ldac_playback_quality_summaries);
|
summaries = resources.getStringArray(R.array.bluetooth_a2dp_codec_ldac_playback_quality_summaries);
|
||||||
streaming = getResources().getString(R.string.bluetooth_select_a2dp_codec_streaming_label, summaries[index]);
|
streaming = resources.getString(R.string.bluetooth_select_a2dp_codec_streaming_label, summaries[index]);
|
||||||
mBluetoothSelectA2dpLdacPlaybackQuality.setSummary(streaming);
|
mBluetoothSelectA2dpLdacPlaybackQuality.setSummary(streaming);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user