Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky committed Jun 28, 2024
2 parents 9772d79 + 6b6068e commit 4ff8624
Show file tree
Hide file tree
Showing 92 changed files with 1,252 additions and 1,282 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ trim_trailing_whitespace=false
indent_size=2

[*.{kt,kts}]
ktlint_code_style = android_studio
# IDE does not follow this Ktlint rule strictly, but the default ordering is pretty good anyway, so let's ditch it
ktlint_standard_import-ordering = disabled
ktlint_standard_no-consecutive-comments = disabled
ktlint_function_naming_ignore_when_annotated_with = Composable
ij_kotlin_allow_trailing_comma = false
ij_kotlin_allow_trailing_comma_on_call_site = false
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 3.29.1 (June 27, 2024)

- Bugfixes

Minimum: NC 16 Server, Android 7.0 Nougat

For a full list, please see https://github.com/nextcloud/android/milestone/93

<!--
~ SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
~ SPDX-FileCopyrightText: 2016-2024 Tobias Kaminsky <[email protected]>
Expand Down
30 changes: 15 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ GEM
base64
nkf
rexml
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.937.0)
aws-sdk-core (3.196.1)
aws-partitions (1.948.0)
aws-sdk-core (3.199.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.82.0)
aws-sdk-core (~> 3, >= 3.193.0)
aws-sdk-kms (1.87.0)
aws-sdk-core (~> 3, >= 3.199.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.151.0)
aws-sdk-core (~> 3, >= 3.194.0)
aws-sdk-s3 (1.154.0)
aws-sdk-core (~> 3, >= 3.199.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
Expand Down Expand Up @@ -69,7 +69,7 @@ GEM
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.3.1)
fastlane (2.220.0)
fastlane (2.221.1)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -150,14 +150,14 @@ GEM
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.5)
http-cookie (1.0.6)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.2)
json (2.7.2)
jwt (2.8.1)
jwt (2.8.2)
base64
mini_magick (4.12.0)
mini_magick (4.13.1)
mini_mime (1.1.5)
multi_json (1.15.0)
multipart-post (2.4.1)
Expand All @@ -167,15 +167,15 @@ GEM
optparse (0.5.0)
os (1.1.4)
plist (3.7.1)
public_suffix (5.0.5)
public_suffix (5.1.1)
rake (13.2.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.8)
strscan (>= 3.0.9)
rexml (3.2.9)
strscan
rouge (2.0.7)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
Expand Down
9 changes: 5 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ buildscript {

plugins {
id "org.jetbrains.kotlin.plugin.compose" version "2.0.0"
id "com.diffplug.spotless" version "6.20.0"
id "com.diffplug.spotless" version "6.25.0"
id "org.jetbrains.kotlin.kapt" version "2.0.0"
id 'com.google.devtools.ksp' version '2.0.0-1.0.22' apply false
}
Expand Down Expand Up @@ -291,7 +291,7 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-service:2.8.2"
implementation "androidx.work:work-runtime:$workRuntime"
implementation "androidx.work:work-runtime-ktx:$workRuntime"
implementation "androidx.fragment:fragment-ktx:1.8.0"
implementation "androidx.fragment:fragment-ktx:1.8.1"
implementation 'com.github.albfernandez:juniversalchardet:2.0.3' // need this version for Android <7
compileOnly 'com.google.code.findbugs:annotations:3.0.1u2'
implementation 'commons-io:commons-io:2.16.1'
Expand Down Expand Up @@ -363,7 +363,7 @@ dependencies {
}

if (perfAnalysis) {
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.13'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'
}

// dependencies for local unit tests
Expand Down Expand Up @@ -411,7 +411,8 @@ dependencies {
implementation "com.github.stateless4j:stateless4j:2.6.0"

// upon each update first test: new registration, receive push
gplayImplementation "com.google.firebase:firebase-messaging:23.4.1"
gplayImplementation "com.google.firebase:firebase-messaging:24.0.0"
gplayImplementation 'com.google.android.gms:play-services-base:18.5.0'
gplayImplementation 'com.google.android.play:review-ktx:2.0.1'

implementation 'com.github.nextcloud.android-common:ui:0.17.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,31 +177,30 @@ object DocumentsProviderUtils {
*/
@Suppress("EXPERIMENTAL_API_USAGE")
@VisibleForTesting
internal suspend fun getLoadedCursor(timeout: Long = 15_000, query: () -> Cursor?) =
withTimeout(timeout) {
suspendCancellableCoroutine<Cursor> { cont ->
val cursor = query() ?: throw IOException("Initial query returned no results")
cont.invokeOnCancellation { cursor.close() }
val loading = cursor.extras.getBoolean(EXTRA_LOADING, false)
if (loading) {
Log_OC.e("TEST", "Cursor was loading, wait for update...")
cursor.registerContentObserver(
object : ContentObserver(null) {
override fun onChange(selfChange: Boolean, uri: Uri?) {
cursor.close()
val newCursor = query()
if (newCursor == null) {
cont.cancel(IOException("Re-query returned no results"))
} else {
cont.resume(newCursor)
}
internal suspend fun getLoadedCursor(timeout: Long = 15_000, query: () -> Cursor?) = withTimeout(timeout) {
suspendCancellableCoroutine<Cursor> { cont ->
val cursor = query() ?: throw IOException("Initial query returned no results")
cont.invokeOnCancellation { cursor.close() }
val loading = cursor.extras.getBoolean(EXTRA_LOADING, false)
if (loading) {
Log_OC.e("TEST", "Cursor was loading, wait for update...")
cursor.registerContentObserver(
object : ContentObserver(null) {
override fun onChange(selfChange: Boolean, uri: Uri?) {
cursor.close()
val newCursor = query()
if (newCursor == null) {
cont.cancel(IOException("Re-query returned no results"))
} else {
cont.resume(newCursor)
}
}
)
} else {
// not loading, return cursor right away
cont.resume(cursor)
}
}
)
} else {
// not loading, return cursor right away
cont.resume(cursor)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import com.owncloud.android.R
import com.owncloud.android.ui.TextDrawable

internal class AvatarTestFragment : Fragment() {
lateinit var list1: LinearLayout
lateinit var list2: LinearLayout
private lateinit var list1: LinearLayout
private lateinit var list2: LinearLayout

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view: View = inflater.inflate(R.layout.avatar_fragment, null)
Expand All @@ -34,7 +34,7 @@ internal class AvatarTestFragment : Fragment() {
}

fun addAvatar(name: String, avatarRadius: Float, width: Int, targetContext: Context) {
val margin = padding
val margin = PADDING
val imageView = ImageView(targetContext)
imageView.setImageDrawable(TextDrawable.createNamedAvatar(name, avatarRadius))

Expand All @@ -47,7 +47,7 @@ internal class AvatarTestFragment : Fragment() {
}

fun addBitmap(bitmap: Bitmap, width: Int, list: Int, targetContext: Context) {
val margin = padding
val margin = PADDING
val imageView = ImageView(targetContext)
imageView.setImageBitmap(bitmap)

Expand All @@ -64,6 +64,6 @@ internal class AvatarTestFragment : Fragment() {
}

companion object {
private const val padding = 10
private const val PADDING = 10
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
}

// open bottom sheet with actions
private fun openAdvancedPermissions(
sut: FileDetailSharingFragment,
userShare: OCShare
) {
private fun openAdvancedPermissions(sut: FileDetailSharingFragment, userShare: OCShare) {
activity.handler.post {
sut.showSharingMenuActionSheet(userShare)
}
Expand Down Expand Up @@ -723,10 +720,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
/**
* verify send new email note text
*/
private fun verifySendNewEmail(
sut: FileDetailSharingFragment,
userShare: OCShare
) {
private fun verifySendNewEmail(sut: FileDetailSharingFragment, userShare: OCShare) {
activity.runOnUiThread { sut.showSharingMenuActionSheet(userShare) }

waitForIdleSync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import org.junit.Test

class TrashbinActivityIT : AbstractIT() {
enum class TestCase {
ERROR, EMPTY, FILES
ERROR,
EMPTY,
FILES
}

@get:Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ class TrashbinLocalRepository(private val testCase: TrashbinActivityIT.TestCase)
"image/png",
"/trashbin/test.png",
"subFolder/test.png",
1395847838, // random date
1395847908 // random date
// random date
1395847838,
// random date
1395847908
)
)
files.add(
Expand All @@ -46,8 +48,10 @@ class TrashbinLocalRepository(private val testCase: TrashbinActivityIT.TestCase)
"image/jpeg",
"/trashbin/image.jpg",
"image.jpg",
1395841858, // random date
1395837858 // random date
// random date
1395841858,
// random date
1395837858
)
)
files.add(
Expand All @@ -56,8 +60,10 @@ class TrashbinLocalRepository(private val testCase: TrashbinActivityIT.TestCase)
"DIR",
"/trashbin/folder/",
"folder",
1395347858, // random date
1395849858 // random date
// random date
1395347858,
// random date
1395849858
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ class EncryptionUtilsV2IT : EncryptionIT() {
mimeType = MimeType.JPEG
},
EncryptionUtils.generateIV(),
EncryptionUtils.generateUid(), // random string, not real tag
// random string, not real tag
EncryptionUtils.generateUid(),
EncryptionUtils.generateKey(),
metadataFile,
storageManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ class InAppReviewHelperImpl(val appPreferences: AppPreferences) : InAppReviewHel
}
}

private fun launchAppReviewFlow(
manager: ReviewManager,
activity: AppCompatActivity,
reviewInfo: ReviewInfo
) {
private fun launchAppReviewFlow(manager: ReviewManager, activity: AppCompatActivity, reviewInfo: ReviewInfo) {
val flow = manager.launchReviewFlow(activity, reviewInfo)
flow.addOnCompleteListener { _ ->
// The flow has finished. The API does not indicate whether the user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class AssistantViewModel(
private val _taskTypes = MutableStateFlow<List<TaskType>?>(null)
val taskTypes: StateFlow<List<TaskType>?> = _taskTypes

private var _taskList: List<Task>? = null
private var taskList: List<Task>? = null

private val _filteredTaskList = MutableStateFlow<List<Task>?>(null)
val filteredTaskList: StateFlow<List<Task>?> = _filteredTaskList
Expand All @@ -55,10 +55,7 @@ class AssistantViewModel(
}

@Suppress("MagicNumber")
fun createTask(
input: String,
type: String
) {
fun createTask(input: String, type: String) {
viewModelScope.launch(Dispatchers.IO) {
val result = repository.createTask(input, type)

Expand Down Expand Up @@ -111,7 +108,7 @@ class AssistantViewModel(
viewModelScope.launch(Dispatchers.IO) {
val result = repository.getTaskList(appId)
if (result.isSuccess) {
_taskList = result.resultData.tasks
taskList = result.resultData.tasks

filterTaskList(_selectedTaskType.value?.id)

Expand Down Expand Up @@ -157,11 +154,11 @@ class AssistantViewModel(
private fun filterTaskList(taskTypeId: String?) {
if (taskTypeId == null) {
_filteredTaskList.update {
_taskList
taskList
}
} else {
_filteredTaskList.update {
_taskList?.filter { it.type == taskTypeId }
taskList?.filter { it.type == taskTypeId }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,7 @@ fun AssistantScreen(viewModel: AssistantViewModel, activity: Activity) {
}

@Composable
private fun ScreenState(
state: AssistantViewModel.State,
activity: Activity,
viewModel: AssistantViewModel
) {
private fun ScreenState(state: AssistantViewModel.State, activity: Activity, viewModel: AssistantViewModel) {
val messageId: Int? = when (state) {
is AssistantViewModel.State.Error -> {
state.messageId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ class AssistantRepository(private val client: NextcloudClient) : AssistantReposi
return GetTaskTypesRemoteOperation().execute(client)
}

override fun createTask(
input: String,
type: String
): RemoteOperationResult<Void> {
override fun createTask(input: String, type: String): RemoteOperationResult<Void> {
return CreateTaskRemoteOperation(input, type).execute(client)
}

Expand Down
Loading

0 comments on commit 4ff8624

Please sign in to comment.