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

Commit c2eca8c1 authored by Daichi Hirono's avatar Daichi Hirono Committed by android-build-merger
Browse files

Merge "Returns "application/octet-stream" for unknown types of MTP files." into nyc-dev

am: f4fe20ad

* commit 'f4fe20ad':
  Returns "application/octet-stream" for unknown types of MTP files.
parents 99589546 f4fe20ad
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -557,13 +557,9 @@ class MtpDatabase {

        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            if (oldVersion == 1) {
            db.execSQL("DROP TABLE " + TABLE_DOCUMENTS);
            db.execSQL("DROP TABLE " + TABLE_ROOT_EXTRA);
            onCreate(db);
                return;
            }
            throw new UnsupportedOperationException();
        }
    }

@@ -680,7 +676,12 @@ class MtpDatabase {
        if (formatCodeMimeType != null) {
            return formatCodeMimeType;
        }
        return MediaFile.getMimeTypeForFile(info.getName());
        final String mediaFileMimeType = MediaFile.getMimeTypeForFile(info.getName());
        if (mediaFileMimeType != null) {
            return mediaFileMimeType;
        }
        // We don't know the file type.
        return "application/octet-stream";
    }

    static String[] strings(Object... args) {
+2 −2
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ import java.util.Map;
 * Class containing MtpDatabase constants.
 */
class MtpDatabaseConstants {
    static final int DATABASE_VERSION = 2;
    static final int DATABASE_VERSION = 3;
    static final String DATABASE_NAME = "database";

    static final int FLAG_DATABASE_IN_MEMORY = 1;
@@ -125,7 +125,7 @@ class MtpDatabaseConstants {
            COLUMN_PARENT_DOCUMENT_ID + " INTEGER," +
            COLUMN_ROW_STATE + " INTEGER NOT NULL," +
            COLUMN_DOCUMENT_TYPE + " INTEGER NOT NULL," +
            Document.COLUMN_MIME_TYPE + " TEXT," +
            Document.COLUMN_MIME_TYPE + " TEXT NOT NULL," +
            Document.COLUMN_DISPLAY_NAME + " TEXT NOT NULL," +
            Document.COLUMN_SUMMARY + " TEXT," +
            Document.COLUMN_LAST_MODIFIED + " INTEGER," +