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

Commit a243546a authored by Pradeep Panigrahi's avatar Pradeep Panigrahi
Browse files

Bluetooth: Map: Filter email message based on FilterReadStatus param

Use FilterReadStatus param from application parameter, for quering
the email database and create message listing element.

CRs-fixed: 607016

Change-Id: I5ec557008f05386578209b97e30658aa72fd217b
parent d6859e2b
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -1214,9 +1214,10 @@ public class BluetoothMapContent {
        return where;
    }

    private String setWhereFilterReadStatus(BluetoothMapAppParams ap) {
    private String setWhereFilterReadStatus(BluetoothMapAppParams ap, FilterInfo fi) {
        String where = "";
        if (ap.getFilterReadStatus() != -1) {
            if ((fi.msgType == FilterInfo.TYPE_SMS) || (fi.msgType == FilterInfo.TYPE_MMS)) {
               if ((ap.getFilterReadStatus() & 0x01) != 0) {
                   where = " AND read=0 ";
               }
@@ -1224,6 +1225,15 @@ public class BluetoothMapContent {
               if ((ap.getFilterReadStatus() & 0x02) != 0) {
                   where = " AND read=1 ";
               }
            } else {
               if ((ap.getFilterReadStatus() & 0x01) != 0) {
                    where = " AND flagRead=0 ";
               }

               if ((ap.getFilterReadStatus() & 0x02) != 0) {
                    where = " AND flagRead=1 ";
               }
            }
        }

        return where;
@@ -1410,7 +1420,7 @@ public class BluetoothMapContent {
        String where = "";

        where += setWhereFilterFolderType(folder, fi);
        where += setWhereFilterReadStatus(ap);
        where += setWhereFilterReadStatus(ap, fi);
        where += setWhereFilterPeriod(ap, fi);
        /* where += setWhereFilterOriginator(ap, fi); */
        /* where += setWhereFilterRecipient(ap, fi); */