Loading core/java/android/hardware/usb/UsbManager.java +10 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ public class UsbManager { * This is a sticky broadcast for clients that includes USB connected/disconnected state, * <ul> * <li> {@link #USB_CONNECTED} boolean indicating whether USB is connected or disconnected. * <li> {@link #USB_HOST_CONNECTED} boolean indicating whether USB is connected or * disconnected as host. * <li> {@link #USB_CONFIGURED} boolean indicating whether USB is configured. * currently zero if not configured, one for configured. * <li> {@link #USB_FUNCTION_ADB} boolean extra indicating whether the Loading Loading @@ -151,6 +153,14 @@ public class UsbManager { */ public static final String USB_CONNECTED = "connected"; /** * Boolean extra indicating whether USB is connected or disconnected as host. * Used in extras for the {@link #ACTION_USB_STATE} broadcast. * * {@hide} */ public static final String USB_HOST_CONNECTED = "host_connected"; /** * Boolean extra indicating whether USB is configured. * Used in extras for the {@link #ACTION_USB_STATE} broadcast. Loading services/usb/java/com/android/server/usb/UsbDeviceManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -608,6 +608,7 @@ public class UsbDeviceManager { intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING | Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(UsbManager.USB_CONNECTED, mConnected); intent.putExtra(UsbManager.USB_HOST_CONNECTED, mHostConnected); intent.putExtra(UsbManager.USB_CONFIGURED, mConfigured); intent.putExtra(UsbManager.USB_DATA_UNLOCKED, isUsbTransferAllowed() && mUsbDataUnlocked); Loading Loading @@ -717,6 +718,9 @@ public class UsbDeviceManager { case MSG_UPDATE_HOST_STATE: mHostConnected = (msg.arg1 == 1); updateUsbNotification(); if (mBootCompleted) { updateUsbStateBroadcastIfNeeded(); } break; case MSG_ENABLE_ADB: setAdbEnabled(msg.arg1 == 1); Loading Loading
core/java/android/hardware/usb/UsbManager.java +10 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ public class UsbManager { * This is a sticky broadcast for clients that includes USB connected/disconnected state, * <ul> * <li> {@link #USB_CONNECTED} boolean indicating whether USB is connected or disconnected. * <li> {@link #USB_HOST_CONNECTED} boolean indicating whether USB is connected or * disconnected as host. * <li> {@link #USB_CONFIGURED} boolean indicating whether USB is configured. * currently zero if not configured, one for configured. * <li> {@link #USB_FUNCTION_ADB} boolean extra indicating whether the Loading Loading @@ -151,6 +153,14 @@ public class UsbManager { */ public static final String USB_CONNECTED = "connected"; /** * Boolean extra indicating whether USB is connected or disconnected as host. * Used in extras for the {@link #ACTION_USB_STATE} broadcast. * * {@hide} */ public static final String USB_HOST_CONNECTED = "host_connected"; /** * Boolean extra indicating whether USB is configured. * Used in extras for the {@link #ACTION_USB_STATE} broadcast. Loading
services/usb/java/com/android/server/usb/UsbDeviceManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -608,6 +608,7 @@ public class UsbDeviceManager { intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING | Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(UsbManager.USB_CONNECTED, mConnected); intent.putExtra(UsbManager.USB_HOST_CONNECTED, mHostConnected); intent.putExtra(UsbManager.USB_CONFIGURED, mConfigured); intent.putExtra(UsbManager.USB_DATA_UNLOCKED, isUsbTransferAllowed() && mUsbDataUnlocked); Loading Loading @@ -717,6 +718,9 @@ public class UsbDeviceManager { case MSG_UPDATE_HOST_STATE: mHostConnected = (msg.arg1 == 1); updateUsbNotification(); if (mBootCompleted) { updateUsbStateBroadcastIfNeeded(); } break; case MSG_ENABLE_ADB: setAdbEnabled(msg.arg1 == 1); Loading