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/** 22*4d7e907cSAndroid Build Coastguard Worker * IClientManager manages IConnection(s) inside a process. A locally 23*4d7e907cSAndroid Build Coastguard Worker * created IConnection represents a communication node(receiver) with the 24*4d7e907cSAndroid Build Coastguard Worker * specified buffer pool(IAccessor). 25*4d7e907cSAndroid Build Coastguard Worker * IConnection(s) are not exposed to other processes(IClientManager). 26*4d7e907cSAndroid Build Coastguard Worker * IClientManager instance must be unique within a process. 27*4d7e907cSAndroid Build Coastguard Worker */ 28*4d7e907cSAndroid Build Coastguard Workerinterface IClientManager { 29*4d7e907cSAndroid Build Coastguard Worker 30*4d7e907cSAndroid Build Coastguard Worker /** 31*4d7e907cSAndroid Build Coastguard Worker * Sets up a buffer receiving communication node for the specified 32*4d7e907cSAndroid Build Coastguard Worker * buffer pool. A manager must create a IConnection to the buffer 33*4d7e907cSAndroid Build Coastguard Worker * pool if it does not already have a connection. 34*4d7e907cSAndroid Build Coastguard Worker * 35*4d7e907cSAndroid Build Coastguard Worker * @param bufferPool a buffer pool which is specified with the IAccessor. 36*4d7e907cSAndroid Build Coastguard Worker * The specified buffer pool is the owner of received buffers. 37*4d7e907cSAndroid Build Coastguard Worker * @return status The status of the call. 38*4d7e907cSAndroid Build Coastguard Worker * OK - A sender was set successfully. 39*4d7e907cSAndroid Build Coastguard Worker * NO_MEMORY - Memory allocation failure occurred. 40*4d7e907cSAndroid Build Coastguard Worker * ALREADY_EXISTS - A sender was registered already. 41*4d7e907cSAndroid Build Coastguard Worker * CRITICAL_ERROR - Other errors. 42*4d7e907cSAndroid Build Coastguard Worker * @return connectionId the Id of the communication node to the buffer pool. 43*4d7e907cSAndroid Build Coastguard Worker * This id is used in FMQ to notify IAccessor that a buffer has been 44*4d7e907cSAndroid Build Coastguard Worker * sent to that connection during transfers. 45*4d7e907cSAndroid Build Coastguard Worker */ 46*4d7e907cSAndroid Build Coastguard Worker registerSender(IAccessor bufferPool) generates 47*4d7e907cSAndroid Build Coastguard Worker (ResultStatus status, int64_t connectionId); 48*4d7e907cSAndroid Build Coastguard Worker}; 49