D18212: Use Storage Access Framework on SDK >= 21 (Lollipop and above)

Albert Vaca Cintora noreply at phabricator.kde.org
Thu Mar 7 20:45:27 GMT 2019


albertvaka added a comment.


  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.

INLINE COMMENTS

> SftpPlugin.java:177
> +        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
> +            addCameraShortcuts = prefs.getBoolean(context.getString(R.string.sftp_preference_key_add_camera_shortcut), false);
> +        }

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.

> SftpSettingsFragment.java:322
> +
> +                String displayName = (Build.VERSION.SDK_INT == 19 || info.readonly) ?
> +                        displayNameReadOnlyBuilder.toString() : displayNameBuilder.toString();

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.

REPOSITORY
  R225 KDE Connect - Android application

BRANCH
  arcpatch-D18212

REVISION DETAIL
  https://phabricator.kde.org/D18212

To: eduisters, #kde_connect, albertvaka, sredman
Cc: albertvaka, sredman, kdeconnect, ctakano, vporvaznik, mschroeder, varunp, shivanshukantprasad, skymoore, brute4s99, wistak, anoopv, dvalencia, rmenezes, julioc, Leptopoda, timothyc, Danial0_0, johnq, Pitel, domson, adeen-s, SemperPeritus, daniel.z.tg, jeanv, seebauer, bugzy, MayeulC, lemuel, menasshock, mikesomov, tctara, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20190307/f1dd7b06/attachment.html>


More information about the KDEConnect mailing list