Only send HOST_STATE intents when host mode is used.

Previously HOST_STATE update intents would broadcast if the
device was in gadget mode but not configured. This would
override the sticky intent, causing MtpReceiver to fail.

This is fixed by only updating host state if host is connected
or if host is being disconnected (was connected before).

Bug: 34873000
Test: set up lockscreen, reboot device while plugged in, unplug before
unlocking, verify usb works.

Change-Id: Ic424e678ba72401ee8ec975e915727272edf3767
1 file changed