From 69355cfeb073d4f3bc3c024c6c445ae89b897635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garc=C3=ADa=20de=20Prada?= Date: Fri, 30 Sep 2022 10:01:25 +0200 Subject: [PATCH 1/2] Remove legacy owncloud version from the client. --- .../android/lib/common/OwnCloudClient.java | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java index e332b8fa..1281ec13 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java @@ -36,7 +36,6 @@ import com.owncloud.android.lib.common.http.HttpClient; import com.owncloud.android.lib.common.http.HttpConstants; import com.owncloud.android.lib.common.http.methods.HttpBaseMethod; import com.owncloud.android.lib.common.utils.RandomUtils; -import com.owncloud.android.lib.resources.status.OwnCloudVersion; import okhttp3.Cookie; import okhttp3.HttpUrl; import timber.log.Timber; @@ -59,7 +58,6 @@ public class OwnCloudClient extends HttpClient { private OwnCloudCredentials mCredentials = null; private int mInstanceNumber; private Uri mBaseUri; - private OwnCloudVersion mVersion = null; private OwnCloudAccount mAccount; private final ConnectionValidator mConnectionValidator; private Object mRequestMutex = new Object(); @@ -185,7 +183,7 @@ public class OwnCloudClient extends HttpClient { return (mCredentials instanceof OwnCloudAnonymousCredentials || mAccount == null) ? Uri.parse(mBaseUri + WEBDAV_FILES_PATH_4_0) : Uri.parse(mBaseUri + WEBDAV_FILES_PATH_4_0 + AccountUtils.getUserId( - mAccount.getSavedAccount(), getContext() + mAccount.getSavedAccount(), getContext() ) ); } @@ -194,7 +192,7 @@ public class OwnCloudClient extends HttpClient { return mCredentials instanceof OwnCloudAnonymousCredentials ? Uri.parse(mBaseUri + WEBDAV_UPLOADS_PATH_4_0) : Uri.parse(mBaseUri + WEBDAV_UPLOADS_PATH_4_0 + AccountUtils.getUserId( - mAccount.getSavedAccount(), getContext() + mAccount.getSavedAccount(), getContext() ) ); } @@ -241,14 +239,6 @@ public class OwnCloudClient extends HttpClient { HttpUrl.parse(mBaseUri.toString())); } - public OwnCloudVersion getOwnCloudVersion() { - return mVersion; - } - - public void setOwnCloudVersion(OwnCloudVersion version) { - mVersion = version; - } - public OwnCloudAccount getAccount() { return mAccount; } @@ -260,4 +250,4 @@ public class OwnCloudClient extends HttpClient { public void setFollowRedirects(boolean followRedirects) { this.mFollowRedirects = followRedirects; } -} \ No newline at end of file +} From bcd7fead11e6bfeb5c09b22a76abef3217a3d755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garc=C3=ADa=20de=20Prada?= Date: Tue, 4 Oct 2022 08:10:54 +0200 Subject: [PATCH 2/2] Remove legacy KEY_OC_VERSION constant --- .../lib/common/accounts/AccountUtils.java | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java index 9db87f4b..535104df 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java @@ -94,26 +94,6 @@ public class AccountUtils { return username; } - /** - * Get the stored server version corresponding to an OC account. - * - * @param account An OC account - * @param context Application context - * @return Version of the OC server, according to last check - */ - public static OwnCloudVersion getServerVersionForAccount(Account account, Context context) { - AccountManager ama = AccountManager.get(context); - OwnCloudVersion version = null; - try { - String versionString = ama.getUserData(account, Constants.KEY_OC_VERSION); - version = new OwnCloudVersion(versionString); - - } catch (Exception e) { - Timber.e(e, "Couldn't get a the server version for an account"); - } - return version; - } - /** * @return * @throws IOException @@ -209,11 +189,6 @@ public class AccountUtils { } public static class Constants { - /** - * Version should be 3 numbers separated by dot so it can be parsed by - * {@link OwnCloudVersion} - */ - public static final String KEY_OC_VERSION = "oc_version"; /** * Base url should point to owncloud installation without trailing / ie: * http://server/path or https://owncloud.server