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

Commit 014620f1 authored by Eric Laurent's avatar Eric Laurent
Browse files

SoundTrigger: fix binder call status reporting.

Bug: 24677430.
Change-Id: Ife9b10e2d1acdb51099b21551e8c191fff7f75b4
parent 4802c0c5
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -60,11 +60,13 @@ public:
        data.writeInterfaceToken(ISoundTrigger::getInterfaceDescriptor());
        data.writeStrongBinder(IInterface::asBinder(modelMemory));
        status_t status = remote()->transact(LOAD_SOUND_MODEL, data, &reply);
        if (status != NO_ERROR ||
                (status = (status_t)reply.readInt32()) != NO_ERROR) {
        if (status != NO_ERROR) {
            return status;
        }
        status = (status_t)reply.readInt32();
        if (status == NO_ERROR) {
            reply.read(handle, sizeof(sound_model_handle_t));
        }
        return status;
    }

@@ -74,7 +76,7 @@ public:
        data.writeInterfaceToken(ISoundTrigger::getInterfaceDescriptor());
        data.write(&handle, sizeof(sound_model_handle_t));
        status_t status = remote()->transact(UNLOAD_SOUND_MODEL, data, &reply);
        if (status != NO_ERROR) {
        if (status == NO_ERROR) {
            status = (status_t)reply.readInt32();
        }
        return status;
@@ -93,7 +95,7 @@ public:
        }
        data.writeStrongBinder(IInterface::asBinder(dataMemory));
        status_t status = remote()->transact(START_RECOGNITION, data, &reply);
        if (status != NO_ERROR) {
        if (status == NO_ERROR) {
            status = (status_t)reply.readInt32();
        }
        return status;
@@ -105,7 +107,7 @@ public:
        data.writeInterfaceToken(ISoundTrigger::getInterfaceDescriptor());
        data.write(&handle, sizeof(sound_model_handle_t));
        status_t status = remote()->transact(STOP_RECOGNITION, data, &reply);
        if (status != NO_ERROR) {
        if (status == NO_ERROR) {
            status = (status_t)reply.readInt32();
        }
        return status;
+5 −2
Original line number Diff line number Diff line
@@ -85,8 +85,11 @@ public:
        data.writeInterfaceToken(ISoundTriggerHwService::getInterfaceDescriptor());
        data.write(&handle, sizeof(sound_trigger_module_handle_t));
        data.writeStrongBinder(IInterface::asBinder(client));
        remote()->transact(ATTACH, data, &reply);
        status_t status = reply.readInt32();
        status_t status = remote()->transact(ATTACH, data, &reply);
        if (status != NO_ERROR) {
            return status;
        }
        status = reply.readInt32();
        if (reply.readInt32() != 0) {
            module = interface_cast<ISoundTrigger>(reply.readStrongBinder());
        }