Allow opening files shared to android using the notification
ClosedPublic

Authored by mtijink on Dec 14 2017, 2:27 PM.

Details

Summary

Since Android Nougat, the previous way to open a file shared to android did not work anymore (using file:// urls), as marked with a TODO.

This diff implements the new way of opening files: a content provider url (content://) allows opening files through the KDE Connect app. As an added benefit, apps without external files permission can now open files received by KDE Connect.

Test Plan

Works for me.

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.
mtijink requested review of this revision.Dec 14 2017, 2:27 PM
mtijink created this revision.

Awesome! I can't try it right now, but I have some quick questions: Does it work with files outside the default destination directory? And would it be possible/wise to use the new method on Android < 24?

mtijink planned changes to this revision.Dec 15 2017, 7:02 AM

Does it work with files outside the default destination directory?

Ah, didn't know that was possible. As written it crashes for non-default directories, I'll fix that. It seems hard to also cover that case, but I'll investigate.

And would it be possible/wise to use the new method on Android < 24?

Maybe, depends on how many apps support the new method (I'd guess most do).

mtijink updated this revision to Diff 23986.Dec 16 2017, 1:27 PM

Changed so that the code no longer crashes with a custom download directory. A custom ContentProvider is needed to also allow tap-to-open for customer download directories.

albertvaka accepted this revision.Dec 18 2017, 12:37 PM
albertvaka added a subscriber: albertvaka.

Cool, thanks a ton! Eventually I think we will need the custom provider, because FileProvider is rather limited, but for now this is already much better than what we had before :)

This revision is now accepted and ready to land.Dec 18 2017, 12:37 PM

Can you commit it for me? Or should I apply for a developer account by now?

Also, could you (or someone else) look at D8957, D9083 and D9296? They've been open for a while, even though they're quite simple.

This revision was automatically updated to reflect the committed changes.

Or should I apply for a developer account by now?

I think you earned that :)