-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to select a Custom alarm audio file. #8
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… selected file to local storage.
Anything you want me to get done before this is merged? |
No, it's fine - if it works for you, then that's great. |
I've added the feature of selecting custom alarm sounds in d6157cf. Thanks for help @magnus-ISU. |
Thanks so much for adding this functionality @magnus-ISU , it works flawlessly! ❤️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As noted by the app now when you choose a custom file as your alarm sound, this can cause a crash when it attempts to play audio if the user picks the wrong thing, specifically if they try to use a playlist file (
.m3u
) as their custom file. You can probably detect this crash right as they pick the file rather when it is attempted to be played but I don't care to try to. Or figure out the mime type and try to exclude it that way - but I have been very frustrated by many apps that expect all audio files to bemp3
s and would rather allow the user to figure it out than restrict them artificially.There is also a crash which I'm not exactly sure how to reproduce which happened when I selected the same file multiple times in a row to be the new alarm. But it doesn't always happen, and once it works once it shouldn't break as it was related to saving the file I think.
Personally, I would still merge this because it is still a very good feature to have, people who use F-droid are probably okay with some small amount of jank in order to get (imo critical) features implemented faster, but if you want to not merge I don't care I wrote this for me. I probably also won't spend too much extra time trying to fix it if you decide this isn't good and won't fix it yourself.
Works by duplicating a file to local app storage, I didn't want to have to do that but it seems android's security model also prevents me from knowing any file paths even with storage permissions when using content API and I don't care to spend too much more time fighting with Android's weird APIs.
Only tested on android 13 so far. I'm not sure what would happen on an older version. I think pre-11 is when they changed some file APIs significantly.