From 91c28ee158f4a375927673ba09cd06f49308ebfc Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 15 Feb 2017 11:24:29 +0100 Subject: [PATCH] Enable auto upload on Android 6+ only :-/ --- .../android/files/InstantUploadBroadcastReceiver.java | 2 +- src/com/owncloud/android/ui/activity/DrawerActivity.java | 4 ++-- src/com/owncloud/android/ui/activity/FileDisplayActivity.java | 2 +- src/com/owncloud/android/ui/activity/Preferences.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java b/src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java index 0f9428c421..6796477c5e 100644 --- a/src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java +++ b/src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java @@ -58,7 +58,7 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { Log_OC.d(TAG, "Received: " + intent.getAction()); if (intent.getAction().equals(NEW_PHOTO_ACTION_UNOFFICIAL)) { handleNewPictureAction(context, intent); diff --git a/src/com/owncloud/android/ui/activity/DrawerActivity.java b/src/com/owncloud/android/ui/activity/DrawerActivity.java index 107617139d..c1109bee9b 100644 --- a/src/com/owncloud/android/ui/activity/DrawerActivity.java +++ b/src/com/owncloud/android/ui/activity/DrawerActivity.java @@ -175,8 +175,8 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU setupQuotaElement(); - // show folder sync menu item only for Android 5+ - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { + // show folder sync menu item only for Android 6+ + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { mNavigationView.getMenu().removeItem(R.id.nav_folder_sync); } } diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 51f19ecf17..6b44875b75 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -257,7 +257,7 @@ public class FileDisplayActivity extends HookActivity */ private void upgradeNotificationForInstantUpload() { // check for Android 5+ if legacy instant upload is activated --> disable + show info - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && (PreferenceManager.instantPictureUploadEnabled(this) || PreferenceManager.instantPictureUploadEnabled(this))) { diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index 9db1fdb4ae..de6bf9d23f 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/src/com/owncloud/android/ui/activity/Preferences.java @@ -368,8 +368,8 @@ public class Preferences extends PreferenceActivity mPrefInstantUploadCategory = (PreferenceCategory) findPreference("instant_uploading_category"); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { - // Instant upload via preferences on pre pre Lollipop + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + // Instant upload via preferences on pre pre M mPrefInstantUploadPath = findPreference("instant_upload_path"); if (mPrefInstantUploadPath != null) {