Skip to content
Open
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ buildscript {
ext {
// SDK
sdkCompileVersion = 36
sdkMinVersion = 24
sdkMinVersion = 28
sdkTargetVersion = 36
}

Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/4885
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Change: Upgrade minimum SDK version to API 28 (Android 9)

The minimum SDK version has been upgraded to API 28 (Android 9)
and previous versions will not be supported anymore

https://github.com/owncloud/android/pull/4885
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* ownCloud Android client application
*
* Copyright (C) 2022 ownCloud GmbH.
* Copyright (C) 2026 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 @@ -30,9 +30,7 @@ import com.github.tmurakami.dexopener.DexOpener
*/
class OCTestAndroidJUnitRunner : AndroidJUnitRunner() {
override fun newApplication(cl: ClassLoader, className: String, context: Context): Application {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
DexOpener.install(this)
}
DexOpener.install(this)
return super.newApplication(cl, className, context)
}
}
7 changes: 1 addition & 6 deletions owncloudApp/src/main/java/com/owncloud/android/MainApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @author Aitor Ballesteros Pavón
* @author Jorge Aguado Recio
*
* Copyright (C) 2025 ownCloud GmbH.
* Copyright (C) 2026 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 @@ -33,7 +33,6 @@ import android.app.NotificationManager.IMPORTANCE_LOW
import android.content.Context
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.view.WindowManager
import android.widget.CheckBox
Expand Down Expand Up @@ -272,10 +271,6 @@ class MainApp : Application() {
}

private fun createNotificationChannels() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return
}

createNotificationChannel(
id = DOWNLOAD_NOTIFICATION_CHANNEL_ID,
name = getString(R.string.download_notification_channel_name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import android.accounts.Account
import android.content.Intent
import android.graphics.Bitmap
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
import android.view.Menu
Expand Down Expand Up @@ -259,11 +258,9 @@ class FileDetailsFragment : FileFragment() {
}

private fun setRolesAccessibilityToMenuItems(menu: Menu) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val roleAccessibilityDescription = getString(R.string.button_role_accessibility)
menu.findItem(R.id.action_rename_file)?.contentDescription = "${getString(R.string.common_rename)} $roleAccessibilityDescription"
menu.findItem(R.id.action_remove_file)?.contentDescription = "${getString(R.string.common_remove)} $roleAccessibilityDescription"
}
val roleAccessibilityDescription = getString(R.string.button_role_accessibility)
menu.findItem(R.id.action_rename_file)?.contentDescription = "${getString(R.string.common_rename)} $roleAccessibilityDescription"
menu.findItem(R.id.action_remove_file)?.contentDescription = "${getString(R.string.common_remove)} $roleAccessibilityDescription"
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import android.content.res.ColorStateList
import android.content.res.Configuration
import android.graphics.drawable.Drawable
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
import android.view.Menu
Expand Down Expand Up @@ -266,28 +265,26 @@ class MainFileListFragment : Fragment(),
}

private fun setRolesAccessibilityToMenuItems() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val roleAccessibilityDescription = getString(R.string.button_role_accessibility)
menu?.apply {
findItem(R.id.file_action_select_all)?.contentDescription =
"${getString(R.string.actionbar_select_all)} $roleAccessibilityDescription"
findItem(R.id.action_select_inverse)?.contentDescription =
"${getString(R.string.actionbar_select_inverse)} $roleAccessibilityDescription"
findItem(R.id.action_open_file_with)?.contentDescription =
"${getString(R.string.actionbar_open_with)} $roleAccessibilityDescription"
findItem(R.id.action_rename_file)?.contentDescription = "${getString(R.string.common_rename)} $roleAccessibilityDescription"
findItem(R.id.action_move)?.contentDescription = "${getString(R.string.actionbar_move)} $roleAccessibilityDescription"
findItem(R.id.action_copy)?.contentDescription = "${getString(R.string.copy)} $roleAccessibilityDescription"
findItem(R.id.action_send_file)?.contentDescription =
"${getString(R.string.actionbar_send_file)} $roleAccessibilityDescription"
findItem(R.id.action_set_available_offline)?.contentDescription =
"${getString(R.string.set_available_offline)} $roleAccessibilityDescription"
findItem(R.id.action_unset_available_offline)?.contentDescription =
"${getString(R.string.unset_available_offline)} $roleAccessibilityDescription"
findItem(R.id.action_see_details)?.contentDescription =
"${getString(R.string.actionbar_see_details)} $roleAccessibilityDescription"
findItem(R.id.action_remove_file)?.contentDescription = "${getString(R.string.common_remove)} $roleAccessibilityDescription"
}
val roleAccessibilityDescription = getString(R.string.button_role_accessibility)
menu?.apply {
findItem(R.id.file_action_select_all)?.contentDescription =
"${getString(R.string.actionbar_select_all)} $roleAccessibilityDescription"
findItem(R.id.action_select_inverse)?.contentDescription =
"${getString(R.string.actionbar_select_inverse)} $roleAccessibilityDescription"
findItem(R.id.action_open_file_with)?.contentDescription =
"${getString(R.string.actionbar_open_with)} $roleAccessibilityDescription"
findItem(R.id.action_rename_file)?.contentDescription = "${getString(R.string.common_rename)} $roleAccessibilityDescription"
findItem(R.id.action_move)?.contentDescription = "${getString(R.string.actionbar_move)} $roleAccessibilityDescription"
findItem(R.id.action_copy)?.contentDescription = "${getString(R.string.copy)} $roleAccessibilityDescription"
findItem(R.id.action_send_file)?.contentDescription =
"${getString(R.string.actionbar_send_file)} $roleAccessibilityDescription"
findItem(R.id.action_set_available_offline)?.contentDescription =
"${getString(R.string.set_available_offline)} $roleAccessibilityDescription"
findItem(R.id.action_unset_available_offline)?.contentDescription =
"${getString(R.string.unset_available_offline)} $roleAccessibilityDescription"
findItem(R.id.action_see_details)?.contentDescription =
"${getString(R.string.actionbar_see_details)} $roleAccessibilityDescription"
findItem(R.id.action_remove_file)?.contentDescription = "${getString(R.string.common_remove)} $roleAccessibilityDescription"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* ownCloud Android client application
*
* @author Juan Carlos Garrote Gascón
* @author Jorge Aguado Recio
*
* Copyright (C) 2021 ownCloud GmbH.
* Copyright (C) 2026 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 All @@ -24,7 +25,6 @@ import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.provider.Settings
import androidx.preference.Preference
Expand Down Expand Up @@ -93,16 +93,12 @@ class SettingsFragment : PreferenceFragmentCompat() {
true
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
subsectionNotifications?.setOnPreferenceClickListener {
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply {
putExtra(Settings.EXTRA_APP_PACKAGE, requireContext().packageName)
}
startActivity(intent)
true
subsectionNotifications?.setOnPreferenceClickListener {
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply {
putExtra(Settings.EXTRA_APP_PACKAGE, requireContext().packageName)
}
} else {
settingsScreen.removePreferenceFromScreen(subsectionNotifications)
startActivity(intent)
true
}

prefAboutApp?.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author Aitor Ballesteros Pavón
* @author Jorge Aguado Recio
*
* Copyright (C) 2024 ownCloud GmbH.
* Copyright (C) 2026 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 All @@ -25,7 +25,6 @@ package com.owncloud.android.presentation.settings.automaticuploads
import android.app.Activity
import android.content.DialogInterface
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.provider.DocumentsContract
import android.view.View
Expand Down Expand Up @@ -209,9 +208,7 @@ class SettingsPictureUploadsFragment : PreferenceFragmentCompat() {
currentSourcePath.takeUnless { it.endsWith(File.separator) } ?: currentSourcePath.plus(File.separator)
}
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).apply {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
putExtra(DocumentsContract.EXTRA_INITIAL_URI, sourcePath)
}
putExtra(DocumentsContract.EXTRA_INITIAL_URI, sourcePath)
addFlags(
Intent.FLAG_GRANT_READ_URI_PERMISSION
or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author Aitor Ballesteros Pavón
* @author Jorge Aguado Recio
*
* Copyright (C) 2024 ownCloud GmbH.
* Copyright (C) 2026 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 All @@ -25,7 +25,6 @@ package com.owncloud.android.presentation.settings.automaticuploads
import android.app.Activity
import android.content.DialogInterface
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.provider.DocumentsContract
import android.view.View
Expand Down Expand Up @@ -207,9 +206,7 @@ class SettingsVideoUploadsFragment : PreferenceFragmentCompat() {
currentSourcePath.takeUnless { it.endsWith(File.separator) } ?: currentSourcePath.plus(File.separator)
}
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).apply {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
putExtra(DocumentsContract.EXTRA_INITIAL_URI, sourcePath)
}
putExtra(DocumentsContract.EXTRA_INITIAL_URI, sourcePath)
addFlags(
Intent.FLAG_GRANT_READ_URI_PERMISSION
or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import android.accounts.AccountManagerFuture
import android.content.Intent
import android.content.res.ColorStateList
import android.content.res.Configuration
import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.provider.DocumentsContract
Expand Down Expand Up @@ -137,11 +136,9 @@ abstract class DrawerActivity : ToolbarActivity() {
// Notch support
getNavView()?.addOnAttachStateChangeListener(object : View.OnAttachStateChangeListener {
override fun onViewAttachedToWindow(v: View) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
v.rootWindowInsets.displayCutout?.let {
getDrawerActiveUser()?.layoutParams?.height =
DisplayUtils.getDrawerHeaderHeight(it.safeInsetTop, resources)
}
v.rootWindowInsets.displayCutout?.let {
getDrawerActiveUser()?.layoutParams?.height =
DisplayUtils.getDrawerHeaderHeight(it.safeInsetTop, resources)
}
}

Expand Down Expand Up @@ -499,16 +496,14 @@ abstract class DrawerActivity : ToolbarActivity() {
}

private fun setRolesAccessibilityToMenuItems() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val navViewMenu = getNavView()?.menu ?: return
val roleAccessibilityDescription = getString(R.string.button_role_accessibility)
navViewMenu.apply {
findItem(R.id.nav_settings)?.contentDescription = "${getString(R.string.actionbar_settings)} $roleAccessibilityDescription"
findItem(R.id.drawer_menu_feedback)?.contentDescription = "${getString(R.string.drawer_feedback)} $roleAccessibilityDescription"
findItem(R.id.drawer_menu_help)?.contentDescription = "${getString(R.string.prefs_help)} $roleAccessibilityDescription"
findItem(R.id.drawer_menu_privacy_policy)?.contentDescription =
"${getString(R.string.prefs_privacy_policy)} $roleAccessibilityDescription"
}
val navViewMenu = getNavView()?.menu ?: return
val roleAccessibilityDescription = getString(R.string.button_role_accessibility)
navViewMenu.apply {
findItem(R.id.nav_settings)?.contentDescription = "${getString(R.string.actionbar_settings)} $roleAccessibilityDescription"
findItem(R.id.drawer_menu_feedback)?.contentDescription = "${getString(R.string.drawer_feedback)} $roleAccessibilityDescription"
findItem(R.id.drawer_menu_help)?.contentDescription = "${getString(R.string.prefs_help)} $roleAccessibilityDescription"
findItem(R.id.drawer_menu_privacy_policy)?.contentDescription =
"${getString(R.string.prefs_privacy_policy)} $roleAccessibilityDescription"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,7 @@ class FileDisplayActivity : FileActivity(),
}

private fun setRolesAccessibilityToMenuItems() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
selectAllMenuItem?.contentDescription = "${getString(R.string.actionbar_select_all)} ${getString(R.string.button_role_accessibility)}"
}
selectAllMenuItem?.contentDescription = "${getString(R.string.actionbar_select_all)} ${getString(R.string.button_role_accessibility)}"
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
* @author Christian Schabesberger
* @author David González Verdugo
* @author Aitor Ballesteros Pavón
* @author Jorge Aguado Recio
*
* Copyright (C) 2024 ownCloud GmbH.
* Copyright (C) 2026 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 @@ -157,12 +158,10 @@ public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflat
super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.file_actions_menu, menu);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
String roleAccessibilityDescription = getString(R.string.button_role_accessibility);
menu.findItem(R.id.action_open_file_with).setContentDescription(getString(R.string.actionbar_open_with) + " " + roleAccessibilityDescription);
menu.findItem(R.id.action_send_file).setContentDescription(getString(R.string.actionbar_send_file) + " " + roleAccessibilityDescription);
menu.findItem(R.id.action_set_available_offline).setContentDescription(getString(R.string.set_available_offline) + " " + roleAccessibilityDescription);
menu.findItem(R.id.action_unset_available_offline).setContentDescription(getString(R.string.set_available_offline) + " " + roleAccessibilityDescription);
}
String roleAccessibilityDescription = getString(R.string.button_role_accessibility);
menu.findItem(R.id.action_open_file_with).setContentDescription(getString(R.string.actionbar_open_with) + " " + roleAccessibilityDescription);
menu.findItem(R.id.action_send_file).setContentDescription(getString(R.string.actionbar_send_file) + " " + roleAccessibilityDescription);
menu.findItem(R.id.action_set_available_offline).setContentDescription(getString(R.string.set_available_offline) + " " + roleAccessibilityDescription);
menu.findItem(R.id.action_unset_available_offline).setContentDescription(getString(R.string.set_available_offline) + " " + roleAccessibilityDescription);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import android.content.Intent
import android.content.ServiceConnection
import android.graphics.BitmapFactory
import android.media.MediaMetadataRetriever
import android.os.Build
import android.os.Bundle
import android.os.IBinder
import android.view.LayoutInflater
Expand Down Expand Up @@ -264,10 +263,8 @@ class PreviewAudioFragment : FileFragment() {
}

private fun setRolesAccessibilityToMenuItems(menu: Menu) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
menu.findItem(R.id.action_see_details)?.contentDescription =
"${getString(R.string.actionbar_see_details)} ${getString(R.string.button_role_accessibility)}"
}
menu.findItem(R.id.action_see_details)?.contentDescription =
"${getString(R.string.actionbar_see_details)} ${getString(R.string.button_role_accessibility)}"
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @author Aitor Ballesteros Pavón
* @author Jorge Aguado Recio
*
* Copyright (C) 2025 ownCloud GmbH.
* Copyright (C) 2026 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 @@ -31,7 +31,6 @@ import android.accounts.Account
import android.graphics.Bitmap
import android.graphics.Color
import android.graphics.drawable.Drawable
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
import android.view.Menu
Expand Down Expand Up @@ -207,10 +206,8 @@ class PreviewImageFragment : FileFragment() {
}

private fun setRolesAccessibilityToMenuItems(menu: Menu) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
menu.findItem(R.id.action_see_details)?.contentDescription =
"${getString(R.string.actionbar_see_details)} ${getString(R.string.button_role_accessibility)}"
}
menu.findItem(R.id.action_see_details)?.contentDescription =
"${getString(R.string.actionbar_see_details)} ${getString(R.string.button_role_accessibility)}"
}

/**
Expand Down
Loading