Methods Summary |
---|
public void | acceptCall(Call ringingCall)Answers a ringing or waiting call.
Active call, if any, go on hold.
If active call can't be held, i.e., a background call of the same channel exists,
the active call will be hang up.
Answering occurs asynchronously, and final notification occurs via
{@link #registerForPreciseCallStateChanged(android.os.Handler, int,
java.lang.Object) registerForPreciseCallStateChanged()}.
Phone ringingPhone = ringingCall.getPhone();
if (VDBG) {
Rlog.d(LOG_TAG, "acceptCall(" +ringingCall + " from " + ringingCall.getPhone() + ")");
Rlog.d(LOG_TAG, toString());
}
if ( hasActiveFgCall() ) {
Phone activePhone = getActiveFgCall().getPhone();
boolean hasBgCall = ! (activePhone.getBackgroundCall().isIdle());
boolean sameChannel = (activePhone == ringingPhone);
if (VDBG) {
Rlog.d(LOG_TAG, "hasBgCall: "+ hasBgCall + "sameChannel:" + sameChannel);
}
if (sameChannel && hasBgCall) {
getActiveFgCall().hangup();
} else if (!sameChannel && !hasBgCall) {
activePhone.switchHoldingAndActive();
} else if (!sameChannel && hasBgCall) {
getActiveFgCall().hangup();
}
}
// We only support the AUDIO_ONLY video state in this scenario.
ringingPhone.acceptCall(VideoProfile.VideoState.AUDIO_ONLY);
if (VDBG) {
Rlog.d(LOG_TAG, "End acceptCall(" +ringingCall + ")");
Rlog.d(LOG_TAG, toString());
}
|
public boolean | canConference(Call heldCall)Whether or not the phone can conference in the current phone
state--that is, one call holding and one call active.
Phone activePhone = null;
Phone heldPhone = null;
if (hasActiveFgCall()) {
activePhone = getActiveFgCall().getPhone();
}
if (heldCall != null) {
heldPhone = heldCall.getPhone();
}
return heldPhone.getClass().equals(activePhone.getClass());
|
public boolean | canConference(Call heldCall, int subId)Whether or not the phone can conference in the current phone
state--that is, one call holding and one call active.
This method consider the phone object which is specific
to the provided subId.
Phone activePhone = null;
Phone heldPhone = null;
if (hasActiveFgCall(subId)) {
activePhone = getActiveFgCall(subId).getPhone();
}
if (heldCall != null) {
heldPhone = heldCall.getPhone();
}
return heldPhone.getClass().equals(activePhone.getClass());
|
private boolean | canDial(Phone phone)Phone can make a call only if ALL of the following are true:
- Phone is not powered off
- There's no incoming or waiting call
- The foreground call is ACTIVE or IDLE or DISCONNECTED.
(We mainly need to make sure it *isn't* DIALING or ALERTING.)
int serviceState = phone.getServiceState().getState();
int subId = phone.getSubId();
boolean hasRingingCall = hasActiveRingingCall();
Call.State fgCallState = getActiveFgCallState(subId);
boolean result = (serviceState != ServiceState.STATE_POWER_OFF
&& !hasRingingCall
&& ((fgCallState == Call.State.ACTIVE)
|| (fgCallState == Call.State.IDLE)
|| (fgCallState == Call.State.DISCONNECTED)
/*As per 3GPP TS 51.010-1 section 31.13.1.4
call should be alowed when the foreground
call is in ALERTING state*/
|| (fgCallState == Call.State.ALERTING)));
if (result == false) {
Rlog.d(LOG_TAG, "canDial serviceState=" + serviceState
+ " hasRingingCall=" + hasRingingCall
+ " fgCallState=" + fgCallState);
}
return result;
|
public boolean | canTransfer(Call heldCall)Whether or not the phone can do explicit call transfer in the current
phone state--that is, one call holding and one call active.
Phone activePhone = null;
Phone heldPhone = null;
if (hasActiveFgCall()) {
activePhone = getActiveFgCall().getPhone();
}
if (heldCall != null) {
heldPhone = heldCall.getPhone();
}
return (heldPhone == activePhone && activePhone.canTransfer());
|
public boolean | canTransfer(Call heldCall, int subId)Whether or not the phone specific to subId can do explicit call transfer
in the current phone state--that is, one call holding and one call active.
Phone activePhone = null;
Phone heldPhone = null;
if (hasActiveFgCall(subId)) {
activePhone = getActiveFgCall(subId).getPhone();
}
if (heldCall != null) {
heldPhone = heldCall.getPhone();
}
return (heldPhone == activePhone && activePhone.canTransfer());
|
public void | clearDisconnected()clear disconnect connection for each phone
for(Phone phone : mPhones) {
phone.clearDisconnected();
}
|
public void | clearDisconnected(int subId)clear disconnect connection for a phone specific
to the provided subId
for(Phone phone : mPhones) {
if (phone.getSubId() == subId) {
phone.clearDisconnected();
}
}
|
public void | conference(Call heldCall)Conferences holding and active. Conference occurs asynchronously
and may fail. Final notification occurs via
{@link #registerForPreciseCallStateChanged(android.os.Handler, int,
java.lang.Object) registerForPreciseCallStateChanged()}.
int subId = heldCall.getPhone().getSubId();
if (VDBG) {
Rlog.d(LOG_TAG, "conference(" +heldCall + ")");
Rlog.d(LOG_TAG, toString());
}
Phone fgPhone = getFgPhone(subId);
if (fgPhone != null) {
if (fgPhone instanceof SipPhone) {
((SipPhone) fgPhone).conference(heldCall);
} else if (canConference(heldCall)) {
fgPhone.conference();
} else {
throw(new CallStateException("Can't conference foreground and selected background call"));
}
} else {
Rlog.d(LOG_TAG, "conference: fgPhone=null");
}
if (VDBG) {
Rlog.d(LOG_TAG, "End conference(" +heldCall + ")");
Rlog.d(LOG_TAG, toString());
}
|
public Connection | dial(Phone phone, java.lang.String dialString, int videoState)Initiate a new voice connection. This happens asynchronously, so you
cannot assume the audio path is connected (or a call index has been
assigned) until PhoneStateChanged notification has occurred.
Phone basePhone = getPhoneBase(phone);
int subId = phone.getSubId();
Connection result;
if (VDBG) {
Rlog.d(LOG_TAG, " dial(" + basePhone + ", "+ dialString + ")" +
" subId = " + subId);
Rlog.d(LOG_TAG, toString());
}
if (!canDial(phone)) {
/*
* canDial function only checks whether the phone can make a new call.
* InCall MMI commmands are basically supplementary services
* within a call eg: call hold, call deflection, explicit call transfer etc.
*/
String newDialString = PhoneNumberUtils.stripSeparators(dialString);
if (basePhone.handleInCallMmiCommands(newDialString)) {
return null;
} else {
throw new CallStateException("cannot dial in current state");
}
}
if ( hasActiveFgCall(subId) ) {
Phone activePhone = getActiveFgCall(subId).getPhone();
boolean hasBgCall = !(activePhone.getBackgroundCall().isIdle());
if (DBG) {
Rlog.d(LOG_TAG, "hasBgCall: "+ hasBgCall + " sameChannel:" + (activePhone == basePhone));
}
// Manipulation between IMS phone and its owner
// will be treated in GSM/CDMA phone.
Phone vPhone = basePhone.getImsPhone();
if (activePhone != basePhone
&& (vPhone == null || vPhone != activePhone)) {
if (hasBgCall) {
Rlog.d(LOG_TAG, "Hangup");
getActiveFgCall(subId).hangup();
} else {
Rlog.d(LOG_TAG, "Switch");
activePhone.switchHoldingAndActive();
}
}
}
// FIXME Taken from klp-sprout-dev but setAudioMode was removed in L.
//mIsEccDialing = PhoneNumberUtils.isEmergencyNumber(dialString);
result = basePhone.dial(dialString, videoState);
if (VDBG) {
Rlog.d(LOG_TAG, "End dial(" + basePhone + ", "+ dialString + ")");
Rlog.d(LOG_TAG, toString());
}
return result;
|
public Connection | dial(Phone phone, java.lang.String dialString, UUSInfo uusInfo, int videoState)Initiate a new voice connection. This happens asynchronously, so you
cannot assume the audio path is connected (or a call index has been
assigned) until PhoneStateChanged notification has occurred.
return phone.dial(dialString, uusInfo, videoState);
|
public void | explicitCallTransfer(Call heldCall)Connects the held call and active call
Disconnects the subscriber from both calls
Explicit Call Transfer occurs asynchronously
and may fail. Final notification occurs via
{@link #registerForPreciseCallStateChanged(android.os.Handler, int,
java.lang.Object) registerForPreciseCallStateChanged()}.
if (VDBG) {
Rlog.d(LOG_TAG, " explicitCallTransfer(" + heldCall + ")");
Rlog.d(LOG_TAG, toString());
}
if (canTransfer(heldCall)) {
heldCall.getPhone().explicitCallTransfer();
}
if (VDBG) {
Rlog.d(LOG_TAG, "End explicitCallTransfer(" + heldCall + ")");
Rlog.d(LOG_TAG, toString());
}
|
public Call | getActiveFgCall()return the active foreground call from foreground calls
Active call means the call is NOT in Call.State.IDLE
1. If there is active foreground call, return it
2. If there is no active foreground call, return the
foreground call associated with default phone, which state is IDLE.
3. If there is no phone registered at all, return null.
Call call = getFirstNonIdleCall(mForegroundCalls);
if (call == null) {
call = (mDefaultPhone == null)
? null
: mDefaultPhone.getForegroundCall();
}
return call;
|
public Call | getActiveFgCall(int subId)
Call call = getFirstNonIdleCall(mForegroundCalls, subId);
if (call == null) {
Phone phone = getPhone(subId);
call = (phone == null)
? null
: phone.getForegroundCall();
}
return call;
|
public Call.State | getActiveFgCallState()
Call fgCall = getActiveFgCall();
if (fgCall != null) {
return fgCall.getState();
}
return Call.State.IDLE;
|
public Call.State | getActiveFgCallState(int subId)
Call fgCall = getActiveFgCall(subId);
if (fgCall != null) {
return fgCall.getState();
}
return Call.State.IDLE;
|
public java.util.List | getAllPhones()Returns all the registered phone objects.
return Collections.unmodifiableList(mPhones);
|
public java.util.List | getBackgroundCalls()
return Collections.unmodifiableList(mBackgroundCalls);
|
public java.util.List | getBgCallConnections()
Call bgCall = getFirstActiveBgCall();
if ( bgCall != null) {
return bgCall.getConnections();
}
return mEmptyConnections;
|
public java.util.List | getBgCallConnections(int subId)
Call bgCall = getFirstActiveBgCall(subId);
if ( bgCall != null) {
return bgCall.getConnections();
}
return mEmptyConnections;
|
public Phone | getBgPhone()
return getFirstActiveBgCall().getPhone();
|
public Phone | getBgPhone(int subId)
return getFirstActiveBgCall(subId).getPhone();
|
private android.content.Context | getContext()
Phone defaultPhone = getDefaultPhone();
return ((defaultPhone == null) ? null : defaultPhone.getContext());
|
public Phone | getDefaultPhone()return the default phone or null if no phone available
return mDefaultPhone;
|
public java.util.List | getFgCallConnections()
Call fgCall = getActiveFgCall();
if ( fgCall != null) {
return fgCall.getConnections();
}
return mEmptyConnections;
|
public java.util.List | getFgCallConnections(int subId)
Call fgCall = getActiveFgCall(subId);
if ( fgCall != null) {
return fgCall.getConnections();
}
return mEmptyConnections;
|
public Connection | getFgCallLatestConnection()
Call fgCall = getActiveFgCall();
if ( fgCall != null) {
return fgCall.getLatestConnection();
}
return null;
|
public Connection | getFgCallLatestConnection(int subId)
Call fgCall = getActiveFgCall(subId);
if ( fgCall != null) {
return fgCall.getLatestConnection();
}
return null;
|
public Phone | getFgPhone()
return getActiveFgCall().getPhone();
|
public Phone | getFgPhone(int subId)
return getActiveFgCall(subId).getPhone();
|
public Call | getFirstActiveBgCall()return one active background call from background calls
Active call means the call is NOT idle defined by Call.isIdle()
1. If there is only one active background call, return it
2. If there is more than one active background call, return the first one
3. If there is no active background call, return the background call
associated with default phone, which state is IDLE.
4. If there is no background call at all, return null.
Complete background calls list can be get by getBackgroundCalls()
Call call = getFirstNonIdleCall(mBackgroundCalls);
if (call == null) {
call = (mDefaultPhone == null)
? null
: mDefaultPhone.getBackgroundCall();
}
return call;
|
public Call | getFirstActiveBgCall(int subId)return one active background call from background calls of the
requested subId.
Active call means the call is NOT idle defined by Call.isIdle()
1. If there is only one active background call on given sub or
on SIP Phone, return it
2. If there is more than one active background call, return the background call
associated with the active sub.
3. If there is no background call at all, return null.
Complete background calls list can be get by getBackgroundCalls()
Phone phone = getPhone(subId);
if (hasMoreThanOneHoldingCall(subId)) {
return phone.getBackgroundCall();
} else {
Call call = getFirstNonIdleCall(mBackgroundCalls, subId);
if (call == null) {
call = (phone == null)
? null
: phone.getBackgroundCall();
}
return call;
}
|
private Call | getFirstActiveCall(java.util.ArrayList calls)
for (Call call : calls) {
if (!call.isIdle()) {
return call;
}
}
return null;
|
private Call | getFirstActiveCall(java.util.ArrayList calls, int subId)
for (Call call : calls) {
if ((!call.isIdle()) && ((call.getPhone().getSubId() == subId) ||
(call.getPhone() instanceof SipPhone))) {
return call;
}
}
return null;
|
public Call | getFirstActiveRingingCall()return one active ringing call from ringing calls
Active call means the call is NOT idle defined by Call.isIdle()
1. If there is only one active ringing call, return it
2. If there is more than one active ringing call, return the first one
3. If there is no active ringing call, return the ringing call
associated with default phone, which state is IDLE.
4. If there is no ringing call at all, return null.
Complete ringing calls list can be get by getRingingCalls()
Call call = getFirstNonIdleCall(mRingingCalls);
if (call == null) {
call = (mDefaultPhone == null)
? null
: mDefaultPhone.getRingingCall();
}
return call;
|
public Call | getFirstActiveRingingCall(int subId)
Phone phone = getPhone(subId);
Call call = getFirstNonIdleCall(mRingingCalls, subId);
if (call == null) {
call = (phone == null)
? null
: phone.getRingingCall();
}
return call;
|
private Call | getFirstCallOfState(java.util.ArrayList calls, Call.State state)
for (Call call : calls) {
if (call.getState() == state) {
return call;
}
}
return null;
|
private Call | getFirstCallOfState(java.util.ArrayList calls, Call.State state, int subId)
for (Call call : calls) {
if ((call.getState() == state) ||
((call.getPhone().getSubId() == subId) ||
(call.getPhone() instanceof SipPhone))) {
return call;
}
}
return null;
|
private Call | getFirstNonIdleCall(java.util.List calls)
Call result = null;
for (Call call : calls) {
if (!call.isIdle()) {
return call;
} else if (call.getState() != Call.State.IDLE) {
if (result == null) result = call;
}
}
return result;
|
private Call | getFirstNonIdleCall(java.util.List calls, int subId)
Call result = null;
for (Call call : calls) {
if ((call.getPhone().getSubId() == subId) ||
(call.getPhone() instanceof SipPhone)) {
if (!call.isIdle()) {
return call;
} else if (call.getState() != Call.State.IDLE) {
if (result == null) result = call;
}
}
}
return result;
|
public java.util.List | getForegroundCalls()
return Collections.unmodifiableList(mForegroundCalls);
|
public static com.android.internal.telephony.CallManager | getInstance()get singleton instance of CallManager
return INSTANCE;
|
public boolean | getMute()Gets current mute status. Use
{@link #registerForPreciseCallStateChanged(android.os.Handler, int,
java.lang.Object) registerForPreciseCallStateChanged()}
as a change notifcation, although presently phone state changed is not
fired when setMute() is called.
if (hasActiveFgCall()) {
return getActiveFgCall().getPhone().getMute();
} else if (hasActiveBgCall()) {
return getFirstActiveBgCall().getPhone().getMute();
}
return false;
|
public java.util.List | getPendingMmiCodes(Phone phone)Returns a list of MMI codes that are pending for a phone. (They have initiated
but have not yet completed).
Presently there is only ever one.
Use registerForMmiInitiate
and registerForMmiComplete for change notification.
Rlog.e(LOG_TAG, "getPendingMmiCodes not implemented");
return null;
|
private Phone | getPhone(int subId)get Phone object corresponds to subId
Phone p = null;
for (Phone phone : mPhones) {
if (phone.getSubId() == subId && !(phone instanceof ImsPhone)) {
p = phone;
break;
}
}
return p;
|
private static Phone | getPhoneBase(Phone phone)Get the corresponding PhoneBase obj
if (phone instanceof PhoneProxy) {
return phone.getForegroundCall().getPhone();
}
return phone;
|
public Phone | getPhoneInCall()
Phone phone = null;
if (!getFirstActiveRingingCall().isIdle()) {
phone = getFirstActiveRingingCall().getPhone();
} else if (!getActiveFgCall().isIdle()) {
phone = getActiveFgCall().getPhone();
} else {
// If BG call is idle, we return default phone
phone = getFirstActiveBgCall().getPhone();
}
return phone;
|
public Phone | getPhoneInCall(int subId)
Phone phone = null;
if (!getFirstActiveRingingCall(subId).isIdle()) {
phone = getFirstActiveRingingCall(subId).getPhone();
} else if (!getActiveFgCall(subId).isIdle()) {
phone = getActiveFgCall(subId).getPhone();
} else {
// If BG call is idle, we return default phone
phone = getFirstActiveBgCall(subId).getPhone();
}
return phone;
|
public java.util.List | getRingingCalls()
return Collections.unmodifiableList(mRingingCalls);
|
public Phone | getRingingPhone()
return getFirstActiveRingingCall().getPhone();
|
public Phone | getRingingPhone(int subId)
return getFirstActiveRingingCall(subId).getPhone();
|
public int | getServiceState(int subId)
int resultState = ServiceState.STATE_OUT_OF_SERVICE;
for (Phone phone : mPhones) {
if (phone.getSubId() == subId) {
int serviceState = phone.getServiceState().getState();
if (serviceState == ServiceState.STATE_IN_SERVICE) {
// IN_SERVICE has the highest priority
resultState = serviceState;
break;
} else if (serviceState == ServiceState.STATE_OUT_OF_SERVICE) {
// OUT_OF_SERVICE replaces EMERGENCY_ONLY and POWER_OFF
// Note: EMERGENCY_ONLY is not in use at this moment
if ( resultState == ServiceState.STATE_EMERGENCY_ONLY ||
resultState == ServiceState.STATE_POWER_OFF) {
resultState = serviceState;
}
} else if (serviceState == ServiceState.STATE_EMERGENCY_ONLY) {
if (resultState == ServiceState.STATE_POWER_OFF) {
resultState = serviceState;
}
}
}
}
return resultState;
|
public int | getServiceState()
int resultState = ServiceState.STATE_OUT_OF_SERVICE;
for (Phone phone : mPhones) {
int serviceState = phone.getServiceState().getState();
if (serviceState == ServiceState.STATE_IN_SERVICE) {
// IN_SERVICE has the highest priority
resultState = serviceState;
break;
} else if (serviceState == ServiceState.STATE_OUT_OF_SERVICE) {
// OUT_OF_SERVICE replaces EMERGENCY_ONLY and POWER_OFF
// Note: EMERGENCY_ONLY is not in use at this moment
if ( resultState == ServiceState.STATE_EMERGENCY_ONLY ||
resultState == ServiceState.STATE_POWER_OFF) {
resultState = serviceState;
}
} else if (serviceState == ServiceState.STATE_EMERGENCY_ONLY) {
if (resultState == ServiceState.STATE_POWER_OFF) {
resultState = serviceState;
}
}
}
return resultState;
|
public PhoneConstants.State | getState()Get current coarse-grained voice call state.
If the Call Manager has an active call and call waiting occurs,
then the phone state is RINGING not OFFHOOK
PhoneConstants.State s = PhoneConstants.State.IDLE;
for (Phone phone : mPhones) {
if (phone.getState() == PhoneConstants.State.RINGING) {
s = PhoneConstants.State.RINGING;
} else if (phone.getState() == PhoneConstants.State.OFFHOOK) {
if (s == PhoneConstants.State.IDLE) s = PhoneConstants.State.OFFHOOK;
}
}
return s;
|
public PhoneConstants.State | getState(int subId)Get current coarse-grained voice call state on a subId.
If the Call Manager has an active call and call waiting occurs,
then the phone state is RINGING not OFFHOOK
PhoneConstants.State s = PhoneConstants.State.IDLE;
for (Phone phone : mPhones) {
if (phone.getSubId() == subId) {
if (phone.getState() == PhoneConstants.State.RINGING) {
s = PhoneConstants.State.RINGING;
} else if (phone.getState() == PhoneConstants.State.OFFHOOK) {
if (s == PhoneConstants.State.IDLE) s = PhoneConstants.State.OFFHOOK;
}
}
}
return s;
|
public void | hangupForegroundResumeBackground(Call heldCall)Hangup foreground call and resume the specific background call
Note: this is noop if there is no foreground call or the heldCall is null
Phone foregroundPhone = null;
Phone backgroundPhone = null;
if (VDBG) {
Rlog.d(LOG_TAG, "hangupForegroundResumeBackground(" +heldCall + ")");
Rlog.d(LOG_TAG, toString());
}
if (hasActiveFgCall()) {
foregroundPhone = getFgPhone();
if (heldCall != null) {
backgroundPhone = heldCall.getPhone();
if (foregroundPhone == backgroundPhone) {
getActiveFgCall().hangup();
} else {
// the call to be hangup and resumed belongs to different phones
getActiveFgCall().hangup();
switchHoldingAndActive(heldCall);
}
}
}
if (VDBG) {
Rlog.d(LOG_TAG, "End hangupForegroundResumeBackground(" +heldCall + ")");
Rlog.d(LOG_TAG, toString());
}
|
public boolean | hasActiveBgCall()Return true if there is at least one active background call
// TODO since hasActiveBgCall may get called often
// better to cache it to improve performance
return (getFirstActiveCall(mBackgroundCalls) != null);
|
public boolean | hasActiveBgCall(int subId)Return true if there is at least one active background call
on a particular subId or an active sip call
// TODO since hasActiveBgCall may get called often
// better to cache it to improve performance
return (getFirstActiveCall(mBackgroundCalls, subId) != null);
|
public boolean | hasActiveFgCall()Return true if there is at least one active foreground call
return (getFirstActiveCall(mForegroundCalls) != null);
|
public boolean | hasActiveFgCall(int subId)Return true if there is at least one active foreground call
on a particular subId or an active sip call
return (getFirstActiveCall(mForegroundCalls, subId) != null);
|
public boolean | hasActiveRingingCall()Return true if there is at least one active ringing call
return (getFirstActiveCall(mRingingCalls) != null);
|
public boolean | hasActiveRingingCall(int subId)Return true if there is at least one active ringing call
return (getFirstActiveCall(mRingingCalls, subId) != null);
|
public boolean | hasDisconnectedBgCall()
return (getFirstCallOfState(mBackgroundCalls, Call.State.DISCONNECTED) != null);
|
public boolean | hasDisconnectedBgCall(int subId)
return (getFirstCallOfState(mBackgroundCalls, Call.State.DISCONNECTED,
subId) != null);
|
public boolean | hasDisconnectedFgCall()
return (getFirstCallOfState(mForegroundCalls, Call.State.DISCONNECTED) != null);
|
public boolean | hasDisconnectedFgCall(int subId)
return (getFirstCallOfState(mForegroundCalls, Call.State.DISCONNECTED,
subId) != null);
|
private boolean | hasMoreThanOneHoldingCall(int subId)
int count = 0;
for (Call call : mBackgroundCalls) {
if ((call.getState() == Call.State.HOLDING) &&
((call.getPhone().getSubId() == subId) ||
(call.getPhone() instanceof SipPhone))) {
if (++count > 1) return true;
}
}
return false;
|
private boolean | hasMoreThanOneRingingCall()
int count = 0;
for (Call call : mRingingCalls) {
if (call.getState().isRinging()) {
if (++count > 1) return true;
}
}
return false;
|
private boolean | hasMoreThanOneRingingCall(int subId)
int count = 0;
for (Call call : mRingingCalls) {
if ((call.getState().isRinging()) &&
((call.getPhone().getSubId() == subId) ||
(call.getPhone() instanceof SipPhone))) {
if (++count > 1) return true;
}
}
return false;
|
public static boolean | isSamePhone(Phone p1, Phone p2)Check if two phones refer to the same PhoneBase obj
Note: PhoneBase, not PhoneProxy, is to be used inside of CallManager
Both PhoneBase and PhoneProxy implement Phone interface, so
they have same phone APIs, such as dial(). The real implementation, for
example in GSM, is in GSMPhone as extend from PhoneBase, so that
foregroundCall.getPhone() returns GSMPhone obj. On the other hand,
PhoneFactory.getDefaultPhone() returns PhoneProxy obj, which has a class
member of GSMPhone.
So for phone returned by PhoneFacotry, which is used by PhoneApp,
phone.getForegroundCall().getPhone() != phone
but
isSamePhone(phone, phone.getForegroundCall().getPhone()) == true
return (getPhoneBase(p1) == getPhoneBase(p2));
|
public void | registerForCallWaiting(android.os.Handler h, int what, java.lang.Object obj)Register for notifications when CDMA call waiting comes
mCallWaitingRegistrants.addUnique(h, what, obj);
|
public void | registerForCdmaOtaStatusChange(android.os.Handler h, int what, java.lang.Object obj)Register for notifications when CDMA OTA Provision status change
mCdmaOtaStatusChangeRegistrants.addUnique(h, what, obj);
|
public void | registerForDisconnect(android.os.Handler h, int what, java.lang.Object obj)Notifies when a voice connection has disconnected, either due to local
or remote hangup or error.
Messages received from this will have the following members:
- Message.obj will be an AsyncResult
- AsyncResult.userObj = obj
- AsyncResult.result = a Connection object that is
no longer connected.
mDisconnectRegistrants.addUnique(h, what, obj);
|
public void | registerForDisplayInfo(android.os.Handler h, int what, java.lang.Object obj)Register for display information notifications from the network.
Message.obj will contain an AsyncResult.
AsyncResult.result will be a SuppServiceNotification instance.
mDisplayInfoRegistrants.addUnique(h, what, obj);
|
public void | registerForEcmTimerReset(android.os.Handler h, int what, java.lang.Object obj)Registration point for Ecm timer reset
mEcmTimerResetRegistrants.addUnique(h, what, obj);
|
public void | registerForInCallVoicePrivacyOff(android.os.Handler h, int what, java.lang.Object obj)Register for notifications when a sInCall VoicePrivacy is disabled
mInCallVoicePrivacyOffRegistrants.addUnique(h, what, obj);
|
public void | registerForInCallVoicePrivacyOn(android.os.Handler h, int what, java.lang.Object obj)Register for notifications when a sInCall VoicePrivacy is enabled
mInCallVoicePrivacyOnRegistrants.addUnique(h, what, obj);
|
public void | registerForIncomingRing(android.os.Handler h, int what, java.lang.Object obj)Notifies when an incoming call rings.
Messages received from this:
Message.obj will be an AsyncResult
AsyncResult.userObj = obj
AsyncResult.result = a Connection.
mIncomingRingRegistrants.addUnique(h, what, obj);
|
public void | registerForMmiComplete(android.os.Handler h, int what, java.lang.Object obj)Register for notifications that an MMI request has completed
its network activity and is in its final state. This may mean a state
of COMPLETE, FAILED, or CANCELLED.
Message.obj will contain an AsyncResult.
obj.result will be an "MmiCode" object
mMmiCompleteRegistrants.addUnique(h, what, obj);
|
public void | registerForMmiInitiate(android.os.Handler h, int what, java.lang.Object obj)Register for notifications of initiation of a new MMI code request.
MMI codes for GSM are discussed in 3GPP TS 22.030.
Example: If Phone.dial is called with "*#31#", then the app will
be notified here.
The returned Message.obj will contain an AsyncResult.
obj.result will be an "MmiCode" object.
mMmiInitiateRegistrants.addUnique(h, what, obj);
|
public void | registerForNewRingingConnection(android.os.Handler h, int what, java.lang.Object obj)Notifies when a new ringing or waiting connection has appeared.
Messages received from this:
Message.obj will be an AsyncResult
AsyncResult.userObj = obj
AsyncResult.result = a Connection.
Please check Connection.isRinging() to make sure the Connection
has not dropped since this message was posted.
If Connection.isRinging() is true, then
Connection.getCall() == Phone.getRingingCall()
mNewRingingConnectionRegistrants.addUnique(h, what, obj);
|
public void | registerForOnHoldTone(android.os.Handler h, int what, java.lang.Object obj)Notifies when out-band on-hold tone is needed.
Messages received from this:
Message.obj will be an AsyncResult
AsyncResult.userObj = obj
AsyncResult.result = boolean, true to start play on-hold tone
and false to stop.
mOnHoldToneRegistrants.addUnique(h, what, obj);
|
private void | registerForPhoneStates(Phone phone)
// We need to keep a mapping of handler to Phone for proper unregistration.
// TODO: Clean up this solution as it is just a work around for each Phone instance
// using the same Handler to register with the RIL. When time permits, we should consider
// moving the handler (or the reference ot the handler) into the Phone object.
// See b/17414427.
CallManagerHandler handler = mHandlerMap.get(phone);
if (handler != null) {
Rlog.d(LOG_TAG, "This phone has already been registered.");
return;
}
// New registration, create a new handler instance and register the phone.
handler = new CallManagerHandler();
mHandlerMap.put(phone, handler);
// for common events supported by all phones
phone.registerForPreciseCallStateChanged(handler, EVENT_PRECISE_CALL_STATE_CHANGED, null);
phone.registerForDisconnect(handler, EVENT_DISCONNECT, null);
phone.registerForNewRingingConnection(handler, EVENT_NEW_RINGING_CONNECTION, null);
phone.registerForUnknownConnection(handler, EVENT_UNKNOWN_CONNECTION, null);
phone.registerForIncomingRing(handler, EVENT_INCOMING_RING, null);
phone.registerForRingbackTone(handler, EVENT_RINGBACK_TONE, null);
phone.registerForInCallVoicePrivacyOn(handler, EVENT_IN_CALL_VOICE_PRIVACY_ON, null);
phone.registerForInCallVoicePrivacyOff(handler, EVENT_IN_CALL_VOICE_PRIVACY_OFF, null);
phone.registerForDisplayInfo(handler, EVENT_DISPLAY_INFO, null);
phone.registerForSignalInfo(handler, EVENT_SIGNAL_INFO, null);
phone.registerForResendIncallMute(handler, EVENT_RESEND_INCALL_MUTE, null);
phone.registerForMmiInitiate(handler, EVENT_MMI_INITIATE, null);
phone.registerForMmiComplete(handler, EVENT_MMI_COMPLETE, null);
phone.registerForSuppServiceFailed(handler, EVENT_SUPP_SERVICE_FAILED, null);
phone.registerForServiceStateChanged(handler, EVENT_SERVICE_STATE_CHANGED, null);
// FIXME Taken from klp-sprout-dev but setAudioMode was removed in L.
//phone.registerForRadioOffOrNotAvailable(handler, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
// for events supported only by GSM, CDMA and IMS phone
if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM ||
phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA ||
phone.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
phone.setOnPostDialCharacter(handler, EVENT_POST_DIAL_CHARACTER, null);
}
// for events supported only by CDMA phone
if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA ){
phone.registerForCdmaOtaStatusChange(handler, EVENT_CDMA_OTA_STATUS_CHANGE, null);
phone.registerForSubscriptionInfoReady(handler, EVENT_SUBSCRIPTION_INFO_READY, null);
phone.registerForCallWaiting(handler, EVENT_CALL_WAITING, null);
phone.registerForEcmTimerReset(handler, EVENT_ECM_TIMER_RESET, null);
}
// for events supported only by IMS phone
if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
phone.registerForOnHoldTone(handler, EVENT_ONHOLD_TONE, null);
phone.registerForSuppServiceFailed(handler, EVENT_SUPP_SERVICE_FAILED, null);
phone.registerForTtyModeReceived(handler, EVENT_TTY_MODE_RECEIVED, null);
}
|
public void | registerForPostDialCharacter(android.os.Handler h, int what, java.lang.Object obj)Sets an event to be fired when the telephony system processes
a post-dial character on an outgoing call.
Messages of type what will be sent to h .
The obj field of these Message's will be instances of
AsyncResult . Message.obj.result will be
a Connection object.
Message.arg1 will be the post dial character being processed,
or 0 ('\0') if end of string.
If Connection.getPostDialState() == WAIT,
the application must call
{@link com.android.internal.telephony.Connection#proceedAfterWaitChar()
Connection.proceedAfterWaitChar()} or
{@link com.android.internal.telephony.Connection#cancelPostDial()
Connection.cancelPostDial()}
for the telephony system to continue playing the post-dial
DTMF sequence.
If Connection.getPostDialState() == WILD,
the application must call
{@link com.android.internal.telephony.Connection#proceedAfterWildChar
Connection.proceedAfterWildChar()}
or
{@link com.android.internal.telephony.Connection#cancelPostDial()
Connection.cancelPostDial()}
for the telephony system to continue playing the
post-dial DTMF sequence.
mPostDialCharacterRegistrants.addUnique(h, what, obj);
|
public void | registerForPreciseCallStateChanged(android.os.Handler h, int what, java.lang.Object obj)Register for getting notifications for change in the Call State {@link Call.State}
This is called PreciseCallState because the call state is more precise than what
can be obtained using the {@link PhoneStateListener}
Resulting events will have an AsyncResult in Message.obj .
AsyncResult.userData will be set to the obj argument here.
The h parameter is held only by a weak reference.
mPreciseCallStateRegistrants.addUnique(h, what, obj);
|
public void | registerForResendIncallMute(android.os.Handler h, int what, java.lang.Object obj)Registers the handler to reset the uplink mute state to get
uplink audio.
mResendIncallMuteRegistrants.addUnique(h, what, obj);
|
public void | registerForRingbackTone(android.os.Handler h, int what, java.lang.Object obj)Notifies when out-band ringback tone is needed.
Messages received from this:
Message.obj will be an AsyncResult
AsyncResult.userObj = obj
AsyncResult.result = boolean, true to start play ringback tone
and false to stop.
mRingbackToneRegistrants.addUnique(h, what, obj);
|
public void | registerForServiceStateChanged(android.os.Handler h, int what, java.lang.Object obj)Register for ServiceState changed.
Message.obj will contain an AsyncResult.
AsyncResult.result will be a ServiceState instance
mServiceStateChangedRegistrants.addUnique(h, what, obj);
|
public void | registerForSignalInfo(android.os.Handler h, int what, java.lang.Object obj)Register for signal information notifications from the network.
Message.obj will contain an AsyncResult.
AsyncResult.result will be a SuppServiceNotification instance.
mSignalInfoRegistrants.addUnique(h, what, obj);
|
public void | registerForSubscriptionInfoReady(android.os.Handler h, int what, java.lang.Object obj)Registration point for subscription info ready
mSubscriptionInfoReadyRegistrants.addUnique(h, what, obj);
|
public void | registerForSuppServiceFailed(android.os.Handler h, int what, java.lang.Object obj)Register for notifications when a supplementary service attempt fails.
Message.obj will contain an AsyncResult.
mSuppServiceFailedRegistrants.addUnique(h, what, obj);
|
public void | registerForTtyModeReceived(android.os.Handler h, int what, java.lang.Object obj)Register for TTY mode change notifications from the network.
Message.obj will contain an AsyncResult.
AsyncResult.result will be an Integer containing new mode.
mTtyModeReceivedRegistrants.addUnique(h, what, obj);
|
public void | registerForUnknownConnection(android.os.Handler h, int what, java.lang.Object obj)Notifies when a previously untracked non-ringing/waiting connection has appeared.
This is likely due to some other entity (eg, SIM card application) initiating a call.
mUnknownConnectionRegistrants.addUnique(h, what, obj);
|
public boolean | registerPhone(Phone phone)Register phone to CallManager
Phone basePhone = getPhoneBase(phone);
if (basePhone != null && !mPhones.contains(basePhone)) {
if (DBG) {
Rlog.d(LOG_TAG, "registerPhone(" +
phone.getPhoneName() + " " + phone + ")");
}
if (mPhones.isEmpty()) {
mDefaultPhone = basePhone;
}
mPhones.add(basePhone);
mRingingCalls.add(basePhone.getRingingCall());
mBackgroundCalls.add(basePhone.getBackgroundCall());
mForegroundCalls.add(basePhone.getForegroundCall());
registerForPhoneStates(basePhone);
return true;
}
return false;
|
public void | rejectCall(Call ringingCall)Reject (ignore) a ringing call. In GSM, this means UDUB
(User Determined User Busy). Reject occurs asynchronously,
and final notification occurs via
{@link #registerForPreciseCallStateChanged(android.os.Handler, int,
java.lang.Object) registerForPreciseCallStateChanged()}.
if (VDBG) {
Rlog.d(LOG_TAG, "rejectCall(" +ringingCall + ")");
Rlog.d(LOG_TAG, toString());
}
Phone ringingPhone = ringingCall.getPhone();
ringingPhone.rejectCall();
if (VDBG) {
Rlog.d(LOG_TAG, "End rejectCall(" +ringingCall + ")");
Rlog.d(LOG_TAG, toString());
}
|
public boolean | sendBurstDtmf(java.lang.String dtmfString, int on, int off, android.os.Message onComplete)send burst DTMF tone, it can send the string as single character or multiple character
ignore if there is no active call or not valid digits string.
Valid digit means only includes characters ISO-LATIN characters 0-9, *, #
The difference between sendDtmf and sendBurstDtmf is sendDtmf only sends one character,
this api can send single character and multiple character, also, this api has response
back to caller.
if (hasActiveFgCall()) {
getActiveFgCall().getPhone().sendBurstDtmf(dtmfString, on, off, onComplete);
return true;
}
return false;
|
public boolean | sendDtmf(char c)Play a DTMF tone on the active call.
boolean result = false;
if (VDBG) {
Rlog.d(LOG_TAG, " sendDtmf(" + c + ")");
Rlog.d(LOG_TAG, toString());
}
if (hasActiveFgCall()) {
getActiveFgCall().getPhone().sendDtmf(c);
result = true;
}
if (VDBG) {
Rlog.d(LOG_TAG, "End sendDtmf(" + c + ")");
Rlog.d(LOG_TAG, toString());
}
return result;
|
public boolean | sendUssdResponse(Phone phone, java.lang.String ussdMessge)Sends user response to a USSD REQUEST message. An MmiCode instance
representing this response is sent to handlers registered with
registerForMmiInitiate.
Rlog.e(LOG_TAG, "sendUssdResponse not implemented");
return false;
|
public void | setEchoSuppressionEnabled()Enables or disables echo suppression.
if (VDBG) {
Rlog.d(LOG_TAG, " setEchoSuppression()");
Rlog.d(LOG_TAG, toString());
}
if (hasActiveFgCall()) {
getActiveFgCall().getPhone().setEchoSuppressionEnabled();
}
if (VDBG) {
Rlog.d(LOG_TAG, "End setEchoSuppression()");
Rlog.d(LOG_TAG, toString());
}
|
public void | setMute(boolean muted)Mutes or unmutes the microphone for the active call. The microphone
is automatically unmuted if a call is answered, dialed, or resumed
from a holding state.
if (VDBG) {
Rlog.d(LOG_TAG, " setMute(" + muted + ")");
Rlog.d(LOG_TAG, toString());
}
if (hasActiveFgCall()) {
getActiveFgCall().getPhone().setMute(muted);
}
if (VDBG) {
Rlog.d(LOG_TAG, "End setMute(" + muted + ")");
Rlog.d(LOG_TAG, toString());
}
|
public boolean | startDtmf(char c)Start to paly a DTMF tone on the active call.
or there is a playing DTMF tone.
boolean result = false;
if (VDBG) {
Rlog.d(LOG_TAG, " startDtmf(" + c + ")");
Rlog.d(LOG_TAG, toString());
}
if (hasActiveFgCall()) {
getActiveFgCall().getPhone().startDtmf(c);
result = true;
}
if (VDBG) {
Rlog.d(LOG_TAG, "End startDtmf(" + c + ")");
Rlog.d(LOG_TAG, toString());
}
return result;
|
public void | stopDtmf()Stop the playing DTMF tone. Ignored if there is no playing DTMF
tone or no active call.
if (VDBG) {
Rlog.d(LOG_TAG, " stopDtmf()" );
Rlog.d(LOG_TAG, toString());
}
if (hasActiveFgCall()) getFgPhone().stopDtmf();
if (VDBG) {
Rlog.d(LOG_TAG, "End stopDtmf()");
Rlog.d(LOG_TAG, toString());
}
|
public void | switchHoldingAndActive(Call heldCall)Places active call on hold, and makes held call active.
Switch occurs asynchronously and may fail.
There are 4 scenarios
1. only active call but no held call, aka, hold
2. no active call but only held call, aka, unhold
3. both active and held calls from same phone, aka, swap
4. active and held calls from different phones, aka, phone swap
Final notification occurs via
{@link #registerForPreciseCallStateChanged(android.os.Handler, int,
java.lang.Object) registerForPreciseCallStateChanged()}.
Phone activePhone = null;
Phone heldPhone = null;
if (VDBG) {
Rlog.d(LOG_TAG, "switchHoldingAndActive(" +heldCall + ")");
Rlog.d(LOG_TAG, toString());
}
if (hasActiveFgCall()) {
activePhone = getActiveFgCall().getPhone();
}
if (heldCall != null) {
heldPhone = heldCall.getPhone();
}
if (activePhone != null) {
activePhone.switchHoldingAndActive();
}
if (heldPhone != null && heldPhone != activePhone) {
heldPhone.switchHoldingAndActive();
}
if (VDBG) {
Rlog.d(LOG_TAG, "End switchHoldingAndActive(" +heldCall + ")");
Rlog.d(LOG_TAG, toString());
}
|
public java.lang.String | toString()
Call call;
StringBuilder b = new StringBuilder();
for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
b.append("CallManager {");
b.append("\nstate = " + getState(i));
call = getActiveFgCall(i);
if (call != null) {
b.append("\n- Foreground: " + getActiveFgCallState(i));
b.append(" from " + call.getPhone());
b.append("\n Conn: ").append(getFgCallConnections(i));
}
call = getFirstActiveBgCall(i);
if (call != null) {
b.append("\n- Background: " + call.getState());
b.append(" from " + call.getPhone());
b.append("\n Conn: ").append(getBgCallConnections(i));
}
call = getFirstActiveRingingCall(i);
if (call != null) {
b.append("\n- Ringing: " +call.getState());
b.append(" from " + call.getPhone());
}
}
for (Phone phone : getAllPhones()) {
if (phone != null) {
b.append("\nPhone: " + phone + ", name = " + phone.getPhoneName()
+ ", state = " + phone.getState());
call = phone.getForegroundCall();
if (call != null) {
b.append("\n- Foreground: ").append(call);
}
call = phone.getBackgroundCall();
if (call != null) {
b.append(" Background: ").append(call);
}
call = phone.getRingingCall();
if (call != null) {
b.append(" Ringing: ").append(call);
}
}
}
b.append("\n}");
return b.toString();
|
public void | unregisterForCallWaiting(android.os.Handler h)Unregister for notifications when CDMA Call waiting comes
mCallWaitingRegistrants.remove(h);
|
public void | unregisterForCdmaOtaStatusChange(android.os.Handler h)Unregister for notifications when CDMA OTA Provision status change
mCdmaOtaStatusChangeRegistrants.remove(h);
|
public void | unregisterForDisconnect(android.os.Handler h)Unregisters for voice disconnection notification.
Extraneous calls are tolerated silently
mDisconnectRegistrants.remove(h);
|
public void | unregisterForDisplayInfo(android.os.Handler h)Unregisters for display information notifications.
Extraneous calls are tolerated silently
mDisplayInfoRegistrants.remove(h);
|
public void | unregisterForEcmTimerReset(android.os.Handler h)Unregister for notification for Ecm timer reset
mEcmTimerResetRegistrants.remove(h);
|
public void | unregisterForInCallVoicePrivacyOff(android.os.Handler h)Unregister for notifications when a sInCall VoicePrivacy is disabled
mInCallVoicePrivacyOffRegistrants.remove(h);
|
public void | unregisterForInCallVoicePrivacyOn(android.os.Handler h)Unregister for notifications when a sInCall VoicePrivacy is enabled
mInCallVoicePrivacyOnRegistrants.remove(h);
|
public void | unregisterForIncomingRing(android.os.Handler h)Unregisters for ring notification.
Extraneous calls are tolerated silently
mIncomingRingRegistrants.remove(h);
|
public void | unregisterForMmiComplete(android.os.Handler h)Unregisters for MMI complete notification.
Extraneous calls are tolerated silently
mMmiCompleteRegistrants.remove(h);
|
public void | unregisterForMmiInitiate(android.os.Handler h)Unregisters for new MMI initiate notification.
Extraneous calls are tolerated silently
mMmiInitiateRegistrants.remove(h);
|
public void | unregisterForNewRingingConnection(android.os.Handler h)Unregisters for new ringing connection notification.
Extraneous calls are tolerated silently
mNewRingingConnectionRegistrants.remove(h);
|
public void | unregisterForOnHoldTone(android.os.Handler h)Unregisters for on-hold tone notification.
mOnHoldToneRegistrants.remove(h);
|
private void | unregisterForPhoneStates(Phone phone)
// Make sure that we clean up our map of handlers to Phones.
CallManagerHandler handler = mHandlerMap.get(phone);
if (handler != null) {
Rlog.e(LOG_TAG, "Could not find Phone handler for unregistration");
return;
}
mHandlerMap.remove(phone);
// for common events supported by all phones
phone.unregisterForPreciseCallStateChanged(handler);
phone.unregisterForDisconnect(handler);
phone.unregisterForNewRingingConnection(handler);
phone.unregisterForUnknownConnection(handler);
phone.unregisterForIncomingRing(handler);
phone.unregisterForRingbackTone(handler);
phone.unregisterForInCallVoicePrivacyOn(handler);
phone.unregisterForInCallVoicePrivacyOff(handler);
phone.unregisterForDisplayInfo(handler);
phone.unregisterForSignalInfo(handler);
phone.unregisterForResendIncallMute(handler);
phone.unregisterForMmiInitiate(handler);
phone.unregisterForMmiComplete(handler);
phone.unregisterForSuppServiceFailed(handler);
phone.unregisterForServiceStateChanged(handler);
phone.unregisterForTtyModeReceived(handler);
// FIXME Taken from klp-sprout-dev but setAudioMode was removed in L.
//phone.unregisterForRadioOffOrNotAvailable(handler);
// for events supported only by GSM, CDMA and IMS phone
if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM ||
phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA ||
phone.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
phone.setOnPostDialCharacter(null, EVENT_POST_DIAL_CHARACTER, null);
}
// for events supported only by CDMA phone
if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA ){
phone.unregisterForCdmaOtaStatusChange(handler);
phone.unregisterForSubscriptionInfoReady(handler);
phone.unregisterForCallWaiting(handler);
phone.unregisterForEcmTimerReset(handler);
}
// for events supported only by IMS phone
if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
phone.unregisterForOnHoldTone(handler);
phone.unregisterForSuppServiceFailed(handler);
}
|
public void | unregisterForPostDialCharacter(android.os.Handler h)
mPostDialCharacterRegistrants.remove(h);
|
public void | unregisterForPreciseCallStateChanged(android.os.Handler h)Unregisters for voice call state change notifications.
Extraneous calls are tolerated silently.
mPreciseCallStateRegistrants.remove(h);
|
public void | unregisterForResendIncallMute(android.os.Handler h)Unregisters for resend incall mute notifications.
mResendIncallMuteRegistrants.remove(h);
|
public void | unregisterForRingbackTone(android.os.Handler h)Unregisters for ringback tone notification.
mRingbackToneRegistrants.remove(h);
|
public void | unregisterForServiceStateChanged(android.os.Handler h)Unregisters for ServiceStateChange notification.
Extraneous calls are tolerated silently
mServiceStateChangedRegistrants.remove(h);
|
public void | unregisterForSignalInfo(android.os.Handler h)Unregisters for signal information notifications.
Extraneous calls are tolerated silently
mSignalInfoRegistrants.remove(h);
|
public void | unregisterForSubscriptionInfoReady(android.os.Handler h)Unregister for notifications for subscription info
mSubscriptionInfoReadyRegistrants.remove(h);
|
public void | unregisterForSuppServiceFailed(android.os.Handler h)Unregister for notifications when a supplementary service attempt fails.
Extraneous calls are tolerated silently
mSuppServiceFailedRegistrants.remove(h);
|
public void | unregisterForTtyModeReceived(android.os.Handler h)Unregisters for TTY mode change notifications.
Extraneous calls are tolerated silently
mTtyModeReceivedRegistrants.remove(h);
|
public void | unregisterForUnknownConnection(android.os.Handler h)Unregisters for unknown connection notifications.
mUnknownConnectionRegistrants.remove(h);
|
public void | unregisterPhone(Phone phone)unregister phone from CallManager
Phone basePhone = getPhoneBase(phone);
if (basePhone != null && mPhones.contains(basePhone)) {
if (DBG) {
Rlog.d(LOG_TAG, "unregisterPhone(" +
phone.getPhoneName() + " " + phone + ")");
}
Phone vPhone = basePhone.getImsPhone();
if (vPhone != null) {
unregisterPhone(vPhone);
}
mPhones.remove(basePhone);
mRingingCalls.remove(basePhone.getRingingCall());
mBackgroundCalls.remove(basePhone.getBackgroundCall());
mForegroundCalls.remove(basePhone.getForegroundCall());
unregisterForPhoneStates(basePhone);
if (basePhone == mDefaultPhone) {
if (mPhones.isEmpty()) {
mDefaultPhone = null;
} else {
mDefaultPhone = mPhones.get(0);
}
}
}
|