summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Santos Cordon <santoscordon@google.com> 2015-06-10 18:42:56 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2015-06-10 18:42:58 +0000
commitcefc16df98a985b8a7c40bca5d5ff3fde6b42dbf (patch)
tree01e47f8f571eb5f7a0925d6468c818c949f160d4
parentc783a5e762b0c4925756b8ca273eb26aab5e7985 (diff)
parent8c332b727523ce0dbb9256f0f43a9c655d71a3ea (diff)
Merge "TelephonyManager should use TelecomManager's getCallState()." into mnc-dev
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 12f164441ace..393888dd1227 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -193,7 +193,7 @@ public class TelephonyManager {
//
/**
- * Broadcast intent action indicating that the call state (cellular)
+ * Broadcast intent action indicating that the call state
* on the device has changed.
*
* <p>
@@ -2437,10 +2437,23 @@ public class TelephonyManager {
public static final int CALL_STATE_OFFHOOK = 2;
/**
- * Returns a constant indicating the call state (cellular) on the device.
+ * Returns one of the following constants that represents the current state of all
+ * phone calls.
+ *
+ * {@link TelephonyManager#CALL_STATE_RINGING}
+ * {@link TelephonyManager#CALL_STATE_OFFHOOK}
+ * {@link TelephonyManager#CALL_STATE_IDLE}
*/
public int getCallState() {
- return getCallState(getDefaultSubscription());
+ try {
+ ITelecomService telecom = getTelecomService();
+ if (telecom != null) {
+ return telecom.getCallState();
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelecomService#getCallState", e);
+ }
+ return CALL_STATE_IDLE;
}
/**