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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ownCloud admins and users.
* Bugfix - Content in Spaces not shown from third-party apps: [#4522](https://github.com/owncloud/android/issues/4522)
* Bugfix - Add bottom margin for used quota in account dialog: [#4566](https://github.com/owncloud/android/issues/4566)
* Bugfix - Infinite edges in Android 15: [#4576](https://github.com/owncloud/android/issues/4576)
* Bugfix - No message when uploading a file with no quota: [#4582](https://github.com/owncloud/android/issues/4582)
* Change - Bump target SDK to 35: [#4529](https://github.com/owncloud/android/issues/4529)
* Change - Replace dav4android location: [#4536](https://github.com/owncloud/android/issues/4536)
* Change - Modify biometrics fail source string: [#4572](https://github.com/owncloud/android/issues/4572)
Expand Down Expand Up @@ -81,6 +82,14 @@ ownCloud admins and users.
https://github.com/owncloud/android/issues/4576
https://github.com/owncloud/android/pull/4581

* Bugfix - No message when uploading a file with no quota: [#4582](https://github.com/owncloud/android/issues/4582)

A message has been added in the file list when uploading a file (from file
system, camera or shortcut) without available quota

https://github.com/owncloud/android/issues/4582
https://github.com/owncloud/android/pull/4587

* Change - Bump target SDK to 35: [#4529](https://github.com/owncloud/android/issues/4529)

Target SDK has been upgraded to 35 in order to fulfill Android platform
Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/4587
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: No message when uploading a file with no quota

A message has been added in the file list when uploading a file (from file system, camera or shortcut) without available quota

https://github.com/owncloud/android/issues/4582
https://github.com/owncloud/android/pull/4587
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Juan Carlos Garrote Gascón
* @author Jorge Aguado Recio
*
* Copyright (C) 2024 ownCloud GmbH.
* Copyright (C) 2025 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -92,4 +92,9 @@ class ManageAccountsViewModel(
}
quota.getDataOrNull()?.available == -4L
}

fun hasEnoughQuota(accountName: String): Boolean = runBlocking(CoroutinesDispatcherProvider().io) {
val quota = getStoredQuotaUseCase(GetStoredQuotaUseCase.Params(accountName))
quota.getDataOrNull()?.available != 0L
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @author Jorge Aguado Recio
*
* Copyright (C) 2011 Bartek Przybylski
* Copyright (C) 2024 ownCloud GmbH.
* Copyright (C) 2025 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -603,6 +603,9 @@ class FileDisplayActivity : FileActivity(),

// Handle calls form internal activities.
if (requestCode == REQUEST_CODE__SELECT_CONTENT_FROM_APPS && (resultCode == RESULT_OK || resultCode == RESULT_OK_AND_MOVE)) {
if (!manageAccountsViewModel.hasEnoughQuota(account.name)) {
showMessageInSnackbar(message = getString(R.string.failed_upload_quota_exceeded_text))
}

requestUploadOfContentFromApps(data)

Expand All @@ -618,6 +621,9 @@ class FileDisplayActivity : FileActivity(),
capturedFilePaths: Array<String>
) {
if (hasEnoughSpace) {
if (!manageAccountsViewModel.hasEnoughQuota(account.name)) {
showMessageInSnackbar(message = getString(R.string.failed_upload_quota_exceeded_text))
}
requestUploadOfFilesFromFileSystem(capturedFilePaths)
}
}
Expand Down Expand Up @@ -1918,6 +1924,9 @@ class FileDisplayActivity : FileActivity(),
}

override fun uploadShortcutFileFromApp(shortcutFilePath: Array<String>) {
if (!manageAccountsViewModel.hasEnoughQuota(account.name)) {
showMessageInSnackbar(message = getString(R.string.failed_upload_quota_exceeded_text))
}
requestUploadOfFilesFromFileSystem(shortcutFilePath)
}

Expand Down
Loading