浏览代码

Merge pull request #1578 from nextcloud/fix-4g-retry

Fix 4g retry
Tobias Kaminsky 7 年之前
父节点
当前提交
2dde6e7b61

+ 1 - 1
scripts/lint/lint-results.txt

@@ -1,2 +1,2 @@
 DO NOT TOUCH; GENERATED BY DRONE
-      <span class="mdl-layout-title">Lint Report: 1 error and 510 warnings</span>
+      <span class="mdl-layout-title">Lint Report: 510 warnings</span>

+ 12 - 2
scripts/lint/lint-up.rb

@@ -117,12 +117,22 @@ else
     unless previous_error_warning_string.nil?
         previous_results = true
 
-        previous_error_string = previous_error_warning_string.match(/[0-9]* error[s]?/)[0]
+        previous_error_string = previous_error_warning_string.match(/[0-9]* error[s]?/)
+        if previous_error_string.nil?
+            previous_error_string = "0 errors"
+        else
+            previous_error_string = previous_error_string[0]
+        end
         previous_error_count = previous_error_string.match(/[0-9]*/)[0].to_i
         puts "previous errors: " + previous_error_count.to_s
 
         if CHECK_WARNINGS == true
-            previous_warning_string = previous_error_warning_string.match(/[0-9]* warning[s]?/)[0]
+            previous_warning_string = previous_error_warning_string.match(/[0-9]* warning[s]?/)
+            if previous_warning_string.nil?
+                previous_warning_string = "0 warnings"
+            else
+                previous_warning_string = previous_warning_string[0]
+            end
             previous_warning_count = previous_warning_string.match(/[0-9]*/)[0].to_i
             puts "previous warnings: " + previous_warning_count.to_s
         end

+ 1 - 1
src/main/java/com/owncloud/android/utils/ReceiversHelper.java

@@ -44,7 +44,7 @@ public class ReceiversHelper {
         BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
             @Override
             public void onReceive(Context context, Intent intent) {
-                if (Device.getNetworkType(context).equals(JobRequest.NetworkType.UNMETERED)) {
+                if (!Device.getNetworkType(context).equals(JobRequest.NetworkType.ANY)) {
                     FilesSyncHelper.restartJobsIfNeeded();
                 }
             }