Merge "Fix issue with failing ContactsProviderTest."
am: c5b95938cd
Change-Id: Idefe89ca63dcd88173ced087c0d2609acc2d30b2
diff --git a/src/com/android/providers/contacts/VoicemailPermissions.java b/src/com/android/providers/contacts/VoicemailPermissions.java
index fc83ebc..58e7a14 100644
--- a/src/com/android/providers/contacts/VoicemailPermissions.java
+++ b/src/com/android/providers/contacts/VoicemailPermissions.java
@@ -20,6 +20,7 @@
import android.os.Binder;
import android.telecom.TelecomManager;
import android.telephony.TelephonyManager;
+import android.text.TextUtils;
import com.android.providers.contacts.util.ContactsPermissions;
@@ -42,6 +43,11 @@
}
private boolean isDefaultOrSystemDialer(String callingPackage) {
+ // Note: Mimics previous dependency on DefaultDialerManager; that code just returns false
+ // here if the calling package is empty.
+ if (TextUtils.isEmpty(callingPackage)) {
+ return false;
+ }
TelecomManager tm = mContext.getSystemService(TelecomManager.class);
return (callingPackage.equals(tm.getDefaultDialerPackage())
|| callingPackage.equals(tm.getSystemDialerPackage()));