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