Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9798eea8 authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Check carrier presence when displaying the "video call" button." into...

Merge "Check carrier presence when displaying the "video call" button." into ub-contactsdialer-b-dev
parents 63730319 0a8f9736
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -483,7 +483,7 @@ public class ContactSelectionActivity extends ContactsActivity
    private final class PhoneNumberPickerActionListener implements
            OnPhoneNumberPickerActionListener {
        @Override
        public void onPickDataUri(Uri dataUri, int callInitiationType) {
        public void onPickDataUri(Uri dataUri, boolean isVideoCall, int callInitiationType) {
            returnPickerResult(dataUri);
        }

+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ public class LegacyPhoneNumberPickerFragment extends PhoneNumberPickerFragment {
    }

    @Override
    protected void startPhoneNumberShortcutIntent(Uri uri) {
    protected void startPhoneNumberShortcutIntent(Uri uri, boolean isVideoCall) {
        throw new UnsupportedOperationException();
    }

+18 −9
Original line number Diff line number Diff line
@@ -1865,12 +1865,16 @@ public class QuickContactActivity extends ContactsActivity
                smsContentDescription = com.android.contacts.common.util.ContactDisplayUtils
                        .getTelephoneTtsSpannable(alternateContentDescription.toString(), header);

                int videoCapability = CallUtil.getVideoCallingAvailability(context);
                boolean isPresenceEnabled =
                        (videoCapability & CallUtil.VIDEO_CALLING_PRESENCE) != 0;
                boolean isVideoEnabled = (videoCapability & CallUtil.VIDEO_CALLING_ENABLED) != 0;

                if (CallUtil.isCallWithSubjectSupported(context)) {
                    thirdIcon = res.getDrawable(R.drawable.ic_call_note_white_24dp);
                    thirdAction = Entry.ACTION_CALL_WITH_SUBJECT;
                    thirdContentDescription =
                            res.getString(R.string.call_with_a_note);

                    // Create a bundle containing the data the call subject dialog requires.
                    thirdExtras = new Bundle();
                    thirdExtras.putLong(CallSubjectDialog.ARG_PHOTO_ID,
@@ -1888,8 +1892,12 @@ public class QuickContactActivity extends ContactsActivity
                            phone.getFormattedPhoneNumber());
                    thirdExtras.putString(CallSubjectDialog.ARG_NUMBER_LABEL,
                            phoneLabel);
                } else if (CallUtil.isVideoEnabled(context)) {
                    // Add video call button if supported
                } else if (isVideoEnabled) {
                    // Check to ensure carrier presence indicates the number supports video calling.
                    int carrierPresence = dataItem.getCarrierPresence();
                    boolean isPresent = (carrierPresence & Phone.CARRIER_PRESENCE_VT_CAPABLE) != 0;

                    if ((isPresenceEnabled && isPresent) || !isPresenceEnabled) {
                        thirdIcon = res.getDrawable(R.drawable.ic_videocam);
                        thirdAction = Entry.ACTION_INTENT;
                        thirdIntent = CallUtil.getVideoCallIntent(phone.getNumber(),
@@ -1898,6 +1906,7 @@ public class QuickContactActivity extends ContactsActivity
                                res.getString(R.string.description_video_call);
                    }
                }
            }
        } else if (dataItem instanceof EmailDataItem) {
            final EmailDataItem email = (EmailDataItem) dataItem;
            final String address = email.getData();