Commit Graph
131 Commits
Author SHA1 Message Date
Michael W 37e5757779 Messaging: Extend AppCompatImageView instead of ImageView
Follow AS recommendation

Change-Id: Id3577cce05e73593183ea33d93c97858f9977a17
2025-05-18 09:18:48 +00:00
Michael W 37ac798c53 Messaging: Remove VisibleForAnimation
It's meant for reflection, but we don't care about that

Change-Id: Id2310a04fb90f39cb9b52fcb183073504b64bcba
2025-05-18 09:18:48 +00:00
Michael W 3c107a2161 Messaging: Migrate attachments to MediaStore
* Saving them doesn't work otherwise
* We don't have to care about MediaScanner and DownloadManager
  anymore that way, either

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/8573
Change-Id: I7a3b1dc6916feff4849bdfa2b8937460c32bc5a2
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
(cherry picked from commit 93bd39838d4a395dd710796b0e71ada1ec1f5ff2)
2025-04-04 16:33:58 +00:00
Tommy Webb 8796975d4a Messaging: Messages are highly important
Set IMPORTANCE_HIGH so that message notifications will pop on screen
by default.

Issue: calyxos#2984
Change-Id: I6d6d823310bc0ad5f06a47df69446ebf502894dd
2025-03-30 18:25:17 +02:00
Michael W 37f7aaea87 Messaging: Fix wrong enum value
* Apparently in QPR2, Material Design specifies iconSize which is set
  as a dimension (18dp) and overwrites ours which is an enum
* Fix it by choosing a unique name for the styleable

Change-Id: I0e9f93dc5bf8d450ea987f3b1fde9641827f2f99
2025-03-06 20:42:27 +01:00
Michael W 53eb598b63 Messaging: Good news: we can tint the status bar properly!
* 80% opacity is not what we want anymore
* The status bar in the conversation list is also supposed to be
  tinted properly - so why not do it?

Change-Id: I03c05595cd7f5a3f8f7dea120e14f3f3e0fff0b5
2025-03-04 18:52:05 +01:00
Michael W b0f59f9515 Messaging: Round AddContactsConfirmationDialog
Change-Id: Ib169d51e860c344182eeeb422b67f1d0d04c3887
2025-03-04 18:52:05 +01:00
Michael W b2f5e3190e Messaging: Further code improvements
* Remove redundant casts
* getParcelable(ArrayList|Exra) without class argument is deprecated
* ViewPager.setOnPageChangeListener -> addOnPageChangeListener
* RecyclerView.setOnScrollListener -> addOnScrollListener
* Remove unused initializations
* Remove unused code

Change-Id: I21beb6c90c675a4f2cfd7e3d5ebbd18b745f5911
2025-03-04 18:52:05 +01:00
Michael W 47f5533a73 Messaging: Remove duplicate code
* mmslib contains basically the same code as android.support.v7.mms.pdu
  does, so align them code-wise and remove the mmslib duplicates
* Since mmslib contains a few usages that are now not accessible
  anymore, make the classes or methods public where it complains

Change-Id: I10b8716c0e45079e4795fda4489dc1a9535026f3
2025-03-04 18:52:05 +01:00
Michael W f83b05ea0a Messages: Replace (Safe)AsyncTask
* AsyncTask is deprecated
* Executors and Handlers can achieve the same thing and
  are not deprecated

Change-Id: I5271bb73b848ce885eeaf5632c1da27853c56c4a
2025-03-04 18:52:05 +01:00
Michael W 278c7e93af Messaging: Hide new chat button when forwarding messages
Change-Id: I511c9745c02bc7918bb38647bd6fb79332cfe523
2025-01-01 18:56:09 +01:00
Michael W 66d57e98a3 Messaging: Handle geo uri scheme
Change-Id: I19f1039d18441cb2bd013577c41e279327f806e6
2025-01-01 18:56:09 +01:00
Michael W b50c51d38f Messaging: Remove forgotten MmsVideoRecorder
Usages removed when removing the own camera handling in commit 7f464b4

Change-Id: I7904a5079e733331c9cfc780ff21bdda8bdb9455
2024-12-26 23:54:02 +01:00
Michael W 6cdd458b69 Messaging: Tint recipient field properly
We need to tint the underline ourselves, reyling on forceDarkAllowed
does nothing here

Change-Id: I2c390a76df5aef6e16512295521d073dbe25d5fc
2024-12-26 17:43:06 +01:00
Michael W edb268697c Messaging: Get rid of storage permissions
Since these have no effect on sdk 33 and up and everything works without
them we can get rid of those

Change-Id: I0482d8b8772dc2c64bb1930fbc6ba4852f4b4c61
2024-12-26 16:13:52 +01:00
Michael W 161c3e9fd9 Messaging: Remove VisibleForTesting
Since we removed all tests, no need to keep those flags around either

Change-Id: Icaf71832c459cecbcbddc75f552c60e48ae95189
2024-12-26 15:54:38 +01:00
Michael W 6e9a803f1c Messaging: Handle default SMS app setting properly
* We don't need two settings basically doing the same
* Handling the change needs to happen via RoleIntent, not
  ACTION_CHANGE_DEFAULT
* Our own name sometimes can't be retrieved from package manager (?) -
  just use it from strings

Change-Id: I28abc52329f00b33a316533f12a54a517cba3514
2024-12-26 15:54:37 +01:00
Michael W 241b4cf833 Messaging: Style even more dialogs properly
Somehow some dialogs use the theme but some need the style set manually

Change-Id: I386a0e43c10d328088066961b75a162bf2c351c1
2024-12-26 15:54:37 +01:00
Michael W 0aa08c0c3b Messaging: Finish after no more contacts are blocked
The view doesn't have a "no items available" element and it doesn't
make sense to have one since the menu item is only visible once a contact
is blocked - so after removing the last blocked contact, simply return
back to the conversation list

Change-Id: I3372e26361f6919502cac6fd27ae849d559a4c05
2024-12-26 15:54:37 +01:00
Michael W 590243f8a8 Messaging: ContactMediaChooser: Remove permission requesting
We never reach this state when we remove the permission, so it makes
no sense to have code for it

Change-Id: I97f2f5d438148234ea1887462ab65735721da2f8
2024-12-26 15:54:37 +01:00
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 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 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 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