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

trigger upload on reaching wifi #755

Closed
matkoniecz opened this issue Jan 8, 2018 · 4 comments
Closed

trigger upload on reaching wifi #755

matkoniecz opened this issue Jan 8, 2018 · 4 comments
Labels
feedback required more info is needed, issue will be likely closed if it is not provided

Comments

@matkoniecz
Copy link
Member

matkoniecz commented Jan 8, 2018

Note that I noticed one issue that I have yet to fully debug but would be made more significant by #753 change.

Is upload attempt triggered only on edits? Because if I edit without Internet connection and return to wifi it seems that it is not triggering upload and changes are stuck for a long time (until edit/manual upload?).

@westnordost westnordost added the bug label Jan 8, 2018
@westnordost westnordost added feedback required more info is needed, issue will be likely closed if it is not provided and removed bug labels Jan 8, 2018
@matkoniecz
Copy link
Member Author

https://github.com/westnordost/StreetComplete/blob/3d0a08bf274297fc25b0e94c87b0f8c7651810dd/app/build.gradle#L23 - this app targets API level 26, later than N according to https://developer.android.com/guide/topics/manifest/uses-sdk-element.html .

It is trying to use ConnectivityManager.CONNECTIVITY_ACTION https://github.com/westnordost/StreetComplete/blob/master/app/src/main/java/de/westnordost/streetcomplete/data/QuestAutoSyncer.java#L63

According to https://stackoverflow.com/questions/36421930/connectivitymanager-connectivity-action-deprecated "Apps targeting Android N do not receive CONNECTIVITY_ACTION broadcasts"

Apps targeting Android N do not receive CONNECTIVITY_ACTION broadcasts, even if they have manifest entries to request notification of these events. Apps running in the foreground can still listen for CONNECTIVITY_CHANGE on their main thread if they request notification with a BroadcastReceiver.

@westnordost westnordost added bug and removed feedback required more info is needed, issue will be likely closed if it is not provided labels Jan 8, 2018
@westnordost
Copy link
Member

The official documentation states

Apps targeting Android 7.0 (API level 24) and higher do not receive this broadcast if they declare the broadcast receiver in their manifest. Apps will still receive broadcasts if they register their BroadcastReceiver with Context.registerReceiver() and that context is still valid.

https://developer.android.com/reference/android/net/ConnectivityManager.html#CONNECTIVITY_ACTION

The receiver is registered programmatically with Context.registerReceiver().

@westnordost westnordost added feedback required more info is needed, issue will be likely closed if it is not provided and removed bug labels Jan 8, 2018
@matkoniecz
Copy link
Member Author

matkoniecz commented Jan 8, 2018

I tried to reproduce it and run out of ideas how it may be triggerred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback required more info is needed, issue will be likely closed if it is not provided
Projects
None yet
Development

No branches or pull requests

2 participants