Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.10.1, 5.11.0, 5.11.1
-
None
-
Qt 5.11.1 android
Google Nexus 7 (android 6.0)
Description
The QStorageInfo dos not return correct info, bytesFree(), bytesTotal(), bytesAvailable() all returns 0.
This is the same issue as QTBUG-69173.
As I explained in QTBUG-69173, the main cause is QStorageInfo is using
_PATH_MOUNTED by include <paths.h>, but the value is defined differently in NDK r10e and more recent NDK.
in <NDK-r10e>/platforms/android-16/arch-arm/usr/include/paths.h (all other api levels has the same value)
#define _PATH_MOUNTED "/etc/mtab"
in <recent-NDK>/sysroot/usr/include/paths.h
#define _PATH_MOUNTED "/proc/mounts"
Since qt installer binary is built with NDK r10e, we are stuck with "/etc/mtab".
The problem is most android devices do not have "/etc/mtab", I have tested this with Google's Nexus 7, and it certainly does not have /etc/mtab.
QStorageInfo used to work normally, but suddenly failed with newer Qt release. The fix should be simple, just hardcode _PATH_MOUNTED to "/proc/mounts", something like:
#ifdef Q_OS_ANDROID
#undef _PATH_MOUNTED
#define_PATH_MOUNTED "/proc/mounts"
#endif
But since the developer keep resist making the changes, maybe it is time to move NDK to a more recent release?
Attachments
Issue Links
- duplicates
-
QTBUG-69173 QStorageInfo on android device
- Closed