diff options
author | Yorke Lee <yorkelee@google.com> | 2015-05-19 15:51:01 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2015-05-22 11:40:21 -0700 |
commit | c16ea5ad67bf454158b364dec2f26c95a879c350 (patch) | |
tree | d711fcd0374d8d82102f81ad74d6f94cd75729d8 /src/com/android/dialer/dialpad/DialpadFragment.java | |
parent | 5a194cd1f573d6c94a6b0e3e14cfabd69e42b856 (diff) |
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
Diffstat (limited to 'src/com/android/dialer/dialpad/DialpadFragment.java')
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 4 |
1 files changed, 4 insertions, 0 deletions
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)) { |