diff options
Diffstat (limited to 'java/com/android/dialer/precall/impl')
-rw-r--r-- | java/com/android/dialer/precall/impl/CallingAccountSelector.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/java/com/android/dialer/precall/impl/CallingAccountSelector.java b/java/com/android/dialer/precall/impl/CallingAccountSelector.java index d5ee0f278..e92832947 100644 --- a/java/com/android/dialer/precall/impl/CallingAccountSelector.java +++ b/java/com/android/dialer/precall/impl/CallingAccountSelector.java @@ -62,6 +62,7 @@ import com.android.dialer.preferredsim.PreferredSimFallbackContract.PreferredSim import com.android.dialer.preferredsim.suggestion.SimSuggestionComponent; import com.android.dialer.preferredsim.suggestion.SuggestionProvider.Suggestion; import com.android.dialer.telecom.TelecomUtil; +import com.android.dialer.util.PermissionsUtil; import com.google.common.base.Optional; import com.google.common.collect.ImmutableSet; import java.util.ArrayList; @@ -311,6 +312,12 @@ public class CallingAccountSelector implements PreCallAction { if (!isPreferredSimEnabled(context)) { return result; } + if (!PermissionsUtil.hasContactsReadPermissions(context)) { + LogUtil.i( + "CallingAccountSelector.PreferredAccountWorker.doInBackground", + "missing READ_CONTACTS permission"); + return result; + } result.dataId = getDataId(context, phoneNumber); if (result.dataId.isPresent()) { result.phoneAccountHandle = getPreferredAccount(context, result.dataId.get()); |