History log of /frameworks/opt/telephony/src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f486d010a5d9677afda526b88023fabbf3dd32d7 11-Apr-2017 Ta-wei Yen <twyen@google.com> Relax VVM originating number matching

The visual voicemail client can restrict the originating number for
VVM SMS to reduce false positives. The matching criteria used to be
exact match, which is too strict. Especially on CTS tests where
the formatting of the number cannot be controlled.

In this CL PhoneNumberUtils.compare() is used instead, which will
ignore formatting and country codes.

Bug: 37106950
Test: CTS android.telephony.cts.VisualVoicemailServiceTest
Change-Id: I2d28a3718b1a87f8618d171d71a08809763b9715
/frameworks/opt/telephony/src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java
d90bd83153068e9a77aacab98ad7da101ccb44be 30-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Allow port and originating number to be specified for VVM SMS" into oc-dev
a6db15590a22000a92d72102ba98b92f608458f3 09-Mar-2017 Ta-wei Yen <twyen@google.com> Allow port and originating number to be specified for VVM SMS

This CL allows the VisualVoicemailService to ignore SMS not from the
designated number or to the designated port.

The VVM SMS filer can be configured to allow only SMS from certain
number or to certain port to be considered as a VVM SMS.
For numbers if the list is not empty, the originating number must be
an exact match to one of the numbers in the list.
For port it can be exact port, any data SMS port, or anything
(default).

Change-Id: I3d4aa34a342ba93d23841c07cbda2c2806f89dc4
Fixes: 36075510
Test: VisualVoicemailSmsFilterTest
CTS VisualVoicemailServiceTest
/frameworks/opt/telephony/src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java
264b2081477f901786e80c28686f9eb5765ce38d 10-Mar-2017 Ta-wei Yen <twyen@google.com> Allow UTF-8 data SMS to be filtered as VVM SMS

The OMTP visual voicemail specification does not specify what the
VVM SMS is.

Previouly only data SMS that is encoded with the Data Coding Scheme
GSM 7bit or UCS2 can be recognized. These format cannot be sent with
SmsManager.sendDataMessage() and prevents CTS testing.

This CL will attempt to decode the 8bit binary DCS userdata as a UTF-8
string. This format can be sent with sendDataMessage()

Fixes: 33397325
Fixes: 36075510
Test: CTS VisualVoicemailServiceTest

Change-Id: I81aa2993d43d1a39e1192d02828a4d982475441f
/frameworks/opt/telephony/src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java
9e9d5109cabad749b0d1bcfa4ccc1efef546027f 23-Dec-2016 Ta-wei Yen <twyen@google.com> Send Filtered VVM SMS to telephony with phone account handle

This follows the public VisualVoicemailService using the
PhoneAccountHandle as account key instead of subId, and uses
VisualVoicmailSms to wrap the SMS content.

Also, previous design of the filter sent the broadcast directly to the
VVM client, which was always telephony. After this CL it will always
send to telephony which will relay it to the client.

Test: CTS tests in follow up CL
Change-Id: I45a3d276af9cb6f9509586f05fc8fc600e074c6b
/frameworks/opt/telephony/src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java
585c46499c06297f19129a024047e2feacd30753 19-Aug-2016 Ta-wei Yen <twyen@google.com> Add carrier regex filtering to VisualVoicemailSmsFilter

This CL adds a extra step in the VisualVoicemailSmsFilter which will
match the message body against the carrier specified regex. Even if
the message have a unknown format if it matches the regex it will
still be considered a VVM SMS.

For example, Verizon requires any SMS that starts with "//VZW" to be
dropped. Other cases are handled by the AppDirectedSms app, but
"//VZWVVM" is left for the system visual voicemail. Previously
"//VZWVVM garbage data" will pass though the filter because it is not
a valid VVM SMS, which is against the specification of dropping
everything. After this CL it will match the regex and dropped.
The VVM client will also receive the message body, but ignore it.

Change-Id: I8d446d69d75914bf5fe63834cfebec92f7917711
Fixes: 30954955
/frameworks/opt/telephony/src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java
9452da00610c4d8c4378ee112de88214d4ec4383 16-Jul-2016 Ta-wei Yen <twyen@google.com> Handle Verizon iPhone WAP push for VVM

Verizon iPhone WAP push is a pure ASCII message, which is used to be
dropped by the system.

this CL will attempt to parse such SMS as an "alternative" VVM format.
The filter will not drop the SMS.

Change-Id: I7ea68bfa7a0bdc190fdc86c85c0e532cbf301e74
Fixes: 30123702
/frameworks/opt/telephony/src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java
54543184e3fd345fe0c96d4d96022ad4f058e410 26-May-2016 Amit Mahajan <amitmahajan@google.com> Additional sms segment de-duping for multi-part SMS.

Adding de-duping logic for segments with same parameters that can
cause ambiguity when concatenating them to get the complete
message.

Bug: 28932719
Change-Id: I187942d8384dc18d4311265441d076f085651c67
/frameworks/opt/telephony/src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java
649d6ef94525802e2911d4063431e3207e452810 07-Jun-2016 Ta-wei Yen <twyen@google.com> Fix VisualVoicemailSmsFilter NPE on invalid SmsMessage

Certain PDU will cause createFromPdu() to return a SmsMessage with null
mWrappedSmsMessage, throwing NPE on any method called. In this case, just
ignore the message.

Bug:29123941
Change-Id: Id649af4b7a7a9f5d7b7a08d007b619a4c98f81cb
/frameworks/opt/telephony/src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java
5580eae0ac10c1b38aae54b6e9f45b4259f409e2 23-May-2016 Ta-wei Yen <twyen@google.com> Switch VVM SMS filter to Builder pattern

Bug:27816386
Change-Id: Ibc3c6ba4487b4a45472c3fc066895828bb796e22
/frameworks/opt/telephony/src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java
3081824ff4942b9bd19db7a0d9918e188c7f69d1 14-May-2016 Ta-wei Yen <twyen@google.com> Add VisualVoicemailSmsFilter

Several implementation exists for OMTP-like visual voicemail SMS
interfaces because what type of SMS to use is not specified.
Before this CL we can only handle data SMS using the DATA_SMS_RECEIVED
broadcast. With this CL, we can handle data, text and type-0 SMS.

SMS filters will potentially do actions base on the SMS or drop it, so
proper priority should be established to make them work nicely together.

The android framework already provides the CarrierMessagingService
interface to filter SMS. There are 2 possible packages that implements
the interface, the carrier package and the system package. One of them
if any will be chosen to do the filtering. The carrier package is
installed with user interaction and have complex restraints. The
system package is preloaded by the OEM.

If there's a carrier package, we will filter after the carrier package
as it should have priority. If there's a system app, we will filter
before it as we offered mechanism to enable/disable us.

For type-0 SMS, we will filter it before it is going to be dropped.

We will filter visual voicemail SMS based on the content of the message.
A visual voicemail SMS should start with a certain prefix defined
through TelephonyManager, have a event field, and the rest of the message
is consist of OMTP key-value pairs. Future CL will add further
restrictions like originating number and destination port number to
reduce false positives.

If the parsing succeeded, we will compile it into a intent and send a
broadcast. The broadcast is to be made explicit in a future CL.

Bug:27816386
Bug:27817303
Change-Id: I120418d344a1537ff006583759659fa025cac712
(cherry picked from commit 0aa683b47dfd8590f71d88e0814dade4503f0b5d)
/frameworks/opt/telephony/src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java