From c16ea5ad67bf454158b364dec2f26c95a879c350 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Tue, 19 May 2015 15:51:01 -0700 Subject: Handle runtime permissions in Dialer Conditionally disable the following features if the required permissions are not available: 1) Display of all contacts 2) Display of speed dial 3) Caller ID in call log 4) Import/export contacts 5) Conversion of People.CONTENT_ITEM_TYPE and Phones.CONTENT_ITEM_TYPE into a phone number (via DIAL intent) 6) UndemoteOutgoingCallReceiver 7) Contact Search 8) Contact lookup in call detail activity 9) Nearby places search Bug: 20266292 Change-Id: I6d26902acb0eac407ae7bc18c11aa6ec57299506 --- src/com/android/dialer/dialpad/DialpadFragment.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/com/android/dialer/dialpad/DialpadFragment.java') diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 8d27c143b..de1d44f89 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -70,6 +70,7 @@ import android.widget.TextView; import com.android.contacts.common.ContactsUtils; import com.android.contacts.common.GeoUtil; +import com.android.contacts.common.util.PermissionsUtil; import com.android.contacts.common.util.PhoneNumberFormatter; import com.android.contacts.common.util.StopWatch; import com.android.contacts.common.widget.FloatingActionButtonController; @@ -441,6 +442,9 @@ public class DialpadFragment extends Fragment setFormattedDigits(converted, null); return true; } else { + if (!PermissionsUtil.hasContactsPermissions(getActivity())) { + return false; + } String type = intent.getType(); if (People.CONTENT_ITEM_TYPE.equals(type) || Phones.CONTENT_ITEM_TYPE.equals(type)) { -- cgit v1.2.3