Loading android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java +16 −4 Original line number Original line Diff line number Diff line Loading @@ -1459,8 +1459,14 @@ public class BluetoothMapContentObserver { if (mTransmitEvents && // extract contact details only if needed if (mTransmitEvents && // extract contact details only if needed mMapEventReportVersion mMapEventReportVersion > BluetoothMapUtils.MAP_EVENT_REPORT_V10) { > BluetoothMapUtils.MAP_EVENT_REPORT_V10) { String date = BluetoothMapUtils.getDateTimeString( long timestamp = c.getLong(c.getColumnIndex(Sms.DATE)); c.getLong(c.getColumnIndex(Sms.DATE))); String date = BluetoothMapUtils.getDateTimeString(timestamp); if (BluetoothMapUtils.isDateTimeOlderThanOneYear(timestamp)) { // Skip sending new message events older than one year listChanged = false; msgListSms.remove(id); continue; } String subject = c.getString(c.getColumnIndex(Sms.BODY)); String subject = c.getString(c.getColumnIndex(Sms.BODY)); if (subject == null) { if (subject == null) { subject = ""; subject = ""; Loading Loading @@ -1631,8 +1637,14 @@ public class BluetoothMapContentObserver { if (mTransmitEvents && // extract contact details only if needed if (mTransmitEvents && // extract contact details only if needed mMapEventReportVersion mMapEventReportVersion != BluetoothMapUtils.MAP_EVENT_REPORT_V10) { != BluetoothMapUtils.MAP_EVENT_REPORT_V10) { String date = BluetoothMapUtils.getDateTimeString( long timestamp = c.getLong(c.getColumnIndex(Mms.DATE)); c.getLong(c.getColumnIndex(Mms.DATE))); String date = BluetoothMapUtils.getDateTimeString(timestamp); if (BluetoothMapUtils.isDateTimeOlderThanOneYear(timestamp)) { // Skip sending new message events older than one year listChanged = false; msgListMms.remove(id); continue; } String subject = c.getString(c.getColumnIndex(Mms.SUBJECT)); String subject = c.getString(c.getColumnIndex(Mms.SUBJECT)); if (subject == null || subject.length() == 0) { if (subject == null || subject.length() == 0) { /* Get subject from mms text body parts - if any exists */ /* Get subject from mms text body parts - if any exists */ Loading android/app/src/com/android/bluetooth/map/BluetoothMapUtils.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -677,6 +677,21 @@ public class BluetoothMapUtils { return format.format(cal.getTime()); 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) { static void savePeerSupportUtcTimeStamp(int remoteFeatureMask) { if ((remoteFeatureMask & MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) if ((remoteFeatureMask & MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) == MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) { == MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) { Loading Loading
android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java +16 −4 Original line number Original line Diff line number Diff line Loading @@ -1459,8 +1459,14 @@ public class BluetoothMapContentObserver { if (mTransmitEvents && // extract contact details only if needed if (mTransmitEvents && // extract contact details only if needed mMapEventReportVersion mMapEventReportVersion > BluetoothMapUtils.MAP_EVENT_REPORT_V10) { > BluetoothMapUtils.MAP_EVENT_REPORT_V10) { String date = BluetoothMapUtils.getDateTimeString( long timestamp = c.getLong(c.getColumnIndex(Sms.DATE)); c.getLong(c.getColumnIndex(Sms.DATE))); String date = BluetoothMapUtils.getDateTimeString(timestamp); if (BluetoothMapUtils.isDateTimeOlderThanOneYear(timestamp)) { // Skip sending new message events older than one year listChanged = false; msgListSms.remove(id); continue; } String subject = c.getString(c.getColumnIndex(Sms.BODY)); String subject = c.getString(c.getColumnIndex(Sms.BODY)); if (subject == null) { if (subject == null) { subject = ""; subject = ""; Loading Loading @@ -1631,8 +1637,14 @@ public class BluetoothMapContentObserver { if (mTransmitEvents && // extract contact details only if needed if (mTransmitEvents && // extract contact details only if needed mMapEventReportVersion mMapEventReportVersion != BluetoothMapUtils.MAP_EVENT_REPORT_V10) { != BluetoothMapUtils.MAP_EVENT_REPORT_V10) { String date = BluetoothMapUtils.getDateTimeString( long timestamp = c.getLong(c.getColumnIndex(Mms.DATE)); c.getLong(c.getColumnIndex(Mms.DATE))); String date = BluetoothMapUtils.getDateTimeString(timestamp); if (BluetoothMapUtils.isDateTimeOlderThanOneYear(timestamp)) { // Skip sending new message events older than one year listChanged = false; msgListMms.remove(id); continue; } String subject = c.getString(c.getColumnIndex(Mms.SUBJECT)); String subject = c.getString(c.getColumnIndex(Mms.SUBJECT)); if (subject == null || subject.length() == 0) { if (subject == null || subject.length() == 0) { /* Get subject from mms text body parts - if any exists */ /* Get subject from mms text body parts - if any exists */ Loading
android/app/src/com/android/bluetooth/map/BluetoothMapUtils.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -677,6 +677,21 @@ public class BluetoothMapUtils { return format.format(cal.getTime()); 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) { static void savePeerSupportUtcTimeStamp(int remoteFeatureMask) { if ((remoteFeatureMask & MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) if ((remoteFeatureMask & MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) == MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) { == MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) { Loading