Skip to content

feat(permission): access local network - #17934

Draft
alperozturk96 wants to merge 13 commits into
masterfrom
feat/local-network-permission-handling
Draft

alperozturk96 wants to merge 13 commits into
masterfrom
feat/local-network-permission-handling

Conversation

@alperozturk96

@alperozturk96 alperozturk96 commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

First common PR: nextcloud/android-common#1104

Changes

  • Only does check if the device runs Android 17 or newer and the app targets SDK 37 or newer and server URL of the current account is local.
  • Adds access local network permission for Android 17
  • Warns user about the missing permission and recovers for failed uploads (only uploads because Downloads, offline sync and contacts/calendar backup aren't retried right away. They run again on their normal schedule. Only uploads restart immediately.)

Documentation

https://developer.android.com/privacy-and-security/local-network-permission

How to test?

  1. make targetSdk = 37 from build.gradle

Behaviour

When user have Android 17 device and when the app opens:

Notification will be showed, if permission is missing and url is local:

Screenshot_20261102_142027

If user puts the app in foreground, permission dialog will appear:

Screenshot_20261102_142420

If user rejects it, snack-bar will appear:

Screenshot_20261102_144421

@alperozturk96

alperozturk96 commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

@tobiasKaminsky @daniele-verducci should we also check permission before any download, export etc?

I think current state of the PR is enough. Whoever have local network and Android 17 will see at least notification on app launch and native permission dialog. If they reject they will see snack-bar.

When they re-launch app they still see notification and snack-bar per app launch if the permission is missing. Adding check for each remote operation would be too much.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

📱 QA build

Download app-qa-debug.apk
QR code Open the QR code for this download
Commit 69ddacb
Version 17934
Available until 7 days after this build

The QA build installs alongside a released Nextcloud app, so you can keep
using your existing install while testing.

Downloading the file requires a GitHub account, so open this link on the
device you want to test on, or transfer the APK to it.

@daniele-verducci

Copy link
Copy Markdown
Contributor

should we also check permission before any download, export etc?

I think on app startup is enough: if the user just upgraded to 17, the phone has been rebooted and the message is shown as soon as the app is started

@daniele-verducci daniele-verducci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as intended

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@alperozturk96
alperozturk96 force-pushed the feat/local-network-permission-handling branch from a1b9400 to e27d73f Compare November 4, 2026 05:32
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

@alperozturk96
alperozturk96 marked this pull request as draft November 4, 2026 09:32
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

SpotBugs

CategoryBaseNew
Bad practice2424
Correctness4545
Dodgy code145145
Experimental11
Malicious code vulnerability11
Multithreaded correctness1313
Performance2828
Security1515
Total272272

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants