History log of /frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f97f0535c2793c0f662a83fa6458f9d3241bd904 03-Apr-2017 fionaxu <fionaxu@google.com> group multi-part message by 3gppswappush

If a device only receives part of long SMS from the network,
and then at some time later received another WAP push with
the same msg_id & message_count, device should not try to
combine them as the same message, otherwise it will trigger
out of boundary crash since sequence numbers for concatenated
messages start at 1 and the exception is CDMA WAP PDU messages,
which use a 0-based index. Fix is trying to group long message
by message_count, message_id, address and 3gpp2wap.

Bug: 29773532
Test: runtest --path
frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/gsm/GsmInboundSmsHandlerTest.java
Change-Id: I18d80f6bad2541e63211b9d61be63d17d817773d
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
af7bc32573007f2ea1185fc5cb4f3980e1ff1304 24-Jan-2017 fionaxu <fionaxu@google.com> fix multi-part sms issue

- sending multi-part SMS via Email was broken in NYC since we are using display
originating address to group multi-part messages.
- In a common case, only the fist SMS comes with the right email
displaying address, thus fails to group sms together.
- Fix is keep using originating_address to aggregate Multi-part SMS and introduce a new column:
display_address in the raw table to check blocking addresses for both
phone number and email address

Bug: 34118154
Test: Manual & telephony unit tests
Change-Id: Ibd902e5ccbad34c0e1e97d7c699258dc4d2c867a
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
4ac3b86a52c65cdbc63a20893969cd5063ec0c21 25-May-2016 Amit Mahajan <amitmahajan@google.com> Merge "Do not register broadcastReceiver for all users." into nyc-dev
9b813aa455186511edd03bb738334a1acca7e7b3 24-May-2016 Amit Mahajan <amitmahajan@google.com> Do not register broadcastReceiver for all users.

Registering for all users makes it receive the intent for each
user which is not required.

Bug: 28933982
Change-Id: I797d4d3d4553658a7e4e5021f45dfef5bb6ff05c
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
8a54cdb7fdac1b325213a775939ccfc50dc65425 23-May-2016 Ji Yang <yangji@google.com> Revert "Revert "Remove the system new message notification automatically.""

This reverts commit de705fdb1d33c79ef676271fd6938120e15912f0.

The root cause was not caused by the original CL and it is now fixed.

BUG: 28874264

Change-Id: If250a2e59b8230fe54fdf5d35d3b669a70fe9a28
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
de705fdb1d33c79ef676271fd6938120e15912f0 21-May-2016 Ji Yang <yangji@google.com> Revert "Remove the system new message notification automatically."

This reverts commit d5059539e839b7bd1e9c62bbc0181444b38a6751.

Change-Id: I5fb1e9e000bc3cf59d6eb8c3a14c5c1fd908284f
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
d5059539e839b7bd1e9c62bbc0181444b38a6751 18-May-2016 Ji Yang <yangji@google.com> Remove the system new message notification automatically.

The notification is removed after user-unlock. It's no longer needed
at that point because the messaging app will show its own notification.

BUG: 28791378
Change-Id: I49f942e565cb8b830c763305483590323ba21e4b
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
a83613955a113b805729cd415aca50707529208a 18-May-2016 Amit Mahajan <amitmahajan@google.com> Changes to scan raw table right away if user is already unlocked.

Bug: 28821195
Change-Id: I79d7bcccbaa2e0bb4841c70b7188cff151b701f7
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
6e4abd849e12860a7459f7ec74496ca02b9d7ee0 28-Mar-2016 Amit Mahajan <amitmahajan@google.com> Changes to de-dup messages in SMS raw table.

Bug: 27820591
Change-Id: Ie3a28cdbbb533c74f456b7e942ddfc2cd0d66bb0
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
0acde342e973a838a46eebf57a03a5fcad12708e 04-Apr-2016 Amit Mahajan <amitmahajan@google.com> Revert "Changes to de-dup messages in SMS raw table."

This reverts commit 8fe2baabaae75ab2975fb642db9a91db75d1a11e.

Bug: 27974596
Change-Id: Id5284e9f3da34b028e0097dc8f0e43a98e3a7a86
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
8fe2baabaae75ab2975fb642db9a91db75d1a11e 28-Mar-2016 Amit Mahajan <amitmahajan@google.com> Changes to de-dup messages in SMS raw table.

Bug: 27820591
Change-Id: I6b071ec99a90d9f5195825ba3cd73cb54f61631b
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
871a2ec0bc8e8198aeb1913e7bf6cb22a7ff3604 18-Mar-2016 Amit Mahajan <amitmahajan@google.com> Unit tests for SmsBroadcastUndelivered.

The behavior that needs to be verified is strongly tied to
InboundSmsHandler so adding the tests in GsmInboundSmsHandlerTest.

Bug: 25691379
Change-Id: Icf62bf50c417964bb3a27587ec03452ea34c1cbd
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
dc7411e9fc8ac029a7bad8b85b0f24642a1774b6 10-Feb-2016 Ji Yang <yangji@google.com> Send EVENT_START_ACCEPTING_SMS to all inbound SMS handlers.

BUG: 26871989.

Change-Id: I077b9b43d63dcbfca4a58596151bc3c0ea761738
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
8f21e0c6528f015924d153350dd2a717d3b51f66 21-Jan-2016 Ji Yang <yangji@google.com> Postpone inbound SMS processing until credential-encrypted storage is unlocked.

A notification will be shown to the user and the inbound SMS will be kept
inside the raw table until credentail-encrypted storage is unlocked.

Bug: 26232405
Change-Id: I2854ced55d911ccaf61df908d7c00f8acd5fae51
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java
0d4bcdf379842af4b6304809156971e926f374f0 18-Mar-2013 Jake Hamby <jhamby@google.com> Refactor inbound (MT) SMS handling into new handler classes.

Moved all MT SMS handling to separate StateMachine classes, which
save all incoming PDUs in the SmsProvider "raw" table, previously
used only for storing PDUs of concatenated messages. Then we ACK the
message, before starting the ordered broadcast as usual. If a receiver
of the broadcast sets the status to failure, we ignore it, but in the
future we could provide a mechanism to redeliver the broadcast.

New classes are (without com.android.internal.telephony prefix):
- CellBroadcastHandler
- InboundSmsHandler
- InboundSmsTracker
- SmsBroadcastUndelivered
- WakeLockStateMachine
- cdma.CdmaInboundSmsHandler
- cdma.CdmaServiceCategoryProgramHandler
- gsm.GsmCellBroadcastHandler
- gsm.GsmInboundSmsHandler

This fixes a bug in the SMS dispatcher. Previously we delivered
incoming SM's as ordered broadcasts and then sent an acknowledgment
to the SMSC after the broadcast completed. It was possible for the
ordered broadcast to take over 20 seconds to complete, causing SMS
retransmissions because we didn't ACK quickly enough. Also, a
broadcast receiver could set the result code to failure (the AOSP
MMS app never does this), causing us to negatively acknowledge the
SMS, potentially leading to many retries and a backlog on the SMSC.

The reason for saving all PDUs in the raw table before ACKing is so
InboundSmsHandler can handle the failure case of a device crash or
power failure in between ACKing the message and the delivery of the
ordered broadcast to receivers. This is handled when the Phone class
starts, creating a new thread to run SmsBroadcastUndelivered.
This Runnable scans the raw table once, finding all complete
PDUs and sending IncomingSmsTrackers to the state machine to
broadcast them again to receivers. In the worst case, a message might
be added twice to the MMS inbox, but it won't be lost.

However, due to the current MMS app implementation, which immediately
acknowledges the ordered broadcast before starting a new Service to
process the message, there is a very short window of time when a
message could potentially be lost, if the MMS app or device crashed
after the ordered broadcast returns and the message is deleted from
the raw table, but before the MMS service has added the message to
its own tables. To fix this will probably require API changes.

Another improvement from this change: SmsBroadcastUndelivered also
deletes PDUs for incomplete multipart messages that are older than
30 days. We've never garbage collected this table in the past, so
it's possible for a phone to accumulate a number of old PDUs in the
raw table if not all components arrived successfully.

The wake lock handling is also improved in this version, as we now
acquire a wakelock when the state machine leaves the Idle state,
releasing it 3 seconds after returning to the idle state, instead
of the previous 5-second timeout. If a new SMS arrives while a
broadcast is being delivered, we add it to the raw table and ACK the
new PDU immediately, then send the InboundSmsTracker as a message to
handle when the previous broadcast completes.

In order to keep track of whether a PDU is in 3GPP or 3GPP2 format,
the destination port column of the raw table is extended with three
flags: 3GPP format, 3GPP2 format, and no destination port present.
Because the destination port is a 16-bit value in both 3GPP and
3GPP2, the upper bits of the destination port can be used for flags.
This saves us from having to modify the SMS provider to update the
DB version and to add extra columns to keep track of these flags.

Bug: 7099232
Change-Id: Ibbc01ccb83320f4b6112fe3dd31355eb6f570b67
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsBroadcastUndelivered.java