Merge "TelephonyManager should use TelecomManager's getCallState()." into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cefc16df98
@@ -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.
|
* on the device has changed.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
@@ -2437,10 +2437,23 @@ public class TelephonyManager {
|
|||||||
public static final int CALL_STATE_OFFHOOK = 2;
|
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() {
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user