- bugfix
authortobiasKaminsky <tobias@kaminsky.me>
Sat, 22 Nov 2014 13:05:51 +0000 (14:05 +0100)
committertobiasKaminsky <tobias@kaminsky.me>
Sat, 22 Nov 2014 13:05:51 +0000 (14:05 +0100)
- changed preferences order

res/xml/preferences.xml
src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java

index 68313e1..b922764 100644 (file)
            <EditTextPreference android:title="@string/prefs_instant_upload_path_title"
                                                android:defaultValue="@string/instant_upload_path"
                                                android:key="instant_upload_path"/>
+           <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_uploading"
+                                       android:disableDependentsState="true"
+                                       android:title="@string/instant_upload_on_charging"
+                                       android:key="instant_upload_on_charging"/>
            <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading"
                                android:title="@string/prefs_instant_upload"
                                android:summary="@string/prefs_instant_upload_summary"/>
            <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_uploading"
                                                android:disableDependentsState="true"
-                                               android:title="@string/instant_upload_on_charging"
-                                               android:key="instant_upload_on_charging"/>
-           <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_uploading"
-                                               android:disableDependentsState="true"
                                                android:title="@string/instant_upload_on_wifi"
                                                android:key="instant_upload_on_wifi"/>
            <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_video_uploading"
index 026fb08..acffddd 100644 (file)
@@ -102,7 +102,6 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
         file_name = c.getString(c.getColumnIndex(Images.Media.DISPLAY_NAME));
         mime_type = c.getString(c.getColumnIndex(Images.Media.MIME_TYPE));
         c.close();
-        
         Log_OC.d(TAG, file_path + "");
 
         // save always temporally the picture to upload
@@ -157,10 +156,16 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
         mime_type = c.getString(c.getColumnIndex(Video.Media.MIME_TYPE));
         c.close();
         Log_OC.d(TAG, file_path + "");
+        
+        // save always temporally the picture to upload
+        DbHandler db = new DbHandler(context);
+        db.putFileForLater(file_path, account.name, null);
+        db.close();
 
         if (!isOnline(context) 
                 || (instantVideoUploadViaWiFiOnly(context) && !isConnectedViaWiFi(context))
-                || (instantUploadWhenChargingOnly(context) && !isCharging(context))) {
+                || (instantUploadWhenChargingOnly(context) && !isCharging(context))
+           ) {
             return;
         }
 
@@ -176,7 +181,7 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
     }
 
     private void handleConnectivityAction(Context context, Intent intent) {
-        if (!instantPictureUploadEnabled(context)) {
+        if (!instantPictureUploadEnabled(context) && !instantVideoUploadEnabled(context)) {
             Log_OC.d(TAG, "Instant upload disabled, don't upload anything");
             return;
         }
@@ -185,6 +190,7 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
                 && isOnline(context)
                 && (!instantUploadWhenChargingOnly(context) || (instantUploadWhenChargingOnly(context) == isCharging(context) == true))
                 && (!instantPictureUploadViaWiFiOnly(context) || (instantPictureUploadViaWiFiOnly(context) == isConnectedViaWiFi(context) == true))
+                && (!instantVideoUploadViaWiFiOnly(context) || (instantVideoUploadViaWiFiOnly(context) == isConnectedViaWiFi(context) == true))
             ) {
             DbHandler db = new DbHandler(context);
             Cursor c = db.getAwaitingFiles();