Commit Graph
64 Commits
Author SHA1 Message Date
Michael W e335f6bec8 Messaging: Use ActivityResultContracts for media and contacts
Instead of handling showing and picking the media ourselves,
use existing AcitivityResultContracts to pick images, videos
or contacts

Change-Id: I20079ad94882cc6bbfeae8d57ca0e4aa30612c01
2024-12-26 15:54:37 +01:00
Michael W 6d11a6658c Messaging: Fix C-style array declarations
Change-Id: Ie7381dc5280ab4d907000ef551df9ea80553ddb4
2024-12-26 15:54:37 +01:00
Michael W 5403d02b5d Messaging: Fix javadoc
Change-Id: Ia1b0a8fa9a5e74078a68a55ca1953b6f085521b1
2024-12-26 15:54:37 +01:00
Michael W e29b158fba Messaging: Remove unused code
Change-Id: I8093bb3e305ae323f7069bf42f9e83f8c8647cc7
2024-12-26 15:54:37 +01:00
Michael W 0069df879a Messaging: Replace explicit types
Change-Id: I2165b3dec73973a2a82d8b3c7c364b5f011e597d
2024-12-26 15:54:37 +01:00
Michael W 9538179c75 Messaging: Use try-with-resource
Change-Id: I6649517cbd990502dfcb54f078764cf05f210268
2024-12-26 15:54:37 +01:00
Michael W 1914db5ea4 Messaging: Convert further parts to androidx
CursorLoader, LoaderManager, Preferences, Fragments, ...

Change-Id: I8787b2db365249839547c6d5c21ab7cd5ff42082
2024-12-26 14:55:13 +01:00
Michael W fd63d5f125 Messaging: Use StandardCharsets where possible
Change-Id: I45a19c47262116d34260e1957145580a7f97168e
2024-12-26 14:55:13 +01:00
Michael W a2f67b4f7b Messaging: Remove GServices
We don't have an actual implementation returning anything but the
defaults, so apply the defaults directly anywhere we need them

Change-Id: Ic651b4b13977799f2f4d2c702c430798fbff77f8
2024-12-26 14:55:12 +01:00
Michael W 7f22a3eea7 Messaging: Remove low storage handling
* SMS are the least of your storage issues, if you reach the limit
* Both Intent.ACTION_DEVICE_STORAGE_LOW and
  Intent.ACTION_DEVICE_STORAGE_LOW are not delivered to apps after O
* Remove all now unused strings from all languages - we don't sync those
  with crowdin (yet)

Change-Id: If01f937acdafbb34d5a9e792db54de4761ec4cc5
2024-12-26 14:55:12 +01:00
Michael W d43b6ff1c4 Messaging: Let there be lambdas
Change-Id: Iee1fc46c92ea9159abb10d92d34baee937bdee0c
2024-12-26 14:55:12 +01:00
Michael W c1b4aa4dfe Messaging: Nullability
Change-Id: I8bcde2a868a9c8989971d056be24ff4986e4f8f3
2024-12-26 14:55:12 +01:00
Michael W e35d385149 Messaging: Remove unnecessary toString() and String.valueOf() calls
Change-Id: I5d5624386ba72b9e7074a7da909f78baaee73f75
2024-12-26 14:55:12 +01:00
Michael W 21cb2b6289 Messaging: Fix modifiers
We either have too few or too many

Change-Id: I09a9a38b859c68526fcbcdbc7862afe1d693f6c0
2024-12-26 14:55:12 +01:00
Michael W 3b7f05ba67 Messaging: Replace ExifInterface with its androidx counterpart
Change-Id: I35ba14886b9f837d576f1cd385869614454c921f
2024-12-26 14:55:12 +01:00
Michael W 7c55a6d56a Messaging: Remove compatibility for old android versions
Change-Id: Id9065d60525a509271a0e64c0e349e857cb998e2
2024-12-26 14:55:12 +01:00
Pranav Vashi e0a037c09e Messaging: Improve letter render decisioning for avatar
Change-Id: I263e617cf6fc058301537a6f2dc7d052bed6487a
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2024-12-22 17:04:27 +01:00
LibXZR d53a425244 Messaging: Do not check preferred sim if conversation sim exist
Fix unable to send message when preferred sms sim is set to
"Ask every time".

Change-Id: I0406985e29ded8157ae5252db2dd814856a93376
2024-12-22 17:04:27 +01:00
Chris Talbot 87cd6873d7 Add support for text/vCard and text/vCalendar MIME type
A vcf file can alias to both "text/vCard" and "text/x-vCard" MIME
types and an ics file can alias to "text/vCalendar" as well as
"text/x-vCalendar". However, if LineageOS does not get the "x-"
MIME type, it will incorrectly display an empty MMS.

Change-Id: I0b63767092c0e7422ff3592983d94b903d9e8cc5
2024-12-22 17:04:27 +01:00
Ido Ben-Hur 96ef363da8 Messaging: Fix handling of default SMS app
Use RoleManager to Launch the correct activity and check the default app
Get rid of deprecated methods used here to do the same
Also add queries in manifest to allow the former method to work as well

Change-Id: I4702aaa4b35a994e225e63534da8fb4975b9717a
2024-10-20 01:36:57 +03:00
Michael W b11039ed8c Messaging: Allow deletion of messages without a sim inserted
* Currently there is a check in place checking for the presence of a
  preferred sim card
* For deletion of a conversation and message this is unnecessary and
  deleting a conversation from the main view does also not have that check
  already, so replace the check with just checking for being the default
  messaging app

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/5974
Test: Try deleting a single message or conversation from within
 conversation before and after
Change-Id: Icd47882eb29e16a17ad57a79ea5e0c0f7855ffc6
2024-09-09 05:47:00 +03:00
Luca Stefani 4246987beb Messaging: Implement per conversation channels. Update API level to 28.
* Get rid of in-app settings for notifications, replaced by channels features
* Remove all the notification plumbing and dead code

Test: m, manual

Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
Signed-off-by: Joey <joey@lineageos.org>
Signed-off-by: Danny Baumann <dannybaumann@web.de>
Signed-off-by: Arne Coucheron <arco68@gmail.com>
Signed-off-by: Lyubo <lyubodzhamov@gmail.com>
Change-Id: Idb39ca32751d40b3376934775d2119dd6cc7e297
2024-09-09 05:46:38 +03:00
Adnan Begovic 086bb5c3f5 Messaging: Implement option for swipe right to delete.
Squashed commit of the following:

Author: Adnan Begovic <adnan@cyngn.com>
Date:   Thu Jan 14 17:20:43 2016 -0800
Messaging: Implement option for swipe to delete.

  No one wants to swipe to archive, that's stupid.

Change-Id: Ia8f0fc675582ef343311e60b755e284322f25102

Author: chengzhi.hou <chengzhi.hou@ck-telecom.com>
Date:   Wed Feb 24 20:01:17 2016 +0800
Messaging: Swipe right to delete conversation

Change "swipe delete" to "swipe right delete", so SwipeArchive and SwipeDelete
can exist at the same time.

Change-Id: Id66167c2e749f8ab0ee917e0138027c7404b8c90

Author: Michael Bestas <mikeioannina@cyanogenmod.org>
Date:   Tue Mar 1 02:27:16 2016 +0200
Improve swipe to delete strings

Change-Id: I180d09a6680084d9fd87c6dafd56db18ca5a580a

Author: Joey Rizzoli <joey@cyanogenmoditalia.it>
Date:   Mon Oct 17 16:32:25 2016 +0200
Messaging: show snackbar instead of toast when deleting conversation

more consistency with archive action

Change-Id: I06129850860a2a51c10ade65fb87c9f37a0c2bfa
Signed-off-by: Joey Rizzoli <joey@cyanogenmoditalia.it>

Change-Id: Ia8f0fc675582ef343311e60b755e284322f25102
2024-09-09 05:45:11 +03:00
Jake Klinker f1b8f9a226 Fix exposing private messages files through attachments with a content URI.
Change-Id: I30b2a06c67af4a347d03c7504d13b9b9365acafd
Tested: Was no longer able to repro b/275552292.
Bug: 275552292
2023-05-09 14:00:51 +00:00
Chaohui Wang 79481ab146 Update DrawableWrapper to DrawableWrapperCompat
Api changed in aosp/2120177

Bug: 235727273
Test: TAP
Change-Id: I1645dab6000dc760b4de2bb625e0af8df014c8c8
2022-08-26 20:58:50 +08:00
Almaz Mingaleev 8edea90f7f Remove uses of Time. am: 909a0763c6
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Messaging/+/2149693

Change-Id: Ifb1497b8c212866284a9c138e58612aa7bde3f28
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-13 09:03:17 +00:00
Almaz Mingaleev 909a0763c6 Remove uses of Time.
android.text.format.Time is deprecated since 2014 and there are
better alternatives.

Bug: 16550209
Test: presubmit
Change-Id: Ibbc4fb11e96b5179ff5dec906e74c9d582b6fb97
2022-07-11 11:10:18 +01:00
Jake Klinker c8e4ab2b22 Fix url:file:// style URIs from not being detected in UriUtil.
Change-Id: I81c01202306d856f6f8f8b74a5a28d7c1011fcec
Tested: Was no longer able to repro b/222091734.
Bug: 222091734
(cherry picked from commit 2283165c23)
2022-04-26 16:38:11 +00:00
Aman Gupta f62c3cd35a Updating the DATA_ROAMING flag acceess from Settings to TelephonyManager
API.

Bug: 172467621
Test: Build
Change-Id: Ide0db6ecacaabc29b5c4c53a2868d4a2ae27c646
2022-03-24 07:03:10 +00:00
Jake Klinker 27e27d944b Use UriUtil when checking if a URI is a file.
UriUtil.isFileUri contains several additional fixes, so this ensure that existing instances where we check for the file scheme use this method as well. This covers all existing instances in the app of SCHEME_FILE.

Change-Id: I1f3131b33823eae3e620aa9608be8e72b2e84aa2
Bug: 215212561
2022-01-31 20:30:24 +00:00
Jake Klinker ebc64c5bae Use UriUtil when checking if a URI is a file.
UriUtil.isFileUri contains several additional fixes, so this ensure that existing instances where we check for the file scheme use this method as well. This covers all existing instances in the app of SCHEME_FILE.

Change-Id: I1f3131b33823eae3e620aa9608be8e72b2e84aa2
Bug: 215212561
2022-01-31 20:29:42 +00:00
Jake Klinker 6e0ca56095 Fix isFileUri to recognize URIs with spaces.
The underlying framework recognizes " file://..." as a valid URI and fetches the file, allowing for a possible exploit (see b/209965112). This trims the URI so that we can properly recognize it as a file from within our code.

Bug: 209965112
Change-Id: I8d9d9100e9a8c3bd64d19015d2177a14ec2306f3
Test: See repro steps on http://b/209965112, was no longer able to repro.
2022-01-11 00:41:38 +00:00
Jake Klinker 0b258f030a Fix isFileUri to recognize URIs with spaces.
The underlying framework recognizes " file://..." as a valid URI and fetches the file, allowing for a possible exploit (see b/209965112). This trims the URI so that we can properly recognize it as a file from within our code.

Bug: 209965112
Change-Id: I8d9d9100e9a8c3bd64d19015d2177a14ec2306f3
Test: See repro steps on http://b/209965112, was no longer able to repro.
2022-01-11 00:38:25 +00:00
Jake Klinker 56bacbcb13 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
(cherry picked from commit 9607c95e71)
2021-10-06 22:38:45 +00:00
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