diff options
author | Colin Cross <ccross@android.com> | 2014-03-28 16:07:27 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2014-03-28 16:07:27 -0700 |
commit | f965ebbdfddf7070ab1807a49b203e76e58b7e4e (patch) | |
tree | 2264f009670ee2dfb3c232a6b66830a4b8734f6e /InCallUI/src/com/android | |
parent | 73f561e7657a1afe3d4be888bb22c4af4f729e33 (diff) | |
parent | 917bb0e20a146a3ab4f7b0cebc4465d0806d0181 (diff) |
resolved conflicts for merge of 063fa2d9 to master-nova
Change-Id: Iaa921a78fb59185404d24b6a4245ae2cb691ea5f
Diffstat (limited to 'InCallUI/src/com/android')
4 files changed, 44 insertions, 37 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 76cdf2ca9..1a5cabd4c 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -22,6 +22,7 @@ import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; +import android.telephony.DisconnectCause; import android.text.TextUtils; import android.view.Gravity; import android.view.LayoutInflater; @@ -227,7 +228,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr } @Override - public void setCallState(int state, Call.DisconnectCause cause, boolean bluetoothOn, + public void setCallState(int state, int cause, boolean bluetoothOn, String gatewayLabel, String gatewayNumber, String wifiConnection) { String callStateLabel = null; @@ -239,7 +240,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr } Log.v(this, "setCallState " + callStateLabel); - Log.v(this, "DisconnectCause " + cause); + Log.v(this, "DisconnectCause " + DisconnectCause.toString(cause)); Log.v(this, "bluetooth on " + bluetoothOn); Log.v(this, "gateway " + gatewayLabel + gatewayNumber); @@ -364,7 +365,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr * Gets the call state label based on the state of the call and * cause of disconnect */ - private String getCallStateLabelFromState(int state, Call.DisconnectCause cause) { + private String getCallStateLabelFromState(int state, int cause) { final Context context = getView().getContext(); String callStateLabel = null; // Label to display as part of the call banner @@ -405,8 +406,10 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr /** * Maps the disconnect cause to a resource string. + * + * @param cause disconnect cause as defined in {@link DisconnectCause} */ - private String getCallFailedString(Call.DisconnectCause cause) { + private String getCallFailedString(int cause) { int resID = R.string.card_title_call_ended; // TODO: The card *title* should probably be "Call ended" in all @@ -414,61 +417,61 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr // probably also display the specific failure reason somewhere... switch (cause) { - case BUSY: + case DisconnectCause.BUSY: resID = R.string.callFailed_userBusy; break; - case CONGESTION: + case DisconnectCause.CONGESTION: resID = R.string.callFailed_congestion; break; - case TIMED_OUT: + case DisconnectCause.TIMED_OUT: resID = R.string.callFailed_timedOut; break; - case SERVER_UNREACHABLE: + case DisconnectCause.SERVER_UNREACHABLE: resID = R.string.callFailed_server_unreachable; break; - case NUMBER_UNREACHABLE: + case DisconnectCause.NUMBER_UNREACHABLE: resID = R.string.callFailed_number_unreachable; break; - case INVALID_CREDENTIALS: + case DisconnectCause.INVALID_CREDENTIALS: resID = R.string.callFailed_invalid_credentials; break; - case SERVER_ERROR: + case DisconnectCause.SERVER_ERROR: resID = R.string.callFailed_server_error; break; - case OUT_OF_NETWORK: + case DisconnectCause.OUT_OF_NETWORK: resID = R.string.callFailed_out_of_network; break; - case LOST_SIGNAL: - case CDMA_DROP: + case DisconnectCause.LOST_SIGNAL: + case DisconnectCause.CDMA_DROP: resID = R.string.callFailed_noSignal; break; - case LIMIT_EXCEEDED: + case DisconnectCause.LIMIT_EXCEEDED: resID = R.string.callFailed_limitExceeded; break; - case POWER_OFF: + case DisconnectCause.POWER_OFF: resID = R.string.callFailed_powerOff; break; - case ICC_ERROR: + case DisconnectCause.ICC_ERROR: resID = R.string.callFailed_simError; break; - case OUT_OF_SERVICE: + case DisconnectCause.OUT_OF_SERVICE: resID = R.string.callFailed_outOfService; break; - case INVALID_NUMBER: - case UNOBTAINABLE_NUMBER: + case DisconnectCause.INVALID_NUMBER: + case DisconnectCause.UNOBTAINABLE_NUMBER: resID = R.string.callFailed_unobtainable_number; break; diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index bb0ef3ec4..81dee250b 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -24,6 +24,7 @@ import android.graphics.Bitmap; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.telecomm.InCallAdapter; +import android.telephony.DisconnectCause; import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.text.format.DateUtils; @@ -194,7 +195,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> ui.setCallState(mPrimary.getState(), mPrimary.getDisconnectCause(), bluetoothOn, getGatewayLabel(), getGatewayNumber(), getWifiConnection()); } else { - ui.setCallState(Call.State.IDLE, Call.DisconnectCause.UNKNOWN, false, null, null, null); + ui.setCallState(Call.State.IDLE, DisconnectCause.NOT_VALID, false, null, null, null); } } @@ -488,7 +489,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> void setSecondary(boolean show, String name, boolean nameIsNumber, String label, Drawable photo, boolean isConference, boolean isGeneric); void setSecondaryImage(Drawable image); - void setCallState(int state, Call.DisconnectCause cause, boolean bluetoothOn, + void setCallState(int state, int cause, boolean bluetoothOn, String gatewayLabel, String gatewayNumber, String wifiConnection); void setPrimaryCallElapsedTime(boolean show, String duration); void setPrimaryName(String name, boolean nameIsNumber); diff --git a/InCallUI/src/com/android/incallui/CallList.java b/InCallUI/src/com/android/incallui/CallList.java index 7e1b709ef..c0303254c 100644 --- a/InCallUI/src/com/android/incallui/CallList.java +++ b/InCallUI/src/com/android/incallui/CallList.java @@ -23,9 +23,9 @@ import com.google.common.base.Preconditions; import android.os.Handler; import android.os.Message; +import android.telephony.DisconnectCause; import com.android.services.telephony.common.Call; -import com.android.services.telephony.common.Call.DisconnectCause; import java.util.HashMap; import java.util.List; @@ -306,7 +306,7 @@ public class CallList { state != Call.State.DISCONNECTED) { call.setState(Call.State.DISCONNECTED); - call.setDisconnectCause(DisconnectCause.UNKNOWN); + call.setDisconnectCause(DisconnectCause.NOT_VALID); updateCallInMap(call); } } @@ -381,18 +381,17 @@ public class CallList { Preconditions.checkState(call.getState() == Call.State.DISCONNECTED); - final Call.DisconnectCause cause = call.getDisconnectCause(); + final int cause = call.getDisconnectCause(); final int delay; switch (cause) { - case LOCAL: + case DisconnectCause.LOCAL: delay = DISCONNECTED_CALL_SHORT_TIMEOUT_MS; break; - case NORMAL: - case UNKNOWN: + case DisconnectCause.NORMAL: delay = DISCONNECTED_CALL_MEDIUM_TIMEOUT_MS; break; - case INCOMING_REJECTED: - case INCOMING_MISSED: + case DisconnectCause.INCOMING_REJECTED: + case DisconnectCause.INCOMING_MISSED: // no delay for missed/rejected incoming calls delay = 0; break; diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 203476cc0..0fd95292a 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -29,6 +29,7 @@ import android.content.Intent; import android.content.res.Configuration; import android.os.Bundle; import android.telecomm.InCallAdapter; +import android.telephony.DisconnectCause; import android.view.KeyEvent; import android.view.View; import android.view.Window; @@ -451,7 +452,10 @@ public class InCallActivity extends Activity { return super.dispatchPopulateAccessibilityEvent(event); } - public void maybeShowErrorDialogOnDisconnect(Call.DisconnectCause cause) { + /** + * @param cause disconnect cause as defined in {@link DisconnectCause} + */ + public void maybeShowErrorDialogOnDisconnect(int cause) { Log.d(this, "maybeShowErrorDialogOnDisconnect"); if (!isFinishing()) { @@ -497,18 +501,18 @@ public class InCallActivity extends Activity { mDialog.show(); } - private int getResIdForDisconnectCause(Call.DisconnectCause cause) { + private int getResIdForDisconnectCause(int cause) { int resId = INVALID_RES_ID; - if (cause == Call.DisconnectCause.CALL_BARRED) { + if (cause == DisconnectCause.CALL_BARRED) { resId = R.string.callFailed_cb_enabled; - } else if (cause == Call.DisconnectCause.FDN_BLOCKED) { + } else if (cause == DisconnectCause.FDN_BLOCKED) { resId = R.string.callFailed_fdn_only; - } else if (cause == Call.DisconnectCause.CS_RESTRICTED) { + } else if (cause == DisconnectCause.CS_RESTRICTED) { resId = R.string.callFailed_dsac_restricted; - } else if (cause == Call.DisconnectCause.CS_RESTRICTED_EMERGENCY) { + } else if (cause == DisconnectCause.CS_RESTRICTED_EMERGENCY) { resId = R.string.callFailed_dsac_restricted_emergency; - } else if (cause == Call.DisconnectCause.CS_RESTRICTED_NORMAL) { + } else if (cause == DisconnectCause.CS_RESTRICTED_NORMAL) { resId = R.string.callFailed_dsac_restricted_normal; } |