blob: fbb4fb0689340d9e5ae7d17f704acba73328f408 [file] [log] [blame]
#define LOG_TAG "RadioMetadataWrapper"
//#define LOG_NDEBUG 0
#include <system/RadioMetadataWrapper.h>
#include <log/log.h>
namespace android {
RadioMetadataWrapper::RadioMetadataWrapper(radio_metadata_t **metadata)
: mMetadata(metadata)
{
*mMetadata = nullptr;
auto status = radio_metadata_allocate(mMetadata, 0, 0);
if (status != 0) {
// *mMetadata remains NULL if allocation fails
ALOGE("Failed to allocate metadata buffer");
}
}
RadioMetadataWrapper::~RadioMetadataWrapper()
{
radio_metadata_deallocate(*mMetadata);
}
} // namespace android