Write restriction on Android 10 and later
See the article https://developer.android.com/training/data-storage/use-cases for more detailed and up-to-date information on the issue.
Starting with API 29, it is no longer possible to use the WRITE_EXTERNAL_STORAGE permission to write data to the /sdcard directory. In this Section we present some suggestions to overcome this limitation. However, before applying one of these workarounds, we recommend that application developers inform themselves about the issue to make the most appropriate decision (see the article indicated in the warning box above).
Disable scoped storage. If the application does not use resources from APIs > 29, there are two possibilities to disable this new restriction and maintain the behavior of APIs < 29. By choosing one of the two options below, the application will not need any other adjustment to record the traces in / sdcard.
The. Reduce the project's targetSdkVersion to 28. B. Keep the project's targetSdkVersion at 29 and set equestLegacyExternalStorage to true in AndroidManifest.xml.
Set DirectoryTrace to an internal path. If it is not possible to reduce the targetSdkVersion, the application can define the parameter
“DiretorioTrace=./files”,
in CLSIT, which determines that the recording of the trace occurs in a directory for which the application does not need to request permission. The disadvantage of this solution is that access to this directory can only be done by the application itself or by development tools. Then the application will need to implement a way to extract the files. Two suggestions follow.The. Activate the Rotary Trace functionality in CLSIT. This functionality, in addition to limiting the size and rotating trace files, also allows them to be sent to the SiTef server. This way, Support or Operations teams can recover the files. This sending must be initiated by the application through the Administrative menu with operator interaction (Function 1) or directly by Function 121, initiated by the operator or automatically by the application. See the document “SiTef - Simplified Interface with the application.pdf” for more details. It is important to note that this functionality makes analysis difficult in case of network errors, as the network will be required to send the files.
B. Use the Storage Access Framework (SAF) to ask the user for write access to /sdcard (PrimaryStorageVolume). This way, you can write data to this directory using DocumentFile instances. The application must then define a criterion to transfer the trace files (CliSiTef.dmp*) from the chosen internal path to /sdcard.