Allow browsing sdcard when there is an unreadable file in it (eg .android_secure)
ClosedPublic

Authored by eduisters on Dec 17 2018, 7:12 PM.

Details

Summary

On my Samsung Galaxy S5 mini (Android 6.0.1) browsing the sdcard is not possible because there
is a hidden file .android_secure that is not readable by a normal user.
For such a file File.exists() returns false while File.listFiles() does return it
and SftpSubsystem.writeAttrs() throws an exception

Test Plan

On a device where the SDCard cannot be browsed (I think its API 23 and up)
install kdeconnect with this patch and verify that the SDCard can now be browsed successfully

Diff Detail

Repository
R225 KDE Connect - Android application
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
eduisters created this revision.Dec 17 2018, 7:12 PM
Restricted Application added a project: KDE Connect. · View Herald TranscriptDec 17 2018, 7:12 PM
Restricted Application added a subscriber: kdeconnect. · View Herald Transcript
eduisters requested review of this revision.Dec 17 2018, 7:12 PM

Awesome! Unfortunately I don't have a phone with an SD Card to test. Does this also fix writing to the SD card?

Awesome! Unfortunately I don't have a phone with an SD Card to test. Does this also fix writing to the SD card?

No only reading. Writing will take storage access framework I think, needs more investigating

albertvaka accepted this revision.Dec 21 2018, 10:34 AM
albertvaka added a subscriber: albertvaka.

Nice job finding these problems!

This revision is now accepted and ready to land.Dec 21 2018, 10:34 AM
This revision was automatically updated to reflect the committed changes.