Compare commits

...
Author SHA1 Message Date
tobiasKaminsky 124892e96d use gradle-cache
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-08 08:59:32 +02:00
tobiasKaminsky e31e891e6e use gradle-cache
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-08 08:54:38 +02:00
Marcel Müller 87797fac2a try cache 2026-09-04 16:21:13 +02:00
Marcel Müller 4372bf87ea format document 2026-09-04 15:57:41 +02:00
Marcel Müller 4ce89d6e58 use 10GB on max 2026-09-04 15:57:20 +02:00
Marcel Müller a49a6affd6 Also upload hidden files 2026-09-04 15:56:53 +02:00
tobiasKaminsky 0f06a59f3a wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-04 08:54:25 +02:00
tobiasKaminsky 3f2a31b196 wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-04 08:19:06 +02:00
tobiasKaminsky ad48bd94ef CI: first build, then assemble
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-03 10:08:34 +02:00
tobiasKaminsky c106507a0e CI: first build, then assemble
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-03 09:44:23 +02:00
Alper Öztürk a6717a26a0 Merge pull request #17508 from nextcloud/improve-chunked-upload
Improve chunked upload
2026-09-03 08:12:42 +02:00
Nextcloud bot 9a4474ce11 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-09-03 03:59:11 +00:00
Alper Öztürk c61bbc56b3 Merge pull request #16672 from nextcloud/editTags
edit tags
2026-09-02 14:29:01 +02:00
Alper Öztürk ceb5192d8f Merge pull request #17524 from nextcloud/fix/internal-103394-media-filters-state
Mantain filters state when navigating away from media list
2026-09-02 13:57:33 +02:00
Alper Öztürk b6b4f7402e Merge pull request #17504 from nextcloud/fix/17495
Hide the bottom navigation bar when a text file preview is shown
2026-09-02 13:06:14 +02:00
Alper Öztürk 84d0af9537 Merge pull request #17538 from nextcloud/fix/helpdesk-104634
Fix ordering filter resetting on refresh in Favorites
2026-09-02 13:05:45 +02:00
Alper Öztürk 2387bedc31 Merge pull request #17401 from nextcloud/fix/auto-upload-skip-check
fix(auto-upload): skip check
2026-09-02 12:35:15 +02:00
Alper Öztürk e4de160952 Merge pull request #17539 from nextcloud/fix/media-not-refreshed-after-folder-change
Fix media view not being refreshed when selecting a different media folder
2026-09-02 12:34:52 +02:00
Alper Öztürk 9bedf98111 Merge pull request #17503 from nextcloud/improve-media-provider
Improve media provider
2026-09-02 12:22:13 +02:00
daniele-verducci eb3964e51b fix/17495: hides the bottom navigation bar when a text file preview is shown
Signed-off-by: daniele-verducci <[email protected]>
2026-09-02 11:55:38 +02:00
alperozturk96 e966354e00 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-02 11:24:35 +02:00
tobiasKaminsky 9b72cb711d Tag: sort case-insensitive
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-02 10:53:57 +02:00
tobiasKaminsky 081fd2de3e create TagUiState
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-02 10:53:57 +02:00
tobiasKaminsky a33c9e3984 wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-02 10:53:57 +02:00
tobiasKaminsky ab0c803107 wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-02 10:53:57 +02:00
tobiasKaminsky c826703a84 edit tags
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-02 10:53:57 +02:00
Alper Öztürk c45225ac76 Merge pull request #14947 from nextcloud/nmc/albums
Albums functionality
2026-09-02 10:34:55 +02:00
renovate[bot] bfdc3fdac0 Update dependency com.diffplug.spotless to v8.10.0 (#17509)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: tobiasKaminsky <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-09-02 08:14:31 +00:00
renovate[bot] d187b32076 Update dependency com.google.firebase:firebase-messaging to v25.1.2 (#17513)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-09-02 07:41:15 +00:00
alperozturk96 b31ae1e912 remove logs
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 17:25:38 +02:00
alperozturk96 8a0c586fd9 convert to kotlin and simplify logic
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 17:25:38 +02:00
alperozturk96 a2065c7405 convert to kotlin and simplify logic
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 17:25:38 +02:00
alperozturk96 34b3d8e93a Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 17:25:38 +02:00
alperozturk96 dc29cfa08d revert
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 13:19:51 +02:00
alperozturk96 27f03e293f use local lib temporary
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 13:13:24 +02:00
daniele-verducci d42213bc70 Merge branch 'master' into fix/internal-103394-media-filters-state 2026-09-01 12:16:43 +02:00
daniele-verducci 89ae720bd5 Documented unclear function
Signed-off-by: daniele-verducci <[email protected]>
2026-09-01 11:56:11 +02:00
alperozturk96 40b88b7276 update lib
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:19:45 +02:00
alperozturk96 6261c237fc update lib
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:14:41 +02:00
alperozturk96 3a3e569b2f update lib
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:11:03 +02:00
alperozturk96 cf271fbc86 update lib
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:11:02 +02:00
alperozturk96 38f6b1162d update lib
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:11:00 +02:00
alperozturk96 481bc5034e use user's capabilities to inject serverMaxChunkSize
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/operations/UploadFileOperation.java
2026-09-01 10:10:56 +02:00
alperozturk96 a5237804e2 add chunked max upload size
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:10:40 +02:00
alperozturk96 1ca3def0e2 fix video preview
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 71b9587106 fix video preview
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 cdf67ea5d1 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 d794a4ea68 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 bb58bfc867 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 eeb4ee68f8 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 8e493f58f7 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 75048833c7 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 79a6e4577c wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 9515547226 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 4a96afbf0b wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 8e2d30121f wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 3928505536 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 f003013ab2 remove unused orientation logic
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 711ac95132 unify column count logic
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 855a2b039c unify column count logic
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 a8ad36f74e use empty state
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 0deebb16b2 use thread safe CopyOnWriteArrayList
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 c94921cc90 introduce ThumbnailArguments
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 3de3923dd1 introduce ThumbnailArguments
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 cbf4037f9a wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 e19f0f76f7 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 3407a43daf wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 100b1cc1bd refactor album sharing bottom sheet
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 092ce03c8c wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
Surinder Kumar a0ffc6d808 feat(albums): add link sharing and add-to-album
Add a sharing bottom sheet for albums with public link creation, sharing
and revocation, backed by PublicShareLinkAlbumRemoteOperation.

Add files to an album from the file list, the image preview and the media
preview. Album picking moves into FileOperationsHelper.addFileToAlbum, so
AlbumsPickerActivity now receives the selected paths and performs the copy
itself instead of returning them through an activity result.

Signed-off-by: Surinder Kumar <[email protected]>
Assisted-by: ClaudeCode:claude-opus-5
2026-09-01 10:03:35 +02:00
alperozturk96 f1c4597931 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 cb1540babd wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 bb39a362eb wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 88de01d562 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
Surinder Kumar f0f607b63a upload files to album, hide video overlay icon, minor ui and bug fixes
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
A117870935 977c769171 Albums functionality.
Signed-off-by: A117870935 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java
#	app/src/main/java/com/owncloud/android/ui/adapter/GalleryAdapter.kt

# Conflicts:
#	app/src/main/res/values/strings.xml

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

# Conflicts:
#	app/src/main/java/com/nextcloud/client/di/ComponentsModule.java

# Conflicts:
#	app/src/main/java/com/nextcloud/ui/albumItemActions/AlbumItemAction.kt
#	app/src/main/java/com/nextcloud/ui/albumItemActions/AlbumItemActionsBottomSheet.kt
#	app/src/main/java/com/owncloud/android/ui/activity/AlbumsPickerActivity.kt
#	app/src/main/java/com/owncloud/android/ui/adapter/albums/AlbumFragmentInterface.kt
#	app/src/main/java/com/owncloud/android/ui/adapter/albums/AlbumGridItemViewHolder.kt
#	app/src/main/java/com/owncloud/android/ui/adapter/albums/AlbumItemViewHolder.kt
#	app/src/main/java/com/owncloud/android/ui/adapter/albums/AlbumListItemViewHolder.kt
#	app/src/main/java/com/owncloud/android/ui/adapter/albums/AlbumsAdapter.kt
#	app/src/main/java/com/owncloud/android/ui/dialog/CreateAlbumDialogFragment.kt
#	app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragment.java
#	app/src/main/java/com/owncloud/android/ui/fragment/albums/AlbumItemsFragment.kt
#	app/src/main/java/com/owncloud/android/ui/fragment/albums/AlbumsFragment.kt
#	app/src/main/res/layout/albums_fragment.xml
#	app/src/main/res/layout/albums_grid_item.xml
#	app/src/main/res/layout/albums_list_item.xml
#	app/src/main/res/menu/bottom_navigation_menu.xml
#	app/src/main/res/menu/partial_drawer_entries.xml
2026-09-01 10:03:35 +02:00
Surinder Kumar e00e92fe98 rebased with master
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 4897cbf9bc add albumOperationListener
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	gradle/verification-metadata.xml
2026-09-01 10:03:35 +02:00
alperozturk96 42a75aba57 adopt overlay manager
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/nextcloud/client/jobs/upload/FileUploadHelper.kt
2026-09-01 10:03:35 +02:00
alperozturk96 fd173bfb0c fix menu item highlighting
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 30a7812896 fix(spotbugs): NAB: Needless Autoboxing
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 42d17f3427 album items fragment code cleanup
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 a8094e5e47 use outlined card
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 c2a87d52cd small typo fixes
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 9e648a209e fix git conflict
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 b3d95bfe86 fix fab button appereance
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 c48a77dcf9 use action bottom sheet for album item actions
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 b38b4b0cda use action bottom sheet for album item actions
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 43f2dd5aa2 use fab
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 cdbd188acc m3 card
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 2e28745f2d m3 card
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 f5810ac82b fix code analytics, simplify
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.kt
2026-09-01 10:03:35 +02:00
alperozturk96 17193a75b6 use optional generic function to access fragment
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 629fa25f37 simplify album fragment
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 e6273a1093 separate params
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 bf7c204d65 separate worker parameters
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
alperozturk96 48b6bb6c92 simplify upload file calls
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 10:03:35 +02:00
Surinder Kumar 152efbceee album upload worker state handled via localbroadcastmanager
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
Surinder Kumar b0769ee806 code fixes
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
tobiasKaminsky 58a0791874 small fix
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-01 10:03:35 +02:00
Surinder Kumar 049b76d391 upload files to album, hide video overlay icon, minor ui and bug fixes
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
A117870935 0799091a38 Code refactoring and operation migrated to kotlin
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
A117870935 fdd7de2aca Rename .java to .kt
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
A117870935 d6986a84dd Albums functionality.
Signed-off-by: A117870935 <[email protected]>
2026-09-01 10:03:35 +02:00
tobiasKaminsky 6b88b78cf8 wip
Signed-off-by: tobiasKaminsky <[email protected]>

# Conflicts:
#	gradle/libs.versions.toml
2026-09-01 10:03:35 +02:00
Surinder Kumar be0d313c17 upload files to album, hide video overlay icon, minor ui and bug fixes
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
Surinder Kumar 9879cb4a4e Fix: preview album items
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
A117870935 6c296c95f2 Fix -> video click event, overflow menu item hide and theming add menu
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
A117870935 c10a951574 Code refactoring and operation migrated to kotlin
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
A117870935 844d8029ae Rename .java to .kt
Signed-off-by: Surinder Kumar <[email protected]>
2026-09-01 10:03:35 +02:00
A117870935 bce8e8e5d3 Albums functionality.
Signed-off-by: A117870935 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java
#	app/src/main/java/com/owncloud/android/ui/adapter/GalleryAdapter.kt

# Conflicts:
#	app/src/main/res/values/strings.xml

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

# Conflicts:
#	app/src/main/java/com/nextcloud/client/di/ComponentsModule.java

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/adapter/OCFileListDelegate.kt
2026-09-01 10:03:35 +02:00
alperozturk96 acf08e6b06 fix verification-metadata.xml
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 09:02:56 +02:00
alperozturk96 285f7149ff wip
Signed-off-by: alperozturk96 <[email protected]>
2026-09-01 08:38:28 +02:00
Alper Öztürk 9741714f3c Merge pull request #17396 from nextcloud/feat/bypass-battery-optimization
feat(auto-upload): ignore battery optimization with sync now
2026-09-01 08:34:22 +02:00
tobiasKaminsky 3aca64edc4 Temp fix for chunked upload
Signed-off-by: tobiasKaminsky <[email protected]>
2026-09-01 07:52:32 +02:00
daniele-verducci 9342d513b5 Fix media view not being refreshed when selecting a different media folder
Signed-off-by: daniele-verducci <[email protected]>
2026-08-31 17:14:43 +02:00
daniele-verducci 84f97998de fix/internal-103394-media-filters-state: Mantain filters state when navigating away from media list
Signed-off-by: daniele-verducci <[email protected]>
2026-08-31 15:09:36 +02:00
daniele-verducci 4c98df9982 fix/helpdesk-104634: Fix filter resetting on refresh in Favorites
Signed-off-by: daniele-verducci <[email protected]>
2026-08-31 15:09:03 +02:00
Tobias Kaminsky d5299bb2ec Merge pull request #17518 from nextcloud/renovate/spotbugsgradleplugin
Update dependency com.github.spotbugs to v6.5.11
2026-08-31 14:24:07 +02:00
Tobias Kaminsky 9d6f749260 Merge pull request #17537 from nextcloud/taskList
exclude AI check from task-list check
2026-08-31 12:56:49 +02:00
tobiasKaminsky 3829520576 exclude AI from task-list check
Signed-off-by: tobiasKaminsky <[email protected]>
2026-08-31 12:50:30 +02:00
renovate[bot] 4c5e9e9b34 Update androidPluginVersion to v9.3.2 (#17530)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-31 09:58:08 +00:00
Tobias Kaminsky 264fa809ed Merge pull request #17532 from nextcloud/renovate/actions-setup-java-6.x
Update actions/setup-java action to v6
2026-08-31 11:33:38 +02:00
renovate[bot] 1c5736eb09 Update actions/setup-java action to v6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-31 10:42:55 +02:00
renovate[bot] 67e76d7941 Update dependency com.github.spotbugs to v6.5.11
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: tobiasKaminsky <[email protected]>
2026-08-31 10:40:40 +02:00
Tobias Kaminsky 4e6f9388b3 Merge pull request #17536 from nextcloud/updateKeys
export keys
2026-08-31 10:39:56 +02:00
Tobias Kaminsky b179d8a8e4 Merge pull request #17534 from nextcloud/update-library-2026-08-30
Update library to 2026-08-30
2026-08-31 10:09:57 +02:00
tobiasKaminsky 042c726e84 export keys
Signed-off-by: tobiasKaminsky <[email protected]>
2026-08-31 09:36:29 +02:00
Tobias Kaminsky 0e19a4fad4 Update library to 2026-08-30
Signed-off-by: Tobias Kaminsky <[email protected]>
2026-08-31 08:53:15 +02:00
Nextcloud bot 357f5ad3a3 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-31 03:54:17 +00:00
Nextcloud bot 4ccb511527 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-30 03:56:02 +00:00
Nextcloud bot 022781bcba fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-29 03:53:19 +00:00
Tobias Kaminsky 0670f5ef96 Merge pull request #17527 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-08-27 10:05:37 +02:00
Tobias Kaminsky 4777331d22 Merge pull request #17511 from nextcloud/renovate/gradle-9.x
Update Gradle to v9.7.1
2026-08-27 10:03:59 +02:00
Tobias Kaminsky f842aee1e7 Merge pull request #17523 from nextcloud/updateLib
Update lib to 26.08.26
2026-08-27 09:16:49 +02:00
nextcloud-android-bot 4c6bef3007 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-08-27 04:48:00 +00:00
Nextcloud bot 26a3d290af fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-27 04:22:00 +00:00
tobiasKaminsky 1e9b3a6c5a Update lib to 26.08.26
Signed-off-by: tobiasKaminsky <[email protected]>
2026-08-26 12:26:20 +02:00
renovate[bot] c6ee037696 Update Gradle to v9.7.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-26 09:17:24 +00:00
Nextcloud bot cf85700306 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-26 04:32:13 +00:00
Andy Scherzinger aea628901b Merge pull request #17517 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-08-25 13:00:17 +02:00
nextcloud-android-bot d572720213 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-08-25 10:44:44 +00:00
Nextcloud bot cf11c59ef5 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-25 04:20:23 +00:00
Andy Scherzinger f4a58d155a Merge pull request #17514 from nextcloud/renovate/ubuntu-resolute
Update ubuntu:resolute Docker digest to 2260313
2026-08-24 00:45:32 +02:00
renovate[bot] 9cda7dba1e Update ubuntu:resolute Docker digest to 2260313
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-23 22:43:41 +00:00
Nextcloud bot 6ec4f5fb43 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-23 03:34:31 +00:00
Andy Scherzinger 36277a1022 Merge pull request #17510 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-08-22 07:24:18 +02:00
nextcloud-android-bot 11cf668518 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-08-22 05:23:37 +00:00
Nextcloud bot 50794f080e fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-22 03:50:38 +00:00
alperozturk96 9e76f369b6 auto upload worker already inserts entries no need to use content observer work
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 10:54:16 +02:00
alperozturk96 e3948cac07 auto upload worker already inserts entries no need to use content observer work
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 10:44:12 +02:00
alperozturk96 11f4710d39 instead of using random minutes to prevent sync now use worker
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 09:47:52 +02:00
alperozturk96 433c91c185 instead of using random minutes to prevent sync now use worker
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 09:27:16 +02:00
alperozturk96 53a028b171 instead of using random minutes to prevent sync now use worker
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 09:26:35 +02:00
alperozturk96 cbacc0800a instead of using random minutes to prevent sync now use worker
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 09:07:16 +02:00
alperozturk96 eb9df06870 instead of using random minutes to prevent sync now use worker
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 09:06:06 +02:00
alperozturk96 e9adcdca0c add debounce
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 08:44:42 +02:00
alperozturk96 2b76712b9d wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 08:44:42 +02:00
alperozturk96 017d9a8b90 fix button alignment
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 08:44:42 +02:00
alperozturk96 873282de67 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 08:44:42 +02:00
alperozturk96 0837f9308b fix infinite loading indicator
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 08:44:42 +02:00
alperozturk96 950b7defb4 add override power saving option to the content observer work
Signed-off-by: alperozturk96 <[email protected]>
2026-08-21 08:44:42 +02:00
alperozturk96 49ee63ae14 feat(auto-upload): ignore battery optimization with sync now
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/nextcloud/ui/component/UploadWarningCard.kt
2026-08-21 08:44:42 +02:00
Nextcloud bot 3a6ebbc94d fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-21 03:47:25 +00:00
Andy Scherzinger 9e4d1bfeb1 Merge pull request #17507 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-08-20 06:57:32 +02:00
Nextcloud bot 4a8f00156f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-20 03:44:42 +00:00
nextcloud-android-bot 249a86bb63 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-08-20 02:53:16 +00:00
Alper Öztürk 90a979a21e Merge pull request #17479 from nextcloud/handle-oome-read
feat(empty-state): oome
2026-08-19 15:28:14 +02:00
Alper Öztürk d7d77fc31e Merge pull request #17498 from nextcloud/fix/analyze-java
fix analyze java
2026-08-19 14:54:45 +02:00
alperozturk96 8b502a38e1 update lib
Signed-off-by: alperozturk96 <[email protected]>
2026-08-19 10:54:30 +02:00
Alper Öztürkanddaniele-verducci ec81a8f873 Update app/src/main/res/values/strings.xml
Co-authored-by: daniele-verducci <[email protected]>
Signed-off-by: Alper Öztürk <[email protected]>
2026-08-19 10:50:09 +02:00
alperozturk96 e4f92f28ca fix analyze java
Signed-off-by: alperozturk96 <[email protected]>
2026-08-19 09:37:11 +02:00
alperozturk96 54f92773df fix analyze java
Signed-off-by: alperozturk96 <[email protected]>
2026-08-19 09:37:11 +02:00
alperozturk96 9fd7370487 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-08-19 08:58:16 +02:00
alperozturk96 44e085e00d use single syncState
Signed-off-by: alperozturk96 <[email protected]>
2026-08-19 08:47:23 +02:00
alperozturk96 0f1e301a70 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-19 08:19:41 +02:00
alperozturk96 b0d5ac3caf feat(oome): empty state
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	gradle/libs.versions.toml
2026-08-19 08:14:16 +02:00
Nextcloud bot b24d3f44a3 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-19 04:10:18 +00:00
Alper Öztürk eed4cbefa8 Merge pull request #17474 from nextcloud/fix/search-encrypted-files-endless-indicator
fix(unified-search): handle slow server search for loader spinner
2026-08-18 13:49:44 +02:00
Alper Öztürk 4a80d4427b Merge pull request #17426 from nextcloud/fix/file-name-extension
fix(file-list): list mode long file names visibility
2026-08-18 13:11:13 +02:00
alperozturk96 dd68a068c5 fix spotless
Signed-off-by: alperozturk96 <[email protected]>
2026-08-18 10:15:15 +02:00
alperozturk96 0396e4ec27 hide more button for encrypted and if device doesn't have activated encryption
Signed-off-by: alperozturk96 <[email protected]>
2026-08-18 10:15:15 +02:00
alperozturk96 afd1ad88bb fix(unified-search): handle slow server search for loader spinner
Signed-off-by: alperozturk96 <[email protected]>
2026-08-18 10:15:15 +02:00
Alper Öztürk 77286696fa Merge pull request #17492 from nextcloud/testRemoveObjenesis
Remove Objenesis
2026-08-18 10:06:38 +02:00
Alper Öztürk e067cd3d68 Merge pull request #17473 from nextcloud/enhancement/files-clients-114-simplify-add-new-menu
Reworked "add new" menu to better support multiple office suites
2026-08-18 10:06:17 +02:00
alperozturk96 609d9b41e2 fix list
Signed-off-by: alperozturk96 <[email protected]>
2026-08-18 09:05:17 +02:00
alperozturk96 f61a14d7bb fix list
Signed-off-by: alperozturk96 <[email protected]>
2026-08-18 09:05:17 +02:00
alperozturk96 cc96746cdf fix lint
Signed-off-by: alperozturk96 <[email protected]>
2026-08-18 09:05:17 +02:00
alperozturk96 199e540e33 fix(file-list): list mode long file names visibility
Signed-off-by: alperozturk96 <[email protected]>
2026-08-18 09:05:17 +02:00
tobiasKaminsky ff6a0363a4 remove old version references
Signed-off-by: tobiasKaminsky <[email protected]>
2026-08-18 09:04:16 +02:00
tobiasKaminsky 1381b0cb8b 4gb
Signed-off-by: tobiasKaminsky <[email protected]>
2026-08-18 09:04:16 +02:00
tobiasKaminsky 690ce0bf17 Remove Objenesis
Signed-off-by: tobiasKaminsky <[email protected]>
2026-08-18 09:04:16 +02:00
alperozturk96 b044cf2bf1 fix menu back alignment
Signed-off-by: alperozturk96 <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 480986dd55 files-clients-114: Fixed missing copyright
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci d3b463712d files-clients-114: Back button position
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci dc1302ab08 files-clients-114: Styled 'more' and 'back' buttons with instance theme
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 9552795549 files-clients-114: Show office documents always first, independently from their source
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 714f392b5a files-clients-114: Back button position and changed ripple shape
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 5379bcd904 files-clients-114: Fixed margins, changed ripple shape
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 32b0767bd3 files-clients-114: gradlew spotlessApply
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 6b6e2e3a8d files-clients-114: moved view manipulation to its own function
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 35801debc3 files-clients-114: refactored collabora capabilities
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci c6d22e1b63 files-clients-114: refactored direct editing capabilities
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 694e3d3bf7 files-clients-114: fix codacy issue
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci c9c55b0572 files-clients-114: missing copyright headers
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci aa6639bf15 files-clients-114: capitalize creator names from API
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 8871d275db files-clients-114: if single item from directEditing, show it as a row
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 0b51bd865b files-clients-114: replaced temporary icon
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci cc11ce3b7e files-clients-114: removed slow animation
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 0872984809 files-clients-114: fixed dividers visibility
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 2a9767c966 files-clients-128: removed 'New' (redundant in an item creation menu)
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci aafa21103c files-clients-114: deprecations
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 42ae98f437 files-clients-114: bottom sheet rework: navigation icons
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 3c460db776 files-clients-114: bottom sheet rework: restored collabora icons
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 2319d176ca files-clients-114: bottom sheet rework: ordered creators, working overview, missing icons
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci 20591959ef files-clients-114: bottom sheet rework: navigation
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
daniele-verducci f2778991fa files-clients-114: bottom sheet rework: removed "Add to cloud", rearranged items
Signed-off-by: daniele-verducci <[email protected]>
2026-08-18 09:01:44 +02:00
Alper Öztürk 6562e77bc6 Merge pull request #17496 from nextcloud/fix/lint-3
fix lint
2026-08-18 09:01:21 +02:00
alperozturk96 07ab717b3b fix lint
Signed-off-by: alperozturk96 <[email protected]>
2026-08-18 08:07:07 +02:00
Nextcloud bot abb074ba22 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-18 03:40:55 +00:00
renovate[bot]andtobiasKaminsky 50d3f0044b Update dependency org.conscrypt:conscrypt-android to v2.6.2 (#17485)
* Update dependency org.conscrypt:conscrypt-android to v2.6.2

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* update verification-metadata.xml

Signed-off-by: tobiasKaminsky <[email protected]>

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: tobiasKaminsky <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: tobiasKaminsky <[email protected]>
2026-08-17 12:54:13 +00:00
renovate[bot]andtobiasKaminsky 4f3b19f7a5 Update dependency androidx.webkit:webkit to v1.17.0 (#17490)
* Update dependency androidx.webkit:webkit to v1.17.0

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* update verification-metadata.xml

Signed-off-by: tobiasKaminsky <[email protected]>

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: tobiasKaminsky <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: tobiasKaminsky <[email protected]>
2026-08-17 11:50:15 +00:00
Tobias Kaminsky ddb3038dfa Merge pull request #17487 from nextcloud/renovate/composebom
Update dependency androidx.compose:compose-bom to v2026.08.00
2026-08-17 12:31:17 +02:00
Alper Öztürk 6629b69c45 Merge pull request #17399 from nextcloud/fix/handle-parent-existence-for-conflicts
fix(upload): grant parent existence
2026-08-17 11:40:13 +02:00
renovate[bot]andtobiasKaminsky b351b6b4da Update dependency androidx.appcompat:appcompat to v1.8.0 (#17486)
* Update dependency androidx.appcompat:appcompat to v1.8.0

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* update verification-metadata.xml

Signed-off-by: tobiasKaminsky <[email protected]>

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: tobiasKaminsky <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: tobiasKaminsky <[email protected]>
2026-08-17 09:40:00 +00:00
Alper Öztürk 50fef3a9b8 Apply suggestion from @alperozturk96
Signed-off-by: Alper Öztürk <[email protected]>
2026-08-17 10:49:03 +02:00
Alper Öztürk 95443beefd Apply suggestion from @alperozturk96
Signed-off-by: Alper Öztürk <[email protected]>
2026-08-17 10:49:03 +02:00
Alper Öztürk bd0e722614 Apply suggestion from @alperozturk96
Signed-off-by: Alper Öztürk <[email protected]>
2026-08-17 10:49:03 +02:00
alperozturk96 32f5dd6f0e add tests
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 10:49:03 +02:00
alperozturk96 a9e9a6703b add tests
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 10:49:03 +02:00
alperozturk96 af06e18a78 fix alignment
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 10:49:03 +02:00
Alper Öztürk 87f28bf582 Merge pull request #17422 from nextcloud/check-web-view
check web view for editor
2026-08-17 09:10:52 +02:00
Alper Öztürk 554707f160 Merge pull request #17438 from nextcloud/fix/list-directory
fix(file-list): list directory 🚀
2026-08-17 08:58:04 +02:00
renovate[bot] 4a69bd6e48 Update dependency androidx.compose:compose-bom to v2026.08.00
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-17 08:40:10 +02:00
Tobias Kaminsky 5247cdecfb Merge pull request #17488 from nextcloud/renovate/foundationversion
Update dependency androidx.compose.foundation:foundation to v1.12.0
2026-08-17 08:39:59 +02:00
Tobias Kaminsky 2ec93db911 Merge pull request #17489 from nextcloud/renovate/fragmentktxversion
Update dependency androidx.fragment:fragment-ktx to v1.9.0
2026-08-17 08:39:24 +02:00
alperozturk96 abaa4d9837 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:05:11 +02:00
alperozturk96 d3ccc9c5c7 check web view for editor
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java
2026-08-17 08:05:11 +02:00
alperozturk96 d2d6cfb8e6 revert
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 89ee4b053b use ResultParser
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 61236650f3 use ResultParser
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 48028aa95c fix codacy
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 fcfa8c252d use static variable for dao
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 c0554790be introduce data of type extension
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 c5af1f6f33 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 373977f02a wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 49c68ce5fe add doc
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 9438fe1af7 add doc
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 753089b435 add doc
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 46bc3cef2e add doc
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 e06822bcbe add doc
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 2f3455fef8 add doc
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 580a31a158 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 15d4cc3e68 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 6c2b71d556 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 ef80977380 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 35ccaf986b wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 331d221195 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
alperozturk96 656de55999 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-17 08:04:51 +02:00
Tobias Kaminsky 67f5bc3374 Merge pull request #17482 from nextcloud/update-library-2026-08-16
Update library to 2026-08-16
2026-08-17 07:41:21 +02:00
Tobias Kaminsky 09f3ad0316 Merge pull request #17456 from nextcloud/renovate/spotbugsgradleplugin
Update dependency com.github.spotbugs to v6.5.10
2026-08-17 07:38:20 +02:00
tobiasKaminsky 09b7841122 update verification-metadata.xml
Signed-off-by: tobiasKaminsky <[email protected]>
2026-08-17 07:37:04 +02:00
renovate[bot] 5e2fe56b91 Update dependency androidx.compose.foundation:foundation to v1.12.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-17 07:32:07 +02:00
renovate[bot] 036b6e919c Update dependency androidx.fragment:fragment-ktx to v1.9.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-17 07:31:18 +02:00
Tobias Kaminsky aac4e654f6 Merge pull request #17480 from nextcloud/fix-ci-3
fix garm
2026-08-17 07:30:27 +02:00
Tobias Kaminsky e060cf5320 Merge pull request #17483 from nextcloud/renovate/fastlane-2.x-lockfile
Update dependency fastlane to v2.238.0
2026-08-17 07:23:40 +02:00
tobiasKaminsky 70695231b7 update verification-metadata.xml
Signed-off-by: tobiasKaminsky <[email protected]>
2026-08-17 07:20:28 +02:00
renovate[bot] 63426411f8 Update dependency com.github.spotbugs to v6.5.10
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-17 07:20:25 +02:00
Tobias Kaminsky 1c8d8e906b Merge pull request #17402 from nextcloud/renovate/spotless
Update dependency com.diffplug.spotless to v8.9.0
2026-08-17 07:09:03 +02:00
tobiasKaminsky d06bfccb99 update verification-metadata.xml
Signed-off-by: tobiasKaminsky <[email protected]>
2026-08-17 07:07:44 +02:00
Nextcloud bot ac2d79489c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-17 03:37:51 +00:00
renovate[bot] ba7702f830 Update dependency fastlane to v2.238.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-16 12:30:42 +00:00
Nextcloud bot dadb642fe4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-16 03:36:17 +00:00
Tobias Kaminsky 9086dc86d2 Update library to 2026-08-16
Signed-off-by: Tobias Kaminsky <[email protected]>
2026-08-16 00:01:04 +02:00
Nextcloud bot b8e462e144 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-15 03:45:34 +00:00
tobiasKaminsky f2c50f269b update verification-metadata.xml
Signed-off-by: tobiasKaminsky <[email protected]>
2026-08-14 15:50:33 +02:00
renovate[bot] e9b7bd48e2 Update dependency com.diffplug.spotless to v8.9.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-14 15:50:33 +02:00
Alper Öztürk ed7ce28775 Merge pull request #17470 from nextcloud/fix/media-player-when-task-in-background
fix(media): video player returning from background
2026-08-14 15:24:37 +02:00
alperozturk96 591609a0a3 objenesis 3.5
Signed-off-by: alperozturk96 <[email protected]>
2026-08-14 15:15:48 +02:00
alperozturk96 e1bbf8389f objenesis 3.5
Signed-off-by: alperozturk96 <[email protected]>
2026-08-14 15:11:36 +02:00
Alper Öztürk 4ff7957e14 Merge pull request #17467 from nextcloud/file-upload-worker-retry
file upload worker retry policy
2026-08-14 14:50:11 +02:00
Alper Öztürk 7e36db34a0 Merge pull request #17471 from nextcloud/fix/navigation-to-root-from-search-fragment
fix(navigation): search fragment to root
2026-08-14 14:48:42 +02:00
Tobias Kaminsky 6fd946db25 Merge pull request #17442 from nextcloud/renovate/objenesis
Update dependency org.objenesis:objenesis to v3.6
2026-08-14 11:31:24 +02:00
Alper Öztürk c971e5847b Merge pull request #17477 from nextcloud/update-android-lib
update android lib
2026-08-14 11:09:18 +02:00
alperozturk96 7db102d45b update android lib
Signed-off-by: alperozturk96 <[email protected]>
2026-08-14 11:08:47 +02:00
Tobias Kaminsky 369275e93c Merge pull request #17460 from nextcloud/renovate/gradle-9.x
Update Gradle to v9.7.0
2026-08-14 10:25:29 +02:00
Tobias Kaminsky 53c9d6c229 Merge pull request #17331 from nextcloud/renovate/firebasemessagingversion
Update dependency com.google.firebase:firebase-messaging to v25.1.1
2026-08-14 10:21:51 +02:00
Alper Öztürk c6e2077dee Merge pull request #17459 from nextcloud/convert-local-file-list-fragment-to-kt-2
Convert LocalFileListFragment to Kotlin
2026-08-14 10:19:37 +02:00
renovate[bot] ef2bab5195 Update dependency org.objenesis:objenesis to v3.6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-14 10:07:47 +02:00
Andy Scherzinger ca9013df4a Merge pull request #17476 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-08-14 07:35:21 +02:00
nextcloud-android-bot d021138d38 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-08-14 05:31:46 +00:00
Nextcloud bot 7be013ca62 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-14 03:49:15 +00:00
alperozturk96 d9d115d59b add search event check to activate search fragment
Signed-off-by: alperozturk96 <[email protected]>
2026-08-13 14:30:10 +02:00
Alper Öztürk aad96b8d56 Merge pull request #17465 from nextcloud/fix/initial-load-time
perf(file-list): initial load, refresh 🚀
2026-08-13 13:56:11 +02:00
alperozturk96 16f1612cba fix(media): video player returning from background
Signed-off-by: alperozturk96 <[email protected]>
2026-08-13 11:50:45 +02:00
alperozturk96 4928b18d45 fix(media): video player returning from background
Signed-off-by: alperozturk96 <[email protected]>
2026-08-13 11:48:06 +02:00
alperozturk96 8acc7855f6 reusePendingUpload
Signed-off-by: alperozturk96 <[email protected]>
2026-08-13 11:17:28 +02:00
alperozturk96 30267ee233 fix can exit policy
Signed-off-by: alperozturk96 <[email protected]>
2026-08-13 11:17:18 +02:00
alperozturk96 740337e974 separate between permanent failed uploads and retryable uploads
Signed-off-by: alperozturk96 <[email protected]>
2026-08-13 10:49:06 +02:00
alperozturk96 04a79a33d5 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-13 10:49:06 +02:00
Alper Öztürk b984f57a30 Merge pull request #17468 from nextcloud/docs/agent-comment-guidelines
docs(agents): update for adding unnecessary comments
2026-08-13 10:34:44 +02:00
alperozturk96 a8a34e335f wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-13 10:19:53 +02:00
alperozturk96 f18ceee722 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-13 10:19:34 +02:00
alperozturk96 7abdc65d02 docs(agents): tighten comment guidance for AI contributions
Replace the single-line comment rule with a dedicated Comments section
stating that names carry the explanation, when a comment is warranted,
and an explicit never-list. Comments must not narrate the change or
reference the issue, PR or the conversation that produced it.

Apply the same rule to the java-to-kotlin skill conventions.

Assisted-by: ClaudeCode:claude-opus-5
2026-08-13 10:12:26 +02:00
alperozturk96 03e7d172ee file upload worker retry policy
Signed-off-by: alperozturk96 <[email protected]>
2026-08-13 10:10:01 +02:00
Nextcloud bot 49eac34881 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-13 03:45:18 +00:00
Alper Öztürk c0b4e3fefc Merge pull request #17464 from nextcloud/fix/15236-account-detail-page-empty
Show cached data in account detail view when server is not reachable
2026-08-12 10:28:03 +02:00
Tobias Kaminsky b77e1a2c03 Merge pull request #17448 from nextcloud/fix/thumbail-generation
fix(thumbail): generation
2026-08-12 10:25:17 +02:00
alperozturk96 0212ba87cf remove hardcoded delay use onWindowFocusChanged instead
Signed-off-by: alperozturk96 <[email protected]>
2026-08-12 09:26:02 +02:00
alperozturk96 a8797f7020 update user profile and oc version after refresh events
Signed-off-by: alperozturk96 <[email protected]>
2026-08-12 09:15:21 +02:00
alperozturk96 d4e7e96e0b wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-12 08:35:32 +02:00
alperozturk96 dd2b15fcd1 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-12 08:30:31 +02:00
daniele-verducci f819f1ab65 Merge branch 'master' into fix/15236-account-detail-page-empty 2026-08-12 08:22:40 +02:00
alperozturk96 db2b38cc01 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-08-12 08:21:52 +02:00
alperozturk96 6976f78e23 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-08-12 08:21:52 +02:00
alperozturk96 a93cec205f convert to kt
Signed-off-by: alperozturk96 <[email protected]>
2026-08-12 08:21:52 +02:00
alperozturk96 999c8f00c5 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-08-12 08:21:52 +02:00
renovate[bot] a4cc4a365f Update dependency com.google.devtools.ksp to v2.3.11 (#17452)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-12 03:56:10 +00:00
renovate[bot] ffa3a82b82 Update Gradle to v9.7.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-12 03:13:48 +00:00
renovate[bot] ff0eadbdcf Update dependency com.google.firebase:firebase-messaging to v25.1.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-12 03:06:06 +00:00
daniele-verducci b0eda3af81 15236: show cached data in account detail view
Signed-off-by: daniele-verducci <[email protected]>
2026-08-11 17:39:16 +02:00
renovate[bot] 80682ea362 Update media3 to v1.11.0 (#17461)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-11 09:57:30 +00:00
alperozturk96 0f8aeb75fc wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:04:45 +02:00
alperozturk96 988b272b47 add doc
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:59 +02:00
alperozturk96 ca631c7d29 only use extension
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:58 +02:00
alperozturk96 235541cda3 check and set preview enable before fetching from server blindly
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:58 +02:00
alperozturk96 7492dda92b fix shimmer
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:58 +02:00
alperozturk96 0faf153c40 use ThumbnailGenerator only
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:58 +02:00
alperozturk96 7877ed9d26 introduce ThumbnailGenerator.kt
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:58 +02:00
alperozturk96 8a6cd4f3c9 rename overlay manager to folder thumbnail generator
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:58 +02:00
alperozturk96 584070bd8e clean imports
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:56 +02:00
alperozturk96 1f90ad4cdc fix thumbnail in media tab
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:54 +02:00
alperozturk96 680490179c use display util for upload list
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:54 +02:00
alperozturk96 4f6eda1809 unify file thumbnail generation
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:54 +02:00
alperozturk96 7cf1adc1a6 simplify FileThumbnailGenerator
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:54 +02:00
alperozturk96 ed866f538f introduce FileThumbnailGenerator
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:53 +02:00
alperozturk96 8241cc6e38 fix thumbnail visibility for video file in upload list adapter
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:53 +02:00
alperozturk96 3c5b51c276 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:53 +02:00
alperozturk96 7d9d776f31 unify PREFIX_RESIZED_IMAGE key usages
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:53 +02:00
alperozturk96 02050d4c52 unify PREFIX_THUMBNAIL key usages
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:53 +02:00
alperozturk96 6da797a1ae unify PREFIX_THUMBNAIL key usages
Signed-off-by: alperozturk96 <[email protected]>
2026-08-11 09:00:53 +02:00
alperozturk96 b902cb3d32 unify PREFIX_THUMBNAIL key usages
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/adapter/LocalFileListAdapter.java
2026-08-11 09:00:51 +02:00
Andy Scherzinger 7769ede981 Merge pull request #17453 from nextcloud/renovate/ubuntu-resolute
Update ubuntu:resolute Docker digest to 678c655
2026-08-08 09:53:12 +02:00
renovate[bot] 64598588db Update ubuntu:resolute Docker digest to 678c655
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-08 04:24:35 +00:00
Alper Öztürk 4dd80b6309 Merge pull request #17394 from nextcloud/local-file-list-adapter-kt
convert local file list adapter to Kotlin
2026-08-07 16:15:35 +02:00
alperozturk96 b5ce3be66b fix footer
Signed-off-by: alperozturk96 <[email protected]>
2026-08-07 14:48:49 +02:00
alperozturk96 9c0ea05c8b improve paging
Signed-off-by: alperozturk96 <[email protected]>
2026-08-07 13:41:18 +02:00
alperozturk96 018c2e5468 improve paging
Signed-off-by: alperozturk96 <[email protected]>
2026-08-07 13:41:18 +02:00
alperozturk96 7439335174 convert java to kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-08-07 13:41:18 +02:00
alperozturk96 5eed20a24a Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-08-07 13:41:18 +02:00
Andy Scherzinger 4c2f99bc6e Merge pull request #17447 from nextcloud/renovate/gradle-actions-6.x
Update gradle/actions action to v6.3.0
2026-08-07 12:41:29 +02:00
Nextcloud bot 04e0ad39e2 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-07 03:47:14 +00:00
renovate[bot] 255b65cd44 Update gradle/actions action to v6.3.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-07 00:48:01 +00:00
Alper Öztürk 78477cffa3 Merge pull request #17389 from nextcloud/fix/upload-error-check
fix(upload): improve error handling
2026-08-06 09:00:39 +02:00
Alper Öztürk 87ac140685 Merge pull request #17418 from nextcloud/fix/fuee-upload-list-adapter
fix(upload-list-adapter): FileUriExposedException
2026-08-06 08:59:56 +02:00
alperozturk96 14390f05e2 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-06 08:59:38 +02:00
Alper Öztürk 57adf0543a Merge pull request #17433 from nextcloud/fix/deep-link-login-ui
style(deep-link-login): ui
2026-08-06 08:54:22 +02:00
Alper Öztürk cd960f06e6 Merge pull request #17437 from nextcloud/unify-alert-dialog-button-theming
unify alert dialog button theming logic
2026-08-06 08:27:38 +02:00
Andy Scherzinger ad6b2c5478 Merge pull request #17432 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-08-05 20:29:35 +02:00
alperozturk96 924bc28e4b simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 10:56:26 +02:00
alperozturk96 8ed4653925 cover nullable dialog as well
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 10:50:49 +02:00
alperozturk96 51cae82224 unify alert dialog button theming logic
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 10:47:56 +02:00
Alper Öztürk 92c51fe802 Merge pull request #17421 from nextcloud/fix/media-metadata-retriever
fix(media-retriever): get thumbnail
2026-08-05 10:33:02 +02:00
Alper Öztürk 69b0761208 Merge pull request #17390 from nextcloud/fix/alphanumeric-comparator
fix(sort): alphanumeric comparator
2026-08-05 10:31:08 +02:00
Alper Öztürk f68b6b4e6c Merge pull request #17383 from nextcloud/fix/unsupported-operation-oc-file
fix(ocfile): unsupported operation shares
2026-08-05 10:30:20 +02:00
alperozturk96 c68752f759 style(deep-link-login): ui
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 09:26:41 +02:00
alperozturk96 5ba5d8a937 use kt helper class
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:55:14 +02:00
alperozturk96 e9d6a461e0 use kt helper class
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:50:40 +02:00
nextcloud-android-bot 9dbc7edd1d 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-08-05 06:47:50 +00:00
alperozturk96 0f38a9de47 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:35:39 +02:00
alperozturk96 2206a6772b wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:35:39 +02:00
alperozturk96 8d4ed90a9d simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:35:39 +02:00
alperozturk96 586a351cdc fix(sort): alphanumeric comparator
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:35:39 +02:00
alperozturk96 21e27d625d fix(sort): alphanumeric comparator
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:35:39 +02:00
alperozturk96 97eed58230 fix lint
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:30:08 +02:00
alperozturk96 e6652f8bcd speed-up bindSharedAvatars
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:25:35 +02:00
alperozturk96 c50f4bf567 speed-up bindSharedAvatars
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:25:35 +02:00
alperozturk96 5dfc099147 speed-up bindSharedAvatars
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:25:35 +02:00
alperozturk96 7b6ea731f4 make sharees mutable
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:25:35 +02:00
Alper Öztürk 747ff5407b Merge pull request #17431 from nextcloud/update-lib
update android lib
2026-08-05 08:22:26 +02:00
alperozturk96 0f4425ef09 update android lib
Signed-off-by: alperozturk96 <[email protected]>
2026-08-05 08:21:59 +02:00
Alper Öztürk cdfabae001 Merge pull request #17408 from nextcloud/fix/toggle-full-screen-icon
fix(media-preview): toggle full screen icon
2026-08-05 08:12:17 +02:00
Alper Öztürk 890238d1e5 Merge pull request #17425 from nextcloud/fix/ui-color-match
fix(ui): color match
2026-08-05 08:11:43 +02:00
Andy Scherzinger e36e90e8ba Merge pull request #17427 from nextcloud/renovate/actions-setup-java-5.x
Update actions/setup-java action to v5.7.0
2026-08-05 08:09:02 +02:00
Andy Scherzinger 61f07db253 Merge pull request #17428 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-08-05 08:06:59 +02:00
nextcloud-android-bot cff9cdbe3c 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-08-05 05:12:32 +00:00
Nextcloud bot 785177b001 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-05 03:45:47 +00:00
renovate[bot] b0c720b5f4 Update actions/setup-java action to v5.7.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-04 21:45:41 +00:00
alperozturk96 3dc38fba0e fix theming internal two way sync
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 14:18:56 +02:00
alperozturk96 a9a9910ecd fix theming manage space activity buttons
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 13:57:08 +02:00
alperozturk96 e84f4a246c fix theming upload warning card buttons
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 13:54:10 +02:00
alperozturk96 f738a562ba create extension for dialog buttons
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 13:52:04 +02:00
alperozturk96 494dfb7442 fix app pass code dialog buttons theming
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 13:51:52 +02:00
Alper Öztürk 391e1e6f9b Merge pull request #17245 from nextcloud/fix/conflict-resolve-auto-upload
fix(conflict-resolve): auto upload
2026-08-04 13:26:56 +02:00
alperozturk96 a2206b67cb fix(media-retriever): get thumbnail
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 11:41:13 +02:00
alperozturk96 4f85abe760 fix(media-retriever): get thumbnail
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 11:39:07 +02:00
alperozturk96 eecd63a80b fix(media-retriever): get thumbnail
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 11:35:10 +02:00
alperozturk96 b0b9900dda fix(media-retriever): get thumbnail
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 11:31:19 +02:00
alperozturk96 07926d0f52 fix(media-retriever): get thumbnail
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 11:31:16 +02:00
alperozturk96 4b4ea553dc use single source of truth
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 10:27:18 +02:00
alperozturk96 6955808770 fix toggle issue
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 10:27:18 +02:00
alperozturk96 7bd68c951c wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 10:20:28 +02:00
alperozturk96 97b90367a4 fix(upload-list-adapter): FileUriExposedException
Signed-off-by: alperozturk96 <[email protected]>
2026-08-04 08:51:01 +02:00
Alper Öztürk e95ecbae4e Merge pull request #17411 from nextcloud/fix/input-dispatching-time-out-copy-and-upload
fix(copy-and-upload): ANR
2026-08-04 08:16:16 +02:00
Alper Öztürk f83b5dd29a Merge pull request #17410 from nextcloud/fix/send-share-dialog-on-send-click
fix(send-share-dialog): on send button click crash
2026-08-04 08:14:07 +02:00
Nextcloud bot 567c58cc3c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-04 04:21:55 +00:00
alperozturk96 4d87d8712e fix(copy-and-upload): ANR
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 15:12:30 +02:00
alperozturk96 7de8d437f4 implement missing consumer and make arguments non-nullable
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 14:33:35 +02:00
alperozturk96 7a0b5980b1 implement missing consumer and make arguments non-nullable
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 14:33:35 +02:00
alperozturk96 9b47c9a259 fix(send-share-dialog): on send button click crash
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 14:33:35 +02:00
Alper Öztürk 3e49e5d61c Merge pull request #17400 from nextcloud/mark-flaky-tests
mark flaky tests
2026-08-03 13:58:09 +02:00
alperozturk96 42c52e3409 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 11:22:48 +02:00
alperozturk96 23dd26f941 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 11:22:20 +02:00
alperozturk96 f52faf99f2 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 11:22:20 +02:00
alperozturk96 11d20b964d wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 11:22:20 +02:00
alperozturk96 4468b4847e wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 11:22:20 +02:00
alperozturk96 457c1c35d4 mark flaky tests
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 11:22:20 +02:00
Alper Öztürk 0e25e23aaa Merge pull request #17407 from nextcloud/renovate/constraintlayoutversion
Update dependency androidx.constraintlayout:constraintlayout to v2.2.2
2026-08-03 11:22:00 +02:00
alperozturk96 cbeede01d3 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 11:21:05 +02:00
renovate[bot] d4be9cec2b Update dependency androidx.constraintlayout:constraintlayout to v2.2.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-03 11:20:16 +02:00
Alper Öztürk 989d97ba90 Merge pull request #17352 from nextcloud/renovate/androidpluginversion
Update androidPluginVersion to v9.3.1
2026-08-03 11:19:34 +02:00
renovate[bot] 88f73e59b4 Update androidPluginVersion to v9.3.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-03 11:16:19 +02:00
Alper Öztürk 97dfab9b58 Merge pull request #17351 from nextcloud/renovate/kotlin-monorepo
Update kotlin monorepo to v2.4.10
2026-08-03 11:15:30 +02:00
alperozturk96 35814caf3a wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 11:14:20 +02:00
renovate[bot] bac081f83e Update kotlin monorepo to v2.4.10
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-03 11:11:32 +02:00
Alper Öztürk b70ed367a9 Merge pull request #17350 from nextcloud/renovate/spotbugsgradleplugin
Update dependency com.github.spotbugs to v6.5.9
2026-08-03 11:11:05 +02:00
alperozturk96 cd6300bf82 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 11:09:59 +02:00
renovate[bot] fe51fd3575 Update dependency com.github.spotbugs to v6.5.9
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-03 11:07:59 +02:00
Alper Öztürk c3b9ddbfa7 Merge pull request #17334 from nextcloud/renovate/conscryptandroidversion
Update dependency org.conscrypt:conscrypt-android to v2.6.1
2026-08-03 10:58:20 +02:00
alperozturk96 d5fe88edbb wip
Signed-off-by: alperozturk96 <[email protected]>
2026-08-03 10:56:13 +02:00
renovate[bot] 31ee90680c Update dependency org.conscrypt:conscrypt-android to v2.6.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-03 10:48:39 +02:00
Alper Öztürk 5d7cd6cfab Merge pull request #17332 from nextcloud/renovate/glide
Update glide to v5.0.9
2026-08-03 10:47:48 +02:00
renovate[bot] 08ddaf56bf Update glide to v5.0.9
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-03 10:42:43 +02:00
Alper Öztürk d42a68d9cf Merge pull request #17330 from nextcloud/renovate/ksp-monorepo
Update dependency com.google.devtools.ksp to v2.3.10
2026-08-03 10:42:02 +02:00
renovate[bot] 518e4d69b9 Update dependency com.google.devtools.ksp to v2.3.10
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-03 10:37:02 +02:00
Nextcloud bot 114f85d7b2 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-03 03:49:23 +00:00
Andy Scherzinger 91763cf627 Merge pull request #17405 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-08-02 09:33:41 +02:00
nextcloud-android-bot 6b8f61db7c 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-08-02 05:24:45 +00:00
Andy Scherzinger e0f674efae Merge pull request #17395 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-08-01 10:14:57 +02:00
Andy Scherzinger 73adcb094c Merge pull request #17403 from nextcloud/renovate/actions-stale-11.x
Update actions/stale action to v11
2026-08-01 10:14:30 +02:00
renovate[bot] f7ef0437f3 Update actions/stale action to v11
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-01 05:46:55 +00:00
nextcloud-android-bot b523815982 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-08-01 05:43:47 +00:00
Alper Öztürk eba69374ae Merge pull request #17397 from nextcloud/feat/add-chips-avatars-to-notification-screen
feat(chip): activities list adapter, notification list adapter
2026-07-30 16:23:50 +02:00
alperozturk96 88b8010e3a fix alignment
Signed-off-by: alperozturk96 <[email protected]>
2026-07-30 12:34:13 +02:00
alperozturk96 7d3c27a706 feat(chip): activities list adapter, notification list adapter
Signed-off-by: alperozturk96 <[email protected]>
2026-07-30 12:02:21 +02:00
alperozturk96 2e54324ea4 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-30 11:42:09 +02:00
Nextcloud bot ba00e6b22a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-30 03:47:37 +00:00
Alper Öztürk cda250e965 Merge pull request #17385 from nextcloud/remove-visibility-of-debug-functionality
remove visibility of debug functionality
2026-07-29 16:52:54 +02:00
Alper Öztürk 9925efe3a6 Merge pull request #17373 from nextcloud/fix/upload-retry-crash-safety
fix(upload): prevent crash and duplicate retries when retrying failed uploads
2026-07-29 16:36:03 +02:00
Alper Öztürk 377efbe6d5 Merge pull request #17379 from nextcloud/fix/video-preview-fullscreen-and-download
fix(media): download and preview
2026-07-29 16:35:37 +02:00
alperozturk96 56a595b7ef add tests
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 10:04:03 +02:00
alperozturk96 b636f68a84 add tests
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 09:36:10 +02:00
alperozturk96 0cfb3d83e1 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 08:58:40 +02:00
alperozturk96 365a7a5527 do not recreate same current account
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 08:52:10 +02:00
alperozturk96 f4dc0650c7 implement client creation to user account manager
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 08:50:29 +02:00
alperozturk96 c3bd723899 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 08:35:12 +02:00
alperozturk96 b7b764938e wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 08:28:20 +02:00
alperozturk96 9448d2895d wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 08:27:33 +02:00
alperozturk96 19c6f48f22 use atomic boolean instead of semaphore and remove broken flag since events will be firing
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 08:27:10 +02:00
alperozturk96 93cdda6799 use lazy for shared instance
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 08:27:10 +02:00
alperozturk96 3983c8e9cc introduce application scope to DispatcherModule.kt
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 08:27:10 +02:00
alperozturk96 f9786381f7 fix crash
Signed-off-by: alperozturk96 <[email protected]>
2026-07-29 08:27:10 +02:00
Nextcloud bot b568e75c37 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-29 03:56:54 +00:00
Alper Öztürk 227313012e Merge pull request #17378 from nextcloud/fix/local-file-list-stable-id-collision
fix(upload): prevent crash from duplicate stable IDs in local file list
2026-07-28 09:45:18 +02:00
Alper Öztürk 6de832cd36 Merge pull request #17386 from nextcloud/convert-FileDetailActivitiesFragment-to-kt
convert file detail activities fragment to Kotlin
2026-07-28 09:10:23 +02:00
Nextcloud bot 37daec8028 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-28 03:40:04 +00:00
alperozturk96 f1d3213345 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 15:44:51 +02:00
alperozturk96 80c46e810f FileDetailActivitiesFragment Kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 15:34:34 +02:00
alperozturk96 8bb2211ced Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 15:34:34 +02:00
alperozturk96 2325c7d02e remove visibility of debug functionality
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 15:26:57 +02:00
Alper Öztürk 9824fc995f Merge pull request #17315 from nextcloud/fix/backup-list-fragment-permission-handling
fix(backup-list-fragment): permission handling
2026-07-27 14:30:13 +02:00
Alper Öztürk e79378dd12 Merge pull request #17267 from nextcloud/fix/e2ee-counter-check
fix(e2ee): refresh during crud operations
2026-07-27 14:29:01 +02:00
Alper Öztürk 6c1ba4a038 Merge pull request #17305 from nextcloud/refactor/setup-encryption-dialog-download-key
refactor(setup-encryption-dialog): download key
2026-07-27 14:28:52 +02:00
alperozturk96 0da6f5ebfb wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 14:25:46 +02:00
alperozturk96 65bbf8877b refactor(setup-encryption-dialog): download key
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/dialog/setupEncryption/SetupEncryptionDialogFragment.kt
2026-07-27 14:20:24 +02:00
alperozturk96 56c16156ec fix full-screen button toggle
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 13:59:31 +02:00
alperozturk96 d275d3fade fix(media): download and preview
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 12:07:02 +02:00
alperozturk96 648de3ec59 fix live photo calls
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 12:01:52 +02:00
alperozturk96 08457113a6 fix downloaded video file preview
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 11:52:51 +02:00
alperozturk96 5a890f41d6 replace deprecated view apis
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 11:34:21 +02:00
alperozturk96 49759b383f use insets instead margins
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 11:24:36 +02:00
alperozturk96 1cf49f2cdb fix(upload): prevent crash from duplicate stable IDs in local file list
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 10:49:09 +02:00
alperozturk96 57b55ba02d fix(upload): prevent crash from duplicate stable IDs in local file list
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 10:30:11 +02:00
Alper Öztürk 61deaaa6f5 Merge pull request #17335 from nextcloud/feat/gallery-pagination
feat(gallery): pagination
2026-07-27 10:19:35 +02:00
alperozturk96 01a5bd0935 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 10:06:22 +02:00
alperozturk96 186d23f0ae fix restoring position
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 10:06:22 +02:00
alperozturk96 50bb148a4a fix index
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 10:06:22 +02:00
alperozturk96 43ce841be7 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 10:06:22 +02:00
alperozturk96 dc03103f27 feat(gallery): pagination
Signed-off-by: alperozturk96 <[email protected]>
2026-07-27 10:06:22 +02:00
Nextcloud bot f286320209 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-27 03:30:43 +00:00
Andy Scherzinger 68a7e95ea1 Merge pull request #17348 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-07-26 10:56:13 +02:00
nextcloud-android-bot 89233d3144 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-07-26 10:55:34 +02:00
Andy Scherzinger 4e2092234f Merge pull request #17377 from nextcloud/renovate/github-codeql-action-4.x
Update github/codeql-action action to v4.37.3
2026-07-26 10:54:38 +02:00
renovate[bot] f059fdeb90 Update github/codeql-action action to v4.37.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-26 08:27:46 +00:00
Nextcloud bot c0349cc15b fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-26 03:32:24 +00:00
Andy Scherzinger 754265a353 Merge pull request #17376 from nextcloud/renovate/github-codeql-action-4.x
Update github/codeql-action action to v4.37.2
2026-07-25 23:00:52 +02:00
renovate[bot] 96714b7111 Update github/codeql-action action to v4.37.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-25 16:26:35 +00:00
Nextcloud bot 9d4fcd910a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-25 04:01:32 +00:00
Andy Scherzinger 28dd44e2aa Merge pull request #17375 from nextcloud/renovate/actions-checkout-7.x
Update actions/checkout action to v7.0.1
2026-07-24 23:32:48 +02:00
renovate[bot] b4e1634fd4 Update actions/checkout action to v7.0.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-24 21:30:56 +00:00
Andy Scherzinger 91bb6ce98e Merge pull request #17357 from nextcloud/renovate/github-codeql-action-4.x
Update github/codeql-action action to v4.37.1
2026-07-24 23:30:06 +02:00
Andy Scherzinger d1fc3efbdb Merge pull request #17333 from nextcloud/renovate/actions-setup-java-5.x
Update actions/setup-java action to v5.6.0
2026-07-24 23:29:43 +02:00
renovate[bot] 27f7982966 Update actions/setup-java action to v5.6.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-24 20:54:59 +00:00
renovate[bot] 6a84fc7f42 Update github/codeql-action action to v4.37.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-24 20:54:44 +00:00
Alper Öztürk 3a9f9d7f6c Merge pull request #17268 from nextcloud/ciTests
Fix CI tests
2026-07-24 11:01:58 +02:00
Alper Öztürk 983d6b52a1 Merge pull request #17344 from nextcloud/feat/e2ee-renew-certificate
feat(e2ee): renew certificate
2026-07-24 10:40:26 +02:00
alperozturk96 40212c30ca add tests
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 10:21:24 +02:00
alperozturk96 c4dd4bdb19 clear confusion between certificate and public key
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 10:21:24 +02:00
alperozturk96 7a9c063d5b fix is matching
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 10:21:24 +02:00
alperozturk96 b9e4c34178 feat(e2ee): renew certificate
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 10:21:24 +02:00
Tobias Kaminsky 05d25d2d2b Merge pull request #17369 from nextcloud/add-java-to-kotlin-conversion-skill
agent: add Java to Kotlin conversion skill
2026-07-24 10:15:06 +02:00
alperozturk96 3b483ea266 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 10:12:26 +02:00
alperozturk96 c087f8e262 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 10:01:11 +02:00
alperozturk96 c9b9f3d770 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 a420292386 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 cd8ef6a3f7 activate FileUploaderIT tests
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 8c82961e2a wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 676f9e80e5 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 3f2269146b wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 9e866184ed wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 db2c2112e6 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 de2e440b02 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 7197284bb1 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 6c72ebb7c2 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 2fac8c8e75 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 a1fbaca58e wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 b54aff2aa9 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 c1c3951e7d wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 c0ab6fee79 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 c87874f81d wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 a13277103f wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 7f008a3720 update library
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	gradle/libs.versions.toml
2026-07-24 09:47:23 +02:00
alperozturk96 9540497d5a fix code format
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 f5f178ea63 fix testDeleteTask
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 d2cfb2b582 remove looper for showMnemonic
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 6b3717cb42 use 2.2 hamcrest
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
alperozturk96 b73bdb1550 disable animation for emulator, keep screen awake
Signed-off-by: alperozturk96 <[email protected]>
2026-07-24 09:47:23 +02:00
tobiasKaminsky e1a37e2698 Fix CI tests
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-24 09:47:23 +02:00
Nextcloud bot 956d1fe10f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-24 03:44:28 +00:00
alperozturk96 aa1f83b99d better naming
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 9e38a0650d fix create folder counter update
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 86494403f0 fix remove counter update
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 2fa538d2e6 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 ceca98c31a wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 95829a47fb wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 68335ebd7a wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 7eb1ffda06 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 d1eb57d3eb wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 4692271cc6 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 40459c97ac wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 391c395e77 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 ebadfc4ddc wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 3f982adab7 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 07d254a626 wait until current uploads finish then verify metadata
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 9211fe3045 improve naming
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 1e2b088c31 consolidate usages
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/fragment/FileDetailSharingFragment.java
2026-07-23 15:18:33 +02:00
alperozturk96 5c95cd8fd5 fix(e2ee): refresh during crud operations
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:18:33 +02:00
alperozturk96 5552989bab expand scope from previous conversion examples
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:14:25 +02:00
alperozturk96 ba4fc10e28 expand scope from previous conversion examples
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 15:13:21 +02:00
alperozturk96 0cb22d0d74 reduce scope to files client
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 14:59:17 +02:00
alperozturk96 3cb58f3248 reduce scope to files client
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 14:55:17 +02:00
alperozturk96 9eccfb392a reduce scope to files client
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 14:54:23 +02:00
alperozturk96 932e23c17f reduce scope to files client
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 14:54:01 +02:00
alperozturk96 eb43c927cd wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 14:44:15 +02:00
alperozturk96 81c05d3062 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 14:44:15 +02:00
alperozturk96 fa29933a5f wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 14:29:28 +02:00
alperozturk96 e93750abc0 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 14:29:28 +02:00
alperozturk96 5b26ed9ef2 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 14:29:28 +02:00
Alper Öztürk 8ce4ef4316 Merge pull request #17226 from nextcloud/fix/handle-editor-mimetypes
fix(editor): file opening flow
2026-07-23 14:29:12 +02:00
Alper Öztürk a337017dfc Merge pull request #17366 from nextcloud/refactor4
refactor
2026-07-23 11:29:39 +02:00
alperozturk96 770bea24d0 refactor
Signed-off-by: alperozturk96 <[email protected]>
2026-07-23 11:27:26 +02:00
alperozturk96 ffe71cd8ac wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 15:58:33 +02:00
alperozturk96 14377b31b5 Open in web editor
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 15:58:33 +02:00
alperozturk96 cecde81a7f Open in web editor
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 15:58:33 +02:00
alperozturk96 89f86ef921 Open in web editor
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 15:58:33 +02:00
alperozturk96 7356e934af fix spotbugs
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 15:58:33 +02:00
alperozturk96 5b60a58961 fix spotbugs
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 15:58:33 +02:00
alperozturk96 c0ed0fc6cd wip
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/activity/TextEditorWebView.kt
2026-07-22 15:58:33 +02:00
alperozturk96 e581c54dcd fix(editor): handle mime types
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 15:58:33 +02:00
Alper Öztürk 52ca8ff557 Merge pull request #17364 from nextcloud/refactor3
refactor
2026-07-22 15:05:21 +02:00
alperozturk96 4f92023e2e refactor
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 15:03:35 +02:00
Alper Öztürk eef79d954d Merge pull request #17362 from nextcloud/refactor2
refactor
2026-07-22 13:53:31 +02:00
alperozturk96 fd523d73e2 refactor
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 13:52:56 +02:00
Alper Öztürk b30386c990 Merge pull request #17304 from nextcloud/ical-v4
ical-v4
2026-07-22 11:36:42 +02:00
alperozturk96 a0f784650d wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 11:36:26 +02:00
alperozturk96 c37b0001f0 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 11:33:33 +02:00
alperozturk96 f0cdf41eb7 feat(ical-v4)
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 11:33:32 +02:00
renovate[bot] 2b7b05342b Update dependency org.mnode.ical4j:ical4j to v4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-22 11:33:32 +02:00
Tobias Kaminsky 92209aa473 Merge pull request #17312 from nextcloud/e2ee/copy-passphrase-debug
feat(setup-encryption-dialog): debug copy button
2026-07-22 10:25:05 +02:00
Tobias Kaminsky 347d3c1d20 Merge pull request #17345 from nextcloud/feat/e2ee-show-mnemonic-in-debug-only
feat(e2ee): show mnemonic only in debug
2026-07-22 10:11:22 +02:00
alperozturk96 d3e10c0968 check permissions before load calendar
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 09:26:37 +02:00
alperozturk96 77d8123c14 handle permissions
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 09:26:36 +02:00
alperozturk96 f2ab75b538 expose reloadCalendars method
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 09:26:36 +02:00
alperozturk96 a9c8502eb8 catch security exception
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 09:26:36 +02:00
alperozturk96 adddd35935 fix(conflict-resolve): auto upload
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 09:26:16 +02:00
Alper Öztürk 25c32bf7a3 Merge pull request #17361 from nextcloud/fix-third-party-package-name
rename third party package name
2026-07-22 09:22:05 +02:00
alperozturk96 989038c219 fix lint
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 08:39:46 +02:00
alperozturk96 8874973322 rename third party package name
Signed-off-by: alperozturk96 <[email protected]>
2026-07-22 08:17:50 +02:00
Alper Öztürk 65b84696b8 Merge pull request #14634 from nextcloud/showAvatars
Show avatars in activity list
2026-07-22 08:10:54 +02:00
Nextcloud bot 057ac4ce0c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-22 03:24:07 +00:00
Alper Öztürk 28e2fcf5cf Merge pull request #17294 from MaqsudMallick/fix/image-video-grid-items
fix(grid): scale grid thumbnails to fill the available tile width
2026-07-21 13:53:00 +02:00
Alper Öztürk 9cd9245713 Merge pull request #17358 from nextcloud/governanceDots
feat(governance): show color dot in retention and legal hold multi-select
2026-07-21 13:52:46 +02:00
tobiasKaminsky 4b2c74f539 feat(governance): show color dot in retention and legal hold multi-select
Add colored dot indicator to both the multi-select dialog items and the
label text field for file retention and legal hold, consistent with how
sensitivity labels display their color.

Assisted-by: ClaudeCode:claude-sonnet-4-6
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-21 13:48:29 +02:00
MaqsudMallick 95144c6348 constrint square dimensions
Signed-off-by: MaqsudMallick <[email protected]>
2026-07-21 13:43:22 +02:00
MaqsudMallick decbc0d0cf fix(grid): scale grid thumbnails to fill the available tile width
Signed-off-by: MaqsudMallick <[email protected]>
2026-07-21 13:43:22 +02:00
alperozturk96 3912404957 fix restoring empty state
Signed-off-by: alperozturk96 <[email protected]>
2026-07-21 09:54:02 +02:00
alperozturk96 5f021f538b refactor BetterImageSpan
Signed-off-by: alperozturk96 <[email protected]>
2026-07-21 09:41:25 +02:00
alperozturk96 ded1eded33 refactor activity list adapter
Signed-off-by: alperozturk96 <[email protected]>
2026-07-21 09:29:56 +02:00
alperozturk96 ce033bfb04 refactor activity list adapter
Signed-off-by: alperozturk96 <[email protected]>
2026-07-21 09:17:53 +02:00
alperozturk96 36a0b453ae fix infinite spinner
Signed-off-by: alperozturk96 <[email protected]>
2026-07-21 08:57:55 +02:00
alperozturk96 5e913b8dc4 refactor MentionChipSpan
Signed-off-by: alperozturk96 <[email protected]>
2026-07-21 08:27:52 +02:00
alperozturk96 7683ca0d27 remove old Spans.java
Signed-off-by: alperozturk96 <[email protected]>
2026-07-21 08:19:15 +02:00
tobiasKaminsky 2948ae64e9 Show avatars in activity list
Signed-off-by: tobiasKaminsky <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java
#	app/src/main/java/third_parties/fresco/BetterImageSpan.kt
#	app/src/main/res/values/styles.xml
2026-07-21 08:19:15 +02:00
tobiasKaminsky 6d4894d555 wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-21 08:19:15 +02:00
tobiasKaminsky 6cc1613cfe fix detekt
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-21 08:19:15 +02:00
tobiasKaminsky ed366057b3 fix spotless
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-21 08:19:15 +02:00
tobiasKaminsky 81ce007748 Rename .java to .kt
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-21 08:19:15 +02:00
tobiasKaminsky ed0e5ccac1 Show avatars in activity list
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-21 08:19:15 +02:00
Nextcloud bot 5c66499031 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-21 03:28:54 +00:00
Tobias Kaminsky d064ec9ee0 Merge pull request #17353 from nextcloud/update-library-2026-07-19
Update library to 2026-07-19
2026-07-20 11:53:20 +02:00
Tobias Kaminsky c613af6945 Update library to 2026-07-19
Signed-off-by: Tobias Kaminsky <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-20 09:35:18 +02:00
Nextcloud bot 37e90934ea fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-20 03:19:27 +00:00
Nextcloud bot 09f85c43b2 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-19 03:25:55 +00:00
Andy Scherzinger 0b2c271578 Merge pull request #17349 from nextcloud/renovate/ubuntu-resolute
Update ubuntu:resolute Docker digest to 3131b4c
2026-07-18 09:52:58 +02:00
renovate[bot] 1003b354e1 Update ubuntu:resolute Docker digest to 3131b4c
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-18 04:47:51 +00:00
Nextcloud bot 050af1980c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-18 03:23:51 +00:00
alperozturk96 bc2fdba432 feat(e2ee): show mnemonic only in debug
Signed-off-by: alperozturk96 <[email protected]>
2026-07-17 15:43:14 +02:00
Nextcloud bot 6a0b463ed2 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-17 03:21:52 +00:00
Andy Scherzinger 927bd632ad Merge pull request #17341 from nextcloud/chore/version-bump-35.0.0
chore: version bump 35.0.0 alpha
2026-07-16 18:40:10 +02:00
alperozturk96 534dc129bd chore: version bump 35.0.0 alpha
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:51:53 +02:00
Alper Öztürk df1ddfa3e5 Merge pull request #16991 from nextcloud/feat/sensivity-label
feat: Sensitivity labels
2026-07-16 15:15:01 +02:00
alperozturk96 3646a40a97 update spotbugs for AssistedFactory
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:14:44 +02:00
alperozturk96 4e89f465c4 update library
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 383f111c69 update library
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky 3162c6f0e9 use one api call for fetching available labels
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky e92ca085cc remove unused files
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky 47dd8a86db update lib
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky 20ff953cdf Sensitivity labels are now an array, but in first iteration only one item is set, thus always use first entry
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 d887c43bf7 refactor(file-info): initialize FileInfoViewModel via AssistedInject
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 c264e95644 remove manual migration
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 b604384d7d remove manual migration
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 a2dc9cd6da make file retention positive button filled tonal button
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 518da6f7e5 revert setting.gradle.kts
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 b598d87317 remove nullable flow data use sealed interface
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 37db1b801b use repository pattern
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky 2df9158b53 wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky c4a1b243fd wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky 9c1a7de3cd wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky 12f38b3ab5 wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky 928f837b73 wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky 4b65bb695a wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky ec304224d1 wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky a544aee913 wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky 050219a409 wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
tobiasKaminsky e6daf81dad show details depending on governance app
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 a760315fb5 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 89e25aa73d wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 a9c23fa784 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 bee18e19a5 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 7f73b009d6 use m3 card to distinc between sections
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 f15e473213 split ui, better margins
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 0cd4e964ae simplify, split gov logic
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 56b1904804 simplify, split gov logic
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 505305fe63 introduce file info fragment, separate image detail logic
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 53ad5662f3 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
alperozturk96 bebb1c96e4 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-16 15:10:51 +02:00
Tobias Kaminsky 82a4aa0b86 Merge pull request #17270 from nextcloud/fix/permission-denial
fix(document-storage-provider): permission denial
2026-07-16 15:00:17 +02:00
Tobias Kaminsky d47c77e6ad Merge pull request #17309 from nextcloud/fix/upload-marked-as-skip-instead-completed
fix(upload-list): distinguish between skip and complete
2026-07-16 14:50:46 +02:00
Tobias Kaminsky 3f2a7c9c73 Merge pull request #17316 from nextcloud/fix/network-on-main-thread-exception
fix(file-data-storage-manager): save file with parent network on main thread
2026-07-16 14:48:36 +02:00
Tobias Kaminsky 9476844ad8 Merge pull request #17320 from nextcloud/fix/dashboard-widged-configuration-activity-client-creation
fix(dashboard-widget-configuration-activity): client creation
2026-07-16 14:47:15 +02:00
Tobias Kaminsky 39f58f37a8 Merge pull request #17321 from nextcloud/fix/fda-commit-fragment
fix(file-display-activity): commit fragment
2026-07-16 14:44:45 +02:00
Tobias Kaminsky 08e0f43499 Merge pull request #17322 from nextcloud/fix/preview-text-fragment-finish
fix(preview-text-fragment): finish
2026-07-16 14:43:11 +02:00
Tobias Kaminsky 9bc7c1f571 Merge pull request #17323 from nextcloud/fix/gallery-fragment-action
fix(gallery-fragment): action
2026-07-16 14:42:30 +02:00
Tobias Kaminsky ad695f50a4 Merge pull request #17324 from nextcloud/fix/text-editor-web-view-no-such-element
fix(text-editor-web-view): user no such element
2026-07-16 14:41:29 +02:00
Tobias Kaminsky 222bd1d22e Merge pull request #17325 from nextcloud/fix/RetrieveHoverCardAsyncTask-npe
fix(retrieve-hover-card): npe
2026-07-16 14:39:55 +02:00
Andy Scherzinger 63d00366f3 Merge pull request #17338 from nextcloud/renovate/ubuntu-resolute
Update ubuntu:resolute Docker digest to 651ba3f
2026-07-16 08:04:18 +02:00
renovate[bot] e9683847a6 Update ubuntu:resolute Docker digest to 651ba3f
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-16 04:26:52 +00:00
Tobias Kaminsky dca5032bba Merge pull request #17240 from nextcloud/renovate/lifecycleviewmodelktxversion
Update lifecycleViewmodelKtxVersion to v2.11.0
2026-07-15 14:23:00 +02:00
Alper Öztürk ef8890f82a Merge pull request #17328 from nextcloud/enable-paralel-sync
build(parallel-sync): gradle
2026-07-15 10:49:39 +02:00
Alper Öztürk 07cd1edd91 Merge pull request #17266 from nextcloud/fix/e2ee-sub-encrypted-folder-creation
fix(e2ee): sub folder creation
2026-07-15 10:49:09 +02:00
Alper Öztürk de63fe5973 Merge pull request #16468 from nextcloud/jtr/fix-camera2-manifest-build-overrides
fix(manifest): Move camera2 feature declaration to scan-enabled flavors
2026-07-15 10:48:47 +02:00
Tobias Kaminsky 351d08cd1a Merge pull request #17311 from nextcloud/refactor-indeterminate-progress-dialog
refactor(indeterminate-progress-dialog)
2026-07-15 10:19:06 +02:00
Tobias Kaminsky 283ff16926 Merge pull request #17314 from nextcloud/fix/sync-with-server-npe
fix(synchronize-file): sync with server npe
2026-07-15 10:12:21 +02:00
Tobias Kaminsky 31ab3d05b1 Merge pull request #17265 from nextcloud/fix/e2ee-exclude-office-files
fix(e2ee): file and folder actions
2026-07-15 09:57:14 +02:00
Tobias Kaminsky 7b51a44e29 Merge pull request #17235 from nextcloud/fix/re-download-office-files
fix(re-download): office file
2026-07-15 09:44:56 +02:00
Tobias Kaminsky b2acf708e4 Merge pull request #17093 from nextcloud/feat/swipe-video-preview-to-image-from-file-list
feat: swipe video preview to image from file list
2026-07-15 09:43:09 +02:00
Josh ecadcf7544 fix(manifest): Add camera2 override to qa manifest
Signed-off-by: Josh <[email protected]>
2026-07-15 09:34:01 +02:00
Josh ed06a4cf77 fix(manifest): Add camera2 override to huawei manifest
Signed-off-by: Josh <[email protected]>
2026-07-15 09:34:01 +02:00
Josh b00f80b44e fix(manifest): Add camera2 override to gplay manifest
Signed-off-by: Josh <[email protected]>
2026-07-15 09:34:01 +02:00
Josh f90eac0efd test(manifest): Remove camera2 override from main manifest
Moving to flavor-specific manifests to avoid warning about `tools:node="replace"` for builds that don't have scanning/camera2

Signed-off-by: Josh <[email protected]>
2026-07-15 09:34:01 +02:00
Tobias Kaminsky 0be315cc32 Merge pull request #17318 from nextcloud/update-library-2026-07-12
Update library to 2026-07-12
2026-07-15 09:25:52 +02:00
Tobias Kaminsky 7c6d9fbb0c Merge pull request #17329 from nextcloud/fixRenovate
matchDatasources is needed for minimumReleaseAge
2026-07-15 08:48:11 +02:00
tobiasKaminsky ab7b350f4f matchDatasources is needed for minimumReleaseAge
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-15 08:46:22 +02:00
tobiasKaminsky 0ae0bf2ed8 fix: Calling an empty super method
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-15 08:39:48 +02:00
alperozturk96 fa8fbe2694 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-15 08:30:12 +02:00
alperozturk96 6923ac226d build(parallel-sync): gradle
Signed-off-by: alperozturk96 <[email protected]>
2026-07-15 08:16:52 +02:00
alperozturk96 764f1ec2b4 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-15 08:12:24 +02:00
alperozturk96 459a46122a wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-15 08:12:24 +02:00
alperozturk96 45e730c0d0 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-15 08:12:24 +02:00
alperozturk96 f77da19615 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-15 08:12:24 +02:00
alperozturk96 1e8329ad8e fix(document-storage-provider): permission denial
Signed-off-by: alperozturk96 <[email protected]>
2026-07-15 08:12:24 +02:00
Tobias Kaminsky b03d08efbf Merge pull request #17128 from nextcloud/renovate/mockkversion
Update mockkVersion to v1.14.11
2026-07-15 07:20:15 +02:00
Tobias Kaminsky 694904c33d Merge pull request #17129 from nextcloud/renovate/slf4j-monorepo
Update dependency org.slf4j:jcl-over-slf4j to v2.0.18
2026-07-15 07:19:48 +02:00
Tobias Kaminsky e5476eb235 Merge pull request #17239 from nextcloud/renovate/composebom
Update dependency androidx.compose:compose-bom to v2026.06.01
2026-07-15 07:19:06 +02:00
Tobias Kaminsky 271a9e1156 Merge pull request #17282 from nextcloud/renovate/daggerversion
Update daggerVersion to v2.60.1
2026-07-15 07:18:34 +02:00
tobiasKaminsky f5143776f8 update verification-metadata.xml
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-15 07:18:13 +02:00
renovate[bot] 1b24c81318 Update lifecycleViewmodelKtxVersion to v2.11.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-15 07:18:13 +02:00
renovate[bot] 51948a6d4c Update daggerVersion to v2.60.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-14 13:02:01 +02:00
Tobias Kaminsky 360bd0f0f4 Merge pull request #17284 from nextcloud/renovate/reactivecircus-android-emulator-runner-2.x
Update reactivecircus/android-emulator-runner action to v2.38.0
2026-07-14 13:00:23 +02:00
Tobias Kaminsky 8bead4264f Merge pull request #17278 from nextcloud/renovate/gradle-9.x
Update Gradle to v9.6.1
2026-07-14 12:59:26 +02:00
renovate[bot] c4b5790efd Update Gradle to v9.6.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-14 12:19:27 +02:00
renovate[bot] bb36468ab9 Update dependency androidx.compose:compose-bom to v2026.06.01
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-14 12:19:09 +02:00
renovate[bot] 51a347424c Update mockkVersion to v1.14.11
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-14 12:18:46 +02:00
alperozturk96 4a17021b7e fix(retrieve-hover-card): npe
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 16:12:19 +02:00
alperozturk96 4183d45797 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 16:12:18 +02:00
alperozturk96 75bba75db2 fix(text-editor-web-view): user no such element
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 16:01:45 +02:00
alperozturk96 1c99bc602e fix(gallery-fragment): action
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 15:46:22 +02:00
alperozturk96 9a439185d5 fix(preview-text-fragment): finish
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 15:31:24 +02:00
alperozturk96 00ccbf92bc remove callback
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 14:48:43 +02:00
alperozturk96 a09190f264 fix Can not perform this action after onSaveInstanceState
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 14:40:11 +02:00
alperozturk96 7da02afdfc fix(dashboard-widget-configuration-activity): client creation
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 13:57:04 +02:00
alperozturk96 ced57ae113 fix(dashboard-widget-configuration-activity): client creation
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 13:54:21 +02:00
alperozturk96 c7c8bc7489 fix lint
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 08:57:51 +02:00
alperozturk96 0be1ed226c fix lint
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 08:57:24 +02:00
alperozturk96 4cbd2d3553 refactor(indeterminate-progress-dialog)
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 08:57:24 +02:00
alperozturk96 0792241850 fix codacy
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 08:25:03 +02:00
alperozturk96 4e5ebe2680 fix multi thread correctness spotbugs
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 08:24:54 +02:00
alperozturk96 e38d085594 clear confusion
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 08:19:43 +02:00
alperozturk96 8e79aaf170 fix(upload-list): distinguish between skip and complete
Signed-off-by: alperozturk96 <[email protected]>
2026-07-13 08:19:43 +02:00
Tobias Kaminsky 34fa392afb Update library to 2026-07-12
Signed-off-by: Tobias Kaminsky <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>
2026-07-13 07:09:23 +02:00
Andy Scherzinger 2acfa9cc6a Merge pull request #17308 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-07-11 12:09:54 +02:00
nextcloud-android-bot 1c0f90adc4 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-07-11 09:36:00 +00:00
Nextcloud bot 521fd1d8b2 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-11 03:21:42 +00:00
alperozturk96 8b9e2b774f fix(file-data-storage-manager): save file with parent network on main thread exception
Signed-off-by: alperozturk96 <[email protected]>
2026-07-10 15:25:45 +02:00
alperozturk96 170ede9d0b fix(synchronize-file): sync with server npe
Signed-off-by: alperozturk96 <[email protected]>
2026-07-10 14:01:40 +02:00
Alper Öztürk 0f6850e97b Merge pull request #17313 from nextcloud/fix/connectivity-service-it
fix ConnectivityServiceImplIT
2026-07-10 13:06:21 +02:00
alperozturk96 9b103e5ae4 fix ConnectivityServiceImplIT
Signed-off-by: alperozturk96 <[email protected]>
2026-07-10 13:05:56 +02:00
Alper Öztürk d1d24fbab7 Merge pull request #17250 from nextcloud/fix/connectivity-service-too-many-request
fix(connectivity-service): too many attempt
2026-07-10 12:51:48 +02:00
Alper Öztürk 46249a38a8 Merge pull request #17310 from nextcloud/fix/login-loading-ui
fix(login): loading ui
2026-07-10 11:44:11 +02:00
alperozturk96 fcf0e7637b feat(setup-encryption-dialog): debug copy button
Signed-off-by: alperozturk96 <[email protected]>
2026-07-10 11:42:19 +02:00
alperozturk96 d5e56b930b fix lint
Signed-off-by: alperozturk96 <[email protected]>
2026-07-10 11:17:30 +02:00
alperozturk96 a4e698bdcf fix(login): loading ui
Signed-off-by: alperozturk96 <[email protected]>
2026-07-10 10:55:05 +02:00
Tobias Kaminsky 203fa433fa Merge pull request #17303 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-07-10 07:13:58 +02:00
Nextcloud bot 7096409d09 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-10 03:23:01 +00:00
Alper Öztürk cc36cfe5bf Merge pull request #17251 from MaqsudMallick/ingestModRewriteWorking
Use clean internal link when server mod_rewrite_working is true
2026-07-09 15:20:24 +02:00
MaqsudMallick 4824325f0d update verification metadata
Signed-off-by: MaqsudMallick <[email protected]>
2026-07-09 14:26:12 +05:30
nextcloud-android-bot 709ff7ebad 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-07-09 06:02:11 +00:00
alperozturk96 665280315a wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-06 11:43:00 +02:00
alperozturk96 d7a25445b0 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-06 11:43:00 +02:00
alperozturk96 779d453573 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-06 11:43:00 +02:00
alperozturk96 353d887089 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-06 11:43:00 +02:00
alperozturk96 9016cc8b5e wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-06 11:43:00 +02:00
alperozturk96 c07fabbfc1 fix(re-download): office file
Signed-off-by: alperozturk96 <[email protected]>
2026-07-06 11:43:00 +02:00
renovate[bot] f80b062e86 Update reactivecircus/android-emulator-runner action to v2.38.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-05 08:25:37 +00:00
renovate[bot] b3867cbf8a Update slf4j monorepo to v2.0.18
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-03 08:52:28 +02:00
Alper Öztürk c914914caf Update WalledCheckCache.kt
Signed-off-by: Alper Öztürk <[email protected]>
2026-07-03 07:56:36 +02:00
alperozturk96 c90b87d6b1 make client factory accepts non-null context
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 13:03:24 +02:00
alperozturk96 16433a2969 fix codacy
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 12:58:55 +02:00
alperozturk96 89ebe6ee5a use concurrent hash map instead synchronized block
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 12:58:55 +02:00
alperozturk96 5550ddfea0 make connectivity service impl and walled check cache singleton
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 12:58:55 +02:00
alperozturk96 60d1f7a96d convert network module to kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 12:58:55 +02:00
alperozturk96 19dca173e0 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 12:58:55 +02:00
alperozturk96 4fba680728 fix(connectivity-service): too many attempt
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 12:58:55 +02:00
alperozturk96 e717eb51dc fix(connectivity-service): too many attempt
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 12:58:55 +02:00
alperozturk96 059b9bd783 use pager
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 11:16:28 +02:00
alperozturk96 17ce20ca5f wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 11:16:28 +02:00
alperozturk96 ff90e9c091 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 11:16:28 +02:00
alperozturk96 7ae5968e68 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 11:16:28 +02:00
alperozturk96 c1b5549b9b wip
Signed-off-by: alperozturk96 <[email protected]>
2026-07-02 11:16:28 +02:00
alperozturk96 48676b02c4 fix(e2ee): sub folder creation
Signed-off-by: alperozturk96 <[email protected]>
2026-07-01 13:24:11 +02:00
alperozturk96 2eab0777c4 fix(e2ee): file and folder actions
Signed-off-by: alperozturk96 <[email protected]>
2026-07-01 11:27:51 +02:00
525 changed files with 22858 additions and 9245 deletions

No files matched your search

@@ -0,0 +1,130 @@
---
name: android-java-to-kotlin
description: >
Use when finishing a Java-to-Kotlin conversion in an Android project, when the user
mentions "java to kotlin", "j2k", "convert java", "migrate java to kotlin", "finish the
conversion", "make it idiomatic", or when a freshly IDE-converted .kt file needs to be
turned into clean, modern, idiomatic Kotlin. The developer first runs the IDE converter
(Android Studio: Code > Convert Java File to Kotlin File), then this skill drives the
second pass: idiomatic cleanup, fail-fast control flow, coroutines/lifecycleScope,
modern Android APIs, function decomposition, and a behaviour-locking test.
license: AGPL-3.0-or-later
SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
metadata:
author: Nextcloud Android
version: "1.0.0"
---
# Android Java to Kotlin Conversion (Second Pass)
The IDE converter produces Kotlin that *compiles* but is not *idiomatic*: platform types
everywhere, one giant function per lifecycle callback, nested `if`/`else`, `new Thread`,
`switch`, `TextUtils.isEmpty`, magic numbers. This skill drives the disciplined second
pass that turns that output into clean, modern, testable Kotlin — **without changing
observable behaviour** — and then writes a test that proves behaviour is unchanged.
## The Two-Person Workflow
This skill assumes a hand-off:
1. **Developer** runs the mechanical IDE conversion (`Code > Convert Java File to Kotlin
File`, or ⌥⇧⌘K), producing a `.kt` file that compiles but is not idiomatic.
2. **You (Claude)** drive everything after that:
Step 0 Baseline → Step 1 Idiomatic pass → Step 2 Behaviour-locking test → Step 3
Verify. If Step 3 fails or behaviour drifts, loop back to Step 1.
If you are handed a `.java` file instead, first apply a faithful 1:1 translation to reach
the same starting point, then continue.
## The Prime Directive: Behaviour Must Not Change
Every transformation in this skill is **behaviour-preserving**. You are refactoring for
readability, safety, and modern API usage — not adding features or fixing bugs. If you
spot a real bug, surface it to the developer; do not silently "fix" it inside a
conversion. The behaviour-locking test in Step 3 exists to keep you honest.
## Step 0: Establish Baseline
Before editing anything:
1. Read the whole `.kt` file (and, if you can, the original `.java` via
`git show <rev>:<path>.java` or the IDE's local history) to understand *what it does*.
2. Write down the **public/observable surface** you must keep intact:
- Lifecycle callbacks (`onCreate`, `onViewCreated`, `onSaveInstanceState`, …) and their
ordering of side-effects.
- Any Parcelable/Bundle keys, intent extras, and `newInstance(...)` factory shapes.
3. Note threading: which work runs off the main thread today (`Thread`, `AsyncTask`,
`runOnUiThread`, executors) — this maps to coroutines in Step 2.
## Step 1: Idiomatic Pass
Apply, in this order, then re-check the invariants:
1. **Kill platform types.** Give every `!` platform type an explicit nullable/non-null
type based on the Java source and call sites.
2. **Fail fast.** Replace nested `if`/`else` pyramids and null-checks with guard clauses
and `require`/`requireNotNull`/`?: return`. See [FAIL-FAST.md](references/FAIL-FAST.md).
3. **Decompose.** Break each oversized lifecycle callback / `setupView`-style method into
small, single-purpose private functions named for their intent. See
[ANDROID-IDIOMS.md](references/ANDROID-IDIOMS.md).
4. **Modern concurrency.** Replace `new Thread`, `AsyncTask`, `runOnUiThread`, and
callback pairs with `lifecycleScope` + `suspend` + `withContext`. See
[CONCURRENCY.md](references/CONCURRENCY.md).
5. **Modern Android + Kotlin idioms.** Scope functions (`run`/`apply`/`let`), extension
functions, `when`/`partition`/`filter` over `switch`, string templates, `isNullOrEmpty`,
view/KTX extensions. See [ANDROID-IDIOMS.md](references/ANDROID-IDIOMS.md). Retire
deprecated Android APIs (`onActivityResult`, options-menu overrides,
`java.util.Observable`) — see [DEPRECATED-APIS.md](references/DEPRECATED-APIS.md).
6. **Project conventions.** SPDX header, no magic numbers (`companion object` +
`const val`), resources not hardcoded strings, ≤300 lines/file, ≤120 cols. See
[PROJECT-CONVENTIONS.md](references/PROJECT-CONVENTIONS.md).
7. **Testability seams.** Extract pure logic (URL building, permission math, partitioning)
into functions you can unit-test; mark with `@VisibleForTesting` where they must stay
`internal`/`private`-ish but be reachable from tests.
Do NOT expand scope. Unrelated files stay untouched (AGENTS.md / AI policy).
## Step 2: Write a Behaviour-Locking Test (Mandatory)
A conversion is not complete until a test proves behaviour is unchanged. See
[TESTING.md](references/TESTING.md) for the decision tree. In short:
- **Pure functions you extracted** (e.g. link builders, `isReshareForbidden`,
partitioning) → fast JVM unit tests in `app/src/test/` (JUnit4 + mockito-kotlin).
- **Fragment/Activity/DB behaviour** → instrumented test in `app/src/androidTest/`
extending the project's base test class, or a Robolectric test where the project uses it.
- Prefer testing the **seams you just created**. If the Java original had no test, your
new test is the characterization test that locks current behaviour.
Every test file gets the SPDX header and follows the project's test conventions.
## Step 3: Verify
Run and report real output — never claim green without evidence:
```bash
# Formatting + static analysis on the changed files
./gradlew spotlessKotlinCheck detektGplayDebug lintGplayDebug spotbugsGplayDebug
# Unit tests
./gradlew jacocoTestGplayDebugUnitTest
# Instrumented tests (if you wrote one), scoped to the class
./gradlew createGplayDebugCoverageReport -Pcoverage=true \
-Pandroid.testInstrumentationRunnerArguments.class=<fully.qualified.TestClass>
```
## Worked Example
[assets/worked-example.md](assets/worked-example.md) is a real before/after from
`FileDetailSharingFragment` (871-line Java fragment → idiomatic Kotlin) showing each
transformation class in context. Read it when you need a concrete pattern.
## Batch Conversion
Convert one file at a time, leaf dependencies first. Report progress per file. Warn the
developer before a change set grows into several thousand lines — split into focused PRs
(AGENTS.md). Each commit needs `Assisted-by: <agent>:<model>`; only the human adds
`Signed-off-by`.
@@ -0,0 +1,163 @@
# Worked Example: FileDetailSharingFragment
A real conversion of an 871-line Java fragment
(`com.owncloud.android.ui.fragment.FileDetailSharingFragment`) into idiomatic Kotlin. Each
section shows one transformation class from the skill, in context. Behaviour is unchanged
throughout; the only new capability (`@VisibleForTesting createInternalLink`) is a
testability seam that returns the same URL the Java produced.
## A. SPDX Header Rewrite
```diff
-/*
- * Nextcloud Android client application
- *
- * @author Andy Scherzinger
- * ...
- * Copyright (C) 2018 Andy Scherzinger
- * SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
- */
+/*
+ * Nextcloud - Android Client
+ *
+ * SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
```
## B. Fail-Fast Preconditions
```diff
-if (file == null) throw new IllegalArgumentException("File may not be null");
-if (user == null) throw new IllegalArgumentException("Account may not be null");
-fileActivity = (FileActivity) getActivity();
-if (fileActivity == null) throw new IllegalArgumentException("FileActivity may not be null");
+fileActivity = (activity as FileActivity?)
+requireNotNull(file) { "File may not be null" }
+requireNotNull(user) { "Account may not be null" }
+requireNotNull(fileActivity) { "FileActivity may not be null" }
```
## C. Decomposition of `onViewCreated`
The Java `onViewCreated` inlined adapter creation (duplicated for internal/external),
layout managers, listeners, and the fetch kick-off. It became a readable sequence plus
extracted helpers `getUserId()`, `setupInternalShares()`, `setupExternalShares()`,
`createShareListAdapter(userId, type)`, `startAnimation()`. The two near-identical adapter
blocks collapsed into one parameterized factory:
```kotlin
private fun createShareListAdapter(userId: String, type: SharesType): ShareeListAdapter =
ShareeListAdapter(
fileActivity!!, ArrayList(), this, userId, user, viewThemeUtils,
(file?.isEncrypted == true), type
).apply { setHasStableIds(true) }
```
## D. `new Thread` + `runOnUiThread` → `lifecycleScope` + `suspend`
```diff
-private void fetchE2EECounter(Runnable onComplete) {
- new Thread(() -> {
- try { ... fileDataStorageManager.saveFile(file); }
- catch (Exception e) { Log_OC.e(TAG, "..." + e.getMessage()); }
- Activity a = getActivity();
- if (a != null) a.runOnUiThread(onComplete);
- }).start();
-}
+private suspend fun fetchE2EECounter(): Boolean = withContext(Dispatchers.IO) {
+ return@withContext try {
+ val client = clientFactory.create(user)
+ val metadata = RefreshFolderOperation.getDecryptedFolderMetadata(true, file, client, user, requireContext())
+ if (metadata is DecryptedFolderMetadataFile) {
+ file?.setE2eCounter(metadata.metadata.counter)
+ fileDataStorageManager?.saveFile(file)
+ }
+ true
+ } catch (e: Exception) {
+ Log_OC.e(TAG, "Error refreshing E2E counter: " + e.message)
+ false
+ }
+}
```
Caller now `lifecycleScope.launch { if (!fetchE2EECounter()) return@launch; withContext(Main){ ... } }`.
The callback-pair `fetchSharees(onSuccess, onError)` was likewise turned into a `suspend`
call returning `Boolean`.
## E. `switch` Bucketing → `partition` + Set
```diff
-for (OCShare share : shares) {
- if (share.getShareType() != null) {
- switch (share.getShareType()) {
- case PUBLIC_LINK: case FEDERATED_GROUP: case FEDERATED: case EMAIL:
- externalShares.add(share); break;
- default: internalShares.add(share); break;
- }
- }
-}
+private val externalShareTypes = setOf(
+ ShareType.PUBLIC_LINK, ShareType.FEDERATED_GROUP, ShareType.FEDERATED, ShareType.EMAIL
+)
+val (external, internal) = shares
+ .filter { it.shareType != null }
+ .partition { it.shareType in externalShareTypes }
```
## F. Nested `if` Cursor Handling → Guard Clauses
The three-level-nested `handleContactResult` became flat sequential guards, each showing
the snackbar + log and returning, with `cursor.close()` preserved on every path. See
[FAIL-FAST.md](../references/FAIL-FAST.md) section "Deeply Nested".
## G. Scope Functions & KTX
```diff
-final LinearLayout shimmerLayout = binding.shimmerLayout.getRoot();
-shimmerLayout.clearAnimation();
-shimmerLayout.setVisibility(View.GONE);
-binding.shareContainer.setVisibility(View.VISIBLE);
+binding?.run {
+ shimmerLayout.root.run { clearAnimation(); visibility = View.GONE }
+ shareContainer.visibility = View.VISIBLE
+}
```
```diff
-for (int i = 0; i < viewGroup.getChildCount(); i++) { toggleSearchViewEnable(viewGroup.getChildAt(i), enable); }
+for (i in 0..<view.size) { toggleSearchViewEnable(view.getChildAt(i), enable) } // androidx.core.view.size
```
## H. Constants + Companion + `@JvmStatic`
```diff
-private static final String TAG = "FileDetailSharingFragment";
-ViewExtensionsKt.setVisibleIf(binding.sharesListInternalShowAll, adapter.shares.size() > 3);
+companion object {
+ private const val TAG = "FileDetailSharingFragment"
+ private const val MIN_SHOW_ALL_VISIBLE_ITEM_COUNT = 3
+ @JvmStatic fun newInstance(file: OCFile?, user: User?) = FileDetailSharingFragment().apply { ... }
+}
+binding.sharesListInternalShowAll.setVisibleIf(internalShares.size > MIN_SHOW_ALL_VISIBLE_ITEM_COUNT)
```
## I. Testability Seam
`createInternalLink` was inlined string concatenation in Java. It was extracted to a pure
`@VisibleForTesting internal fun createInternalLink(user, file, capabilities): String` that
returns the identical URL — enabling the unit test in
[TESTING.md](../references/TESTING.md) without a device.
## J. Detekt Suppression (Last Resort)
The class is genuinely large and can't be fully split within one conversion, so a
file-level suppression documents the debt honestly:
```kotlin
@Suppress("TooManyFunctions", "LargeClass", "TooGenericExceptionCaught", "ReturnCount")
class FileDetailSharingFragment : Fragment(), ... {
```
Prefer real decomposition; use this only when splitting is out of scope, and tell the
developer.
@@ -0,0 +1,170 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Android + Kotlin Idioms
Transformations applied during the idiomatic pass. Every one is behaviour-preserving.
Examples are drawn from a real fragment conversion.
## 1. Decompose Oversized Functions
The IDE keeps the Java structure: one enormous `onViewCreated`/`setupView` that inflates,
themes, wires listeners, and kicks off loading in a single 80-line block. Split by
intent into small private functions. The lifecycle callback becomes a readable table of
contents.
```kotlin
// BEFORE: onViewCreated does everything inline (adapters, layout managers, listeners, fetch)
// AFTER
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
fileActivity ?: return
fileDataStorageManager = fileActivity?.storageManager
fileOperationsHelper = fileActivity?.fileOperationsHelper
startAnimation()
val userId = getUserId()
setupInternalShares(userId)
setupExternalShares(userId)
binding?.pickContactEmailBtn?.setOnClickListener { checkContactPermission() }
fetchSharees()
setupView()
}
```
Rules:
- One function = one reason to change. Name it for *what it accomplishes*
(`setupInternalShares`, `themeView`, `disableE2EEShareForV1`), not *how*.
- Factor duplicated blocks into a parameterized helper
(`createShareListAdapter(userId, SharesType.INTERNAL)`).
- Keep files ≤300 lines (project rule). Heavy decomposition sometimes means splitting a
god-class into collaborators — raise that with the developer rather than exceeding 300.
## 2. Scope Functions Over Repetition
Replace repeated `binding.x` / `viewThemeUtils.material.y` chains with `run`/`apply`/`with`.
```kotlin
// BEFORE
viewThemeUtils.material.themeSearchCardView(binding.searchCardWrapper);
viewThemeUtils.material.colorMaterialButtonPrimaryOutlined(binding.sendCopyBtn);
viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(binding.sharesListInternalShowAll);
// AFTER
binding.run {
viewThemeUtils.material.run {
themeSearchCardView(searchCardWrapper)
colorMaterialButtonPrimaryOutlined(sendCopyBtn)
colorMaterialButtonPrimaryBorderless(sharesListInternalShowAll)
}
}
```
Use `apply {}` when configuring and returning the receiver:
```kotlin
ShareeListAdapter(fileActivity!!, ArrayList(), this, userId, user, viewThemeUtils, encrypted, type)
.apply { setHasStableIds(true) }
```
## 3. `switch` → `when` / `filter` + `partition`
Collapse a `switch` that sorts items into buckets into a declarative pipeline with a
constant `Set`.
```kotlin
// BEFORE: for-loop with switch(shareType) adding to internalShares / externalShares
// AFTER
private val externalShareTypes = setOf(
ShareType.PUBLIC_LINK, ShareType.FEDERATED_GROUP, ShareType.FEDERATED, ShareType.EMAIL
)
val (external, internal) = shares
.filter { it.shareType != null }
.partition { it.shareType in externalShareTypes }
```
## 4. Extension Functions & KTX
Import members directly and lean on AndroidX KTX instead of verbose Java utilities.
| Java / verbose | Idiomatic Kotlin |
|---|---|
| `TextUtils.isEmpty(s)` | `s.isNullOrEmpty()` |
| `BundleExtensionsKt.getParcelableArgument(b, k, T.class)` | `b.getParcelableArgument(k, T::class.java)` |
| `for (int i = 0; i < vg.getChildCount(); i++)` | `for (i in 0..<view.size)` (`androidx.core.view.size`) |
| manual getter/setter methods | Kotlin property access (`view.visibility = View.GONE`) |
| `private int x; public int getX()` (read-only to callers) | `var columnsCount = 0; private set` |
| empty override method body | `= Unit` single-expression body |
| free-standing util call | receiver extension (`externalShares.mergeDistinctByToken(publicShares)`) |
Domain-specific extensions read best as receivers on the relevant type:
```kotlin
private fun OCCapability?.isPasswordEnforced(): Boolean =
this?.filesSharingPublicPasswordEnforced?.isTrue == true &&
filesSharingPublicAskForOptionalPassword.isTrue
```
## 5. Null Safety Instead of Platform Types
The IDE leaves `!` platform types and defensive Java null-checks. Replace with `?.`,
`?:`, and Kotlin's `require`/`requireNotNull`. A nullable `binding` (cleared in
`onDestroyView`) is the canonical Android case — guard it with `?.` / `?: return`.
```kotlin
// BEFORE
if (binding == null) return;
final LinearLayout shimmer = binding.shimmerLayout.getRoot();
shimmer.clearAnimation();
// AFTER
binding?.run {
shimmerLayout.root.run {
clearAnimation()
visibility = View.GONE
}
shareContainer.visibility = View.VISIBLE
}
```
## 6. Constants & Companion Object
Move `static final` and magic literals into a `companion object`; use `const val` for
compile-time constants. Add `@JvmStatic` to factory methods still called from Java.
```kotlin
companion object {
private const val TAG = "FileDetailSharingFragment"
private const val ARG_FILE = "FILE"
private const val MIN_SHOW_ALL_VISIBLE_ITEM_COUNT = 3
private const val INTERNAL_LINK_PATH_PRETTY = "/f/"
@JvmStatic
fun newInstance(file: OCFile?, user: User?) = FileDetailSharingFragment().apply {
arguments = Bundle().apply {
putParcelable(ARG_FILE, file)
putParcelable(ARG_USER, user)
}
}
}
```
## 7. Detekt Suppressions Are a Last Resort
If a legacy god-class genuinely cannot be split within the conversion's scope, a
file/class-level `@Suppress("TooManyFunctions", "LargeClass", ...)` is acceptable — but
prefer real decomposition and tell the developer what you suppressed and why.
## 8. `// region` Organization
For large classes, grouping members under `// region <name>` / `// endregion` (lifecycle,
private methods, overrides, companion) aids IDE folding. This is IDE structure, not a
decorative divider. Match the surrounding file's existing style; do not introduce ASCII
banner comments (`// ==== ====`), which the project forbids.
@@ -0,0 +1,213 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Concurrency: Java Threads → Coroutines & `lifecycleScope`
Replace `new Thread`, `AsyncTask`, executors, and `runOnUiThread`/`Handler.post`
callback-passing with structured coroutines scoped to the component lifecycle. This is
behaviour-preserving *and* fixes leaks: `lifecycleScope`/`viewModelScope` cancel
automatically when the owner is destroyed, so no work touches a dead view.
## Choose the Right Scope
| Context | Scope |
|---|---|
| `Fragment` (UI work tied to view) | `viewLifecycleOwner.lifecycleScope` (preferred) or `lifecycleScope` |
| `Activity` | `lifecycleScope` |
| `ViewModel` | `viewModelScope` |
| No lifecycle owner | inject a `CoroutineScope` / use a repository suspend fun |
Use `Dispatchers.IO` for disk/network/DB, `Dispatchers.Main` (or `withContext(Main)`) to
touch views.
## `AsyncTask` → Coroutines
`AsyncTask` is deprecated. Map its callbacks onto a single `launch`:
| `AsyncTask` | Coroutine |
|---|---|
| `onPreExecute()` | code before `withContext(IO)` (runs on Main) |
| `doInBackground()` | `withContext(Dispatchers.IO) { ... }` |
| `onPostExecute(result)` | code after, back on `Dispatchers.Main` |
| `isCancelled()` | `isActive` (or `ensureActive()`) |
| `cancel(true)` | `job.cancel()` |
| the `AsyncTask` instance field | the returned `Job` |
A self-contained task class stops extending `AsyncTask` and holds the lifecycle owner so
its scope cancels with the screen:
```kotlin
// BEFORE: class GallerySearchTask extends AsyncTask<Void, Void, Result> { ... }
class GallerySearchTask(
private val fragment: GalleryFragment,
private val user: User,
private val storageManager: FileDataStorageManager,
private val endDate: Long,
private val limit: Int
) {
fun execute(): Job = fragment.lifecycleScope.launch(Dispatchers.IO) {
if (!isActive) return@launch
val context = fragment.context ?: return@launch
val result = performSearch(context)
withContext(Dispatchers.Main) {
fragment.searchCompleted(result.emptySearch, result.lastTimestamp)
}
}
}
```
The caller keeps the `Job` and cancels it with the view:
```kotlin
private var photoSearchTask: Job? = null
// ...
photoSearchTask = GallerySearchTask(this, user, storageManager, endDate, limit).execute()
override fun onDestroyView() {
photoSearchTask?.cancel()
photoSearchTask = null
}
```
Because `lifecycleScope` cancels on destroy, the old `WeakReference<Fragment>` leak-guard
disappears — a direct `fragment` reference plus `fragment.context ?: return@launch` is
enough. (PR #16908)
## `AsyncTask` Behind a Callback API → `runCatching` + `fold`
When a service method hid an `AsyncTask` that set mutable fields (a boolean success flag,
`errorMessage`, result fields) and dispatched them in `onPostExecute`, keep the public
callback signature but drive it from a coroutine. Return an **immutable** result from the
background function and branch with `fold`:
```kotlin
private data class ActivitiesResult(
val activities: List<Any>,
val client: NextcloudClient,
val lastGiven: Long
)
override fun getActivities(lastGiven: Long, callback: ActivitiesServiceCallback) {
scope.launch {
runCatching { withContext(Dispatchers.IO) { fetchActivities(lastGiven) } }
.fold(
onSuccess = { (activities, client, updated) ->
callback.onLoaded(activities, client, updated)
},
onFailure = { callback.onError(it.message ?: "") }
)
}
}
```
`runCatching` / `fold` replaces the boolean-success + `errorMessage`-field idiom; the
background function `fetchActivities` throws on failure instead of returning `false`, and
the immutable `ActivitiesResult` destructures straight into `onSuccess`. (PR #16654)
> **Scope caveat:** that PR launched on an ad-hoc `CoroutineScope(Dispatchers.Main)` with
> no lifecycle owner — it never cancels and can leak. Prefer an injected `CoroutineScope`
> or expose a `suspend` function the presenter runs on `lifecycleScope` / `viewModelScope`.
> Flag ad-hoc scopes in review.
## `new Thread { ... runOnUiThread(...) }` → `lifecycleScope.launch` + `withContext`
```kotlin
// BEFORE
private void fetchE2EECounter(Runnable onComplete) {
new Thread(() -> {
try {
OwnCloudClient client = clientFactory.create(user);
Object metadata = RefreshFolderOperation.getDecryptedFolderMetadata(true, file, client, user, ctx);
if (metadata instanceof DecryptedFolderMetadataFile m) {
file.setE2eCounter(m.getMetadata().getCounter());
fileDataStorageManager.saveFile(file);
}
} catch (Exception e) { Log_OC.e(TAG, "..." + e.getMessage()); }
Activity a = getActivity();
if (a != null) a.runOnUiThread(onComplete);
}).start();
}
// AFTER: background work is a suspend fun on IO; the UI reaction runs on Main
private suspend fun fetchE2EECounter(): Boolean = withContext(Dispatchers.IO) {
return@withContext try {
val context = requireContext()
val client = clientFactory.create(user)
val metadata = RefreshFolderOperation.getDecryptedFolderMetadata(true, file, client, user, context)
if (metadata is DecryptedFolderMetadataFile) {
file?.setE2eCounter(metadata.metadata.counter)
fileDataStorageManager?.saveFile(file)
}
true
} catch (e: Exception) {
Log_OC.e(TAG, "Error refreshing E2E counter: " + e.message)
false
}
}
// caller
lifecycleScope.launch {
val ok = fetchE2EECounter()
if (!ok) return@launch
withContext(Dispatchers.Main) { /* update views */ }
}
```
Notes:
- The old code returned nothing and drove the UI via a `Runnable`. The idiomatic version
returns a `Boolean` result and lets the caller decide — same observable outcome, no
callback threading.
- `getActivity() != null` guard becomes `lifecycleScope` cancellation + `binding?`/`?:
return` guards. Preserve any "is the view still alive?" check as a `binding == null`
guard inside `launch`.
## Callback-Pair API → `suspend` Result
Repositories that took `onSuccess`/`onError` lambdas become `suspend` functions returning
a result, awaited inside a coroutine.
```kotlin
// BEFORE
shareRepository.fetchSharees(remotePath, onSuccess = { ... }, onError = { ... });
// AFTER
lifecycleScope.launch {
val result = shareRepository.fetchSharees(remotePath)
if (binding == null) return@launch
if (result) { refreshSharesFromDB(); stopLoadingAnimationAndShowShareContainer() }
else { stopLoadingAnimationAndShowShareContainer(); showError() }
}
```
## Moving DB/IO off the Main Thread
Wrap the blocking DB read in `withContext(Dispatchers.IO)` and hop back to `Main` to touch
adapters/views. This can be a *behaviour improvement* (fewer main-thread stalls) — flag it
to the developer if the Java version was doing DB work on the main thread synchronously,
since timing changes can be observable (e.g. tests that assumed synchronous population).
```kotlin
private suspend fun loadAndPartitionShares(): Pair<List<OCShare>, List<OCShare>> =
withContext(Dispatchers.IO) {
val shares = fileDataStorageManager?.getSharesWithForAFile(file?.remotePath, user?.accountName)
?: emptyList()
val (external, internal) = shares.filter { it.shareType != null }
.partition { it.shareType in externalShareTypes }
internal to external
}
```
## Pitfalls
- Never launch on `GlobalScope` — it outlives the screen and leaks.
- An ad-hoc `CoroutineScope(Dispatchers.Main)` created inside a service/presenter has the
same problem: no lifecycle owner, no cancellation, a leak. Use an injected scope or a
`suspend` function the caller runs on `lifecycleScope` / `viewModelScope`.
- Keep `try/catch` semantics: coroutine cancellation throws `CancellationException`;
rethrow it (don't swallow in a broad `catch (e: Exception)` that logs and continues) or
catch `Exception` only around the real work, not around the whole `launch`.
- Preserve exception-to-UI mapping exactly (same snackbar, same log tag/message).
@@ -0,0 +1,85 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Retiring Deprecated Android APIs During Conversion
A Java→Kotlin conversion is the right moment to replace deprecated Android APIs the IDE
converter leaves untouched. Each replacement below is behaviour-preserving. Examples are
real conversions (nextcloud/android PRs #16878, #16792).
## `startActivityForResult` / `onActivityResult` → Activity Result API
The request-code + `onActivityResult` protocol is deprecated. Register a launcher at
construction time and receive the result in its callback.
```kotlin
// BEFORE
startActivityForResult(action, SELECT_LOCATION_REQUEST_CODE)
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == SELECT_LOCATION_REQUEST_CODE && data != null) { handle(data) }
}
// AFTER
private val folderPickerLauncher = registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) { result ->
if (result.resultCode == Activity.RESULT_OK) {
handle(result.data)
}
}
// launch it:
folderPickerLauncher.launch(intent)
```
Type-safe, no manual request-code bookkeeping, and it survives process death because
registration is declarative. Register during initialization (a field initializer or
`onCreate`/`onViewCreated`) — never inside a click handler, or the registration is lost.
## `onCreateOptionsMenu` / `onOptionsItemSelected` → `MenuProvider`
`setHasOptionsMenu(true)` plus the two menu overrides are deprecated on `Fragment`. Add a
`MenuProvider` bound to the view lifecycle instead.
```kotlin
// AFTER
val menuHost: MenuHost = requireActivity()
menuHost.addMenuProvider(object : MenuProvider {
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) =
inflater.inflate(R.menu.gallery_menu, menu)
override fun onMenuItemSelected(item: MenuItem): Boolean = when (item.itemId) {
R.id.action_select_all -> { selectAll(); true }
else -> false
}
}, viewLifecycleOwner, Lifecycle.State.RESUMED)
```
Passing `viewLifecycleOwner` + `Lifecycle.State.RESUMED` auto-adds and removes the menu as
the view's lifecycle changes — no leak, no manual `setHasOptionsMenu`. (PR #16878)
## `java.util.Observable` — Keep or Migrate?
`java.util.Observable` / `Observer` are deprecated (Java 9+). But a conversion is
behaviour-locked, so **do not** silently swap the notification mechanism — existing Java
observers rely on `setChanged()` / `notifyObservers()`. PR #16792 deliberately KEPT it:
```kotlin
class UploadsStorageManager(...) : Observable() {
fun notifyObserversNow() {
Handler(Looper.getMainLooper()).post {
setChanged()
notifyObservers()
}
}
}
```
Migrating to `StateFlow` / `SharedFlow` changes the observation contract and every call
site — that is a separate, opt-in refactor, not part of a 1:1 conversion. Note the
deprecation, propose the flow migration as a follow-up, and keep the current mechanism
unless the developer scopes the larger change.
@@ -0,0 +1,115 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Fail Fast: Guard Clauses Over Nested `if`/`else`
The IDE preserves Java's nested-`if` pyramids. Invert them into guard clauses that return
(or throw) early, leaving the happy path at the lowest indentation. Behaviour is
identical — the branches are the same, only the shape changes.
## Precondition Checks → `require` / `requireNotNull`
`requireNotNull` returns the smart-cast non-null value AND throws
`IllegalArgumentException` with the message — exactly matching the Java `if (x == null)
throw new IllegalArgumentException(...)`.
```kotlin
// BEFORE
if (file == null) throw IllegalArgumentException("File may not be null");
if (user == null) throw IllegalArgumentException("Account may not be null");
fileActivity = (FileActivity) getActivity();
if (fileActivity == null) throw IllegalArgumentException("FileActivity may not be null");
// AFTER
fileActivity = activity as? FileActivity
requireNotNull(file) { "File may not be null" }
requireNotNull(user) { "Account may not be null" }
requireNotNull(fileActivity) { "FileActivity may not be null" }
```
Use `require(condition) { msg }` for boolean preconditions:
```kotlin
require(activity is FileActivity) { "Calling activity must be of type FileActivity" }
```
`check`/`checkNotNull` are the `IllegalStateException` equivalents — use them when the Java
threw `IllegalStateException`. Match the original exception type; that is observable
behaviour.
## Early Return Over Nested Success Path
```kotlin
// BEFORE
private void checkShareViaUser() {
if (!MDMConfig.INSTANCE.shareViaUser(requireContext())) {
binding.searchContainer.setVisibility(View.GONE);
}
}
// AFTER
private fun checkShareViaUser() {
if (shareViaUser(requireContext())) return
binding?.searchContainer?.visibility = View.GONE
}
```
## Deeply Nested `if`/`else` → Sequential Guards
The most valuable transformation. A cursor-handling method nested three levels deep
becomes a flat sequence of guard clauses, each handling one failure and returning.
```kotlin
// BEFORE: if (cursor != null) { if (moveToFirst()) { if (columnIndex != -1) {...} else ... } else ... } else ...
// AFTER
private fun handleContactResult(contactUri: Uri) {
val cursor = fileActivity?.contentResolver?.query(contactUri, projection, null, null, null)
if (cursor == null) {
DisplayUtils.showSnackMessage(this, R.string.email_pick_failed)
Log_OC.e(TAG, "Failed to pick email address as Cursor is null.")
return
}
if (!cursor.moveToFirst()) {
DisplayUtils.showSnackMessage(this, R.string.email_pick_failed)
Log_OC.e(TAG, "Failed to pick email address as no Email found.")
return
}
val columnIndex = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.ADDRESS)
if (columnIndex == -1) {
DisplayUtils.showSnackMessage(this, R.string.email_pick_failed)
Log_OC.e(TAG, "Failed to pick email address.")
cursor.close()
return
}
val email = cursor.getString(columnIndex)
// ... happy path at base indentation
cursor.close()
}
```
Watch the cleanup: if the Java relied on falling through to a single `cursor.close()`,
each early return must still close it (or wrap in `use {}`). Missing that changes
behaviour (resource leak) — verify it.
## Nullable-Guard Idioms
```kotlin
val activity = fileActivity ?: return
val clientRepository = activity.clientRepository ?: return
val remotePath = file?.remotePath ?: return
```
Each `?: return` collapses one Java `if (x == null) return;`. Chain them at the top of the
function so the body works with non-null smart-cast locals.
## When NOT to Invert
- Do not turn a genuine two-branch decision (both branches do real work) into a guard if
it obscures the symmetry — a `when`/`if-else` expression is clearer there.
- Do not change the *order* of side-effects while inverting; the snackbar/log calls above
must fire in the same cases as before.
@@ -0,0 +1,79 @@
# Project Conventions (Nextcloud Android)
Apply these during Step 2 so the converted file passes review and the quality gates. They
are enforced by `spotlessKotlinCheck`, `detekt`, `lint`, and `spotbugsGplayDebug`.
## SPDX Header (every new/renamed file)
The IDE keeps the old license block. Replace it with the current template. The year is the
year the Kotlin file is created. New contributions are `AGPL-3.0-or-later`; keep
`OR GPL-2.0-only` only if the original file carried it.
```kotlin
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: <YEAR> Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
```
If the developer wants personal attribution (as in the real conversion), the form
`SPDX-FileCopyrightText: <YEAR> <Name> <email>` is also used — match what the developer
asks for; default to the "Nextcloud GmbH and Nextcloud contributors" line.
## Structural Rules
- **≤300 lines per file.** If decomposition pushes past it, split responsibilities into
separate files/collaborators and tell the developer. A file/class-level
`@Suppress("LargeClass", "TooManyFunctions")` is a last resort for legacy god-classes.
- **≤120 columns per line.**
- **One top-level type per file.** Extract models, states, sealed classes, and listener
interfaces into their own files rather than nesting many types in one.
- **Exactly one trailing newline** at end of file.
## No Magic Numbers / Hardcoded Resources
- Extract literals into named `const val` in a `companion object`
(`MIN_SHOW_ALL_VISIBLE_ITEM_COUNT = 3`, `INTERNAL_LINK_PATH_PRETTY = "/f/"`).
- Strings, colors, dimens come from resources (`R.string.*`, `R.dimen.*`), never inline.
- Only `app/src/main/res/values/strings.xml` may be edited for strings; never touch
`values-*` translation folders.
## Comments & Naming
- No decorative divider comments (`// ==== ====`, `// ---- Title ----`). `// region` /
`// endregion` for IDE folding is allowed and should match the file's existing style.
- Names carry the explanation, not comments. If a name needs a comment to be understood,
rename or decompose instead. Do not add KDoc to a function just because it is new.
- Preserve genuinely informative Javadoc as KDoc (invariant 4); drop noise. A comment
earns its place only for a non-obvious invariant, a platform/server workaround, or an
ordering requirement — and it explains **why**, never **what**.
- Never narrate the conversion itself: no "was a Java thread, now a coroutine", no
"changed from X to Y", no references to the PR, the issue, or this conversation.
Comments describe the code as it stands. That history belongs in the commit message.
- Do not use multiple boolean flags to model state — use an `enum`/sealed class.
## Modern Java Interop
When the file still has Java callers, keep the Java-facing API clean:
`@JvmStatic` for factory/companion functions, `@JvmField` for exposed constants,
`@JvmOverloads` for defaulted params, `@Throws` for checked exceptions.
## Git & Commits (developer-driven)
- Preserve history: the rename `git mv Foo.java Foo.kt` should be a **separate commit**
from the content change so `git blame` follows through.
- Conventional Commits (`refactor(sharing): convert FileDetailSharingFragment to Kotlin`).
- Every AI-assisted commit needs an `Assisted-by: <agent>:<model>` trailer.
- Only the human contributor adds `Signed-off-by` (DCO). You must never add it, and never
open PRs/issues autonomously (AI policy).
## Quality Gate
```bash
./gradlew spotlessKotlinCheck detektGplayDebug lintGplayDebug spotbugsGplayDebug \
jacocoTestGplayDebugUnitTest
```
Fix every finding in the files you changed before declaring done.
@@ -0,0 +1,107 @@
# Behaviour-Locking Tests (Mandatory Step)
A conversion is not done until a test proves behaviour did not change. If the Java class
already had tests, they are your primary safety net — run them and keep them green. If it
had none, you must add a **characterization test** that pins the current behaviour so the
refactor is provably safe.
## Decision Tree
```dot
digraph test_choice {
rankdir=LR;
"What are you locking?" -> "Pure logic (no Android SDK)" [label="fn returns a value"];
"What are you locking?" -> "Component behaviour" [label="Fragment/Activity/DB/View"];
"Pure logic (no Android SDK)" -> "JVM unit test app/src/test/ (JUnit4 + mockito-kotlin)";
"Component behaviour" -> "Robolectric unit test (if project uses it)";
"Component behaviour" -> "Instrumented test app/src/androidTest/ extends base IT class";
}
```
**Prefer the seams you just created.** The idiomatic pass extracts pure functions
(link builders, permission math, partitioning, `isReshareForbidden`) specifically so they
can be unit-tested fast without a device. Test those first; they give the most behaviour
coverage per second.
## 1. JVM Unit Tests — Pure Functions
Location: `app/src/test/`. Fast, no emulator. Command:
`./gradlew jacocoTestGplayDebugUnitTest`.
Mark the function `@VisibleForTesting internal` so the test module can reach it while it
stays out of the public API.
```kotlin
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.owncloud.android.ui.fragment
import com.owncloud.android.lib.resources.status.OCCapability
import org.junit.Assert.assertEquals
import org.junit.Test
import org.mockito.kotlin.mock
import org.mockito.kotlin.whenever
class FileDetailSharingFragmentTest {
@Test
fun `internal link uses pretty path when modRewrite is on`() {
val user = mock<User> { whenever(it.server.uri).thenReturn(URI("https://cloud.example")) }
val file = mock<OCFile> { whenever(it.localId).thenReturn(42L) }
val caps = mock<OCCapability> { whenever(it.modRewriteWorking.isTrue).thenReturn(true) }
val link = FileDetailSharingFragment().createInternalLink(user, file, caps)
assertEquals("https://cloud.example/f/42", link)
}
@Test
fun `internal link falls back to index php path when modRewrite is off`() {
// ... same setup with modRewriteWorking.isTrue == false
// assertEquals("https://cloud.example/index.php/f/42", link)
}
}
```
The point: run this test's logic against **both** the pre-conversion and post-conversion
code paths mentally (or, if the Java is still on disk, literally) and confirm the assertion
holds for both. That is what "behaviour must not change" means concretely.
## 2. Instrumented Tests — Component Behaviour
Location: `app/src/androidTest/`. For Fragment/Activity/DB behaviour that needs the Android
runtime. Extend the project's base test class (`AbstractOnServerIT` when server
communication is required) and follow its conventions (separate test user, etc.).
```bash
./gradlew createGplayDebugCoverageReport -Pcoverage=true \
-Pandroid.testInstrumentationRunnerArguments.class=com.owncloud.android.ui.fragment.FileDetailSharingFragmentIT
```
Use `@VisibleForTesting` hooks the original exposed (e.g. a `search(query)` or
`showSharingMenuActionSheet(share)` method) to drive and assert UI state, exactly as the
existing IT suite does. Do not weaken visibility further than the Java original did.
## 3. What to Assert
Lock the observable contract, not the implementation:
- Same return values / thrown exception types for the same inputs (including the
`require`/`requireNotNull` messages if callers depend on them).
- Same Bundle keys, intent extras, and `newInstance` argument wiring.
- Same branch outcomes (e.g. "reshare forbidden when FEDERATED", "show-all button visible
only when > 3 shares").
- For coroutine conversions, assert the end state, and use the project's test dispatcher /
`runTest` so async work is deterministic — never assert on wall-clock timing.
## 4. Guardrails
- Every new test file gets the SPDX header and ends with exactly one trailing newline.
- Do not modify unrelated tests to make yours pass.
- Report actual test output. If a test reveals the conversion changed behaviour, fix the
conversion — do not adjust the test to match the drift.
- If a genuine pre-existing bug is uncovered, surface it to the developer separately; do
not fold a behaviour change into the conversion.
+1 -1
View File
@@ -1,4 +1,4 @@
FROM ubuntu:resolute@sha256:b7f48194d4d8b763a478a621cdc81c27be222ba2206ca3ca6bc42b49685f3d9e
FROM ubuntu:resolute@sha256:2260313b31c8c011cd2eebe728008efac1b3982be73eb71348ea2648d2c0e09b
ARG DEBIAN_FRONTEND=noninteractive
ENV ANDROID_HOME=/usr/lib/android-sdk
+1 -1
View File
@@ -23,4 +23,4 @@ B | A
## 🤖 AI (if applicable)
- [ ] The content of this PR was partly or fully generated using AI
- [ ] The content of this PR was partly or fully generated using AI (N/A)
Binary file not shown.
@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
-179
View File
@@ -1,179 +0,0 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: AI Policy
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [master, main]
permissions:
contents: read
# Required to add the "AI assisted" label via `gh pr edit --add-label`
pull-requests: write
# Required to create the "AI assisted" label via the REST labels endpoint
# (labels are an issues-scoped resource in the GitHub API)
issues: write
concurrency:
group: ai-policy-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check-ai-trailers:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- name: Collect PR commit messages
id: collect
env:
BASE_REF: ${{ github.base_ref }}
run: |
set -euo pipefail
git fetch origin "${BASE_REF}"
MERGE_BASE=$(git merge-base "origin/${BASE_REF}" HEAD)
git log --format="%B" "${MERGE_BASE}..HEAD" > /tmp/pr_commits.txt
echo "--- PR commit messages ---"
cat /tmp/pr_commits.txt
echo "--------------------------"
- name: Define shared agent detection patterns
run: |
set -euo pipefail
# Email addresses known to be used by coding agents.
# These should never appear in Signed-off-by because the DCO can only be attested by a human.
EMAIL_PATTERN="copilot@github\.com\
|noreply@anthropic\.com\
|devin@cognition\.ai\
|devin@cognition-labs\.com\
|aider@aider\.chat\
|noreply@aider\.chat\
|codex@openai\.com\
|cursor@anysphere\.com\
|windsurf@codeium\.com\
|codeium@codeium\.com\
|amazon-q@amazon\.com\
|codewhisperer@amazon\.com\
|gemini-code-assist@google\.com\
|openhands@all-hands\.dev\
|swe-agent@princeton\.edu"
# Strip embedded whitespace (used above only for readability)
EMAIL_PATTERN=$(echo "$EMAIL_PATTERN" | tr -d ' \n')
echo "AGENT_EMAIL_PATTERN=${EMAIL_PATTERN}" >> "$GITHUB_ENV"
# Display-name prefixes used by known coding agents (shared by Signed-off-by and Co-Authored-By checks)
# shellcheck disable=SC2016
echo 'AGENT_NAMES=GitHub Copilot|Claude( [A-Za-z0-9. -]+)?|Devin( AI)?|aider( \(.*\))?|OpenAI Codex|Cursor( AI)?|Windsurf|Amazon Q|CodeWhisperer|Gemini Code Assist|OpenHands|SWE-agent|AutoCodeRover|Tabnine' >> "$GITHUB_ENV"
- name: Check for AI-assistant / Assisted-by trailers
id: ai_trailers
run: |
set -euo pipefail
AI_ASSISTED=false
if grep -qiE '^(AI-assistant|Assisted-by):' /tmp/pr_commits.txt; then
AI_ASSISTED=true
echo "Found AI-assistant/Assisted-by trailer(s):"
grep -iE '^(AI-assistant|Assisted-by):' /tmp/pr_commits.txt
fi
echo "ai_assisted=${AI_ASSISTED}" >> "$GITHUB_OUTPUT"
- name: Check for coding-agent Signed-off-by trailers
id: agent_signoff
run: |
set -euo pipefail
EMAIL_HITS=$(grep -iE "^Signed-off-by:.*<(${AGENT_EMAIL_PATTERN})>" /tmp/pr_commits.txt 2>/dev/null || true)
NAME_HITS=$(grep -iE "^Signed-off-by: *(${AGENT_NAMES}) *[<(]" /tmp/pr_commits.txt 2>/dev/null || true)
AGENT_LINES=$(printf '%s\n%s' "$EMAIL_HITS" "$NAME_HITS" | sort -u | sed '/^[[:space:]]*$/d')
AGENT_SIGNOFF=false
if [ -n "$AGENT_LINES" ]; then
AGENT_SIGNOFF=true
fi
echo "agent_signoff=${AGENT_SIGNOFF}" >> "$GITHUB_OUTPUT"
{
echo "agent_lines<<AGENT_EOF"
echo "${AGENT_LINES}"
echo "AGENT_EOF"
} >> "$GITHUB_OUTPUT"
- name: Check for coding-agent Co-Authored-By trailers
id: co_authored
run: |
set -euo pipefail
EMAIL_HITS=$(grep -iE "^Co-Authored-By:.*<(${AGENT_EMAIL_PATTERN})>" /tmp/pr_commits.txt 2>/dev/null || true)
NAME_HITS=$(grep -iE "^Co-Authored-By: *(${AGENT_NAMES}) *[<(]" /tmp/pr_commits.txt 2>/dev/null || true)
CO_AUTHORED=false
if [ -n "$EMAIL_HITS" ] || [ -n "$NAME_HITS" ]; then
CO_AUTHORED=true
echo "Found coding-agent Co-Authored-By trailer(s):"
printf '%s\n%s' "$EMAIL_HITS" "$NAME_HITS" | sort -u | sed '/^[[:space:]]*$/d'
fi
echo "co_authored=${CO_AUTHORED}" >> "$GITHUB_OUTPUT"
- name: Create 'AI assisted' label if absent
if: steps.ai_trailers.outputs.ai_assisted == 'true' || steps.agent_signoff.outputs.agent_signoff == 'true' || steps.co_authored.outputs.co_authored == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api "repos/${{ github.repository }}/labels" \
--method POST \
-f name="AI assisted" \
-f color="d93f0b" \
-f description="This PR contains AI-assisted commits" \
2>/dev/null || true
- name: Label PR as AI assisted
if: steps.ai_trailers.outputs.ai_assisted == 'true' || steps.agent_signoff.outputs.agent_signoff == 'true' || steps.co_authored.outputs.co_authored == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr edit "${{ github.event.pull_request.number }}" \
--repo "${{ github.repository }}" \
--add-label "AI assisted"
echo "Added 'AI assisted' label to PR #${{ github.event.pull_request.number }}"
- name: Fail on coding-agent Signed-off-by
if: steps.agent_signoff.outputs.agent_signoff == 'true'
env:
AGENT_LINES: ${{ steps.agent_signoff.outputs.agent_lines }}
AGENTS_MD_URL: https://github.com/${{ github.repository }}/blob/${{ github.base_ref }}/AGENTS.md
run: |
echo "::error title=Coding-agent sign-off detected::A Signed-off-by trailer from a known coding agent was found in one or more commits."
echo ""
echo "Offending trailer(s):"
echo "${AGENT_LINES}"
echo ""
echo "The 'Signed-off-by' trailer represents the Developer Certificate of Origin (DCO)"
echo "and must only be attested by a human contributor."
echo "Please amend the affected commit(s) to remove the coding-agent sign-off"
echo "and replace it with an 'Assisted-by' trailer, for example:"
echo ""
echo " Assisted-by: Claude Code:claude-sonnet-4-6"
echo ""
echo "References:"
echo " • AGENTS.md (this repository)"
echo " ${AGENTS_MD_URL}"
echo " • AI Contribution Policy"
echo " https://github.com/nextcloud/.github/blob/master/AI_POLICY.md"
echo " • Contribution Guidelines"
echo " https://github.com/nextcloud/.github/blob/master/CONTRIBUTING.md"
exit 1
-76
View File
@@ -1,76 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
# SPDX-FileCopyrightText: 2023 Tobias Kaminsky <[email protected]>
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <[email protected]>
# SPDX-FileCopyrightText: 2023 Josh Richards <[email protected]>
# SPDX-FileCopyrightText: 2025 Marcel Hibbe <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: "Analysis"
on:
pull_request:
branches: [ "master", "main", "stable-*" ]
push:
branches: [ "master", "main", "stable-*" ]
permissions:
pull-requests: write
contents: write
concurrency:
group: analysis-wrapper-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
analysis:
runs-on: ubuntu-latest
steps:
- name: Disabled on forks
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
run: |
echo 'Can not analyze PRs from forks'
exit 1
- name: Setup variables # zizmor: ignore[template-injection]
id: get-vars
run: |
if [ -z "$GITHUB_HEAD_REF" ]; then
# push
{
echo "branch=$GITHUB_REF_NAME"
echo "pr=$GITHUB_RUN_ID"
echo "repo=${{ github.repository }}"
} >> "$GITHUB_OUTPUT"
else
# pull request
{
echo "branch=$GITHUB_HEAD_REF"
echo "pr=${{ github.event.pull_request.number }}"
echo "repo=${{ github.event.pull_request.head.repo.full_name }}"
} >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
repository: ${{ steps.get-vars.outputs.repo }}
ref: ${{ steps.get-vars.outputs.branch }}
- name: Set up JDK 21
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
with:
distribution: "temurin"
java-version: 21
- name: Install dependencies
run: |
sudo apt install python3-defusedxml
- name: Run analysis wrapper
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p "$HOME/.gradle"
{
echo "org.gradle.jvmargs=-Xmx1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
echo "org.gradle.configureondemand=true"
} > "$HOME/.gradle/gradle.properties"
scripts/analysis/analysis-wrapper.sh "${{ steps.get-vars.outputs.branch }}" "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" "$GITHUB_RUN_NUMBER" "${{ steps.get-vars.outputs.pr }}"
+46 -16
View File
@@ -5,7 +5,7 @@ name: "Assemble"
on:
pull_request:
branches: [ master, stable-* ]
branches: [master, stable-*]
# Declare default permissions as read only.
permissions: read-all
@@ -15,24 +15,54 @@ concurrency:
cancel-in-progress: true
jobs:
compile:
runs-on: ubuntu-latest-max
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: set up JDK 21
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: "temurin"
java-version: 21
- name: compile
run: |
echo "org.gradle.dependency.verification=lenient" >> gradle.properties
echo "org.gradle.jvmargs=-Xmx10g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" >> gradle.properties
echo "org.gradle.caching=true" >> gradle.properties
echo "org.gradle.parallel=true" >> gradle.properties
echo "org.gradle.configureondemand=true" >> gradle.properties
- uses: gradle/actions/wrapper-validation@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
- name: Gradle Cache
uses: burrunan/gradle-cache-action@404534c34a2faa40430357a3183522a845b04f3b # v3.0.3
with:
job-id: assemble
arguments: assembleGeneric
flavor:
runs-on: ubuntu-latest
needs: [compile]
strategy:
fail-fast: false
matrix:
flavor: [ Generic, Gplay, Huawei ]
flavor: [Generic, Gplay, Huawei]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: set up JDK 21
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
with:
distribution: "temurin"
java-version: 21
- uses: gradle/actions/wrapper-validation@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
- name: Build ${{ matrix.flavor }}
run: |
echo "org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" >> gradle.properties
echo "org.gradle.caching=true" >> gradle.properties
echo "org.gradle.parallel=true" >> gradle.properties
echo "org.gradle.configureondemand=true" >> gradle.properties
./gradlew assemble${{ matrix.flavor }}
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: set up JDK 21
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: "temurin"
java-version: 21
- uses: gradle/actions/wrapper-validation@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
- name: compile
run: |
echo "org.gradle.dependency.verification=lenient" >> gradle.properties
echo "org.gradle.jvmargs=-Xmx10g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" >> gradle.properties
echo "org.gradle.caching=true" >> gradle.properties
echo "org.gradle.parallel=true" >> gradle.properties
echo "org.gradle.configureondemand=true" >> gradle.properties
- uses: gradle/actions/wrapper-validation@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
- name: Gradle Cache
uses: burrunan/gradle-cache-action@404534c34a2faa40430357a3183522a845b04f3b # v3.0.3
with:
job-id: assemble
arguments: assemble${{ matrix.flavor }}
-40
View File
@@ -1,40 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Álvaro Brey <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: Auto approve sync
on:
pull_request_target: # zizmor: ignore[dangerous-triggers]
branches:
- master
- main
types:
- opened
- reopened
- synchronize
- labeled
concurrency:
group: sync-approve-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
pull-requests: write
jobs:
auto-approve:
name: Auto approve sync
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'sync') && github.actor == 'nextcloud-android-bot' }}
steps:
- name: Disabled on forks
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
run: |
echo 'Can not approve PRs from forks'
exit 1
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
-32
View File
@@ -1,32 +0,0 @@
# SPDX-FileCopyrightText: 2020-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
name: Check
on:
pull_request:
branches: [ master, stable-* ]
# Declare default permissions as read only.
permissions: read-all
concurrency:
group: check-kotlin-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
task: [ detekt, spotlessKotlinCheck, lint ]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up JDK 21
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
with:
distribution: "temurin"
java-version: 21
- name: Check ${{ matrix.task }}
run: ./gradlew ${{ matrix.task }}
-60
View File
@@ -1,60 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023-2024 Andy Scherzinger <[email protected]>
# SPDX-FileCopyrightText: 2022 Tobias Kaminsky <[email protected]>
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
# SPDX-FileCopyrightText: 2025 Marcel Hibbe <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: "CodeQL"
on:
push:
branches: [ "master", "main", "stable-*" ]
pull_request:
branches: [ "master", "main" ]
schedule:
- cron: '24 18 * * 3'
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'java' ]
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Set Swap Space
if: runner.environment == 'github-hosted'
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # v1.0
with:
swap-size-gb: 10
- name: Initialize CodeQL
uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
with:
languages: ${{ matrix.language }}
- name: Set up JDK 21
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
with:
distribution: "temurin"
java-version: 21
- name: Assemble
run: |
mkdir -p "$HOME/.gradle"
echo "org.gradle.jvmargs=-Xmx3g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
./gradlew --no-daemon assembleDebug
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
-86
View File
@@ -1,86 +0,0 @@
#!/bin/sh
# Nextcloud Android Library
#
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
#
if [ $1 = "master" ]; then
SERVER_VERSION_MAIN="main"
SERVER_VERSION_MASTER="master"
else
SERVER_VERSION_MAIN=$1
SERVER_VERSION_MASTER=$1
fi
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
. ~/.bashrc; nvm install node
php /var/www/html/occ log:manage --level warning
OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1
OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2
OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3
OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test@Test' test@test
OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test Spaces' 'test test'
php /var/www/html/occ user:setting user2 files quota 1G
php /var/www/html/occ group:add users
php /var/www/html/occ group:adduser users user1
php /var/www/html/occ group:adduser users user2
php /var/www/html/occ group:adduser users test
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/activity.git /var/www/html/apps/activity/
php /var/www/html/occ app:enable -f activity
git clone --depth=1 -b $SERVER_VERSION_MAIN https://github.com/nextcloud/text.git /var/www/html/apps/text/
php /var/www/html/occ app:enable -f text
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/end_to_end_encryption.git /var/www/html/apps/end_to_end_encryption/
php /var/www/html/occ app:enable -f end_to_end_encryption
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/password_policy.git /var/www/html/apps/password_policy/
php /var/www/html/occ app:enable -f password_policy
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/external.git /var/www/html/apps/external/
cd /var/www/html/apps/external; composer install --no-dev
php /var/www/html/occ app:enable -f external
php /var/www/html/occ config:app:set external sites --value="{\"1\":{\"id\":1,\"name\":\"Nextcloud\",\"url\":\"https:\/\/www.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false},\"2\":{\"id\":2,\"name\":\"Forum\",\"url\":\"https:\/\/help.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false}}"
git clone --depth=1 -b $SERVER_VERSION_MAIN https://github.com/nextcloud/files_lock.git /var/www/html/apps/files_lock/
php /var/www/html/occ app:enable -f files_lock
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/
cd /var/www/html/apps/notifications; composer install --no-dev
php /var/www/html/occ app:enable -f notifications
if [ $1 = 'stable22' ]; then
php /var/www/html/occ notification:generate test test
else
php /var/www/html/occ notification:generate test -d test
fi
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/photos.git /var/www/html/apps/photos/
cd /var/www/html/apps/photos; composer install --no-dev
php /var/www/html/occ app:enable -f photos
git clone --depth=1 -b $SERVER_VERSION_MAIN https://github.com/nextcloud/assistant.git /var/www/html/apps/assistant/
cd /var/www/html/apps/assistant; . ~/.bashrc; make
php /var/www/html/occ app:enable -f assistant
php /var/www/html/occ app:enable -f testing
git clone --depth 1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/files_downloadlimit.git /var/www/html/apps/files_downloadlimit/
php /var/www/html/occ app:enable -f files_downloadlimit
git clone --depth 1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/recommendations.git /var/www/html/apps/recommendations/
cd /var/www/html/apps/recommendations; composer install --no-dev
php /var/www/html/occ app:enable -f recommendations
git clone --depth 1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/viewer.git /var/www/html/apps/viewer/
php /var/www/html/occ app:enable -f viewer
php /var/www/html/occ config:system:set ratelimit.protection.enabled --value false --type bool
-20
View File
@@ -1,20 +0,0 @@
#!/bin/sh
# Nextcloud Android Library
#
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
#
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
apt-get update && apt-get install -y composer
mkdir /var/www/.nvm /var/www/.npm
mkdir /var/www/.cache/
touch /var/www/.bashrc
chown -R 33:33 /var/www/.nvm /var/www/.npm /var/www/.bashrc /var/www/.cache
cd /var/www/html/
rm data -rf
rm config/config.php
su www-data -c "git reset --hard"
BRANCH="$1" /usr/local/bin/initnc.sh
-43
View File
@@ -1,43 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <[email protected]>
# SPDX-FileCopyrightText: 2022 Tobias Kaminsky <[email protected]>
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: "Detect new java files"
on:
pull_request:
branches: [ master, main, stable-* ]
permissions: read-all
concurrency:
group: detect-new-java-files-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
detectNewJavaFiles:
runs-on: ubuntu-latest
steps:
- id: file_changes
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b # v1.2.4
with:
output: ','
- name: Detect new java files
run: |
if [ -z '${{ steps.file_changes.outputs.files_added }}' ]; then
echo "No new files added"
exit 0
fi
new_java=$(echo '${{ steps.file_changes.outputs.files_added }}' | tr ',' '\n' | grep '\.java$' | cat)
if [ -n "$new_java" ]; then
# shellcheck disable=SC2016
printf 'New java files detected:\n```\n%s\n```\n' "$new_java" | tee "$GITHUB_STEP_SUMMARY"
exit 1
else
echo "No new java files detected"
exit 0
fi
-30
View File
@@ -1,30 +0,0 @@
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Tobias Kaminsky <[email protected]>
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
name: "Detect wrong settings"
on:
pull_request:
branches: [ master, stable-* ]
# Declare default permissions as read only.
permissions: read-all
concurrency:
group: detect-wrong-settings-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
detectWrongSettings:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up JDK 21
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
with:
distribution: "temurin"
java-version: 21
- name: Detect SNAPSHOT
run: scripts/analysis/detectWrongSettings.sh
-107
View File
@@ -1,107 +0,0 @@
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: "Garm"
on:
pull_request:
branches: [ master, stable-* ]
permissions:
contents: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-24.04
services:
server:
image: ${{ matrix.server == 'stable22' && 'ghcr.io/nextcloud/continuous-integration-shallow-server-php8.0:1' || 'ghcr.io/nextcloud/continuous-integration-shallow-server-php8.3:latest' }}
options: --name server
ports:
- 80:80
strategy:
fail-fast: false
matrix:
server: [ master ] # [ stable22, stable33, master ]
api-level: [ 29 ] # [ 21, 36 ]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: configure server
run: |
sudo apt-get update && sudo apt-get install unzip cpu-checker qemu-kvm --yes
sudo chmod 666 /dev/kvm
docker cp .github/workflows/configServer.sh server:/tmp/
docker exec server chmod +x /tmp/configServer.sh
docker exec server /tmp/configServer.sh ${{ matrix.server }}
docker cp .github/workflows/configNC.sh server:/tmp/
docker exec server chmod +x /tmp/configNC.sh
docker exec --user www-data server /tmp/configNC.sh ${{ matrix.server }}
docker exec server /usr/local/bin/run.sh
- name: set up JDK 21
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
with:
distribution: "temurin"
java-version: 21
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Configure gradle daemon
run: |
mkdir -p $HOME/.gradle
echo "org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" >> $HOME/.gradle/gradle.properties
echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties
echo "org.gradle.parallel=true" >> $HOME/.gradle/gradle.properties
echo "org.gradle.configureondemand=true" >> $HOME/.gradle/gradle.properties
- name: Config gplay
run: |
sed -i s#http://server#http://10.0.2.2# gradle.properties
sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g app/src/main/res/values/setup.xml
- name: wait and ping server
run: |
while ! curl http://localhost/status.php 2>&1 | grep installed; do
echo "wait…"
sleep 5
done
- name: gplay
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
with:
api-level: ${{ matrix.api-level }}
cmake: 4.1.2
force-avd-creation: false
arch: x86_64
sdcard-path-or-size: 100M
target: google_apis
emulator-options: -no-metrics -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
script: scripts/runCombinedTest.sh ${{github.event.number}} ${{ secrets.LOG_USERNAME }} ${{ secrets.LOG_PASSWORD }} ${{github.event.number}} ${{ matrix.server }}
- name: upload failing results
if: ${{ failure() }}
env:
LOG_USERNAME: ${{ secrets.LOG_USERNAME }}
LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }}
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} ${{ matrix.server }} "IT" ${{github.event.number}}
- name: Archive Espresso results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ always() }}
with:
name: Report-${{ matrix.server }}-${{ matrix.api-level }}
path: app/build/reports
retention-days: 4
-27
View File
@@ -1,27 +0,0 @@
#!/usr/bin/env bash
#
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
# SPDX-License-Identifier: AGPL-3.0-or-later
#
## This file is intended to be sourced by other scripts
function err() {
echo >&2 "$@"
}
function curl_gh() {
if [[ -n "$GITHUB_TOKEN" ]]
then
curl \
--silent \
--header "Authorization: token $GITHUB_TOKEN" \
"$@"
else
err "WARNING: No GITHUB_TOKEN found. Skipping API call"
fi
}
-2
View File
@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2019-2025 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
-39
View File
@@ -1,39 +0,0 @@
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Lint translation files
on:
pull_request:
branches: [ master, main, stable-* ]
push:
branches: [ master, main, stable-* ]
permissions:
contents: read
concurrency:
group: lint-php-cs-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest-low
name: translations-string-xml
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Check for new lines in translation strings
id: counter
run: |
grep -P '<string name' app/src/main/res/values/strings.xml | grep -vcP '</string>' | grep '^0$'
- name: Output
if: failure()
run: |
grep -P '<string name' app/src/main/res/values/strings.xml | grep -vP '</string>'
-55
View File
@@ -1,55 +0,0 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Marcel Klehr <[email protected]>
# SPDX-FileCopyrightText: 2023 Joas Schilling <[email protected]>
# SPDX-FileCopyrightText: 2023 Daniel Kesselberg <[email protected]>
# SPDX-FileCopyrightText: 2023 Florian Steffens <[email protected]>
# SPDX-License-Identifier: MIT
name: 'Ask for feedback on PRs'
on:
schedule:
- cron: '30 1 * * *'
permissions:
contents: read
pull-requests: write
jobs:
pr-feedback:
if: ${{ github.repository_owner == 'nextcloud' }}
runs-on: ubuntu-latest
steps:
- name: The get-github-handles-from-website action
uses: marcelklehr/get-github-handles-from-website-action@06b2239db0a48fe1484ba0bfd966a3ab81a08308 # v1.0.1
id: scrape
with:
website: 'https://nextcloud.com/team/'
- name: Get blocklist
id: blocklist
run: |
blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -)
echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT"
- uses: nextcloud/pr-feedback-action@4709fa5b3e1821559d4c312ef937b61f1567aa44 # main
with:
feedback-message: |
Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.
We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.
Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6
Thank you for contributing to Nextcloud and we hope to hear from you soon!
(If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).)
days-before-feedback: 14
start-date: '2024-04-30'
exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}'
exempt-bots: true
-85
View File
@@ -1,85 +0,0 @@
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <[email protected]>
# SPDX-License-Identifier: MIT
name: "QA"
on:
pull_request:
branches: [ main, master, stable-* ]
permissions:
pull-requests: write
contents: read
concurrency:
group: qa-build-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
qa:
runs-on: ubuntu-latest
steps:
- name: Check if secrets are available
run: echo "ok=${{ secrets.KS_PASS != '' }}" >> "$GITHUB_OUTPUT"
id: check-secrets
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
with:
persist-credentials: false
- name: set up JDK 21
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
with:
distribution: "temurin"
java-version: 21
- name: Build QA
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
env:
KS_PASS: ${{ secrets.KS_PASS }}
KEY_PASS: ${{ secrets.KEY_PASS }}
LOG_USERNAME: ${{ secrets.LOG_USERNAME }}
LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p "$HOME/.gradle"
echo "org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" > "$HOME/.gradle/gradle.properties"
echo "org.gradle.caching=true; org.gradle.parallel=true; org.gradle.configureondemand=true" >> "$HOME/.gradle/gradle.properties"
[ -e app/build.gradle ] && sed -i "/qa/,/\}/ s/versionCode .*/versionCode ${{github.event.number}} /" "app/build.gradle"
[ -e app/build.gradle ] && sed -i "/qa/,/\}/ s/versionName .*/versionName \"${{github.event.number}}\"/" "app/build.gradle"
[ -e app/build.gradle.kts ] && sed -i "/qa/,/\}/ s/versionCode .*/versionCode = ${{github.event.number}} /" "app/build.gradle.kts"
[ -e app/build.gradle.kts ] && sed -i "/qa/,/\}/ s/versionName .*/versionName = \"${{github.event.number}}\"/" "app/build.gradle.kts"
./gradlew assembleQaDebug
$(find /usr/local/lib/android/sdk/build-tools/*/apksigner | sort | tail -n1) sign --ks-pass pass:"$KS_PASS" --key-pass pass:"$KEY_PASS" --ks-key-alias key0 --ks ".github/workflows/QA_keystore.jks" app/build/outputs/apk/qa/debug/*qa-debug*.apk
- name: Upload APK
id: upload-apk
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
path: app/build/outputs/apk/qa/debug/*qa-debug*.apk
retention-days: 7
archive: false
- name: Create QR Code
run: |
sudo apt-get -y install qrencode
qrencode -o qr.png "${{ steps.upload-apk.outputs.artifact-url }}"
- name: Upload QR
id: upload-qr
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
path: qr.png
retention-days: 7
archive: false
- name: Comment PR
uses: thollander/actions-comment-pull-request@e4a76dd2b0a3c2027c3fd84147a67c22ee4c90fa
with:
message: |
APK file: ${{ steps.upload-apk.outputs.artifact-url }}
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
![qrcode](${{ steps.upload-qr.outputs.artifact-url }}) (please click on link to get QR code displayed)
@@ -1,61 +0,0 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Auto approve renovate PRs
on:
pull_request_target: # zizmor: ignore[dangerous-triggers]
branches:
- main
- master
- stable*
permissions:
contents: read
concurrency:
group: renovate-approve-merge-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
auto-approve-merge:
if: github.event.pull_request.user.login == 'renovate[bot]'
runs-on: ubuntu-latest
permissions:
# for hmarr/auto-approve-action to approve PRs
pull-requests: write
steps:
- name: Disabled on forks
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
run: |
echo 'Can not approve PRs from forks'
exit 1
- uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0
id: branchname
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# GitHub actions bot approve
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
if: github.actor == 'renovate[bot]'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ github.head_ref }}
# Enable GitHub auto merge
- name: Enable Pull Request Automerge
if: github.actor == 'renovate[bot]'
run: gh pr merge --merge --auto
env:
GH_TOKEN: ${{ secrets.AUTOMERGE }}
-27
View File
@@ -1,27 +0,0 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
#
# SPDX-License-Identifier: CC0-1.0
name: REUSE Compliance Check
on: [pull_request]
permissions:
contents: read
jobs:
reuse-compliance-check:
runs-on: ubuntu-latest-low
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: REUSE Compliance Check
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0
-47
View File
@@ -1,47 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: Scorecard supply-chain security
on:
branch_protection_rule:
schedule:
- cron: '32 23 * * 4'
push:
branches: [ "main", "master" ]
# Declare default permissions as read only.
permissions: read-all
concurrency:
group: scorecard-supply-chain-security-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
steps:
- name: "Checkout code"
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
publish_results: false
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
with:
sarif_file: results.sarif
-109
View File
@@ -1,109 +0,0 @@
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
name: "Screenshot Test"
on:
pull_request:
branches: [ master, stable-* ]
permissions:
contents: read
pull-requests: write
concurrency:
group: screenshot-test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
screenshot:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
scheme: [ Light ]
color: [ blue ]
api-level: [ 28 ]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Gradle cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: AVD cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
with:
distribution: "temurin"
java-version: 21
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
arch: x86
sdcard-path-or-size: 100M
target: google_apis
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
script: echo "Generated AVD snapshot for caching."
- name: Configure gradle daemon
run: |
mkdir -p $HOME/.gradle
echo "org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" > $HOME/.gradle/gradle.properties
echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties
echo "org.gradle.parallel=true" >> $HOME/.gradle/gradle.properties
echo "org.gradle.configureondemand=true" >> $HOME/.gradle/gradle.properties
- name: Build generic flavor
run: ./gradlew assembleGenericDebug
- name: Delete old comments
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ always() }}
run: scripts/deleteOldComments.sh "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}}
- name: Run screenshot tests
env:
SHOT_TEST: "true"
uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
arch: x86
sdcard-path-or-size: 100M
target: google_apis
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
script: ./gradlew uninstallAll genericDebugExecuteScreenshotTests -Dorg.gradle.jvmargs="--add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio.channels=ALL-UNNAMED --add-exports java.base/sun.nio.ch=ALL-UNNAMED" -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest -Pandroid.testInstrumentationRunnerArguments.COLOR=${{ matrix.color }} -Pandroid.testInstrumentationRunnerArguments.DARKMODE=${{ matrix.scheme }}
- name: upload failing results
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}}
- name: Archive Espresso results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ always() }}
with:
name: Report-${{ matrix.color }}-${{ matrix.scheme }}
path: app/build/reports
retention-days: 4
-35
View File
@@ -1,35 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Tobias Kaminsky <[email protected]>
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: 'Close stale issues'
on:
schedule:
- cron: '0 0 * * *'
# Declare default permissions as read only.
permissions: read-all
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
with:
days-before-stale: 28
days-before-close: 14
days-before-pr-close: -1
only-labels: 'bug,needs info'
exempt-issue-labels: 'no-stale'
stale-issue-message: >-
This bug report did not receive an update in the last 4 weeks.
Please take a look again and update the issue with new details,
otherwise the issue will be automatically closed in 2 weeks. Thank you!
exempt-all-pr-milestones: true
labels-to-remove-when-unstale: 'needs info'
-64
View File
@@ -1,64 +0,0 @@
# SPDX-FileCopyrightText: 2022-2025 Nextcloud GmbH and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
name: Unit tests
on:
pull_request:
branches: [ master, stable-* ]
push:
branches: [ master, stable-* ]
permissions:
contents: read
pull-requests: write
concurrency:
group: unit-tests-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up JDK 21
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
with:
distribution: "temurin"
java-version: 21
- name: Delete old comments
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ always() }}
run: scripts/deleteOldComments.sh "test" "Unit" ${{github.event.number}}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
- name: Run unit tests with coverage
run: ./gradlew jacocoTestGplayDebugUnitTest
- name: Upload failing results
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "test" "Unit" ${{github.event.number}}
- name: Upload coverage to codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
fail_ci_if_error: true
files: app/build/reports/jacoco/jacocoTestGplayDebugUnitTestReport/jacoco.xml
- name: Upload jacoco artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-results
path: app/build/reports/jacoco/jacocoTestGplayDebugUnitTestReport/html/
-44
View File
@@ -1,44 +0,0 @@
#!/usr/bin/env bash
#
# SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2019-2022 Tobias Kaminsky <[email protected]>
# SPDX-License-Identifier: AGPL-3.0-or-later
#
#1: LOG_USERNAME
#2: LOG_PASSWORD
#3: DRONE_BUILD_NUMBER
#4: DRONE_PULL_REQUEST
PUBLIC_URL=https://www.kaminsky.me/nc-dev/android-artifacts
USER=$1
PASS=$2
BUILD=$3
PR=$4
GITHUB_TOKEN=$5
DAV_URL=https://nextcloud.kaminsky.me/remote.php/dav/files/$USER/android-artifacts/
source .github/workflows/lib.sh
REPO=$(cat scripts/repo)
if ! test -e app/build/outputs/apk/qa/debug/*qa-debug*.apk ; then
exit 1
fi
echo "Uploaded artifact to $DAV_URL/$BUILD.apk"
# delete all old comments, starting with "APK file:"
oldComments=$(curl_gh -X GET https://api.github.com/repos/nextcloud/$REPO/issues/$PR/comments | jq '.[] | (.id |tostring) + "|" + (.user.login | test("github-actions") | tostring) + "|" + (.body | test("APK file:.*") | tostring)' | grep "true|true" | tr -d "\"" | cut -f1 -d"|")
echo $oldComments | while read comment ; do
curl_gh -X DELETE https://api.github.com/repos/nextcloud/$REPO/issues/comments/$comment
done
sudo apt-get -y install qrencode
qrencode -o $PR.png "$PUBLIC_URL/$BUILD.apk"
curl -u $USER:$PASS -X PUT $DAV_URL/$BUILD.apk --upload-file app/build/outputs/apk/qa/debug/*qa-debug*.apk
curl -u $USER:$PASS -X PUT $DAV_URL/$BUILD.png --upload-file $PR.png
curl_gh -X POST https://api.github.com/repos/nextcloud/$REPO/issues/$PR/comments -d "{ \"body\" : \"APK file: $PUBLIC_URL/$BUILD.apk <br/><br/> ![qrcode]($PUBLIC_URL/$BUILD.png) <br/><br/>To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app. \" }"
-25
View File
@@ -2,31 +2,6 @@
<code_scheme name="Project" version="173">
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="android" withSubpackages="true" static="false" />
<emptyLine />
<package name="com" withSubpackages="true" static="false" />
<emptyLine />
<package name="junit" withSubpackages="true" static="false" />
<emptyLine />
<package name="net" withSubpackages="true" static="false" />
<emptyLine />
<package name="org" withSubpackages="true" static="false" />
<emptyLine />
<package name="java" withSubpackages="true" static="false" />
<emptyLine />
<package name="javax" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="true" />
<emptyLine />
</value>
</option>
<option name="RIGHT_MARGIN" value="120" />
<JavaCodeStyleSettings>
<option name="IMPORT_LAYOUT_TABLE">
+30 -2
View File
@@ -30,6 +30,13 @@ Java, Kotlin, XML, Jetpack Compose are the key technologies used for building th
- `./app/src/test/` Unit tests (small, isolated tests without Android SDK)
- `./app/src/androidTest/` Instrumented tests (require Android SDK)
- `./app/src/main/res/values/` Translations. Only update `./app/src/main/res/values/strings.xml`. Do not modify any other translation files or folders. Ignore all `values-*` directories (e.g., `values-es`, `values-fr`).
- `./.claude/skills/` Reusable agent skills. Each subdirectory is one skill with a `SKILL.md` entry point plus `references/` and `assets/`.
## Agent Skills
Project-specific skills live in `./.claude/skills/<skill-name>/`. Load a skill when the task matches its trigger.
- **`android-java-to-kotlin`** (`./.claude/skills/android-java-to-kotlin/SKILL.md`) — Completes a Java-to-Kotlin conversion in this Android app. Use it when finishing a conversion, when the user mentions "java to kotlin", "j2k", "convert java", or "make it idiomatic", or when a freshly IDE-converted `.kt` file needs cleanup. The workflow is two-person: the developer first runs the Android Studio converter (`Code > Convert Java File to Kotlin File`), then the agent drives the idiomatic second pass — fail-fast control flow, function decomposition, `lifecycleScope`/coroutines instead of Java threads, modern Android APIs, and project conventions (SPDX headers, no magic numbers, `@JvmStatic`). The conversion must preserve behaviour, and the agent must write a behaviour-locking test before declaring it done.
## General Guidance
@@ -178,9 +185,7 @@ All contributions generated or assisted by this agent must fully comply with:
- Line length: **120 characters**
- Standard Android Studio formatter with EditorConfig.
- Kotlin preferred for new code; legacy Java still present.
- Do not use decorative section-divider comments of any kind (e.g. `// ── Title ───`, `// ------`, `// ======`).
- Every new file must end with exactly one empty trailing line (no more, no less).
- Do not add comments, documentation for every function you created instead make it self explanatory as much as possible.
- Create models, states in different files instead of doing it one single file.
- Do not use magic numbers.
- Apply fail fast principle instead of using nested if-else statements.
@@ -188,3 +193,26 @@ All contributions generated or assisted by this agent must fully comply with:
- Use modern Java for Java classes. Optionals, virtual threads, records, streams if necessary.
- Avoid hardcoded strings, colors, dimensions. Use resources.
- Run lint, spotbugsGplayDebug, detekt, spotlessKotlinCheck and fix findings inside the files that have been changed.
## Comments
Names carry the explanation, not comments. A function or variable whose purpose is not obvious from its
name is a naming problem or a decomposition problem — rename it or split it, do not describe it in a comment.
Assume the reader knows Kotlin, Java and the Android framework.
Write a comment only when the code cannot carry the information itself: a non-obvious invariant, a workaround
for a platform or server bug, an ordering requirement, or a decision whose alternatives look equally valid and
are not. When you do write one, explain **why**, never **what**.
Never write:
- Comments that restate the code (`// increase the counter` above `counter++`).
- KDoc/Javadoc added to a function just because the function is new.
- Narration of the change or its history: "changed from X to Y", "previously this failed", "this is not a
permanent failure so we now retry", "fixes the crash reported in the issue". Comments describe the code as
it is today. A reader six months from now has no access to the issue, the PR discussion, or the conversation
that produced the change — that context belongs in the commit message and the PR description.
- Decorative section-divider comments of any kind (e.g. `// ── Title ───`, `// ------`, `// ======`).
`// region` / `// endregion` for IDE folding is allowed where the file already uses it.
Existing comments that are still accurate stay. Delete the ones the change makes wrong or obsolete.
+57 -44
View File
@@ -8,8 +8,8 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.4.0)
aws-partitions (1.1265.0)
aws-sdk-core (3.252.0)
aws-partitions (1.1281.0)
aws-sdk-core (3.254.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
@@ -17,11 +17,11 @@ GEM
bigdecimal
jmespath (~> 1, >= 1.6.1)
logger
aws-sdk-kms (1.129.0)
aws-sdk-core (~> 3, >= 3.248.0)
aws-sdk-kms (1.130.0)
aws-sdk-core (~> 3, >= 3.254.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.226.0)
aws-sdk-core (~> 3, >= 3.248.0)
aws-sdk-s3 (1.229.0)
aws-sdk-core (~> 3, >= 3.254.1)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.12.1)
@@ -36,44 +36,31 @@ GEM
colored2 (3.1.2)
commander (4.6.0)
highline (~> 2.0.0)
csv (3.3.5)
csv (3.3.6)
declarative (0.0.20)
digest-crc (0.7.0)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.6.20240107)
dotenv (2.8.1)
emoji_regex (3.2.3)
erb (6.0.7)
excon (0.112.0)
faraday (1.10.6)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday (2.14.3)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-cookie_jar (0.0.8)
faraday (>= 0.8.0)
http-cookie (>= 1.0.0)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.1)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-follow_redirects (0.5.0)
faraday (>= 1, < 3)
faraday-multipart (1.2.0)
multipart-post (~> 2.0)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.4)
faraday_middleware (1.2.1)
faraday (~> 1.0)
faraday-net_http (2.1.0)
faraday-retry (2.4.0)
faraday (~> 2.0)
fastimage (2.4.1)
fastlane (2.237.0)
fastlane (2.238.0)
CFPropertyList (>= 2.3, < 5.0.0)
abbrev (~> 0.1)
addressable (>= 2.9.0, < 3.0.0)
@@ -89,9 +76,11 @@ GEM
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 2.0.0)
faraday (~> 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 1.0)
faraday (~> 2.7)
faraday-cookie_jar (~> 0.0.8)
faraday-follow_redirects (~> 0.3)
faraday-multipart (~> 1.0)
faraday-retry (~> 2.0)
fastimage (>= 2.1.0, < 3.0.0)
fastlane-sirp (>= 1.1.0)
gh_inspector (>= 1.1.2, < 2.0.0)
@@ -101,6 +90,7 @@ GEM
google-cloud-storage (~> 1.31)
highline (~> 2.0)
http-cookie (~> 1.0.5)
irb (>= 1.8)
json (< 3.0.0)
jwt (>= 2.10.3, < 4)
logger (>= 1.6, < 2.0)
@@ -117,7 +107,7 @@ GEM
security (= 0.1.5)
simctl (~> 1.6.3)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (~> 3)
terminal-table (~> 4)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
@@ -128,7 +118,7 @@ GEM
cgi
fastlane-sirp (1.1.0)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.104.0)
google-apis-androidpublisher_v3 (0.106.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-core (0.18.0)
addressable (~> 2.5, >= 2.5.1)
@@ -142,7 +132,7 @@ GEM
google-apis-core (>= 0.15.0, < 2.a)
google-apis-playcustomapp_v1 (0.18.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-storage_v1 (0.64.0)
google-apis-storage_v1 (0.66.0)
google-apis-core (>= 0.15.0, < 2.a)
google-cloud-core (1.9.0)
google-cloud-env (>= 1.0, < 3.a)
@@ -150,7 +140,7 @@ GEM
google-cloud-env (2.2.2)
base64 (~> 0.2)
faraday (>= 1.0, < 3.a)
google-cloud-errors (1.6.0)
google-cloud-errors (1.7.0)
google-cloud-storage (1.62.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
@@ -161,7 +151,7 @@ GEM
googleauth (~> 1.9)
mini_mime (~> 1.0)
google-logging-utils (0.2.0)
googleauth (1.17.1)
googleauth (1.17.3)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.2)
google-logging-utils (~> 0.1)
@@ -174,8 +164,14 @@ GEM
domain_name (~> 0.5)
httpclient (2.9.0)
mutex_m
io-console (0.9.2)
irb (1.18.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jmespath (1.6.2)
json (2.20.0)
json (2.21.2)
jwt (2.10.3)
base64
logger (1.7.0)
@@ -191,9 +187,24 @@ GEM
os (1.1.4)
ostruct (0.6.3)
plist (3.7.2)
pp (0.6.4)
prettyprint
prettyprint (0.2.0)
prism (1.9.0)
pstore (0.2.1)
public_suffix (6.0.2)
rake (13.4.2)
rbs (4.1.3)
logger
prism (>= 1.6.0)
tsort
rdoc (8.0.0)
erb
prism (>= 1.6.0)
rbs (>= 4.0.0)
tsort
reline (0.7.0)
io-console (~> 0.5)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
@@ -201,7 +212,6 @@ GEM
retriable (3.8.0)
rexml (3.4.4)
rouge (3.28.0)
ruby2_keywords (0.0.5)
rubyzip (2.4.1)
security (0.1.5)
signet (0.22.0)
@@ -212,9 +222,10 @@ GEM
CFPropertyList
naturally
terminal-notifier (2.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
trailblazer-option (0.1.2)
tsort (0.2.0)
tty-cursor (0.7.1)
tty-screen (0.8.2)
tty-spinner (0.9.3)
@@ -222,12 +233,14 @@ GEM
uber (0.1.0)
unicode-display_width (2.6.0)
word_wrap (1.0.0)
xcodeproj (1.27.0)
xcodeproj (1.28.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
base64
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.4.0)
nkf
rexml (>= 3.3.6, < 4.0)
xcpretty (0.4.1)
rouge (~> 3.28.0)
+43 -19
View File
@@ -1,6 +1,7 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2025 Jimly Asshiddiqy <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
@@ -43,24 +44,33 @@ configurations.configureEach {
exclude(group = "org.jetbrains", module = "annotations-java5")
resolutionStrategy {
force(libs.objenesis)
eachDependency {
if (requested.group == "org.checkerframework" && requested.name != "checker-compat-qual") {
useVersion(libs.versions.checker.get())
because("https://github.com/google/ExoPlayer/issues/10007")
} else if (requested.group == "org.jacoco") {
useVersion(libs.versions.jacoco.get())
} else if (requested.group == "commons-logging" && requested.name == "commons-logging") {
useTarget(libs.slfj)
when (requested.group) {
"org.checkerframework" if requested.name != "checker-compat-qual" -> {
useVersion(libs.versions.checker.get())
because("https://github.com/google/ExoPlayer/issues/10007")
}
"org.jacoco" -> {
useVersion(libs.versions.jacoco.get())
}
"commons-logging" if requested.name == "commons-logging" -> {
useTarget(libs.slfj)
}
"org.hamcrest" -> {
useVersion("2.2")
because(
"Align hamcrest on compile and runtime. 1.3 (via junit) exposes fixed-arity " +
"anyOf/allOf overloads that 2.2 (via androidx.test) removed, causing NoSuchMethodError."
)
}
}
}
}
}
// semantic versioning for version code
val versionMajor = 34
val versionMinor = 1
val versionMajor = 35
val versionMinor = 0
val versionPatch = 0
val versionBuild = 50 // 0-50=Alpha / 51-98=RC / 90-99=stable
@@ -266,6 +276,7 @@ spotbugs {
}
tasks.register<Checkstyle>("checkstyle") {
description = "Runs Checkstyle static analysis on the Java sources to enforce the project's coding style."
configFile = file("${rootProject.projectDir}/checkstyle.xml")
setConfigProperties(
"checkstyleSuppressionsPath" to file("${rootProject.rootDir}/suppressions.xml").absolutePath
@@ -277,6 +288,7 @@ tasks.register<Checkstyle>("checkstyle") {
}
tasks.register<Pmd>("pmd") {
description = "Runs PMD static analysis on the Java sources to detect common programming flaws and bad practices."
ruleSetFiles = files("${rootProject.rootDir}/ruleset.xml")
ignoreFailures = true // should continue checking
ruleSets = emptyList()
@@ -332,6 +344,17 @@ tasks.named("check").configure {
dependsOn("checkstyle", "spotbugsGplayDebug", "pmd", "lint", "spotlessKotlinCheck", "detekt")
}
val kspConfiguration = "ksp"
val kspAndroidTestConfiguration = "kspAndroidTest"
val gplayImplementationConfiguration = "gplayImplementation"
val huaweiImplementationConfiguration = "huaweiImplementation"
val qaImplementationConfiguration = "qaImplementation"
val appScanConfigurations = listOf(
gplayImplementationConfiguration,
huaweiImplementationConfiguration,
qaImplementationConfiguration
)
dependencies {
// region Nextcloud library
implementation(libs.android.library) {
@@ -429,10 +452,10 @@ dependencies {
// endregion
// region AppScan, document scanner not available on FDroid (generic) due to OpenCV binaries
// To enable the feature for another variant, add it here.
"gplayImplementation"(project(":appscan"))
"huaweiImplementation"(project(":appscan"))
"qaImplementation"(project(":appscan"))
// To enable the feature for another variant, add its "<variant>Implementation" here.
appScanConfigurations.forEach { configuration ->
add(configuration, project(":appscan"))
}
// endregion
// region SpotBugs
@@ -444,9 +467,10 @@ dependencies {
implementation(libs.dagger)
implementation(libs.dagger.android)
implementation(libs.dagger.android.support)
ksp(libs.dagger.compiler)
ksp(libs.dagger.processor)
kspAndroidTest(libs.dagger.compiler)
listOf(kspConfiguration, kspAndroidTestConfiguration).forEach { configuration ->
add(configuration, libs.dagger.compiler)
}
// endregion
// region Crypto
@@ -476,7 +500,7 @@ dependencies {
// region iCal4j
implementation(libs.ical4j) {
listOf("org.apache.commons", "commons-logging").forEach { groupName -> exclude(group = groupName) }
exclude(group = "commons-logging")
}
// endregion
@@ -509,7 +533,7 @@ dependencies {
// endregion
// region Google Play dependencies, upon each update first test: new registration, receive push
"gplayImplementation"(libs.bundles.gplay)
add(gplayImplementationConfiguration, libs.bundles.gplay)
// endregion
// region common
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -33,8 +33,7 @@ class FileDisplayActivityScreenshotIT : AbstractIT() {
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
companion object {
@@ -9,7 +9,6 @@
package com.nextcloud.client
import android.content.Intent
import android.os.Looper
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
@@ -61,12 +60,8 @@ class SettingsActivityIT : AbstractIT() {
}
}
@Suppress("DEPRECATION")
@Test
fun showMnemonic() {
if (Looper.myLooper() == null) {
Looper.prepare()
}
val intent = Intent().apply {
putExtra(RequestCredentialsActivity.KEY_CHECK_RESULT, RequestCredentialsActivity.KEY_CHECK_RESULT_TRUE)
}
@@ -76,13 +71,10 @@ class SettingsActivityIT : AbstractIT() {
}
launchActivity<SettingsActivity>().use { scenario ->
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
sut.handleMnemonicRequest(intent)
}
Looper.myLooper()?.quitSafely()
Assert.assertTrue(true)
}
}
@@ -87,17 +87,13 @@ class AssistantRepositoryTests : AbstractOnServerIT() {
testCreateTask()
sleep(120)
runBlocking {
val taskList = sut?.getTaskList("assistant")
assertTrue(taskList != null)
sleep(120)
val taskId = taskList?.firstOrNull()?.id ?: return@runBlocking
assert((taskList?.size ?: 0) > 0)
val result = sut?.deleteTask(taskList!!.first().id)
val result = sut?.deleteTask(taskId)
assertTrue(result?.isSuccess == true)
}
}
@@ -10,7 +10,6 @@ package com.nextcloud.client.network
import android.accounts.AccountManager
import android.content.Context
import com.nextcloud.client.account.UserAccountManagerImpl
import com.nextcloud.client.core.ClockImpl
import com.nextcloud.client.network.ConnectivityServiceImpl.GetRequestBuilder
import com.nextcloud.operations.GetMethod
import com.owncloud.android.AbstractOnServerIT
@@ -25,7 +24,7 @@ class ConnectivityServiceImplIT : AbstractOnServerIT() {
val userAccountManager = UserAccountManagerImpl(targetContext, accountManager)
val clientFactory = ClientFactoryImpl(targetContext)
val requestBuilder = GetRequestBuilder { url -> GetMethod(url, false) }
val walledCheckCache = WalledCheckCache(ClockImpl())
val walledCheckCache = WalledCheckCache()
val sut = ConnectivityServiceImpl(
targetContext,
@@ -0,0 +1,51 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.test
import android.os.ParcelFileDescriptor
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement
/**
* Disables system animations for the duration of the test.
*
* Espresso requires that no view keeps requesting layout while it waits for the root window. Animated components such
* as [com.google.android.material.snackbar.Snackbar] keep animating unless the global animation scales are set to zero.
* The Gradle `animationsDisabled` option only passes `--no-window-animation`, which leaves `animator_duration_scale`
* untouched, so animations still run on CI. This rule zeroes all scales directly via a shell command.
*/
class DisableAnimationsRule : TestRule {
override fun apply(base: Statement, description: Description): Statement = object : Statement() {
override fun evaluate() {
setAnimationScale("0.0")
try {
base.evaluate()
} finally {
setAnimationScale("1.0")
}
}
}
private fun setAnimationScale(scale: String) {
val uiAutomation = InstrumentationRegistry.getInstrumentation().uiAutomation
SCALE_SETTINGS.forEach { setting ->
val descriptor = uiAutomation.executeShellCommand("settings put global $setting $scale")
ParcelFileDescriptor.AutoCloseInputStream(descriptor).use { it.readBytes() }
}
}
companion object {
private val SCALE_SETTINGS = listOf(
"window_animation_scale",
"transition_animation_scale",
"animator_duration_scale"
)
}
}
@@ -9,7 +9,6 @@ package com.nextcloud.test
import androidx.test.espresso.IdlingResource
import com.owncloud.android.datamodel.FileDataStorageManager
import com.owncloud.android.datamodel.OCFile
import java.util.concurrent.atomic.AtomicLong
import java.util.concurrent.atomic.AtomicReference
/**
@@ -0,0 +1,11 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.test
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.CLASS)
annotation class Flaky(val reason: String)
@@ -0,0 +1,36 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.test
import android.Manifest
import android.os.Build
import androidx.test.rule.GrantPermissionRule
/**
* Grants the runtime permissions UI tests need, matching what the manifest actually declares:
*
* - WRITE_EXTERNAL_STORAGE is capped at maxSdkVersion="29", so on API 30+ the app never requests it
* and granting it throws "has not requested permission WRITE_EXTERNAL_STORAGE". It is therefore
* granted only when SDK_INT <= 29.
* - POST_NOTIFICATIONS only exists on API 33+, so granting it on lower API levels fails with
* "Unknown permission" and it is granted only from TIRAMISU onwards.
*/
object GrantTestPermissionRule {
fun grantStorageAndNotification(): GrantPermissionRule {
val permissions = buildList {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q) {
add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
add(Manifest.permission.POST_NOTIFICATIONS)
}
}
@Suppress("SpreadOperator")
return GrantPermissionRule.grant(*permissions.toTypedArray())
}
}
@@ -27,10 +27,7 @@ import org.junit.Test
class SetOnlineStatusBottomSheetIT : AbstractIT() {
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE)
@Test
fun open() {
@@ -8,7 +8,6 @@
*/
package com.nextcloud.ui
import android.Manifest
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
@@ -16,6 +15,8 @@ import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.rule.GrantPermissionRule
import com.nextcloud.test.Flaky
import com.nextcloud.test.GrantTestPermissionRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.lib.resources.users.ClearAt
@@ -28,12 +29,10 @@ import org.junit.Test
class SetStatusMessageBottomSheetIT : AbstractIT() {
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
val permissionRule: GrantPermissionRule = GrantTestPermissionRule.grantStorageAndNotification()
@Test
@Flaky(reason = "Bottom sheet is occasionally not rendered before the assertions run")
fun open() {
launchActivity<FileDisplayActivity>().use { scenario ->
onView(isRoot()).check(matches(isDisplayed()))
@@ -8,6 +8,7 @@ package com.nextcloud.utils
import junit.framework.TestCase.assertEquals
import junit.framework.TestCase.assertTrue
import kotlinx.coroutines.runBlocking
import org.junit.After
import org.junit.Before
import org.junit.Test
@@ -29,176 +30,131 @@ class FileHelperTest {
testDirectory.deleteRecursively()
}
@Test
fun testListDirectoryEntriesWhenGivenNullDirectoryShouldReturnEmptyList() {
val result = FileHelper.listDirectoryEntries(null, 0, 10, false)
assertTrue(result.isEmpty())
private fun collectPages(directory: File?, pageSize: Int, fetchFolders: Boolean): List<List<File>> {
val pages = mutableListOf<List<File>>()
runBlocking {
FileHelper.forEachDirectoryPage(directory, pageSize, fetchFolders) { page ->
pages.add(page)
}
}
return pages
}
@Test
fun testListDirectoryEntriesWhenGivenNonExistentDirectoryShouldReturnEmptyList() {
fun testForEachDirectoryPageWhenGivenNullDirectoryShouldReportNoPage() {
assertTrue(collectPages(null, 10, false).isEmpty())
}
@Test
fun testForEachDirectoryPageWhenGivenNonExistentDirectoryShouldReportNoPage() {
val nonExistent = File(testDirectory, "does_not_exist")
val result = FileHelper.listDirectoryEntries(nonExistent, 0, 10, false)
assertTrue(result.isEmpty())
assertTrue(collectPages(nonExistent, 10, false).isEmpty())
}
@Test
fun testListDirectoryEntriesWhenGivenFileInsteadOfDirectoryShouldReturnEmptyList() {
fun testForEachDirectoryPageWhenGivenFileInsteadOfDirectoryShouldReportNoPage() {
val file = File(testDirectory, "test.txt")
file.createNewFile()
val result = FileHelper.listDirectoryEntries(file, 0, 10, false)
assertTrue(result.isEmpty())
assertTrue(collectPages(file, 10, false).isEmpty())
}
@Test
fun testListDirectoryEntriesWhenGivenEmptyDirectoryShouldReturnEmptyList() {
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 10, false)
assertTrue(result.isEmpty())
fun testForEachDirectoryPageWhenGivenEmptyDirectoryShouldReportNoPage() {
assertTrue(collectPages(testDirectory, 10, false).isEmpty())
}
@Test
fun testListDirectoryEntriesWhenFetchingFoldersShouldReturnOnlyFolders() {
fun testForEachDirectoryPageWhenPageSizeIsZeroShouldReportNoPage() {
for (i in 1..5) File(testDirectory, "file$i.txt").createNewFile()
assertTrue(collectPages(testDirectory, 0, false).isEmpty())
}
@Test
fun testForEachDirectoryPageWhenFetchingFoldersShouldReportOnlyFolders() {
File(testDirectory, "folder1").mkdir()
File(testDirectory, "folder2").mkdir()
File(testDirectory, "file1.txt").createNewFile()
File(testDirectory, "file2.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 10, true)
val entries = collectPages(testDirectory, 10, true).flatten()
assertEquals(2, result.size)
assertTrue(result.all { it.isDirectory })
assertEquals(2, entries.size)
assertTrue(entries.all { it.isDirectory })
}
@Test
fun testListDirectoryEntriesWhenFetchingFilesShouldReturnOnlyFiles() {
fun testForEachDirectoryPageWhenFetchingFilesShouldReportOnlyFiles() {
File(testDirectory, "folder1").mkdir()
File(testDirectory, "folder2").mkdir()
File(testDirectory, "file1.txt").createNewFile()
File(testDirectory, "file2.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 10, false)
val entries = collectPages(testDirectory, 10, false).flatten()
assertEquals(2, result.size)
assertTrue(result.all { it.isFile })
assertEquals(2, entries.size)
assertTrue(entries.all { it.isFile })
}
@Test
fun testListDirectoryEntriesWhenStartIndexProvidedShouldSkipCorrectNumberOfItems() {
for (i in 1..5) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 2, 10, false)
assertEquals(3, result.size)
}
@Test
fun testListDirectoryEntriesWhenMaxItemsProvidedShouldLimitResults() {
for (i in 1..10) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 5, false)
assertEquals(5, result.size)
}
@Test
fun testListDirectoryEntriesWhenGivenStartIndexAndMaxItemsShouldReturnCorrectSubset() {
for (i in 1..10) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 3, 4, false)
assertEquals(4, result.size)
}
@Test
fun testListDirectoryEntriesWhenStartIndexBeyondAvailableShouldReturnEmptyList() {
for (i in 1..3) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 10, 5, false)
assertTrue(result.isEmpty())
}
@Test
fun testListDirectoryEntriesWhenMaxItemsBeyondAvailableShouldReturnAllItems() {
for (i in 1..3) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 100, false)
assertEquals(3, result.size)
}
@Test
fun testListDirectoryEntriesWhenFetchingFoldersWithOffsetShouldSkipCorrectly() {
fun testForEachDirectoryPageWhenGivenOnlyFoldersAndFetchingFilesShouldReportNoPage() {
for (i in 1..5) File(testDirectory, "folder$i").mkdir()
assertTrue(collectPages(testDirectory, 10, false).isEmpty())
}
@Test
fun testForEachDirectoryPageWhenGivenOnlyFilesAndFetchingFoldersShouldReportNoPage() {
for (i in 1..5) File(testDirectory, "file$i.txt").createNewFile()
assertTrue(collectPages(testDirectory, 10, true).isEmpty())
}
@Test
fun testForEachDirectoryPageWhenPageSizeExceedsContentShouldReportSinglePage() {
for (i in 1..3) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 2, 10, true)
val pages = collectPages(testDirectory, 100, false)
assertEquals(3, result.size)
assertTrue(result.all { it.isDirectory })
assertEquals(1, pages.size)
assertEquals(3, pages.first().size)
}
@Test
fun testListDirectoryEntriesWhenFetchingFilesWithOffsetShouldSkipCorrectly() {
for (i in 1..3) File(testDirectory, "folder$i").mkdir()
for (i in 1..5) File(testDirectory, "file$i.txt").createNewFile()
fun testForEachDirectoryPageWhenPaginatingFoldersShouldFillEveryPageButTheLast() {
for (i in 1..10) File(testDirectory, "folder$i").mkdir()
val result = FileHelper.listDirectoryEntries(testDirectory, 2, 10, false)
val pages = collectPages(testDirectory, 3, true)
assertEquals(3, result.size)
assertTrue(result.all { it.isFile })
assertEquals(listOf(3, 3, 3, 1), pages.map { it.size })
}
@Test
fun testListDirectoryEntriesWhenGivenOnlyFoldersAndFetchingFilesShouldReturnEmptyList() {
for (i in 1..5) File(testDirectory, "folder$i").mkdir()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 10, false)
assertTrue(result.isEmpty())
fun testForEachDirectoryPageWhenContentIsAMultipleOfPageSizeShouldNotReportAnEmptyPage() {
for (i in 1..9) File(testDirectory, "file$i.txt").createNewFile()
val pages = collectPages(testDirectory, 3, false)
assertEquals(listOf(3, 3, 3), pages.map { it.size })
}
@Test
fun testListDirectoryEntriesWhenGivenOnlyFilesAndFetchingFoldersShouldReturnEmptyList() {
for (i in 1..5) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 10, true)
assertTrue(result.isEmpty())
}
@Test
fun testListDirectoryEntriesWhenMaxItemsIsZeroShouldReturnEmptyList() {
for (i in 1..5) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 0, false)
assertTrue(result.isEmpty())
}
@Test
fun testListDirectoryEntriesWhenGivenMixedContentShouldFilterCorrectly() {
fun testForEachDirectoryPageWhenGivenMixedContentShouldReportEveryEntryExactlyOnce() {
for (i in 1..3) File(testDirectory, "folder$i").mkdir()
for (i in 1..7) File(testDirectory, "file$i.txt").createNewFile()
val folders = FileHelper.listDirectoryEntries(testDirectory, 0, 10, true)
val files = FileHelper.listDirectoryEntries(testDirectory, 0, 10, false)
val folders = collectPages(testDirectory, 2, true).flatten()
val files = collectPages(testDirectory, 2, false).flatten()
assertEquals(3, folders.size)
assertEquals(7, files.size)
assertEquals(folders.size, folders.distinct().size)
assertEquals(files.size, files.distinct().size)
assertTrue(folders.all { it.isDirectory })
assertTrue(files.all { it.isFile })
}
@Test
fun testListDirectoryEntriesWhenPaginatingFoldersShouldWorkCorrectly() {
for (i in 1..10) File(testDirectory, "folder$i").mkdir()
val page1 = FileHelper.listDirectoryEntries(testDirectory, 0, 3, true)
val page2 = FileHelper.listDirectoryEntries(testDirectory, 3, 3, true)
val page3 = FileHelper.listDirectoryEntries(testDirectory, 6, 3, true)
val page4 = FileHelper.listDirectoryEntries(testDirectory, 9, 3, true)
assertEquals(3, page1.size)
assertEquals(3, page2.size)
assertEquals(3, page3.size)
assertEquals(1, page4.size)
}
@Test
fun testListDirectoryEntriesWhenPaginatingFilesShouldWorkCorrectly() {
for (i in 1..10) File(testDirectory, "file$i.txt").createNewFile()
val page1 = FileHelper.listDirectoryEntries(testDirectory, 0, 4, false)
val page2 = FileHelper.listDirectoryEntries(testDirectory, 4, 4, false)
val page3 = FileHelper.listDirectoryEntries(testDirectory, 8, 4, false)
assertEquals(4, page1.size)
assertEquals(4, page2.size)
assertEquals(2, page3.size)
}
}
@@ -6,16 +6,12 @@
*/
package com.nmc.android.ui
import android.view.View
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
@@ -24,29 +20,21 @@ class LauncherActivityIT : AbstractIT() {
@Test
fun testSplashScreenWithEmptyTitlesShouldHideTitles() {
launchActivity<LauncherActivity>().use { scenario ->
onView(withId(R.id.ivSplash)).check(matches(isCompletelyDisplayed()))
onView(
withId(R.id.splashScreenBold)
).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE)))
onView(
withId(R.id.splashScreenNormal)
).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE)))
launchActivity<LauncherActivity>().onActivity { activity ->
assertEquals(View.VISIBLE, activity.findViewById<View>(R.id.ivSplash).visibility)
assertEquals(View.GONE, activity.findViewById<View>(R.id.splashScreenBold).visibility)
assertEquals(View.GONE, activity.findViewById<View>(R.id.splashScreenNormal).visibility)
}
}
@Test
fun testSplashScreenWithTitlesShouldShowTitles() {
launchActivity<LauncherActivity>().use { scenario ->
onView(withId(R.id.ivSplash)).check(matches(isCompletelyDisplayed()))
launchActivity<LauncherActivity>().onActivity { activity ->
activity.setSplashTitles("Example", "Cloud")
scenario.onActivity {
it.setSplashTitles("Example", "Cloud")
}
val onePercentArea = ViewMatchers.isDisplayingAtLeast(1)
onView(withId(R.id.splashScreenBold)).check(matches(onePercentArea))
onView(withId(R.id.splashScreenNormal)).check(matches(onePercentArea))
assertEquals(View.VISIBLE, activity.findViewById<View>(R.id.ivSplash).visibility)
assertEquals(View.VISIBLE, activity.findViewById<View>(R.id.splashScreenBold).visibility)
assertEquals(View.VISIBLE, activity.findViewById<View>(R.id.splashScreenNormal).visibility)
}
}
}
@@ -0,0 +1,148 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.owncloud.android
import com.nextcloud.client.account.UserAccountManagerImpl
import com.nextcloud.client.device.BatteryStatus
import com.nextcloud.client.device.PowerManagementService
import com.nextcloud.client.jobs.upload.FileUploadWorker
import com.owncloud.android.datamodel.UploadsStorageManager
import com.owncloud.android.db.OCUpload
import com.owncloud.android.files.services.NameCollisionPolicy
import com.owncloud.android.lib.common.operations.RemoteOperationResult
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation
import com.owncloud.android.lib.resources.files.RemoveFileRemoteOperation
import com.owncloud.android.operations.UploadFileOperation
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import java.io.IOException
class GrantFolderExistenceTests : AbstractOnServerIT() {
private val root = "/autoupload/"
private val yearFolder = root + "2026/"
private val monthFolder = yearFolder + "07/"
private val uploadsStorageManager = UploadsStorageManager(
UserAccountManagerImpl.fromContext(targetContext),
targetContext.contentResolver
)
private val powerManagementServiceMock = object : PowerManagementService {
override val isPowerSavingEnabled = false
override val isIgnoringOptimization = true
override val battery = BatteryStatus(false, 0)
}
@Before
@Throws(IOException::class)
fun before() {
createDummyFiles()
}
@Test
fun testUploadFileThenDeleteYearFolderOnServerOnlyThenUploadAgainShouldRecreateMonthFolderAndReturnOk() {
uploadAndAssertSuccess("first.txt")
assertTrue("month folder should exist on server", existsOnServer(monthFolder))
assertNotNull("month folder should be cached locally", storageManager.getFileByDecryptedRemotePath(monthFolder))
removeYearFolderOnServerOnly()
assertFalse("month folder should be deleted", existsOnServer(monthFolder))
assertNotNull(
"app still has a cached entry for the removed folder",
storageManager.getFileByDecryptedRemotePath(monthFolder)
)
// attempting upload to the same folder
val result = upload("nonEmpty.txt", monthFolder + "nonEmpty.txt")
assertEquals(
"upload must not fail with a conflict, the missing folder has to be recreated",
RemoteOperationResult.ResultCode.OK,
result.code
)
assertTrue("month folder should be recreated on server", existsOnServer(monthFolder))
assertTrue("uploaded file should exist on server", existsOnServer(monthFolder + "nonEmpty.txt"))
}
@Test
fun testUploadFileThenDeleteRootOnServerOnlyThenUploadAgainShouldRecreateAllFolderLevelsAndReturnOk() {
uploadAndAssertSuccess("first.txt")
assertTrue(
"root folder should be removed",
RemoveFileRemoteOperation(root).execute(client).isSuccess
)
assertFalse(existsOnServer(root))
val result = upload("nonEmpty.txt", monthFolder + "nonEmpty.txt")
assertEquals(
"every missing folder level has to be recreated",
RemoteOperationResult.ResultCode.OK,
result.code
)
assertTrue(existsOnServer(yearFolder))
assertTrue(existsOnServer(monthFolder))
assertTrue(existsOnServer(monthFolder + "nonEmpty.txt"))
}
private fun uploadAndAssertSuccess(filename: String) {
val result = upload(filename, monthFolder + filename)
assertTrue(result.logMessage, result.isSuccess)
assertTrue("uploaded file should exist on server", existsOnServer(monthFolder + filename))
}
private fun removeYearFolderOnServerOnly() {
assertTrue(
"year folder should be removed",
RemoveFileRemoteOperation(yearFolder).execute(client).isSuccess
)
}
private fun existsOnServer(remotePath: String): Boolean =
ExistenceCheckRemoteOperation(remotePath, false).execute(client).isSuccess
private fun upload(localFileName: String, remotePath: String): RemoteOperationResult<*> {
val localFile = createFile(localFileName, FILE_LINE_COUNT)
assertTrue("local file must exist before uploading", localFile.exists())
val ocUpload = OCUpload(
localFile.absolutePath,
remotePath,
account.name
).apply {
isCreateRemoteFolder = true
createdBy = UploadFileOperation.CREATED_AS_INSTANT_PICTURE
}
return UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.ASK_USER,
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false,
storageManager
).execute(client)
}
companion object {
private const val FILE_LINE_COUNT = 100
}
}
@@ -37,8 +37,7 @@ class ScreenshotsIT : AbstractIT() {
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
@Test
@@ -330,6 +330,39 @@ class FileMenuFilterIT : AbstractIT() {
}
}
@Test
fun filter_openWithOnlyOffice_onlyForDownloadedFiles() {
every {
mockArbitraryDataProvider.getValue(any<User>(), ArbitraryDataProvider.DIRECT_EDITING)
} returns ONLYOFFICE_DIRECT_EDITING_JSON
configureCapability(OCCapability())
val downloadedFile = OCFile("/downloaded.docx").apply {
mimeType = OFFICE_MIMETYPE
storagePath = getDummyFile("downloaded.docx").absolutePath
}
val onlineOnlyFile = OCFile("/online.docx").apply {
mimeType = OFFICE_MIMETYPE
}
launchActivity<TestActivity>().use {
it.onActivity { activity ->
val filterFactory = FileMenuFilter.Factory(mockStorageManager, activity, editorUtils)
val downloadedToHide = filterFactory
.newInstance(downloadedFile, mockComponentsGetter, true, user)
.getToHide(false)
assertFalse(downloadedToHide.contains(R.id.action_open_in_web_editor))
val onlineToHide = filterFactory
.newInstance(onlineOnlyFile, mockComponentsGetter, true, user)
.getToHide(false)
assertTrue(onlineToHide.contains(R.id.action_open_in_web_editor))
}
}
}
private data class ExpectedLockVisibilities(val lockFile: Boolean, val unlockFile: Boolean)
private fun configureCapability(capability: OCCapability) {
@@ -363,4 +396,25 @@ class FileMenuFilterIT : AbstractIT() {
}
}
}
companion object {
private const val OFFICE_MIMETYPE =
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
private val ONLYOFFICE_DIRECT_EDITING_JSON =
"""
{
"editors": {
"onlyoffice": {
"id": "onlyoffice",
"name": "OnlyOffice",
"mimetypes": [],
"optionalMimetypes": ["$OFFICE_MIMETYPE"],
"secure": false
}
},
"creators": {}
}
""".trimIndent()
}
}
@@ -1,6 +1,7 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2020 Tobias Kaminsky <[email protected]>
* SPDX-FileCopyrightText: 2020 Chris Narkiewicz <[email protected]>
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH
@@ -8,475 +9,141 @@
*/
package com.owncloud.android.files.services
import com.nextcloud.client.account.UserAccountManager
import com.nextcloud.client.account.UserAccountManagerImpl
import com.nextcloud.client.device.BatteryStatus
import com.nextcloud.client.device.PowerManagementService
import com.nextcloud.client.jobs.upload.FileUploadHelper
import com.nextcloud.client.jobs.upload.FileUploadWorker
import com.owncloud.android.AbstractOnServerIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.datamodel.UploadsStorageManager
import com.owncloud.android.db.OCUpload
import com.owncloud.android.lib.common.operations.OperationCancelledException
import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation
import com.owncloud.android.lib.resources.files.model.RemoteFile
import com.owncloud.android.operations.UploadFileOperation
import junit.framework.Assert.assertEquals
import junit.framework.Assert.assertFalse
import junit.framework.Assert.assertTrue
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import java.io.File
abstract class FileUploaderIT : AbstractOnServerIT() {
private var uploadsStorageManager: UploadsStorageManager? = null
class FileUploaderIT : AbstractOnServerIT() {
private val powerManagementServiceMock: PowerManagementService = object : PowerManagementService {
override val isIgnoringOptimization: Boolean
get() = true
private lateinit var uploadsStorageManager: UploadsStorageManager
override val isPowerSavingEnabled: Boolean
get() = false
override val battery: BatteryStatus
get() = BatteryStatus()
private val powerManagementServiceMock = object : PowerManagementService {
override val isIgnoringOptimization = true
override val isPowerSavingEnabled = false
override val battery = BatteryStatus()
}
@Before
fun setUp() {
val contentResolver = targetContext.contentResolver
val accountManager: UserAccountManager = UserAccountManagerImpl.fromContext(targetContext)
uploadsStorageManager = UploadsStorageManager(accountManager, contentResolver)
val accountManager = UserAccountManagerImpl.fromContext(targetContext)
uploadsStorageManager = UploadsStorageManager(accountManager, targetContext.contentResolver)
}
// /**
// * uploads a file, overwrites it with an empty one, check if overwritten
// */
// disabled, flaky test
// @Test
// fun testKeepLocalAndOverwriteRemote() {
// val file = getDummyFile("chunkedFile.txt")
// val ocUpload = OCUpload(file.absolutePath, "/testFile.txt", account.name)
//
// assertTrue(
// UploadFileOperation(
// uploadsStorageManager,
// connectivityServiceMock,
// powerManagementServiceMock,
// user,
// null,
// ocUpload,
// FileUploader.NameCollisionPolicy.DEFAULT,
// FileUploader.LOCAL_BEHAVIOUR_COPY,
// targetContext,
// false,
// false
// )
// .setRemoteFolderToBeCreated()
// .execute(client, storageManager)
// .isSuccess
// )
//
// val result = ReadFileRemoteOperation("/testFile.txt").execute(client)
// assertTrue(result.isSuccess)
//
// assertEquals(file.length(), (result.data[0] as RemoteFile).length)
//
// val ocUpload2 = OCUpload(getDummyFile("empty.txt").absolutePath, "/testFile.txt", account.name)
//
// assertTrue(
// UploadFileOperation(
// uploadsStorageManager,
// connectivityServiceMock,
// powerManagementServiceMock,
// user,
// null,
// ocUpload2,
// FileUploader.NameCollisionPolicy.OVERWRITE,
// FileUploader.LOCAL_BEHAVIOUR_COPY,
// targetContext,
// false,
// false
// )
// .execute(client, storageManager)
// .isSuccess
// )
//
// val result2 = ReadFileRemoteOperation("/testFile.txt").execute(client)
// assertTrue(result2.isSuccess)
//
// assertEquals(0, (result2.data[0] as RemoteFile).length)
// }
/**
* uploads a file, overwrites it with an empty one, check if overwritten
*/
@Test
fun testKeepLocalAndOverwriteRemoteStatic() {
val file = getDummyFile("chunkedFile.txt")
fun uploadWithOverwritePolicyReplacesRemoteFile() {
val originalFile = getDummyFile(CHUNKED_FILE)
uploadOriginalFile(originalFile)
FileUploadHelper().uploadNewFiles(
user,
arrayOf(file.absolutePath),
arrayOf("/testFile.txt"),
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
true,
UploadFileOperation.CREATED_BY_USER,
false,
false,
NameCollisionPolicy.DEFAULT
)
val replacement = getDummyFile(EMPTY_FILE)
assertTrue(uploadOperation(replacement, NameCollisionPolicy.OVERWRITE).execute(client).isSuccess)
longSleep()
val result = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result.isSuccess)
assertEquals(file.length(), (result.data[0] as RemoteFile).length)
val ocFile2 = OCFile("/testFile.txt")
ocFile2.storagePath = getDummyFile("empty.txt").absolutePath
FileUploadHelper().uploadUpdatedFile(
user,
arrayOf(ocFile2),
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
NameCollisionPolicy.OVERWRITE
)
shortSleep()
val result2 = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result2.isSuccess)
assertEquals(0, (result2.data[0] as RemoteFile).length)
assertRemoteFileLength(REMOTE_PATH, EMPTY_LENGTH)
}
/**
* uploads a file, uploads another one with automatically (2) added, check
*/
@Test
fun testKeepBoth() {
var renameListenerWasTriggered = false
fun uploadWithRenamePolicyKeepsBothFiles() {
val originalFile = getDummyFile(CHUNKED_FILE)
uploadOriginalFile(originalFile)
val file = getDummyFile("chunkedFile.txt")
val ocUpload = OCUpload(file.absolutePath, "/testFile.txt", account.name)
val renamedFile = getDummyFile(EMPTY_FILE)
var renameListenerTriggered = false
val operation = uploadOperation(renamedFile, NameCollisionPolicy.RENAME)
.addRenameUploadListener { renameListenerTriggered = true }
assertTrue(operation.execute(client).isSuccess)
assertTrue(
UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false,
storageManager
)
.setRemoteFolderToBeCreated()
.execute(client)
.isSuccess
)
val result = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result.isSuccess)
assertEquals(file.length(), (result.data[0] as RemoteFile).length)
val file2 = getDummyFile("empty.txt")
val ocUpload2 = OCUpload(file2.absolutePath, "/testFile.txt", account.name)
assertTrue(
UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload2,
NameCollisionPolicy.RENAME,
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false,
storageManager
)
.addRenameUploadListener {
renameListenerWasTriggered = true
}
.execute(client)
.isSuccess
)
val result2 = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result2.isSuccess)
assertEquals(file.length(), (result2.data[0] as RemoteFile).length)
val result3 = ReadFileRemoteOperation("/testFile (2).txt").execute(client)
assertTrue(result3.isSuccess)
assertEquals(file2.length(), (result3.data[0] as RemoteFile).length)
assertTrue(renameListenerWasTriggered)
assertRemoteFileLength(REMOTE_PATH, originalFile.length())
assertRemoteFileLength(REMOTE_PATH_RENAMED, renamedFile.length())
assertTrue(renameListenerTriggered)
}
/**
* uploads a file, uploads another one with automatically (2) added, check
*/
@Test
fun testKeepBothStatic() {
val file = getDummyFile("nonEmpty.txt")
fun uploadWithRenamePolicyKeepsBothFilesForNonEmptyOriginal() {
val originalFile = getDummyFile(NON_EMPTY_FILE)
uploadOriginalFile(originalFile)
FileUploadHelper().uploadNewFiles(
user,
arrayOf(file.absolutePath),
arrayOf("/testFile.txt"),
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
true,
UploadFileOperation.CREATED_BY_USER,
false,
false,
NameCollisionPolicy.DEFAULT
)
val renamedFile = getDummyFile(EMPTY_FILE)
assertTrue(uploadOperation(renamedFile, NameCollisionPolicy.RENAME).execute(client).isSuccess)
longSleep()
val result = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result.isSuccess)
assertEquals(file.length(), (result.data[0] as RemoteFile).length)
val ocFile2 = OCFile("/testFile.txt")
ocFile2.storagePath = getDummyFile("empty.txt").absolutePath
FileUploadHelper().uploadUpdatedFile(
user,
arrayOf(ocFile2),
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
NameCollisionPolicy.RENAME
)
shortSleep()
val result2 = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result2.isSuccess)
assertEquals(file.length(), (result2.data[0] as RemoteFile).length)
val result3 = ReadFileRemoteOperation("/testFile (2).txt").execute(client)
assertTrue(result3.isSuccess)
assertEquals(ocFile2.fileLength, (result3.data[0] as RemoteFile).length)
assertRemoteFileLength(REMOTE_PATH, originalFile.length())
assertRemoteFileLength(REMOTE_PATH_RENAMED, renamedFile.length())
}
/**
* uploads a file with "keep server" option set, so do nothing
*/
@Test
fun testKeepServer() {
val file = getDummyFile("chunkedFile.txt")
val ocUpload = OCUpload(file.absolutePath, "/testFile.txt", account.name)
fun uploadWithSkipPolicyKeepsRemoteFileUnchanged() {
val originalFile = getDummyFile(CHUNKED_FILE)
uploadOriginalFile(originalFile)
assertTrue(
UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false,
storageManager
)
.setRemoteFolderToBeCreated()
.execute(client)
.isSuccess
)
val skippedFile = getDummyFile(EMPTY_FILE)
val operation = uploadOperation(skippedFile, NameCollisionPolicy.SKIP)
assertTrue(operation.execute(client).isSuccess)
assertTrue(operation.wasSkipped())
val result = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result.isSuccess)
assertEquals(file.length(), (result.data[0] as RemoteFile).length)
val ocUpload2 = OCUpload(getDummyFile("empty.txt").absolutePath, "/testFile.txt", account.name)
assertFalse(
UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload2,
NameCollisionPolicy.SKIP,
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false,
storageManager
)
.execute(client).isSuccess
)
val result2 = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result2.isSuccess)
assertEquals(file.length(), (result2.data[0] as RemoteFile).length)
assertRemoteFileLength(REMOTE_PATH, originalFile.length())
}
/**
* uploads a file with "keep server" option set, so do nothing
*/
@Test
fun testKeepServerStatic() {
val file = getDummyFile("chunkedFile.txt")
fun uploadWithSkipPolicyUploadsWhenNoRemoteFileExists() {
val originalFile = getDummyFile(CHUNKED_FILE)
val operation = uploadOperation(originalFile, NameCollisionPolicy.SKIP).setRemoteFolderToBeCreated()
assertTrue(operation.execute(client).isSuccess)
assertFalse(operation.wasSkipped())
FileUploadHelper().uploadNewFiles(
user,
arrayOf(file.absolutePath),
arrayOf("/testFile.txt"),
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
true,
UploadFileOperation.CREATED_BY_USER,
false,
false,
NameCollisionPolicy.DEFAULT
)
assertRemoteFileLength(REMOTE_PATH, originalFile.length())
longSleep()
val skippedFile = getDummyFile(EMPTY_FILE)
val skippedOperation = uploadOperation(skippedFile, NameCollisionPolicy.SKIP)
assertTrue(skippedOperation.execute(client).isSuccess)
assertTrue(skippedOperation.wasSkipped())
val result = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result.isSuccess)
assertEquals(file.length(), (result.data[0] as RemoteFile).length)
val ocFile2 = OCFile("/testFile.txt")
ocFile2.storagePath = getDummyFile("empty.txt").absolutePath
FileUploadHelper().uploadUpdatedFile(
user,
arrayOf(ocFile2),
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
NameCollisionPolicy.SKIP
)
shortSleep()
val result2 = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result2.isSuccess)
assertEquals(file.length(), (result2.data[0] as RemoteFile).length)
assertRemoteFileLength(REMOTE_PATH, originalFile.length())
}
/**
* uploads a file with "skip if exists" option set, so do nothing if file exists
*/
@Test
fun testCancelServer() {
val file = getDummyFile("chunkedFile.txt")
val ocUpload = OCUpload(file.absolutePath, "/testFile.txt", account.name)
assertTrue(
UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.SKIP,
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false,
storageManager
)
.setRemoteFolderToBeCreated()
.execute(client)
.isSuccess
)
val result = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result.isSuccess)
assertEquals(file.length(), (result.data[0] as RemoteFile).length)
val ocUpload2 = OCUpload(getDummyFile("empty.txt").absolutePath, "/testFile.txt", account.name)
val uploadResult = UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload2,
NameCollisionPolicy.SKIP,
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false,
storageManager
)
.execute(client)
assertFalse(uploadResult.isSuccess)
assertTrue(uploadResult.exception is OperationCancelledException)
val result2 = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result2.isSuccess)
assertEquals(file.length(), (result2.data[0] as RemoteFile).length)
private fun uploadOriginalFile(originalFile: File) {
val operation = uploadOperation(originalFile, NameCollisionPolicy.DEFAULT).setRemoteFolderToBeCreated()
assertTrue(operation.execute(client).isSuccess)
assertRemoteFileLength(REMOTE_PATH, originalFile.length())
}
/**
* uploads a file with "skip if exists" option set, so do nothing if file exists
*/
@Test
fun testKeepCancelStatic() {
val file = getDummyFile("chunkedFile.txt")
private fun uploadOperation(localFile: File, nameCollisionPolicy: NameCollisionPolicy) = UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
OCUpload(localFile.absolutePath, REMOTE_PATH, account.name),
nameCollisionPolicy,
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false,
storageManager
)
FileUploadHelper().uploadNewFiles(
user,
arrayOf(file.absolutePath),
arrayOf("/testFile.txt"),
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
true,
UploadFileOperation.CREATED_BY_USER,
false,
false,
NameCollisionPolicy.DEFAULT
)
longSleep()
val result = ReadFileRemoteOperation("/testFile.txt").execute(client)
private fun assertRemoteFileLength(remotePath: String, expectedLength: Long) {
val result = ReadFileRemoteOperation(remotePath).execute(client)
assertTrue(result.isSuccess)
assertEquals(expectedLength, (result.data[0] as RemoteFile).length)
}
assertEquals(file.length(), (result.data[0] as RemoteFile).length)
val ocFile2 = OCFile("/testFile.txt")
ocFile2.storagePath = getDummyFile("empty.txt").absolutePath
FileUploadHelper().uploadUpdatedFile(
user,
arrayOf(ocFile2),
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
NameCollisionPolicy.SKIP
)
shortSleep()
val result2 = ReadFileRemoteOperation("/testFile.txt").execute(client)
assertTrue(result2.isSuccess)
assertEquals(file.length(), (result2.data[0] as RemoteFile).length)
companion object {
private const val REMOTE_PATH = "/testFile.txt"
private const val REMOTE_PATH_RENAMED = "/testFile (2).txt"
private const val CHUNKED_FILE = "chunkedFile.txt"
private const val NON_EMPTY_FILE = "nonEmpty.txt"
private const val EMPTY_FILE = "empty.txt"
private const val EMPTY_LENGTH = 0L
}
}
@@ -28,6 +28,7 @@ import com.owncloud.android.authentication.AuthenticatorActivity
import org.junit.AfterClass
import org.junit.Assert
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
@@ -53,6 +54,7 @@ class LoginIT : AbstractIT() {
@Throws(InterruptedException::class)
@Suppress("MagicNumber", "SwallowedException")
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.Q)
@Ignore("Login no longer uses an in-app WebView, so espresso-web (Espresso.onWebView) cannot drive it. ")
fun login() {
val arguments = InstrumentationRegistry.getArguments()
val baseUrl = arguments.getString("TEST_SERVER_URL")!!
@@ -8,7 +8,6 @@
*/
package com.owncloud.android.ui.activity
import android.Manifest
import android.accounts.Account
import android.accounts.AccountManager
import android.net.Uri
@@ -21,6 +20,8 @@ import androidx.test.rule.GrantPermissionRule
import com.nextcloud.client.account.User
import com.nextcloud.client.account.UserAccountManager
import com.nextcloud.client.account.UserAccountManagerImpl
import com.nextcloud.test.Flaky
import com.nextcloud.test.GrantTestPermissionRule
import com.nextcloud.test.RetryTestRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.MainApp
@@ -39,36 +40,37 @@ class DrawerActivityIT : AbstractIT() {
val retryTestRule = RetryTestRule()
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
val permissionRule: GrantPermissionRule = GrantTestPermissionRule.grantStorageAndNotification()
@Test
@Flaky(reason = "Account switch relaunches FileDisplayActivity, which races with the drawer assertions")
fun switchAccountViaAccountList() {
launchActivity<FileDisplayActivity>().use { scenario ->
var sut: FileDisplayActivity? = null
scenario.onActivity { activity ->
sut = activity
}
Assert.assertEquals(account1, sut!!.user.get().toPlatformAccount())
onView(ViewMatchers.withId(R.id.switch_account_button)).perform(ViewActions.click())
onView(
Matchers.anyOf(
ViewMatchers.withText(account2Name),
ViewMatchers.withText(
account2DisplayName
)
)
).perform(ViewActions.click())
Assert.assertEquals(account2, sut.user.get().toPlatformAccount())
onView(ViewMatchers.withId(R.id.switch_account_button)).perform(ViewActions.click())
onView(ViewMatchers.withText(account1?.name)).perform(ViewActions.click())
// Switching accounts finishes and relaunches FileDisplayActivity (see
// FileDisplayActivity.handleRestartIntent). That self-relaunch is incompatible with
// ActivityScenario#close(), which cannot drive its tracked instance to DESTROYED, so the
// scenario is launched without auto-closing.
val scenario = launchActivity<FileDisplayActivity>()
lateinit var sut: FileDisplayActivity
scenario.onActivity { activity ->
sut = activity
}
Assert.assertEquals(account1, sut.user.get().toPlatformAccount())
onView(ViewMatchers.withId(R.id.switch_account_button)).perform(ViewActions.click())
onView(
Matchers.anyOf(
ViewMatchers.withText(account2Name),
ViewMatchers.withText(
account2DisplayName
)
)
).perform(ViewActions.click())
Assert.assertEquals(account2, sut.user.get().toPlatformAccount())
onView(ViewMatchers.withId(R.id.switch_account_button)).perform(ViewActions.click())
onView(ViewMatchers.withText(account1?.name)).perform(ViewActions.click())
}
companion object {
@@ -12,6 +12,7 @@ package com.owncloud.android.ui.activity
import android.content.Intent
import android.net.Uri
import android.view.KeyEvent
import android.view.View
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions
@@ -24,6 +25,7 @@ import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import com.facebook.testing.screenshot.internal.TestNameDetector
import com.nextcloud.client.preferences.AppPreferencesImpl
import com.nextcloud.test.Flaky
import com.nextcloud.test.GrantStoragePermissionRule
import com.nextcloud.test.withSelectedText
import com.nextcloud.utils.extensions.removeFileExtension
@@ -32,6 +34,8 @@ import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.utils.ScreenshotTest
import org.hamcrest.Matchers.not
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@@ -101,6 +105,7 @@ class ReceiveExternalFilesActivityIT : AbstractIT() {
}
@Test
@Flaky(reason = "Rename dialog text selection is not settled when the assertions run")
fun renameSingleFileUpload() {
val imageFile = getDummyFile("image.jpg")
val intent = createSendIntent(imageFile)
@@ -229,18 +234,22 @@ class ReceiveExternalFilesActivityIT : AbstractIT() {
val preferences = AppPreferencesImpl.fromContext(targetContext)
preferences.setLastUploadPath(mainFolder.remotePath)
launchActivity<ReceiveExternalFilesActivity>(intent).use {
val expectedMainFolderTitle = (getCurrentActivity() as ToolbarActivity).getActionBarTitle(mainFolder, false)
// Verify that the test starts in the expected folder. If this fails, change the setup calls above
onView(withId(R.id.toolbar))
.check(matches(hasDescendant(withText(expectedMainFolderTitle))))
// In the multi-upload case the rename field is hidden and no view requests focus, so the
// activity window never gains focus on the CI emulator and Espresso's onView(...) fails with
// RootViewWithoutFocusException. The view state is therefore asserted directly via
// onActivity, which does not depend on window focus.
launchActivity<ReceiveExternalFilesActivity>(intent).use { scenario ->
scenario.onActivity { sut ->
// Verify that the test starts in the expected folder. If this fails, change the setup calls above
val expectedMainFolderTitle = sut.getActionBarTitle(mainFolder, false)
assertEquals(expectedMainFolderTitle, sut.supportActionBar?.title?.toString())
onView(withText(R.string.uploader_btn_upload_text))
.check(matches(isDisplayed()))
.check(matches(isEnabled()))
val uploadButton = sut.findViewById<View>(R.id.uploader_choose_folder)
assertEquals(View.VISIBLE, uploadButton.visibility)
assertTrue(uploadButton.isEnabled)
onView(withId(R.id.user_input))
.check(matches(not(isDisplayed())))
assertEquals(View.GONE, sut.findViewById<View>(R.id.user_input).visibility)
}
}
}
}
@@ -21,9 +21,13 @@ import com.owncloud.android.ui.interfaces.UnifiedSearchCurrentDirItemAction
import com.owncloud.android.ui.interfaces.UnifiedSearchListInterface
import com.owncloud.android.ui.unifiedsearch.ProviderID
import com.owncloud.android.ui.unifiedsearch.UnifiedSearchSection
import com.owncloud.android.ui.unifiedsearch.toUnifiedSearchEntry
import com.owncloud.android.utils.MimeType
import com.owncloud.android.utils.ScreenshotTest
import com.owncloud.android.utils.overlay.OverlayManager
import com.nextcloud.utils.thumbnail.FileThumbnailGenerator
import com.nextcloud.utils.thumbnail.FolderThumbnailGenerator
import com.nextcloud.utils.thumbnail.ThumbnailGenerator
import javax.inject.Provider
import org.junit.Before
import org.junit.Test
@@ -32,7 +36,7 @@ class UnifiedSearchListAdapterIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.adapter.UnifiedSearchListAdapterIT"
private lateinit var overlayManager: OverlayManager
private lateinit var thumbnailGenerator: ThumbnailGenerator
private lateinit var preferences: AppPreferences
@Suppress("DEPRECATION")
@@ -98,7 +102,7 @@ class UnifiedSearchListAdapterIT : AbstractIT() {
UnifiedSearchSection(
providerID = name.lowercase().replace(" ", "_"),
name = name,
entries = entries,
entries = entries.map { it.toUnifiedSearchEntry(storageManager) },
hasMoreResults = false
)
}
@@ -108,7 +112,7 @@ class UnifiedSearchListAdapterIT : AbstractIT() {
UnifiedSearchSection(
providerID = name.lowercase().replace(" ", "_"),
name = name,
entries = entries,
entries = entries.map { it.toUnifiedSearchEntry(storageManager) },
hasMoreResults = true
)
}
@@ -134,11 +138,20 @@ class UnifiedSearchListAdapterIT : AbstractIT() {
): UnifiedSearchListAdapter {
val accountManager = UserAccountManagerImpl.fromContext(targetContext)
overlayManager = OverlayManager(
preferences = preferences,
viewThemeUtils = sut.viewThemeUtils,
context = targetContext,
accountManager = accountManager
thumbnailGenerator = ThumbnailGenerator(
fileThumbnailGenerator = FileThumbnailGenerator(
storageManager = Provider { sut.storageManager },
preferences = preferences,
viewThemeUtils = sut.viewThemeUtils,
context = targetContext,
accountManager = accountManager
),
folderThumbnailGenerator = FolderThumbnailGenerator(
preferences = preferences,
viewThemeUtils = sut.viewThemeUtils,
context = targetContext,
accountManager = accountManager
)
)
val adapter = UnifiedSearchListAdapter(
@@ -152,12 +165,11 @@ class UnifiedSearchListAdapterIT : AbstractIT() {
onClientReady: (com.nextcloud.common.NextcloudClient) -> Unit
) = Unit
},
user = sut.user.get(),
context = sut,
viewThemeUtils = sut.viewThemeUtils,
appPreferences = preferences,
currentDirItemAction = noopCurrentDirAction,
overlayManager = overlayManager
thumbnailGenerator = thumbnailGenerator,
user = sut.user.get()
)
adapter.shouldShowFooters(true)
@@ -85,8 +85,7 @@ class DialogFragmentIT : AbstractIT() {
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
@After
@@ -6,13 +6,13 @@
*/
package com.owncloud.android.ui.dialog
import android.Manifest
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.rule.GrantPermissionRule
import com.nextcloud.test.GrantTestPermissionRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.ui.activity.FileDisplayActivity
@@ -25,10 +25,7 @@ class SyncFileNotEnoughSpaceDialogFragmentTest : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.dialog.SyncFileNotEnoughSpaceDialogFragmentTest"
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
val permissionRule: GrantPermissionRule = GrantTestPermissionRule.grantStorageAndNotification()
@Test
@ScreenshotTest
@@ -0,0 +1,34 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.owncloud.android.ui.fragment
import com.nextcloud.client.account.User
import com.nextcloud.utils.extensions.getParcelableArgument
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Test
class FileDetailActivitiesFragmentIT : AbstractIT() {
@Test
fun newInstanceStoresFileAndUserInArguments() {
val file = OCFile("/test.txt").apply { fileId = 12 }
val fragment = FileDetailActivitiesFragment.newInstance(file, user)
val arguments = fragment.arguments
assertNotNull(arguments)
val storedFile = arguments.getParcelableArgument("FILE", OCFile::class.java)
val storedUser = arguments.getParcelableArgument("USER", User::class.java)
assertEquals(file.fileId, storedFile?.fileId)
assertEquals(user.accountName, storedUser?.accountName)
}
}
@@ -15,7 +15,7 @@ import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import com.nextcloud.test.TestActivity
import com.nextcloud.ui.ImageDetailFragment
import com.nextcloud.ui.fileInfo.FileInfoFragment
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile
@@ -79,7 +79,7 @@ class FileDetailFragmentStaticServerIT : AbstractIT() {
var activity: TestActivity? = null
scenario.onActivity { sut ->
activity = sut
val fragment = ImageDetailFragment.newInstance(oCFile, user).apply {
val fragment = FileInfoFragment.newInstance(oCFile, user).apply {
hideMap()
}
sut.addFragment(fragment)
@@ -1,6 +1,7 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2020 Tobias Kaminsky <[email protected]>
* SPDX-FileCopyrightText: 2020 Chris Narkiewicz <[email protected]>
* SPDX-FileCopyrightText: 2021 TSI-mc
@@ -9,11 +10,13 @@
package com.owncloud.android.ui.fragment
import android.view.View
import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.accessibility.AccessibilityChecks
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.RootMatchers.isDialog
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.isChecked
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
@@ -24,6 +27,7 @@ import com.google.android.apps.common.testing.accessibility.framework.Accessibil
import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesViews
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.nextcloud.android.lib.resources.files.FileDownloadLimit
import com.nextcloud.test.Flaky
import com.nextcloud.test.RetryTestRule
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
@@ -86,12 +90,14 @@ class FileDetailSharingFragmentIT : AbstractIT() {
@Test
@ScreenshotTest
@Flaky("not stable")
fun listSharesFileNone() {
show(file)
}
@Test
@ScreenshotTest
@Flaky("not stable")
fun listSharesFileResharingNotAllowed() {
file.permissions = ""
@@ -100,6 +106,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
@Test
@ScreenshotTest
@Flaky("not stable")
fun listSharesDownloadLimit() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
@@ -153,6 +160,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
@Test
@ScreenshotTest
@Suppress("MagicNumber")
@Flaky("not stable")
fun listSharesFileAllShareTypes() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
@@ -283,36 +291,30 @@ class FileDetailSharingFragmentIT : AbstractIT() {
// for advanced permissions
@Test
@Suppress("MagicNumber")
@Flaky("not stable")
fun publicLinkOptionMenuFolderAdvancePermission() {
launchActivity<TestActivity>().use { scenario ->
var sut: FileDetailSharingFragment? = null
var activity: TestActivity? = null
scenario.onActivity { testActivity ->
activity = testActivity
sut = FileDetailSharingFragment.newInstance(file, user)
activity.addFragment(sut)
activity.supportFragmentManager.executePendingTransactions()
lateinit var sut: FileDetailSharingFragment
scenario.onActivity { activity ->
sut = addSharingFragment(activity)
}
setupSecondaryFragment()
sut!!.refreshCapabilitiesFromDB()
val publicShare = OCShare().apply {
isFolder = true
shareType = ShareType.PUBLIC_LINK
permissions = 17
}
activity!!.runOnUiThread { sut.showSharingMenuActionSheet(publicShare) }
scenario.onActivity { sut.showSharingMenuActionSheet(publicShare) }
// check if items are visible
onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.menu_share_send_new_email)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.menu_share_send_link)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.menu_share_unshare)).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_advanced_permissions).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_send_new_email).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_send_link).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_unshare).check(matches(isDisplayed()))
// click event
onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).perform(ViewActions.click())
onMenuItem(R.id.menu_share_advanced_permissions).perform(ViewActions.click())
// validate view shown on screen
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isDisplayed()))
@@ -326,57 +328,57 @@ class FileDetailSharingFragmentIT : AbstractIT() {
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isChecked()))
onView(ViewMatchers.withId(R.id.can_edit_radio_button)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.file_request_radio_button)).check(matches(isNotChecked()))
goBack()
goBack(scenario)
// upload and editing
publicShare.permissions = MAXIMUM_PERMISSIONS_FOR_FOLDER
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.can_edit_radio_button)).check(matches(isChecked()))
onView(ViewMatchers.withId(R.id.file_request_radio_button)).check(matches(isNotChecked()))
goBack()
goBack(scenario)
// file request
publicShare.permissions = 4
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.can_edit_radio_button)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.file_request_radio_button)).check(matches(isChecked()))
goBack()
goBack(scenario)
// password protection
publicShare.shareWith = "someValue"
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.share_process_set_password_switch)).check(matches(isChecked()))
goBack()
goBack(scenario)
publicShare.shareWith = ""
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.share_process_set_password_switch)).check(matches(isNotChecked()))
goBack()
goBack(scenario)
// hide download
publicShare.isHideFileDownload = true
publicShare.permissions = MAXIMUM_PERMISSIONS_FOR_FOLDER
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.share_process_hide_download_checkbox)).check(matches(isChecked()))
goBack()
goBack(scenario)
publicShare.isHideFileDownload = false
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(
ViewMatchers.withId(R.id.share_process_hide_download_checkbox)
).check(matches(isNotChecked()))
goBack()
goBack(scenario)
publicShare.expirationDate = 1582019340000
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.share_process_set_exp_date_switch)).check(matches(isChecked()))
onView(ViewMatchers.withId(R.id.share_process_select_exp_date)).check(matches(not(withText(""))))
goBack()
goBack(scenario)
publicShare.expirationDate = 0
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.share_process_set_exp_date_switch)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.share_process_select_exp_date)).check(matches(withText("")))
}
@@ -386,76 +388,76 @@ class FileDetailSharingFragmentIT : AbstractIT() {
// for send new email
@Test
@Suppress("MagicNumber")
@Flaky("not stable")
fun publicLinkOptionMenuFolderSendNewEmail() {
launchActivity<TestActivity>().use { scenario ->
var sut: FileDetailSharingFragment? = null
lateinit var sut: FileDetailSharingFragment
scenario.onActivity { activity ->
sut = FileDetailSharingFragment.newInstance(file, user)
activity.addFragment(sut)
sut.refreshCapabilitiesFromDB()
sut = addSharingFragment(activity)
}
setupSecondaryFragment()
val publicShare = OCShare().apply {
isFolder = true
shareType = ShareType.PUBLIC_LINK
permissions = 17
}
verifySendNewEmail(sut!!, publicShare)
verifySendNewEmail(scenario, sut, publicShare)
}
}
private fun setupSecondaryFragment() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
val parentFolder = OCFile("/")
val secondary = FileDetailFragment.newInstance(file, parentFolder, user)
activity.addSecondaryFragment(secondary, FileDisplayActivity.TAG_LIST_OF_FILES)
activity.addView(
FloatingActionButton(activity).apply {
// needed for some reason
visibility = View.GONE
id = R.id.fab_main
}
)
private fun addSharingFragment(activity: TestActivity): FileDetailSharingFragment {
val fragment = FileDetailSharingFragment.newInstance(file, user)
activity.addFragment(fragment)
fragment.refreshCapabilitiesFromDB()
setupSecondaryFragment(activity)
activity.supportFragmentManager.executePendingTransactions()
return fragment
}
// the sharing action sheet is a BottomSheetDialog, so its items must be matched in the dialog window
private fun onMenuItem(id: Int) = onView(ViewMatchers.withId(id)).inRoot(isDialog())
private fun setupSecondaryFragment(activity: TestActivity) {
val parentFolder = OCFile("/")
val secondary = FileDetailFragment.newInstance(file, parentFolder, user)
activity.addSecondaryFragment(secondary, FileDisplayActivity.TAG_LIST_OF_FILES)
activity.addView(
FloatingActionButton(activity).apply {
// needed for some reason
visibility = View.GONE
id = R.id.fab_main
}
}
)
}
// public link and email are handled the same way
// for advanced permissions
@Test
@Suppress("MagicNumber")
@Flaky("not stable")
fun publicLinkOptionMenuFileAdvancePermission() {
launchActivity<TestActivity>().use { scenario ->
var sut: FileDetailSharingFragment? = null
var activity: TestActivity? = null
scenario.onActivity { testActivity ->
activity = testActivity
sut = FileDetailSharingFragment.newInstance(file, user)
activity.addFragment(sut)
sut.refreshCapabilitiesFromDB()
lateinit var sut: FileDetailSharingFragment
scenario.onActivity { activity ->
sut = addSharingFragment(activity)
}
setupSecondaryFragment()
val publicShare = OCShare().apply {
isFolder = false
shareType = ShareType.PUBLIC_LINK
permissions = 17
}
activity!!.handler.post { sut!!.showSharingMenuActionSheet(publicShare) }
scenario.onActivity { sut.showSharingMenuActionSheet(publicShare) }
// check if items are visible
onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.menu_share_send_new_email)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.menu_share_send_link)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.menu_share_unshare)).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_advanced_permissions).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_send_new_email).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_send_link).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_unshare).check(matches(isDisplayed()))
// click event
onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).perform(ViewActions.click())
onMenuItem(R.id.menu_share_advanced_permissions).perform(ViewActions.click())
// validate view shown on screen
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isDisplayed()))
@@ -471,50 +473,50 @@ class FileDetailSharingFragmentIT : AbstractIT() {
publicShare.permissions = 17 // from server
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isChecked()))
onView(ViewMatchers.withId(R.id.can_edit_radio_button)).check(matches(isNotChecked()))
goBack()
goBack(scenario)
// editing
publicShare.permissions = MAXIMUM_PERMISSIONS_FOR_FILE // from server
openAdvancedPermissions(sut!!, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.can_edit_radio_button)).check(matches(isChecked()))
goBack()
goBack(scenario)
// hide download
publicShare.isHideFileDownload = true
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.share_process_hide_download_checkbox)).check(matches(isChecked()))
goBack()
goBack(scenario)
publicShare.isHideFileDownload = false
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(
ViewMatchers.withId(R.id.share_process_hide_download_checkbox)
).check(matches(isNotChecked()))
goBack()
goBack(scenario)
// password protection
publicShare.isPasswordProtected = true
publicShare.shareWith = "someValue"
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.share_process_set_password_switch)).check(matches(isChecked()))
goBack()
goBack(scenario)
publicShare.isPasswordProtected = false
publicShare.shareWith = ""
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.share_process_set_password_switch)).check(matches(isNotChecked()))
goBack()
goBack(scenario)
// expires
publicShare.expirationDate = 1582019340
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.share_process_set_exp_date_switch)).check(matches(isChecked()))
onView(ViewMatchers.withId(R.id.share_process_select_exp_date)).check(matches(not(withText(""))))
goBack()
goBack(scenario)
publicShare.expirationDate = 0
openAdvancedPermissions(sut, publicShare)
openAdvancedPermissions(scenario, sut, publicShare)
onView(ViewMatchers.withId(R.id.share_process_set_exp_date_switch)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.share_process_select_exp_date)).check(matches(withText("")))
}
@@ -524,25 +526,21 @@ class FileDetailSharingFragmentIT : AbstractIT() {
// for send new email
@Test
@Suppress("MagicNumber")
@Flaky("not stable")
fun publicLinkOptionMenuFileSendNewEmail() {
launchActivity<TestActivity>().use { scenario ->
var sut: FileDetailSharingFragment? = null
lateinit var sut: FileDetailSharingFragment
scenario.onActivity { activity ->
sut = FileDetailSharingFragment.newInstance(file, user)
activity.addFragment(sut)
sut.refreshCapabilitiesFromDB()
sut = addSharingFragment(activity)
}
setupSecondaryFragment()
val publicShare = OCShare().apply {
isFolder = false
shareType = ShareType.PUBLIC_LINK
permissions = 17
}
verifySendNewEmail(sut!!, publicShare)
verifySendNewEmail(scenario, sut, publicShare)
}
}
@@ -554,36 +552,31 @@ class FileDetailSharingFragmentIT : AbstractIT() {
// for advanced permissions
@Test
@Suppress("MagicNumber")
@Flaky("not stable")
fun userOptionMenuFileAdvancePermission() {
launchActivity<TestActivity>().use { scenario ->
var activity: TestActivity? = null
var sut: FileDetailSharingFragment? = null
scenario.onActivity { testActivity ->
activity = testActivity
sut = FileDetailSharingFragment.newInstance(file, user)
lateinit var sut: FileDetailSharingFragment
scenario.onActivity { activity ->
suppressFDFAccessibilityChecks()
activity.addFragment(sut)
sut.refreshCapabilitiesFromDB()
sut = addSharingFragment(activity)
}
setupSecondaryFragment()
val userShare = OCShare().apply {
isFolder = false
shareType = ShareType.USER
permissions = 17
}
activity!!.runOnUiThread { sut!!.showSharingMenuActionSheet(userShare) }
scenario.onActivity { sut.showSharingMenuActionSheet(userShare) }
// check if items are visible
onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.menu_share_send_new_email)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.menu_share_send_link)).check(matches(not(isDisplayed())))
onView(ViewMatchers.withId(R.id.menu_share_unshare)).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_advanced_permissions).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_send_new_email).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_send_link).check(matches(not(isDisplayed())))
onMenuItem(R.id.menu_share_unshare).check(matches(isDisplayed()))
// click event
onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).perform(ViewActions.click())
onMenuItem(R.id.menu_share_advanced_permissions).perform(ViewActions.click())
// validate view shown on screen
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isDisplayed()))
@@ -605,24 +598,24 @@ class FileDetailSharingFragmentIT : AbstractIT() {
userShare.permissions = 17 // from server
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isChecked()))
onView(ViewMatchers.withId(R.id.can_edit_radio_button)).check(matches(isNotChecked()))
goBack()
goBack(scenario)
// editing
userShare.permissions = MAXIMUM_PERMISSIONS_FOR_FILE // from server
openAdvancedPermissions(sut!!, userShare)
openAdvancedPermissions(scenario, sut, userShare)
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.can_edit_radio_button)).check(matches(isChecked()))
goBack()
goBack(scenario)
// set expiration date
userShare.expirationDate = 1582019340000
openAdvancedPermissions(sut, userShare)
openAdvancedPermissions(scenario, sut, userShare)
onView(ViewMatchers.withId(R.id.share_process_set_exp_date_switch)).check(matches(isChecked()))
onView(ViewMatchers.withId(R.id.share_process_select_exp_date)).check(matches(not(withText(""))))
goBack()
goBack(scenario)
userShare.expirationDate = 0
openAdvancedPermissions(sut, userShare)
openAdvancedPermissions(scenario, sut, userShare)
onView(ViewMatchers.withId(R.id.share_process_set_exp_date_switch)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.share_process_select_exp_date)).check(matches(withText("")))
}
@@ -653,17 +646,14 @@ class FileDetailSharingFragmentIT : AbstractIT() {
// for send new email
@Test
@Suppress("MagicNumber")
@Flaky("not stable")
fun userOptionMenuFileSendNewEmail() {
launchActivity<TestActivity>().use { scenario ->
var sut: FileDetailSharingFragment? = null
lateinit var sut: FileDetailSharingFragment
scenario.onActivity { activity ->
sut = FileDetailSharingFragment.newInstance(file, user)
activity.addFragment(sut)
sut.refreshCapabilitiesFromDB()
sut = addSharingFragment(activity)
}
setupSecondaryFragment()
val userShare = OCShare().apply {
remoteId = 1001L
isFolder = false
@@ -671,7 +661,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
permissions = 17
}
verifySendNewEmail(sut!!, userShare)
verifySendNewEmail(scenario, sut, userShare)
}
}
@@ -683,41 +673,37 @@ class FileDetailSharingFragmentIT : AbstractIT() {
// for advanced permissions
@Test
@Suppress("MagicNumber")
@Flaky("not stable")
fun userOptionMenuFolderAdvancePermission() {
launchActivity<TestActivity>().use { scenario ->
var activity: TestActivity? = null
var sut: FileDetailSharingFragment? = null
scenario.onActivity { testActivity ->
activity = testActivity
sut = FileDetailSharingFragment.newInstance(file, user)
activity.addFragment(sut)
lateinit var sut: FileDetailSharingFragment
scenario.onActivity { activity ->
suppressFDFAccessibilityChecks()
sut.refreshCapabilitiesFromDB()
sut = addSharingFragment(activity)
}
setupSecondaryFragment()
val userShare = OCShare().apply {
isFolder = true
shareType = ShareType.USER
permissions = 17
}
activity!!.runOnUiThread { sut!!.showSharingMenuActionSheet(userShare) }
scenario.onActivity { sut.showSharingMenuActionSheet(userShare) }
// check if items are visible
onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.menu_share_send_new_email)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.menu_share_send_link)).check(matches(not(isDisplayed())))
onView(ViewMatchers.withId(R.id.menu_share_unshare)).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_advanced_permissions).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_send_new_email).check(matches(isDisplayed()))
onMenuItem(R.id.menu_share_send_link).check(matches(not(isDisplayed())))
onMenuItem(R.id.menu_share_unshare).check(matches(isDisplayed()))
// click event
onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).perform(ViewActions.click())
onMenuItem(R.id.menu_share_advanced_permissions).perform(ViewActions.click())
// validate view shown on screen
// file request is only offered for public link and email shares, not for user shares
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.can_edit_radio_button)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.file_request_radio_button)).check(matches(isDisplayed()))
onView(ViewMatchers.withId(R.id.file_request_radio_button)).check(matches(not(isDisplayed())))
onView(
ViewMatchers.withId(R.id.share_process_hide_download_checkbox)
).check(matches(not(isDisplayed())))
@@ -732,63 +718,46 @@ class FileDetailSharingFragmentIT : AbstractIT() {
userShare.permissions = 17 // from server
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isChecked()))
onView(ViewMatchers.withId(R.id.can_edit_radio_button)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.file_request_radio_button)).check(matches(isNotChecked()))
goBack()
goBack(scenario)
// allow upload & editing
userShare.permissions = MAXIMUM_PERMISSIONS_FOR_FOLDER // from server
openAdvancedPermissions(sut!!, userShare)
openAdvancedPermissions(scenario, sut, userShare)
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.can_edit_radio_button)).check(matches(isChecked()))
onView(ViewMatchers.withId(R.id.file_request_radio_button)).check(matches(isNotChecked()))
goBack()
// file request
userShare.permissions = 4
openAdvancedPermissions(sut, userShare)
onView(ViewMatchers.withId(R.id.view_only_radio_button)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.can_edit_radio_button)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.file_request_radio_button)).check(matches(isChecked()))
goBack()
goBack(scenario)
// set expiration date
userShare.expirationDate = 1582019340000
openAdvancedPermissions(sut, userShare)
openAdvancedPermissions(scenario, sut, userShare)
onView(ViewMatchers.withId(R.id.share_process_set_exp_date_switch)).check(matches(isChecked()))
onView(ViewMatchers.withId(R.id.share_process_select_exp_date)).check(matches(not(withText(""))))
goBack()
goBack(scenario)
userShare.expirationDate = 0
openAdvancedPermissions(sut, userShare)
openAdvancedPermissions(scenario, sut, userShare)
onView(ViewMatchers.withId(R.id.share_process_set_exp_date_switch)).check(matches(isNotChecked()))
onView(ViewMatchers.withId(R.id.share_process_select_exp_date)).check(matches(withText("")))
}
}
// open bottom sheet with actions
private fun openAdvancedPermissions(sut: FileDetailSharingFragment, userShare: OCShare) {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
activity.handler.post {
sut.showSharingMenuActionSheet(userShare)
}
}
onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).perform(ViewActions.click())
}
private fun openAdvancedPermissions(
scenario: ActivityScenario<TestActivity>,
sut: FileDetailSharingFragment,
userShare: OCShare
) {
scenario.onActivity { sut.showSharingMenuActionSheet(userShare) }
onMenuItem(R.id.menu_share_advanced_permissions).perform(ViewActions.click())
}
// remove the fragment shown
private fun goBack() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
activity.handler.post {
val processFragment =
activity.supportFragmentManager.findFragmentByTag(FileDetailsSharingProcessFragment.TAG) as
FileDetailsSharingProcessFragment
processFragment.activity?.onBackPressedDispatcher?.onBackPressed()
}
}
private fun goBack(scenario: ActivityScenario<TestActivity>) {
scenario.onActivity { activity ->
val processFragment =
activity.supportFragmentManager.findFragmentByTag(FileDetailsSharingProcessFragment.TAG) as
FileDetailsSharingProcessFragment
processFragment.onBackPressed()
}
}
@@ -800,45 +769,43 @@ class FileDetailSharingFragmentIT : AbstractIT() {
// for send new email
@Test
@Suppress("MagicNumber")
@Flaky(reason = "Share option menu occasionally does not open before the assertions run")
fun userOptionMenuFolderSendNewEmail() {
launchActivity<TestActivity>().use { scenario ->
var sut: FileDetailSharingFragment? = null
lateinit var sut: FileDetailSharingFragment
scenario.onActivity { activity ->
sut = FileDetailSharingFragment.newInstance(file, user)
activity.addFragment(sut)
sut.refreshCapabilitiesFromDB()
sut = addSharingFragment(activity)
}
setupSecondaryFragment()
val userShare = OCShare().apply {
isFolder = true
shareType = ShareType.USER
permissions = 17
}
verifySendNewEmail(sut!!, userShare)
verifySendNewEmail(scenario, sut, userShare)
}
}
/**
* verify send new email note text
*/
private fun verifySendNewEmail(sut: FileDetailSharingFragment, userShare: OCShare) {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
activity.runOnUiThread { sut.showSharingMenuActionSheet(userShare) }
}
private fun verifySendNewEmail(
scenario: ActivityScenario<TestActivity>,
sut: FileDetailSharingFragment,
userShare: OCShare
) {
scenario.onActivity { sut.showSharingMenuActionSheet(userShare) }
// click event
onView(ViewMatchers.withId(R.id.menu_share_send_new_email)).perform(ViewActions.click())
// click event
onMenuItem(R.id.menu_share_send_new_email).perform(ViewActions.click())
// validate view shown on screen
onView(ViewMatchers.withId(R.id.note_text)).check(matches(isDisplayed()))
}
// validate view shown on screen
onView(ViewMatchers.withId(R.id.note_text)).check(matches(isDisplayed()))
}
@Test
@Flaky("not stable")
fun testUploadAndEditingSharePermissions() {
val testCases = mapOf(
MAXIMUM_PERMISSIONS_FOR_FOLDER to true,
@@ -857,6 +824,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
}
@Test
@Flaky("not stable")
fun testReadOnlySharePermissions() {
val testCases = mapOf(
READ_PERMISSION_FLAG to true,
@@ -876,6 +844,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
}
@Test
@Flaky("not stable")
fun testFileRequestSharePermission() {
val testCases = mapOf(
CREATE_PERMISSION_FLAG to true,
@@ -898,6 +867,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
}
@Test
@Flaky("not stable")
fun internalLinkUsesPrettyPathWhenModRewriteWorking() {
launchActivity<TestActivity>().use { scenario ->
var sut: FileDetailSharingFragment? = null
@@ -916,6 +886,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
}
@Test
@Flaky("not stable")
fun internalLinkUsesDefaultPathWhenModRewriteNotWorking() {
launchActivity<TestActivity>().use { scenario ->
var sut: FileDetailSharingFragment? = null
@@ -933,6 +904,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
}
@Test
@Flaky("not stable")
fun internalLinkFallsBackToDefaultPathWhenCapabilitiesNull() {
launchActivity<TestActivity>().use { scenario ->
var sut: FileDetailSharingFragment? = null
@@ -27,12 +27,14 @@ import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withId
import com.nextcloud.test.Flaky
import com.nextcloud.test.TestActivity
import com.nextcloud.utils.extensions.getBigThumbnail
import com.nextcloud.utils.extensions.getBigThumbnailKey
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.datamodel.ThumbnailsCacheManager
import com.owncloud.android.datamodel.ThumbnailsCacheManager.PREFIX_RESIZED_IMAGE
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.lib.resources.files.model.ImageDimension
import com.owncloud.android.ui.adapter.GalleryRowHolder
@@ -100,6 +102,7 @@ class GalleryFragmentIT : AbstractIT() {
}
@Test
@Flaky(reason = "Gallery sections are occasionally not laid out before the multi select assertions run")
fun multiSelect() {
val imageCount = 100
for (num in 1..imageCount) {
@@ -219,9 +222,9 @@ class GalleryFragmentIT : AbstractIT() {
drawRGB(random.nextInt(256), random.nextInt(256), random.nextInt(256))
drawCircle(w / 2f, h / 2f, w.coerceAtMost(h) / 2f, Paint().apply { color = Color.BLACK })
}
ThumbnailsCacheManager.addBitmapToCache(PREFIX_RESIZED_IMAGE + file.remoteId, bitmap)
ThumbnailsCacheManager.addBitmapToCache(file.getBigThumbnailKey(), bitmap)
assertNotNull(ThumbnailsCacheManager.getBitmapFromDiskCache(PREFIX_RESIZED_IMAGE + file.remoteId))
assertNotNull(file.getBigThumbnail())
Log_OC.d("Gallery_thumbnail", "created $id with ${bitmap.width} x ${bitmap.height}")
}
@@ -22,6 +22,7 @@ import androidx.test.espresso.matcher.ViewMatchers.isEnabled
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import com.nextcloud.test.Flaky
import com.nextcloud.test.GrantStoragePermissionRule.Companion.grant
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
@@ -36,6 +37,7 @@ import com.owncloud.android.utils.MimeType
import com.owncloud.android.utils.ScreenshotTest
import org.hamcrest.Matchers.allOf
import org.hamcrest.Matchers.not
import org.junit.After
import org.junit.Assert
import org.junit.Before
import org.junit.Rule
@@ -53,6 +55,11 @@ class OCFileListFragmentStaticServerIT : AbstractIT() {
Intents.init()
}
@After
fun releaseIntentRecording() {
Intents.release()
}
@Test
@ScreenshotTest
@Suppress("MagicNumber")
@@ -417,6 +424,7 @@ class OCFileListFragmentStaticServerIT : AbstractIT() {
}
@Test
@Flaky(reason = "Folder picker activity is occasionally not started before the intent assertions run")
fun shouldStartMoveInParentFolder() {
launchActivity<TestActivity>().use { scenario ->
val fragment = OCFileListFragment()
@@ -13,11 +13,13 @@ import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import com.nextcloud.test.Flaky
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.common.SearchResultEntry
import com.owncloud.android.ui.unifiedsearch.UnifiedSearchSection
import com.owncloud.android.ui.unifiedsearch.toUnifiedSearchEntry
import com.owncloud.android.ui.unifiedsearch.UnifiedSearchViewModel
import org.junit.Test
import java.io.File
@@ -25,6 +27,7 @@ import java.io.File
class UnifiedSearchFragmentIT : AbstractIT() {
@Test
@Flaky(reason = "Search result list is occasionally not rendered before the assertions run")
fun showSearchResult() {
launchActivity<TestActivity>().use { scenario ->
@@ -45,7 +48,7 @@ class UnifiedSearchFragmentIT : AbstractIT() {
"http://localhost/nc/index.php/apps/files/?dir=/Files&scrollto=Test",
"icon",
false
)
).toUnifiedSearchEntry(storageManager)
),
hasMoreResults = false
)
@@ -58,6 +61,7 @@ class UnifiedSearchFragmentIT : AbstractIT() {
}
@Test
@Flaky(reason = "Search runs asynchronously and does not always complete before the assertions run")
fun search() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
@@ -22,6 +22,7 @@ import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import com.nextcloud.test.FileRemovedIdlingResource
import com.nextcloud.test.Flaky
import com.nextcloud.test.LoopFailureHandler
import com.owncloud.android.AbstractOnServerIT
import com.owncloud.android.R
@@ -29,6 +30,7 @@ import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.db.OCUpload
import com.owncloud.android.files.services.NameCollisionPolicy
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation
import com.owncloud.android.utils.FileStorageUtils
import org.hamcrest.Matchers.allOf
import org.junit.After
import org.junit.Assert.assertFalse
@@ -49,29 +51,20 @@ class PreviewImageActivityIT : AbstractOnServerIT() {
private fun createLocalMockedImageFiles(count: Int): List<OCFile> {
val srcPngFile = getFile("imageFile.png")
return (0 until count).map { i ->
val pngFile = File(srcPngFile.parent ?: ".", "image$i.png")
srcPngFile.copyTo(pngFile, overwrite = true)
OCFile("/${pngFile.name}").apply {
storagePath = pngFile.absolutePath
OCFile("/image$i.png").apply {
mimeType = "image/png"
modificationTimestamp = 1000000
permissions = "D" // OCFile.PERMISSION_CAN_DELETE_OR_LEAVE_SHARE. Required for deletion button to show
permissions = OCFile.PERMISSION_CAN_DELETE_OR_LEAVE_SHARE
val localCopy = File(FileStorageUtils.getDefaultSavePathFor(user.accountName, this))
localCopy.parentFile?.mkdirs()
srcPngFile.copyTo(localCopy, overwrite = true)
storagePath = localCopy.absolutePath
}.also {
storageManager.saveNewFile(it)
}
}
}
/**
* Create image files and upload them to the connected server.
*
* This function relies on the images not existing beforehand, as AbstractOnServerIT#deleteAllFilesOnServer()
* should clean up. If it does fail, likely because that clean up didn't work and there are leftovers from
* a previous run
* @param count Number of files to create
* @param folder Parent folder to which to upload. Must start and end with a slash
*/
private fun createAndUploadImageFiles(count: Int, folder: String = REMOTE_FOLDER): List<OCFile> {
val srcPngFile = getFile("imageFile.png")
return (0 until count).map { i ->
@@ -200,16 +193,19 @@ class PreviewImageActivityIT : AbstractOnServerIT() {
}
@Test
@Flaky(reason = "Slideshow pager does not always settle on the next image before the assertions run")
fun deleteFromSlideshow_localOnly_online() {
testDeleteFromSlideshow_impl(localOnly = true, offline = false)
}
@Test
@Flaky(reason = "Slideshow pager does not always settle on the next image before the assertions run")
fun deleteFromSlideshow_localOnly_offline() {
testDeleteFromSlideshow_impl(localOnly = true, offline = true)
}
@Test
@Flaky(reason = "Remote delete races with the slideshow pager update, so the assertions run too early")
fun deleteFromSlideshow_remote_online() {
testDeleteFromSlideshow_impl(localOnly = false, offline = false)
}
@@ -6,13 +6,13 @@
*/
package com.owncloud.android.ui.preview
import android.Manifest
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.rule.GrantPermissionRule
import com.nextcloud.test.GrantTestPermissionRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.ui.activity.FileDisplayActivity
@@ -26,10 +26,7 @@ class PreviewTextFileFragmentTest : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.preview.PreviewTextFileFragmentTest"
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
val permissionRule: GrantPermissionRule = GrantTestPermissionRule.grantStorageAndNotification()
@Test
@ScreenshotTest
@@ -1,6 +1,7 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2023 Tobias Kaminsky <[email protected]>
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
@@ -139,6 +140,13 @@ class EncryptionUtilsV2IT : EncryptionIT() {
2J9mW5WvAAaG+j28Q/GKSuE=
""".trimIndent()
// Decryption derives the metadata version from the stored server capability, so align it with the fixture.
private fun setE2EECapabilityVersion(version: E2EVersion) {
val capability = storageManager.getCapability(account.name)
capability.endToEndEncryptionApiVersion = version
storageManager.saveCapabilities(capability)
}
@Test
fun testEncryptDecryptMetadata() {
val metadataKey = EncryptionUtils.generateKey()
@@ -247,6 +255,7 @@ class EncryptionUtilsV2IT : EncryptionIT() {
}
val metadataFile = generateDecryptedFolderMetadataFile(enc1, enc1Cert)
setE2EECapabilityVersion(E2EVersion.fromValue(metadataFile.version))
val encrypted = encryptionUtilsV2.encryptFolderMetadataFile(
metadataFile,
@@ -300,8 +309,7 @@ class EncryptionUtilsV2IT : EncryptionIT() {
// random string, not real tag
EncryptionUtils.generateUid(),
EncryptionUtils.generateKey(),
metadataFile,
storageManager
metadataFile
)
assertEquals(3, updatedMetadata.metadata.files.size)
@@ -341,7 +349,6 @@ class EncryptionUtilsV2IT : EncryptionIT() {
@Test
fun addFolder() {
val folder = OCFile("/e/")
val enc1 = MockUser("enc1", "Nextcloud")
val metadataFile = generateDecryptedFolderMetadataFile(enc1, enc1Cert)
assertEquals(2, metadataFile.metadata.files.size)
@@ -350,9 +357,7 @@ class EncryptionUtilsV2IT : EncryptionIT() {
val updatedMetadata = encryptionUtilsV2.addFolderToMetadata(
EncryptionUtils.generateUid(),
"new subfolder",
metadataFile,
folder,
storageManager
metadataFile
)
assertEquals(2, updatedMetadata.metadata.files.size)
@@ -361,7 +366,6 @@ class EncryptionUtilsV2IT : EncryptionIT() {
@Test
fun removeFolder() {
val folder = OCFile("/e/")
val enc1 = MockUser("enc1", "Nextcloud")
val metadataFile = generateDecryptedFolderMetadataFile(enc1, enc1Cert)
assertEquals(2, metadataFile.metadata.files.size)
@@ -371,9 +375,7 @@ class EncryptionUtilsV2IT : EncryptionIT() {
var updatedMetadata = encryptionUtilsV2.addFolderToMetadata(
encryptedFileName,
"new subfolder",
metadataFile,
folder,
storageManager
metadataFile
)
assertEquals(2, updatedMetadata.metadata.files.size)
@@ -810,6 +812,7 @@ class EncryptionUtilsV2IT : EncryptionIT() {
fun encryptionMetadataV2() {
val decryptedFolderMetadata1: DecryptedFolderMetadataFile =
EncryptionTestUtils().generateFolderMetadataV2(client.userId, EncryptionTestIT.publicKey)
setE2EECapabilityVersion(E2EVersion.fromValue(decryptedFolderMetadata1.version))
val root = OCFile("/")
storageManager.saveFile(root)
@@ -7,15 +7,32 @@
*/
package com.owncloud.android.utils
import android.os.Environment
import android.provider.MediaStore
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import java.io.File
class FileExportUtilsIT : AbstractIT() {
@Before
fun clearExistingDownload() {
val fileName = "export.txt"
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) {
targetContext.contentResolver.delete(
MediaStore.Downloads.EXTERNAL_CONTENT_URI,
"${MediaStore.MediaColumns.DISPLAY_NAME} = ?",
arrayOf(fileName)
)
} else {
File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), fileName).delete()
}
}
@Test
fun exportFile() {
val file = createFile("export.txt", 10)
@@ -23,7 +40,7 @@ class FileExportUtilsIT : AbstractIT() {
val sut = FileExportUtils()
val expectedFile = if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) {
File("/sdcard/Downloads/export.txt")
File("/sdcard/Download/export.txt")
} else {
File("/storage/emulated/0/Download/export.txt")
}
@@ -47,7 +64,7 @@ class FileExportUtilsIT : AbstractIT() {
val sut = FileExportUtils()
val expectedFile = if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) {
File("/sdcard/Downloads/export.txt")
File("/sdcard/Download/export.txt")
} else {
File("/storage/emulated/0/Download/export.txt")
}
@@ -19,8 +19,11 @@ import com.owncloud.android.files.services.NameCollisionPolicy
import com.owncloud.android.lib.resources.status.OCCapability
import io.mockk.every
import io.mockk.mockk
import io.mockk.mockkStatic
import io.mockk.spyk
import io.mockk.unmockkStatic
import io.mockk.verify
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
@@ -43,9 +46,7 @@ class FileUploadHelperTest {
val mockFileStorageManager = mockk<com.owncloud.android.datamodel.FileDataStorageManager>(relaxed = true)
every { mockFileStorageManager.getCapability(any<com.nextcloud.client.account.User>()) } returns mockCapability
val field = FileUploadHelper::class.java.getDeclaredField("fileStorageManager")
field.isAccessible = true
field.set(fileUploadHelper, mockFileStorageManager)
fileUploadHelper.fileStorageManager = mockFileStorageManager
}
@Suppress("LongParameterList")
@@ -104,19 +105,25 @@ class FileUploadHelperTest {
@Before
fun setUp() {
mockkStatic("com.nextcloud.utils.extensions.OCCapabilityExtensionsKt")
uploadDao = mockk(relaxed = true)
fileUploadHelper = spyk(FileUploadHelper(), recordPrivateCalls = true)
val uploadsStorageManager = mockk<com.owncloud.android.datamodel.UploadsStorageManager>(relaxed = true)
every { uploadsStorageManager.uploadDao } returns uploadDao
val daoField = com.owncloud.android.datamodel.UploadsStorageManager::class.java
.declaredFields
.first { it.type == UploadDao::class.java }
daoField.isAccessible = true
daoField.set(uploadsStorageManager, uploadDao)
val accountManager = mockk<com.nextcloud.client.account.UserAccountManager>(relaxed = true)
val field = FileUploadHelper::class.java.getDeclaredField("uploadsStorageManager")
field.isAccessible = true
field.set(fileUploadHelper, uploadsStorageManager)
fileUploadHelper = spyk(FileUploadHelper(), recordPrivateCalls = true)
fileUploadHelper.uploadsStorageManager = uploadsStorageManager
fileUploadHelper.accountManager = accountManager
toggleWCFRestrictions(false)
}
@After
fun tearDown() {
unmockkStatic("com.nextcloud.utils.extensions.OCCapabilityExtensionsKt")
}
@Test
@@ -1,142 +0,0 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.owncloud.android.utils
import android.app.Activity
import android.app.Instrumentation
import android.content.Intent
import androidx.annotation.StringRes
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.Intents.intending
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withText
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.nextcloud.client.onboarding.FirstRunActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.R
import com.owncloud.android.authentication.AuthenticatorActivity
import org.hamcrest.Matchers.anyOf
import org.junit.After
import org.junit.Before
import org.junit.Test
class SnackbarTests {
class NormalTestFragment : Fragment()
class DialogTestFragment : DialogFragment()
class BottomSheetTestFragment : BottomSheetDialogFragment()
@Before
fun setUp() {
Intents.init()
val cancelledResult = Instrumentation.ActivityResult(Activity.RESULT_CANCELED, Intent())
intending(
anyOf(
hasComponent(AuthenticatorActivity::class.java.name),
hasComponent(FirstRunActivity::class.java.name)
)
).respondWith(cancelledResult)
}
@After
fun tearDown() {
Intents.release()
}
private fun assertSnackbarVisible(msg: String) {
onView(withText(msg)).check(matches(isDisplayed()))
}
private fun assertSnackbarVisible(@StringRes msgRes: Int) {
onView(withText(msgRes)).check(matches(isDisplayed()))
}
private fun testFragmentSnackbar(fragment: Fragment, @StringRes msgRes: Int) {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { sut ->
sut.addFragment(fragment)
}
scenario.onActivity {
DisplayUtils.showSnackMessage(fragment, msgRes)
}
assertSnackbarVisible(msgRes)
}
}
@Test
fun testNormalFragmentSnackbar() {
testFragmentSnackbar(NormalTestFragment(), R.string.app_name)
}
@Test
fun testDialogFragmentSnackbar() {
testFragmentSnackbar(DialogTestFragment(), R.string.app_name)
}
@Test
fun testBottomSheetFragmentSnackbar() {
testFragmentSnackbar(BottomSheetTestFragment(), R.string.app_name)
}
@Test
fun testNullFragmentSnackbarShouldNotCrash() {
DisplayUtils.showSnackMessage(null as Fragment?, R.string.app_name)
}
@Test
fun testActivityStringResSnackbar() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { sut ->
DisplayUtils.showSnackMessage(sut, R.string.app_name)
}
assertSnackbarVisible(R.string.app_name)
}
}
@Test
fun testActivityStringSnackbar() {
launchActivity<TestActivity>().use { scenario ->
var message = ""
scenario.onActivity { sut ->
message = sut.getString(R.string.app_name)
DisplayUtils.showSnackMessage(sut, message)
}
assertSnackbarVisible(message)
}
}
@Test
fun testViewStringResSnackbar() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { sut ->
val contentView = sut.findViewById<android.view.View>(android.R.id.content)
DisplayUtils.showSnackMessage(contentView, R.string.app_name)
}
assertSnackbarVisible(R.string.app_name)
}
}
@Test
fun testViewStringSnackbar() {
launchActivity<TestActivity>().use { scenario ->
var message = ""
scenario.onActivity { sut ->
message = sut.getString(R.string.app_name)
val contentView = sut.findViewById<android.view.View>(android.R.id.content)
DisplayUtils.showSnackMessage(contentView, message)
}
assertSnackbarVisible(message)
}
}
}
@@ -18,7 +18,7 @@ class CapabilityUtilsIT : AbstractIT() {
@Test
fun checkOutdatedWarning() {
assertFalse(test(NextcloudVersion.nextcloud_31))
assertFalse(test(NextcloudVersion.nextcloud_30))
assertTrue(test(NextcloudVersion.nextcloud_30))
assertTrue(test(NextcloudVersion.nextcloud_29))
assertTrue(test(NextcloudVersion.nextcloud_28))
@@ -35,7 +35,7 @@ class CapabilityUtilsIT : AbstractIT() {
@Test
fun checkOutdatedWarningWithSubscription() {
assertFalse(test(NextcloudVersion.nextcloud_31))
assertFalse(test(NextcloudVersion.nextcloud_30))
assertTrue(test(NextcloudVersion.nextcloud_30))
assertFalse(test(OwnCloudVersion.nextcloud_20, true))
}
+6
View File
@@ -15,6 +15,12 @@
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
<!-- Used for document scanning, but lib declares it as required, which it's not -->
<uses-feature
android:name="android.hardware.camera2"
android:required="false"
tools:node="replace" />
<application
android:name=".MainApp"
android:icon="@mipmap/ic_launcher"
+6
View File
@@ -9,6 +9,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- Used for document scanning, but lib declares it as required, which it's not -->
<uses-feature
android:name="android.hardware.camera2"
android:required="false"
tools:node="replace" />
<application
android:name=".MainApp"
android:fullBackupContent="@xml/backup_config"
+7 -8
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2024 TSI-mc <surinder.kumar@t-systems.com>
~ SPDX-FileCopyrightText: 2024-2025 TSI-mc <surinder.kumar@t-systems.com>
~ SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-->
@@ -11,13 +11,9 @@
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" /> <!-- Used for document scanning, but lib declares it as required, which it's not -->
<uses-feature
android:name="android.hardware.camera2"
android:required="false"
tools:node="replace" />
<!--
WRITE_EXTERNAL_STORAGE may be enabled or disabled by the user after installation in
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<!--
WRITE_EXTERNAL_STORAGE may be enabled or disabled by the user after installation in
API >= 23; the app needs to handle this
-->
<uses-permission
@@ -630,6 +626,9 @@
android:launchMode="singleTop"
android:theme="@style/Theme.ownCloud.Dialog.NoTitle"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".ui.activity.AlbumsPickerActivity"
android:exported="false" />
<activity
android:name=".ui.activity.ShareActivity"
android:exported="false"
@@ -9,6 +9,7 @@ package com.nextcloud.client.account;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import com.owncloud.android.MainApp;
@@ -30,6 +31,9 @@ public interface UserAccountManager extends CurrentAccountProvider {
String ACCOUNT_USES_STANDARD_PASSWORD = "ACCOUNT_USES_STANDARD_PASSWORD";
String PENDING_FOR_REMOVAL = "PENDING_FOR_REMOVAL";
@Nullable
Context getContext();
@Nullable
OwnCloudAccount getCurrentOwnCloudAccount();
@@ -55,7 +55,7 @@ public class UserAccountManagerImpl implements UserAccountManager {
private static final String TAG = UserAccountManagerImpl.class.getSimpleName();
private static final String PREF_SELECT_OC_ACCOUNT = "select_oc_account";
private Context context;
private final Context context;
private final AccountManager accountManager;
public static UserAccountManagerImpl fromContext(Context context) {
@@ -305,6 +305,12 @@ public class UserAccountManagerImpl implements UserAccountManager {
return AnonymousUser.fromContext(context);
}
@Nullable
@Override
public Context getContext() {
return context;
}
@Override
@Nullable
public OwnCloudAccount getCurrentOwnCloudAccount() {
@@ -201,7 +201,6 @@ class ChatViewModel(private val remoteRepository: AssistantRemoteRepository) : V
}
override fun onCleared() {
super.onCleared()
stopPolling()
}
}
@@ -1,6 +1,7 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
@@ -99,7 +100,9 @@ import com.owncloud.android.db.ProviderMeta
// manual migration used for 97 to 98
AutoMigration(from = 98, to = 99),
// manual migration used for 99 to 100
AutoMigration(from = 100, to = 101, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class)
AutoMigration(from = 100, to = 101, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class),
AutoMigration(from = 101, to = 102, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class),
AutoMigration(from = 102, to = 103, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class)
],
exportSchema = true
)
@@ -65,6 +65,23 @@ interface FileDao {
)
suspend fun getGalleryItemsSuspended(startDate: Long, endDate: Long, fileOwner: String): List<FileEntity>
@Query(
"SELECT * FROM filelist" +
" WHERE (content_type LIKE 'image/%' OR content_type LIKE 'video/%')" +
" AND file_owner = :fileOwner" +
" AND path LIKE :pathPrefix || '%'" +
" AND (:mimeFilter IS NULL OR content_type LIKE :mimeFilter)" +
" ORDER BY modified DESC" +
" LIMIT :limit OFFSET :offset"
)
suspend fun getGalleryItemsPageSuspended(
fileOwner: String,
pathPrefix: String,
mimeFilter: String?,
limit: Int,
offset: Int
): List<FileEntity>
@Query("SELECT * FROM filelist WHERE file_owner = :fileOwner ORDER BY ${ProviderTableMeta.FILE_DEFAULT_SORT_ORDER}")
fun getAllFiles(fileOwner: String): List<FileEntity>
@@ -12,6 +12,8 @@ import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.nextcloud.client.database.entity.ShareEntity
import com.nextcloud.client.database.entity.model.ShareeKey
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta
@Dao
interface ShareDao {
@@ -21,4 +23,12 @@ interface ShareDao {
@Query("DELETE FROM ocshares WHERE owner_share = :accountName")
suspend fun clearSharesForAccount(accountName: String)
@Query(
"SELECT path, ${ProviderTableMeta.OCSHARES_SHARE_WITH}, " +
"${ProviderTableMeta.OCSHARES_SHARE_TYPE} FROM ${ProviderTableMeta.OCSHARES_TABLE_NAME} " +
"WHERE path IN (:paths) AND owner_share = :accountName AND " +
"${ProviderTableMeta.OCSHARES_SHARE_TYPE} IN (:shareTypes)"
)
fun getShareeKeys(paths: List<String>, accountName: String, shareTypes: List<Int>): List<ShareeKey>
}
@@ -126,6 +126,8 @@ data class CapabilityEntity(
val dropAccount: Int?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_SECURITY_GUARD)
val securityGuard: Int?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_GOVERNANCE)
val governance: Int?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_FORBIDDEN_FILENAME_CHARACTERS)
val forbiddenFileNameCharacters: String?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_FORBIDDEN_FILENAMES)
@@ -153,7 +155,9 @@ data class CapabilityEntity(
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_CLIENT_INTEGRATION_JSON)
val clientIntegrationJson: String?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_MOD_REWRITE_WORKING)
val modRewriteWorking: Int?
val modRewriteWorking: Int?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_CHUNKED_UPLOAD_MAX_SIZE)
val chunkedUploadMaxSize: Long?
)
@Suppress("LongMethod", "ReturnCount")
@@ -222,6 +226,7 @@ fun CapabilityEntity?.toOCCapability(): OCCapability {
capability.groupfolders = intToBoolean(this.groupfolders)
capability.dropAccount = intToBoolean(this.dropAccount)
capability.securityGuard = intToBoolean(this.securityGuard)
capability.governance = intToBoolean(this.governance)
capability.forbiddenFilenameCharactersJson = this.forbiddenFileNameCharacters
capability.forbiddenFilenamesJson = this.forbiddenFileNames
capability.forbiddenFilenameExtensionJson = this.forbiddenFileNameExtensions
@@ -235,6 +240,7 @@ fun CapabilityEntity?.toOCCapability(): OCCapability {
capability.hasValidSubscription = intToBoolean(this.hasValidSubscription)
capability.clientIntegrationJson = this.clientIntegrationJson
capability.modRewriteWorking = intToBoolean(this.modRewriteWorking)
capability.chunkedUploadMaxSize = this.chunkedUploadMaxSize ?: OCCapability.CHUNKED_UPLOAD_MAX_SIZE_UNKNOWN
return capability
}
@@ -0,0 +1,29 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.client.database.entity.model
import androidx.room.ColumnInfo
import com.owncloud.android.lib.resources.shares.ShareType
data class ShareeKey(
@ColumnInfo(name = "path") val path: String,
@ColumnInfo(name = "shate_with") val shareWith: String?,
@ColumnInfo(name = "share_type") val shareType: Int
) {
companion object {
val shareableShareTypeValues = listOf(
ShareType.USER,
ShareType.GROUP,
ShareType.EMAIL,
ShareType.FEDERATED,
ShareType.FEDERATED_GROUP,
ShareType.ROOM,
ShareType.CIRCLE
).map { it.value }
}
}
@@ -57,7 +57,7 @@ import com.owncloud.android.ui.activities.data.files.FilesRepository;
import com.owncloud.android.ui.activities.data.files.FilesServiceApiImpl;
import com.owncloud.android.ui.activities.data.files.RemoteFilesRepository;
import com.owncloud.android.ui.dialog.setupEncryption.CertificateValidator;
import com.owncloud.android.utils.overlay.OverlayManager;
import com.nextcloud.utils.thumbnail.FolderThumbnailGenerator;
import com.owncloud.android.utils.theme.ViewThemeUtils;
import org.greenrobot.eventbus.EventBus;
@@ -272,11 +272,12 @@ class AppModule {
@Provides
@Singleton
OverlayManager overlayManager(
FolderThumbnailGenerator folderThumbnailGenerator(
AppPreferences appPreferences,
ViewThemeUtils viewThemeUtils,
Context context,
UserAccountManager accountManager) {
return new OverlayManager(appPreferences, viewThemeUtils, context, accountManager);
return new FolderThumbnailGenerator(appPreferences, viewThemeUtils, context, accountManager);
}
}
@@ -1,7 +1,7 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 TSI-mc <[email protected]>
* SPDX-FileCopyrightText: 2024-2026 TSI-mc <[email protected]>
* SPDX-FileCopyrightText: 2020 Chris Narkiewicz <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
@@ -28,11 +28,13 @@ import com.nextcloud.client.widget.DashboardWidgetProvider;
import com.nextcloud.client.widget.DashboardWidgetService;
import com.nextcloud.ui.ChooseAccountDialogFragment;
import com.nextcloud.ui.ChooseStorageLocationDialogFragment;
import com.nextcloud.ui.ImageDetailFragment;
import com.nextcloud.ui.fileInfo.FileInfoFragment;
import com.nextcloud.ui.SetOnlineStatusBottomSheet;
import com.nextcloud.ui.SetStatusMessageBottomSheet;
import com.nextcloud.ui.albumItemActions.AlbumItemActionsBottomSheet;
import com.nextcloud.ui.composeActivity.ComposeActivity;
import com.nextcloud.ui.fileactions.FileActionsBottomSheet;
import com.nextcloud.ui.tags.TagManagementBottomSheet;
import com.nextcloud.ui.trashbinFileActions.TrashbinFileActionsBottomSheet;
import com.nmc.android.ui.LauncherActivity;
import com.owncloud.android.MainApp;
@@ -46,6 +48,7 @@ import com.owncloud.android.providers.UsersAndGroupsSearchProvider;
import com.owncloud.android.services.AccountManagerService;
import com.owncloud.android.services.OperationsService;
import com.owncloud.android.syncadapter.FileSyncService;
import com.owncloud.android.ui.activity.AlbumsPickerActivity;
import com.owncloud.android.ui.activity.BaseActivity;
import com.owncloud.android.ui.activity.ConflictsResolveActivity;
import com.owncloud.android.ui.activity.ContactsPreferenceActivity;
@@ -79,6 +82,7 @@ import com.owncloud.android.ui.dialog.ChooseRichDocumentsTemplateDialogFragment;
import com.owncloud.android.ui.dialog.ChooseTemplateDialogFragment;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
import com.owncloud.android.ui.dialog.ConflictsResolveDialog;
import com.owncloud.android.ui.dialog.CreateAlbumDialogFragment;
import com.owncloud.android.ui.dialog.CreateFolderDialogFragment;
import com.owncloud.android.ui.dialog.ExpirationDatePickerDialogFragment;
import com.owncloud.android.ui.dialog.IndeterminateProgressDialog;
@@ -108,11 +112,14 @@ import com.owncloud.android.ui.fragment.FileDetailsSharingProcessFragment;
import com.owncloud.android.ui.fragment.GalleryFragment;
import com.owncloud.android.ui.fragment.GalleryFragmentBottomSheetDialog;
import com.owncloud.android.ui.fragment.GroupfolderListFragment;
import com.owncloud.android.ui.fragment.LocalFileListFragment;
import com.owncloud.android.ui.fragment.localfilelist.LocalFileListFragment;
import com.owncloud.android.ui.fragment.OCFileListBottomSheetDialog;
import com.owncloud.android.ui.fragment.OCFileListFragment;
import com.owncloud.android.ui.fragment.SharedListFragment;
import com.owncloud.android.ui.fragment.UnifiedSearchFragment;
import com.owncloud.android.ui.fragment.albums.AlbumItemsFragment;
import com.owncloud.android.ui.fragment.albums.bottomsheet.AlbumSharingBottomSheet;
import com.owncloud.android.ui.fragment.albums.AlbumsFragment;
import com.owncloud.android.ui.fragment.community.CommunityFragment;
import com.owncloud.android.ui.fragment.contactsbackup.BackupFragment;
import com.owncloud.android.ui.fragment.contactsbackup.BackupListFragment;
@@ -483,7 +490,7 @@ abstract class ComponentsModule {
abstract EditImageActivity editImageActivity();
@ContributesAndroidInjector
abstract ImageDetailFragment imageDetailFragment();
abstract FileInfoFragment fileInfoFragment();
@ContributesAndroidInjector
abstract EtmBackgroundJobsFragment etmBackgroundJobsFragment();
@@ -507,9 +514,30 @@ abstract class ComponentsModule {
@ContributesAndroidInjector
abstract SetStatusMessageBottomSheet setStatusMessageBottomSheet();
@ContributesAndroidInjector
abstract TagManagementBottomSheet tagManagementBottomSheet();
@ContributesAndroidInjector
abstract NavigatorActivity navigatorActivity();
@ContributesAndroidInjector
abstract CommunityFragment communityFragment();
@ContributesAndroidInjector
abstract AlbumsPickerActivity albumsPickerActivity();
@ContributesAndroidInjector
abstract CreateAlbumDialogFragment createAlbumDialogFragment();
@ContributesAndroidInjector
abstract AlbumsFragment albumsFragment();
@ContributesAndroidInjector
abstract AlbumItemsFragment albumItemsFragment();
@ContributesAndroidInjector
abstract AlbumItemActionsBottomSheet albumItemActionsBottomSheet();
@ContributesAndroidInjector
abstract AlbumSharingBottomSheet albumSharingBottomSheet();
}
@@ -1,17 +1,23 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.nextcloud.client.di
import com.owncloud.android.lib.common.utils.Log_OC
import dagger.Module
import dagger.Provides
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import javax.inject.Qualifier
import javax.inject.Singleton
@Retention(AnnotationRetention.BINARY)
@Qualifier
@@ -25,8 +31,15 @@ annotation class IoDispatcher
@Qualifier
annotation class MainDispatcher
@Retention(AnnotationRetention.BINARY)
@Qualifier
annotation class ApplicationScope
@Module
object DispatcherModule {
private const val APPLICATION_SCOPE_TAG = "ApplicationScope"
@DefaultDispatcher
@Provides
fun provideDefaultDispatcher(): CoroutineDispatcher = Dispatchers.Default
@@ -38,4 +51,18 @@ object DispatcherModule {
@MainDispatcher
@Provides
fun provideMainDispatcher(): CoroutineDispatcher = Dispatchers.Main
/**
* A process-lifetime [CoroutineScope] for singletons that outlive any single Android component.
*/
@ApplicationScope
@Provides
@Singleton
fun provideApplicationScope(@IoDispatcher dispatcher: CoroutineDispatcher): CoroutineScope = CoroutineScope(
SupervisorJob() +
dispatcher +
CoroutineExceptionHandler { _, throwable ->
Log_OC.e(APPLICATION_SCOPE_TAG, "Uncaught exception in application coroutine scope", throwable)
}
)
}
@@ -13,8 +13,9 @@ import com.nextcloud.client.documentscan.DocumentScanViewModel
import com.nextcloud.client.etm.EtmViewModel
import com.nextcloud.client.logger.ui.LogsViewModel
import com.nextcloud.ui.fileactions.FileActionsViewModel
import com.owncloud.android.ui.preview.pdf.PreviewPdfViewModel
import com.nextcloud.ui.tags.TagManagementViewModel
import com.nextcloud.ui.trashbinFileActions.TrashbinFileActionsViewModel
import com.owncloud.android.ui.preview.pdf.PreviewPdfViewModel
import com.owncloud.android.ui.unifiedsearch.UnifiedSearchViewModel
import dagger.Binds
import dagger.Module
@@ -57,6 +58,11 @@ abstract class ViewModelModule {
@ViewModelKey(TrashbinFileActionsViewModel::class)
abstract fun trashbinFileActionsViewModel(vm: TrashbinFileActionsViewModel): ViewModel
@Binds
@IntoMap
@ViewModelKey(TagManagementViewModel::class)
abstract fun tagManagementViewModel(vm: TagManagementViewModel): ViewModel
@Binds
abstract fun bindViewModelFactory(factory: ViewModelFactory): ViewModelProvider.Factory
}
@@ -18,6 +18,7 @@ import com.nextcloud.client.jobs.BackgroundJobManager
import com.nextcloud.client.jobs.upload.FileUploadHelper
import com.nextcloud.client.jobs.upload.FileUploadWorker
import com.nextcloud.client.logger.Logger
import com.nextcloud.model.OCUploadLocalPathData
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.files.services.NameCollisionPolicy
import com.owncloud.android.operations.UploadFileOperation
@@ -166,17 +167,8 @@ class DocumentScanViewModel @Inject constructor(
uploadFolder + OCFile.PATH_SEPARATOR + File(it).name
}.toTypedArray()
FileUploadHelper.instance().uploadNewFiles(
currentAccountProvider.user,
pageList.toTypedArray(),
uploadPaths,
FileUploadWorker.LOCAL_BEHAVIOUR_DELETE,
true,
UploadFileOperation.CREATED_BY_USER,
false,
false,
NameCollisionPolicy.ASK_USER
)
val data = OCUploadLocalPathData.forDocument(currentAccountProvider.user, pageList.toTypedArray(), uploadPaths)
FileUploadHelper.instance().uploadNewFiles(data)
}
fun onExportCanceled() {
@@ -20,6 +20,7 @@ import com.nextcloud.client.account.UserAccountManager
import com.nextcloud.client.jobs.upload.FileUploadHelper
import com.nextcloud.client.jobs.upload.FileUploadWorker
import com.nextcloud.client.logger.Logger
import com.nextcloud.model.OCUploadLocalPathData
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.files.services.NameCollisionPolicy
@@ -108,18 +109,8 @@ class GeneratePdfFromImagesWork(
private fun uploadFile(user: User, uploadFolder: String, pdfPath: String) {
val uploadPath = uploadFolder + OCFile.PATH_SEPARATOR + File(pdfPath).name
FileUploadHelper().uploadNewFiles(
user,
arrayOf(pdfPath),
arrayOf(uploadPath),
// MIME type will be detected from file name
FileUploadWorker.LOCAL_BEHAVIOUR_DELETE,
true,
UploadFileOperation.CREATED_BY_USER,
false,
false,
NameCollisionPolicy.ASK_USER
)
val data = OCUploadLocalPathData.forDocument(user, arrayOf(pdfPath), arrayOf(uploadPath))
FileUploadHelper().uploadNewFiles(data)
}
companion object {
@@ -22,6 +22,7 @@ import com.canhub.cropper.CropImageView
import com.nextcloud.client.di.Injectable
import com.nextcloud.client.jobs.upload.FileUploadHelper
import com.nextcloud.client.jobs.upload.FileUploadWorker
import com.nextcloud.model.OCUploadLocalPathData
import com.nextcloud.utils.extensions.getParcelableArgument
import com.owncloud.android.R
import com.owncloud.android.databinding.ActivityEditImageBinding
@@ -95,17 +96,18 @@ class EditImageActivity :
resultUri?.substring(resultUri.lastIndexOf('.'))
resultUri?.let {
FileUploadHelper().uploadNewFiles(
val data = OCUploadLocalPathData(
user = storageManager.user,
localPaths = arrayOf(it),
remotePaths = arrayOf(file.parentRemotePath + File.separator + newFileName),
createRemoteFolder = false,
createdBy = UploadFileOperation.CREATED_BY_USER,
creationType = UploadFileOperation.CREATED_BY_USER,
requiresWifi = false,
requiresCharging = false,
nameCollisionPolicy = NameCollisionPolicy.RENAME,
collisionPolicy = NameCollisionPolicy.RENAME,
localBehavior = FileUploadWorker.LOCAL_BEHAVIOUR_DELETE
)
FileUploadHelper().uploadNewFiles(data)
}
}
@@ -2,6 +2,7 @@
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2020 Chris Narkiewicz <[email protected]>
* SPDX-FileCopyrightText: 2026 TSI-mc <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.nextcloud.client.jobs
@@ -29,6 +30,7 @@ import com.nextcloud.client.jobs.download.FileDownloadWorker
import com.nextcloud.client.jobs.folderDownload.FolderDownloadWorker
import com.nextcloud.client.jobs.metadata.MetadataWorker
import com.nextcloud.client.jobs.offlineOperations.OfflineOperationsWorker
import com.nextcloud.client.jobs.upload.AlbumFileUploadWorker
import com.nextcloud.client.jobs.upload.FileUploadWorker
import com.nextcloud.client.logger.Logger
import com.nextcloud.client.network.ConnectivityService
@@ -99,6 +101,7 @@ class BackgroundJobFactory @Inject constructor(
CalendarImportWork::class -> createCalendarImportWork(context, workerParameters)
FilesExportWork::class -> createFilesExportWork(context, workerParameters)
FileUploadWorker::class -> createFilesUploadWorker(context, workerParameters)
AlbumFileUploadWorker::class -> createAlbumsFilesUploadWorker(context, workerParameters)
FileDownloadWorker::class -> createFilesDownloadWorker(context, workerParameters)
GeneratePdfFromImagesWork::class -> createPDFGenerateWork(context, workerParameters)
HealthStatusWork::class -> createHealthStatusWork(context, workerParameters)
@@ -262,6 +265,20 @@ class BackgroundJobFactory @Inject constructor(
params
)
private fun createAlbumsFilesUploadWorker(context: Context, params: WorkerParameters): AlbumFileUploadWorker =
AlbumFileUploadWorker(
uploadsStorageManager,
connectivityService,
powerManagementService,
accountManager,
viewThemeUtils.get(),
localBroadcastManager.get(),
backgroundJobManager.get(),
preferences,
context,
params
)
private fun createPDFGenerateWork(context: Context, params: WorkerParameters): GeneratePdfFromImagesWork =
GeneratePdfFromImagesWork(
appContext = context,
@@ -2,6 +2,7 @@
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2020 Chris Narkiewicz <[email protected]>
* SPDX-FileCopyrightText: 2026 TSI-mc <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.nextcloud.client.jobs
@@ -120,6 +121,10 @@ interface BackgroundJobManager {
fun startImmediateFilesExportJob(files: Collection<OCFile>): LiveData<JobInfo?>
/**
* @param overridePowerSaving uploads even while the device is in power saving mode. Such a run replaces an
* already scheduled run of the same folder, because that one would otherwise stop on the power saving check.
*/
fun startAutoUpload(syncedFolder: SyncedFolder, overridePowerSaving: Boolean = false)
fun cancelTwoWaySyncJob()
@@ -137,10 +142,11 @@ interface BackgroundJobManager {
showSameFileAlreadyExistsNotification: Boolean,
skipAutoUploadCheck: Boolean = false
)
fun startAlbumFilesUploadJob(user: User, uploadIds: LongArray, albumName: String)
fun getFileUploads(user: User): LiveData<List<JobInfo>>
fun cancelFilesUploadJob(user: User)
fun isStartFileUploadJobScheduled(accountName: String): Boolean
fun isAutoUploadIgnoringPowerSavingScheduled(syncedFolderID: Long): Boolean
fun cancelFilesDownloadJob(accountName: String, fileId: Long)
@Suppress("LongParameterList")
@@ -33,6 +33,7 @@ import com.nextcloud.client.jobs.download.FileDownloadWorker
import com.nextcloud.client.jobs.folderDownload.FolderDownloadWorker
import com.nextcloud.client.jobs.metadata.MetadataWorker
import com.nextcloud.client.jobs.offlineOperations.OfflineOperationsWorker
import com.nextcloud.client.jobs.upload.AlbumFileUploadWorker
import com.nextcloud.client.jobs.upload.FileUploadHelper
import com.nextcloud.client.jobs.upload.FileUploadWorker
import com.nextcloud.client.jobs.worker.WorkerFilesPayload
@@ -106,6 +107,8 @@ internal class BackgroundJobManagerImpl(
const val JOB_TEST = "test_job"
private const val TAG_SUFFIX_IGNORE_POWER_SAVING = "ignore_power_saving"
const val TAG_PREFIX_NAME = "name"
const val TAG_PREFIX_USER = "user"
const val TAG_PREFIX_CLASS = "class"
@@ -117,6 +120,7 @@ internal class BackgroundJobManagerImpl(
const val OFFLINE_OPERATIONS_PERIODIC_JOB_INTERVAL_MINUTES = 5L
const val DEFAULT_IMMEDIATE_JOB_DELAY_SEC = 3L
const val DEFAULT_BACKOFF_CRITERIA_DELAY_SEC = 300L
const val ALBUM_JOB_FILES_UPLOAD = "album_files_upload"
private const val KEEP_LOG_MILLIS = 1000 * 60 * 60 * 24 * 3L
@@ -482,9 +486,24 @@ internal class BackgroundJobManagerImpl(
workManager.enqueueUniqueWork(JOB_CONTENT_OBSERVER, ExistingWorkPolicy.REPLACE, request)
}
private fun autoUploadWorkName(syncedFolderID: Long): String = JOB_IMMEDIATE_FILES_SYNC + "_" + syncedFolderID
private fun autoUploadIgnorePowerSavingTag(syncedFolderID: Long): String =
autoUploadWorkName(syncedFolderID) + "_" + TAG_SUFFIX_IGNORE_POWER_SAVING
override fun isAutoUploadIgnoringPowerSavingScheduled(syncedFolderID: Long): Boolean =
workManager.isWorkScheduled(autoUploadIgnorePowerSavingTag(syncedFolderID))
override fun startAutoUpload(syncedFolder: SyncedFolder, overridePowerSaving: Boolean) {
val syncedFolderID = syncedFolder.id
// the sync now button starts this folder and also lets the content observer request it, replacing the
// running one would cancel it mid upload
if (overridePowerSaving && isAutoUploadIgnoringPowerSavingScheduled(syncedFolderID)) {
Log_OC.d(TAG, "auto upload ignoring power saving already running for folder $syncedFolderID")
return
}
val arguments = Data.Builder()
.putBoolean(AutoUploadWorker.OVERRIDE_POWER_SAVING, overridePowerSaving)
.putLong(AutoUploadWorker.SYNCED_FOLDER_ID, syncedFolderID)
@@ -495,9 +514,9 @@ internal class BackgroundJobManagerImpl(
.setRequiresCharging(syncedFolder.isChargingOnly)
.build()
val request = oneTimeRequestBuilder(
val requestBuilder = oneTimeRequestBuilder(
jobClass = AutoUploadWorker::class,
jobName = JOB_IMMEDIATE_FILES_SYNC + "_" + syncedFolderID
jobName = autoUploadWorkName(syncedFolderID)
)
.setInputData(arguments)
.setConstraints(constraints)
@@ -506,12 +525,19 @@ internal class BackgroundJobManagerImpl(
DEFAULT_BACKOFF_CRITERIA_DELAY_SEC,
TimeUnit.SECONDS
)
.build()
if (overridePowerSaving) {
requestBuilder.addTag(autoUploadIgnorePowerSavingTag(syncedFolderID))
}
// a scheduled run still carries its own overridePowerSaving flag, so keeping it would swallow the
// explicit user request and stop on the power saving check
val policy = if (overridePowerSaving) ExistingWorkPolicy.REPLACE else ExistingWorkPolicy.KEEP
workManager.enqueueUniqueWork(
JOB_IMMEDIATE_FILES_SYNC + "_" + syncedFolderID,
ExistingWorkPolicy.KEEP,
request
autoUploadWorkName(syncedFolderID),
policy,
requestBuilder.build()
)
}
@@ -676,6 +702,61 @@ internal class BackgroundJobManagerImpl(
}
}
private fun startAlbumsFileUploadJobTag(accountName: String): String = ALBUM_JOB_FILES_UPLOAD + accountName
/**
* This method supports uploading and copying selected files to Album
*
* @param user The user for whom the upload job is being created.
* @param uploadIds Array of upload IDs to be processed. These IDs originate from multiple sources
* and cannot be determined directly from the account name or a single function
* within the worker.
* @param albumName Album on which selected files should be copy after upload
*/
override fun startAlbumFilesUploadJob(user: User, uploadIds: LongArray, albumName: String) {
defaultDispatcherScope.launch {
val batchSize = FileUploadHelper.MAX_FILE_COUNT
val batches = uploadIds.toList().chunked(batchSize)
val tag = startAlbumsFileUploadJobTag(user.accountName)
val constraints = Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.build()
val dataBuilder = Data.Builder()
.putString(AlbumFileUploadWorker.ACCOUNT, user.accountName)
.putInt(AlbumFileUploadWorker.TOTAL_UPLOAD_SIZE, uploadIds.size)
.putString(AlbumFileUploadWorker.ALBUM_NAME, albumName)
val workRequests = batches.mapIndexed { index, batch ->
dataBuilder
.putLongArray(AlbumFileUploadWorker.UPLOAD_IDS, batch.toLongArray())
.putInt(AlbumFileUploadWorker.CURRENT_BATCH_INDEX, index)
oneTimeRequestBuilder(AlbumFileUploadWorker::class, ALBUM_JOB_FILES_UPLOAD, user)
.addTag(tag)
.setInputData(dataBuilder.build())
.setConstraints(constraints)
.build()
}
// Chain the work requests sequentially
if (workRequests.isNotEmpty()) {
var workChain = workManager.beginUniqueWork(
tag,
ExistingWorkPolicy.APPEND_OR_REPLACE,
workRequests.first()
)
workRequests.drop(1).forEach { request ->
workChain = workChain.then(request)
}
workChain.enqueue()
}
}
}
private fun startFileDownloadJobTag(accountName: String, fileId: Long): String =
JOB_FOLDER_DOWNLOAD + accountName + fileId
@@ -15,8 +15,8 @@ import androidx.work.WorkerParameters
import com.nextcloud.client.account.UserAccountManager
import com.nextcloud.client.preferences.AppPreferences
import com.owncloud.android.lib.common.utils.Log_OC
import third_parties.sufficientlysecure.AndroidCalendar
import third_parties.sufficientlysecure.SaveCalendar
import thirdparties.sufficientlysecure.AndroidCalendar
import thirdparties.sufficientlysecure.SaveCalendar
import java.util.Calendar
class CalendarBackupWork(
@@ -16,9 +16,9 @@ import androidx.work.WorkerParameters
import com.nextcloud.client.logger.Logger
import com.owncloud.android.lib.common.utils.Log_OC
import net.fortuna.ical4j.data.CalendarBuilder
import third_parties.sufficientlysecure.AndroidCalendar
import third_parties.sufficientlysecure.CalendarSource
import third_parties.sufficientlysecure.ProcessVEvent
import thirdparties.sufficientlysecure.AndroidCalendar
import thirdparties.sufficientlysecure.CalendarSource
import thirdparties.sufficientlysecure.ProcessVEvent
import java.io.File
class CalendarImportWork(
@@ -23,7 +23,7 @@ import com.owncloud.android.ui.fragment.contactsbackup.VCardComparator
import ezvcard.Ezvcard
import ezvcard.VCard
import org.apache.commons.io.FileUtils
import third_parties.ezvcard_android.ContactOperations
import thirdparties.ezvcardAndroid.ContactOperations
import java.io.BufferedInputStream
import java.io.File
import java.io.FileInputStream
Loaded 100 of 525 files, more files were not shown because too many files have changed in this diff. Show more