From 4620df7b92a85074a2fcdca3fc6f3a3d432bffb8 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 23 Sep 2010 14:01:11 -0400 Subject: MTP: Fix problems with signed ints in MtpCursor.cpp BUG: 2978335 Change-Id: Ie9f3dea3b88b00a555e1ca3232f196e83ee7a6da Signed-off-by: Mike Lockwood --- media/mtp/MtpCursor.cpp | 6 ++++-- media/mtp/MtpCursor.h | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'media/mtp') diff --git a/media/mtp/MtpCursor.cpp b/media/mtp/MtpCursor.cpp index 8c964b4..865a294 100644 --- a/media/mtp/MtpCursor.cpp +++ b/media/mtp/MtpCursor.cpp @@ -66,7 +66,8 @@ namespace android { #define OBJECT_THUMB 221 MtpCursor::MtpCursor(MtpClient* client, int queryType, int deviceID, - int storageID, int objectID, int columnCount, int* columns) + MtpStorageID storageID, MtpObjectHandle objectID, + int columnCount, int* columns) : mClient(client), mQueryType(queryType), mDeviceID(deviceID), @@ -427,7 +428,8 @@ bool MtpCursor::putString(CursorWindow* window, const char* text, int row, int c return true; } -bool MtpCursor::putThumbnail(CursorWindow* window, int objectID, int format, int row, int column) { +bool MtpCursor::putThumbnail(CursorWindow* window, MtpObjectHandle objectID, + MtpObjectFormat format, int row, int column) { MtpDevice* device = mClient->getDevice(mDeviceID); void* thumbnail; int size, offset; diff --git a/media/mtp/MtpCursor.h b/media/mtp/MtpCursor.h index 3f84753..9e9833f 100644 --- a/media/mtp/MtpCursor.h +++ b/media/mtp/MtpCursor.h @@ -36,17 +36,18 @@ private: OBJECT_CHILDREN = 8, }; - MtpClient* mClient; - int mQueryType; - int mDeviceID; - int mStorageID; - int mQbjectID; - int mColumnCount; - int* mColumns; + MtpClient* mClient; + int mQueryType; + int mDeviceID; + MtpStorageID mStorageID; + MtpObjectHandle mQbjectID; + int mColumnCount; + int* mColumns; public: MtpCursor(MtpClient* client, int queryType, int deviceID, - int storageID, int objectID, int columnCount, int* columns); + MtpStorageID storageID, MtpObjectHandle objectID, + int columnCount, int* columns); virtual ~MtpCursor(); int fillWindow(CursorWindow* window, int startPos); @@ -68,7 +69,8 @@ private: bool prepareRow(CursorWindow* window); bool putLong(CursorWindow* window, int value, int row, int column); bool putString(CursorWindow* window, const char* text, int row, int column); - bool putThumbnail(CursorWindow* window, int objectID, int format, int row, int column); + bool putThumbnail(CursorWindow* window, MtpObjectHandle objectID, + MtpObjectFormat format, int row, int column); }; }; // namespace android -- cgit v1.1