Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

[Feature]: Updater compatibility with minimizing app #719

Open
2 tasks done
ViktorScaletta opened this issue Oct 23, 2021 · 3 comments
Open
2 tasks done

[Feature]: Updater compatibility with minimizing app #719

ViktorScaletta opened this issue Oct 23, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@ViktorScaletta
Copy link

ViktorScaletta commented Oct 23, 2021

Suggestion

Hello, developers! There's a problem with update processes after minimizing application. Don't you consider using Foreground Services for that kind of work? It would allow resume any update process after returning to app's window. For now it's just freezing at 100% and we have to restart update.
I'm pretty sure you know how implement it, but I can help if you don't.

Additional Information

Because sometimes download process takes a lot of time. It's weird to just wait and do nothing while downloading.

Additional checks

  • I have checked other feature requests and this is not a duplicate.
  • This is a suggestion for Vanced Manager and NOT YouTube Vanced/YouTube Vanced Music/Vanced microG.
@ViktorScaletta ViktorScaletta added the enhancement New feature or request label Oct 23, 2021
@X1nto
Copy link
Member

X1nto commented Oct 23, 2021

I was thinking of listening for the Activity's onPause method and launching a Foreground Service that displays a notification and keeps the app alive, but we found out that not many ROMs were friendly with this approach while testing.

@ViktorScaletta
Copy link
Author

ViktorScaletta commented Oct 23, 2021

@X1nto but why it stopped you from keeping that functionality? You can put a message in the window, that says something like "Some ROMs can kill app anyway".
And about implementing itself. Described approach is okay and it's used by many apps, such file explorers and others, but I suppose it's unnecessary to run the foreground service on onPause. You can do it immediately after starting update process and do all update-related work there(in background thread, indeed). For update progress to be available you can use Broadcast Receivers(context-registered ones, not ones that use manifest declaration) or any other approaches.
Actually, there's another approach you can try, but usually it shouldn't be used for such work. I mean WorkManager. All the work can be implemented there and for update progress you can use the same approach I mentioned above. The end of the work can be observed by integrated LiveData functionality.

@X1nto
Copy link
Member

X1nto commented Oct 23, 2021

@X1nto but why it stopped you from keeping that functionality? You can put a message in the window, that says something like "Some ROMs can kill app anyway".
And about implementing itself. Described approach is okay and it's used by many apps, such file explorers and others, but I suppose it's unnecessary to run the foreground service on onPause. You can do it immediately after starting update process and do all update-related work there(in background thread, indeed). For update progress to be available you can use Broadcast Receivers(context-registered ones, not ones that use manifest declaration) or any other approaches.
Actually, there's another approach you can try, but usually it shouldn't be used for such work. I mean WorkManager. All the work can be implemented there and for update progress you can use the same approach I mentioned above. The end of the work can be observed by integrated LiveData functionality.

WorkManager actually seems like a good alternative to services, I believe they even provide much more functionality. I'll try to implement this for the upcoming 3.0 that's in the compose branch

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants