diff options
| author | 2020-12-03 16:55:36 -0500 | |
|---|---|---|
| committer | 2021-01-08 09:40:38 -0500 | |
| commit | 9b9fb394e3f40b90fff0c24bfbf225da91c8b8c8 (patch) | |
| tree | dc1cd127fb724a9ffaec19f59b0cce55d503f08f /include/android/imagedecoder.h | |
| parent | ac9f749cfe3087d9624bdfc31065dfc219a9e6b4 (diff) | |
Add AImageDecoder_resultToString
Bug: 160984428
Test: I118eaa99cd65b70dbfb2c8a7731c714564911a34
This allows clients to print a readable string when there is an error
(e.g. "ANDROID_IMAGE_DECODER_BAD_PARAMETER" instead of "-5").
Change-Id: I24400979e1ce12d5c8b48bba456b07fdfda49662
Diffstat (limited to 'include/android/imagedecoder.h')
| -rw-r--r-- | include/android/imagedecoder.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/android/imagedecoder.h b/include/android/imagedecoder.h index 27be9c84b1..c439e5142a 100644 --- a/include/android/imagedecoder.h +++ b/include/android/imagedecoder.h @@ -65,7 +65,8 @@ struct AAsset; * Many functions will return this to indicate success * ({@link ANDROID_IMAGE_DECODER_SUCCESS}) or the reason for the failure. On * failure, any out-parameters should be considered uninitialized, except where - * specified. + * specified. Use {@link AImageDecoder_resultToString} for a readable + * version of the result code. */ enum { /** @@ -124,6 +125,24 @@ enum { ANDROID_IMAGE_DECODER_INVALID_STATE = -11, }; +#if __ANDROID_API__ >= 31 + +/** + * Return a constant string value representing the error code. + * + * Introduced in API 31. + * + * Pass the return value from an {@link AImageDecoder} method (e.g. + * {@link AImageDecoder_decodeImage}) for a text string representing the error + * code. + * + * Errors: + * - Returns null for a value out of range. + */ +const char* _Nullable AImageDecoder_resultToString(int)__INTRODUCED_IN(31); + +#endif // __ANDROID_API__ >= 31 + struct AImageDecoder; /** |