Fix upload checks

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-01-22 13:57:38 +01:00 committed by tobiaskaminsky
parent 39b477f513
commit 9b2b72c713
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -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;