From 2f8d48f5e981ab9945c907cd9ab0f6bd6a82db22 Mon Sep 17 00:00:00 2001 From: yueg Date: Mon, 16 Oct 2017 14:23:26 -0700 Subject: Add GSM conference calling to simulator. This CL adds a new item to the simulator menu: - Add GSM conference The GSM conference action creates a conference with 5 phone calls. Users can individually separate or kick calls out of the conference. Hanging up the second last call finishes the conference. Bug: 67785540 Test: SimulatorConferenceTest PiperOrigin-RevId: 172377631 Change-Id: Ic30fa6c65cf782247f75bcdd1ecbd86b1c16f143 --- .../simulator/impl/SimulatorConnectionService.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'java/com/android/dialer/simulator/impl/SimulatorConnectionService.java') diff --git a/java/com/android/dialer/simulator/impl/SimulatorConnectionService.java b/java/com/android/dialer/simulator/impl/SimulatorConnectionService.java index 25d4a7240..465890cf0 100644 --- a/java/com/android/dialer/simulator/impl/SimulatorConnectionService.java +++ b/java/com/android/dialer/simulator/impl/SimulatorConnectionService.java @@ -109,6 +109,19 @@ public class SimulatorConnectionService extends ConnectionService { return connection; } + @Override + public void onConference(Connection connection1, Connection connection2) { + LogUtil.i( + "SimulatorConnectionService.onConference", + "connection1: " + + SimulatorSimCallManager.getConnectionTag(connection1) + + ", connection2: " + + SimulatorSimCallManager.getConnectionTag(connection2)); + for (Listener listener : listeners) { + listener.onConference((SimulatorConnection) connection1, (SimulatorConnection) connection2); + } + } + private static Uri getPhoneNumber(ConnectionRequest request) { String phoneNumber = request.getExtras().getString(TelephonyManager.EXTRA_INCOMING_NUMBER); return Uri.fromParts(PhoneAccount.SCHEME_TEL, phoneNumber, null); @@ -116,8 +129,11 @@ public class SimulatorConnectionService extends ConnectionService { /** Callback used to notify listeners when a new connection has been added. */ public interface Listener { - void onNewOutgoingConnection(SimulatorConnection connection); + void onNewOutgoingConnection(@NonNull SimulatorConnection connection); + + void onNewIncomingConnection(@NonNull SimulatorConnection connection); - void onNewIncomingConnection(SimulatorConnection connection); + void onConference( + @NonNull SimulatorConnection connection1, @NonNull SimulatorConnection connection2); } } -- cgit v1.2.3