Moved the Bluetooth-related default config init within onCreate()

This should avoid potential crashes in case somehow onCreateView() is
called without onCreate() being called first.

Test: Manual UI interaction with Developer Settings
Bug: 34192829
Change-Id: Iaf46d05f30d20f98727c4dbfb91feef8509c92f7
This commit is contained in:
Pavlin Radoslavov
2017-01-10 15:40:13 -08:00
committed by Andre Eisenbach
parent f952a87060
commit 0a63e8b768

View File

@@ -475,6 +475,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
mBluetoothSelectA2dpBitsPerSample = addListPreference(BLUETOOTH_SELECT_A2DP_BITS_PER_SAMPLE_KEY);
mBluetoothSelectA2dpChannelMode = addListPreference(BLUETOOTH_SELECT_A2DP_CHANNEL_MODE_KEY);
mBluetoothSelectA2dpLdacPlaybackQuality = addListPreference(BLUETOOTH_SELECT_A2DP_LDAC_PLAYBACK_QUALITY_KEY);
initBluetoothConfigurationValues();
mWindowAnimationScale = addListPreference(WINDOW_ANIMATION_SCALE_KEY);
mTransitionAnimationScale = addListPreference(TRANSITION_ANIMATION_SCALE_KEY);
@@ -668,7 +669,6 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
updateUsbConfigurationValues();
}
initBluetoothConfigurationValues();
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if (adapter != null) {
adapter.getProfileProxy(getActivity(),