Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b9fb394 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

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
parent ac9f749c
Loading
Loading
Loading
Loading
+20 −1
Original line number Original line Diff line number Diff line
@@ -65,7 +65,8 @@ struct AAsset;
 *  Many functions will return this to indicate success
 *  Many functions will return this to indicate success
 *  ({@link ANDROID_IMAGE_DECODER_SUCCESS}) or the reason for the failure. On
 *  ({@link ANDROID_IMAGE_DECODER_SUCCESS}) or the reason for the failure. On
 *  failure, any out-parameters should be considered uninitialized, except where
 *  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 {
enum {
    /**
    /**
@@ -124,6 +125,24 @@ enum {
    ANDROID_IMAGE_DECODER_INVALID_STATE = -11,
    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;
struct AImageDecoder;


/**
/**