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
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ android {
htmlOutput = layout.buildDirectory.file("reports/lint/lint.html").get().asFile
htmlReport = true
warningsAsErrors = true
targetSdk 36
targetSdk 37
}

defaultConfig {
Expand Down Expand Up @@ -164,7 +164,7 @@ android {

testOptions {
unitTests.returnDefaultValues = true
targetSdk 36
targetSdk 37
}

packagingOptions {
Expand Down
12 changes: 12 additions & 0 deletions library/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Nextcloud Android Library
~
~ SPDX-FileCopyrightText: 2026 Alper Ozturk <alper.ozturk@nextcloud.com>
~ SPDX-License-Identifier: MIT
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.ACCESS_LOCAL_NETWORK" />

</manifest>
14 changes: 14 additions & 0 deletions library/src/androidTest/java/com/owncloud/android/AbstractIT.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Nextcloud Android Library
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <alper.ozturk@nextcloud.com>
* SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2018-2023 Tobias Kaminsky <tobias@kaminsky.me>
* SPDX-FileCopyrightText: 2025 TSI-mc <surinder.kumar@t-systems.com>
Expand All @@ -13,8 +14,10 @@
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;

import android.Manifest;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;

import androidx.test.platform.app.InstrumentationRegistry;
Expand Down Expand Up @@ -89,6 +92,7 @@ public static void beforeAll() throws InterruptedException,
IOException {
Bundle arguments = InstrumentationRegistry.getArguments();
context = InstrumentationRegistry.getInstrumentation().getTargetContext();
grantLocalNetworkPermission();

url = Uri.parse(arguments.getString("TEST_SERVER_URL"));
String loginName = arguments.getString("TEST_SERVER_USERNAME");
Expand Down Expand Up @@ -116,6 +120,16 @@ public static void beforeAll() throws InterruptedException,
testConnection();
}

private static void grantLocalNetworkPermission() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.CINNAMON_BUN) {
return;
}

InstrumentationRegistry.getInstrumentation()
.getUiAutomation()
.grantRuntimePermission(context.getPackageName(), Manifest.permission.ACCESS_LOCAL_NETWORK);
}

private static void waitForServer(OwnCloudClient client, Uri baseUrl) {
String statusUrl = baseUrl + "/status.php";
GetMethod get;
Expand Down
2 changes: 1 addition & 1 deletion sample_client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {

defaultConfig {
minSdkVersion 26
targetSdkVersion 36
targetSdkVersion 37

multiDexEnabled = true

Expand Down
Loading