- Fix user circumventing permissions: Permissions are now checked everytime the user taps the search icon, preventing the user from initiating search without required permissions.
- Added: Display rationale for the permission being requested
Comprehensive refactoring of DeviceListFragment, includes:
- Shifting all async-tasks to separate files
- Exceptions in the async-tasks are now handled by showing a toast and closing the LocalFileTransferActivity
- Added a new 'Error' status for file items
- If a file has error status after transfer, then an error icon is shown for it TransferProgressFragment
- Documentation and other additions/changes
MainActivity, AnimationUtils & tab_switcher.xml were using the "ic_close_white_24dp" (whose colouring was corrected in a previous commit of this branch from black to white, which caused the 'Close all tabs' button to appear completely white without any icons)
Code now uses ".../Kiwix/Notes/ZimFileName/ArticleUrl.txt" instead of ".../Notes/ZimFileTitle/ArticleTitle.txt" for storing notes
- Changed because multiple zim files can have the same ZimFileTitle, whereas ZimFileName is the actual name of the zim file (& hence unique).
- Chose ArticleUrl over ArticleTitle for greater stability (as article urls, being a core part of Kiwix, will always exist and hence are less likely to break the app)
Device name for WiFi Direct is supposed to be changed manually (from the advanced wifi settings) by the user.
This solution used reflection to access the hidden method used by the system to perform the same. However use of non-SDK interfaces (fields/methods accessed using reflection) will be restricted and subsequently lead to exceptions, hence the feature needs to be removed.
For more: developer.android.com/distribute/best-practices/develop/restrictions-non-sdk-interfaces
Best guess - Calling disconnect after sending the last file was somehow corrupting the output stream to the server. Replacing with Toast (or just finish()) has corrected it.