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

Commit af749614 authored by Christine Hallstrom's avatar Christine Hallstrom Committed by Automerger Merge Worker
Browse files

Merge "Revert "Don't send MAP new message events if older than one year"" into...

Merge "Revert "Don't send MAP new message events if older than one year"" into tm-qpr-dev am: fe6526ee am: d07e5102

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/21013666



Change-Id: Icf71030de4b045db4c305150e581959a3ea49e7a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 898fcaee d07e5102
Loading
Loading
Loading
Loading
+4 −16
Original line number Diff line number Diff line
@@ -1466,14 +1466,8 @@ public class BluetoothMapContentObserver {
                            if (mTransmitEvents && // extract contact details only if needed
                                    mMapEventReportVersion
                                            > BluetoothMapUtils.MAP_EVENT_REPORT_V10) {
                                long timestamp = 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 date = BluetoothMapUtils.getDateTimeString(
                                        c.getLong(c.getColumnIndex(Sms.DATE)));
                                String subject = c.getString(c.getColumnIndex(Sms.BODY));
                                if (subject == null) {
                                    subject = "";
@@ -1644,14 +1638,8 @@ public class BluetoothMapContentObserver {
                            if (mTransmitEvents && // extract contact details only if needed
                                    mMapEventReportVersion
                                            != BluetoothMapUtils.MAP_EVENT_REPORT_V10) {
                                long timestamp = 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 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 */
+0 −15
Original line number Diff line number Diff line
@@ -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) {