diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 05cae9f8bc6dc..4430ea0cc7b4c 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -377,4 +377,17 @@ 2 + + true + diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index aa916e0b70033..92bed8de81eb5 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -912,4 +912,25 @@ public class TelephonyManager { return null; } } + + /** + * @return true if the current device is "voice capable". + *

+ * "Voice capable" means that this device supports circuit-switched + * (i.e. voice) phone calls over the telephony network, and is allowed + * to display the in-call UI while a cellular voice call is active. + * This will be false on "data only" devices which can't make voice + * calls and don't support any in-call UI. + *

+ * Note: the meaning of this flag is subtly different from the + * PackageManager.FEATURE_TELEPHONY system feature, which is available + * on any device with a telephony radio, even if the device is + * data-only. + * + * @hide pending API review + */ + public boolean isVoiceCapable() { + return mContext.getResources().getBoolean( + com.android.internal.R.bool.config_voice_capable); + } }