Commit Graph
230 Commits
Author SHA1 Message Date
Michael W c73fdc5064 Messaging: Replace permission requests with launchers
Change-Id: I0d12fd05fb0abaeb9bd64c8c77e0e776d5459e4d
2024-12-26 15:54:37 +01:00
Michael W 7f464b401c Messaging: Replace own camera handling with pickers
We do not need to handle camera on our own - there are apps out there
that are made for that!

Change-Id: Ifeb70e46b17bff5eb8d85c8775589efac4f2c284
2024-12-26 15:54:37 +01:00
Michael W 6cc0e38bb5 Messaging: Get rid of onActivityResult()
We are supposed to use ActivityResultLaunchers, so do it that way

Change-Id: I070ec485097c927877b3e0eb4699addc9b9df873
2024-12-26 15:54:37 +01:00
Michael W d940ab74ad Messaging: Fix a few android related things
* NotificationBuilder.addPerson(String) -> .addPerson(Person)
* Wearableextenter.addPage deprecated without replacement
* Html.fromHtml(String) -> .fromHtml(String, int)
* Handlers need Loopers
* Resource-IDs are not final by default (if-else instead of switch-case)
* call super.onFinishInflate() in override of onFinishInflate()
* Configuration.locale -> configuration.getLocales().get(0)
* SimpleDateFormat needs localization as well
* AudioAttributes instead of setAudioStreamType()
* isDataEnabled() is a public method, no need for reflection anymore

Change-Id: Icd830768b86edca3e0b44f1edc6c57facc9f731a
2024-12-26 15:54:37 +01:00
Michael W e128bff457 Messaging: Language cleanup
No unnecessary boxing, enhanced for loops, redundant checks and throws,
imports (removal, reordering), possible void returns

Change-Id: I7a8e1b2007e3b0906e01b41785c518d02c2f3fab
2024-12-26 15:54:37 +01:00
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 7f9087a49e Messaging: Properly hide and show FAB
When starting or stopping action mode, the FAB should hide and show again

Change-Id: I94b12cbd3190df90189dc02c39ac7db78d58d090
2024-12-26 15:54:37 +01:00
Michael W d4ac014a74 Messaging: Use an extended FAB
With proper color scheme and "Start chat" text

Change-Id: I320b169b2bec354db7b0ebc3e81149aaf575092f
2024-12-26 15:54:37 +01:00
Michael W b12a4f8a3a Messaging: Fix loader not auto-restarting
When suspending and resuming the app, somehow the loader returns
immediately after onResume() with onLoadFinished() but somehow has no
data left (data.moveToNext() returns false) which makes the conversation
close immediately.
Restarting the loader has the desired result: We can leave the app
temporarily and come back to the same conversation again

This also fixes adding a vcard attachment (since that temporarily
leaves the app)

Change-Id: Id52e55563a11474fa776323477aa900ca4be0bbe
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 f31b198928 Messaging: Remove usages of DataUsageStatUpdater
Since Q, contacts affinity isn't supported anymore, as reflected by
the documentation plus DataUsageStatUpdater code itself

Change-Id: I35e00d0fa743525c3b977c9756126ae764726afa
2024-12-26 15:54:37 +01:00
Michael W 5ed268cee1 Messaging: Style the SwitchPreferences
Use the newer style of A15

Change-Id: I75a0e54f70f837d21d3aaa746f2e0ec7af226eda
2024-12-26 15:54:35 +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 d430161ca0 Messaging: Fix warnings about drawables and colors
* They need the theme provided now
* Follow the suggestion by AS
  (sometimes we use ResourcesCompat, sometimes not)

Change-Id: Ie3023fee13a6fc04bd4b912721ba19dcc08befba
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 37d6d70835 Messaging: Prevent broadcast spoofing
Change-Id: Ib0df346233cd4fcbf242aef580f72414bf1e359b
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 d869533f6f Messaging: Use xml drawables
Replace the pngs with xml drawables

Change-Id: I71be32c36194d3b34b54287a09789f73087600ef
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
Michael W 9bbc7a8f99 Messaging: Fix file permissions
No need to be executable

Change-Id: I71d4c03eed558a15489f71fa9ac69d42bdcef474
2024-12-26 14:55:12 +01:00
Michael W a65de2aee3 Messaging: Rename androidx.appcompat.mms
* Someone apparently decided to "Replace-In-Files" these before, but
  they are not correct according to the folder structure
* Since it is just annoying to read the code in AS when it does not
  match the folder, change the package name back

Change-Id: Iea5c51aeb9e1f5b650a1009348065c7c38cddbeb
2024-12-26 14:55:12 +01:00
Michael W 009df43b06 Messaging: Remove cell broadcasts
* Packagemanager doesn't tell us about its' availability anymore
* It's accessible from notification settings, no need for the app to
  be able to launch them

Change-Id: I10b7742917f8639c94b0187f158cc30156f90e92
2024-12-26 14:55:12 +01:00
Michael W bc93ce392e Messaging: Bump sdk (>=33, <=34)
* Since we already compile with sdk "current", this is just the next
  logical step
* We skip 35 for now since edge-to-edge stuff can be done later
* It also gives AS the possibility to recognize necessary steps
* WRITE_SMS permission removed in API 23

Change-Id: Ia567fa9e42772f0b6d6e6fdc0d21b5635ff9dcc5
2024-12-26 14:55:12 +01:00
Michael W f3863c9a39 Messaging: Remove tests
Nobody runs them anyway

Change-Id: I2b07847509269af31430abc6cb0fb190f08d45f9
2024-12-26 14:55:00 +01:00
minarypenguin 5ce3a1b2db Messaging: Fix activity bar menu icons tint
Change-Id: Ife5af067eb39a3a75e67fd0d7241f4b2e13e23a6
2024-12-22 17:04:27 +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 e46a7b2475 SimIconView: Don't intercept touch events when there's nothing to do
Fix unable to switch conversation sim card by clicking on the sim icon.

Change-Id: I9359cfc4f730186d8709251856899efa8484f6d9
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
Ido Ben-Hur d8a0bf022d Messaging: FrameSequence -> ImageDecoder
fixes playing / displaying gifs
replaces old deprecated FrameSequence & FrameSequenceDrawable libs

Change-Id: Id65fff90bdd09af86480636a8a0e404aeb39580f
2024-09-16 02:25:12 +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
Michael W 37b7f1a539 Messaging: All contacts: Remove space for sections
* Due to the sections not working anymore since we removed the duplicate
  numbers, we are left with a rather large empty space left of the
  contacts
* Disable sectioning to make it look properly again

Change-Id: Iff1849b80d70269933708e5440809c657f0d70d9
2024-09-09 05:47:00 +03:00
nift4 46ee5ce5e0 Messaging: fix crash
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.messaging/com.android.messaging.ui.SmsStorageLowWarningActivity}: java.lang.IllegalStateException: Fragment com.android.messaging.ui.SmsStorageLowWarningFragment$ChooseActionDialogFragment must be a public static class to be  properly recreated from instance state.

Change-Id: I78d46a6f74383a4b865759bc980240f6f73ff20d
2024-09-09 05:47:00 +03:00
nift4 77203378cc Messaging: Add notification channels where missing
Change-Id: I1cb3177704542fc48c42dc18a9e1f4d3118d4193
2024-09-09 05:46:59 +03:00
Tommy Webb 5784795fe2 Fix crash on forwarding messages
onAttachFragment in ForwardMessageActivity does not necessarily have
to be provided with a ConversationListFragment, so there is no need to
assert this. Just move along, as is done in VCardDetailActivity, etc.

Change-Id: I41825c9c118d71d447b820d29f60fb10ef2d5fdf
2024-09-09 05:46:59 +03:00
Michael W 09e4b197ff Messages: Only youuuuu...
* Removing the arrow from the message bubbles and adding a little
  rounding to them and the input bar already does a lot in
  modernizing the look of the app

Change-Id: Ia6466968553856fdf2ea15c10cfed79402e36a5d
2024-09-09 05:46:59 +03:00
Michael W c416c287eb Messaging: Don't show numbers of contacts multiple times
* Somehow there are multiple entries per some numbers, sometimes stored
  with, sometimes without spaces and/or invisible characters
* This leads to the same number being shown multiple times
* Don't add those entries by comparing number and type of all
  already added entries with the staging one

Change-Id: Ic815393d3d4f4ba56107f42c9d8940309564554c
2024-09-09 05:46:59 +03:00
Han Wang 1970f9ea99 Messaging: Show quick reply choices only on wearable devices
Change-Id: I4b81643c051a9b1377f2046c1aa0515c590736fc
2024-09-09 05:46:58 +03:00
z3DD3r e51017a0f2 Messaging: Update cellbroadcast package name
As part of mainline effort, AOSP cellbroadcast package name was changed
from com.android.cellbroadcast to com.android.cellbroadcast.module

Change-Id: Ie1f27abb0f645dd53c26d164b03c5e93c3c13cdc
2024-09-09 05:46:58 +03:00