Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-115143

Unable to open files under certain conditions on Android.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.1
    • Core: I/O
    • None
    • Host:Linux x86_64
      Target:Android arm64_v8a
    • Android

    Description

      Premise:

      There are 4 test files.
      1."日本語.txt" (Japanese filename and known extention)
      2."日本語.xxx" (Japanese filename and unknown extention)
      3."english.txt" (English filename and known extention)
      4."english.xxx" (English filename and unknown extention)

      Place them in /storage/emulated/0/Documents .

      There are some ways to specify file.
      a. Choose file from "Documents" on Sidebar (a1.jpg) and open "Documents" folder (only .txt files are visible)(a2.jpg)
      b. Choose file from "(User)'s (Device Name)" on Sidebar(b1.jpg) and open "Documents" folder (all files are visible)(b2.jpg)

      Attached sample program shows Android native QFileDialog and when you choose one of file above "Application Output" in Qt Creator says "file open succeeded: true (or false)".

      Result is shown below.

        日本語.txt 日本語.xxx english.txt english.xxx
      from "Documents" success (not visible) success (not visible)
      from "(User)'s (Device Name)" fail fail success success

       

      When it fails Application Output is like this:

      D libAndroidFileTest_arm64-v8a.so: filename: "content://com.android.externalstorage.documents/document/primary%3ADocuments%2F日本語.txt"
      W libAndroidFileTest_arm64-v8a.so: java.lang.SecurityException: Permission Denial: reading com.android.externalstorage.ExternalStorageProvider uri content://com.android.externalstorage.documents/document/primary%3ADocuments%2F日本語.txt from pid=7907, uid=10573 requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs
      W libAndroidFileTest_arm64-v8a.so:     at android.os.Parcel.createExceptionOrNull(Parcel.java:3023)
      W libAndroidFileTest_arm64-v8a.so:     at android.os.Parcel.createException(Parcel.java:3007)
      W libAndroidFileTest_arm64-v8a.so:     at android.os.Parcel.readException(Parcel.java:2990)
      W libAndroidFileTest_arm64-v8a.so:     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
      W libAndroidFileTest_arm64-v8a.so:     at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:153)
      W libAndroidFileTest_arm64-v8a.so:     at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:780)
      W libAndroidFileTest_arm64-v8a.so:     at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:2034)
      W libAndroidFileTest_arm64-v8a.so:     at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1849)
      W libAndroidFileTest_arm64-v8a.so:     at android.content.ContentResolver.openFileDescriptor(ContentResolver.java:1682) 
      W libAndroidFileTest_arm64-v8a.so:     a
      D libAndroidFileTest_arm64-v8a.so: file open succeeded: false

      Attachments

        1. a1.jpg
          a1.jpg
          217 kB
        2. a2.jpg
          a2.jpg
          193 kB
        3. AndroidFileTest.tar.gz
          0.7 kB
        4. b1.jpg
          b1.jpg
          252 kB
        5. b2.jpg
          b2.jpg
          291 kB
        6. english.txt
          0.0 kB
        7. english.xxx
          0.0 kB
        8. 日本語.txt
          0.0 kB
        9. 日本語.xxx
          0.0 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              assam Assam Boudjelthia
              eighttails Tadahito Yao
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes