1dfb68debb
Background: External SD cards are only partially supported by the Android system, with a great deal of fragmentation on implementation across manufacturers and android versions. There is no official support for OTG devices. This commit adds: 1) External SD card support 2) OTG device support Caveats: 1) Not tested on Android 6. Emulator crashes when opening files on Android 6, using an unmodified build of the master branch. 2) OTG support currently works only if there is write access to the OTG directory. The user must be aware of exact OTG directory path or be able to navigate to it as well. 3) External SD card provider currently lacks file filtering. Approach: ----- Added new document providers. External SD cards: There are 2 different document providers external sd cards, one for Android 4.4 and above, and the other for older versions. 1) New Android 4.4 and above require usage of the DocumentFile wrapper class to access files in external storage. Actual file paths are no longer obtainable. As such, the underlying file will be cloned in a cache, allowing us to get an actual file path and use LOK. Some differences exist between 4.4 & 5+. The document provider handles each case separately. 2) Legacy Android 4.3 and below do not support the DocumentFile wrapper. File object can be used in these versions, allowing actual file paths to be obtained. The document provider guesses the root directory of the SD card. If the guessing fails, the user is to navigate to this directory himself. OTG: The OTG document provider resembles the legacy external SD card document provider, requiring the user to locate the directory himself. The document provider does not guess the root directory of the OTG device as the location varies with manufacturer implementation. ----- Supplementary Notes: Attempting to use the internal app cache as the file cache like in the ownCloud document provider did not work. Using the external app cache works fine though. It could be because initializing LOK wipes the internal app cache. Would be good to test the ownCloud document provider to confirm if it works. Change-Id: Ie727cca265107bc49ca7e7b57130470f7fc52e06 Reviewed-on: https://gerrit.libreoffice.org/20738 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
6 lines
No EOL
245 B
XML
6 lines
No EOL
245 B
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:id="@+id/fragment_container"
|
|
android:layout_width="match_parent" android:layout_height="match_parent">
|
|
|
|
</FrameLayout> |