diff options
author | Jarkko Koivikko <[email protected]> | 2022-03-24 06:12:38 +0200 |
---|---|---|
committer | Jarkko Koivikko <[email protected]> | 2022-03-25 19:06:53 +0200 |
commit | 1fefff6d1f99dbcf1a453424753ad5562fb675ef (patch) | |
tree | 5cbc1eca4fdcdac8a35417a680161784d6f0956c /src/plugins/platforms/android/androidcontentfileengine.h | |
parent | eda8b7b4dad6fada6c7afa43b7df0f531d2504d1 (diff) |
Android: Keep the ParcelFileDescriptor open for content uris
Detaching fd and closing the ParcelFileDescriptor prevents IO with the
services like Google Drive on Android.
Instead, the file system should keep the ParcelFileDescriptor open while
the IO operations take place and close it manually. Also, prevent Qt
from closing the handle for us.
Pick-to: 6.2 6.3
Fixes: QTBUG-101996
Change-Id: Ie54c04ad5aa1e7ee5444a04c30ac1323f73047bb
Reviewed-by: Assam Boudjelthia <[email protected]>
Diffstat (limited to 'src/plugins/platforms/android/androidcontentfileengine.h')
-rw-r--r-- | src/plugins/platforms/android/androidcontentfileengine.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/androidcontentfileengine.h b/src/plugins/platforms/android/androidcontentfileengine.h index 531d0f80ff0..47730f56850 100644 --- a/src/plugins/platforms/android/androidcontentfileengine.h +++ b/src/plugins/platforms/android/androidcontentfileengine.h @@ -41,12 +41,14 @@ #define ANDROIDCONTENTFILEENGINE_H #include <private/qfsfileengine_p.h> +#include <QtCore/qjniobject.h> class AndroidContentFileEngine : public QFSFileEngine { public: AndroidContentFileEngine(const QString &fileName); bool open(QIODevice::OpenMode openMode, std::optional<QFile::Permissions> permissions) override; + bool close() override; qint64 size() const override; FileFlags fileFlags(FileFlags type = FileInfoAll) const override; QString fileName(FileName file = DefaultName) const override; @@ -54,6 +56,7 @@ public: QAbstractFileEngine::Iterator *endEntryList() override; private: QString m_file; + QJniObject m_pfd; }; |