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

Commit b962f372 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add standby mode for aaudio service stream."

parents db752f0a f7f06151
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -49,6 +49,12 @@ enum {
};
typedef int32_t aaudio_policy_t;

// Internal error codes. Only used by the framework.
enum {
    AAUDIO_INTERNAL_ERROR_BASE = -1000,
    AAUDIO_ERROR_STANDBY,
};

/**
 * Control whether AAudioStreamBuilder_openStream() will use the new MMAP data path
 * or the older "Legacy" data path.
+12 −0
Original line number Diff line number Diff line
@@ -124,4 +124,16 @@ aaudio_result_t AAudioBinderAdapter::unregisterAudioThread(aaudio_handle_t strea
    return result;
}

aaudio_result_t AAudioBinderAdapter::exitStandby(aaudio_handle_t streamHandle,
                                                 AudioEndpointParcelable &endpointOut) {
    aaudio_result_t result;
    Endpoint endpoint;
    Status status = mDelegate->exitStandby(streamHandle, &endpoint, &result);
    if (!status.isOk()) {
        result = AAudioConvert_androidToAAudioResult(statusTFromBinderStatus(status));
    }
    endpointOut = std::move(endpoint);
    return result;
}

}  // namespace aaudio
+3 −0
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@ public:
    aaudio_result_t unregisterAudioThread(aaudio_handle_t streamHandle,
                                          pid_t clientThreadId) override;

    aaudio_result_t exitStandby(aaudio_handle_t streamHandle,
                                AudioEndpointParcelable &parcelable) override;

private:
    IAAudioService* const mDelegate;
};
+8 −0
Original line number Diff line number Diff line
@@ -201,3 +201,11 @@ aaudio_result_t AAudioBinderClient::unregisterAudioThread(aaudio_handle_t stream

    return service->unregisterAudioThread(streamHandle, clientThreadId);
}

aaudio_result_t AAudioBinderClient::exitStandby(aaudio_handle_t streamHandle,
                                                AudioEndpointParcelable &endpointOut) {
    std::shared_ptr<AAudioServiceInterface> service = getAAudioService();
    if (service.get() == nullptr) return AAUDIO_ERROR_NO_SERVICE;

    return service->exitStandby(streamHandle, endpointOut);
}
+3 −0
Original line number Diff line number Diff line
@@ -108,6 +108,9 @@ public:
        return AAUDIO_ERROR_UNAVAILABLE;
    }

    aaudio_result_t exitStandby(aaudio_handle_t streamHandle,
                                AudioEndpointParcelable &endpointOut) override;

    void onStreamChange(aaudio_handle_t /*handle*/, int32_t /*opcode*/, int32_t /*value*/) {
        // TODO This is just a stub so we can have a client Binder to pass to the service.
        // TODO Implemented in a later CL.
Loading