Loading android/app/src/com/android/bluetooth/map/BluetoothMapContent.java +42 −15 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.util.Log; import com.android.bluetooth.map.BluetoothMapUtils.TYPE; import com.android.bluetooth.map.BluetoothMapUtils.TYPE; import com.google.android.mms.pdu.CharacterSets; import com.google.android.mms.pdu.CharacterSets; import com.google.android.mms.pdu.PduHeaders; public class BluetoothMapContent { public class BluetoothMapContent { private static final String TAG = "BluetoothMapContent"; private static final String TAG = "BluetoothMapContent"; Loading Loading @@ -389,8 +390,15 @@ public class BluetoothMapContent { private void setPriority(BluetoothMapMessageListingElement e, Cursor c, private void setPriority(BluetoothMapMessageListingElement e, Cursor c, FilterInfo fi, BluetoothMapAppParams ap) { FilterInfo fi, BluetoothMapAppParams ap) { if ((ap.getParameterMask() & MASK_PRIORITY) != 0) { String priority = "no"; String priority = "no"; if ((ap.getParameterMask() & MASK_PRIORITY) != 0) { int pri = 0; if (fi.msgType == FilterInfo.TYPE_MMS) { pri = c.getInt(c.getColumnIndex(Mms.PRIORITY)); } if (pri == PduHeaders.PRIORITY_HIGH) { priority = "yes"; } if (D) Log.d(TAG, "setPriority: " + priority); if (D) Log.d(TAG, "setPriority: " + priority); e.setPriority(priority); e.setPriority(priority); } } Loading Loading @@ -1051,6 +1059,23 @@ public class BluetoothMapContent { return where; return where; } } private String setWhereFilterPriority(BluetoothMapAppParams ap, FilterInfo fi) { String where = ""; int pri = ap.getFilterPriority(); /*only MMS have priority info */ if(fi.msgType == FilterInfo.TYPE_MMS) { if(pri == 0x0002) { where += " AND " + Mms.PRIORITY + "<=" + Integer.toString(PduHeaders.PRIORITY_NORMAL); }else if(pri == 0x0001) { where += " AND " + Mms.PRIORITY + "=" + Integer.toString(PduHeaders.PRIORITY_HIGH); } } return where; } private String setWhereFilterRecipient(BluetoothMapAppParams ap, private String setWhereFilterRecipient(BluetoothMapAppParams ap, FilterInfo fi) { FilterInfo fi) { Loading Loading @@ -1094,6 +1119,7 @@ public class BluetoothMapContent { where += setWhereFilterFolderType(folder, fi); where += setWhereFilterFolderType(folder, fi); where += setWhereFilterReadStatus(ap); where += setWhereFilterReadStatus(ap); where += setWhereFilterPeriod(ap, fi); where += setWhereFilterPeriod(ap, fi); where += setWhereFilterPriority(ap,fi); /* where += setWhereFilterOriginator(ap, fi); */ /* where += setWhereFilterOriginator(ap, fi); */ /* where += setWhereFilterRecipient(ap, fi); */ /* where += setWhereFilterRecipient(ap, fi); */ Loading Loading @@ -1155,7 +1181,7 @@ public class BluetoothMapContent { if (smsSelected(fi, ap)) { if (smsSelected(fi, ap)) { fi.msgType = FilterInfo.TYPE_SMS; fi.msgType = FilterInfo.TYPE_SMS; if(ap.getFilterPriority() != 1){ /*SMS cannot have high priority*/ String where = setWhereFilter(folder, fi, ap); String where = setWhereFilter(folder, fi, ap); Cursor c = mResolver.query(Sms.CONTENT_URI, Cursor c = mResolver.query(Sms.CONTENT_URI, Loading @@ -1172,6 +1198,7 @@ public class BluetoothMapContent { c.close(); c.close(); } } } } } if (mmsSelected(fi, ap)) { if (mmsSelected(fi, ap)) { fi.msgType = FilterInfo.TYPE_MMS; fi.msgType = FilterInfo.TYPE_MMS; Loading Loading
android/app/src/com/android/bluetooth/map/BluetoothMapContent.java +42 −15 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.util.Log; import com.android.bluetooth.map.BluetoothMapUtils.TYPE; import com.android.bluetooth.map.BluetoothMapUtils.TYPE; import com.google.android.mms.pdu.CharacterSets; import com.google.android.mms.pdu.CharacterSets; import com.google.android.mms.pdu.PduHeaders; public class BluetoothMapContent { public class BluetoothMapContent { private static final String TAG = "BluetoothMapContent"; private static final String TAG = "BluetoothMapContent"; Loading Loading @@ -389,8 +390,15 @@ public class BluetoothMapContent { private void setPriority(BluetoothMapMessageListingElement e, Cursor c, private void setPriority(BluetoothMapMessageListingElement e, Cursor c, FilterInfo fi, BluetoothMapAppParams ap) { FilterInfo fi, BluetoothMapAppParams ap) { if ((ap.getParameterMask() & MASK_PRIORITY) != 0) { String priority = "no"; String priority = "no"; if ((ap.getParameterMask() & MASK_PRIORITY) != 0) { int pri = 0; if (fi.msgType == FilterInfo.TYPE_MMS) { pri = c.getInt(c.getColumnIndex(Mms.PRIORITY)); } if (pri == PduHeaders.PRIORITY_HIGH) { priority = "yes"; } if (D) Log.d(TAG, "setPriority: " + priority); if (D) Log.d(TAG, "setPriority: " + priority); e.setPriority(priority); e.setPriority(priority); } } Loading Loading @@ -1051,6 +1059,23 @@ public class BluetoothMapContent { return where; return where; } } private String setWhereFilterPriority(BluetoothMapAppParams ap, FilterInfo fi) { String where = ""; int pri = ap.getFilterPriority(); /*only MMS have priority info */ if(fi.msgType == FilterInfo.TYPE_MMS) { if(pri == 0x0002) { where += " AND " + Mms.PRIORITY + "<=" + Integer.toString(PduHeaders.PRIORITY_NORMAL); }else if(pri == 0x0001) { where += " AND " + Mms.PRIORITY + "=" + Integer.toString(PduHeaders.PRIORITY_HIGH); } } return where; } private String setWhereFilterRecipient(BluetoothMapAppParams ap, private String setWhereFilterRecipient(BluetoothMapAppParams ap, FilterInfo fi) { FilterInfo fi) { Loading Loading @@ -1094,6 +1119,7 @@ public class BluetoothMapContent { where += setWhereFilterFolderType(folder, fi); where += setWhereFilterFolderType(folder, fi); where += setWhereFilterReadStatus(ap); where += setWhereFilterReadStatus(ap); where += setWhereFilterPeriod(ap, fi); where += setWhereFilterPeriod(ap, fi); where += setWhereFilterPriority(ap,fi); /* where += setWhereFilterOriginator(ap, fi); */ /* where += setWhereFilterOriginator(ap, fi); */ /* where += setWhereFilterRecipient(ap, fi); */ /* where += setWhereFilterRecipient(ap, fi); */ Loading Loading @@ -1155,7 +1181,7 @@ public class BluetoothMapContent { if (smsSelected(fi, ap)) { if (smsSelected(fi, ap)) { fi.msgType = FilterInfo.TYPE_SMS; fi.msgType = FilterInfo.TYPE_SMS; if(ap.getFilterPriority() != 1){ /*SMS cannot have high priority*/ String where = setWhereFilter(folder, fi, ap); String where = setWhereFilter(folder, fi, ap); Cursor c = mResolver.query(Sms.CONTENT_URI, Cursor c = mResolver.query(Sms.CONTENT_URI, Loading @@ -1172,6 +1198,7 @@ public class BluetoothMapContent { c.close(); c.close(); } } } } } if (mmsSelected(fi, ap)) { if (mmsSelected(fi, ap)) { fi.msgType = FilterInfo.TYPE_MMS; fi.msgType = FilterInfo.TYPE_MMS; Loading