diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2014-02-17 08:36:00 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-02-17 08:36:00 -0800 |
| commit | c1404d87e5c69f681dfba33e72fb7685a836815a (patch) | |
| tree | 1ee2733862cea8771b7a3735b7adc9afa314a763 /src | |
| parent | aaf53b883eb9c8da6e84c1f196ffca69d12e5cd9 (diff) | |
| parent | db38496569861eb538710d159b645232f17c72d7 (diff) | |
| download | packages_apps_InCallUI-c1404d87e5c69f681dfba33e72fb7685a836815a.tar.gz packages_apps_InCallUI-c1404d87e5c69f681dfba33e72fb7685a836815a.tar.bz2 packages_apps_InCallUI-c1404d87e5c69f681dfba33e72fb7685a836815a.zip | |
Merge "Display Conference call Failure to the user"
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/incallui/CallHandlerService.java | 12 | ||||
| -rw-r--r-- | src/com/android/incallui/InCallActivity.java | 57 | ||||
| -rw-r--r-- | src/com/android/incallui/InCallPresenter.java | 6 |
3 files changed, 74 insertions, 1 deletions
diff --git a/src/com/android/incallui/CallHandlerService.java b/src/com/android/incallui/CallHandlerService.java index 7a206317..f404b490 100644 --- a/src/com/android/incallui/CallHandlerService.java +++ b/src/com/android/incallui/CallHandlerService.java @@ -50,8 +50,9 @@ public class CallHandlerService extends Service { private static final int ON_DESTROY = 10; private static final int ON_ACTIVE_SUB_CHANGE = 11; private static final int ON_UNSOL_CALLMODIFY = 12; + private static final int ON_SUPP_SERVICE_FAIL = 13; - private static final int LARGEST_MSG_ID = ON_ACTIVE_SUB_CHANGE; + private static final int LARGEST_MSG_ID = ON_SUPP_SERVICE_FAIL; private CallList mCallList; @@ -204,6 +205,11 @@ public class CallHandlerService extends Service { mMainHandler.sendMessage(mMainHandler.obtainMessage(ON_ACTIVE_SUB_CHANGE, activeSub)); } + @Override + public void onSuppServiceFailed(int service) { + mMainHandler.sendMessage(mMainHandler.obtainMessage(ON_SUPP_SERVICE_FAIL, service)); + } + }; private void doStart(ICallCommandService service) { @@ -344,6 +350,10 @@ public class CallHandlerService extends Service { Log.i(TAG, "ON_ACTIVE_SUB_CHANGE: " + msg.obj); mCallList.onActiveSubChanged((Integer) msg.obj); break; + case ON_SUPP_SERVICE_FAIL: + Log.i(TAG, "ON_SUPP_SERVICE_FAIL: "); + mInCallPresenter.onSuppServiceFailed((Integer) msg.obj); + break; default: break; diff --git a/src/com/android/incallui/InCallActivity.java b/src/com/android/incallui/InCallActivity.java index f1a7133a..54fe92e8 100644 --- a/src/com/android/incallui/InCallActivity.java +++ b/src/com/android/incallui/InCallActivity.java @@ -23,6 +23,7 @@ package com.android.incallui; import java.lang.reflect.Array; import java.util.ArrayList; +import com.android.internal.telephony.Phone; import com.android.services.telephony.common.Call; import com.android.services.telephony.common.Call.State; import com.android.services.telephony.common.CallDetails; @@ -611,6 +612,62 @@ public class InCallActivity extends Activity { } /** + * Handle a failure notification for a supplementary service + * (i.e. conference, switch, separate, transfer, etc.). + */ + void onSuppServiceFailed(int service) { + Log.d(this, "onSuppServiceFailed: " + service); + Phone.SuppService result = Phone.SuppService.values()[service]; + int errorMessageResId; + + switch (result) { + case SWITCH: + // Attempt to switch foreground and background/incoming calls failed + // ("Failed to switch calls") + errorMessageResId = R.string.incall_error_supp_service_switch; + break; + + case SEPARATE: + // Attempt to separate a call from a conference call + // failed ("Failed to separate out call") + errorMessageResId = R.string.incall_error_supp_service_separate; + break; + + case TRANSFER: + // Attempt to connect foreground and background calls to + // each other (and hanging up user's line) failed ("Call + // transfer failed") + errorMessageResId = R.string.incall_error_supp_service_transfer; + break; + + case CONFERENCE: + // Attempt to add a call to conference call failed + // ("Conference call failed") + errorMessageResId = R.string.incall_error_supp_service_conference; + break; + + case REJECT: + // Attempt to reject an incoming call failed + // ("Call rejection failed") + errorMessageResId = R.string.incall_error_supp_service_reject; + break; + + case HANGUP: + // Attempt to release a call failed ("Failed to release call(s)") + errorMessageResId = R.string.incall_error_supp_service_hangup; + break; + + case UNKNOWN: + default: + // Attempt to use a service we don't recognize or support + // ("Unsupported service" or "Selected service failed") + errorMessageResId = R.string.incall_error_supp_service_unknown; + break; + } + showErrorDialog(errorMessageResId); + } + + /** * Utility function to bring up a generic "error" dialog. */ private void showErrorDialog(int resId) { diff --git a/src/com/android/incallui/InCallPresenter.java b/src/com/android/incallui/InCallPresenter.java index 8ad32fd3..8f24a81d 100644 --- a/src/com/android/incallui/InCallPresenter.java +++ b/src/com/android/incallui/InCallPresenter.java @@ -860,6 +860,12 @@ public class InCallPresenter implements CallList.Listener { } } + public void onSuppServiceFailed(int service) { + if (mInCallActivity != null) { + mInCallActivity.onSuppServiceFailed(service); + } + } + /** * Private constructor. Must use getInstance() to get this singleton. */ |
