Move BluetoothPhoneService to telecom.
BluetoothPhoneService needs to be in telecom to be aware of all types of
calls. While in telephony, there's no way for it to know about
third-party sourced calls.
Additionally, conference calls for CDMA are no longer functional in the
telephony layer and needs to move to telecom to support BT commands on
CDMA calls.
Bug: 17475562
Change-Id: I443431291a3b0120d92b52dba2acca17a4c0c983
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 4b14fca..826afb4 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -299,6 +299,14 @@
return mTtyManager.getCurrentTtyMode();
}
+ void addListener(CallsManagerListener listener) {
+ mListeners.add(listener);
+ }
+
+ void removeListener(CallsManagerListener listener) {
+ mListeners.remove(listener);
+ }
+
/**
* Starts the process to attach the call to a connection service.
*
@@ -794,6 +802,22 @@
return true;
}
+ Call getRingingCall() {
+ return getFirstCallWithState(CallState.RINGING);
+ }
+
+ Call getActiveCall() {
+ return getFirstCallWithState(CallState.ACTIVE);
+ }
+
+ Call getDialingOrConnectingCall() {
+ return getFirstCallWithState(CallState.DIALING, CallState.CONNECTING);
+ }
+
+ Call getHeldCall() {
+ return getFirstCallWithState(CallState.ON_HOLD);
+ }
+
Call getFirstCallWithState(int... states) {
return getFirstCallWithState(null, states);
}