Skip to content
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

Run copyTo and remove methods in a background thread #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ramikhafagi96
Copy link

@ramikhafagi96 ramikhafagi96 commented Sep 8, 2022

Issue description

Due to many issues reported that the application hangs during fetching live update, by running the app on a low-end device HUWAIE-GR5 found that the copyTo method blocks the main UI thread for 128 seconds, by checking the implementation found that the method runs on the foreground not in a background thread. So, in a result the skip button is not enabled after exactly 30 seconds and the user screen just hangs.

Solution

The solution was to run the copyTo and remove methods in a background thread to avoid blocking the main UI thread and the user can skip live update if it takes more than 30 seconds

Screenshot 2022-09-08 at 2 43 19 AM

Note

before merging this PR, I should make it clear on some low-end devices the live update most probably it will always take more than 30 seconds so are we sure that it's okay to allow the user to skip the update after 30 seconds have passed as this will always be the case

Before and after videos

In the after video you can see that the skip button is enabled after exactly 30 seconds as the UI thread is not blocked

Before After

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant