Closed MohitMaliFtechiz closed 1 month ago
Attention: Patch coverage is 62.16216%
with 14 lines
in your changes missing coverage. Please review.
Project coverage is 58.13%. Comparing base (
a959978
) to head (05eecc2
). Report is 18 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@MohitMaliFtechiz It works! But why my tablet behaves differently than other android 14?
@MohitMaliFtechiz It works! But why my tablet behave differently than other Android 14?
@kelson42 Tablet Uris are different than normal phones. I have checked with another real tablet and found the same issue there. These download URIs are different in tablets to make them compatible with scoped storage.
In tablets:
For example, if I open a zim file directly from the opera browser then it returns the URI like this: content://com.opera.browser.DownloadProvider/downloads/beer.stackexchange.com_en_all_2023-05.zim?hash=w4A3vMuc7l1FPQwk23rmbgvfPGJfhcj5FujW37NApdA%3D&mt=application%2Foctet-stream
which opera gives with its own file provider.
When I directly open the downloaded zim file from the file manager it gives us this URI: content://com.android.providers.downloads.documents/document/msf%3A1000000057
.
In phones:
Chrome Uri: content://media/external/downloads/2825
File Manager Uri: content://com.android.providers.downloads.documents/100059
.
@MohitMaliFtechiz Please test this then for both tablet and phone within the CI. This very super basic should 100% work.
3 scenarios:
In mean obviously: testing in CI
Fixes #3941 Fixes #3997
getZimFileFromUri()
method to perform the renaming for the move functionality. However, on Android 14 tablets, the URI was not resolved correctly by this method, leading to a "ZIM file not found" error(This is a separate issue https://github.com/kiwix/kiwix-android/issues/4008).getZimFileFromUri()
method in the Play Store variant, as future Android versions may handle URIs differently. We refactored our code so that thecopy/move
functionality works independently of this method and now works directly with Android's provided URI.Reference APK
https://drive.google.com/file/d/16uwwoKWdF00rwhvAvR5musunKse4bBwD/view?usp=sharinghttps://drive.google.com/file/d/16uwwoKWdF00rwhvAvR5musunKse4bBwD/view?usp=sharing you can try this APK and confirms the behaviours of this functionality.