From 32cabd8d8567277d65cb1df6b3a6642152eb965e Mon Sep 17 00:00:00 2001 From: weijiaxu Date: Tue, 27 Feb 2018 18:45:04 -0800 Subject: set connection state after adding NonSimulatorConnectionListener and set connection to active at the end. This is necessary to make sure that NonSimulatorConnectionListener gets event callback when Connection.setDialing() or Connection.setActive() is called. Test: On a local device. PiperOrigin-RevId: 187266120 Change-Id: I6ee5d5113285e7a27a4e8497a95b28844ac6b397 --- .../com/android/dialer/simulator/impl/SimulatorConnectionService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/com/android/dialer/simulator/impl/SimulatorConnectionService.java b/java/com/android/dialer/simulator/impl/SimulatorConnectionService.java index 19104be24..8430e24b7 100644 --- a/java/com/android/dialer/simulator/impl/SimulatorConnectionService.java +++ b/java/com/android/dialer/simulator/impl/SimulatorConnectionService.java @@ -84,7 +84,6 @@ public class SimulatorConnectionService extends ConnectionService { return null; } SimulatorConnection connection = new SimulatorConnection(this, request); - connection.setDialing(); if (SimulatorSimCallManager.isSimulatorConnectionRequest(request)) { simulatorConnectionsBank.add(connection); connection.setAddress( @@ -92,6 +91,7 @@ public class SimulatorConnectionService extends ConnectionService { request .getExtras() .getInt(Simulator.PRESENTATION_CHOICE, TelecomManager.PRESENTATION_ALLOWED)); + connection.setDialing(); ThreadUtil.postOnUiThread( () -> SimulatorComponent.get(instance) @@ -107,6 +107,8 @@ public class SimulatorConnectionService extends ConnectionService { connection.putExtras(extras); simulatorConnectionsBank.add(connection); connection.addListener(new NonSimulatorConnectionListener()); + connection.setDialing(); + ThreadUtil.postOnUiThread(connection::setActive); } return connection; } -- cgit v1.2.3