Commit Graph
62 Commits
Author SHA1 Message Date
Treehugger Robot 5500d33555 Merge "Fix assertion failures caused by different instance type" 2019-06-21 22:21:40 +00:00
Treehugger Robot 0e3986db52 Merge "Fix MMS Config issues in Debug menu" 2019-06-21 22:09:41 +00:00
Taesu Lee 77a839f1ef Apply new duplication detection logic for M-Notification.ind
The X-Mms-Transaction-ID of the M-Notification.ind identifies each
M-Notification.ind message. New duplication detection logic compares
the new X-Mms-Transaction-ID with the stored value to identify the
Network duplicate M-Notification.ind message when it receives a new
M-Notification.ind message.

Following SQL WHERE clause is used to query from the DB.
 ((m_type=NOTIFICATION_IND) OR (m_type=RETRIEVE_CONF)) AND (exp>NOW))
 AND (t_id=xxxxxx)

For this, when the M-Retrieve.conf is received, updates the t_id and the
exp from the corresponding M-Notification.ind so that new logic would
work even after the M-Notification.ind is deleted.

Test: Manual

Change-Id: I86e1eee62ea612d96ca16e5384b044cb6541ff6a
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-06-14 16:45:30 +09:00
Treehugger Robot a6f1ae137d Merge "Use correct format info for SMS" 2019-06-12 01:38:23 +00:00
Treehugger Robot 4e3db63e41 Merge "Fix SMS status handling" 2019-06-12 00:18:44 +00:00
Treehugger Robot aa5bde8dbe Merge "Fix X-Mms-Transaction-ID of M-Acknowledge.ind" 2019-06-12 00:12:16 +00:00
Taesu Lee 6c3770a7ea Fix wrong PreferenceCategory for SMS delivery report
Test: Manual

Change-Id: I3008c596e5559e51613ed2da43793187c79381f5
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-05-31 14:54:31 +09:00
Taesu Lee 2771ac7ae9 Fix assertion failures caused by different instance type
onAttachFragment() with ReportFragment instance is called first since
Support Library 26.1.0 has been applied. Remove assert() and check
instance to fix crash caused by the ReportFragement.

Test: Manual

Change-Id: I5a4d6bdd00ac94c5892527f5fe784b8f19701214
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-05-30 16:52:56 +09:00
Raman Tenneti 1e56062ac9 Merge "Messaging: Fix generating id in android namespace" 2019-05-23 22:26:29 +00:00
Taesu Lee 84f8649354 Fix MMS Config issues in Debug menu
Fix
 - Wrong order of args for update().
 - Wrong and missing configs in keyType map.
And remove MMS config keys from the key list if the keyType map doesn't
include them.

Test: Manual

Change-Id: Ib1876072625187baf15ce6e64f90785ed0ba3df8
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-04-30 15:04:32 +09:00
Colin Cross 485b019679 Update messaging for guava 27.1
CharMatcher.ASCII has been replaced with CharMatcher.ascii().

Bug: 130306229
Test: m checkbuild
Change-Id: I21473e2aa5e432b135fac7f1ecf0a85f52f3951e
Merged-In: I21473e2aa5e432b135fac7f1ecf0a85f52f3951e
Exempt-From-Owner-Approval: cherry pick
(cherry picked from commit 63cffd0246)
2019-04-15 21:45:16 -07:00
Taesu Lee 4708388210 Use correct format info for SMS
Use correct format to
 - Parse SMS delivery report.
 - Dump/Load SMS to/from the dump file.

TODO: Update message text state during composing.
Test: Manual

Change-Id: I7e53bed86130484a634c9305b276e2586db31796
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-03-21 13:23:40 +09:00
Taesu Lee 4b1c6eb2c9 Fix SMS status handling
Simple matching up CDMA status with GSM TP-Status for common handling.
And fix bugleStatusForSMS() for all the permanent error cases.

Note: Need to check SC operation for ERROR_TEMPORARY.
Test: Manual

Change-Id: Ic8136d273dc0c25a4f0690f951d4d8aca20579ff
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-03-15 16:22:48 +09:00
Taesu Lee 87811542d0 Fix X-Mms-Transaction-ID of M-Acknowledge.ind
X-Mms-Transaction-ID of M-Acknowledge.ind should be set as the
corresponding M-Retrieve.conf's transaction ID instead of
M-Notification.ind's one.
(OMA-TS-MMS_ENC-V1_3-20110913-A)

Test: Manual

Change-Id: I250f32b93cdfbed815206543df5486efa4df18eb
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2019-03-13 12:16:09 +09:00
Michael Bestas a6accb4a53 Messaging: Fix generating id in android namespace
Fixes:
res/layout/apn_preference_layout.xml:40: warn:
generated id 'android:id/title' for external package 'android'.
res/layout/apn_preference_layout.xml:48: warn:
generated id 'android:id/summary' for external package 'android'.

Change-Id: Ia096fa2e072ba4391e3adad52d3f9c9abed0e976
2019-03-03 16:23:45 +02:00
Raman Tenneti cdf40bb061 AOSP/Messaging - update the Messaging version to target P (28) or higher.
Use JobIntentService to start the Backgroundworkerservice and
ActionServiceImpl services.

+ Deleted WakeLock code.
+ Made changes to com.android.messaging.test tests so that all tests
  pass with the new JobService. I am not sure if these tests passed
  before these changes.
+ CTS tests passed without any changes.
+ Added TEST_MAPPING file for presubmit tests.

Bug: 115499280
Bug: 119503204

Test: manual - Tested the messaging UI. Ran the following CTS tests on Pixel phone.

$ make -j 40
  rw-r--r-- 1 rtenneti primarygroup 8624061 Feb 19 12:37 out/target/product/marlin/system/app/messaging/messaging.apk

$ make messagingtests -j
  -rw-r--r-- 1 rtenneti primarygroup 729713 Feb 19 12:52 out/target/product/marlin/testcases/messagingtests/messagingtests.apk

$ adb install -r -d out/target/product/marlin/system/app/messaging/messaging.apk

$ adb install -r -d out/target/product/marlin/testcases/messagingtests/messagingtests.apk

$ adb shell am instrument -w com.android.messaging.test
  Test results for InstrumentationTestRunner=...........
  Time: 13.353
  OK (113 tests)

CTS tests for Mesaging app
---------------------------
$ ./development/testrunner/runtest.py --path cts/tests/app/src/android/app/cts/NotificationTest.java
  android.app.cts.NotificationTest:...........................
  Time: 0.299
  OK (27 tests)

atest
-----
$ cd .../packages/apps/Messaging
$ atest
  Running Tests...
  messagingtests (113 Tests)
  -------------------------
  ...
  [113/113] com.android.messaging.util.YouTubeUtilTest#testGetYoutubePreviewImageLink: PASSED (2ms)

  Results from tests that require device:

  Summary
  -------
  messagingtests: Passed: 113, Failed: 0, Ignored: 0

  All tests passed!

Change-Id: I9494f0750954e6364abb695aa867494669ae54c4
2019-02-19 14:52:18 -08:00
Aurimas Liutikas 1b693ea7df Migrate Messaging to androidx.
Test: make messaging
Bug: 76692459
Change-Id: I9103450622f129311545648ac75f5b2f9fc2d04a
Merged-In: I9103450622f129311545648ac75f5b2f9fc2d04a
2019-02-14 22:59:57 +00:00
calvinpan 7ea2a930be Migrate to TelephonyProvider new URI when query the current sim APN
Since MCC, MNC and MVNO is deprecated in the TelephonyProvider and
query based on SIM_APN_URI will return all matching APNs from current
subscription carrier, so migrate to the new URI.

Bug: 115709816
Test: Build pass.
Change-Id: I260f2da2677564f37ef6a7711d45040a61215ddc
Merged-In: I260f2da2677564f37ef6a7711d45040a61215ddc
2019-01-18 03:25:55 +00:00
Atanas Kirilov dc683fa0fd Merge changes from topic "am-d8363787-88bb-4e45-b57c-b18d9d8290cb" into oc-dev am: f7bdc8fd87 am: 24fba8cf55
am: 8f2f5671b0

Change-Id: If409352ed52e8b4a1bf92b2bceedf5f032e8a7ed
2018-06-01 03:47:45 -07:00
Android Build Merger (Role) 870a173e43 [automerger] Messaging ignores file URIs shared via intent am: 9deefdf182 am: ea03db3303 am: cd77076596 am: 9c69271a58 am: 0c21193863
Change-Id: Ifd8f26ed2cfc372c039fffa192a49293f234890b
2018-05-25 23:24:07 +00:00
Android Build Merger (Role) ea03db3303 [automerger] Messaging ignores file URIs shared via intent am: 9deefdf182
Change-Id: Ieaca25fa19b578953f88da445e2ecbd4b15f3a98
2018-05-25 23:24:03 +00:00
David Smith 9deefdf182 Messaging ignores file URIs shared via intent
Fixes b/37629504 by not creating attachments from file URIs shared via
intent. Sharing file URIs is disallowed by Android N and later and is no
longer supported for this app.

Test: manual using the Debug command added in this change

Change-Id: Ibff486c94ac703a9a4c5a80e33b934a460804a8f
Merged-In: Ibff486c94ac703a9a4c5a80e33b934a460804a8f
2018-05-25 23:24:02 +00:00
Vasu Nori 871938aa2c Revert "Enable content observer notifications even for default SMS app, when the"
This reverts commit 2e0bf0af27.

Reason for revert: should not be in P

Change-Id: I457ebe79e66abb21a9d2fc1c168802b8505c5e9f
2018-02-28 17:34:49 +00:00
Vasu Nori 2e0bf0af27 Enable content observer notifications even for default SMS app, when the
build is for Android Auto

Bug: 71633682
Test: tested manually
Change-Id: Iee139fd7a65f60cd6c059f5c6d2ef78464e0dfce
2018-02-15 16:00:01 -08:00
Tom Taylor 467361dbcf 37742976 - Catch bad gifs
* A security researcher crafted a gif that would cause the Android
Bitmap code to throw an NPE. That would cause messaging to crash when
decoding the NPE. The frameworks team is changing the underlying code to
throw an OutOfMemoryError instead of a NullPointerException.
In order to catch both errors, the code needs to catch Throwable.

Test: I added code to GifImageResource.getDrawable to throw a new
OutOfMemoryError and then used the debugger to verify it was caught by the
new catch Throwable statement. I did the same test with NullPointerException.
I tested attaching gif images and sending them to verify the gif path still
worked.

BUG=37742976

Change-Id: If71a7e65f8c0b083fe6c4b79f78358666338d59d
2017-10-05 11:27:21 -07:00
Tom Taylor c12af8d012 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4 am: 6ea30b87b1 am: a072033ce4 am: 93d52cb5e2 am: cbed68f73b
am: f9b9dc3d2f

Change-Id: Ica8bedeb18ee6604e1382f54f0ad910b7cfa8c40
2017-07-12 19:20:09 +00:00
Tom Taylor a072033ce4 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4
am: 6ea30b87b1

Change-Id: I28cfc0b9abbc28420feec7c690406ebe922b31e8
2017-07-12 19:09:10 +00:00
Tom Taylor 6ea30b87b1 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360
am: 7a6b99a4a4

Change-Id: I0817d9c8e4e30630cd0008f93ee31a728342eae1
2017-07-12 19:07:09 +00:00
Tom Taylor e0f247e399 37742976 - Catch bad gifs
* A security researcher crafted a gif that would cause the Android
Bitmap code to throw an NPE. That would cause messaging to crash when
decoding the NPE. Catch the NPE.

Test: manually tested the "crash.gif" attached to the bug. Stepped
through the debugger to verify we're catching the NPE and logging
the attempt. Verified normal gifs still work.

Bug: 37742976

Change-Id: Iab814d5b0b514bed0cecddd9a76f1fc095f90892
(cherry picked from commit 3671fd94ae)
2017-06-23 16:48:57 -07:00
Tom Taylor 3671fd94ae 37742976 - Catch bad gifs
* A security researcher crafted a gif that would cause the Android
Bitmap code to throw an NPE. That would cause messaging to crash when
decoding the NPE. Catch the NPE.

Test: manually tested the "crash.gif" attached to the bug. Stepped
through the debugger to verify we're catching the NPE and logging
the attempt. Verified normal gifs still work.

BUG=37742976

Change-Id: Iab814d5b0b514bed0cecddd9a76f1fc095f90892
2017-06-23 14:09:12 -07:00
Aurimas Liutikas d3b23f568a Remove usages of ActionBarActivity.
ActionBarActivity has been deprecated for 2+ years and has been
extending AppCompatActivity for all that time. These changes
should be no-ops.

Bug: 35253513
Test: None
Change-Id: I699f327aaa99b26a0a0b562cf425203e4b625c33
(cherry picked from commit 11224977e7)
2017-06-06 15:13:49 +00:00
Aurimas Liutikas 11224977e7 Remove usages of ActionBarActivity.
ActionBarActivity has been deprecated for 2+ years and has been
extending AppCompatActivity for all that time. These changes
should be no-ops.

Bug: 35253513
Test: None
Change-Id: I699f327aaa99b26a0a0b562cf425203e4b625c33
2017-05-18 11:16:47 -07:00
Tom Taylor db45a19fe5 37544704 PduPersister is not doing a safe Uri comparison
* The PduPersister had some code where it checked uris for
equality, but didn't use the safe .equals method.

Test: manual test of sending and receiving mms's.

Bug: 37544704

Change-Id: I6dfd037068b4eff04c34cd9d41760e36e11915d6
2017-05-01 09:21:52 -07:00
Sanket Padawe 616dc26461 Update SubscriptionManager API by replacing 'id' & 'idx' with 'index'.
Bug: 35767068
Test: No build failure on update.
Change-Id: Iab619e80da63685212043f88d30c171a013f8925
2017-03-21 11:25:10 -07:00
Tom Taylor e0f37bb8e1 22851197 Messaging Application crash with unsupported type's URI
This bug and AOSP patch arrived last July. Supposedly, I
merged the change, but it's certainly not fixed in bugler, nor in various
copies of PduPersister in Android's master. Fixing all the locations
now.

Test: manual - sent/received MMS's to verify the change didn't break
existing behavior.

Bug: 22851197
Change-Id: Ia79bd9951b1820ebc42baf0eef38667753d77ab9
2017-02-23 10:41:40 -08:00
Paul Duffin 3cce9e3644 Use com.android.messaging.util.Assert instead of junit.framework.Assert
am: 991c2e5ab8

Change-Id: Ifb50be13961d566c58c25c3f9f6e7a4ac4b6a260
2017-02-21 18:01:15 +00:00
Paul Duffin 991c2e5ab8 Use com.android.messaging.util.Assert instead of junit.framework.Assert
Bug: 35234379
Bug: 30188076
Test: make checkbuild
Change-Id: I3aa9b72393d128877c86c9a116495f76f3e50e18
2017-02-21 11:23:14 +00:00
Tom Taylor 4d220d4777 resolve merge conflicts of eafd58a to nyc-dev
am: a43c5c5f18

Change-Id: Ibcf2308553a68a8deaa05d15548d3eca67d4579a
2016-12-07 02:45:53 +00:00
Tom Taylor a43c5c5f18 resolve merge conflicts of eafd58a to nyc-dev
Change-Id: I58151ca0c248dd4b84c78c8e7ca73d5a80bbd962
2016-12-06 16:26:14 -08:00
Tom Taylor 4dfcff98da 32807795 Security Vulnerability - AOSP Messaging App: thirdparty can attach private files from "/data/data/com.android.messaging/" directory to the messaging app. am: a2aa53f83a am: 90bf70396d am: 305a004e19 am: 2397f2fbef
am: 313284eee7

Change-Id: Iaa18124b7f9090efe55a0a46a1851ff5c0b6fe28
2016-12-06 22:27:37 +00:00
Tom Taylor 313284eee7 32807795 Security Vulnerability - AOSP Messaging App: thirdparty can attach private files from "/data/data/com.android.messaging/" directory to the messaging app. am: a2aa53f83a am: 90bf70396d am: 305a004e19
am: 2397f2fbef

Change-Id: I16b590f76c9856d1407b336973ba86ff681415c6
2016-12-06 22:24:07 +00:00
Tom Taylor 10dccb12ad 32161610 Security Vulnerability - Information disclosure vulnerability in AOSP Messaging
am: 69ed579fb8

Change-Id: I4be088ae899c6729da2197a9ab23951dc95c238e
2016-12-06 22:13:14 +00:00
Tom Taylor 3f6e2e2b07 Merge "32161610 Security Vulnerability - Information disclosure vulnerability in AOSP Messaging" into mnc-dev 2016-12-06 22:11:03 +00:00
Tom Taylor a2aa53f83a 32807795 Security Vulnerability - AOSP Messaging App: thirdparty can
attach private files from "/data/data/com.android.messaging/"
directory to the messaging app.

* This is a manual merge from ag/871758 -- backporting a security fix from
Bugle to Kazoo.
* Don't export the MediaScratchFileProvider or the MmsFileProvider. This
will block external access from third party apps. In addition, make both
providers more robust in handling path names. Make sure the file paths
handled in the providers point to the expected directory.

Change-Id: I9e6b3ae0e122e3f5022243418f2893d4a0859edb
Fixes: 32807795
2016-12-05 16:39:55 -08:00
Tom Taylor 69ed579fb8 32161610 Security Vulnerability - Information disclosure vulnerability
in AOSP Messaging

* Check to make sure the returned uri from the gallery picker does
not point to bugle's data directory (or any subdir).

* Test:
Manual-
* I created the test app in the bug, the one that injects the bad
uri into Bugle. I verified the bad behavior before the fix and the
good behavior after.
* I tested the gallery to make sure picking photos,
from the photos app and drive, still work.
* I verified the behavior in the debugger to be sure the code is
catching the bad uri from the test app.

Change-Id: I3393f3b886c837a49758b91945cf1e17ec9bee41
Fixes: 32161610
2016-12-05 13:57:45 -08:00
Tony Mak 7ad7ac27f1 Show badge icon if any participant in the conversation is work contact
Precompute is_enterprise and stored the value in conversation table.
Include is_enterprise in the ConversationList view.

Change-Id: I2e31bd61c08d25a296aaa3e99cb24631ae2e7976
2016-06-29 10:58:33 +01:00
Tony Mak 2a50ffe57c Add badge in conversation view if the participant is a work contact
TODO: To handle conversation having more than one participants.

Bug: 29065176
Change-Id: I3820454bf2b76c151dc3a13d9be270502029160d
2016-06-28 15:44:27 +01:00
Tavis Bohne 41f3b673f1 Messenger refuses all file:///data/ uris
We've been informed it's possible for an app to create a world
readable hardlink in L in its own /data directory that links to
another apps private data, including Messenger data. The hardlink
bypassed our existing checks. So now we simply refuse all file: uris
in the /data/ directory.
Other apps shouldn't be sending file uris anyway, and we dont know
of any that send file:///data/ uris.

Bug: 28793303
Change-Id: I778bb2bcb9e11185357093c59fc1fa3f6caa26a1
2016-05-17 17:36:51 -07:00
Tavis Bohne ca5fc9fa7d Merge "Messaging doesn't allow sharing of its own files" into nyc-dev 2016-05-16 18:14:20 +00:00
Tony Mak c4073ff4ce Add badge icon for work contact in search result
BUG=26021888
BUG=28016344
(cherry picked from commit 6e00763823cd1b27ff88d25d0eb11f8addc3b2e6)

Change-Id: If0e2f7b1c58cd064ebfdae8a9b735b391c5009fc
2016-05-16 16:35:06 +01:00