Skip to content

Commit 3d4069a

Browse files
author
Eric Laurent
committed
Allow TTY mode for GSM Phones
TTY mode should not be restricted to CDMA phones as some GSM carriers support it. TTY support is enabled by overlaying the tty_enabled boolean property in packages/apps/Phones/res/values/config.xml Also corrected wrong comments on TTY methods. Change-Id: I48dbc2be51c3dcdaedc1838b85134edc7012be3c
1 parent cbf0983 commit 3d4069a

File tree

5 files changed

+32
-34
lines changed

5 files changed

+32
-34
lines changed

telephony/java/com/android/internal/telephony/CommandsInterface.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,18 +1305,25 @@ void setFacilityLock (String facility, boolean lockState, String password,
13051305
void setCdmaSubscription(int cdmaSubscriptionType, Message response);
13061306

13071307
/**
1308-
* Set the TTY mode for the CDMA phone
1308+
* Set the TTY mode
13091309
*
1310-
* @param enable is true to enable, false to disable
1310+
* @param ttyMode one of the following:
1311+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
1312+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
1313+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
1314+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
13111315
* @param response is callback message
13121316
*/
13131317
void setTTYMode(int ttyMode, Message response);
13141318

13151319
/**
1316-
* Query the TTY mode for the CDMA phone
1320+
* Query the TTY mode
13171321
* (AsyncResult)response.obj).result is an int[] with element [0] set to
1318-
* 0 for disabled, 1 for enabled.
1319-
*
1322+
* tty mode:
1323+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
1324+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
1325+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
1326+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
13201327
* @param response is callback message
13211328
*/
13221329
void queryTTYMode(Message response);

telephony/java/com/android/internal/telephony/Phone.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,9 +1463,11 @@ void selectNetworkManually(NetworkInfo network,
14631463
/**
14641464
* setTTYMode
14651465
* sets a TTY mode option.
1466-
*
1467-
* @param ttyMode is a boolean representing the state that you are
1468-
* requesting, true for enabled, false for disabled.
1466+
* @param ttyMode is a one of the following:
1467+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
1468+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
1469+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
1470+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
14691471
* @param onComplete a callback message when the action is completed
14701472
*/
14711473
void setTTYMode(int ttyMode, Message onComplete);

telephony/java/com/android/internal/telephony/PhoneBase.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -697,13 +697,11 @@ public void setSmscAddress(String address, Message result) {
697697
}
698698

699699
public void setTTYMode(int ttyMode, Message onComplete) {
700-
// This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
701-
logUnexpectedCdmaMethodCall("setTTYMode");
700+
mCM.setTTYMode(ttyMode, onComplete);
702701
}
703702

704703
public void queryTTYMode(Message onComplete) {
705-
// This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
706-
logUnexpectedCdmaMethodCall("queryTTYMode");
704+
mCM.queryTTYMode(onComplete);
707705
}
708706

709707
public void enableEnhancedVoicePrivacy(boolean enable, Message onComplete) {

telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,20 +1142,6 @@ public IccFileHandler getIccFileHandler() {
11421142
return this.mIccFileHandler;
11431143
}
11441144

1145-
/**
1146-
* Set the TTY mode of the CDMAPhone
1147-
*/
1148-
public void setTTYMode(int ttyMode, Message onComplete) {
1149-
this.mCM.setTTYMode(ttyMode, onComplete);
1150-
}
1151-
1152-
/**
1153-
* Queries the TTY mode of the CDMAPhone
1154-
*/
1155-
public void queryTTYMode(Message onComplete) {
1156-
this.mCM.queryTTYMode(onComplete);
1157-
}
1158-
11591145
/**
11601146
* Activate or deactivate cell broadcast SMS.
11611147
*

telephony/java/com/android/internal/telephony/test/SimulatedCommands.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,23 +1402,28 @@ public void setPreferredVoicePrivacy(boolean enable, Message result) {
14021402
}
14031403

14041404
/**
1405-
* Set the TTY mode for the CDMA phone
1405+
* Set the TTY mode
14061406
*
1407-
* @param enable is true to enable, false to disable
1408-
* @param serviceClass is a sum of SERVICE_CLASS_*
1407+
* @param ttyMode is one of the following:
1408+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
1409+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
1410+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
1411+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
14091412
* @param response is callback message
14101413
*/
14111414
public void setTTYMode(int ttyMode, Message response) {
1412-
Log.w(LOG_TAG, "CDMA not implemented in SimulatedCommands");
1415+
Log.w(LOG_TAG, "Not implemented in SimulatedCommands");
14131416
unimplemented(response);
14141417
}
14151418

14161419
/**
1417-
* Query the TTY mode for the CDMA phone
1420+
* Query the TTY mode
14181421
* (AsyncResult)response.obj).result is an int[] with element [0] set to
1419-
* 0 for disabled, 1 for enabled.
1420-
*
1421-
* @param serviceClass is a sum of SERVICE_CLASS_*
1422+
* tty mode:
1423+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
1424+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
1425+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
1426+
* - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
14221427
* @param response is callback message
14231428
*/
14241429
public void queryTTYMode(Message response) {

0 commit comments

Comments
 (0)