Loading src/java/com/android/internal/telephony/Connection.java +4 −42 Original line number Original line Diff line number Diff line Loading @@ -30,46 +30,6 @@ public abstract class Connection { private static String LOG_TAG = "Connection"; private static String LOG_TAG = "Connection"; public enum DisconnectCause { NOT_DISCONNECTED, /* has not yet disconnected */ INCOMING_MISSED, /* an incoming call that was missed and never answered */ NORMAL, /* normal; remote */ LOCAL, /* normal; local hangup */ BUSY, /* outgoing call to busy line */ CONGESTION, /* outgoing call to congested network */ MMI, /* not presently used; dial() returns null */ INVALID_NUMBER, /* invalid dial string */ NUMBER_UNREACHABLE, /* cannot reach the peer */ SERVER_UNREACHABLE, /* cannot reach the server */ INVALID_CREDENTIALS, /* invalid credentials */ OUT_OF_NETWORK, /* calling from out of network is not allowed */ SERVER_ERROR, /* server error */ TIMED_OUT, /* client timed out */ LOST_SIGNAL, LIMIT_EXCEEDED, /* eg GSM ACM limit exceeded */ INCOMING_REJECTED, /* an incoming call that was rejected */ POWER_OFF, /* radio is turned off explicitly */ OUT_OF_SERVICE, /* out of service */ ICC_ERROR, /* No ICC, ICC locked, or other ICC error */ CALL_BARRED, /* call was blocked by call barring */ FDN_BLOCKED, /* call was blocked by fixed dial number */ CS_RESTRICTED, /* call was blocked by restricted all voice access */ CS_RESTRICTED_NORMAL, /* call was blocked by restricted normal voice access */ CS_RESTRICTED_EMERGENCY, /* call was blocked by restricted emergency voice access */ UNOBTAINABLE_NUMBER, /* Unassigned number (3GPP TS 24.008 table 10.5.123) */ CDMA_LOCKED_UNTIL_POWER_CYCLE, /* MS is locked until next power cycle */ CDMA_DROP, CDMA_INTERCEPT, /* INTERCEPT order received, MS state idle entered */ CDMA_REORDER, /* MS has been redirected, call is cancelled */ CDMA_SO_REJECT, /* service option rejection */ CDMA_RETRY_ORDER, /* requested service is rejected, retry delay is set */ CDMA_ACCESS_FAILURE, CDMA_PREEMPTED, CDMA_NOT_EMERGENCY, /* not an emergency call */ CDMA_ACCESS_BLOCKED, /* Access Blocked by CDMA network */ ERROR_UNSPECIFIED } Object mUserData; Object mUserData; /* Instance Methods */ /* Instance Methods */ Loading Loading @@ -153,9 +113,11 @@ public abstract class Connection { public abstract long getHoldDurationMillis(); public abstract long getHoldDurationMillis(); /** /** * Returns "NOT_DISCONNECTED" if not yet disconnected. * Returns call disconnect cause. Values are defined in * {@link android.telephony.DisconnectCause}. If the call is not yet * disconnected, NOT_DISCONNECTED is returned. */ */ public abstract DisconnectCause getDisconnectCause(); public abstract int getDisconnectCause(); /** /** * Returns true of this connection originated elsewhere * Returns true of this connection originated elsewhere Loading src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +2 −168 Original line number Original line Diff line number Diff line Loading @@ -201,9 +201,9 @@ public class DefaultPhoneNotifier implements PhoneNotifier { } } } } public void notifyDisconnectCause(Connection.DisconnectCause cause, int preciseCause) { public void notifyDisconnectCause(int cause, int preciseCause) { try { try { mRegistry.notifyDisconnectCause(convertDisconnectCause(cause), preciseCause); mRegistry.notifyDisconnectCause(cause, preciseCause); } catch (RemoteException ex) { } catch (RemoteException ex) { // system process is dead // system process is dead } } Loading Loading @@ -373,170 +373,4 @@ public class DefaultPhoneNotifier implements PhoneNotifier { return Call.State.IDLE; return Call.State.IDLE; } } } } /** * Convert the {@link DisconnectCause} enum into the DisconnectCause.* * constants for the public API. */ public static int convertDisconnectCause(Connection.DisconnectCause cause) { switch (cause) { case NOT_DISCONNECTED: return DisconnectCause.NOT_DISCONNECTED; case INCOMING_MISSED: return DisconnectCause.INCOMING_MISSED; case NORMAL: return DisconnectCause.NORMAL; case LOCAL: return DisconnectCause.LOCAL; case BUSY: return DisconnectCause.BUSY; case CONGESTION: return DisconnectCause.CONGESTION; case MMI: return DisconnectCause.MMI; case INVALID_NUMBER: return DisconnectCause.INVALID_NUMBER; case NUMBER_UNREACHABLE: return DisconnectCause.NUMBER_UNREACHABLE; case SERVER_UNREACHABLE: return DisconnectCause.SERVER_UNREACHABLE; case INVALID_CREDENTIALS: return DisconnectCause.INVALID_CREDENTIALS; case OUT_OF_NETWORK: return DisconnectCause.OUT_OF_NETWORK; case SERVER_ERROR: return DisconnectCause.SERVER_ERROR; case TIMED_OUT: return DisconnectCause.TIMED_OUT; case LOST_SIGNAL: return DisconnectCause.LOST_SIGNAL; case LIMIT_EXCEEDED: return DisconnectCause.LIMIT_EXCEEDED; case INCOMING_REJECTED: return DisconnectCause.INCOMING_REJECTED; case POWER_OFF: return DisconnectCause.POWER_OFF; case OUT_OF_SERVICE: return DisconnectCause.OUT_OF_SERVICE; case ICC_ERROR: return DisconnectCause.ICC_ERROR; case CALL_BARRED: return DisconnectCause.CALL_BARRED; case FDN_BLOCKED: return DisconnectCause.FDN_BLOCKED; case CS_RESTRICTED: return DisconnectCause.CS_RESTRICTED; case CS_RESTRICTED_NORMAL: return DisconnectCause.CS_RESTRICTED_NORMAL; case CS_RESTRICTED_EMERGENCY: return DisconnectCause.CS_RESTRICTED_EMERGENCY; case UNOBTAINABLE_NUMBER: return DisconnectCause.UNOBTAINABLE_NUMBER; case CDMA_LOCKED_UNTIL_POWER_CYCLE: return DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE; case CDMA_DROP: return DisconnectCause.CDMA_DROP; case CDMA_INTERCEPT: return DisconnectCause.CDMA_INTERCEPT; case CDMA_REORDER: return DisconnectCause.CDMA_REORDER; case CDMA_SO_REJECT: return DisconnectCause.CDMA_SO_REJECT; case CDMA_RETRY_ORDER: return DisconnectCause.CDMA_RETRY_ORDER; case CDMA_ACCESS_FAILURE: return DisconnectCause.CDMA_ACCESS_FAILURE; case CDMA_PREEMPTED: return DisconnectCause.CDMA_PREEMPTED; case CDMA_NOT_EMERGENCY: return DisconnectCause.CDMA_NOT_EMERGENCY; case CDMA_ACCESS_BLOCKED: return DisconnectCause.CDMA_ACCESS_BLOCKED; default: return DisconnectCause.ERROR_UNSPECIFIED; } } /** * Convert the DisconnectCause.* constants into the {@link DisconnectCause} * enum for the public API. */ public static Connection.DisconnectCause convertDisconnectCause(int disconnectCause) { switch (disconnectCause) { case DisconnectCause.NOT_DISCONNECTED: return Connection.DisconnectCause.NOT_DISCONNECTED; case DisconnectCause.INCOMING_MISSED: return Connection.DisconnectCause.INCOMING_MISSED; case DisconnectCause.NORMAL: return Connection.DisconnectCause.NORMAL; case DisconnectCause.LOCAL: return Connection.DisconnectCause.LOCAL; case DisconnectCause.BUSY: return Connection.DisconnectCause.BUSY; case DisconnectCause.CONGESTION: return Connection.DisconnectCause.CONGESTION; case DisconnectCause.MMI: return Connection.DisconnectCause.MMI; case DisconnectCause.INVALID_NUMBER: return Connection.DisconnectCause.INVALID_NUMBER; case DisconnectCause.NUMBER_UNREACHABLE: return Connection.DisconnectCause.NUMBER_UNREACHABLE; case DisconnectCause.SERVER_UNREACHABLE: return Connection.DisconnectCause.SERVER_UNREACHABLE; case DisconnectCause.INVALID_CREDENTIALS: return Connection.DisconnectCause.INVALID_CREDENTIALS; case DisconnectCause.OUT_OF_NETWORK: return Connection.DisconnectCause.OUT_OF_NETWORK; case DisconnectCause.SERVER_ERROR: return Connection.DisconnectCause.SERVER_ERROR; case DisconnectCause.TIMED_OUT: return Connection.DisconnectCause.TIMED_OUT; case DisconnectCause.LOST_SIGNAL: return Connection.DisconnectCause.LOST_SIGNAL; case DisconnectCause.LIMIT_EXCEEDED: return Connection.DisconnectCause.LIMIT_EXCEEDED; case DisconnectCause.INCOMING_REJECTED: return Connection.DisconnectCause.INCOMING_REJECTED; case DisconnectCause.POWER_OFF: return Connection.DisconnectCause.POWER_OFF; case DisconnectCause.OUT_OF_SERVICE: return Connection.DisconnectCause.OUT_OF_SERVICE; case DisconnectCause.ICC_ERROR: return Connection.DisconnectCause.ICC_ERROR; case DisconnectCause.CALL_BARRED: return Connection.DisconnectCause.CALL_BARRED; case DisconnectCause.FDN_BLOCKED: return Connection.DisconnectCause.FDN_BLOCKED; case DisconnectCause.CS_RESTRICTED: return Connection.DisconnectCause.CS_RESTRICTED; case DisconnectCause.CS_RESTRICTED_NORMAL: return Connection.DisconnectCause.CS_RESTRICTED_NORMAL; case DisconnectCause.CS_RESTRICTED_EMERGENCY: return Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY; case DisconnectCause.UNOBTAINABLE_NUMBER: return Connection.DisconnectCause.UNOBTAINABLE_NUMBER; case DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE: return Connection.DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE; case DisconnectCause.CDMA_DROP: return Connection.DisconnectCause.CDMA_DROP; case DisconnectCause.CDMA_INTERCEPT: return Connection.DisconnectCause.CDMA_INTERCEPT; case DisconnectCause.CDMA_REORDER: return Connection.DisconnectCause.CDMA_REORDER; case DisconnectCause.CDMA_SO_REJECT: return Connection.DisconnectCause.CDMA_SO_REJECT; case DisconnectCause.CDMA_RETRY_ORDER: return Connection.DisconnectCause.CDMA_RETRY_ORDER; case DisconnectCause.CDMA_ACCESS_FAILURE: return Connection.DisconnectCause.CDMA_ACCESS_FAILURE; case DisconnectCause.CDMA_PREEMPTED: return Connection.DisconnectCause.CDMA_PREEMPTED; case DisconnectCause.CDMA_NOT_EMERGENCY: return Connection.DisconnectCause.CDMA_NOT_EMERGENCY; case DisconnectCause.CDMA_ACCESS_BLOCKED: return Connection.DisconnectCause.CDMA_ACCESS_BLOCKED; default: return Connection.DisconnectCause.ERROR_UNSPECIFIED; } } } } src/java/com/android/internal/telephony/PhoneNotifier.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -51,7 +51,7 @@ public interface PhoneNotifier { public void notifyPreciseCallState(Phone sender); public void notifyPreciseCallState(Phone sender); public void notifyDisconnectCause(Connection.DisconnectCause cause, int preciseCause); public void notifyDisconnectCause(int cause, int preciseCause); public void notifyPreciseDataConnectionFailed(Phone sender, String reason, String apnType, public void notifyPreciseDataConnectionFailed(Phone sender, String reason, String apnType, String apn, String failCause); String apn, String failCause); Loading src/java/com/android/internal/telephony/cdma/CdmaCallTracker.java +10 −9 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.os.Handler; import android.os.Message; import android.os.Message; import android.os.Registrant; import android.os.Registrant; import android.os.RegistrantList; import android.os.RegistrantList; import android.telephony.DisconnectCause; import android.telephony.PhoneNumberUtils; import android.telephony.PhoneNumberUtils; import android.telephony.ServiceState; import android.telephony.ServiceState; import android.telephony.Rlog; import android.telephony.Rlog; Loading Loading @@ -115,7 +116,7 @@ public final class CdmaCallTracker extends CallTracker { // Since by now we are unregistered, we won't notify // Since by now we are unregistered, we won't notify // PhoneApp that the call is gone. Do that here // PhoneApp that the call is gone. Do that here Rlog.d(LOG_TAG, "dispose: call connnection onDisconnect, cause LOST_SIGNAL"); Rlog.d(LOG_TAG, "dispose: call connnection onDisconnect, cause LOST_SIGNAL"); c.onDisconnect(Connection.DisconnectCause.LOST_SIGNAL); c.onDisconnect(DisconnectCause.LOST_SIGNAL); } } } catch (CallStateException ex) { } catch (CallStateException ex) { Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex); Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex); Loading @@ -126,7 +127,7 @@ public final class CdmaCallTracker extends CallTracker { if(mPendingMO != null) { if(mPendingMO != null) { hangup(mPendingMO); hangup(mPendingMO); Rlog.d(LOG_TAG, "dispose: call mPendingMO.onDsiconnect, cause LOST_SIGNAL"); Rlog.d(LOG_TAG, "dispose: call mPendingMO.onDsiconnect, cause LOST_SIGNAL"); mPendingMO.onDisconnect(Connection.DisconnectCause.LOST_SIGNAL); mPendingMO.onDisconnect(DisconnectCause.LOST_SIGNAL); } } } catch (CallStateException ex) { } catch (CallStateException ex) { Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex); Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex); Loading Loading @@ -219,7 +220,7 @@ public final class CdmaCallTracker extends CallTracker { if (mPendingMO.mAddress == null || mPendingMO.mAddress.length() == 0 if (mPendingMO.mAddress == null || mPendingMO.mAddress.length() == 0 || mPendingMO.mAddress.indexOf(PhoneNumberUtils.WILD) >= 0) { || mPendingMO.mAddress.indexOf(PhoneNumberUtils.WILD) >= 0) { // Phone number is invalid // Phone number is invalid mPendingMO.mCause = Connection.DisconnectCause.INVALID_NUMBER; mPendingMO.mCause = DisconnectCause.INVALID_NUMBER; // handlePollCalls() will notice this call not present // handlePollCalls() will notice this call not present // and will mark it as dropped. // and will mark it as dropped. Loading Loading @@ -665,11 +666,11 @@ public final class CdmaCallTracker extends CallTracker { if (conn.isIncoming() && conn.getConnectTime() == 0) { if (conn.isIncoming() && conn.getConnectTime() == 0) { // Missed or rejected call // Missed or rejected call Connection.DisconnectCause cause; int cause; if (conn.mCause == Connection.DisconnectCause.LOCAL) { if (conn.mCause == DisconnectCause.LOCAL) { cause = Connection.DisconnectCause.INCOMING_REJECTED; cause = DisconnectCause.INCOMING_REJECTED; } else { } else { cause = Connection.DisconnectCause.INCOMING_MISSED; cause = DisconnectCause.INCOMING_MISSED; } } if (Phone.DEBUG_PHONE) { if (Phone.DEBUG_PHONE) { Loading @@ -678,8 +679,8 @@ public final class CdmaCallTracker extends CallTracker { } } mDroppedDuringPoll.remove(i); mDroppedDuringPoll.remove(i); hasAnyCallDisconnected |= conn.onDisconnect(cause); hasAnyCallDisconnected |= conn.onDisconnect(cause); } else if (conn.mCause == Connection.DisconnectCause.LOCAL } else if (conn.mCause == DisconnectCause.LOCAL || conn.mCause == Connection.DisconnectCause.INVALID_NUMBER) { || conn.mCause == DisconnectCause.INVALID_NUMBER) { mDroppedDuringPoll.remove(i); mDroppedDuringPoll.remove(i); hasAnyCallDisconnected |= conn.onDisconnect(conn.mCause); hasAnyCallDisconnected |= conn.onDisconnect(conn.mCause); } } Loading src/java/com/android/internal/telephony/cdma/CdmaConnection.java +14 −6 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.os.Message; import android.os.PowerManager; import android.os.PowerManager; import android.os.Registrant; import android.os.Registrant; import android.os.SystemClock; import android.os.SystemClock; import android.telephony.DisconnectCause; import android.telephony.Rlog; import android.telephony.Rlog; import android.text.TextUtils; import android.text.TextUtils; Loading Loading @@ -75,7 +76,7 @@ public class CdmaConnection extends Connection { int mNextPostDialChar; // index into postDialString int mNextPostDialChar; // index into postDialString DisconnectCause mCause = DisconnectCause.NOT_DISCONNECTED; int mCause = DisconnectCause.NOT_DISCONNECTED; PostDialState mPostDialState = PostDialState.NOT_STARTED; PostDialState mPostDialState = PostDialState.NOT_STARTED; int mNumberPresentation = PhoneConstants.PRESENTATION_ALLOWED; int mNumberPresentation = PhoneConstants.PRESENTATION_ALLOWED; int mPreciseCause = 0; int mPreciseCause = 0; Loading Loading @@ -276,7 +277,7 @@ public class CdmaConnection extends Connection { } } @Override @Override public DisconnectCause getDisconnectCause() { public int getDisconnectCause() { return mCause; return mCause; } } Loading Loading @@ -371,8 +372,12 @@ public class CdmaConnection extends Connection { mPreciseCause = 0; mPreciseCause = 0; } } DisconnectCause /** disconnectCauseFromCode(int causeCode) { * Maps RIL call disconnect code to {@link DisconnectCause}. * @param causeCode RIL disconnect code * @return the corresponding value from {@link DisconnectCause} */ int disconnectCauseFromCode(int causeCode) { /** /** * See 22.001 Annex F.4 for mapping of cause codes * See 22.001 Annex F.4 for mapping of cause codes * to local tones * to local tones Loading Loading @@ -441,9 +446,12 @@ public class CdmaConnection extends Connection { onDisconnect(disconnectCauseFromCode(causeCode)); onDisconnect(disconnectCauseFromCode(causeCode)); } } /** Called when the radio indicates the connection has been disconnected */ /** * Called when the radio indicates the connection has been disconnected. * @param cause call disconnect cause; values are defined in {@link DisconnectCause} */ /*package*/ boolean /*package*/ boolean onDisconnect(DisconnectCause cause) { onDisconnect(int cause) { boolean changed = false; boolean changed = false; mCause = cause; mCause = cause; Loading Loading
src/java/com/android/internal/telephony/Connection.java +4 −42 Original line number Original line Diff line number Diff line Loading @@ -30,46 +30,6 @@ public abstract class Connection { private static String LOG_TAG = "Connection"; private static String LOG_TAG = "Connection"; public enum DisconnectCause { NOT_DISCONNECTED, /* has not yet disconnected */ INCOMING_MISSED, /* an incoming call that was missed and never answered */ NORMAL, /* normal; remote */ LOCAL, /* normal; local hangup */ BUSY, /* outgoing call to busy line */ CONGESTION, /* outgoing call to congested network */ MMI, /* not presently used; dial() returns null */ INVALID_NUMBER, /* invalid dial string */ NUMBER_UNREACHABLE, /* cannot reach the peer */ SERVER_UNREACHABLE, /* cannot reach the server */ INVALID_CREDENTIALS, /* invalid credentials */ OUT_OF_NETWORK, /* calling from out of network is not allowed */ SERVER_ERROR, /* server error */ TIMED_OUT, /* client timed out */ LOST_SIGNAL, LIMIT_EXCEEDED, /* eg GSM ACM limit exceeded */ INCOMING_REJECTED, /* an incoming call that was rejected */ POWER_OFF, /* radio is turned off explicitly */ OUT_OF_SERVICE, /* out of service */ ICC_ERROR, /* No ICC, ICC locked, or other ICC error */ CALL_BARRED, /* call was blocked by call barring */ FDN_BLOCKED, /* call was blocked by fixed dial number */ CS_RESTRICTED, /* call was blocked by restricted all voice access */ CS_RESTRICTED_NORMAL, /* call was blocked by restricted normal voice access */ CS_RESTRICTED_EMERGENCY, /* call was blocked by restricted emergency voice access */ UNOBTAINABLE_NUMBER, /* Unassigned number (3GPP TS 24.008 table 10.5.123) */ CDMA_LOCKED_UNTIL_POWER_CYCLE, /* MS is locked until next power cycle */ CDMA_DROP, CDMA_INTERCEPT, /* INTERCEPT order received, MS state idle entered */ CDMA_REORDER, /* MS has been redirected, call is cancelled */ CDMA_SO_REJECT, /* service option rejection */ CDMA_RETRY_ORDER, /* requested service is rejected, retry delay is set */ CDMA_ACCESS_FAILURE, CDMA_PREEMPTED, CDMA_NOT_EMERGENCY, /* not an emergency call */ CDMA_ACCESS_BLOCKED, /* Access Blocked by CDMA network */ ERROR_UNSPECIFIED } Object mUserData; Object mUserData; /* Instance Methods */ /* Instance Methods */ Loading Loading @@ -153,9 +113,11 @@ public abstract class Connection { public abstract long getHoldDurationMillis(); public abstract long getHoldDurationMillis(); /** /** * Returns "NOT_DISCONNECTED" if not yet disconnected. * Returns call disconnect cause. Values are defined in * {@link android.telephony.DisconnectCause}. If the call is not yet * disconnected, NOT_DISCONNECTED is returned. */ */ public abstract DisconnectCause getDisconnectCause(); public abstract int getDisconnectCause(); /** /** * Returns true of this connection originated elsewhere * Returns true of this connection originated elsewhere Loading
src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +2 −168 Original line number Original line Diff line number Diff line Loading @@ -201,9 +201,9 @@ public class DefaultPhoneNotifier implements PhoneNotifier { } } } } public void notifyDisconnectCause(Connection.DisconnectCause cause, int preciseCause) { public void notifyDisconnectCause(int cause, int preciseCause) { try { try { mRegistry.notifyDisconnectCause(convertDisconnectCause(cause), preciseCause); mRegistry.notifyDisconnectCause(cause, preciseCause); } catch (RemoteException ex) { } catch (RemoteException ex) { // system process is dead // system process is dead } } Loading Loading @@ -373,170 +373,4 @@ public class DefaultPhoneNotifier implements PhoneNotifier { return Call.State.IDLE; return Call.State.IDLE; } } } } /** * Convert the {@link DisconnectCause} enum into the DisconnectCause.* * constants for the public API. */ public static int convertDisconnectCause(Connection.DisconnectCause cause) { switch (cause) { case NOT_DISCONNECTED: return DisconnectCause.NOT_DISCONNECTED; case INCOMING_MISSED: return DisconnectCause.INCOMING_MISSED; case NORMAL: return DisconnectCause.NORMAL; case LOCAL: return DisconnectCause.LOCAL; case BUSY: return DisconnectCause.BUSY; case CONGESTION: return DisconnectCause.CONGESTION; case MMI: return DisconnectCause.MMI; case INVALID_NUMBER: return DisconnectCause.INVALID_NUMBER; case NUMBER_UNREACHABLE: return DisconnectCause.NUMBER_UNREACHABLE; case SERVER_UNREACHABLE: return DisconnectCause.SERVER_UNREACHABLE; case INVALID_CREDENTIALS: return DisconnectCause.INVALID_CREDENTIALS; case OUT_OF_NETWORK: return DisconnectCause.OUT_OF_NETWORK; case SERVER_ERROR: return DisconnectCause.SERVER_ERROR; case TIMED_OUT: return DisconnectCause.TIMED_OUT; case LOST_SIGNAL: return DisconnectCause.LOST_SIGNAL; case LIMIT_EXCEEDED: return DisconnectCause.LIMIT_EXCEEDED; case INCOMING_REJECTED: return DisconnectCause.INCOMING_REJECTED; case POWER_OFF: return DisconnectCause.POWER_OFF; case OUT_OF_SERVICE: return DisconnectCause.OUT_OF_SERVICE; case ICC_ERROR: return DisconnectCause.ICC_ERROR; case CALL_BARRED: return DisconnectCause.CALL_BARRED; case FDN_BLOCKED: return DisconnectCause.FDN_BLOCKED; case CS_RESTRICTED: return DisconnectCause.CS_RESTRICTED; case CS_RESTRICTED_NORMAL: return DisconnectCause.CS_RESTRICTED_NORMAL; case CS_RESTRICTED_EMERGENCY: return DisconnectCause.CS_RESTRICTED_EMERGENCY; case UNOBTAINABLE_NUMBER: return DisconnectCause.UNOBTAINABLE_NUMBER; case CDMA_LOCKED_UNTIL_POWER_CYCLE: return DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE; case CDMA_DROP: return DisconnectCause.CDMA_DROP; case CDMA_INTERCEPT: return DisconnectCause.CDMA_INTERCEPT; case CDMA_REORDER: return DisconnectCause.CDMA_REORDER; case CDMA_SO_REJECT: return DisconnectCause.CDMA_SO_REJECT; case CDMA_RETRY_ORDER: return DisconnectCause.CDMA_RETRY_ORDER; case CDMA_ACCESS_FAILURE: return DisconnectCause.CDMA_ACCESS_FAILURE; case CDMA_PREEMPTED: return DisconnectCause.CDMA_PREEMPTED; case CDMA_NOT_EMERGENCY: return DisconnectCause.CDMA_NOT_EMERGENCY; case CDMA_ACCESS_BLOCKED: return DisconnectCause.CDMA_ACCESS_BLOCKED; default: return DisconnectCause.ERROR_UNSPECIFIED; } } /** * Convert the DisconnectCause.* constants into the {@link DisconnectCause} * enum for the public API. */ public static Connection.DisconnectCause convertDisconnectCause(int disconnectCause) { switch (disconnectCause) { case DisconnectCause.NOT_DISCONNECTED: return Connection.DisconnectCause.NOT_DISCONNECTED; case DisconnectCause.INCOMING_MISSED: return Connection.DisconnectCause.INCOMING_MISSED; case DisconnectCause.NORMAL: return Connection.DisconnectCause.NORMAL; case DisconnectCause.LOCAL: return Connection.DisconnectCause.LOCAL; case DisconnectCause.BUSY: return Connection.DisconnectCause.BUSY; case DisconnectCause.CONGESTION: return Connection.DisconnectCause.CONGESTION; case DisconnectCause.MMI: return Connection.DisconnectCause.MMI; case DisconnectCause.INVALID_NUMBER: return Connection.DisconnectCause.INVALID_NUMBER; case DisconnectCause.NUMBER_UNREACHABLE: return Connection.DisconnectCause.NUMBER_UNREACHABLE; case DisconnectCause.SERVER_UNREACHABLE: return Connection.DisconnectCause.SERVER_UNREACHABLE; case DisconnectCause.INVALID_CREDENTIALS: return Connection.DisconnectCause.INVALID_CREDENTIALS; case DisconnectCause.OUT_OF_NETWORK: return Connection.DisconnectCause.OUT_OF_NETWORK; case DisconnectCause.SERVER_ERROR: return Connection.DisconnectCause.SERVER_ERROR; case DisconnectCause.TIMED_OUT: return Connection.DisconnectCause.TIMED_OUT; case DisconnectCause.LOST_SIGNAL: return Connection.DisconnectCause.LOST_SIGNAL; case DisconnectCause.LIMIT_EXCEEDED: return Connection.DisconnectCause.LIMIT_EXCEEDED; case DisconnectCause.INCOMING_REJECTED: return Connection.DisconnectCause.INCOMING_REJECTED; case DisconnectCause.POWER_OFF: return Connection.DisconnectCause.POWER_OFF; case DisconnectCause.OUT_OF_SERVICE: return Connection.DisconnectCause.OUT_OF_SERVICE; case DisconnectCause.ICC_ERROR: return Connection.DisconnectCause.ICC_ERROR; case DisconnectCause.CALL_BARRED: return Connection.DisconnectCause.CALL_BARRED; case DisconnectCause.FDN_BLOCKED: return Connection.DisconnectCause.FDN_BLOCKED; case DisconnectCause.CS_RESTRICTED: return Connection.DisconnectCause.CS_RESTRICTED; case DisconnectCause.CS_RESTRICTED_NORMAL: return Connection.DisconnectCause.CS_RESTRICTED_NORMAL; case DisconnectCause.CS_RESTRICTED_EMERGENCY: return Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY; case DisconnectCause.UNOBTAINABLE_NUMBER: return Connection.DisconnectCause.UNOBTAINABLE_NUMBER; case DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE: return Connection.DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE; case DisconnectCause.CDMA_DROP: return Connection.DisconnectCause.CDMA_DROP; case DisconnectCause.CDMA_INTERCEPT: return Connection.DisconnectCause.CDMA_INTERCEPT; case DisconnectCause.CDMA_REORDER: return Connection.DisconnectCause.CDMA_REORDER; case DisconnectCause.CDMA_SO_REJECT: return Connection.DisconnectCause.CDMA_SO_REJECT; case DisconnectCause.CDMA_RETRY_ORDER: return Connection.DisconnectCause.CDMA_RETRY_ORDER; case DisconnectCause.CDMA_ACCESS_FAILURE: return Connection.DisconnectCause.CDMA_ACCESS_FAILURE; case DisconnectCause.CDMA_PREEMPTED: return Connection.DisconnectCause.CDMA_PREEMPTED; case DisconnectCause.CDMA_NOT_EMERGENCY: return Connection.DisconnectCause.CDMA_NOT_EMERGENCY; case DisconnectCause.CDMA_ACCESS_BLOCKED: return Connection.DisconnectCause.CDMA_ACCESS_BLOCKED; default: return Connection.DisconnectCause.ERROR_UNSPECIFIED; } } } }
src/java/com/android/internal/telephony/PhoneNotifier.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -51,7 +51,7 @@ public interface PhoneNotifier { public void notifyPreciseCallState(Phone sender); public void notifyPreciseCallState(Phone sender); public void notifyDisconnectCause(Connection.DisconnectCause cause, int preciseCause); public void notifyDisconnectCause(int cause, int preciseCause); public void notifyPreciseDataConnectionFailed(Phone sender, String reason, String apnType, public void notifyPreciseDataConnectionFailed(Phone sender, String reason, String apnType, String apn, String failCause); String apn, String failCause); Loading
src/java/com/android/internal/telephony/cdma/CdmaCallTracker.java +10 −9 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.os.Handler; import android.os.Message; import android.os.Message; import android.os.Registrant; import android.os.Registrant; import android.os.RegistrantList; import android.os.RegistrantList; import android.telephony.DisconnectCause; import android.telephony.PhoneNumberUtils; import android.telephony.PhoneNumberUtils; import android.telephony.ServiceState; import android.telephony.ServiceState; import android.telephony.Rlog; import android.telephony.Rlog; Loading Loading @@ -115,7 +116,7 @@ public final class CdmaCallTracker extends CallTracker { // Since by now we are unregistered, we won't notify // Since by now we are unregistered, we won't notify // PhoneApp that the call is gone. Do that here // PhoneApp that the call is gone. Do that here Rlog.d(LOG_TAG, "dispose: call connnection onDisconnect, cause LOST_SIGNAL"); Rlog.d(LOG_TAG, "dispose: call connnection onDisconnect, cause LOST_SIGNAL"); c.onDisconnect(Connection.DisconnectCause.LOST_SIGNAL); c.onDisconnect(DisconnectCause.LOST_SIGNAL); } } } catch (CallStateException ex) { } catch (CallStateException ex) { Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex); Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex); Loading @@ -126,7 +127,7 @@ public final class CdmaCallTracker extends CallTracker { if(mPendingMO != null) { if(mPendingMO != null) { hangup(mPendingMO); hangup(mPendingMO); Rlog.d(LOG_TAG, "dispose: call mPendingMO.onDsiconnect, cause LOST_SIGNAL"); Rlog.d(LOG_TAG, "dispose: call mPendingMO.onDsiconnect, cause LOST_SIGNAL"); mPendingMO.onDisconnect(Connection.DisconnectCause.LOST_SIGNAL); mPendingMO.onDisconnect(DisconnectCause.LOST_SIGNAL); } } } catch (CallStateException ex) { } catch (CallStateException ex) { Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex); Rlog.e(LOG_TAG, "dispose: unexpected error on hangup", ex); Loading Loading @@ -219,7 +220,7 @@ public final class CdmaCallTracker extends CallTracker { if (mPendingMO.mAddress == null || mPendingMO.mAddress.length() == 0 if (mPendingMO.mAddress == null || mPendingMO.mAddress.length() == 0 || mPendingMO.mAddress.indexOf(PhoneNumberUtils.WILD) >= 0) { || mPendingMO.mAddress.indexOf(PhoneNumberUtils.WILD) >= 0) { // Phone number is invalid // Phone number is invalid mPendingMO.mCause = Connection.DisconnectCause.INVALID_NUMBER; mPendingMO.mCause = DisconnectCause.INVALID_NUMBER; // handlePollCalls() will notice this call not present // handlePollCalls() will notice this call not present // and will mark it as dropped. // and will mark it as dropped. Loading Loading @@ -665,11 +666,11 @@ public final class CdmaCallTracker extends CallTracker { if (conn.isIncoming() && conn.getConnectTime() == 0) { if (conn.isIncoming() && conn.getConnectTime() == 0) { // Missed or rejected call // Missed or rejected call Connection.DisconnectCause cause; int cause; if (conn.mCause == Connection.DisconnectCause.LOCAL) { if (conn.mCause == DisconnectCause.LOCAL) { cause = Connection.DisconnectCause.INCOMING_REJECTED; cause = DisconnectCause.INCOMING_REJECTED; } else { } else { cause = Connection.DisconnectCause.INCOMING_MISSED; cause = DisconnectCause.INCOMING_MISSED; } } if (Phone.DEBUG_PHONE) { if (Phone.DEBUG_PHONE) { Loading @@ -678,8 +679,8 @@ public final class CdmaCallTracker extends CallTracker { } } mDroppedDuringPoll.remove(i); mDroppedDuringPoll.remove(i); hasAnyCallDisconnected |= conn.onDisconnect(cause); hasAnyCallDisconnected |= conn.onDisconnect(cause); } else if (conn.mCause == Connection.DisconnectCause.LOCAL } else if (conn.mCause == DisconnectCause.LOCAL || conn.mCause == Connection.DisconnectCause.INVALID_NUMBER) { || conn.mCause == DisconnectCause.INVALID_NUMBER) { mDroppedDuringPoll.remove(i); mDroppedDuringPoll.remove(i); hasAnyCallDisconnected |= conn.onDisconnect(conn.mCause); hasAnyCallDisconnected |= conn.onDisconnect(conn.mCause); } } Loading
src/java/com/android/internal/telephony/cdma/CdmaConnection.java +14 −6 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.os.Message; import android.os.PowerManager; import android.os.PowerManager; import android.os.Registrant; import android.os.Registrant; import android.os.SystemClock; import android.os.SystemClock; import android.telephony.DisconnectCause; import android.telephony.Rlog; import android.telephony.Rlog; import android.text.TextUtils; import android.text.TextUtils; Loading Loading @@ -75,7 +76,7 @@ public class CdmaConnection extends Connection { int mNextPostDialChar; // index into postDialString int mNextPostDialChar; // index into postDialString DisconnectCause mCause = DisconnectCause.NOT_DISCONNECTED; int mCause = DisconnectCause.NOT_DISCONNECTED; PostDialState mPostDialState = PostDialState.NOT_STARTED; PostDialState mPostDialState = PostDialState.NOT_STARTED; int mNumberPresentation = PhoneConstants.PRESENTATION_ALLOWED; int mNumberPresentation = PhoneConstants.PRESENTATION_ALLOWED; int mPreciseCause = 0; int mPreciseCause = 0; Loading Loading @@ -276,7 +277,7 @@ public class CdmaConnection extends Connection { } } @Override @Override public DisconnectCause getDisconnectCause() { public int getDisconnectCause() { return mCause; return mCause; } } Loading Loading @@ -371,8 +372,12 @@ public class CdmaConnection extends Connection { mPreciseCause = 0; mPreciseCause = 0; } } DisconnectCause /** disconnectCauseFromCode(int causeCode) { * Maps RIL call disconnect code to {@link DisconnectCause}. * @param causeCode RIL disconnect code * @return the corresponding value from {@link DisconnectCause} */ int disconnectCauseFromCode(int causeCode) { /** /** * See 22.001 Annex F.4 for mapping of cause codes * See 22.001 Annex F.4 for mapping of cause codes * to local tones * to local tones Loading Loading @@ -441,9 +446,12 @@ public class CdmaConnection extends Connection { onDisconnect(disconnectCauseFromCode(causeCode)); onDisconnect(disconnectCauseFromCode(causeCode)); } } /** Called when the radio indicates the connection has been disconnected */ /** * Called when the radio indicates the connection has been disconnected. * @param cause call disconnect cause; values are defined in {@link DisconnectCause} */ /*package*/ boolean /*package*/ boolean onDisconnect(DisconnectCause cause) { onDisconnect(int cause) { boolean changed = false; boolean changed = false; mCause = cause; mCause = cause; Loading