diff options
author | Andrew Lee <anwlee@google.com> | 2014-09-11 17:33:16 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2014-09-16 12:07:41 -0700 |
commit | 7f3d41fd124dd7c4a8b72c1d48df08a8ee7209ec (patch) | |
tree | 5f90ef2d188ec564b16fd79936b5a19c7ea27395 /telecomm/java/android/telecom/Conference.java | |
parent | b37b7ae137d09e21ed9b57415960ae1b975bdc0f (diff) | |
download | frameworks_base-7f3d41fd124dd7c4a8b72c1d48df08a8ee7209ec.zip frameworks_base-7f3d41fd124dd7c4a8b72c1d48df08a8ee7209ec.tar.gz frameworks_base-7f3d41fd124dd7c4a8b72c1d48df08a8ee7209ec.tar.bz2 |
Add new DisconnectCause class to telecomm.
+ Add a hidden "UNKNOWN" default type to ToneGenerator.
- Hide the Telephony DisconnectCause from the public API.
+ Add a Telecomm DisconnectCause. This is parcelable, and contains
information (code, user facing message, non-user facing reason,
and tone) to help describe the disconnect state and what behaviors
an application can implement for the user experience. This reduces
the causes for a disconnect to a more generic set.
+ Lots of work to pipe this through. DisconnectCause replaces the
code and message which were formerly passed around.
Bug: 17241433
Bug: 17329632
Change-Id: I9d337e478a8784bcc0ade02267c2df52cac9bf17
Diffstat (limited to 'telecomm/java/android/telecom/Conference.java')
-rw-r--r-- | telecomm/java/android/telecom/Conference.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index ca85446..d1e150f 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -16,8 +16,6 @@ package android.telecom; -import android.telephony.DisconnectCause; - import java.util.Collections; import java.util.List; import java.util.Set; @@ -32,7 +30,7 @@ public abstract class Conference { /** @hide */ public abstract static class Listener { public void onStateChanged(Conference conference, int oldState, int newState) {} - public void onDisconnected(Conference conference, int cause, String message) {} + public void onDisconnected(Conference conference, DisconnectCause disconnectCause) {} public void onConnectionAdded(Conference conference, Connection connection) {} public void onConnectionRemoved(Conference conference, Connection connection) {} public void onDestroyed(Conference conference) {} @@ -46,7 +44,7 @@ public abstract class Conference { private PhoneAccountHandle mPhoneAccount; private int mState = Connection.STATE_NEW; - private int mDisconnectCause = DisconnectCause.NOT_VALID; + private DisconnectCause mDisconnectCause; private int mCapabilities; private String mDisconnectMessage; @@ -146,16 +144,14 @@ public abstract class Conference { /** * Sets state to disconnected. * - * @param cause The reason for the disconnection, any of - * {@link android.telephony.DisconnectCause}. - * @param message Optional call-service-provided message about the disconnect. + * @param disconnectCause The reason for the disconnection, as described by + * {@link android.telecom.DisconnectCause}. */ - public final void setDisconnected(int cause, String message) { - mDisconnectCause = cause; - mDisconnectMessage = message; + public final void setDisconnected(DisconnectCause disconnectCause) { + mDisconnectCause = disconnectCause;; setState(Connection.STATE_DISCONNECTED); for (Listener l : mListeners) { - l.onDisconnected(this, mDisconnectCause, mDisconnectMessage); + l.onDisconnected(this, mDisconnectCause); } } @@ -222,7 +218,7 @@ public abstract class Conference { // If not yet disconnected, set the conference call as disconnected first. if (mState != Connection.STATE_DISCONNECTED) { Log.d(this, "setting to disconnected"); - setDisconnected(DisconnectCause.LOCAL, null); + setDisconnected(new DisconnectCause(DisconnectCause.LOCAL)); } // ...and notify. |