History log of /frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ace9a749c5a2a5e07527f728b7331423d16c36cd 30-Oct-2013 Sukanya Rajkhowa <srajkh@codeaurora.org> SMS over IMS bug fixes

This change includes the following:
1) SMS over IMS remaining patches which address review comments

2) Fix for Bug:11378993
For MT SMS over IMS, if an application uses the createFromPdu(byte[] pdu) API
instead of createFromPdu(byte[] pdu,String format) API, we first try to create
SmsMessage from raw PDU with the format of active phone. That either returns a
valid SmsMessage object or throws a RuntimeException causing the correct format
to be used the next time. If GsmSmsAddress is not valid, we should throw
a RuntimeException which is handled by createFromPdu(byte[] pdu)

3) Fix for Bug:11424054
Register for ICC changes and handle new SMS on ICC

Bug: 11378993, 11424054
Change-Id: I94bcfcf93d8205c2916997091617899c6ebdd5e5
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
4931e2c19616ab5985f61f343b231efb33692241 01-Nov-2013 Zhihai Xu <zhihaixu@google.com> problem to send SMS message by bluetooth MAP profile.

Currently SMSDispatcher will add the message to Sms.Sent database
for all non default SMS application.
This won't work for Bluetooth MAP profile.
In the bluetooth MAP spec, at 5.8 PushMessageFunction,
there are a parameter to control how to send the message by Bluetooth MAP.
Transparent:This parameter may be used to indicate to the MSE(phone)
that no copy of the message shall be kept in the 'Sent' folder
after the message was sent. This is especially useful for telematics applications,
e.g., frequent sending of car's speed and position for traffic measurements
(floating car data).
This application parameter is optional. The value of this parameter is "OFF"
(keep messages in 'Sent' folder) and "ON" (don't keep messages in Sent' folder).
If Transparent is "ON", we shouldn't put the message in Sent folder.
SMSDispatcher always put the message in Sms.Sent
which is mapped to the Sent folder in bluetooth MAP.
Prefer to let bluetooth to decide whether put the message in Sms.Sent based
on Transparent parameter value.

bug:11454636
Change-Id: I2e6c8deb5c4ed8bc9a3d90d492f4d4eb7dac7e5c
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
0217e2d6e60f7edd95407c7b385a627da9f1c1e3 17-Oct-2013 David Braun <dabraun@google.com> Persist SMS messages sent by other than the default SMS app

Bug: 11256715 SmsManger.sendTextMessage() and SmsManager.sendMultiPartTextMessage() need to store the message in SmsProvider if called from non-default SMS app
Change-Id: I9f08435edd767f39863d018d59ec1d44e3d2128b
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
1260f1c6c909f2940989b72afe1b91fd83845eaa 14-Sep-2013 Sukanya Rajkhowa <srajkh@codeaurora.org> Support SMS over IMS

ImsSMSDispatcher is part of IccSmsInterfaceManager.
It always receives calls to send sms first and decides
whether to use ims call flow or gsm/cdma based on response
to REQUEST_IMS_REGISTRATION_STATE.

When ims is registered and sms is supported, the request also returns
sms format to use.

In case of sms over ims failure, RIL_REQUEST_IMS_SEND_SMS sets
messageRef from RIL_SMS_RESPONSE of corresponding failed MO SMS, and
sets retry field to non-zero. If voice is available, sends
RIL_REQUEST_IMS_SEND_SMS retries with data encoded based on voice tech
available. If voice is not available, sets retry counter to max and
skips retries and sends failure to client.

Bug: 9626411

Change-Id: I4c63c8fc0eb2191847b509e66772e3de27d491ed
Signed-off-by: Ed Tam <etam@google.com>

Conflicts:
src/java/com/android/internal/telephony/gsm/GSMPhone.java
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
ec125af4306f1be2c829c3a1d7adbf9b8cd7e659 06-Aug-2013 William Luh <williamluh@google.com> Change the SMS event logging to "packages" aggregation, which requires the app uid.

Change-Id: Ic3927b5764909b4ec8dc64fc41118f9057814656
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
634a24f56f54b5d2911649288147c750b67c7ae4 23-Jul-2013 William Luh <williamluh@google.com> Add prefix to SMS event tag

Legal requires user consent for logging these in production (non-dogfood).
We will be filtering based on the specific tag prefix of exp_det_.

Change-Id: Id3d869c1b31716cee3e6ae98d3b840ef7f948e42
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.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/SMSDispatcher.java
5a176f73dbb2bff2ca8b8f86af86a17be6863b87 11-Mar-2013 Wink Saville <wink@google.com> Merge commit '958e7316' into fix-merge-conflict

* commit '958e7316':
Telephony: Set TP-RD to 1 in case of retry

Change-Id: I298e588b1076686e2c7c4b3714b46d2637b04079
454c5783e7695feec276325920550b2d4dcc3e16 07-Jun-2012 Rika Brooks <rbrooks@codeaurora.org> Telephony: Set TP-RD to 1 in case of retry

per TS 23.040 Section 9.2.3.6: In the case where no response or an
RP-ERROR with an appropriate cause value (see 3GPP TS 24.011 [13]) is
received in response to an SMS-SUBMIT, then the MS shall automatically
repeat the SMS-SUBMIT but must use the same TP-MR value
and set the TP-RD bit to 1 (see 9.2.3.25)

Bug: 8323645
Change-Id: I1c7ebc67f80a6eeba456ab0dc5f6331a038d7ab2
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
22d85a8e3a575a6d01d2c788587971657dfe20c6 23-Feb-2013 Wink Saville <wink@google.com> Clean up member variables.

Change-Id: Ib60f350131ade626aca682407ea0b4377b16f6c6
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
cbaa45bbf2cab852b6c9c3a887e9f803d4e857ea 23-Feb-2013 Wink Saville <wink@google.com> Clean up

- Add @Overrides where needed.
- Update javadoc comments
- Remove extra semi-colons
- Rename DataConnection.java to DataConnectionBase.java
- Rename GsmDataConnection.java to DataConnection.java
- Add defaults to switch statements
- Remove/fix most "if (false)" statements. Fixed by using a CONSTANT
- Fix hidden variables by hoisting to base class or renaming
- Tweak some debug output

Change-Id: If38de2fdeaacafbf40cdfd7f84dc5c52030ba2a3
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
7fce994eb223105829becb6c26e3af7a9739752c 05-Feb-2013 Dianne Hackborn <hackbod@google.com> Add new app ops for sending/receiving SMS messages.

There are a variety of new app ops for various kind of
SMS operations: reading, writing, sending, receiving, on
ICC card, MMS, etc. These are instrumented in the telephony
framework; the controls for access to these features are
rolled up to either sending or receiving SMS.

Change-Id: Ie18b09d77fac555aaa169eb6fdfba44dd8078976
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
eabfd15c321499201e9d150fe16288c2d43b7787 10-Jan-2013 Jake Hamby <jhamby@google.com> Merge "Telephony: Don't ack CB messages"
ac57a399534677ebfcfef530f1529d5d7f3d3c49 09-Jan-2013 Jake Hamby <jhamby@google.com> Merge "Telephony: Check SmsTracker's mSentIntent for null"
ded9c0af7fa49504c047275ed34c2d3b22bf0c3a 07-Dec-2012 Wink Saville <wink@google.com> Use Rlog

Change-Id: Ie013f51215de8380b8de74161b6056b010711cfd
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
78df2f47241a498bbd919c4c19a44b824e5dc2d6 25-Sep-2012 Robert Greenwalt <rgreenwalt@google.com> Fix the premium-SMS UI.

Add instructions to undo permanent selections.
bug:7205024

Change-Id: I970e41019c66ef77ed62c9cd017571e308744380
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
ee7b6094d4f3d4c641e54246aec8f61349d6e9d0 22-Sep-2012 Robert Greenwalt <rgreenwalt@google.com> Add gservices-controllable rules policy.

Allows using SIM country, network country or the most restrictive of both.
bug:7205426

Change-Id: I4f7ec6ef884d8cc3665fe60290c167740f17d9e7
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
5d875796122cdd8a7004e8e3964b20b5c65a31a1 20-Sep-2012 Robert Greenwalt <rgreenwalt@google.com> Fix string in sms_short_code confirm dialog.

Typo used the wrong string giving "allow, allow" options after toggling
the remember-my-choice checkbox.

bug:7198380
Change-Id: Ia9bf3da44a1153838c618bd8c6b722235629e853
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
4658a1a8c23111d5cc89feb040ce547a7b65dfb0 06-Sep-2012 Jake Hamby <jhamby@google.com> Add support for per-package policy for sending premium SMS.

The default behavior for sending a message to a premium SMS
short code (or suspected premium SMS number) is to ask the user for
confirmation. Enable the user to set a default policy ("remember this
choice" checkbox) to always/never allow the app to send SMS to
premium short codes in the future. The policy can be changed by
the Settings app in the app info screen.

Bug: 5513975
Change-Id: I82731bbc6631ac79b1b5d1d9b1f96c7100ab20cf
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
2029d86b5aebd03f7acbd249a4e2e4f65ec37d47 08-Sep-2012 Geremy Condra <gcondra@google.com> Add event logging for SMS

This allows us to gather metrics about unwanted SMS use on
dogfood devices.

Change-Id: I00820b12219dde918d6d7adee3ccf03c576424c9
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
bb8277c9c32f77d71dcc393b9baa19a3ffbeb0a6 15-Aug-2012 Alex Yakavenka <ayakaven@codeaurora.org> Telephony: Don't ack CB messages

SmsDispatcher receives its own broadcast to ack messages.
CB message needs to be excluded from the acking code since
it should not be acked.

Change-Id: I3f1496bb0c81a8edcc4173661e2ca75b03a9c6fb
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
a13eb8b86f22b0efcfb888e2491b007d3424dddd 08-Nov-2011 Rekha Kumar <rekhak@codeaurora.org> Telephony: Check SmsTracker's mSentIntent for null

When SmsManager's sendMultipartTextMessage is invoked with null sentIntents,
the SmsTracker object is initialized with mSentIntent as null.
This causes NullPointerException.

Change-Id: I545c4a23676ba67f6a5523f15564993f001e48ca
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
b8a13d300b245e0080aa01275e232f54d5d0e09c 25-Jul-2012 Jake Hamby <jhamby@google.com> Implement CMAS service category program results.

Correctly handle CDMA Service Category Program Data requests,
and send the SCPT response to the message center. Parcel SCPD
operations as an ArrayList instead of an array (current version
will throw ClassCastException when the array is cast).

Bug: 6853691
Change-Id: I949ea68891c78306059248832e59a593ab606e11
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
c38bb60d867c5d61d90b7179a9ed2b2d1848124f 12-Jul-2012 Wink Saville <wink@google.com> Create telephony-common - DO NOT MERGE

telephony-common was created by moving some of
frameworks/base/telephony
to:
frameworks/opt/telephony

Change-Id: I32cbb5eec1fa239c1587e055c8f7ef4fc48fb62c
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java
0825495a331bb44df395a0cdb79fab85e68db5d5 12-Jul-2012 Wink Saville <wink@google.com> Create telephony-common

telephony-common was created by moving some of
frameworks/base/telephony
to:
frameworks/opt/telephony

Change-Id: I32cbb5eec1fa239c1587e055c8f7ef4fc48fb62c
/frameworks/opt/telephony/src/java/com/android/internal/telephony/SMSDispatcher.java