summaryrefslogtreecommitdiffstats
path: root/media/tests/CameraBrowser/src
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-09-21 10:39:27 -0400
committerMike Lockwood <lockwood@android.com>2010-09-21 10:41:33 -0400
commitf1f5361e328c13be80e3760d8cc2170d70c9d0ba (patch)
treeec9d04509319c10492f7c8907be3ed1483239998 /media/tests/CameraBrowser/src
parent141e00c212ab1cd9d6def55edadc3e709d88f9d5 (diff)
downloadframeworks_base-f1f5361e328c13be80e3760d8cc2170d70c9d0ba.zip
frameworks_base-f1f5361e328c13be80e3760d8cc2170d70c9d0ba.tar.gz
frameworks_base-f1f5361e328c13be80e3760d8cc2170d70c9d0ba.tar.bz2
MTP host: Use Java longs for storage and object IDs
This avoids problems with unsigned 32 bit numbers with cameras that use storage and object IDs > 0x7FFFFFFF Change-Id: I615f2d468851e9d6ff8882d22966d3687697d8eb Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/tests/CameraBrowser/src')
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java12
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java8
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java2
3 files changed, 11 insertions, 11 deletions
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java
index 329aa40..6d34fd4 100644
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java
+++ b/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java
@@ -44,8 +44,8 @@ public class ObjectBrowser extends ListActivity {
private Cursor mCursor;
private ObjectCursorAdapter mAdapter;
private int mDeviceID;
- private int mStorageID;
- private int mObjectID;
+ private long mStorageID;
+ private long mObjectID;
private static final String[] OBJECT_COLUMNS =
new String[] { Mtp.Object._ID, Mtp.Object.NAME, Mtp.Object.FORMAT, Mtp.Object.THUMB };
@@ -65,8 +65,8 @@ public class ObjectBrowser extends ListActivity {
super.onResume();
mDeviceID = getIntent().getIntExtra("device", 0);
- mStorageID = getIntent().getIntExtra("storage", 0);
- mObjectID = getIntent().getIntExtra("object", 0);
+ mStorageID = getIntent().getLongExtra("storage", 0);
+ mObjectID = getIntent().getLongExtra("object", 0);
if (mDeviceID != 0 && mStorageID != 0) {
Cursor c;
Uri uri;
@@ -88,7 +88,7 @@ public class ObjectBrowser extends ListActivity {
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
- int rowID = (int)mAdapter.getItemId(position);
+ long rowID = mAdapter.getItemId(position);
Cursor c = getContentResolver().query(
Mtp.Object.getContentUri(mDeviceID, rowID),
OBJECT_COLUMNS, null, null, null);
@@ -111,7 +111,7 @@ public class ObjectBrowser extends ListActivity {
Intent intent = new Intent(this, ObjectViewer.class);
intent.putExtra("device", mDeviceID);
intent.putExtra("storage", mStorageID);
- intent.putExtra("object",rowID);
+ intent.putExtra("object", rowID);
startActivity(intent);
}
}
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java
index 408f15e..5899bc1 100644
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java
+++ b/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java
@@ -51,8 +51,8 @@ public class ObjectViewer extends Activity {
private static final String TAG = "ObjectViewer";
private int mDeviceID;
- private int mStorageID;
- private int mObjectID;
+ private long mStorageID;
+ private long mObjectID;
private static final String[] OBJECT_COLUMNS =
new String[] { Mtp.Object._ID,
@@ -84,8 +84,8 @@ public class ObjectViewer extends Activity {
super.onResume();
mDeviceID = getIntent().getIntExtra("device", 0);
- mStorageID = getIntent().getIntExtra("storage", 0);
- mObjectID = getIntent().getIntExtra("object", 0);
+ mStorageID = getIntent().getLongExtra("storage", 0);
+ mObjectID = getIntent().getLongExtra("object", 0);
if (mDeviceID != 0 && mObjectID != 0) {
Cursor c = getContentResolver().query(
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java
index 6ddf4e7..63e036e 100644
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java
+++ b/media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java
@@ -70,7 +70,7 @@ public class StorageBrowser extends ListActivity {
protected void onListItemClick(ListView l, View v, int position, long id) {
Intent intent = new Intent(this, ObjectBrowser.class);
intent.putExtra("device", mDeviceID);
- intent.putExtra("storage", (int)mAdapter.getItemId(position));
+ intent.putExtra("storage", mAdapter.getItemId(position));
startActivity(intent);
}
}