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

[Feature]: Updater compatibility with minimizing app #719

Open

Description

@ViktorScaletta

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.

Activity

  1. X1nto commented on Oct 23, 2021

    @X1nto
    Member

    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.

  2. ViktorScaletta commented on Oct 23, 2021

    @ViktorScaletta
    Author

    @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.

  3. X1nto commented on Oct 23, 2021

    @X1nto
    Member

    @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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions