diff options
author | Anders Kristensen <andersk@google.com> | 2014-02-27 14:26:43 -0800 |
---|---|---|
committer | Anders Kristensen <andersk@google.com> | 2014-03-28 17:13:34 +0000 |
commit | 479c50f6d4fac0fa44210c9bad4346f64dba3f1e (patch) | |
tree | 3e0a16fddc09f50c855b16ca082a458d0defeecc /InCallUI/src/com/android/incallui/InCallActivity.java | |
parent | 3ce49172bf45607990d1e791e99fcd5670c6b217 (diff) |
Remove duplicate call disconnect codes.
The Android code base defines call disconnect codes in three places:
- android.telephony.DisconnectCause
- android.internal.telephony.Connection.DisconnectCause
- com.android.services.telephony.common.Call.DisconnectCause
This CL consolidates the code to use the integer codes from
android.telephony.DisconnectCause everywhere.
Change-Id: I84a3fd5182a51d07fc7d81076e4b2c15ff26c61c
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 08a8f12d0..aa4a715ad 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -27,6 +27,7 @@ import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.content.res.Configuration; import android.os.Bundle; +import android.telephony.DisconnectCause; import android.view.KeyEvent; import android.view.View; import android.view.Window; @@ -432,7 +433,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()) { @@ -478,18 +482,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; } |