TTY: Telecomm
This CL makes the following changes:
1. Added TtyManager. This class contains code that used
to live in PhoneGlobals to listen to preferred TTY
mode changes. Current TTY mode is based on the
preferred mode, wired headset state, and device TTY
support.
2. Moved ownership of WiredHeadsetManager to CallsManager
so that TtyManager can listen to headset plugged events.
3. Added plumbing to TelecommServiceImpl to impement
isTtySupported and getCurrentTtyMode.
4. Added tty_enabled to config.xml. This is moved over
from Telephony.
Change-Id: I652b095af30cc2732a06829dc23492e5355660da
diff --git a/src/com/android/telecomm/TelecommServiceImpl.java b/src/com/android/telecomm/TelecommServiceImpl.java
index 9bf4987..509307b 100644
--- a/src/com/android/telecomm/TelecommServiceImpl.java
+++ b/src/com/android/telecomm/TelecommServiceImpl.java
@@ -80,6 +80,12 @@
case MSG_CANCEL_MISSED_CALLS_NOTIFICATION:
mMissedCallNotifier.clearMissedCalls();
break;
+ case MSG_IS_TTY_SUPPORTED:
+ result = mCallsManager.isTtySupported();
+ break;
+ case MSG_GET_CURRENT_TTY_MODE:
+ result = mCallsManager.getCurrentTtyMode();
+ break;
}
if (result != null) {
@@ -102,6 +108,8 @@
private static final int MSG_END_CALL = 3;
private static final int MSG_ACCEPT_RINGING_CALL = 4;
private static final int MSG_CANCEL_MISSED_CALLS_NOTIFICATION = 5;
+ private static final int MSG_IS_TTY_SUPPORTED = 6;
+ private static final int MSG_GET_CURRENT_TTY_MODE = 7;
/** The singleton instance. */
private static TelecommServiceImpl sInstance;
@@ -320,6 +328,24 @@
return retval;
}
+ /**
+ * @see TelecommManager#isTtySupported
+ */
+ @Override
+ public boolean isTtySupported() {
+ enforceReadPermission();
+ return (boolean) sendRequest(MSG_IS_TTY_SUPPORTED);
+ }
+
+ /**
+ * @see TelecommManager#getCurrentTtyMode
+ */
+ @Override
+ public int getCurrentTtyMode() {
+ enforceReadPermission();
+ return (int) sendRequest(MSG_GET_CURRENT_TTY_MODE);
+ }
+
//
// Supporting methods for the ITelecommService interface implementation.
//