Loading android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java +4 −12 Original line number Diff line number Diff line Loading @@ -1420,7 +1420,6 @@ public class BluetoothMapContentObserver { int type = c.getInt(c.getColumnIndex(Sms.TYPE)); int threadId = c.getInt(c.getColumnIndex(Sms.THREAD_ID)); int read = c.getInt(c.getColumnIndex(Sms.READ)); long timestamp = c.getLong(c.getColumnIndex(Sms.DATE)); Msg msg = getMsgListSms().remove(id); Loading @@ -1428,10 +1427,6 @@ public class BluetoothMapContentObserver { * a message deleted and/or MessageShift for messages deleted by the MCE. */ if (msg == null) { if (BluetoothMapUtils.isDateTimeOlderThanOneYear(timestamp)) { // Skip sending new message events older than one year continue; } /* New message */ msg = new Msg(id, type, threadId, read); msgListSms.put(id, msg); Loading @@ -1440,7 +1435,8 @@ public class BluetoothMapContentObserver { if (mTransmitEvents && // extract contact details only if needed mMapEventReportVersion > BluetoothMapUtils.MAP_EVENT_REPORT_V10) { String date = BluetoothMapUtils.getDateTimeString(timestamp); String date = BluetoothMapUtils.getDateTimeString( c.getLong(c.getColumnIndex(Sms.DATE))); String subject = c.getString(c.getColumnIndex(Sms.BODY)); if (subject == null) { subject = ""; Loading Loading @@ -1587,7 +1583,6 @@ public class BluetoothMapContentObserver { // TODO: Go through code to see if we have an issue with mismatch in types // for threadId. Seems to be a long in DB?? int read = c.getInt(c.getColumnIndex(Mms.READ)); long timestamp = c.getLong(c.getColumnIndex(Mms.DATE)); Msg msg = getMsgListMms().remove(id); Loading @@ -1596,10 +1591,6 @@ public class BluetoothMapContentObserver { * MCE.*/ if (msg == null) { if (BluetoothMapUtils.isDateTimeOlderThanOneYear(timestamp)) { // Skip sending new message events older than one year continue; } /* New message - only notify on retrieve conf */ listChanged = true; if (getMmsFolderName(type).equalsIgnoreCase( Loading @@ -1613,7 +1604,8 @@ public class BluetoothMapContentObserver { if (mTransmitEvents && // extract contact details only if needed mMapEventReportVersion != BluetoothMapUtils.MAP_EVENT_REPORT_V10) { String date = BluetoothMapUtils.getDateTimeString(timestamp); String date = BluetoothMapUtils.getDateTimeString( c.getLong(c.getColumnIndex(Mms.DATE))); String subject = c.getString(c.getColumnIndex(Mms.SUBJECT)); if (subject == null || subject.length() == 0) { /* Get subject from mms text body parts - if any exists */ Loading android/app/src/com/android/bluetooth/map/BluetoothMapUtils.java +0 −15 Original line number Diff line number Diff line Loading @@ -677,21 +677,6 @@ public class BluetoothMapUtils { return format.format(cal.getTime()); } static boolean isDateTimeOlderThanOneYear(long timestamp) { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(timestamp); Calendar oneYearAgo = Calendar.getInstance(); oneYearAgo.add(Calendar.YEAR, -1); if (cal.compareTo(oneYearAgo) > 0) { if (V) { Log.v(TAG, "isDateTimeOlderThanOneYear timestamp : " + timestamp + " oneYearAgo: " + oneYearAgo); } return true; } return false; } static void savePeerSupportUtcTimeStamp(int remoteFeatureMask) { if ((remoteFeatureMask & MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) == MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) { Loading Loading
android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java +4 −12 Original line number Diff line number Diff line Loading @@ -1420,7 +1420,6 @@ public class BluetoothMapContentObserver { int type = c.getInt(c.getColumnIndex(Sms.TYPE)); int threadId = c.getInt(c.getColumnIndex(Sms.THREAD_ID)); int read = c.getInt(c.getColumnIndex(Sms.READ)); long timestamp = c.getLong(c.getColumnIndex(Sms.DATE)); Msg msg = getMsgListSms().remove(id); Loading @@ -1428,10 +1427,6 @@ public class BluetoothMapContentObserver { * a message deleted and/or MessageShift for messages deleted by the MCE. */ if (msg == null) { if (BluetoothMapUtils.isDateTimeOlderThanOneYear(timestamp)) { // Skip sending new message events older than one year continue; } /* New message */ msg = new Msg(id, type, threadId, read); msgListSms.put(id, msg); Loading @@ -1440,7 +1435,8 @@ public class BluetoothMapContentObserver { if (mTransmitEvents && // extract contact details only if needed mMapEventReportVersion > BluetoothMapUtils.MAP_EVENT_REPORT_V10) { String date = BluetoothMapUtils.getDateTimeString(timestamp); String date = BluetoothMapUtils.getDateTimeString( c.getLong(c.getColumnIndex(Sms.DATE))); String subject = c.getString(c.getColumnIndex(Sms.BODY)); if (subject == null) { subject = ""; Loading Loading @@ -1587,7 +1583,6 @@ public class BluetoothMapContentObserver { // TODO: Go through code to see if we have an issue with mismatch in types // for threadId. Seems to be a long in DB?? int read = c.getInt(c.getColumnIndex(Mms.READ)); long timestamp = c.getLong(c.getColumnIndex(Mms.DATE)); Msg msg = getMsgListMms().remove(id); Loading @@ -1596,10 +1591,6 @@ public class BluetoothMapContentObserver { * MCE.*/ if (msg == null) { if (BluetoothMapUtils.isDateTimeOlderThanOneYear(timestamp)) { // Skip sending new message events older than one year continue; } /* New message - only notify on retrieve conf */ listChanged = true; if (getMmsFolderName(type).equalsIgnoreCase( Loading @@ -1613,7 +1604,8 @@ public class BluetoothMapContentObserver { if (mTransmitEvents && // extract contact details only if needed mMapEventReportVersion != BluetoothMapUtils.MAP_EVENT_REPORT_V10) { String date = BluetoothMapUtils.getDateTimeString(timestamp); String date = BluetoothMapUtils.getDateTimeString( c.getLong(c.getColumnIndex(Mms.DATE))); String subject = c.getString(c.getColumnIndex(Mms.SUBJECT)); if (subject == null || subject.length() == 0) { /* Get subject from mms text body parts - if any exists */ Loading
android/app/src/com/android/bluetooth/map/BluetoothMapUtils.java +0 −15 Original line number Diff line number Diff line Loading @@ -677,21 +677,6 @@ public class BluetoothMapUtils { return format.format(cal.getTime()); } static boolean isDateTimeOlderThanOneYear(long timestamp) { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(timestamp); Calendar oneYearAgo = Calendar.getInstance(); oneYearAgo.add(Calendar.YEAR, -1); if (cal.compareTo(oneYearAgo) > 0) { if (V) { Log.v(TAG, "isDateTimeOlderThanOneYear timestamp : " + timestamp + " oneYearAgo: " + oneYearAgo); } return true; } return false; } static void savePeerSupportUtcTimeStamp(int remoteFeatureMask) { if ((remoteFeatureMask & MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) == MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) { Loading