1/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.media.bufferpool@1.0;
18
19import IAccessor;
20/**
21 * IClientManager manages IConnection(s) inside a process. A locally
22 * created IConnection represents a communication node(receiver) with the
23 * specified buffer pool(IAccessor).
24 * IConnection(s) are not exposed to other processes(IClientManager).
25 * IClientManager instance must be unique within a process.
26 */
27interface IClientManager {
28
29    /**
30     * Sets up a buffer receiving communication node for the specified
31     * buffer pool. A manager must create a IConnection to the buffer
32     * pool if it does not already have a connection.
33     *
34     * @param bufferPool a buffer pool which is specified with the IAccessor.
35     *     The specified buffer pool is the owner of received buffers.
36     * @return status The status of the call.
37     *     OK               - A sender was set successfully.
38     *     NO_MEMORY        - Memory allocation failure occurred.
39     *     ALREADY_EXISTS   - A sender was registered already.
40     *     CRITICAL_ERROR   - Other errors.
41     * @return connectionId the Id of the communication node to the buffer pool.
42     *     This id is used in FMQ to notify IAccessor that a buffer has been
43     *     sent to that connection during transfers.
44     */
45    registerSender(IAccessor bufferPool) generates
46        (ResultStatus status, int64_t connectionId);
47};
48