Loading api/current.xml +0 −110 Original line number Diff line number Diff line Loading @@ -95413,50 +95413,6 @@ visibility="public" > </field> <field name="EXTRA_ACCESSORY_MANUFACTURER" type="java.lang.String" transient="false" volatile="false" value=""accessory-manufacturer"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_ACCESSORY_PRODUCT" type="java.lang.String" transient="false" volatile="false" value=""accessory-product"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_ACCESSORY_TYPE" type="java.lang.String" transient="false" volatile="false" value=""accessory-type"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_ACCESSORY_VERSION" type="java.lang.String" transient="false" volatile="false" value=""accessory-version"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_DEVICE" type="java.lang.String" transient="false" Loading @@ -95468,72 +95424,6 @@ visibility="public" > </field> <field name="EXTRA_DEVICE_CLASS" type="java.lang.String" transient="false" volatile="false" value=""device_class"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_DEVICE_NAME" type="java.lang.String" transient="false" volatile="false" value=""device_name"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_DEVICE_PROTOCOL" type="java.lang.String" transient="false" volatile="false" value=""device_protocol"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_DEVICE_SUBCLASS" type="java.lang.String" transient="false" volatile="false" value=""device_subclass"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_PRODUCT_ID" type="java.lang.String" transient="false" volatile="false" value=""product_id"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_VENDOR_ID" type="java.lang.String" transient="false" volatile="false" value=""vendor_id"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="USB_CONFIGURATION" type="java.lang.String" transient="false" core/java/android/hardware/UsbManager.java +3 −72 Original line number Diff line number Diff line Loading @@ -62,12 +62,6 @@ public class UsbManager { * * This intent is sent when a USB device is attached to the USB bus when in host mode. * <ul> * <li> {@link #EXTRA_DEVICE_NAME} containing the device's name (String) * <li> {@link #EXTRA_VENDOR_ID} containing the device's vendor ID (Integer) * <li> {@link #EXTRA_PRODUCT_ID} containing the device's product ID (Integer) * <li> {@link #EXTRA_DEVICE_CLASS} } containing the device class (Integer) * <li> {@link #EXTRA_DEVICE_SUBCLASS} containing the device subclass (Integer) * <li> {@link #EXTRA_DEVICE_PROTOCOL} containing the device protocol (Integer) * <li> {@link #EXTRA_DEVICE} containing the {@link android.hardware.UsbDevice} * for the attached device * </ul> Loading @@ -80,7 +74,8 @@ public class UsbManager { * * This intent is sent when a USB device is detached from the USB bus when in host mode. * <ul> * <li> {@link #EXTRA_DEVICE_NAME} containing the device's name (String) * <li> {@link #EXTRA_DEVICE} containing the {@link android.hardware.UsbDevice} * for the detached device * </ul> */ public static final String ACTION_USB_DEVICE_DETACHED = Loading @@ -91,10 +86,6 @@ public class UsbManager { * * This intent is sent when a USB accessory is attached. * <ul> * <li> {@link #EXTRA_ACCESSORY_MANUFACTURER} containing the accessory's manufacturer (String) * <li> {@link #EXTRA_ACCESSORY_PRODUCT} containing the accessory's product name (String) * <li> {@link #EXTRA_ACCESSORY_TYPE} containing the accessory's type (String) * <li> {@link #EXTRA_ACCESSORY_VERSION} containing the accessory's version (String) * <li> {@link #EXTRA_ACCESSORY} containing the {@link android.hardware.UsbAccessory} * for the attached accessory * </ul> Loading Loading @@ -172,43 +163,7 @@ public class UsbManager { /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} and * {@link #ACTION_USB_DEVICE_DETACHED} broadcasts * containing the device's ID (String). */ public static final String EXTRA_DEVICE_NAME = "device_name"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * containing the device's vendor ID (int). */ public static final String EXTRA_VENDOR_ID = "vendor_id"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * containing the device's product ID (int). */ public static final String EXTRA_PRODUCT_ID = "product_id"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * containing the device's class (int). */ public static final String EXTRA_DEVICE_CLASS = "device_class"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * containing the device's class (int). */ public static final String EXTRA_DEVICE_SUBCLASS = "device_subclass"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * containing the device's class (int). */ public static final String EXTRA_DEVICE_PROTOCOL = "device_protocol"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * {@link #ACTION_USB_DEVICE_DETACHED} broadcasts. * containing the UsbDevice object for the device. */ Loading @@ -220,30 +175,6 @@ public class UsbManager { */ public static final String EXTRA_ACCESSORY = "accessory"; /** * Name of extra for {@link #ACTION_USB_ACCESSORY_ATTACHED} broadcast * containing the accessory's manufacturer name. */ public static final String EXTRA_ACCESSORY_MANUFACTURER = "accessory-manufacturer"; /** * Name of extra for {@link #ACTION_USB_ACCESSORY_ATTACHED} broadcast * containing the accessory's product name. */ public static final String EXTRA_ACCESSORY_PRODUCT = "accessory-product"; /** * Name of extra for {@link #ACTION_USB_ACCESSORY_ATTACHED} broadcast * containing the accessory's type. */ public static final String EXTRA_ACCESSORY_TYPE = "accessory-type"; /** * Name of extra for {@link #ACTION_USB_ACCESSORY_ATTACHED} broadcast * containing the accessory's version. */ public static final String EXTRA_ACCESSORY_VERSION = "accessory-version"; private IUsbManager mService; /** Loading media/java/android/mtp/MtpClient.java +2 −3 Original line number Diff line number Diff line Loading @@ -48,15 +48,14 @@ public class MtpClient { private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String deviceName = intent.getStringExtra(UsbManager.EXTRA_DEVICE_NAME); UsbDevice usbDevice = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); String deviceName = usbDevice.getDeviceName(); synchronized (mDeviceList) { MtpDevice mtpDevice = getDeviceLocked(deviceName); if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(intent.getAction())) { if (mtpDevice == null) { UsbDevice usbDevice = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); mtpDevice = openDevice(usbDevice); } if (mtpDevice != null) { Loading media/tests/CameraBrowser/src/com/android/camerabrowser/DeviceDisconnectedReceiver.java +3 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.hardware.UsbDevice; import android.hardware.UsbManager; import android.util.Log; Loading @@ -41,7 +42,8 @@ public class DeviceDisconnectedReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String deviceName = intent.getStringExtra(UsbManager.EXTRA_DEVICE_NAME); UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); String deviceName = device.getDeviceName(); Log.d(TAG, "ACTION_USB_DEVICE_DETACHED " + deviceName); // close our activity if the device it is displaying is disconnected Loading services/java/com/android/server/UsbService.java +1 −20 Original line number Diff line number Diff line Loading @@ -143,19 +143,6 @@ class UsbService extends IUsbManager.Stub { mCurrentAccessory = new UsbAccessory(strings); Intent intent = new Intent(UsbManager.ACTION_USB_ACCESSORY_ATTACHED); intent.putExtra(UsbManager.EXTRA_ACCESSORY, mCurrentAccessory); // add strings as separate extras to allow filtering if (strings[0] != null) { intent.putExtra(UsbManager.EXTRA_ACCESSORY_MANUFACTURER, strings[0]); } if (strings[1] != null) { intent.putExtra(UsbManager.EXTRA_ACCESSORY_PRODUCT, strings[1]); } if (strings[2] != null) { intent.putExtra(UsbManager.EXTRA_ACCESSORY_TYPE, strings[2]); } if (strings[3] != null) { intent.putExtra(UsbManager.EXTRA_ACCESSORY_VERSION, strings[3]); } mContext.sendBroadcast(intent); } else { Log.e(TAG, "nativeGetAccessoryStrings failed"); Loading Loading @@ -360,12 +347,6 @@ class UsbService extends IUsbManager.Stub { mDevices.put(deviceName, device); Intent intent = new Intent(UsbManager.ACTION_USB_DEVICE_ATTACHED); intent.putExtra(UsbManager.EXTRA_DEVICE_NAME, deviceName); intent.putExtra(UsbManager.EXTRA_VENDOR_ID, vendorID); intent.putExtra(UsbManager.EXTRA_PRODUCT_ID, productID); intent.putExtra(UsbManager.EXTRA_DEVICE_CLASS, deviceClass); intent.putExtra(UsbManager.EXTRA_DEVICE_SUBCLASS, deviceSubclass); intent.putExtra(UsbManager.EXTRA_DEVICE_PROTOCOL, deviceProtocol); intent.putExtra(UsbManager.EXTRA_DEVICE, device); Log.d(TAG, "usbDeviceAdded, sending " + intent); mContext.sendBroadcast(intent); Loading @@ -378,7 +359,7 @@ class UsbService extends IUsbManager.Stub { UsbDevice device = mDevices.remove(deviceName); if (device != null) { Intent intent = new Intent(UsbManager.ACTION_USB_DEVICE_DETACHED); intent.putExtra(UsbManager.EXTRA_DEVICE_NAME, deviceName); intent.putExtra(UsbManager.EXTRA_DEVICE, device); Log.d(TAG, "usbDeviceRemoved, sending " + intent); mContext.sendBroadcast(intent); } Loading Loading
api/current.xml +0 −110 Original line number Diff line number Diff line Loading @@ -95413,50 +95413,6 @@ visibility="public" > </field> <field name="EXTRA_ACCESSORY_MANUFACTURER" type="java.lang.String" transient="false" volatile="false" value=""accessory-manufacturer"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_ACCESSORY_PRODUCT" type="java.lang.String" transient="false" volatile="false" value=""accessory-product"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_ACCESSORY_TYPE" type="java.lang.String" transient="false" volatile="false" value=""accessory-type"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_ACCESSORY_VERSION" type="java.lang.String" transient="false" volatile="false" value=""accessory-version"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_DEVICE" type="java.lang.String" transient="false" Loading @@ -95468,72 +95424,6 @@ visibility="public" > </field> <field name="EXTRA_DEVICE_CLASS" type="java.lang.String" transient="false" volatile="false" value=""device_class"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_DEVICE_NAME" type="java.lang.String" transient="false" volatile="false" value=""device_name"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_DEVICE_PROTOCOL" type="java.lang.String" transient="false" volatile="false" value=""device_protocol"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_DEVICE_SUBCLASS" type="java.lang.String" transient="false" volatile="false" value=""device_subclass"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_PRODUCT_ID" type="java.lang.String" transient="false" volatile="false" value=""product_id"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_VENDOR_ID" type="java.lang.String" transient="false" volatile="false" value=""vendor_id"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="USB_CONFIGURATION" type="java.lang.String" transient="false"
core/java/android/hardware/UsbManager.java +3 −72 Original line number Diff line number Diff line Loading @@ -62,12 +62,6 @@ public class UsbManager { * * This intent is sent when a USB device is attached to the USB bus when in host mode. * <ul> * <li> {@link #EXTRA_DEVICE_NAME} containing the device's name (String) * <li> {@link #EXTRA_VENDOR_ID} containing the device's vendor ID (Integer) * <li> {@link #EXTRA_PRODUCT_ID} containing the device's product ID (Integer) * <li> {@link #EXTRA_DEVICE_CLASS} } containing the device class (Integer) * <li> {@link #EXTRA_DEVICE_SUBCLASS} containing the device subclass (Integer) * <li> {@link #EXTRA_DEVICE_PROTOCOL} containing the device protocol (Integer) * <li> {@link #EXTRA_DEVICE} containing the {@link android.hardware.UsbDevice} * for the attached device * </ul> Loading @@ -80,7 +74,8 @@ public class UsbManager { * * This intent is sent when a USB device is detached from the USB bus when in host mode. * <ul> * <li> {@link #EXTRA_DEVICE_NAME} containing the device's name (String) * <li> {@link #EXTRA_DEVICE} containing the {@link android.hardware.UsbDevice} * for the detached device * </ul> */ public static final String ACTION_USB_DEVICE_DETACHED = Loading @@ -91,10 +86,6 @@ public class UsbManager { * * This intent is sent when a USB accessory is attached. * <ul> * <li> {@link #EXTRA_ACCESSORY_MANUFACTURER} containing the accessory's manufacturer (String) * <li> {@link #EXTRA_ACCESSORY_PRODUCT} containing the accessory's product name (String) * <li> {@link #EXTRA_ACCESSORY_TYPE} containing the accessory's type (String) * <li> {@link #EXTRA_ACCESSORY_VERSION} containing the accessory's version (String) * <li> {@link #EXTRA_ACCESSORY} containing the {@link android.hardware.UsbAccessory} * for the attached accessory * </ul> Loading Loading @@ -172,43 +163,7 @@ public class UsbManager { /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} and * {@link #ACTION_USB_DEVICE_DETACHED} broadcasts * containing the device's ID (String). */ public static final String EXTRA_DEVICE_NAME = "device_name"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * containing the device's vendor ID (int). */ public static final String EXTRA_VENDOR_ID = "vendor_id"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * containing the device's product ID (int). */ public static final String EXTRA_PRODUCT_ID = "product_id"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * containing the device's class (int). */ public static final String EXTRA_DEVICE_CLASS = "device_class"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * containing the device's class (int). */ public static final String EXTRA_DEVICE_SUBCLASS = "device_subclass"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * containing the device's class (int). */ public static final String EXTRA_DEVICE_PROTOCOL = "device_protocol"; /** * Name of extra for {@link #ACTION_USB_DEVICE_ATTACHED} broadcast * {@link #ACTION_USB_DEVICE_DETACHED} broadcasts. * containing the UsbDevice object for the device. */ Loading @@ -220,30 +175,6 @@ public class UsbManager { */ public static final String EXTRA_ACCESSORY = "accessory"; /** * Name of extra for {@link #ACTION_USB_ACCESSORY_ATTACHED} broadcast * containing the accessory's manufacturer name. */ public static final String EXTRA_ACCESSORY_MANUFACTURER = "accessory-manufacturer"; /** * Name of extra for {@link #ACTION_USB_ACCESSORY_ATTACHED} broadcast * containing the accessory's product name. */ public static final String EXTRA_ACCESSORY_PRODUCT = "accessory-product"; /** * Name of extra for {@link #ACTION_USB_ACCESSORY_ATTACHED} broadcast * containing the accessory's type. */ public static final String EXTRA_ACCESSORY_TYPE = "accessory-type"; /** * Name of extra for {@link #ACTION_USB_ACCESSORY_ATTACHED} broadcast * containing the accessory's version. */ public static final String EXTRA_ACCESSORY_VERSION = "accessory-version"; private IUsbManager mService; /** Loading
media/java/android/mtp/MtpClient.java +2 −3 Original line number Diff line number Diff line Loading @@ -48,15 +48,14 @@ public class MtpClient { private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String deviceName = intent.getStringExtra(UsbManager.EXTRA_DEVICE_NAME); UsbDevice usbDevice = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); String deviceName = usbDevice.getDeviceName(); synchronized (mDeviceList) { MtpDevice mtpDevice = getDeviceLocked(deviceName); if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(intent.getAction())) { if (mtpDevice == null) { UsbDevice usbDevice = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); mtpDevice = openDevice(usbDevice); } if (mtpDevice != null) { Loading
media/tests/CameraBrowser/src/com/android/camerabrowser/DeviceDisconnectedReceiver.java +3 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.hardware.UsbDevice; import android.hardware.UsbManager; import android.util.Log; Loading @@ -41,7 +42,8 @@ public class DeviceDisconnectedReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String deviceName = intent.getStringExtra(UsbManager.EXTRA_DEVICE_NAME); UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); String deviceName = device.getDeviceName(); Log.d(TAG, "ACTION_USB_DEVICE_DETACHED " + deviceName); // close our activity if the device it is displaying is disconnected Loading
services/java/com/android/server/UsbService.java +1 −20 Original line number Diff line number Diff line Loading @@ -143,19 +143,6 @@ class UsbService extends IUsbManager.Stub { mCurrentAccessory = new UsbAccessory(strings); Intent intent = new Intent(UsbManager.ACTION_USB_ACCESSORY_ATTACHED); intent.putExtra(UsbManager.EXTRA_ACCESSORY, mCurrentAccessory); // add strings as separate extras to allow filtering if (strings[0] != null) { intent.putExtra(UsbManager.EXTRA_ACCESSORY_MANUFACTURER, strings[0]); } if (strings[1] != null) { intent.putExtra(UsbManager.EXTRA_ACCESSORY_PRODUCT, strings[1]); } if (strings[2] != null) { intent.putExtra(UsbManager.EXTRA_ACCESSORY_TYPE, strings[2]); } if (strings[3] != null) { intent.putExtra(UsbManager.EXTRA_ACCESSORY_VERSION, strings[3]); } mContext.sendBroadcast(intent); } else { Log.e(TAG, "nativeGetAccessoryStrings failed"); Loading Loading @@ -360,12 +347,6 @@ class UsbService extends IUsbManager.Stub { mDevices.put(deviceName, device); Intent intent = new Intent(UsbManager.ACTION_USB_DEVICE_ATTACHED); intent.putExtra(UsbManager.EXTRA_DEVICE_NAME, deviceName); intent.putExtra(UsbManager.EXTRA_VENDOR_ID, vendorID); intent.putExtra(UsbManager.EXTRA_PRODUCT_ID, productID); intent.putExtra(UsbManager.EXTRA_DEVICE_CLASS, deviceClass); intent.putExtra(UsbManager.EXTRA_DEVICE_SUBCLASS, deviceSubclass); intent.putExtra(UsbManager.EXTRA_DEVICE_PROTOCOL, deviceProtocol); intent.putExtra(UsbManager.EXTRA_DEVICE, device); Log.d(TAG, "usbDeviceAdded, sending " + intent); mContext.sendBroadcast(intent); Loading @@ -378,7 +359,7 @@ class UsbService extends IUsbManager.Stub { UsbDevice device = mDevices.remove(deviceName); if (device != null) { Intent intent = new Intent(UsbManager.ACTION_USB_DEVICE_DETACHED); intent.putExtra(UsbManager.EXTRA_DEVICE_NAME, deviceName); intent.putExtra(UsbManager.EXTRA_DEVICE, device); Log.d(TAG, "usbDeviceRemoved, sending " + intent); mContext.sendBroadcast(intent); } Loading