aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichele <mberionne@google.com>2019-12-11 14:49:35 -0800
committerMichele <mberionne@google.com>2019-12-11 14:49:35 -0800
commit1c6736fd438a3dec6e602f3e12a612f5800f8d0b (patch)
tree183c50d310246a2e8ae5a4c351767fdb5b819f8b /src
parentb3833b3c1ac3993d2defd74f2f622443f53ef313 (diff)
downloadContactsProvider-1c6736fd438a3dec6e602f3e12a612f5800f8d0b.tar.gz
Use TelephonyManager API to check if device is voice capable.
Bug: 146076403 Test: make Change-Id: I695e811de33cb36b27e07d290f407120fe649ae8
Diffstat (limited to 'src')
-rw-r--r--src/com/android/providers/contacts/ContactsProvider2.java16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index 89f3c709..b92a9178 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -9664,25 +9664,15 @@ public class ContactsProvider2 extends AbstractContactsProvider
@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) {