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
17package com.android.dialer.simulator;
18
19import android.content.Context;
20import android.support.annotation.NonNull;
21import android.telecom.Connection;
22import com.android.dialer.simulator.Simulator.ConferenceType;
23import 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 */
29public interface SimulatorConnectionsBank {
30
31  /** Add a connection into bank. */
32  void add(Connection connection);
33
34  /** Remove a connection from bank. */
35  void remove(Connection connection);
36
37  /** Merge all existing connections created by simulator into a conference. */
38  void mergeAllConnections(@ConferenceType int conferenceType, Context context);
39
40  /** Set all connections created by simulator to disconnected. */
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   */
48  void updateConferenceableConnections();
49
50  /** Determine whether a connection is created by simulator. */
51  boolean isSimulatorConnection(@NonNull Connection connection);
52
53  /** Get all connections tags from bank. */
54  List<String> getConnectionTags();
55}
56