Loading src/java/com/android/internal/telephony/BaseCommands.java +42 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.internal.telephony; import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.os.AsyncResult; import android.os.Handler; Loading @@ -30,8 +31,10 @@ import android.telephony.TelephonyManager; */ public abstract class BaseCommands implements CommandsInterface { //***** Instance Variables @UnsupportedAppUsage protected Context mContext; protected int mState = TelephonyManager.RADIO_POWER_UNAVAILABLE; @UnsupportedAppUsage protected Object mStateMonitor = new Object(); protected RegistrantList mRadioStateChangedRegistrants = new RegistrantList(); Loading @@ -39,17 +42,24 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mAvailRegistrants = new RegistrantList(); protected RegistrantList mOffOrNotAvailRegistrants = new RegistrantList(); protected RegistrantList mNotAvailRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mCallStateRegistrants = new RegistrantList(); protected RegistrantList mNetworkStateRegistrants = new RegistrantList(); protected RegistrantList mDataCallListChangedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mVoiceRadioTechChangedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mImsNetworkStateChangedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mIccStatusChangedRegistrants = new RegistrantList(); protected RegistrantList mIccSlotStatusChangedRegistrants = new RegistrantList(); protected RegistrantList mVoicePrivacyOnRegistrants = new RegistrantList(); protected RegistrantList mVoicePrivacyOffRegistrants = new RegistrantList(); @UnsupportedAppUsage protected Registrant mUnsolOemHookRawRegistrant; @UnsupportedAppUsage protected RegistrantList mOtaProvisionRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mCallWaitingInfoRegistrants = new RegistrantList(); protected RegistrantList mDisplayInfoRegistrants = new RegistrantList(); protected RegistrantList mSignalInfoRegistrants = new RegistrantList(); Loading @@ -58,17 +68,28 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mLineControlInfoRegistrants = new RegistrantList(); protected RegistrantList mT53ClirInfoRegistrants = new RegistrantList(); protected RegistrantList mT53AudCntrlInfoRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mRingbackToneRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mResendIncallMuteRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mCdmaSubscriptionChangedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mCdmaPrlChangedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mExitEmergencyCallbackModeRegistrants = new RegistrantList(); protected RegistrantList mRilConnectedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mIccRefreshRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mRilCellInfoListRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mSubscriptionStatusRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mSrvccStateRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mHardwareConfigChangeRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mPhoneRadioCapabilityChangedRegistrants = new RegistrantList(); protected RegistrantList mPcoDataRegistrants = new RegistrantList(); Loading @@ -80,33 +101,54 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mLceInfoRegistrants = new RegistrantList(); protected RegistrantList mEmergencyNumberListRegistrants = new RegistrantList(); @UnsupportedAppUsage protected Registrant mGsmSmsRegistrant; @UnsupportedAppUsage protected Registrant mCdmaSmsRegistrant; @UnsupportedAppUsage protected Registrant mNITZTimeRegistrant; @UnsupportedAppUsage protected Registrant mSignalStrengthRegistrant; @UnsupportedAppUsage protected Registrant mUSSDRegistrant; @UnsupportedAppUsage protected Registrant mSmsOnSimRegistrant; @UnsupportedAppUsage protected Registrant mSmsStatusRegistrant; @UnsupportedAppUsage protected Registrant mSsnRegistrant; @UnsupportedAppUsage protected Registrant mCatSessionEndRegistrant; @UnsupportedAppUsage protected Registrant mCatProCmdRegistrant; @UnsupportedAppUsage protected Registrant mCatEventRegistrant; @UnsupportedAppUsage protected Registrant mCatCallSetUpRegistrant; @UnsupportedAppUsage protected Registrant mIccSmsFullRegistrant; @UnsupportedAppUsage protected Registrant mEmergencyCallbackModeRegistrant; @UnsupportedAppUsage protected Registrant mRingRegistrant; @UnsupportedAppUsage protected Registrant mRestrictedStateRegistrant; @UnsupportedAppUsage protected Registrant mGsmBroadcastSmsRegistrant; @UnsupportedAppUsage protected Registrant mCatCcAlphaRegistrant; @UnsupportedAppUsage protected Registrant mSsRegistrant; // Preferred network type received from PhoneFactory. // This is used when establishing a connection to the // vendor ril so it starts up in the correct mode. @UnsupportedAppUsage protected int mPreferredNetworkType; // CDMA subscription received from PhoneFactory protected int mCdmaSubscription; // Type of Phone, GSM or CDMA. Set by GsmCdmaPhone. @UnsupportedAppUsage protected int mPhoneType; // RIL Version protected int mRilVersion = -1; Loading src/java/com/android/internal/telephony/Call.java +14 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.telecom.ConferenceParticipant; import java.util.ArrayList; import java.util.List; import android.annotation.UnsupportedAppUsage; import android.telephony.Rlog; /** Loading @@ -32,12 +33,15 @@ public abstract class Call { /* Enums */ public enum State { @UnsupportedAppUsage IDLE, ACTIVE, HOLDING, DIALING, ALERTING, INCOMING, WAITING, DISCONNECTED, DISCONNECTING; @UnsupportedAppUsage public boolean isAlive() { return !(this == IDLE || this == DISCONNECTED || this == DISCONNECTING); } @UnsupportedAppUsage public boolean isRinging() { return this == INCOMING || this == WAITING; } Loading Loading @@ -66,8 +70,10 @@ public abstract class Call { /* Instance Variables */ @UnsupportedAppUsage public State mState = State.IDLE; @UnsupportedAppUsage public ArrayList<Connection> mConnections = new ArrayList<Connection>(); /* Instance Methods */ Loading @@ -76,9 +82,13 @@ public abstract class Call { * It will change across event loop iterations top */ @UnsupportedAppUsage public abstract List<Connection> getConnections(); @UnsupportedAppUsage public abstract Phone getPhone(); @UnsupportedAppUsage public abstract boolean isMultiparty(); @UnsupportedAppUsage public abstract void hangup() throws CallStateException; Loading Loading @@ -110,6 +120,7 @@ public abstract class Call { * getState * @return state of class call */ @UnsupportedAppUsage public State getState() { return mState; } Loading @@ -128,6 +139,7 @@ public abstract class Call { * FIXME rename * @return true if the call contains only disconnected connections (if any) */ @UnsupportedAppUsage public boolean isIdle() { return !getState().isAlive(); } Loading @@ -136,6 +148,7 @@ public abstract class Call { * Returns the Connection associated with this Call that was created * first, or null if there are no Connections in this Call */ @UnsupportedAppUsage public Connection getEarliestConnection() { List<Connection> l; Loading Loading @@ -223,6 +236,7 @@ public abstract class Call { * Returns the Connection associated with this Call that was created * last, or null if there are no Connections in this Call */ @UnsupportedAppUsage public Connection getLatestConnection() { List<Connection> l = getConnections(); Loading src/java/com/android/internal/telephony/CallForwardInfo.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.internal.telephony; import android.annotation.UnsupportedAppUsage; import android.telecom.Log; /** Loading @@ -26,11 +27,17 @@ import android.telecom.Log; public class CallForwardInfo { private static final String TAG = "CallForwardInfo"; @UnsupportedAppUsage public int status; /*1 = active, 0 = not active */ @UnsupportedAppUsage public int reason; /* from TS 27.007 7.11 "reason" */ @UnsupportedAppUsage public int serviceClass; /* Saum of CommandsInterface.SERVICE_CLASS */ @UnsupportedAppUsage public int toa; /* "type" from TS 27.007 7.11 */ @UnsupportedAppUsage public String number; /* "number" from TS 27.007 7.11 */ @UnsupportedAppUsage public int timeSeconds; /* for CF no reply only */ @Override Loading src/java/com/android/internal/telephony/CallManager.java +44 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.internal.telephony; import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.os.AsyncResult; import android.os.Handler; Loading Loading @@ -89,18 +90,23 @@ public class CallManager { private static final CallManager INSTANCE = new CallManager(); // list of registered phones, which are Phone objs @UnsupportedAppUsage private final ArrayList<Phone> mPhones; // list of supported ringing calls @UnsupportedAppUsage private final ArrayList<Call> mRingingCalls; // list of supported background calls @UnsupportedAppUsage private final ArrayList<Call> mBackgroundCalls; // list of supported foreground calls @UnsupportedAppUsage private final ArrayList<Call> mForegroundCalls; // empty connection list @UnsupportedAppUsage private final ArrayList<Connection> mEmptyConnections = new ArrayList<Connection>(); // mapping of phones to registered handler instances used for callbacks from RIL Loading Loading @@ -197,6 +203,7 @@ public class CallManager { * get singleton instance of CallManager * @return CallManager */ @UnsupportedAppUsage public static CallManager getInstance() { return INSTANCE; } Loading @@ -223,6 +230,7 @@ public class CallManager { * then the phone state is RINGING not OFFHOOK * */ @UnsupportedAppUsage public PhoneConstants.State getState() { PhoneConstants.State s = PhoneConstants.State.IDLE; Loading @@ -242,6 +250,7 @@ public class CallManager { * then the phone state is RINGING not OFFHOOK * */ @UnsupportedAppUsage public PhoneConstants.State getState(int subId) { PhoneConstants.State s = PhoneConstants.State.IDLE; Loading Loading @@ -325,6 +334,7 @@ public class CallManager { /** * @return the phone associated with any call */ @UnsupportedAppUsage public Phone getPhoneInCall() { Phone phone = null; if (!getFirstActiveRingingCall().isIdle()) { Loading @@ -343,6 +353,7 @@ public class CallManager { * @param phone to be registered * @return true if register successfully */ @UnsupportedAppUsage public boolean registerPhone(Phone phone) { if (phone != null && !mPhones.contains(phone)) { Loading @@ -368,6 +379,7 @@ public class CallManager { * unregister phone from CallManager * @param phone to be unregistered */ @UnsupportedAppUsage public void unregisterPhone(Phone phone) { if (phone != null && mPhones.contains(phone)) { Loading Loading @@ -399,6 +411,7 @@ public class CallManager { /** * return the default phone or null if no phone available */ @UnsupportedAppUsage public Phone getDefaultPhone() { return mDefaultPhone; } Loading @@ -406,6 +419,7 @@ public class CallManager { /** * @return the phone associated with the foreground call */ @UnsupportedAppUsage public Phone getFgPhone() { return getActiveFgCall().getPhone(); } Loading @@ -414,6 +428,7 @@ public class CallManager { * @return the phone associated with the foreground call * of a particular subId */ @UnsupportedAppUsage public Phone getFgPhone(int subId) { return getActiveFgCall(subId).getPhone(); } Loading @@ -421,6 +436,7 @@ public class CallManager { /** * @return the phone associated with the background call */ @UnsupportedAppUsage public Phone getBgPhone() { return getFirstActiveBgCall().getPhone(); } Loading @@ -428,6 +444,7 @@ public class CallManager { /** * @return the phone associated with the ringing call */ @UnsupportedAppUsage public Phone getRingingPhone() { return getFirstActiveRingingCall().getPhone(); } Loading Loading @@ -515,6 +532,7 @@ public class CallManager { } */ @UnsupportedAppUsage private Context getContext() { Phone defaultPhone = getDefaultPhone(); return ((defaultPhone == null) ? null : defaultPhone.getContext()); Loading Loading @@ -686,6 +704,7 @@ public class CallManager { * to the provided subId. * @return true if the phone can conference; false otherwise. */ @UnsupportedAppUsage public boolean canConference(Call heldCall, int subId) { Phone activePhone = null; Phone heldPhone = null; Loading @@ -710,6 +729,7 @@ public class CallManager { * @exception CallStateException if canConference() would return false. * In these cases, this operation may not be performed. */ @UnsupportedAppUsage public void conference(Call heldCall) throws CallStateException { int subId = heldCall.getPhone().getSubId(); Loading Loading @@ -858,6 +878,7 @@ public class CallManager { * @param phone * @return true if the phone can make a new call */ @UnsupportedAppUsage private boolean canDial(Phone phone) { int serviceState = phone.getServiceState().getState(); int subId = phone.getSubId(); Loading Loading @@ -1148,6 +1169,7 @@ public class CallManager { * <li>AsyncResult.result = a Connection object that is * no longer connected.</li></ul> */ @UnsupportedAppUsage public void registerForDisconnect(Handler h, int what, Object obj) { mDisconnectRegistrants.addUnique(h, what, obj); } Loading @@ -1156,6 +1178,7 @@ public class CallManager { * Unregisters for voice disconnection notification. * Extraneous calls are tolerated silently */ @UnsupportedAppUsage public void unregisterForDisconnect(Handler h){ mDisconnectRegistrants.remove(h); } Loading @@ -1169,6 +1192,7 @@ public class CallManager { * AsyncResult.userData will be set to the obj argument here. * The <em>h</em> parameter is held only by a weak reference. */ @UnsupportedAppUsage public void registerForPreciseCallStateChanged(Handler h, int what, Object obj){ mPreciseCallStateRegistrants.addUnique(h, what, obj); } Loading @@ -1177,6 +1201,7 @@ public class CallManager { * Unregisters for voice call state change notifications. * Extraneous calls are tolerated silently. */ @UnsupportedAppUsage public void unregisterForPreciseCallStateChanged(Handler h){ mPreciseCallStateRegistrants.remove(h); } Loading Loading @@ -1209,6 +1234,7 @@ public class CallManager { * If Connection.isRinging() is true, then * Connection.getCall() == Phone.getRingingCall() */ @UnsupportedAppUsage public void registerForNewRingingConnection(Handler h, int what, Object obj){ mNewRingingConnectionRegistrants.addUnique(h, what, obj); } Loading @@ -1218,6 +1244,7 @@ public class CallManager { * Extraneous calls are tolerated silently */ @UnsupportedAppUsage public void unregisterForNewRingingConnection(Handler h){ mNewRingingConnectionRegistrants.remove(h); } Loading Loading @@ -1620,6 +1647,7 @@ public class CallManager { /** * @return list of all ringing calls */ @UnsupportedAppUsage public List<Call> getRingingCalls() { return Collections.unmodifiableList(mRingingCalls); } Loading @@ -1634,6 +1662,7 @@ public class CallManager { /** * @return list of all background calls */ @UnsupportedAppUsage public List<Call> getBackgroundCalls() { return Collections.unmodifiableList(mBackgroundCalls); } Loading @@ -1641,6 +1670,7 @@ public class CallManager { /** * Return true if there is at least one active foreground call */ @UnsupportedAppUsage public boolean hasActiveFgCall() { return (getFirstActiveCall(mForegroundCalls) != null); } Loading @@ -1649,6 +1679,7 @@ public class CallManager { * Return true if there is at least one active foreground call * on a particular subId or an active sip call */ @UnsupportedAppUsage public boolean hasActiveFgCall(int subId) { return (getFirstActiveCall(mForegroundCalls, subId) != null); } Loading @@ -1656,6 +1687,7 @@ public class CallManager { /** * Return true if there is at least one active background call */ @UnsupportedAppUsage public boolean hasActiveBgCall() { // TODO since hasActiveBgCall may get called often // better to cache it to improve performance Loading @@ -1666,6 +1698,7 @@ public class CallManager { * Return true if there is at least one active background call * on a particular subId or an active sip call */ @UnsupportedAppUsage public boolean hasActiveBgCall(int subId) { // TODO since hasActiveBgCall may get called often // better to cache it to improve performance Loading @@ -1683,6 +1716,7 @@ public class CallManager { /** * Return true if there is at least one active ringing call */ @UnsupportedAppUsage public boolean hasActiveRingingCall(int subId) { return (getFirstActiveCall(mRingingCalls, subId) != null); } Loading @@ -1708,6 +1742,7 @@ public class CallManager { return call; } @UnsupportedAppUsage public Call getActiveFgCall(int subId) { Call call = getFirstNonIdleCall(mForegroundCalls, subId); if (call == null) { Loading Loading @@ -1763,6 +1798,7 @@ public class CallManager { * * Complete background calls list can be get by getBackgroundCalls() */ @UnsupportedAppUsage public Call getFirstActiveBgCall() { Call call = getFirstNonIdleCall(mBackgroundCalls); if (call == null) { Loading @@ -1787,6 +1823,7 @@ public class CallManager { * * Complete background calls list can be get by getBackgroundCalls() */ @UnsupportedAppUsage public Call getFirstActiveBgCall(int subId) { Phone phone = getPhone(subId); if (hasMoreThanOneHoldingCall(subId)) { Loading Loading @@ -1815,6 +1852,7 @@ public class CallManager { * * Complete ringing calls list can be get by getRingingCalls() */ @UnsupportedAppUsage public Call getFirstActiveRingingCall() { Call call = getFirstNonIdleCall(mRingingCalls); if (call == null) { Loading @@ -1825,6 +1863,7 @@ public class CallManager { return call; } @UnsupportedAppUsage public Call getFirstActiveRingingCall(int subId) { Phone phone = getPhone(subId); Call call = getFirstNonIdleCall(mRingingCalls, subId); Loading @@ -1850,6 +1889,7 @@ public class CallManager { return Call.State.IDLE; } @UnsupportedAppUsage public Call.State getActiveFgCallState(int subId) { Call fgCall = getActiveFgCall(subId); Loading @@ -1864,6 +1904,7 @@ public class CallManager { * @return the connections of active foreground call * return empty list if there is no active foreground call */ @UnsupportedAppUsage public List<Connection> getFgCallConnections() { Call fgCall = getActiveFgCall(); if ( fgCall != null) { Loading @@ -1888,6 +1929,7 @@ public class CallManager { * @return the connections of active background call * return empty list if there is no active background call */ @UnsupportedAppUsage public List<Connection> getBgCallConnections() { Call bgCall = getFirstActiveBgCall(); if ( bgCall != null) { Loading Loading @@ -1979,6 +2021,7 @@ public class CallManager { return null; } @UnsupportedAppUsage private boolean hasMoreThanOneRingingCall() { int count = 0; for (Call call : mRingingCalls) { Loading @@ -1996,6 +2039,7 @@ public class CallManager { * subId and also active calls on SIP Phone. * */ @UnsupportedAppUsage private boolean hasMoreThanOneRingingCall(int subId) { int count = 0; for (Call call : mRingingCalls) { Loading src/java/com/android/internal/telephony/CallStateException.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.telephony; import android.annotation.UnsupportedAppUsage; /** * {@hide} */ Loading @@ -39,6 +41,7 @@ public class CallStateException extends Exception { } @UnsupportedAppUsage public CallStateException(String string) { Loading Loading
src/java/com/android/internal/telephony/BaseCommands.java +42 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.internal.telephony; import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.os.AsyncResult; import android.os.Handler; Loading @@ -30,8 +31,10 @@ import android.telephony.TelephonyManager; */ public abstract class BaseCommands implements CommandsInterface { //***** Instance Variables @UnsupportedAppUsage protected Context mContext; protected int mState = TelephonyManager.RADIO_POWER_UNAVAILABLE; @UnsupportedAppUsage protected Object mStateMonitor = new Object(); protected RegistrantList mRadioStateChangedRegistrants = new RegistrantList(); Loading @@ -39,17 +42,24 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mAvailRegistrants = new RegistrantList(); protected RegistrantList mOffOrNotAvailRegistrants = new RegistrantList(); protected RegistrantList mNotAvailRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mCallStateRegistrants = new RegistrantList(); protected RegistrantList mNetworkStateRegistrants = new RegistrantList(); protected RegistrantList mDataCallListChangedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mVoiceRadioTechChangedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mImsNetworkStateChangedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mIccStatusChangedRegistrants = new RegistrantList(); protected RegistrantList mIccSlotStatusChangedRegistrants = new RegistrantList(); protected RegistrantList mVoicePrivacyOnRegistrants = new RegistrantList(); protected RegistrantList mVoicePrivacyOffRegistrants = new RegistrantList(); @UnsupportedAppUsage protected Registrant mUnsolOemHookRawRegistrant; @UnsupportedAppUsage protected RegistrantList mOtaProvisionRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mCallWaitingInfoRegistrants = new RegistrantList(); protected RegistrantList mDisplayInfoRegistrants = new RegistrantList(); protected RegistrantList mSignalInfoRegistrants = new RegistrantList(); Loading @@ -58,17 +68,28 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mLineControlInfoRegistrants = new RegistrantList(); protected RegistrantList mT53ClirInfoRegistrants = new RegistrantList(); protected RegistrantList mT53AudCntrlInfoRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mRingbackToneRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mResendIncallMuteRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mCdmaSubscriptionChangedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mCdmaPrlChangedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mExitEmergencyCallbackModeRegistrants = new RegistrantList(); protected RegistrantList mRilConnectedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mIccRefreshRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mRilCellInfoListRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mSubscriptionStatusRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mSrvccStateRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mHardwareConfigChangeRegistrants = new RegistrantList(); @UnsupportedAppUsage protected RegistrantList mPhoneRadioCapabilityChangedRegistrants = new RegistrantList(); protected RegistrantList mPcoDataRegistrants = new RegistrantList(); Loading @@ -80,33 +101,54 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mLceInfoRegistrants = new RegistrantList(); protected RegistrantList mEmergencyNumberListRegistrants = new RegistrantList(); @UnsupportedAppUsage protected Registrant mGsmSmsRegistrant; @UnsupportedAppUsage protected Registrant mCdmaSmsRegistrant; @UnsupportedAppUsage protected Registrant mNITZTimeRegistrant; @UnsupportedAppUsage protected Registrant mSignalStrengthRegistrant; @UnsupportedAppUsage protected Registrant mUSSDRegistrant; @UnsupportedAppUsage protected Registrant mSmsOnSimRegistrant; @UnsupportedAppUsage protected Registrant mSmsStatusRegistrant; @UnsupportedAppUsage protected Registrant mSsnRegistrant; @UnsupportedAppUsage protected Registrant mCatSessionEndRegistrant; @UnsupportedAppUsage protected Registrant mCatProCmdRegistrant; @UnsupportedAppUsage protected Registrant mCatEventRegistrant; @UnsupportedAppUsage protected Registrant mCatCallSetUpRegistrant; @UnsupportedAppUsage protected Registrant mIccSmsFullRegistrant; @UnsupportedAppUsage protected Registrant mEmergencyCallbackModeRegistrant; @UnsupportedAppUsage protected Registrant mRingRegistrant; @UnsupportedAppUsage protected Registrant mRestrictedStateRegistrant; @UnsupportedAppUsage protected Registrant mGsmBroadcastSmsRegistrant; @UnsupportedAppUsage protected Registrant mCatCcAlphaRegistrant; @UnsupportedAppUsage protected Registrant mSsRegistrant; // Preferred network type received from PhoneFactory. // This is used when establishing a connection to the // vendor ril so it starts up in the correct mode. @UnsupportedAppUsage protected int mPreferredNetworkType; // CDMA subscription received from PhoneFactory protected int mCdmaSubscription; // Type of Phone, GSM or CDMA. Set by GsmCdmaPhone. @UnsupportedAppUsage protected int mPhoneType; // RIL Version protected int mRilVersion = -1; Loading
src/java/com/android/internal/telephony/Call.java +14 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.telecom.ConferenceParticipant; import java.util.ArrayList; import java.util.List; import android.annotation.UnsupportedAppUsage; import android.telephony.Rlog; /** Loading @@ -32,12 +33,15 @@ public abstract class Call { /* Enums */ public enum State { @UnsupportedAppUsage IDLE, ACTIVE, HOLDING, DIALING, ALERTING, INCOMING, WAITING, DISCONNECTED, DISCONNECTING; @UnsupportedAppUsage public boolean isAlive() { return !(this == IDLE || this == DISCONNECTED || this == DISCONNECTING); } @UnsupportedAppUsage public boolean isRinging() { return this == INCOMING || this == WAITING; } Loading Loading @@ -66,8 +70,10 @@ public abstract class Call { /* Instance Variables */ @UnsupportedAppUsage public State mState = State.IDLE; @UnsupportedAppUsage public ArrayList<Connection> mConnections = new ArrayList<Connection>(); /* Instance Methods */ Loading @@ -76,9 +82,13 @@ public abstract class Call { * It will change across event loop iterations top */ @UnsupportedAppUsage public abstract List<Connection> getConnections(); @UnsupportedAppUsage public abstract Phone getPhone(); @UnsupportedAppUsage public abstract boolean isMultiparty(); @UnsupportedAppUsage public abstract void hangup() throws CallStateException; Loading Loading @@ -110,6 +120,7 @@ public abstract class Call { * getState * @return state of class call */ @UnsupportedAppUsage public State getState() { return mState; } Loading @@ -128,6 +139,7 @@ public abstract class Call { * FIXME rename * @return true if the call contains only disconnected connections (if any) */ @UnsupportedAppUsage public boolean isIdle() { return !getState().isAlive(); } Loading @@ -136,6 +148,7 @@ public abstract class Call { * Returns the Connection associated with this Call that was created * first, or null if there are no Connections in this Call */ @UnsupportedAppUsage public Connection getEarliestConnection() { List<Connection> l; Loading Loading @@ -223,6 +236,7 @@ public abstract class Call { * Returns the Connection associated with this Call that was created * last, or null if there are no Connections in this Call */ @UnsupportedAppUsage public Connection getLatestConnection() { List<Connection> l = getConnections(); Loading
src/java/com/android/internal/telephony/CallForwardInfo.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.internal.telephony; import android.annotation.UnsupportedAppUsage; import android.telecom.Log; /** Loading @@ -26,11 +27,17 @@ import android.telecom.Log; public class CallForwardInfo { private static final String TAG = "CallForwardInfo"; @UnsupportedAppUsage public int status; /*1 = active, 0 = not active */ @UnsupportedAppUsage public int reason; /* from TS 27.007 7.11 "reason" */ @UnsupportedAppUsage public int serviceClass; /* Saum of CommandsInterface.SERVICE_CLASS */ @UnsupportedAppUsage public int toa; /* "type" from TS 27.007 7.11 */ @UnsupportedAppUsage public String number; /* "number" from TS 27.007 7.11 */ @UnsupportedAppUsage public int timeSeconds; /* for CF no reply only */ @Override Loading
src/java/com/android/internal/telephony/CallManager.java +44 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.internal.telephony; import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.os.AsyncResult; import android.os.Handler; Loading Loading @@ -89,18 +90,23 @@ public class CallManager { private static final CallManager INSTANCE = new CallManager(); // list of registered phones, which are Phone objs @UnsupportedAppUsage private final ArrayList<Phone> mPhones; // list of supported ringing calls @UnsupportedAppUsage private final ArrayList<Call> mRingingCalls; // list of supported background calls @UnsupportedAppUsage private final ArrayList<Call> mBackgroundCalls; // list of supported foreground calls @UnsupportedAppUsage private final ArrayList<Call> mForegroundCalls; // empty connection list @UnsupportedAppUsage private final ArrayList<Connection> mEmptyConnections = new ArrayList<Connection>(); // mapping of phones to registered handler instances used for callbacks from RIL Loading Loading @@ -197,6 +203,7 @@ public class CallManager { * get singleton instance of CallManager * @return CallManager */ @UnsupportedAppUsage public static CallManager getInstance() { return INSTANCE; } Loading @@ -223,6 +230,7 @@ public class CallManager { * then the phone state is RINGING not OFFHOOK * */ @UnsupportedAppUsage public PhoneConstants.State getState() { PhoneConstants.State s = PhoneConstants.State.IDLE; Loading @@ -242,6 +250,7 @@ public class CallManager { * then the phone state is RINGING not OFFHOOK * */ @UnsupportedAppUsage public PhoneConstants.State getState(int subId) { PhoneConstants.State s = PhoneConstants.State.IDLE; Loading Loading @@ -325,6 +334,7 @@ public class CallManager { /** * @return the phone associated with any call */ @UnsupportedAppUsage public Phone getPhoneInCall() { Phone phone = null; if (!getFirstActiveRingingCall().isIdle()) { Loading @@ -343,6 +353,7 @@ public class CallManager { * @param phone to be registered * @return true if register successfully */ @UnsupportedAppUsage public boolean registerPhone(Phone phone) { if (phone != null && !mPhones.contains(phone)) { Loading @@ -368,6 +379,7 @@ public class CallManager { * unregister phone from CallManager * @param phone to be unregistered */ @UnsupportedAppUsage public void unregisterPhone(Phone phone) { if (phone != null && mPhones.contains(phone)) { Loading Loading @@ -399,6 +411,7 @@ public class CallManager { /** * return the default phone or null if no phone available */ @UnsupportedAppUsage public Phone getDefaultPhone() { return mDefaultPhone; } Loading @@ -406,6 +419,7 @@ public class CallManager { /** * @return the phone associated with the foreground call */ @UnsupportedAppUsage public Phone getFgPhone() { return getActiveFgCall().getPhone(); } Loading @@ -414,6 +428,7 @@ public class CallManager { * @return the phone associated with the foreground call * of a particular subId */ @UnsupportedAppUsage public Phone getFgPhone(int subId) { return getActiveFgCall(subId).getPhone(); } Loading @@ -421,6 +436,7 @@ public class CallManager { /** * @return the phone associated with the background call */ @UnsupportedAppUsage public Phone getBgPhone() { return getFirstActiveBgCall().getPhone(); } Loading @@ -428,6 +444,7 @@ public class CallManager { /** * @return the phone associated with the ringing call */ @UnsupportedAppUsage public Phone getRingingPhone() { return getFirstActiveRingingCall().getPhone(); } Loading Loading @@ -515,6 +532,7 @@ public class CallManager { } */ @UnsupportedAppUsage private Context getContext() { Phone defaultPhone = getDefaultPhone(); return ((defaultPhone == null) ? null : defaultPhone.getContext()); Loading Loading @@ -686,6 +704,7 @@ public class CallManager { * to the provided subId. * @return true if the phone can conference; false otherwise. */ @UnsupportedAppUsage public boolean canConference(Call heldCall, int subId) { Phone activePhone = null; Phone heldPhone = null; Loading @@ -710,6 +729,7 @@ public class CallManager { * @exception CallStateException if canConference() would return false. * In these cases, this operation may not be performed. */ @UnsupportedAppUsage public void conference(Call heldCall) throws CallStateException { int subId = heldCall.getPhone().getSubId(); Loading Loading @@ -858,6 +878,7 @@ public class CallManager { * @param phone * @return true if the phone can make a new call */ @UnsupportedAppUsage private boolean canDial(Phone phone) { int serviceState = phone.getServiceState().getState(); int subId = phone.getSubId(); Loading Loading @@ -1148,6 +1169,7 @@ public class CallManager { * <li>AsyncResult.result = a Connection object that is * no longer connected.</li></ul> */ @UnsupportedAppUsage public void registerForDisconnect(Handler h, int what, Object obj) { mDisconnectRegistrants.addUnique(h, what, obj); } Loading @@ -1156,6 +1178,7 @@ public class CallManager { * Unregisters for voice disconnection notification. * Extraneous calls are tolerated silently */ @UnsupportedAppUsage public void unregisterForDisconnect(Handler h){ mDisconnectRegistrants.remove(h); } Loading @@ -1169,6 +1192,7 @@ public class CallManager { * AsyncResult.userData will be set to the obj argument here. * The <em>h</em> parameter is held only by a weak reference. */ @UnsupportedAppUsage public void registerForPreciseCallStateChanged(Handler h, int what, Object obj){ mPreciseCallStateRegistrants.addUnique(h, what, obj); } Loading @@ -1177,6 +1201,7 @@ public class CallManager { * Unregisters for voice call state change notifications. * Extraneous calls are tolerated silently. */ @UnsupportedAppUsage public void unregisterForPreciseCallStateChanged(Handler h){ mPreciseCallStateRegistrants.remove(h); } Loading Loading @@ -1209,6 +1234,7 @@ public class CallManager { * If Connection.isRinging() is true, then * Connection.getCall() == Phone.getRingingCall() */ @UnsupportedAppUsage public void registerForNewRingingConnection(Handler h, int what, Object obj){ mNewRingingConnectionRegistrants.addUnique(h, what, obj); } Loading @@ -1218,6 +1244,7 @@ public class CallManager { * Extraneous calls are tolerated silently */ @UnsupportedAppUsage public void unregisterForNewRingingConnection(Handler h){ mNewRingingConnectionRegistrants.remove(h); } Loading Loading @@ -1620,6 +1647,7 @@ public class CallManager { /** * @return list of all ringing calls */ @UnsupportedAppUsage public List<Call> getRingingCalls() { return Collections.unmodifiableList(mRingingCalls); } Loading @@ -1634,6 +1662,7 @@ public class CallManager { /** * @return list of all background calls */ @UnsupportedAppUsage public List<Call> getBackgroundCalls() { return Collections.unmodifiableList(mBackgroundCalls); } Loading @@ -1641,6 +1670,7 @@ public class CallManager { /** * Return true if there is at least one active foreground call */ @UnsupportedAppUsage public boolean hasActiveFgCall() { return (getFirstActiveCall(mForegroundCalls) != null); } Loading @@ -1649,6 +1679,7 @@ public class CallManager { * Return true if there is at least one active foreground call * on a particular subId or an active sip call */ @UnsupportedAppUsage public boolean hasActiveFgCall(int subId) { return (getFirstActiveCall(mForegroundCalls, subId) != null); } Loading @@ -1656,6 +1687,7 @@ public class CallManager { /** * Return true if there is at least one active background call */ @UnsupportedAppUsage public boolean hasActiveBgCall() { // TODO since hasActiveBgCall may get called often // better to cache it to improve performance Loading @@ -1666,6 +1698,7 @@ public class CallManager { * Return true if there is at least one active background call * on a particular subId or an active sip call */ @UnsupportedAppUsage public boolean hasActiveBgCall(int subId) { // TODO since hasActiveBgCall may get called often // better to cache it to improve performance Loading @@ -1683,6 +1716,7 @@ public class CallManager { /** * Return true if there is at least one active ringing call */ @UnsupportedAppUsage public boolean hasActiveRingingCall(int subId) { return (getFirstActiveCall(mRingingCalls, subId) != null); } Loading @@ -1708,6 +1742,7 @@ public class CallManager { return call; } @UnsupportedAppUsage public Call getActiveFgCall(int subId) { Call call = getFirstNonIdleCall(mForegroundCalls, subId); if (call == null) { Loading Loading @@ -1763,6 +1798,7 @@ public class CallManager { * * Complete background calls list can be get by getBackgroundCalls() */ @UnsupportedAppUsage public Call getFirstActiveBgCall() { Call call = getFirstNonIdleCall(mBackgroundCalls); if (call == null) { Loading @@ -1787,6 +1823,7 @@ public class CallManager { * * Complete background calls list can be get by getBackgroundCalls() */ @UnsupportedAppUsage public Call getFirstActiveBgCall(int subId) { Phone phone = getPhone(subId); if (hasMoreThanOneHoldingCall(subId)) { Loading Loading @@ -1815,6 +1852,7 @@ public class CallManager { * * Complete ringing calls list can be get by getRingingCalls() */ @UnsupportedAppUsage public Call getFirstActiveRingingCall() { Call call = getFirstNonIdleCall(mRingingCalls); if (call == null) { Loading @@ -1825,6 +1863,7 @@ public class CallManager { return call; } @UnsupportedAppUsage public Call getFirstActiveRingingCall(int subId) { Phone phone = getPhone(subId); Call call = getFirstNonIdleCall(mRingingCalls, subId); Loading @@ -1850,6 +1889,7 @@ public class CallManager { return Call.State.IDLE; } @UnsupportedAppUsage public Call.State getActiveFgCallState(int subId) { Call fgCall = getActiveFgCall(subId); Loading @@ -1864,6 +1904,7 @@ public class CallManager { * @return the connections of active foreground call * return empty list if there is no active foreground call */ @UnsupportedAppUsage public List<Connection> getFgCallConnections() { Call fgCall = getActiveFgCall(); if ( fgCall != null) { Loading @@ -1888,6 +1929,7 @@ public class CallManager { * @return the connections of active background call * return empty list if there is no active background call */ @UnsupportedAppUsage public List<Connection> getBgCallConnections() { Call bgCall = getFirstActiveBgCall(); if ( bgCall != null) { Loading Loading @@ -1979,6 +2021,7 @@ public class CallManager { return null; } @UnsupportedAppUsage private boolean hasMoreThanOneRingingCall() { int count = 0; for (Call call : mRingingCalls) { Loading @@ -1996,6 +2039,7 @@ public class CallManager { * subId and also active calls on SIP Phone. * */ @UnsupportedAppUsage private boolean hasMoreThanOneRingingCall(int subId) { int count = 0; for (Call call : mRingingCalls) { Loading
src/java/com/android/internal/telephony/CallStateException.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.telephony; import android.annotation.UnsupportedAppUsage; /** * {@hide} */ Loading @@ -39,6 +41,7 @@ public class CallStateException extends Exception { } @UnsupportedAppUsage public CallStateException(String string) { Loading