Commit Graph
30 Commits
Author SHA1 Message Date
Jake Klinker 9607c95e71 Convert URI scheme to lower case before checking if it is a file.
This fixes an edge case where a "File://" style URI could be passed in
but not pass this check, even though the underlying framework recognizes
this as a legitimate file.

Bug: 197328178
Test: See repro steps on http://b/197328178, was no longer able to
repro.

Change-Id: Id837744a79d1aca91b41d24207dc9b98f2b5b5e9
2021-10-06 21:17:05 +00:00
Santiago Seifert c4ce65c11e Handle MediaMetadataRetriever.release IOException
MediaMetadataRetriever.release now declares a thrown IOException.

Bug: 200173116
Test: Should be a non-functional change (only relevant when using MediaDataSource).
Change-Id: Ia3f5f01ee79feb35a10ec8bbbef6db88b32f2161
2021-09-22 10:56:34 +00:00
Raman Tenneti 4b52654e98 AOSP/Messaging - Update language to comply with Android's inclusive language guidance.
See https://source.android.com/setup/contribute/respectful-code for reference

BUG=161896447

Test: make and make messagingtests
Change-Id: I01c520f1d5e9eab8dbb25b08d133ae34bd301093
2020-07-29 16:43:46 -07:00
Taesu Lee bd3b711aca Fix handling format based on API level accordingly.
Use SmsMessage#createFromPdu(pdu, format) at least on M and replace
SmsMessage#FORMAT_3GPP2 with "3gpp2".
 - SmsMessage#createFromPdu(pdu, format) is added in API level 23.
 - SmsMessage#FORMAT_3GPP2 is added in API level 28.

Test: Manual

Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: Icab2c6c3c86ee8b6597881bfac6066fed60db4d2
2020-06-19 18:34:20 +09:00
Taesu Lee dcfe928ff3 Fix creating ConnectivityUtil to work on any platform
After this CL, ConnectivityUtil for default subId is used again on pre
N because TelephonyManager has createForSubscriptionId() for a specific
subId from N.
Nevertheless, listen() uses the default subId on PhoneStateListener
instead of the subId on the manager still even N. On O and beyond,
ConnectivityUtil works correctly on multi-sim devices.

Revert "Fix missing computeIfAbsent() method in L_MR1 and M"

This reverts commit f0ccb76d8d.

Reason for revert: Manage ConnectivityUtil instances for subIds at least
                   on N instead.

Test: Manual

Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I2f08928a6798a2ce275c5c75569ad379999d274c
2020-06-18 19:24:27 +09:00
Taesu Lee fcf6699742 Parse recipients from RESPOND_VIA_MESSAGE correctly
UriUtil#parseRecipientsFromSmsMmsUri() will returns a comma-separated
recipients for common use so that InsertNewMessageAction#createMessage()
can create or get a conversation correctly for RESPOND_VIA_MESSAGE.
In addition, mms/mmsto schemes are added. And it includes small cleanup
intent-filters for LaunchConversationActivity.

Test: adb shell am startservice
-a android.intent.action.RESPOND_VIA_MESSAGE -d "sms:12345678,87654321"
-e android.intent.extra.TEXT "Text"

Change-Id: I291dc765a46846982d059016d44f90873c687867
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2020-05-28 16:43:29 +09:00
Taesu Lee 4e99cc0a02 ProcessPendingMessagesAction works based on subscriptions
PorcessPendingMessagesAction queues one message for sending/downloading
associated with a subscription triggering current action at a time. And
the ConnectivityUtil also works based on subscriptions so that pending
messages can be processed regardless of other phones' state in multi-sim
case.

It includes cleanup code as well.

Test: Manual

Change-Id: Id6b4f4a0aa6a3291e7a4d8a5d3f0fbb9db3c5b86
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2020-02-28 18:16:54 +09:00
Taesu Lee 6c77158718 Support video attachments through GalleryMediaChooser
GalleryMediaChooser supports video types and more image types also. And
video thumbnails are overlaid with the play button image to distinguish
between images and videos.

Note:
 1. EXTRA_ALLOW_MULTIPLE is not specified for ACTION_GET_CONTENT.
 2. Files, methods and variables' name are still including "image".
 3. Content descriptions are not updated.

Test: Manual

Change-Id: I961928f150e4ae8ee80a1fba2f20c37fb5426669
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2020-02-19 18:36:32 +09:00
Taesu Lee 050bc461fc Fix android.os.strictmode.LeakedClosableViolation
Test: Check log.

Change-Id: I488fc6c4288bc3843a2be35a8e2988738441263e
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2020-02-12 09:54:01 +09:00
Treehugger Robot d3ea4ec384 Merge "Fix NPE caused by invalid IFD0 offset" 2020-02-06 20:51:01 +00:00
Taesu Lee 0770975c8a Use file extension based on MIME type
It uses the most common extension for the given MIME type.

Test: Manual

Change-Id: I3d4aea85fcd42088ed19898054db7225954d3401
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2020-02-05 16:08:02 +09:00
Taesu Lee 710fe2f2ae Fix NPE caused by invalid IFD0 offset
NPE occurs when current IFD0 offset is smaller than default IFD offset.
Just skip invalid tag instead.

Test: Manual

Change-Id: I184794e7ee227849da7d2ecf3cf647e69dc91610
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2020-02-05 15:47:13 +09:00
Treehugger Robot a6f1ae137d Merge "Use correct format info for SMS" 2019-06-12 01:38:23 +00: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
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
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
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
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
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 e2ccf8bff5 Cleanup enterprise feature in ContactUtil
1. Remove isWorkProfileSupported checking, api level checking is enough.
2. Replace the hardcoded uri with the corresponding api.

BUG=26797244
BUG=28016344
(cherry picked from commit 0d7a1cce157e4ffb26d5fefb9908bbeffcb1d03c)

Change-Id: I76edad19dc6a19aa77b523cb960f716fca08944d
2016-05-16 16:34:58 +01:00
Tony Mak b7fc988f23 Search enterprise directory as well in SMS app
TODO: Update the UI to show enterprise result separately (b/26021888)

Bug: 28016344, 25977180
(cherry picked from commit 5c621e57256f5068a43f1456f9bab1194f0d27b2)

Change-Id: I7130ae5e057ed750a29f64c5497a04b868613579
2016-05-16 16:34:24 +01:00
Victor Chang 0a85b81c9f Add isAtLeastN in OsUtil
Bug: 28016344
Change-Id: I431b4fed3f2114d1f1b311416a892f608a846e4c
2016-05-11 18:07:38 +01:00
Tavis Bohne 30fb338539 Messaging doesn't allow sharing of its own files
-Previously, Messaging allowed sharing of any file it had permission
 to reach. This meant that bad apps could share a link to
 file:///data/data/com.android.messaging/databases/bugle_db
 and Messaging would happily send all this sensitive information to
 the target. Worse, a bad app could share a softlink to this file,
 where the symlink was picture.jpg with the image/jpg type.
-Now, when sanitizing attachments, we make sure any filepaths don't
 lead to any Bugle-specific directories.
-getApplicationInfo().dataDir is a symlink to
 /data/data/com.android.messaging, and appears to be the
 only directory where we store personal data.
-Most apps share as contentUris, including Messaging, so Messaging
 can still share to itself.

Change-Id: Ic464bc1f099029a030793c478aaf88b957d8bad1
Fixes:28076752
2016-04-29 14:39:59 -07:00
Shri Borde eba0949bc6 Access incoming audio files after user taps Play
For platforms with insecure handling of media files, media files should
be opened only after the user chooses to play the media.

Change-Id: I5f9bbd1f8468a704a5962f0dddd3c8b11bba8bea
2015-08-21 10:17:46 -07:00
Mike Dodd d4b7315d55 Fix build for latest Guava.
b/23110861

Change-Id: Iccd6e66f996fd00880cc3024085c838235da0adb
2015-08-12 15:11:43 -07:00
Mike Dodd d3b009ae55 Initial checkin of AOSP Messaging app.
b/23110861

Change-Id: I11db999bd10656801e618f78ab2b2ef74136fff1
2015-08-12 12:47:26 -07:00
Mike Dodd ef8c7abbcf Revert "Initial checkin of AOSP Messaging app."
This reverts commit 461a34b466.

Change-Id: Iac4ca77eeaa94989e91dead49a7959c905bd3078
2015-08-12 18:48:39 +00:00
Mike Dodd 461a34b466 Initial checkin of AOSP Messaging app.
b/23110861

Change-Id: I9aa980d7569247d6b2ca78f5dcb4502e1eaadb8a
2015-08-12 08:58:28 -07:00