aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-08-20 07:34:13 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-08-20 07:34:13 +0000
commit0e6c61e7b983ee5fa16fd1e28d6cfb34e0253211 (patch)
tree79fabd0ddce1af92c58a395f605298e87ac4d37c
parent4d28a3be15edeae61d4c47ce78ccb2a6ba63a8e6 (diff)
parent1a252db65342689248230b6dac6aa3cb0052d123 (diff)
downloadims-0e6c61e7b983ee5fa16fd1e28d6cfb34e0253211.tar.gz
release-request-369362fc-cc6c-4cb1-95c0-90b5ac7c52cb-for-git_oc-mr1-release-4288633 snap-temp-L81700000095141745
Change-Id: I3fb48534f4e796b1db77a8b8bdc2d369bda9203a
-rw-r--r--src/java/com/android/ims/ImsManager.java40
1 files changed, 28 insertions, 12 deletions
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java
index 97aa61c5..ccb602bb 100644
--- a/src/java/com/android/ims/ImsManager.java
+++ b/src/java/com/android/ims/ImsManager.java
@@ -38,6 +38,7 @@ import android.telephony.TelephonyManager;
import android.telephony.ims.ImsServiceProxy;
import android.telephony.ims.ImsServiceProxyCompat;
import android.telephony.ims.feature.ImsFeature;
+import android.util.Log;
import com.android.ims.internal.IImsCallSession;
import com.android.ims.internal.IImsConfig;
@@ -358,9 +359,12 @@ public class ImsManager {
return true;
}
- return Settings.Secure.getInt(context.getContentResolver(),
- Settings.Secure.PREFERRED_TTY_MODE, TelecomManager.TTY_MODE_OFF)
- == TelecomManager.TTY_MODE_OFF;
+ TelecomManager tm = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
+ if (tm == null) {
+ Log.w(TAG, "isNonTtyOrTtyOnVolteEnabled: telecom not available");
+ return true;
+ }
+ return tm.getCurrentTtyMode() == TelecomManager.TTY_MODE_OFF;
}
/**
@@ -373,9 +377,12 @@ public class ImsManager {
return true;
}
- return Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.PREFERRED_TTY_MODE, TelecomManager.TTY_MODE_OFF)
- == TelecomManager.TTY_MODE_OFF;
+ TelecomManager tm = (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE);
+ if (tm == null) {
+ Log.w(TAG, "isNonTtyOrTtyOnVolteEnabledForSlot: telecom not available");
+ return true;
+ }
+ return tm.getCurrentTtyMode() == TelecomManager.TTY_MODE_OFF;
}
/**
@@ -1856,6 +1863,21 @@ public class ImsManager {
return mConfig;
}
+ /**
+ * Set the TTY mode. This is the actual tty mode (varies depending on peripheral status)
+ */
+ public void setTtyMode(int ttyMode) throws ImsException {
+ if (!getBooleanCarrierConfigForSlot(
+ CarrierConfigManager.KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL)) {
+ setAdvanced4GMode((ttyMode == TelecomManager.TTY_MODE_OFF) &&
+ isEnhanced4gLteModeSettingEnabledByUserForSlot());
+ }
+ }
+
+ /**
+ * Sets the UI TTY mode. This is the preferred TTY mode that the user sets in the call
+ * settings screen.
+ */
public void setUiTTYMode(Context context, int uiTtyMode, Message onComplete)
throws ImsException {
@@ -1867,12 +1889,6 @@ public class ImsManager {
throw new ImsException("setTTYMode()", e,
ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
}
-
- if (!getBooleanCarrierConfigForSlot(
- CarrierConfigManager.KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL)) {
- setAdvanced4GMode((uiTtyMode == TelecomManager.TTY_MODE_OFF) &&
- isEnhanced4gLteModeSettingEnabledByUserForSlot());
- }
}
private ImsReasonInfo makeACopy(ImsReasonInfo imsReasonInfo) {