Loading src/java/com/android/internal/telephony/Connection.java +7 −0 Original line number Diff line number Diff line Loading @@ -849,6 +849,13 @@ public abstract class Connection { public void onDisconnectConferenceParticipant(Uri endpoint) { } /** * Called by a {@link android.telecom.Connection} to indicate that this call should be pulled * to the local device. */ public void pullExternalCall() { } /** * */ Loading src/java/com/android/internal/telephony/TelephonyComponentFactory.java +5 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.internal.telephony.dataconnection.DcTracker; import com.android.internal.telephony.imsphone.ImsExternalCallTracker; import com.android.internal.telephony.imsphone.ImsPhone; import com.android.internal.telephony.imsphone.ImsPhoneCallTracker; import com.android.internal.telephony.imsphone.ImsPullCall; import com.android.internal.telephony.uicc.IccCardProxy; /** Loading Loading @@ -117,8 +118,10 @@ public class TelephonyComponentFactory { return new ImsPhoneCallTracker(imsPhone); } public ImsExternalCallTracker makeImsExternalCallTracker(ImsPhone imsPhone) { return new ImsExternalCallTracker(imsPhone); public ImsExternalCallTracker makeImsExternalCallTracker(ImsPhone imsPhone, ImsPullCall callPuller) { return new ImsExternalCallTracker(imsPhone, callPuller); } public CdmaSubscriptionSourceManager Loading src/java/com/android/internal/telephony/imsphone/ImsExternalCallTracker.java +47 −5 Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ package com.android.internal.telephony.imsphone; import com.android.ims.ImsCallProfile; import com.android.ims.ImsExternalCallState; import com.android.ims.ImsExternalCallStateListener; import com.android.internal.telephony.Call; import com.android.internal.telephony.Connection; import com.android.internal.telephony.Phone; Loading @@ -36,6 +38,28 @@ import java.util.Map; */ public class ImsExternalCallTracker { /** * Implements the {@link ImsExternalCallStateListener}, which is responsible for receiving * external call state updates from the IMS framework. */ public class ExternalCallStateListener extends ImsExternalCallStateListener { @Override public void onImsExternalCallStateUpdate(List<ImsExternalCallState> externalCallState) { refreshExternalCallState(externalCallState); } } /** * Receives callbacks from {@link ImsExternalConnection}s when a call pull has been initiated. */ public class ExternalConnectionListener implements ImsExternalConnection.Listener { @Override public void onPullExternalCall(ImsExternalConnection connection) { Log.d(TAG, "onPullExternalCall: connection = " + connection); mCallPuller.pullExternalCall(connection.getAddress(), connection.getVideoState()); } } public final static String TAG = "ImsExternalCallTracker"; /** Loading @@ -54,12 +78,21 @@ public class ImsExternalCallTracker { * Used in multi-endpoint (VoLTE for internet connected endpoints) scenarios. */ private Map<Integer, ImsExternalConnection> mExternalConnections = new ArrayMap<Integer, ImsExternalConnection>(); private ImsPhone mPhone; public ImsExternalCallTracker(ImsPhone phone) { new ArrayMap<>(); private final ImsPhone mPhone; private final ExternalCallStateListener mExternalCallStateListener; private final ExternalConnectionListener mExternalConnectionListener = new ExternalConnectionListener(); private final ImsPullCall mCallPuller; public ImsExternalCallTracker(ImsPhone phone, ImsPullCall callPuller) { mPhone = phone; mExternalCallStateListener = new ExternalCallStateListener(); mCallPuller = callPuller; } public ExternalCallStateListener getExternalCallStateListener() { return mExternalCallStateListener; } /** Loading @@ -85,6 +118,7 @@ public class ImsExternalCallTracker { if (!containsCallId(externalCallStates, callId)) { ImsExternalConnection externalConnection = entry.getValue(); externalConnection.setTerminated(); externalConnection.removeListener(mExternalConnectionListener); connectionIterator.remove(); wasCallRemoved = true; } Loading Loading @@ -136,6 +170,8 @@ public class ImsExternalCallTracker { state.getCallId(), /* Dialog event package call id */ state.getAddress().getSchemeSpecificPart() /* phone number */, state.isCallPullable()); connection.setVideoState(ImsCallProfile.getVideoStateFromCallType(state.getCallType())); connection.addListener(mExternalConnectionListener); // Add to list of tracked connections. mExternalConnections.put(connection.getCallId(), connection); Loading Loading @@ -165,12 +201,18 @@ public class ImsExternalCallTracker { connection.setActive(); } else { connection.setTerminated(); connection.removeListener(mExternalConnectionListener); mExternalConnections.remove(connection); mPhone.notifyPreciseCallStateChanged(); } } connection.setIsPullable(state.isCallPullable()); int newVideoState = ImsCallProfile.getVideoStateFromCallType(state.getCallType()); if (newVideoState != connection.getVideoState()) { connection.setVideoState(newVideoState); } } /** Loading src/java/com/android/internal/telephony/imsphone/ImsExternalConnection.java +41 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,11 @@ import com.android.internal.telephony.UUSInfo; import android.telephony.Rlog; import android.util.Log; import java.util.Collections; import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; /** * Represents an IMS call external to the device. This class is used to represent a call which * takes places on a secondary device associated with this one. Originates from a Dialog Event Loading @@ -33,9 +38,23 @@ import android.util.Log; * * Dialog event package information is received from the IMS framework via * {@link com.android.ims.ImsExternalCallState} instances. * * @hide */ public class ImsExternalConnection extends Connection { public interface Listener { void onPullExternalCall(ImsExternalConnection connection); } /** * ConcurrentHashMap constructor params: 8 is initial table size, 0.9f is * load factor before resizing, 1 means we only expect a single thread to * access the map so make only a single shard */ private final Set<Listener> mListeners = Collections.newSetFromMap( new ConcurrentHashMap<Listener, Boolean>(8, 0.9f, 1)); /** * The unqiue dialog event package specified ID associated with this external connection. */ Loading Loading @@ -135,6 +154,20 @@ public class ImsExternalConnection extends Connection { return false; } /** * Called by a {@link android.telecom.Connection} to indicate that this call should be pulled * to the local device. * * Informs all listeners, in this case {@link ImsExternalCallTracker}, of the request to pull * the call. */ @Override public void pullExternalCall() { for (Listener listener : mListeners) { listener.onPullExternalCall(this); } } /** * Sets this external call as active. */ Loading Loading @@ -166,6 +199,14 @@ public class ImsExternalConnection extends Connection { rebuildCapabilities(); } public void addListener(Listener listener) { mListeners.add(listener); } public void removeListener(Listener listener) { mListeners.remove(listener); } /** * 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/imsphone/ImsPhone.java +11 −1 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import com.android.ims.ImsEcbm; import com.android.ims.ImsEcbmStateListener; import com.android.ims.ImsException; import com.android.ims.ImsManager; import com.android.ims.ImsMultiEndpoint; import com.android.ims.ImsReasonInfo; import com.android.ims.ImsSsInfo; import com.android.ims.ImsUtInterface; Loading Loading @@ -125,6 +126,7 @@ public class ImsPhone extends ImsPhoneBase { // Instance Variables Phone mDefaultPhone; ImsPhoneCallTracker mCT; ImsMultiEndpoint mImsMultiEndpoint; ImsExternalCallTracker mExternalCallTracker; private ArrayList <ImsPhoneMmiCode> mPendingMMIs = new ArrayList<ImsPhoneMmiCode>(); Loading Loading @@ -184,7 +186,15 @@ public class ImsPhone extends ImsPhoneBase { mDefaultPhone = defaultPhone; mCT = TelephonyComponentFactory.getInstance().makeImsPhoneCallTracker(this); mExternalCallTracker = TelephonyComponentFactory.getInstance().makeImsExternalCallTracker(this); TelephonyComponentFactory.getInstance().makeImsExternalCallTracker(this, mCT); try { mImsMultiEndpoint = mCT.getMultiEndpointInterface(); mImsMultiEndpoint.setExternalCallStateListener( mExternalCallTracker.getExternalCallStateListener()); } catch (ImsException e) { Rlog.i(LOG_TAG, "ImsMultiEndpointInterface is not available."); } mSS.setStateOff(); mPhoneId = mDefaultPhone.getPhoneId(); Loading Loading
src/java/com/android/internal/telephony/Connection.java +7 −0 Original line number Diff line number Diff line Loading @@ -849,6 +849,13 @@ public abstract class Connection { public void onDisconnectConferenceParticipant(Uri endpoint) { } /** * Called by a {@link android.telecom.Connection} to indicate that this call should be pulled * to the local device. */ public void pullExternalCall() { } /** * */ Loading
src/java/com/android/internal/telephony/TelephonyComponentFactory.java +5 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.internal.telephony.dataconnection.DcTracker; import com.android.internal.telephony.imsphone.ImsExternalCallTracker; import com.android.internal.telephony.imsphone.ImsPhone; import com.android.internal.telephony.imsphone.ImsPhoneCallTracker; import com.android.internal.telephony.imsphone.ImsPullCall; import com.android.internal.telephony.uicc.IccCardProxy; /** Loading Loading @@ -117,8 +118,10 @@ public class TelephonyComponentFactory { return new ImsPhoneCallTracker(imsPhone); } public ImsExternalCallTracker makeImsExternalCallTracker(ImsPhone imsPhone) { return new ImsExternalCallTracker(imsPhone); public ImsExternalCallTracker makeImsExternalCallTracker(ImsPhone imsPhone, ImsPullCall callPuller) { return new ImsExternalCallTracker(imsPhone, callPuller); } public CdmaSubscriptionSourceManager Loading
src/java/com/android/internal/telephony/imsphone/ImsExternalCallTracker.java +47 −5 Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ package com.android.internal.telephony.imsphone; import com.android.ims.ImsCallProfile; import com.android.ims.ImsExternalCallState; import com.android.ims.ImsExternalCallStateListener; import com.android.internal.telephony.Call; import com.android.internal.telephony.Connection; import com.android.internal.telephony.Phone; Loading @@ -36,6 +38,28 @@ import java.util.Map; */ public class ImsExternalCallTracker { /** * Implements the {@link ImsExternalCallStateListener}, which is responsible for receiving * external call state updates from the IMS framework. */ public class ExternalCallStateListener extends ImsExternalCallStateListener { @Override public void onImsExternalCallStateUpdate(List<ImsExternalCallState> externalCallState) { refreshExternalCallState(externalCallState); } } /** * Receives callbacks from {@link ImsExternalConnection}s when a call pull has been initiated. */ public class ExternalConnectionListener implements ImsExternalConnection.Listener { @Override public void onPullExternalCall(ImsExternalConnection connection) { Log.d(TAG, "onPullExternalCall: connection = " + connection); mCallPuller.pullExternalCall(connection.getAddress(), connection.getVideoState()); } } public final static String TAG = "ImsExternalCallTracker"; /** Loading @@ -54,12 +78,21 @@ public class ImsExternalCallTracker { * Used in multi-endpoint (VoLTE for internet connected endpoints) scenarios. */ private Map<Integer, ImsExternalConnection> mExternalConnections = new ArrayMap<Integer, ImsExternalConnection>(); private ImsPhone mPhone; public ImsExternalCallTracker(ImsPhone phone) { new ArrayMap<>(); private final ImsPhone mPhone; private final ExternalCallStateListener mExternalCallStateListener; private final ExternalConnectionListener mExternalConnectionListener = new ExternalConnectionListener(); private final ImsPullCall mCallPuller; public ImsExternalCallTracker(ImsPhone phone, ImsPullCall callPuller) { mPhone = phone; mExternalCallStateListener = new ExternalCallStateListener(); mCallPuller = callPuller; } public ExternalCallStateListener getExternalCallStateListener() { return mExternalCallStateListener; } /** Loading @@ -85,6 +118,7 @@ public class ImsExternalCallTracker { if (!containsCallId(externalCallStates, callId)) { ImsExternalConnection externalConnection = entry.getValue(); externalConnection.setTerminated(); externalConnection.removeListener(mExternalConnectionListener); connectionIterator.remove(); wasCallRemoved = true; } Loading Loading @@ -136,6 +170,8 @@ public class ImsExternalCallTracker { state.getCallId(), /* Dialog event package call id */ state.getAddress().getSchemeSpecificPart() /* phone number */, state.isCallPullable()); connection.setVideoState(ImsCallProfile.getVideoStateFromCallType(state.getCallType())); connection.addListener(mExternalConnectionListener); // Add to list of tracked connections. mExternalConnections.put(connection.getCallId(), connection); Loading Loading @@ -165,12 +201,18 @@ public class ImsExternalCallTracker { connection.setActive(); } else { connection.setTerminated(); connection.removeListener(mExternalConnectionListener); mExternalConnections.remove(connection); mPhone.notifyPreciseCallStateChanged(); } } connection.setIsPullable(state.isCallPullable()); int newVideoState = ImsCallProfile.getVideoStateFromCallType(state.getCallType()); if (newVideoState != connection.getVideoState()) { connection.setVideoState(newVideoState); } } /** Loading
src/java/com/android/internal/telephony/imsphone/ImsExternalConnection.java +41 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,11 @@ import com.android.internal.telephony.UUSInfo; import android.telephony.Rlog; import android.util.Log; import java.util.Collections; import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; /** * Represents an IMS call external to the device. This class is used to represent a call which * takes places on a secondary device associated with this one. Originates from a Dialog Event Loading @@ -33,9 +38,23 @@ import android.util.Log; * * Dialog event package information is received from the IMS framework via * {@link com.android.ims.ImsExternalCallState} instances. * * @hide */ public class ImsExternalConnection extends Connection { public interface Listener { void onPullExternalCall(ImsExternalConnection connection); } /** * ConcurrentHashMap constructor params: 8 is initial table size, 0.9f is * load factor before resizing, 1 means we only expect a single thread to * access the map so make only a single shard */ private final Set<Listener> mListeners = Collections.newSetFromMap( new ConcurrentHashMap<Listener, Boolean>(8, 0.9f, 1)); /** * The unqiue dialog event package specified ID associated with this external connection. */ Loading Loading @@ -135,6 +154,20 @@ public class ImsExternalConnection extends Connection { return false; } /** * Called by a {@link android.telecom.Connection} to indicate that this call should be pulled * to the local device. * * Informs all listeners, in this case {@link ImsExternalCallTracker}, of the request to pull * the call. */ @Override public void pullExternalCall() { for (Listener listener : mListeners) { listener.onPullExternalCall(this); } } /** * Sets this external call as active. */ Loading Loading @@ -166,6 +199,14 @@ public class ImsExternalConnection extends Connection { rebuildCapabilities(); } public void addListener(Listener listener) { mListeners.add(listener); } public void removeListener(Listener listener) { mListeners.remove(listener); } /** * 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/imsphone/ImsPhone.java +11 −1 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import com.android.ims.ImsEcbm; import com.android.ims.ImsEcbmStateListener; import com.android.ims.ImsException; import com.android.ims.ImsManager; import com.android.ims.ImsMultiEndpoint; import com.android.ims.ImsReasonInfo; import com.android.ims.ImsSsInfo; import com.android.ims.ImsUtInterface; Loading Loading @@ -125,6 +126,7 @@ public class ImsPhone extends ImsPhoneBase { // Instance Variables Phone mDefaultPhone; ImsPhoneCallTracker mCT; ImsMultiEndpoint mImsMultiEndpoint; ImsExternalCallTracker mExternalCallTracker; private ArrayList <ImsPhoneMmiCode> mPendingMMIs = new ArrayList<ImsPhoneMmiCode>(); Loading Loading @@ -184,7 +186,15 @@ public class ImsPhone extends ImsPhoneBase { mDefaultPhone = defaultPhone; mCT = TelephonyComponentFactory.getInstance().makeImsPhoneCallTracker(this); mExternalCallTracker = TelephonyComponentFactory.getInstance().makeImsExternalCallTracker(this); TelephonyComponentFactory.getInstance().makeImsExternalCallTracker(this, mCT); try { mImsMultiEndpoint = mCT.getMultiEndpointInterface(); mImsMultiEndpoint.setExternalCallStateListener( mExternalCallTracker.getExternalCallStateListener()); } catch (ImsException e) { Rlog.i(LOG_TAG, "ImsMultiEndpointInterface is not available."); } mSS.setStateOff(); mPhoneId = mDefaultPhone.getPhoneId(); Loading