You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also should really check that for any off the "EXTERNAL" methods storage is mounted as per "EXTERNAL" method in Context Docs i.e.
Shared storage may not always be available, since removable media can be ejected by the user. Media state can be checked using Environment#getExternalStorageState(File).
Also Directory.kt uses getExternalStorageDirectory and
I've not found any direct usages, though it could probably be used in one of the optional config paths.
Expected behaviour
Not to provide methods that won't work correctly at various supported by the library API versions or be configured with the right permission and state tests for them to work correct.
I would suggest that "EXTERNAL_FILES", "EXTERNAL_CACHE" and "EXTERNAL_STORAGE" variants of getFile are removed as the simplest solution.
Version
Android: API 14 onwards
ACRA 5.9.5
The text was updated successfully, but these errors were encountered:
These fields are used for configuration. A user might want to e.g. add attachments from external storage, that is a valid use case. It is however the users responsibility to make sure permissions are available. I have added a note to the documentation.
Describe the bug
The EXTERNAL_FILES version of getFile method (https://github.com/ACRA/acra/blob/master/acra-core/src/main/java/org/acra/file/Directory.kt#L51 ) is redundant
OR
It will should generate a Null pointer exception as
getExternalFilesDir
will returnnull
if used when ACRA is running from the minimum supported API (14) to API 18 because as per docsThe NPE can be avoided by adding a suitable Manifest entry to the core library.
e.g. to https://github.com/ACRA/acra/blob/master/acra-core/src/main/AndroidManifest.xml add
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"/>
Also should really check that for any off the "EXTERNAL" methods storage is mounted as per "EXTERNAL" method in Context Docs
i.e.
Also Directory.kt uses
getExternalStorageDirectory
andI've not found any direct usages, though it could probably be used in one of the optional config paths.
Expected behaviour
Not to provide methods that won't work correctly at various supported by the library API versions or be configured with the right permission and state tests for them to work correct.
I would suggest that "EXTERNAL_FILES", "EXTERNAL_CACHE" and "EXTERNAL_STORAGE" variants of
getFile
are removed as the simplest solution.Version
The text was updated successfully, but these errors were encountered: