Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,215 changes: 1,215 additions & 0 deletions app/schemas/com.nextcloud.client.database.NextcloudDatabase/95.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ class CapabilityUtilsIT : AbstractIT() {
assertTrue(test(OwnCloudVersion.nextcloud_20))
}

private fun test(version: OwnCloudVersion): Boolean =
CapabilityUtils.checkOutdatedWarning(targetContext.resources, version, false)
@Test
fun checkOutdatedWarningWithSubscription() {
assertFalse(test(NextcloudVersion.nextcloud_31))
assertFalse(test(NextcloudVersion.nextcloud_30))

assertFalse(test(OwnCloudVersion.nextcloud_20, true))
}

private fun test(version: OwnCloudVersion, hasValidSubscription: Boolean = false): Boolean =
CapabilityUtils.checkOutdatedWarning(targetContext.resources, version, false, hasValidSubscription)
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ import com.owncloud.android.db.ProviderMeta
AutoMigration(from = 90, to = 91),
AutoMigration(from = 91, to = 92),
AutoMigration(from = 92, to = 93, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class),
AutoMigration(from = 93, to = 94, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class)
AutoMigration(from = 93, to = 94, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class),
AutoMigration(from = 94, to = 95, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class)
],
exportSchema = true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,7 @@ data class CapabilityEntity(
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_USER_STATUS_SUPPORTS_BUSY)
val userStatusSupportsBusy: Int?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_WINDOWS_COMPATIBLE_FILENAMES)
val isWCFEnabled: Int?
val isWCFEnabled: Int?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_HAS_VALID_SUBSCRIPTION)
val hasValidSubscription: Int?
)
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

import com.blikoon.qrcodescanner.QrCodeActivity;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
Expand Down Expand Up @@ -105,7 +104,6 @@
import com.owncloud.android.utils.ErrorMessageAdapter;
import com.owncloud.android.utils.PermissionUtil;
import com.owncloud.android.utils.WebViewUtil;
import com.owncloud.android.utils.theme.CapabilityUtils;
import com.owncloud.android.utils.theme.ViewThemeUtils;

import java.io.InputStream;
Expand Down Expand Up @@ -1104,13 +1102,6 @@ private void onGetServerInfoFinish(RemoteOperationResult result) {
// 4. we got the authentication method required by the server
mServerInfo = (GetServerInfoOperation.ServerInfo) (result.getData().get(0));

// show outdated warning
if (CapabilityUtils.checkOutdatedWarning(getResources(),
mServerInfo.mVersion,
mServerInfo.hasExtendedSupport)) {
DisplayUtils.showServerOutdatedSnackbar(this, Snackbar.LENGTH_INDEFINITE);
}

if (webViewUser != null && !webViewUser.isEmpty() &&
webViewPassword != null && !webViewPassword.isEmpty()) {
checkBasicAuthorization(webViewUser, webViewPassword);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2420,6 +2420,8 @@ private ContentValues createContentValues(String accountName, OCCapability capab
contentValues.put(ProviderTableMeta.CAPABILITIES_NOTES_FOLDER_PATH, capability.getNotesFolderPath());

contentValues.put(ProviderTableMeta.CAPABILITIES_DEFAULT_PERMISSIONS, capability.getDefaultPermissions());

contentValues.put(ProviderTableMeta.CAPABILITIES_HAS_VALID_SUBSCRIPTION, capability.getHasValidSubscription().getValue());

return contentValues;
}
Expand Down Expand Up @@ -2605,6 +2607,7 @@ private OCCapability createCapabilityInstance(Cursor cursor) {
capability.setNotesFolderPath(getString(cursor, ProviderTableMeta.CAPABILITIES_NOTES_FOLDER_PATH));

capability.setDefaultPermissions(getInt(cursor, ProviderTableMeta.CAPABILITIES_DEFAULT_PERMISSIONS));
capability.setHasValidSubscription(getBoolean(cursor, ProviderTableMeta.CAPABILITIES_HAS_VALID_SUBSCRIPTION));
}

return capability;
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/owncloud/android/db/ProviderMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
public class ProviderMeta {
public static final String DB_NAME = "filelist";
public static final int DB_VERSION = 94;
public static final int DB_VERSION = 95;

private ProviderMeta() {
// No instance
Expand Down Expand Up @@ -290,6 +290,7 @@ static public class ProviderTableMeta implements BaseColumns {
public static final String CAPABILITIES_FILES_DOWNLOAD_LIMIT_DEFAULT = "files_download_limit_default";
public static final String CAPABILITIES_NOTES_FOLDER_PATH = "notes_folder_path";
public static final String CAPABILITIES_DEFAULT_PERMISSIONS = "default_permissions";
public static final String CAPABILITIES_HAS_VALID_SUBSCRIPTION = "has_valid_subscription";

//Columns of Uploads table
public static final String UPLOADS_LOCAL_PATH = "local_path";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ class FileDisplayActivity :
CapabilityUtils.checkOutdatedWarning(
getResources(),
user.get().server.version,
capabilities.extendedSupport.isTrue
capabilities.extendedSupport.isTrue,
capabilities.hasValidSubscription.isTrue
)
) {
DisplayUtils.showServerOutdatedSnackbar(this, Snackbar.LENGTH_LONG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ public static void updateCapability(OCCapability capability) {

public static boolean checkOutdatedWarning(Resources resources,
OwnCloudVersion version,
boolean hasExtendedSupport) {
boolean hasExtendedSupport,
boolean hasValidSubscription) {
return resources.getBoolean(R.bool.show_outdated_server_warning) &&
(MainApp.OUTDATED_SERVER_VERSION.isSameMajorVersion(version) ||
version.isOlderThan(MainApp.OUTDATED_SERVER_VERSION))
&& !hasExtendedSupport;
&& !hasExtendedSupport && !hasValidSubscription;
}
}
13 changes: 13 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18063,6 +18063,19 @@
<sha256 value="b29d8928cba81c13d016ac2e0b7a7d40f1b2e71f8229d65efcffb871a27576de" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="d525104338">
<artifact name="android-library-d525104338.aar">
<sha256 value="dbd608b7b39e8e89f82450f24a48fd0f084d264ea6b95b2993897e44de0954d3" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
<artifact name="android-library-d525104338.module">
<sha256 value="65bb7aa76e0d9992d5afcd15ea59bc996d8ed29ce79f177fc3f1910f4bc286dc" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="d525104338a94b61df6cf44041081d95ed2955c9">
<artifact name="android-library-d525104338a94b61df6cf44041081d95ed2955c9.pom">
<sha256 value="54aed157e9fbecdd01361b651f4f25163ffe6589d50c9506110f450e6faa9b01" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="d5f21fa1ec5b67c564983b0c8a07bc3acd96f695">
<artifact name="android-library-d5f21fa1ec5b67c564983b0c8a07bc3acd96f695.aar">
<sha256 value="95c86f501a4c1a2e055ba2d1fe68f5ffeed3613492bdaf0594abbae4b21b9227" origin="Generated by Gradle" reason="Artifact is not signed"/>
Expand Down
Loading