Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Data requests when app is backgrounded #9965

Closed
tobrun opened this issue Sep 12, 2017 · 4 comments
Closed

Data requests when app is backgrounded #9965

tobrun opened this issue Sep 12, 2017 · 4 comments
Assignees
Labels
Android Mapbox Maps SDK for Android

Comments

@tobrun
Copy link
Member

tobrun commented Sep 12, 2017

Users have reported seeing data requests occurring when the app has been backgrounded (the Activity is in an paused state). One example given was the download of a sprite (eg. sprite@2x.png) which occured when the app has been backgrounded for a couple of hours. Ideally we stop requesting resources when onPause occurs and only resume downloads when we hit onResume.

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Sep 12, 2017
@kkaefer
Copy link
Contributor

kkaefer commented Sep 12, 2017

It's likely that this happens because resources expire while the app is still running in the background. When a resource expires, we try to reload/refresh it.

@kkaefer
Copy link
Contributor

kkaefer commented Sep 12, 2017

@tobrun DefaultFileSource has the ability to pause:

/*
* Pause file request activity.
*
* If pause is called then no revalidation or network request activity
* will occur.
*/
void pause();
/*
* Resume file request activity.
*
* Calling resume will unpause the file source and process any tasks that
* expired while the file source was paused.
*/
void resume();

Are we calling this when the app goes to the background?

@tobrun
Copy link
Member Author

tobrun commented Sep 12, 2017

Thank you for 👀 @kkaefer, we aren't atm, will fix this up.

@tobrun tobrun self-assigned this Sep 27, 2017
@tobrun tobrun added this to the android-v5.2.0 milestone Sep 27, 2017
@lilykaiser lilykaiser modified the milestones: android-v5.2.0, android-v6.0.0 Oct 2, 2017
@tobrun
Copy link
Member Author

tobrun commented Dec 12, 2017

This landed in 5.2.0

@tobrun tobrun closed this as completed Dec 12, 2017
@tobrun tobrun removed this from the android-v6.0.0 milestone Dec 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

3 participants