-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Refactor download receiver to background service #10310
Conversation
retest this please |
1 similar comment
retest this please |
@fm-sys
If I'm not mistaken I'm using the
It may work with the standard theme, but works best with the themes specifically created for it, so we should mention it and give the user the choice. (Besides that, auto-downloaded of accompanying theme was specifically requested for.)
Totally agree. Just had no better way at hand back when implementing the downloader.
Using a background service seems promising, please continue... ;-)
Sure, if I can be of any help with this, I'm happy to participate / support. |
I have to add that file overwrite check (name conflicts etc.) are handled as well on receiving a download (although not in the A few observations from a quick test:
|
Thanks for testing it :)
Probably, because the map file list is not recreated after an successful download yet. Does it work for you after restarting c:geo?
Agreed, although a notification should be used for it. Toasts can be quite confusing if they show up while another app is currently opened. IIRC I have already implemented such a notification. But I can use a higher priority for it be more prominent. As already pointed out, this is just a quick and thirty draft. I will look into the exceptions and hope, to get simultaneous downloads working soon... |
Note to myself: However, everytime you start the service, the onStartCommand() method is called." So we might need to use a different method than http://developer.android.com/guide/components/services.html#StartingAService |
@fm-sys |
@moving-bits thank you! Unfortunately I'm quite busy for the next days (need to write a scientific paper for school). Anyway, I think it shouldn't take too long. Background service might be ready within the next 2 weeks... :) |
After some more research, i noticed that there's something called (this class might be interesting for background cache downloads as well ;-) ) |
648f439
to
1de44b9
Compare
Oh, dear. It wasn't easy to rebase this PR to our current master 😅 Current State:
@moving-bits would you mind another test in the emulator? |
Sure, will try to test it during the next days. Only I'm a bit on a tight time budget currently, so it may take a few days. |
1de44b9
to
b243303
Compare
PR is ready to merge from my side. Some short notes:
BTW, I will not let codacy dictate what to call my classes - it's the same semantic as for "Dialogs.java", "Intents.java", ... ;-) |
I've given it a short test-drive, even with five downloads in parallel, which the new background service handled pretty well - a big thanks! Two minor things:
|
Nice to hear! Big thanks for cross-testing as well :)
IIRC it gets activated if you reopen the maps activity. But for sure, these two things could be optimized. I would like to get it into master first, and then we can work on these minor things and hopefully will implement some more background services in the future ;-) |
Tested a bit more, somewhere deep in an area without downloaded routing tile info. Tile data got downloaded, and routing does work, so everything seems to be fine. |
Haven't checked for map (as the last finished download was the map already being active), but a theme does not get activated automatically after successful import.
understandable, and ok for me
Looking forward to it ;-) |
Have not checked this explicitly, but actually I have just copied everything from the original receiveDownloadActivity (nearly) without deleting/changing any code parts. So if the service is working in total, nothing should have got broken... |
My bad, haven't remembered my own code... I got distracted by the explicit call from within the |
Fixes #10256
Yippee - it works ;-)