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

Commit 6c8ebf04 authored by Malcolm Chen's avatar Malcolm Chen
Browse files

Move getUndeliveredSmsExpirationTime out of while loop.

Move getUndeliveredSmsExpirationTime out of while loop so that
it only reads carrier config for once.

Bug: 79543663
Test: Build
Change-Id: I2d08c16ee893bc21ba1e722bcce72776e596a1b3
parent 3676a5ee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ public class SmsBroadcastUndelivered {
            }

            boolean isCurrentFormat3gpp2 = InboundSmsHandler.isCurrentFormat3gpp2();
            long expirationTime = getUndeliveredSmsExpirationTime(context);
            while (cursor.moveToNext()) {
                InboundSmsTracker tracker;
                try {
@@ -178,7 +179,6 @@ public class SmsBroadcastUndelivered {
                    Integer receivedCount = multiPartReceivedCount.get(reference);
                    if (receivedCount == null) {
                        multiPartReceivedCount.put(reference, 1);    // first segment seen
                        long expirationTime = getUndeliveredSmsExpirationTime(context);
                        if (tracker.getTimestamp() <
                                (System.currentTimeMillis() - expirationTime)) {
                            // older than 30 days; delete if we don't find all the segments