summaryrefslogtreecommitdiffstats
path: root/media/tests
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-02-23 13:14:33 -0800
committerMike Lockwood <lockwood@android.com>2011-02-23 13:14:33 -0800
commit188d00b07ef0b8968868b3489e80dd9f53d3bafa (patch)
tree06f0784819432134832e7d20e5a61475e33c16db /media/tests
parent16dc3073a2f06a77d9873e536f633a4adf575fce (diff)
downloadframeworks_base-188d00b07ef0b8968868b3489e80dd9f53d3bafa.zip
frameworks_base-188d00b07ef0b8968868b3489e80dd9f53d3bafa.tar.gz
frameworks_base-188d00b07ef0b8968868b3489e80dd9f53d3bafa.tar.bz2
UsbManager: Remove redundant Intent extras from USB device and accessory broadcasts
These extras are also accessable via the UsbDevice and UsbAccessory classes, which are also included as extras. Since you can't filter Intents based on extras there is no point in duplicating this information as separate extras. Change-Id: I4c8d1e70d66023a1800b3f8f06118898da6b37af Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/tests')
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/DeviceDisconnectedReceiver.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/DeviceDisconnectedReceiver.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/DeviceDisconnectedReceiver.java
index 736af1f..1155807 100644
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/DeviceDisconnectedReceiver.java
+++ b/media/tests/CameraBrowser/src/com/android/camerabrowser/DeviceDisconnectedReceiver.java
@@ -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;
@@ -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