Fix: Sync Media Fail Notifications are expandable and copyable
Purpose / Description
SyncMediaWorker fail throwable notification could not be expanded or opened
Fixes
- Fixes #20826
Approach
- Adds attribute .bigText to make text expandable
- Adds addAction for a button that copies error message and instantly closes the message upon the action
- Uses a custom receiver for serving pendingIntent required for addAction
How Has This Been Tested?
Tested on local device
Learning (optional, can help others)
- https://stackoverflow.com/questions/14291436/copy-to-clipboard-by-notification-action#14294660
- https://developer.android.com/develop/ui/views/touch-and-input/copy-paste#Copying
- https://developer.android.com/develop/ui/views/notifications/build-notification#Actions
Checklist
- [X] You have a descriptive commit message with a short title (first line, max 50 chars).
- [ ] You have commented your code, particularly in hard-to-understand areas
- [X] You have performed a self-review of your own code
- [ ] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
- [ ] UI Changes: You have tested your change using the Google Accessibility Scanner
Second commit may not be fully optimised, requesting review
How Has This Been Tested?
Tested on local device
Describe that appropriately and/or send a video or screenshot
bigText allows for display of the entire error message, copy to clipboard - copies to clipboard
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically
@BrayanDSO
This still has a flagged security vulnerability:
https://github.com/ankidroid/Anki-Android/security/code-scanning/35
Hey david I saw that persisting error but couldn't figure out how to rectify it as other examples of usages of intent within the project follow the same syntax, I'll need some guidance on the same
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically
Should be fine now, I didn't implement support for other languages/runes since I assume stacktrace will necessarily be in english, lmk if i should
Hmm... Can't reopen this