Loading src/java/com/android/internal/telephony/Connection.java +27 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ public abstract class Connection { public void onRttInitiated(); public void onRttTerminated(); public void onOriginalConnectionReplaced(Connection newConnection); public void onIsNetworkEmergencyCallChanged(boolean isEmergencyCall); } /** Loading Loading @@ -156,6 +157,8 @@ public abstract class Connection { public void onRttTerminated() {} @Override public void onOriginalConnectionReplaced(Connection newConnection) {} @Override public void onIsNetworkEmergencyCallChanged(boolean isEmergencyCall) {} } public static final int AUDIO_QUALITY_STANDARD = 1; Loading Loading @@ -224,6 +227,11 @@ public abstract class Connection { private boolean mAnsweringDisconnectsActiveCall; private boolean mAllowAddCallDuringVideoCall; /** * When {@code true}, the network has indicated that this is an emergency call. */ private boolean mIsNetworkIdentifiedEmergencyCall; /** * Used to indicate that this originated from pulling a {@link android.telecom.Connection} with * {@link android.telecom.Connection#PROPERTY_IS_EXTERNAL_CALL}. Loading Loading @@ -1139,6 +1147,25 @@ public abstract class Connection { } } /** * Sets whether this {@link Connection} has been identified by the network as an emergency call. * @param isNetworkIdentifiedEmergencyCall {@code true} if ecall, {@code false} otherwise. */ public void setIsNetworkIdentifiedEmergencyCall(boolean isNetworkIdentifiedEmergencyCall) { mIsNetworkIdentifiedEmergencyCall = isNetworkIdentifiedEmergencyCall; for (Listener l : mListeners) { l.onIsNetworkEmergencyCallChanged(isNetworkIdentifiedEmergencyCall); } } /** * @return Whether this {@link Connection} has been identified by the network as an emergency * call. */ public boolean isNetworkIdentifiedEmergencyCall() { return mIsNetworkIdentifiedEmergencyCall; } /** * Build a human representation of a connection instance, suitable for debugging. * Don't log personal stuff unless in debug mode. Loading src/java/com/android/internal/telephony/TelephonyTester.java +39 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.IntentFilter; import android.net.Uri; import android.os.BadParcelableException; import android.os.Build; import android.os.Bundle; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.ims.ImsCallProfile; Loading Loading @@ -104,6 +105,12 @@ public class TelephonyTester { private static final String EXTRA_CODE = "code"; private static final String EXTRA_TYPE = "type"; /** * Test-only intent used to trigger signalling that an IMS call is an emergency call. */ private static final String ACTION_TEST_IMS_E_CALL = "com.android.internal.telephony.TestImsECall"; private static final String ACTION_TEST_SERVICE_STATE = "com.android.internal.telephony.TestServiceState"; Loading Loading @@ -161,6 +168,9 @@ public class TelephonyTester { mServiceStateTestIntent = intent; mPhone.getServiceStateTracker().sendEmptyMessage( ServiceStateTracker.EVENT_NETWORK_STATE_CHANGED); } else if (action.equals(ACTION_TEST_IMS_E_CALL)) { log("handle test IMS ecall intent"); testImsECall(); } else { if (DBG) log("onReceive: unknown action=" + action); } Loading Loading @@ -189,6 +199,7 @@ public class TelephonyTester { filter.addAction(ACTION_TEST_SUPP_SRVC_FAIL); filter.addAction(ACTION_TEST_HANDOVER_FAIL); filter.addAction(ACTION_TEST_SUPP_SRVC_NOTIFICATION); filter.addAction(ACTION_TEST_IMS_E_CALL); mImsExternalCallStates = new ArrayList<ImsExternalCallState>(); } else { filter.addAction(ACTION_TEST_SERVICE_STATE); Loading Loading @@ -375,4 +386,32 @@ public class TelephonyTester { log("Override operator with " + operator); } } void testImsECall() { // Attempt to get the active IMS call before parsing the test XML file. ImsPhone imsPhone = (ImsPhone) mPhone; if (imsPhone == null) { return; } ImsPhoneCall imsPhoneCall = imsPhone.getForegroundCall(); if (imsPhoneCall == null) { return; } ImsCall imsCall = imsPhoneCall.getImsCall(); if (imsCall == null) { return; } ImsCallProfile callProfile = imsCall.getCallProfile(); Bundle extras = callProfile.getCallExtras(); if (extras == null) { extras = new Bundle(); } extras.putBoolean(ImsCallProfile.EXTRA_E_CALL, true); callProfile.mCallExtras = extras; imsCall.getImsCallSessionListenerProxy().callSessionUpdated(imsCall.getSession(), callProfile); } } No newline at end of file src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +7 −1 Original line number Diff line number Diff line Loading @@ -1092,6 +1092,12 @@ public class ImsPhoneConnection extends Connection implements } } private void updateEmergencyCallFromExtras(Bundle extras) { if (extras.getBoolean(ImsCallProfile.EXTRA_E_CALL)) { setIsNetworkIdentifiedEmergencyCall(true); } } /** * Check for a change in call extras of {@link ImsCall}, and * update the {@link ImsPhoneConnection} accordingly. Loading @@ -1113,7 +1119,7 @@ public class ImsPhoneConnection extends Connection implements final boolean changed = !areBundlesEqual(extras, mExtras); if (changed) { updateImsCallRatFromExtras(extras); updateEmergencyCallFromExtras(extras); mExtras.clear(); mExtras.putAll(extras); setConnectionExtras(mExtras); Loading Loading
src/java/com/android/internal/telephony/Connection.java +27 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ public abstract class Connection { public void onRttInitiated(); public void onRttTerminated(); public void onOriginalConnectionReplaced(Connection newConnection); public void onIsNetworkEmergencyCallChanged(boolean isEmergencyCall); } /** Loading Loading @@ -156,6 +157,8 @@ public abstract class Connection { public void onRttTerminated() {} @Override public void onOriginalConnectionReplaced(Connection newConnection) {} @Override public void onIsNetworkEmergencyCallChanged(boolean isEmergencyCall) {} } public static final int AUDIO_QUALITY_STANDARD = 1; Loading Loading @@ -224,6 +227,11 @@ public abstract class Connection { private boolean mAnsweringDisconnectsActiveCall; private boolean mAllowAddCallDuringVideoCall; /** * When {@code true}, the network has indicated that this is an emergency call. */ private boolean mIsNetworkIdentifiedEmergencyCall; /** * Used to indicate that this originated from pulling a {@link android.telecom.Connection} with * {@link android.telecom.Connection#PROPERTY_IS_EXTERNAL_CALL}. Loading Loading @@ -1139,6 +1147,25 @@ public abstract class Connection { } } /** * Sets whether this {@link Connection} has been identified by the network as an emergency call. * @param isNetworkIdentifiedEmergencyCall {@code true} if ecall, {@code false} otherwise. */ public void setIsNetworkIdentifiedEmergencyCall(boolean isNetworkIdentifiedEmergencyCall) { mIsNetworkIdentifiedEmergencyCall = isNetworkIdentifiedEmergencyCall; for (Listener l : mListeners) { l.onIsNetworkEmergencyCallChanged(isNetworkIdentifiedEmergencyCall); } } /** * @return Whether this {@link Connection} has been identified by the network as an emergency * call. */ public boolean isNetworkIdentifiedEmergencyCall() { return mIsNetworkIdentifiedEmergencyCall; } /** * Build a human representation of a connection instance, suitable for debugging. * Don't log personal stuff unless in debug mode. Loading
src/java/com/android/internal/telephony/TelephonyTester.java +39 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.IntentFilter; import android.net.Uri; import android.os.BadParcelableException; import android.os.Build; import android.os.Bundle; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.ims.ImsCallProfile; Loading Loading @@ -104,6 +105,12 @@ public class TelephonyTester { private static final String EXTRA_CODE = "code"; private static final String EXTRA_TYPE = "type"; /** * Test-only intent used to trigger signalling that an IMS call is an emergency call. */ private static final String ACTION_TEST_IMS_E_CALL = "com.android.internal.telephony.TestImsECall"; private static final String ACTION_TEST_SERVICE_STATE = "com.android.internal.telephony.TestServiceState"; Loading Loading @@ -161,6 +168,9 @@ public class TelephonyTester { mServiceStateTestIntent = intent; mPhone.getServiceStateTracker().sendEmptyMessage( ServiceStateTracker.EVENT_NETWORK_STATE_CHANGED); } else if (action.equals(ACTION_TEST_IMS_E_CALL)) { log("handle test IMS ecall intent"); testImsECall(); } else { if (DBG) log("onReceive: unknown action=" + action); } Loading Loading @@ -189,6 +199,7 @@ public class TelephonyTester { filter.addAction(ACTION_TEST_SUPP_SRVC_FAIL); filter.addAction(ACTION_TEST_HANDOVER_FAIL); filter.addAction(ACTION_TEST_SUPP_SRVC_NOTIFICATION); filter.addAction(ACTION_TEST_IMS_E_CALL); mImsExternalCallStates = new ArrayList<ImsExternalCallState>(); } else { filter.addAction(ACTION_TEST_SERVICE_STATE); Loading Loading @@ -375,4 +386,32 @@ public class TelephonyTester { log("Override operator with " + operator); } } void testImsECall() { // Attempt to get the active IMS call before parsing the test XML file. ImsPhone imsPhone = (ImsPhone) mPhone; if (imsPhone == null) { return; } ImsPhoneCall imsPhoneCall = imsPhone.getForegroundCall(); if (imsPhoneCall == null) { return; } ImsCall imsCall = imsPhoneCall.getImsCall(); if (imsCall == null) { return; } ImsCallProfile callProfile = imsCall.getCallProfile(); Bundle extras = callProfile.getCallExtras(); if (extras == null) { extras = new Bundle(); } extras.putBoolean(ImsCallProfile.EXTRA_E_CALL, true); callProfile.mCallExtras = extras; imsCall.getImsCallSessionListenerProxy().callSessionUpdated(imsCall.getSession(), callProfile); } } No newline at end of file
src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +7 −1 Original line number Diff line number Diff line Loading @@ -1092,6 +1092,12 @@ public class ImsPhoneConnection extends Connection implements } } private void updateEmergencyCallFromExtras(Bundle extras) { if (extras.getBoolean(ImsCallProfile.EXTRA_E_CALL)) { setIsNetworkIdentifiedEmergencyCall(true); } } /** * Check for a change in call extras of {@link ImsCall}, and * update the {@link ImsPhoneConnection} accordingly. Loading @@ -1113,7 +1119,7 @@ public class ImsPhoneConnection extends Connection implements final boolean changed = !areBundlesEqual(extras, mExtras); if (changed) { updateImsCallRatFromExtras(extras); updateEmergencyCallFromExtras(extras); mExtras.clear(); mExtras.putAll(extras); setConnectionExtras(mExtras); Loading