mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
Fix upload checks
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
39b477f513
commit
9b2b72c713
1 changed files with 2 additions and 1 deletions
|
@ -761,7 +761,8 @@ public class UploadFileOperation extends SyncOperation {
|
|||
}
|
||||
|
||||
// check if charging conditions are met and delays the upload otherwise
|
||||
if (mWhileChargingOnly && !Device.getBatteryStatus(mContext).isCharging()) {
|
||||
if (mWhileChargingOnly && (!Device.getBatteryStatus(mContext).isCharging() && Device.getBatteryStatus(mContext)
|
||||
.getBatteryPercent() < 1)) {
|
||||
Log_OC.d(TAG, "Upload delayed until the device is charging: " + getRemotePath());
|
||||
remoteOperationResult = new RemoteOperationResult(ResultCode.DELAYED_FOR_CHARGING);
|
||||
return remoteOperationResult;
|
||||
|
|
Loading…
Reference in a new issue