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

Commit e23ba763 authored by Casper Bonde's avatar Casper Bonde Committed by Android Git Automerger
Browse files

am 52ca5cad: am 081b680e: MAP: Workaround for missing size values in message data base

* commit '52ca5cad':
  MAP: Workaround for missing size values in message data base
parents 625b2ff7 52ca5cad
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -459,12 +459,22 @@ public class BluetoothMapContent {
            if (fi.mMsgType == FilterInfo.TYPE_MMS) {
                if(c.getInt(fi.mMmsColTextOnly) == 0) {
                    size = c.getInt(fi.mMmsColAttachmentSize);
                    if(size <= 0) {
                        // We know there are attachments, since it is not TextOnly
                        // Hence the size in the database must be wrong.
                        // Set size to 1 to indicate to the client, that attachments are present
                        if (D) Log.d(TAG, "Error in message database, size reported as: " + size
                                + " Changing size to 1");
                        size = 1;
                    }
                }
            } else if (fi.mMsgType == FilterInfo.TYPE_EMAIL) {
                int attachment = c.getInt(fi.mEmailColAttachment);
                size = c.getInt(fi.mEmailColAttachementSize);
                if(attachment == 1 && size == 0) {
                    size = 1; /* Ensure we indicate we have attachments in the size, it the
                    if (D) Log.d(TAG, "Error in message database, attachment size reported as: " + size
                            + " Changing size to 1");
                    size = 1; /* Ensure we indicate we have attachments in the size, if the
                                 message has attachments, in case the e-mail client do not
                                 report a size */
                }
@@ -522,6 +532,14 @@ public class BluetoothMapContent {
            } else if (fi.mMsgType == FilterInfo.TYPE_EMAIL) {
                size = c.getInt(fi.mEmailColSize);
            }
            if(size <= 0) {
                // A message cannot have size 0
                // Hence the size in the database must be wrong.
                // Set size to 1 to indicate to the client, that the message has content.
                if (D) Log.d(TAG, "Error in message database, size reported as: " + size
                        + " Changing size to 1");
                size = 1;
            }
            if (V) Log.d(TAG, "setSize: " + size);
            e.setSize(size);
        }