resolved conflicts for merge of f3804c3c to lmp-sprout-dev

Conflicts:
	telephony/java/android/telephony/TelephonyManager.java

Change-Id: Ibdd0b6c2c9901ec46196ac9460a0908dfb739ad4
This commit is contained in:
Yorke Lee
2014-09-14 13:58:43 -07:00
3 changed files with 36 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ import android.content.Context;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.telephony.TelephonyManager;
import android.util.Log;
import com.android.internal.telecom.ITelecomService;
@@ -661,11 +662,35 @@ public class TelecomManager {
return getTelecomService().isInCall();
}
} catch (RemoteException e) {
Log.e(TAG, "RemoteException attempting to get default phone app.", e);
Log.e(TAG, "RemoteException calling isInCall().", e);
}
return false;
}
/**
* Returns one of the following constants that represents the current state of Telecom:
*
* {@link TelephonyManager#CALL_STATE_RINGING}
* {@link TelephonyManager#CALL_STATE_OFFHOOK}
* {@link TelephonyManager#CALL_STATE_IDLE}
*
* <p>
* Requires permission: {@link android.Manifest.permission#READ_PHONE_STATE}
* </p>
* @hide
*/
@SystemApi
public int getCallState() {
try {
if (isServiceConnected()) {
return getTelecomService().getCallState();
}
} catch (RemoteException e) {
Log.d(TAG, "RemoteException calling getCallState().", e);
}
return TelephonyManager.CALL_STATE_IDLE;
}
/**
* Returns whether there currently exists is a ringing incoming-call.
*

View File

@@ -138,6 +138,11 @@ interface ITelecomService {
*/
boolean isRinging();
/**
* @see TelecomServiceImpl#getCallState
*/
int getCallState();
/**
* @see TelecomServiceImpl#endCall
*/

View File

@@ -2071,7 +2071,11 @@ public class TelephonyManager {
* Returns a constant indicating the call state (cellular) on the device.
*/
public int getCallState() {
return getCallState(getDefaultSubscription());
try {
return getTelecomService().getCallState();
} catch (RemoteException | NullPointerException e) {
return CALL_STATE_IDLE;
}
}
/**