Merge "Don\'t close USB type notification when USB is connected to USB devices." into nyc-dev

am: 98607d4

* commit '98607d444903f5c74fe190f65800a5679b312c4e':
  Don't close USB type notification when USB is connected to USB devices.
This commit is contained in:
Daichi Hirono
2016-03-24 02:50:52 +00:00
committed by android-build-merger

View File

@@ -68,7 +68,9 @@ public class UsbModeChooserActivity extends Activity {
String action = intent.getAction(); String action = intent.getAction();
if (UsbManager.ACTION_USB_STATE.equals(action)) { if (UsbManager.ACTION_USB_STATE.equals(action)) {
boolean connected = intent.getBooleanExtra(UsbManager.USB_CONNECTED, false); boolean connected = intent.getBooleanExtra(UsbManager.USB_CONNECTED, false);
if (!connected) { boolean hostConnected =
intent.getBooleanExtra(UsbManager.USB_HOST_CONNECTED, false);
if (!connected && !hostConnected) {
mDialog.dismiss(); mDialog.dismiss();
} }
} }