1 /*
2  * Copyright (C) 2017 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 
17 package com.android.dialer.simulator;
18 
19 import android.content.Context;
20 import android.support.annotation.NonNull;
21 import android.telecom.Connection;
22 import com.android.dialer.simulator.Simulator.ConferenceType;
23 import java.util.List;
24 
25 /**
26  * Used to create a shared connections bank which contains methods to manipulate connections. This
27  * is used mainly for conference calling.
28  */
29 public interface SimulatorConnectionsBank {
30 
31   /** Add a connection into bank. */
add(Connection connection)32   void add(Connection connection);
33 
34   /** Remove a connection from bank. */
remove(Connection connection)35   void remove(Connection connection);
36 
37   /** Merge all existing connections created by simulator into a conference. */
mergeAllConnections(@onferenceType int conferenceType, Context context)38   void mergeAllConnections(@ConferenceType int conferenceType, Context context);
39 
40   /** Set all connections created by simulator to disconnected. */
disconnectAllConnections()41   void disconnectAllConnections();
42 
43   /**
44    * Update conferenceable connections for all connections in bank (usually after adding a new
45    * connection). Before calling this method, make sure all connections are returned by
46    * ConnectionService.
47    */
updateConferenceableConnections()48   void updateConferenceableConnections();
49 
50   /** Determine whether a connection is created by simulator. */
isSimulatorConnection(@onNull Connection connection)51   boolean isSimulatorConnection(@NonNull Connection connection);
52 
53   /** Get all connections tags from bank. */
getConnectionTags()54   List<String> getConnectionTags();
55 }
56