|
@@ -92,7 +92,7 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
|
|
|
|
|
|
Account account = AccountUtils.getCurrentOwnCloudAccount(context);
|
|
Account account = AccountUtils.getCurrentOwnCloudAccount(context);
|
|
if (account == null) {
|
|
if (account == null) {
|
|
- Log_OC.w(TAG, "No ownCloud account found for instant upload, aborting");
|
|
|
|
|
|
+ Log_OC.w(TAG, "No account found for instant upload, aborting");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -170,7 +170,7 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
|
|
|
|
|
|
Account account = AccountUtils.getCurrentOwnCloudAccount(context);
|
|
Account account = AccountUtils.getCurrentOwnCloudAccount(context);
|
|
if (account == null) {
|
|
if (account == null) {
|
|
- Log_OC.w(TAG, "No owncloud account found for instant upload, aborting");
|
|
|
|
|
|
+ Log_OC.w(TAG, "No account found for instant upload, aborting");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -211,6 +211,19 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (instantPictureUploadViaWiFiOnly(context) && !isConnectedViaWiFi(context)){
|
|
|
|
+ Account account = AccountUtils.getCurrentOwnCloudAccount(context);
|
|
|
|
+ if (account == null) {
|
|
|
|
+ Log_OC.w(TAG, "No account found for instant upload, aborting");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Intent i = new Intent(context, FileUploader.class);
|
|
|
|
+ i.putExtra(FileUploader.KEY_ACCOUNT, account);
|
|
|
|
+ i.putExtra(FileUploader.KEY_CANCEL_ALL, true);
|
|
|
|
+ context.startService(i);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (!intent.hasExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY)
|
|
if (!intent.hasExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY)
|
|
&& isOnline(context)
|
|
&& isOnline(context)
|
|
&& (!instantPictureUploadViaWiFiOnly(context) || (instantPictureUploadViaWiFiOnly(context) == isConnectedViaWiFi(context) == true))) {
|
|
&& (!instantPictureUploadViaWiFiOnly(context) || (instantPictureUploadViaWiFiOnly(context) == isConnectedViaWiFi(context) == true))) {
|
|
@@ -218,6 +231,11 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
|
|
Cursor c = db.getAwaitingFiles();
|
|
Cursor c = db.getAwaitingFiles();
|
|
if (c.moveToFirst()) {
|
|
if (c.moveToFirst()) {
|
|
do {
|
|
do {
|
|
|
|
+ if (instantPictureUploadViaWiFiOnly(context) &&
|
|
|
|
+ !isConnectedViaWiFi(context)){
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
String account_name = c.getString(c.getColumnIndex("account"));
|
|
String account_name = c.getString(c.getColumnIndex("account"));
|
|
String file_path = c.getString(c.getColumnIndex("path"));
|
|
String file_path = c.getString(c.getColumnIndex("path"));
|
|
File f = new File(file_path);
|
|
File f = new File(file_path);
|