aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Zhamaitsiak <pavelz@google.com>2014-11-16 15:29:09 -0800
committerPavel Zhamaitsiak <pavelz@google.com>2014-11-19 09:31:50 -0800
commit987bab859324396c0d1fc00c375f98f3f74c9067 (patch)
treeaab5a0a068aba24831b451e0bdfaf5cecab53735
parent168c634eef29f21c73129164207d04b8cce23738 (diff)
downloadims-987bab859324396c0d1fc00c375f98f3f74c9067.tar.gz
TTY over IMS: Notify the user that TTY mode changed in the far device
Bug: 18247323 Change-Id: I9847d947c9d1ee97da0151a7ccfac35aa6a7b9c4
-rw-r--r--src/java/com/android/ims/ImsCall.java37
-rw-r--r--src/java/com/android/ims/internal/ImsCallSession.java14
2 files changed, 49 insertions, 2 deletions
diff --git a/src/java/com/android/ims/ImsCall.java b/src/java/com/android/ims/ImsCall.java
index 342f527d..c65516b6 100644
--- a/src/java/com/android/ims/ImsCall.java
+++ b/src/java/com/android/ims/ImsCall.java
@@ -28,8 +28,11 @@ import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.os.Message;
+import android.provider.Settings;
import android.telecom.ConferenceParticipant;
+import android.telecom.TelecomManager;
import android.telephony.Rlog;
+import android.widget.Toast;
import com.android.ims.internal.CallGroup;
import com.android.ims.internal.CallGroupManager;
@@ -2609,6 +2612,40 @@ public class ImsCall implements ICall {
}
}
}
+
+ @Override
+ public void callSessionTtyModeReceived(ImsCallSession session, int mode) {
+ if (DBG) {
+ log("callSessionTtyModeReceived :: session=" + session
+ + ", mode=" + mode);
+ }
+
+ int settingsTtyMode = Settings.Secure.getInt(
+ mContext.getContentResolver(),
+ Settings.Secure.PREFERRED_TTY_MODE,
+ TelecomManager.TTY_MODE_OFF);
+ if (settingsTtyMode == TelecomManager.TTY_MODE_OFF) {
+ // Notify the user that TTY mode changed in the far device
+ int resId = 0;
+ switch (mode) {
+ case TelecomManager.TTY_MODE_FULL:
+ resId = com.android.internal.R.string.peerTtyModeFull;
+ break;
+ case TelecomManager.TTY_MODE_HCO:
+ resId = com.android.internal.R.string.peerTtyModeHco;
+ break;
+ case TelecomManager.TTY_MODE_VCO:
+ resId = com.android.internal.R.string.peerTtyModeVco;
+ break;
+ case TelecomManager.TTY_MODE_OFF:
+ resId = com.android.internal.R.string.peerTtyModeOff;
+ break;
+ }
+ if (resId != 0) {
+ Toast.makeText(mContext, resId, Toast.LENGTH_SHORT).show();
+ }
+ }
+ }
}
/**
diff --git a/src/java/com/android/ims/internal/ImsCallSession.java b/src/java/com/android/ims/internal/ImsCallSession.java
index eeca7a81..2acc433c 100644
--- a/src/java/com/android/ims/internal/ImsCallSession.java
+++ b/src/java/com/android/ims/internal/ImsCallSession.java
@@ -365,6 +365,17 @@ public class ImsCallSession {
ImsReasonInfo reasonInfo) {
// no-op
}
+
+ /**
+ * Called when TTY mode of remote party changed
+ *
+ * @param session IMS session object
+ * @param mode TTY mode of remote party
+ */
+ public void callSessionTtyModeReceived(ImsCallSession session,
+ int mode) {
+ // no-op
+ }
}
private final IImsCallSession miSession;
@@ -1125,8 +1136,7 @@ public class ImsCallSession {
public void callSessionTtyModeReceived(IImsCallSession session,
int mode) {
if (mListener != null) {
- //TODO: UI specific implementation.
- //Vendor UI can listen to this callback to take action on received TTY mode.
+ mListener.callSessionTtyModeReceived(ImsCallSession.this, mode);
}
}
}