Handle the case where USB_STATE intent is not received yet.
Call updateUsbConfigurationValues() when ACTION_USB_STATE intent is not yet received so that mUsbConfiguration value is properly initialized in this case. BUG: 22163689 Change-Id: I2aeed43fc49e40c52cdc2bfc08d43081815b49d1
This commit is contained in:
@@ -552,7 +552,9 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
Bundle savedInstanceState) {
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(UsbManager.ACTION_USB_STATE);
|
||||
getActivity().registerReceiver(mUsbReceiver, filter);
|
||||
if (getActivity().registerReceiver(mUsbReceiver, filter) == null) {
|
||||
updateUsbConfigurationValues();
|
||||
}
|
||||
return super.onCreateView(inflater, container, savedInstanceState);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user