Przeglądaj źródła

Fix upload checks

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 7 lat temu
rodzic
commit
9b2b72c713

+ 2 - 1
src/main/java/com/owncloud/android/operations/UploadFileOperation.java

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