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
2 changes: 1 addition & 1 deletion .github/workflows/screenShotTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
matrix:
scheme: [ Light ]
color: [ blue ]
api-level: [ 27 ]
api-level: [ 28 ]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ android {

defaultConfig {
applicationId = "com.nextcloud.client"
minSdk = 27
minSdk = 28
targetSdk = 36
compileSdk = 36

Expand Down
20 changes: 2 additions & 18 deletions app/src/androidTest/assets/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@ Java:

```java
private String getAppProcessName() {
String processName = "";
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
ActivityManager manager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
final int ownPid = android.os.Process.myPid();
final List<ActivityManager.RunningAppProcessInfo> processes = manager.getRunningAppProcesses();
if (processes != null) {
for (ActivityManager.RunningAppProcessInfo info : processes) {
if (info.pid == ownPid) {
processName = info.processName;
break;
}
}
}
} else {
processName = Application.getProcessName();
}
return processName;
}
return Application.getProcessName();
}
```
16 changes: 3 additions & 13 deletions app/src/androidTest/java/com/nextcloud/client/TestRunner.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <alper.ozturk@nextcloud.com>
* SPDX-FileCopyrightText: 2023 Álvaro Brey <alvaro@alvarobrey.com>
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH
* SPDX-FileCopyrightText: 2019 Tobias Kaminsky <tobias@kaminsky.me>
Expand All @@ -9,23 +10,12 @@
package com.nextcloud.client

import android.app.Application
import android.app.Instrumentation
import android.content.Context
import android.os.Build
import androidx.test.runner.AndroidJUnitRunner
import com.github.tmurakami.dexopener.DexOpener
import com.nextcloud.test.TestMainApp

class TestRunner : AndroidJUnitRunner() {
@Throws(ClassNotFoundException::class, IllegalAccessException::class, InstantiationException::class)
override fun newApplication(cl: ClassLoader, className: String, context: Context): Application {
/*
* Initialize DexOpener only on API below 28 to enable mocking of Kotlin classes.
* On API 28+ the platform supports mocking natively.
*/
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
DexOpener.install(this)
}
return Instrumentation.newApplication(TestMainApp::class.java, context)
}
override fun newApplication(cl: ClassLoader, className: String, context: Context): Application =
newApplication(TestMainApp::class.java, context)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ package com.owncloud.android.datamodel

import android.content.ContentResolver
import android.net.Uri
import android.os.Build
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SdkSuppress
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -60,20 +58,4 @@ class ContentResolverHelperIT {
null
)
}

@Test
@SdkSuppress(maxSdkVersion = Build.VERSION_CODES.N_MR1)
fun contentResolver_onAndroidBelow26_usesOldAPI() {
ContentResolverHelper
.queryResolver(resolver, URI, PROJECTION, SELECTION, null, SORT_COLUMN, SORT_DIRECTION, LIMIT)

verify(resolver).query(
eq(URI),
eq(PROJECTION),
eq(SELECTION),
eq(null),
eq("$SORT_COLUMN $SORT_DIRECTION LIMIT $LIMIT"),
eq(null)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ class ClipboardClearWorker(private val context: Context, params: WorkerParameter
return Result.success()
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
clipboardManager.clearPrimaryClip()
} else {
val newEmptyClip = ClipData.newPlainText("EmptyClipContent", "")
clipboardManager.setPrimaryClip(newEmptyClip)
}
clipboardManager.clearPrimaryClip()

return Result.success()
} catch (e: Exception) {
Expand Down
20 changes: 2 additions & 18 deletions app/src/main/java/com/owncloud/android/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
* Contains methods to build the "static" strings. These strings were before constants in different classes.
*/
public class MainApp extends Application implements HasAndroidInjector, NetworkChangeListener {
public static final OwnCloudVersion OUTDATED_SERVER_VERSION = NextcloudVersion.nextcloud_29;
public static final OwnCloudVersion OUTDATED_SERVER_VERSION = NextcloudVersion.nextcloud_30;
public static final OwnCloudVersion MINIMUM_SUPPORTED_SERVER_VERSION = OwnCloudVersion.nextcloud_20;

private static final String TAG = MainApp.class.getSimpleName();
Expand Down Expand Up @@ -233,23 +233,7 @@ private void registerNetworkChangeReceiver() {
}

private String getAppProcessName() {
String processName = "";
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
ActivityManager manager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
final int ownPid = android.os.Process.myPid();
final List<ActivityManager.RunningAppProcessInfo> processes = manager.getRunningAppProcesses();
if (processes != null) {
for (ActivityManager.RunningAppProcessInfo info : processes) {
if (info.pid == ownPid) {
processName = info.processName;
break;
}
}
}
} else {
processName = Application.getProcessName();
}
return processName;
return Application.getProcessName();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import android.os.Bundle
import android.view.MenuItem
import android.view.View
Expand Down Expand Up @@ -129,10 +128,6 @@ class PreviewImageActivity :
}

private fun applyDisplayCutOutTopPadding() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
return
}

window.decorView.setOnApplyWindowInsetsListener { view, insets ->
val displayCutout = insets.displayCutout
if (displayCutout != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,10 @@ class TestPowerManagementService {
}

@Test
fun `battery charging status on API 17+`() {
fun `battery charging status`() {
// GIVEN
// device has API level 17+
// battery status sticky intent is available
whenever(deviceInfo.apiLevel).thenReturn(Build.VERSION_CODES.JELLY_BEAN_MR1)
whenever(deviceInfo.apiLevel).thenReturn(Build.VERSION_CODES.P)
val powerSources = setOf(
BatteryManager.BATTERY_PLUGGED_AC,
BatteryManager.BATTERY_PLUGGED_USB,
Expand All @@ -134,29 +133,6 @@ class TestPowerManagementService {
}
}

@Test
fun `battery charging status on API 16`() {
// GIVEN
// device has API level 16
// battery status sticky intent is available
whenever(deviceInfo.apiLevel).thenReturn(Build.VERSION_CODES.JELLY_BEAN)
val powerSources = setOf(
BatteryManager.BATTERY_PLUGGED_AC,
BatteryManager.BATTERY_PLUGGED_USB
)

for (row in powerSources) {
// WHEN
// device is charging using AC or USB
whenever(intent.getIntExtra(eq(BatteryManager.EXTRA_PLUGGED), any()))
.thenReturn(row)

// THEN
// charging flag is true
assertTrue(powerManagementService.battery.isCharging)
}
}

@Test
fun `battery status sticky intent is not available`() {
// GIVEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,10 @@ class BackgroundJobFactoryTest {
}

@Test
fun content_observer_worker_is_created_on_api_level_24() {
fun content_observer_worker_is_created() {
// GIVEN
// api level is > 24
// content URI trigger is supported
whenever(deviceInfo.apiLevel).thenReturn(Build.VERSION_CODES.N)
whenever(deviceInfo.apiLevel).thenReturn(Build.VERSION_CODES.P)

// WHEN
// factory is called to create content observer worker
Expand Down
2 changes: 1 addition & 1 deletion appscan/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
namespace = "com.nextcloud.appscan"

defaultConfig {
minSdk = 27
minSdk = 28
compileSdk = 36
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
androidCommonLibraryVersion = "0.30.0"
androidGifDrawableVersion = "1.2.29"
androidImageCropperVersion = "4.7.0"
androidLibraryVersion = "b8f77935157e44c1d7a71f81271b412b0dbe8c76"
androidLibraryVersion = "827db94ca661d39ca7fae5c608eab1282b629b84"
androidPluginVersion = '8.13.1'
androidsvgVersion = "1.4"
androidxMediaVersion = "1.5.1"
Expand Down
56 changes: 56 additions & 0 deletions gradle/verification-keyring.keys
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,47 @@ yzETgE8zz59/t9SaMpJ0Wtw2iS688bZba+b0OT6AsrI=
=XaPu
-----END PGP PUBLIC KEY BLOCK-----

pub AE094C852B4EE5DC
sub 2728E6DC4904AE9D
-----BEGIN PGP PUBLIC KEY BLOCK-----

xsFNBGkPj7UBEAC3TJajkxkcOyZic+qxdz/LVk5oHRM7E28deZcwCQb6182A8SyH
nHiQeCvjJWCgEXSAtdDuJRfBEpy2mFuKDj2ht4XwNyHNCs/qB78pC/aY45d+AImu
57Fh7N8JTCy1L/MO2WBOT8OMLxx3gLbvay4o+8JVrpeR5puhLzT2UKbDCF00gXPv
y1y+MluH6hLpf0I5VtIhXsdRX18Ta3+R8az8NBq2G7uv+mA8C+1OjFUPCfLdMpWK
teJtvDwQUGl2QSKpwUkgFp1FTOVN5kRE/jarjulu0U4khNEOQCOXyBZBGrUdbGYO
mDpfSwfDMunuh/n/A7WjZ2l3KFtbJjHoe1B4eYxa3dceym18PgR83bSvDLnwIJgC
Kodyd7BRVaa09lVbGf2SQ4XL+OqkyZRcfChkFUsD1BnQXydRnIUKIkxMp76ldpAp
yPq0FgLOCB1UxJp274fLlePPTuRAHZa6uK1mWNZcJpMua5rWYlOBvrpMo20nbGqx
04tSHXIASSQv90yxe14ZZUGVi3IfkDrw2ig5J6X/VjtEZBaB1/drHAgTxrRrgKbp
9jcaQMlgjQjulS3yi6g64w5dYniJg/t2cH5xLKk8dLX2SNj3quLT/zX1ISmIvTe3
AgtKG/eDCPySfF24NRbpe7G9Qu4qmSqSx/DE5aD5+TywhazizA4CDcODgwARAQAB
zs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K8nkeSssWTEiJ8CQwEkV
ArkNlxIUzZ8g/4Kya6+b26xAHdQ/uxT+9djHgledlg9oH5DWaST/gHy3bLgggcZQ
wPTFnACtM8qA1kFs5/ikpaNyHx4PBvy5gCG74+IYKFR4yb2p/0OjwztoE6sggVB7
5BX4cNSD21s5tvxe/FBgbUiRyLMi5FZmHLX/sDVXqLNw8JOT19O1O8Xhkx3nUc9J
bnEdl0Gq+VchsyAjPCZLZkqy+ZhZe4JFtF0UtZUGEnRJzpRZkQIyBgHQ0ShQ4LAW
5brE6l3oL47QY6MFQ6VmsLr7IuUtenUOjMSXh5ubyy+wiuQRlOoy8LCduC0onv7V
gI9NtptN+3snH/IYqwS6E/L5B6w2ITfm2NQZFEMs4CLDBQedFIyJVdY=
=UQCs
-----END PGP PUBLIC KEY BLOCK-----

pub AE5A7FB608A0221C
uid Robert Scholte <rfscholte@apache.org>

Expand Down Expand Up @@ -6139,6 +6180,21 @@ ZgMBzI+v/ingWOyKpKqhpZR/50PHA0o23zw8P1BGeQOlr4kFNA==
=jR+6
-----END PGP PUBLIC KEY BLOCK-----

pub 340B090F727518D8
uid Thomas Ball <tball@google.com>

sub 6EAC8515E0EBB87E
-----BEGIN PGP PUBLIC KEY BLOCK-----

xjMEaJzwtxYJKwYBBAHaRw8BAQdAmw8gRfE8mqvum1kG2Zlm6t46bkXFvJIHRVBZ
OctVLVe0HlRob21hcyBCYWxsIDx0YmFsbEBnb29nbGUuY29tPs44BGic8LcSCisG
AQQBl1UBBQEBB0A+DJUNDeULyBrFpk3P07SXnEAch7KoDYah6j0PxgnNQgMBCAfC
fgQYFgoAJhYhBMMlnSDa7ErObVfMgzQLCQ9ydRjYBQJonPC3AhsMBQkFo5qAAAoJ
EDQLCQ9ydRjY3/MA/38kMom8Qy8gO3AH31GqVqguYruG848SaIJugavlTT4sAP9D
EfbsFU4kymcgABRT9CyDsNAmI/lxRNEB+pxiNp1/DA==
=FAP2
-----END PGP PUBLIC KEY BLOCK-----

pub 347CD0EAED975C5F
uid Eric Vergnaud <eric.vergnaud@wanadoo.fr>

Expand Down
Loading
Loading