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/OldSpeedDialFragment.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/OldSpeedDialFragment.java')
-rw-r--r-- | java/com/android/dialer/app/list/OldSpeedDialFragment.java | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/java/com/android/dialer/app/list/OldSpeedDialFragment.java b/java/com/android/dialer/app/list/OldSpeedDialFragment.java index 40fe74565..afc7c133b 100644 --- a/java/com/android/dialer/app/list/OldSpeedDialFragment.java +++ b/java/com/android/dialer/app/list/OldSpeedDialFragment.java @@ -45,18 +45,18 @@ import android.widget.FrameLayout; import android.widget.FrameLayout.LayoutParams; import android.widget.ImageView; import android.widget.ListView; -import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.ContactTileLoaderFactory; import com.android.contacts.common.list.ContactTileView; import com.android.contacts.common.list.OnPhoneNumberPickerActionListener; import com.android.dialer.app.R; -import com.android.dialer.app.widget.EmptyContentView; -import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallSpecificAppData; import com.android.dialer.common.LogUtil; +import com.android.dialer.contactphoto.ContactPhotoManager; import com.android.dialer.util.PermissionsUtil; import com.android.dialer.util.ViewUtil; +import com.android.dialer.widget.EmptyContentView; import java.util.ArrayList; +import java.util.Arrays; /** This fragment displays the user's favorite/frequent contacts in a grid. */ public class OldSpeedDialFragment extends Fragment @@ -404,9 +404,15 @@ public class OldSpeedDialFragment extends Fragment return; } - if (!PermissionsUtil.hasPermission(activity, READ_CONTACTS)) { + String[] deniedPermissions = + PermissionsUtil.getPermissionsCurrentlyDenied( + getContext(), PermissionsUtil.allContactsGroupPermissionsUsedInDialer); + if (deniedPermissions.length > 0) { + LogUtil.i( + "OldSpeedDialFragment.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 { // Switch tabs ((HostInterface) activity).showAllContactsTab(); @@ -430,7 +436,7 @@ public class OldSpeedDialFragment extends Fragment void showAllContactsTab(); } - private class ContactTileLoaderListener implements LoaderManager.LoaderCallbacks<Cursor> { + class ContactTileLoaderListener implements LoaderManager.LoaderCallbacks<Cursor> { @Override public CursorLoader onCreateLoader(int id, Bundle args) { @@ -460,24 +466,17 @@ public class OldSpeedDialFragment extends Fragment private class ContactTileAdapterListener implements ContactTileView.Listener { @Override - public void onContactSelected(Uri contactUri, Rect targetRect) { + public void onContactSelected( + Uri contactUri, Rect targetRect, CallSpecificAppData callSpecificAppData) { if (mPhoneNumberPickerActionListener != null) { - CallSpecificAppData callSpecificAppData = - CallSpecificAppData.newBuilder() - .setCallInitiationType(CallInitiationType.Type.SPEED_DIAL) - .build(); mPhoneNumberPickerActionListener.onPickDataUri( contactUri, false /* isVideoCall */, callSpecificAppData); } } @Override - public void onCallNumberDirectly(String phoneNumber) { + public void onCallNumberDirectly(String phoneNumber, CallSpecificAppData callSpecificAppData) { if (mPhoneNumberPickerActionListener != null) { - CallSpecificAppData callSpecificAppData = - CallSpecificAppData.newBuilder() - .setCallInitiationType(CallInitiationType.Type.SPEED_DIAL) - .build(); mPhoneNumberPickerActionListener.onPickPhoneNumber( phoneNumber, false /* isVideoCall */, callSpecificAppData); } |