Merge "Handle the case where USB_STATE intent is not received yet."
This commit is contained in:
committed by
Android (Google) Code Review
commit
ea37281d9e
@@ -547,7 +547,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