diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-08-31 16:17:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-08-31 16:17:04 +0000 |
commit | c39ea3c55fac807c0b98aabdf56c70dc8a49036c (patch) | |
tree | e282668a9587cf6c1ec7b604dea860400c75c6c7 /java/com/android/dialer/app/list/AllContactsFragment.java | |
parent | 68038172793ee0e2ab3e2e56ddfbeb82879d1f58 (diff) | |
parent | 2ca4318cc1ee57dda907ba2069bd61d162b1baef (diff) |
Merge "Update Dialer source to latest internal Google revision."
Diffstat (limited to 'java/com/android/dialer/app/list/AllContactsFragment.java')
-rw-r--r-- | java/com/android/dialer/app/list/AllContactsFragment.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/java/com/android/dialer/app/list/AllContactsFragment.java b/java/com/android/dialer/app/list/AllContactsFragment.java index 04609970a..32a99e795 100644 --- a/java/com/android/dialer/app/list/AllContactsFragment.java +++ b/java/com/android/dialer/app/list/AllContactsFragment.java @@ -38,12 +38,16 @@ import com.android.contacts.common.list.ContactEntryListFragment; import com.android.contacts.common.list.ContactListFilter; import com.android.contacts.common.list.DefaultContactListAdapter; import com.android.dialer.app.R; -import com.android.dialer.app.widget.EmptyContentView; -import com.android.dialer.app.widget.EmptyContentView.OnEmptyViewActionButtonClickedListener; +import com.android.dialer.common.LogUtil; import com.android.dialer.compat.CompatUtils; +import com.android.dialer.logging.InteractionEvent; +import com.android.dialer.logging.Logger; import com.android.dialer.util.DialerUtils; import com.android.dialer.util.IntentUtil; import com.android.dialer.util.PermissionsUtil; +import com.android.dialer.widget.EmptyContentView; +import com.android.dialer.widget.EmptyContentView.OnEmptyViewActionButtonClickedListener; +import java.util.Arrays; /** Fragments to show all contacts with phone numbers. */ public class AllContactsFragment extends ContactEntryListFragment<ContactEntryListAdapter> @@ -149,6 +153,8 @@ public class AllContactsFragment extends ContactEntryListFragment<ContactEntryLi public void onItemClick(AdapterView<?> parent, View view, int position, long id) { final Uri uri = (Uri) view.getTag(); if (uri != null) { + Logger.get(getContext()) + .logInteraction(InteractionEvent.Type.OPEN_QUICK_CONTACT_FROM_ALL_CONTACTS_GENERAL); if (CompatUtils.hasPrioritizedMimeType()) { QuickContact.showQuickContact(getContext(), view, uri, null, Phone.CONTENT_ITEM_TYPE); } else { @@ -169,9 +175,15 @@ public class AllContactsFragment extends ContactEntryListFragment<ContactEntryLi return; } - if (!PermissionsUtil.hasPermission(activity, READ_CONTACTS)) { + String[] deniedPermissions = + PermissionsUtil.getPermissionsCurrentlyDenied( + getContext(), PermissionsUtil.allContactsGroupPermissionsUsedInDialer); + if (deniedPermissions.length > 0) { + LogUtil.i( + "AllContactsFragment.onEmptyViewActionButtonClicked", + "Requesting permissions: " + Arrays.toString(deniedPermissions)); FragmentCompat.requestPermissions( - this, new String[] {READ_CONTACTS}, READ_CONTACTS_PERMISSION_REQUEST_CODE); + this, deniedPermissions, READ_CONTACTS_PERMISSION_REQUEST_CODE); } else { // Add new contact DialerUtils.startActivityWithErrorToast( |