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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ ownCloud admins and users.
* Change - Bump target SDK to 35: [#4529](https://github.com/owncloud/android/issues/4529)
* Change - Replace dav4android location: [#4536](https://github.com/owncloud/android/issues/4536)
* Change - Modify biometrics fail source string: [#4572](https://github.com/owncloud/android/issues/4572)
* Enhancement - QA variant: [#3791](https://github.com/owncloud/android/issues/3791)
* Enhancement - Accessibility reports in 4.5.1: [#4568](https://github.com/owncloud/android/issues/4568)

## Details
Expand Down Expand Up @@ -84,6 +85,13 @@ ownCloud admins and users.
https://github.com/owncloud/android/issues/4572
https://github.com/owncloud/android/pull/4578

* Enhancement - QA variant: [#3791](https://github.com/owncloud/android/issues/3791)

A new flavor for QA has been created in order to make automatic tests easier.

https://github.com/owncloud/android/issues/3791
https://github.com/owncloud/android/pull/4569

* Enhancement - Accessibility reports in 4.5.1: [#4568](https://github.com/owncloud/android/issues/4568)

Some content descriptions that were missing have been added to provide a better
Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/4569
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: QA variant

A new flavor for QA has been created in order to make automatic tests easier.

https://github.com/owncloud/android/issues/3791
https://github.com/owncloud/android/pull/4569
3 changes: 3 additions & 0 deletions owncloudApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ android {
mdm {
dimension "management"
}
qa {
dimension "management"
}
}

applicationVariants.all { variant ->
Expand Down
8 changes: 5 additions & 3 deletions owncloudApp/src/main/java/com/owncloud/android/MainApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
* @author David Crespo Ríos
* @author Juan Carlos Garrote Gascón
* @author Aitor Ballesteros Pavón
* @author Jorge Aguado Recio
*
* Copyright (C) 2024 ownCloud GmbH.
* Copyright (C) 2025 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -260,11 +261,11 @@ class MainApp : Application() {
}

/**
* Screenshots allowed in debug mode. Devs and tests <3
* Screenshots allowed in debug or QA mode. Devs and tests <3
* Otherwise, depends on branding.
*/
private fun areScreenshotsAllowed(): Boolean {
if (BuildConfig.DEBUG) return true
if (BuildConfig.DEBUG || BuildConfig.FLAVOR == QA_FLAVOR) return true

val mdmProvider = MdmProvider(applicationContext)
return mdmProvider.getBrandingBoolean(CONFIGURATION_ALLOW_SCREENSHOTS, R.bool.allow_screenshots)
Expand Down Expand Up @@ -320,6 +321,7 @@ class MainApp : Application() {

companion object {
const val MDM_FLAVOR = "mdm"
const val QA_FLAVOR = "qa"

lateinit var appContext: Context
private set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* @author David González Verdugo
* @author Abel García de Prada
* @author Juan Carlos Garrote Gascón
* @author Jorge Aguado Recio
*
* Copyright (C) 2023 ownCloud GmbH.
* Copyright (C) 2025 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand All @@ -23,6 +24,8 @@
package com.owncloud.android.dependecyinjection

import android.accounts.AccountManager
import com.owncloud.android.BuildConfig
import com.owncloud.android.MainApp
import com.owncloud.android.MainApp.Companion.accountType
import com.owncloud.android.MainApp.Companion.dataFolder
import com.owncloud.android.data.OwncloudDatabase
Expand All @@ -43,6 +46,7 @@ import com.owncloud.android.data.sharing.shares.datasources.implementation.OCLoc
import com.owncloud.android.data.spaces.datasources.LocalSpacesDataSource
import com.owncloud.android.data.spaces.datasources.implementation.OCLocalSpacesDataSource
import com.owncloud.android.data.providers.LocalStorageProvider
import com.owncloud.android.data.providers.QaStorageProvider
import com.owncloud.android.data.providers.ScopedStorageProvider
import com.owncloud.android.data.transfers.datasources.LocalTransferDataSource
import com.owncloud.android.data.transfers.datasources.implementation.OCLocalTransferDataSource
Expand All @@ -67,7 +71,13 @@ val localDataSourceModule = module {
single { OwncloudDatabase.getDatabase(androidContext()).userDao() }

singleOf(::OCSharedPreferencesProvider) bind SharedPreferencesProvider::class
single<LocalStorageProvider> { ScopedStorageProvider(dataFolder, androidContext()) }
single<LocalStorageProvider> {
if (BuildConfig.FLAVOR == MainApp.QA_FLAVOR) {
QaStorageProvider(dataFolder)
} else {
ScopedStorageProvider(dataFolder, androidContext())
}
}

factory<LocalAuthenticationDataSource> { OCLocalAuthenticationDataSource(androidContext(), get(), get(), accountType) }
factoryOf(::OCLocalFolderBackupDataSource) bind LocalFolderBackupDataSource::class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @author Jorge Aguado Recio
*
* Copyright (C) 2012 Bartek Przybylski
* Copyright (C) 2024 ownCloud GmbH.
* Copyright (C) 2025 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -46,6 +46,7 @@ import androidx.core.net.toUri
import androidx.core.view.isVisible
import androidx.core.widget.doAfterTextChanged
import com.owncloud.android.BuildConfig
import com.owncloud.android.MainApp
import com.owncloud.android.MainApp.Companion.accountType
import com.owncloud.android.R
import com.owncloud.android.data.authentication.KEY_USER_ID
Expand Down Expand Up @@ -372,13 +373,14 @@ class LoginActivity : AppCompatActivity(), SslUntrustedCertDialog.OnSslUntrusted
}

private fun checkServerType(serverInfo: ServerInfo) {
if (BuildConfig.FLAVOR == MainApp.QA_FLAVOR) {
handleBasicAuth()
return
}

when (serverInfo) {
is ServerInfo.BasicServer -> {
authTokenType = BASIC_TOKEN_TYPE
oidcSupported = false
showOrHideBasicAuthFields(shouldBeVisible = true)
binding.accountUsername.doAfterTextChanged { updateLoginButtonVisibility() }
binding.accountPassword.doAfterTextChanged { updateLoginButtonVisibility() }
handleBasicAuth()
}

is ServerInfo.OAuth2Server -> {
Expand Down Expand Up @@ -416,6 +418,14 @@ class LoginActivity : AppCompatActivity(), SslUntrustedCertDialog.OnSslUntrusted
}
}

private fun handleBasicAuth() {
authTokenType = BASIC_TOKEN_TYPE
oidcSupported = false
showOrHideBasicAuthFields(shouldBeVisible = true)
binding.accountUsername.doAfterTextChanged { updateLoginButtonVisibility() }
binding.accountPassword.doAfterTextChanged { updateLoginButtonVisibility() }
}

private fun getServerInfoIsLoading() {
binding.serverStatusText.run {
text = getString(R.string.auth_testing_connection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
* ownCloud Android client application
*
* @author David Crespo Ríos
* Copyright (C) 2022 ownCloud GmbH.
* @author Jorge Aguado Recio
*
* Copyright (C) 2025 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -93,6 +95,7 @@ class ReleaseNotesActivity : AppCompatActivity() {

private fun shouldShow(context: Context): Boolean {
val showReleaseNotes = context.resources.getBoolean(R.bool.release_notes_enabled) && !BuildConfig.DEBUG
&& BuildConfig.FLAVOR != MainApp.QA_FLAVOR

return firstRunAfterUpdate() && showReleaseNotes &&
ReleaseNotesViewModel.releaseNotesList.isNotEmpty() &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
* @author Brtosz Przybylski
* @author Christian Schabesberger
* @author David Crespo Ríos
* @author Jorge Aguado Recio
*
* Copyright (C) 2020 Bartosz Przybylski
* Copyright (C) 2022 ownCloud GmbH.
* Copyright (C) 2025 ownCloud GmbH.
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -73,7 +75,7 @@ static public void runIfNeeded(Context context) {
}

static private boolean shouldShow(Context context) {
return context.getResources().getBoolean(R.bool.wizard_enabled) && !BuildConfig.DEBUG
return context.getResources().getBoolean(R.bool.wizard_enabled) && !BuildConfig.DEBUG && !BuildConfig.FLAVOR.equals(MainApp.QA_FLAVOR)
&& context instanceof LoginActivity; // When it is LoginActivity to start it only once
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* ownCloud Android client application
*
* @author Jorge Aguado Recio
*
* Copyright (C) 2025 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.owncloud.android.data.providers

import android.os.Environment
import java.io.File

class QaStorageProvider(
rootFolderName: String,
) : LocalStorageProvider(rootFolderName) {

override fun getPrimaryStorageDirectory(): File = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
}
Loading