nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.32k stars 1.78k forks source link

Set wait time after charger connect for auto upload #1803

Open egeu5 opened 7 years ago

egeu5 commented 7 years ago

Actual behaviour

If i connect the power / charger to my phone the app imediatly uploads all the pictures of the day. I connect the power in normal case if the phone is almost empty. Then the upload is starting and uses a lot of power if there are many pictures. Sometimes it is to much power and the phone is shutting down.

Expected behaviour

Set a timer to wait after I connect the charger. The most users will charge the phone over the night so there is enough time to upload. Older phones are almost unuseable if they are uploading data.

Steps to reproduce

  1. Activate auto upload
  2. Enable the feature "on charger only"
  3. Got a lot of pictures over the day
  4. Connect the phone
  5. Have fun if you want to do something else with the phone

Environment data

Android version: CM13.1

Device model:

Stock or customized system:

Nextcloud app version: 2.0.0

Nextcloud server version: 13.0.3-3

AndyScherzinger commented 7 years ago

Hi @egeu5, thank for the report, this may or may not be fixed with 2.1.0 via https://github.com/nextcloud/android/pull/1527 which delays auto uploads if the device is in power save mode.

AndyScherzinger commented 7 years ago

Any opinios @tobiasKaminsky @mario ? I am not sure if power save mode is detected or active if the device is charging.

egeu5 commented 7 years ago

1527 was not tagged as AutoUpload, so i did not find it. Sorry for that :-)

But in #1527 you only want to delay it if the device is in power safe mode. I think there are some cases where an additional delay might be awesome. Especially if every app would do a lot of things after connecting you're device to the power the device would not be useable for quite a while... ;-) You could ad a button like "Low priority sync" and not add a setable integer which 99% of the users won't use. But that is just my opinion. Thank you for this awesome app! You're helping me every day!

tobiasKaminsky commented 7 years ago

I think the best way is to combine both: start auto upload when charging and battery is >= 15% (this is the threshold for power save mode). I am unsure if we can get notified when device is >= 15%...

AndyScherzinger commented 7 years ago

Sounds like a good solution while I also can't tell if we can get this information or be notified about it...

luiscruz commented 6 years ago

So, in the end, does #1527 fix the issue? I.e., can we detect power save mode while the device is charging?

mario commented 6 years ago

@luiscruz it should. Did you try 3.0.3? :)

luiscruz commented 6 years ago

I haven't 🙈😕 Anyway, shall we close this issue?

mario commented 6 years ago

@luiscruz not until you try it :P

egeu5 commented 6 years ago

I tested it and it is not working. Settings: Auto Upload only on wifi, only while charging, use subdir and leave original untouched. The phone was in power-safe mode (battery was at 13% and die power-safe mode messaged appeard). The phone started to upload the pictures immediately after connecting to the charger.

tobiasKaminsky commented 6 years ago

@egeu5, it did what it is expected to do: upload when charging. Delaying upload when in power save mode is only if you are not connected to a charger and if "only while charging" is disabled. This is to prevent draining battery even more.

Do you expect that the upload starts after battery is at >15% and charging?

egeu5 commented 6 years ago

Ok, thats not what I expected.

Do you expect that the upload starts after battery is at >15% and charging?

You are right. I think we had to wait until the phone is not in low-power-mode. Sometimes it happens to me (if the battery is almost at 1%) that the phone is plugged into the charger, immidiatley start updating from Play- and F-Store and start synchronising with nc - and that consume to much power and the phone died at 0% battery.

Furthermore it would be nice to add a delay. Imagine you have 10 different apps and every app will do a lot of things right after you plug you're phone into the charger. You're phone woun't be usable anymore for quite a time... that is not fair. One possibility which I think is a nice way is to add those additional timer which is shown in the notification-area and starts to count down after plugging in you're phone. And we could add a button like "Start uploading now" or "Skip delay".