Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c2d06da authored by Mike Lockwood's avatar Mike Lockwood Committed by Android (Google) Code Review
Browse files

Merge changes I75c4c7dc,Ie9f3dea3

* changes:
  MTP: List all the formats we support in addition to FORMAT_UNDEFINED
  MTP: Fix problems with signed ints in MtpCursor.cpp
parents fea28c93 12b8a99f
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -246,8 +246,30 @@ public class MtpDatabase {
        return new int[] {
            // allow transfering arbitrary files
            MtpConstants.FORMAT_UNDEFINED,

            MtpConstants.FORMAT_ASSOCIATION,
            MtpConstants.FORMAT_TEXT,
            MtpConstants.FORMAT_HTML,
            MtpConstants.FORMAT_WAV,
            MtpConstants.FORMAT_MP3,
            MtpConstants.FORMAT_MPEG,
            MtpConstants.FORMAT_EXIF_JPEG,
            MtpConstants.FORMAT_TIFF_EP,
            MtpConstants.FORMAT_GIF,
            MtpConstants.FORMAT_JFIF,
            MtpConstants.FORMAT_PNG,
            MtpConstants.FORMAT_TIFF,
            MtpConstants.FORMAT_WMA,
            MtpConstants.FORMAT_OGG,
            MtpConstants.FORMAT_AAC,
            MtpConstants.FORMAT_MP4_CONTAINER,
            MtpConstants.FORMAT_MP2,
            MtpConstants.FORMAT_3GP_CONTAINER,
            MtpConstants.FORMAT_ABSTRACT_AV_PLAYLIST,
            MtpConstants.FORMAT_WPL_PLAYLIST,
            MtpConstants.FORMAT_M3U_PLAYLIST,
            MtpConstants.FORMAT_PLS_PLAYLIST,
            MtpConstants.FORMAT_XML_DOCUMENT,
        };
    }

+4 −2
Original line number Diff line number Diff line
@@ -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;
+11 −9
Original line number Diff line number Diff line
@@ -39,14 +39,15 @@ private:
    MtpClient*      mClient;
    int             mQueryType;
    int             mDeviceID;
    int         mStorageID;
    int         mQbjectID;
    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