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

Commit 378ed204 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

ApexCodecs: rename _release() APIs to _destroy()

To be consistent with the native API guideline.

Bug: 380300185
Test: builds
Change-Id: I8d55930468669987315438cfb71f385c8a6f6cd6
parent 9d5e75bc
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -47,13 +47,13 @@ enum MethodIndex {
    k_ApexCodec_Configurable_querySupportedParams,
    k_ApexCodec_Configurable_querySupportedValues,
    k_ApexCodec_GetComponentStore,
    k_ApexCodec_ParamDescriptors_destroy,
    k_ApexCodec_ParamDescriptors_getDescriptor,
    k_ApexCodec_ParamDescriptors_getIndices,
    k_ApexCodec_ParamDescriptors_release,
    k_ApexCodec_SettingResults_destroy,
    k_ApexCodec_SettingResults_getResultAtIndex,
    k_ApexCodec_SettingResults_release,
    k_ApexCodec_SupportedValues_destroy,
    k_ApexCodec_SupportedValues_getTypeAndValues,
    k_ApexCodec_SupportedValues_release,
    k_ApexCodec_Traits_get,

    // Marker for count of methods
@@ -124,13 +124,13 @@ private:
        BIND_SYMBOL(ApexCodec_Configurable_querySupportedParams);
        BIND_SYMBOL(ApexCodec_Configurable_querySupportedValues);
        BIND_SYMBOL(ApexCodec_GetComponentStore);
        BIND_SYMBOL(ApexCodec_ParamDescriptors_destroy);
        BIND_SYMBOL(ApexCodec_ParamDescriptors_getDescriptor);
        BIND_SYMBOL(ApexCodec_ParamDescriptors_getIndices);
        BIND_SYMBOL(ApexCodec_ParamDescriptors_release);
        BIND_SYMBOL(ApexCodec_SettingResults_destroy);
        BIND_SYMBOL(ApexCodec_SettingResults_getResultAtIndex);
        BIND_SYMBOL(ApexCodec_SettingResults_release);
        BIND_SYMBOL(ApexCodec_SupportedValues_destroy);
        BIND_SYMBOL(ApexCodec_SupportedValues_getTypeAndValues);
        BIND_SYMBOL(ApexCodec_SupportedValues_release);
        BIND_SYMBOL(ApexCodec_Traits_get);
#undef BIND_SYMBOL

@@ -209,8 +209,8 @@ ApexCodec_Status ApexCodec_SupportedValues_getTypeAndValues(
                  supportedValues, type, numberType, values, numValues);
}

void ApexCodec_SupportedValues_release(ApexCodec_SupportedValues *values) {
    INVOKE_METHOD(ApexCodec_SupportedValues_release, void(), values);
void ApexCodec_SupportedValues_destroy(ApexCodec_SupportedValues *values) {
    INVOKE_METHOD(ApexCodec_SupportedValues_destroy, void(), values);
}

ApexCodec_Status ApexCodec_SettingResults_getResultAtIndex(
@@ -224,8 +224,8 @@ ApexCodec_Status ApexCodec_SettingResults_getResultAtIndex(
                  results, index, failure, field, conflicts, numConflicts);
}

void ApexCodec_SettingResults_release(ApexCodec_SettingResults *results) {
    INVOKE_METHOD(ApexCodec_SettingResults_release, void(), results);
void ApexCodec_SettingResults_destroy(ApexCodec_SettingResults *results) {
    INVOKE_METHOD(ApexCodec_SettingResults_destroy, void(), results);
}

ApexCodec_Status ApexCodec_Component_process(
@@ -274,9 +274,9 @@ ApexCodec_Status ApexCodec_ParamDescriptors_getDescriptor(
                  descriptors, index, attr, name, dependencies, numDependencies);
}

ApexCodec_Status ApexCodec_ParamDescriptors_release(
ApexCodec_Status ApexCodec_ParamDescriptors_destroy(
        ApexCodec_ParamDescriptors *descriptors) {
    INVOKE_METHOD(ApexCodec_ParamDescriptors_release, APEXCODEC_STATUS_OMITTED, descriptors);
    INVOKE_METHOD(ApexCodec_ParamDescriptors_destroy, APEXCODEC_STATUS_OMITTED, descriptors);
}

ApexCodec_Status ApexCodec_Configurable_querySupportedParams(
+3 −3
Original line number Diff line number Diff line
@@ -1066,7 +1066,7 @@ c2_status_t Codec2ConfigurableClient::ApexImpl::config(
                mBase, &config, &result);
        base::ScopeGuard guard([result] {
            if (result) {
                ApexCodec_SettingResults_release(result);
                ApexCodec_SettingResults_destroy(result);
            }
        });
        size_t index = 0;
@@ -1115,7 +1115,7 @@ c2_status_t Codec2ConfigurableClient::ApexImpl::querySupportedParams(
        ApexCodec_Configurable_querySupportedParams(mBase, &paramDescs);
        base::ScopeGuard guard([paramDescs] {
            if (paramDescs) {
                ApexCodec_ParamDescriptors_release(paramDescs);
                ApexCodec_ParamDescriptors_destroy(paramDescs);
            }
        });
        uint32_t *indices = nullptr;
@@ -1173,7 +1173,7 @@ c2_status_t Codec2ConfigurableClient::ApexImpl::querySupportedValues(
            fields[i].status = (c2_status_t)queries[i].status;
            FromApex(queries[i].values, &fields[i].values);
            if (queries[i].values) {
                ApexCodec_SupportedValues_release(queries[i].values);
                ApexCodec_SupportedValues_destroy(queries[i].values);
                queries[i].values = nullptr;
            }
        }
+3 −3
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ ApexCodec_Status ApexCodec_SupportedValues_getTypeAndValues(
    return APEXCODEC_STATUS_OMITTED;
}

void ApexCodec_SupportedValues_release(ApexCodec_SupportedValues *values) {}
void ApexCodec_SupportedValues_destroy(ApexCodec_SupportedValues *values) {}

ApexCodec_Status ApexCodec_SettingResults_getResultAtIndex(
        ApexCodec_SettingResults *results,
@@ -83,7 +83,7 @@ ApexCodec_Status ApexCodec_SettingResults_getResultAtIndex(
    return APEXCODEC_STATUS_OMITTED;
}

void ApexCodec_SettingResults_release(ApexCodec_SettingResults *results) {}
void ApexCodec_SettingResults_destroy(ApexCodec_SettingResults *results) {}

ApexCodec_Status ApexCodec_Component_process(
        ApexCodec_Component *comp,
@@ -127,7 +127,7 @@ ApexCodec_Status ApexCodec_ParamDescriptors_getDescriptor(
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_ParamDescriptors_release(
ApexCodec_Status ApexCodec_ParamDescriptors_destroy(
        ApexCodec_ParamDescriptors *descriptors) {
    return APEXCODEC_STATUS_OMITTED;
}
+9 −9
Original line number Diff line number Diff line
@@ -435,11 +435,11 @@ ApexCodec_Status ApexCodec_SupportedValues_getTypeAndValues(
        uint32_t *_Nonnull outNumValues) __INTRODUCED_IN(36);

/**
 * Release the supported values object. No-op if |values| is nullptr.
 * Destroy the supported values object. No-op if |values| is nullptr.
 *
 * \param values the supported values object
 */
void ApexCodec_SupportedValues_release(
void ApexCodec_SupportedValues_destroy(
        ApexCodec_SupportedValues *_Nullable values) __INTRODUCED_IN(36);

/**
@@ -537,11 +537,11 @@ ApexCodec_Status ApexCodec_SettingResults_getResultAtIndex(
        size_t *_Nonnull outNumConflicts) __INTRODUCED_IN(36);

/**
 * Release the setting result object. No-op if |results| is nullptr.
 * Destroy the setting result object. No-op if |results| is nullptr.
 *
 * \param result the setting result object
 */
void ApexCodec_SettingResults_release(
void ApexCodec_SettingResults_destroy(
        ApexCodec_SettingResults *_Nullable results) __INTRODUCED_IN(36);

/**
@@ -599,7 +599,7 @@ ApexCodec_Status ApexCodec_Component_process(
 * \param outResult     the result of the configuration.
 *                      the client should call ApexCodec_SettingResult_getResultAtIndex()
 *                      to extract the result. The result object is owned by the client and should
 *                      be released with ApexCodec_SettingResult_release().
 *                      be released with ApexCodec_SettingResult_destroy().
 *                      |result| may be nullptr if empty.
 * \return APEXCODEC_STATUS_OK         if successful
 * \return APEXCODEC_STATUS_BAD_VALUE  if the config is invalid
@@ -710,11 +710,11 @@ ApexCodec_Status ApexCodec_ParamDescriptors_getDescriptor(
        size_t *_Nonnull outNumDependencies) __INTRODUCED_IN(36);

/**
 * Release the param descriptors object.
 * Destroy the param descriptors object.
 *
 * \param descriptors the param descriptors object
 */
ApexCodec_Status ApexCodec_ParamDescriptors_release(
ApexCodec_Status ApexCodec_ParamDescriptors_destroy(
        ApexCodec_ParamDescriptors *_Nullable descriptors) __INTRODUCED_IN(36);

/**
@@ -722,7 +722,7 @@ ApexCodec_Status ApexCodec_ParamDescriptors_release(
 *
 * \param comp              the handle for the component
 * \param outDescriptors    the pointer to be filled with the param descriptors object
 *                          the object should be released with ApexCodec_ParamDescriptors_release().
 *                          the object should be released with ApexCodec_ParamDescriptors_destroy().
 * \return APEXCODEC_STATUS_OK          if successful
 * \return APEXCODEC_STATUS_BAD_VALUE   if parameters are bad. e.g. |descriptors| is nullptr.
 */
@@ -752,7 +752,7 @@ typedef struct ApexCodec_SupportedValuesQuery {
    /** status of the query */
    ApexCodec_Status status;

    /** supported values. must be released with ApexCodec_SupportedValues_release(). */
    /** supported values. must be released with ApexCodec_SupportedValues_destroy(). */
    ApexCodec_SupportedValues *_Nullable values;
} ApexCodec_SupportedValuesQuery;

+3 −3
Original line number Diff line number Diff line
@@ -12,13 +12,13 @@ LIBAPEXCODECS_36 { # introduced=36
    ApexCodec_Configurable_querySupportedParams; # apex
    ApexCodec_Configurable_querySupportedValues; # apex
    ApexCodec_GetComponentStore; # apex
    ApexCodec_ParamDescriptors_destroy; # apex
    ApexCodec_ParamDescriptors_getDescriptor; # apex
    ApexCodec_ParamDescriptors_getIndices; # apex
    ApexCodec_ParamDescriptors_release; # apex
    ApexCodec_SettingResults_destroy; # apex
    ApexCodec_SettingResults_getResultAtIndex; # apex
    ApexCodec_SettingResults_release; # apex
    ApexCodec_SupportedValues_destroy; # apex
    ApexCodec_SupportedValues_getTypeAndValues; # apex
    ApexCodec_SupportedValues_release; # apex
    ApexCodec_Traits_get; # apex

  local: