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

Commit 84469864 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk Committed by android-build-merger
Browse files

Merge "Use the new radio_metadata wrapper for safer memory management." am:...

Merge "Use the new radio_metadata wrapper for safer memory management." am: f41c781c am: 9ae457ec am: 5d8c9767
am: be706d62

Change-Id: Iba94e3e82dff749f37ec6643a19cd77875841e7a
parents 1784ec91 be706d62
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
*/

#define LOG_TAG "IRadio"
//#define LOG_NDEBUG 0
#include <utils/Log.h>
#include <utils/Errors.h>
#include <binder/IMemory.h>
@@ -23,7 +24,7 @@
#include <radio/IRadioService.h>
#include <radio/IRadioClient.h>
#include <system/radio.h>
#include <system/radio_metadata.h>
#include <system/RadioMetadataWrapper.h>

namespace android {

@@ -300,12 +301,9 @@ status_t BnRadio::onTransact(
        case GET_PROGRAM_INFORMATION: {
            CHECK_INTERFACE(IRadio, data, reply);
            struct radio_program_info info;
            RadioMetadataWrapper metadataWrapper(&info.metadata);

            status_t status = radio_metadata_allocate(&info.metadata, 0, 0);
            if (status != NO_ERROR) {
                return status;
            }
            status = getProgramInformation(&info);
            status_t status = getProgramInformation(&info);
            reply->writeInt32(status);
            if (status == NO_ERROR) {
                reply->write(&info, sizeof(struct radio_program_info));
@@ -317,7 +315,6 @@ status_t BnRadio::onTransact(
                    reply->writeUint32(0);
                }
            }
            radio_metadata_deallocate(info.metadata);
            return NO_ERROR;
        }
        case HAS_CONTROL: {