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

Photo upload runs only when charging #3553

Closed
kotecky opened this issue Feb 2, 2019 · 9 comments · Fixed by #3589
Closed

Photo upload runs only when charging #3553

kotecky opened this issue Feb 2, 2019 · 9 comments · Fixed by #3589

Comments

@kotecky
Copy link

kotecky commented Feb 2, 2019

Auto upload of photos works only when charging despite the settings (not checked) and the granted exception from battery-saving (phone). When charging starts, the auto upload starts immediately.

Related to old #300 and #355.
3.5.0 RC1, I do not have access to server logs.
Sony Xperia X Compact, Android 8. 0

@nextcloud-android-bot
Copy link
Collaborator

GitMate.io thinks possibly related issues are #1393 (Upload while charging not working ), #355 (video auto-upload only while charging), #1782 (Take photo & upload it directly in folder), #1226 (AutoUpload uploads all photos that already in Nextcloud again), and #1812 (Empty pic created each time a photo is uploaded).

@tobiasKaminsky
Copy link
Member

Can this maybe related to some sort of battery saving optimization on your phone?

@kotecky
Copy link
Author

kotecky commented Feb 6, 2019

Tobias,
it does. But the application has an exception. So I am wondering whether the application correctly interprets the state that the phone is in. I will test things if needed, just need a hint on what should be tested.

(The #3569 seems to share the same symptoms.)

@tobiasKaminsky
Copy link
Member

I will test things if needed, just need a hint on what should be tested.

Thanks for the offer, unfortunately I also do not have a clue, where to start…

Do you see the uploads in the upload queue?

@kotecky
Copy link
Author

kotecky commented Feb 6, 2019

Indeed, they are in the queue and saying that they wait for the battery saving regime to end. Sony calls that regime Stamina. When disabling the regime, the photos get uploaded immediately. So it seems that the app does not know that it has an exception from the regime.

@tobiasKaminsky
Copy link
Member

We rely hier on Android's PowerManager.isPowerSaveMode(context) method.
But I found a way to detect if the app is whitelisted.

@kotecky I can create you a test apk file, which you can simply install (and it will be upgraded to next stable release automatically).
Would you try it?

@kotecky
Copy link
Author

kotecky commented Feb 8, 2019

@tobiasKaminsky yes, I will. Let me know.

@AndyScherzinger
Copy link
Member

As per discussion with @tobiasKaminsky on irc:

power save mode and battery optimization setting are 2 very different things that should not be mixed, nevertheless we need to detect such scenarios as mentionede above since the app itself can't do much about it, it is rather an OEM bug where there is no real work around.

So the solution discusse dis to dected such a situation and inform the user about it within the app.
On the file list screen check:

  1. Any Folder configured and active for Auto Upload
  2. Any file queued for upload with status "waiting for battery"
  3. Battery optimization active
  4. App not excluded from battery optimization

If all these rules apply then show a popup, mentioning the situation (blocked auto uploads) and offering a possible solution (refer to batetry optimization / whitelist).

Another possibility would also be some kind of a "force upload now" where we then update the queued entries to "createdByUser" which is basically a "ignore energy related OS settings" (This needs to be discussed...)

@stale
Copy link

stale bot commented May 9, 2019

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@stale stale bot added the stale label May 9, 2019
@stale stale bot closed this as completed May 23, 2019
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.7.0 milestone Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants