Use Storage Access Framework on Android running SDK >= 21 so writing to
sdcard will work again
API 21+ | API 19- | Edit |
albertvaka | |
sredman |
KDE Connect |
Use Storage Access Framework on Android running SDK >= 21 so writing to
sdcard will work again
API 21+ | API 19- | Edit |
Install patch on Android phone with Build.Version < 19 (Kitkat)
Install patch on Android phone with Build.Version < 19 (Kitkat)
Install patch on Android phone with Build.Version > 21 (Lollipop)
No Linters Available |
No Unit Test Coverage |
Buildable 9299 | |
Build 9317: arc lint + arc unit |
USB OTG Testing looks good:
Tested device: OnePlus 6T, Android version 9.0
The downside of this patch is it changes the default: I was very confused that I couldn't immediately see my USB drive and internal storage from Dolphin. Our per-plugin settings are very non-obvious :/. Is it possible to either display a dummy "you need to configure settings" file, or to show everything by default (as things currently are) and leave the settings so advanced users can hide filesystems if they like?
Default behavior is the same for kitkat and earlier. For anything newer the Storage access Framework is used and that requires the user to pick a tree document (Directory) before read/write access is granted. That's what you do with the plugin settings. Also there is no way for me to determine which document providers there are (need to check android bug system). Dummy file or readme.md would be possible.
Since the configuration for plugins is quite hidden, I agree with Simon it can be confusing. I have two ideas:
I'll implement Alberts 1st idea because the second is just not fool-proof and will only allow read-only access to the sdcard.
As soon as we can handle disabled plugins properly I think it's better to disable the plugin until storage locations have been configured
Cool! I like the warning popup!
Does the system automatically configure the device 'root' now? I can't tell if that was there by default or if it was just left over from when I had this before...
Is there a length limit to the warning? I would still vote for something along the lines of "Please configure some storage locations in the plugin settings", just to make it clear what the resolution to the problem is
No it does not and cannot because the user has to grant access
Is there a length limit to the warning? I would still vote for something along the lines of "Please configure some storage locations in the plugin settings", just to make it clear what the resolution to the problem is
Should be possible
This has been stuck for super long, I'm really sorry... testing now.
I don't get any relevant place to pick from as a "storage location" on OnePlus 6 (only "Downloads"):
Why?
Also, really minor but I think the first field shouldn't be editable:
I don't know if this is a OnePlus thing (I think it is not; I think you have to do the same thing on stock Android)
You need to go into the menu (Triple dots at the top right of the shown screenshot) and click "Show Internal Storage" -- This is a setting of the storage-picking thing, so you will now be able to see the internal storage regardless of which app caused it to open (KDE Connect, WhatsApp document share, email attachments, etc.)
In other words, I don't think this is something we have any control over
I'm giving this patch my 👍 since I have been the one reviewing before. It's a great change!
Also, if you have a USB-C adapter, you can plug in a USB flash drive and it will show up under the list of storage locations along with Downloads and Internal Storage!
The field shouldn't be editable only clickable what API are you testing on? I'll have a look tomorrow. Signed my contract today so having a little party tonight
Sorry for all this updates to your patch >.< I thought rebasing would be way simpler...
I've tested it on API 19, API 21, and API 28 and seems to work well.
Just a few minor things inlined, plus that field being editable on my OnePlus 6 with API 28.
Iron those tiny things and you have my +1.
Note that I rebased the code onto master! You can get my changes with arc patch D18212 instead of rebasing it yourself and re-doing the work.
src/org/kde/kdeconnect/Plugins/SftpPlugin/SftpPlugin.java | ||
---|---|---|
197 ↗ | (On Diff #53387) | This default should be true to match the default state of the setting. I had to disable and re-enable the setting for the Camera folder to appear. |
src/org/kde/kdeconnect/Plugins/SftpPlugin/SftpSettingsFragment.java | ||
323 ↗ | (On Diff #53387) | I can write to the internal phone storage (sdcard0) on API 19, although it appears as read only because of this condition. Maybe you had a different experience while testing? To simplify this code, since it's only for old APIs, maybe remove appending the "read only" string? It could be that every device is different, and determining if it is actually going to be read-only is difficult. If that's the case, I don't think it's worth trying to get it right just for old APIs. |
src/org/kde/kdeconnect/Plugins/SftpPlugin/SftpSettingsFragment.java | ||
---|---|---|
323 ↗ | (On Diff #53387) | I apparently did not test if writing to API 19 was possible. I just assumed that because writing to sdcard on KitKat was not possible using the File API it was also not possible using SaF. |