[kdeconnect] [Bug 523973] Sending multiple files via "Send files" drops some files with SecurityException

[email protected]
Newsgroups gmane.comp.kde.devel.bugs
Message-ID <[email protected]/>
https://bugs.kde.org/show_bug.cgi?id=523973

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|                            |https://invent.kde.org/netw
                   |                            |ork/kdeconnect-android/-/co
                   |                            |mmit/14c65432dcbaabc796af4f
                   |                            |e449756e6adb7c0d28
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from [email protected] ---
Git commit 14c65432dcbaabc796af4fe449756e6adb7c0d28 by Manuel Mike.
Committed on 07/08/2026 at 13:23.
Pushed by albertvaka into branch 'master'.

Fix SecurityException for some files sent via SendFileActivity

ACTION_GET_CONTENT grants read permission on the returned URIs only for
the lifetime of the receiving activity. SendFileActivity dispatched the
actual reading (SharePlugin.sendUriList -> FilesHelper.uriToNetworkPacket
-> ContentResolver.openInputStream) to a background thread but called
finish() immediately afterwards without waiting for it, so the activity
could be torn down -- and the URI grants revoked -- before all the
selected files had been opened. Any URI opened after that point failed
with "SecurityException: ... requires ACTION_OPEN_DOCUMENT", so multi-file
sends would silently drop a subset of the selection.

finish() is now deferred until sendUriList() has returned, keeping the
activity (and its URI grants) alive for the whole synchronous read loop
while still keeping that work off the main thread.

M  +14   -6   
src/main/java/org/kde/kdeconnect/plugins/share/SendFileActivity.java

https://invent.kde.org/network/kdeconnect-android/-/commit/14c65432dcbaabc796af4fe449756e6adb7c0d28

-- 
You are receiving this mail because:
You are watching all bug changes.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.