Use TelephonyManager API to check if device is voice capable.
Bug: 146076403
Test: make
Change-Id: I695e811de33cb36b27e07d290f407120fe649ae8
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index 89f3c70..b92a917 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -9664,25 +9664,15 @@
@VisibleForTesting
protected boolean isPhone() {
if (!mIsPhoneInitialized) {
- TelephonyManager tm = getContext().getSystemService(TelephonyManager.class);
- mIsPhone = tm.isVoiceCapable();
+ mIsPhone = isVoiceCapable();
mIsPhoneInitialized = true;
}
return mIsPhone;
}
protected boolean isVoiceCapable() {
- // this copied from com.android.phone.PhoneApp.onCreate():
-
- // "voice capable" flag.
- // This flag currently comes from a resource (which is
- // overrideable on a per-product basis):
- return getContext().getResources()
- .getBoolean(com.android.internal.R.bool.config_voice_capable);
- // ...but this might eventually become a PackageManager "system
- // feature" instead, in which case we'd do something like:
- // return
- // getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY_VOICE_CALLS);
+ TelephonyManager tm = getContext().getSystemService(TelephonyManager.class);
+ return tm.isVoiceCapable();
}
private void undemoteContact(SQLiteDatabase db, long id) {