From 38e713f489d455c36893eac2e87454d0b15640a0 Mon Sep 17 00:00:00 2001 From: Luca Carlon Date: Wed, 2 Oct 2024 04:41:39 +0000 Subject: [PATCH] Fix access to the Downloads directory on Android 10 On Android 10 the share files feature fails when the default directory is selected. When selecting a custom directory, the permission is explicitly asked to the user, which makes the feature work. When the location is switched back to the default location, the feature is again broken. The requestLegacyExternalStorage flag brings back the old behavior and allows to write in the directory. It should be however ignored for Android >= 11 according to the docs: https://developer.android.com/training/data-storage/use-cases#opt-out-in-production-app From Android 11, the Downlods directory should not need specific permissions. --- AndroidManifest.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index a248a935..78cc2ffb 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -68,7 +68,9 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted android:networkSecurityConfig="@xml/network_security_config" android:theme="@style/KdeConnectTheme.NoActionBar" android:name="org.kde.kdeconnect.KdeConnect" - android:enableOnBackInvokedCallback="true"> + android:enableOnBackInvokedCallback="true" + android:requestLegacyExternalStorage="true"> +