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

Commit ed08842e authored by maxwen's avatar maxwen Committed by Michael Bestas
Browse files

Contacts: silence logs about getDrawable without theme

Change-Id: Iee447be43a3d86cffdcbb1a2110e009c02b2b284
parent e7547318
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -1575,7 +1575,7 @@ public class QuickContactActivity extends ContactsActivity {
                phoneContentDescription = com.android.contacts.util.ContactDisplayUtils
                        .getTelephoneTtsSpannable(primaryContentDescription.toString(), header);
                iconResourceId = R.drawable.quantum_ic_phone_vd_theme_24;
                icon = res.getDrawable(iconResourceId);
                icon = context.getDrawable(iconResourceId);
                if (PhoneCapabilityTester.isPhone(context)) {
                    intent = CallUtil.getCallIntent(phone.getNumber());
                    intent.putExtra(EXTRA_ACTION_TYPE, ActionType.CALL);
@@ -1584,7 +1584,7 @@ public class QuickContactActivity extends ContactsActivity {
                        Uri.fromParts(ContactsUtils.SCHEME_SMSTO, phone.getNumber(), null));
                alternateIntent.putExtra(EXTRA_ACTION_TYPE, ActionType.SMS);

                alternateIcon = res.getDrawable(R.drawable.quantum_ic_message_vd_theme_24);
                alternateIcon = context.getDrawable(R.drawable.quantum_ic_message_vd_theme_24);
                alternateContentDescription.append(res.getString(R.string.sms_custom, header));
                smsContentDescription = com.android.contacts.util.ContactDisplayUtils
                        .getTelephoneTtsSpannable(alternateContentDescription.toString(), header);
@@ -1598,7 +1598,8 @@ public class QuickContactActivity extends ContactsActivity {
                boolean isPresent = (carrierPresence & Phone.CARRIER_PRESENCE_VT_CAPABLE) != 0;

                if (CallUtil.isCallWithSubjectSupported(context)) {
                    thirdIcon = res.getDrawable(R.drawable.quantum_ic_perm_phone_msg_vd_theme_24);
                    thirdIcon =
                            context.getDrawable(R.drawable.quantum_ic_perm_phone_msg_vd_theme_24);
                    thirdAction = Entry.ACTION_CALL_WITH_SUBJECT;
                    thirdContentDescription =
                            res.getString(R.string.call_with_a_note);
@@ -1620,7 +1621,7 @@ public class QuickContactActivity extends ContactsActivity {
                    thirdExtras.putString(CallSubjectDialog.ARG_NUMBER_LABEL,
                            phoneLabel);
                } else if (isVideoEnabled && (!isPresenceEnabled || isPresent)) {
                    thirdIcon = res.getDrawable(R.drawable.quantum_ic_videocam_vd_theme_24);
                    thirdIcon = context.getDrawable(R.drawable.quantum_ic_videocam_vd_theme_24);
                    thirdAction = Entry.ACTION_INTENT;
                    thirdIntent = CallUtil.getVideoCallIntent(phone.getNumber(),
                            CALL_ORIGIN_QUICK_CONTACTS_ACTIVITY);
@@ -1629,7 +1630,7 @@ public class QuickContactActivity extends ContactsActivity {
                            res.getString(R.string.description_video_call);
                } else if (CallUtil.isTachyonEnabled(context)
                        && ((PhoneDataItem) dataItem).isTachyonReachable()) {
                    thirdIcon = res.getDrawable(R.drawable.quantum_ic_videocam_vd_theme_24);
                    thirdIcon = context.getDrawable(R.drawable.quantum_ic_videocam_vd_theme_24);
                    thirdAction = Entry.ACTION_INTENT;
                    thirdIntent = new Intent(TACHYON_CALL_ACTION);
                    thirdIntent.setData(
@@ -1657,7 +1658,7 @@ public class QuickContactActivity extends ContactsActivity {
                }
                primaryContentDescription.append(header);
                iconResourceId = R.drawable.quantum_ic_email_vd_theme_24;
                icon = res.getDrawable(iconResourceId);
                icon = context.getDrawable(iconResourceId);
            }
        } else if (dataItem instanceof StructuredPostalDataItem) {
            StructuredPostalDataItem postal = (StructuredPostalDataItem) dataItem;
@@ -1679,11 +1680,11 @@ public class QuickContactActivity extends ContactsActivity {
                alternateIntent =
                        StructuredPostalUtils.getViewPostalAddressDirectionsIntent(postalAddress);
                alternateIntent.putExtra(EXTRA_ACTION_TYPE, ActionType.DIRECTIONS);
                alternateIcon = res.getDrawable(R.drawable.quantum_ic_directions_vd_theme_24);
                alternateIcon = context.getDrawable(R.drawable.quantum_ic_directions_vd_theme_24);
                alternateContentDescription.append(res.getString(
                        R.string.content_description_directions)).append(" ").append(header);
                iconResourceId = R.drawable.quantum_ic_place_vd_theme_24;
                icon = res.getDrawable(iconResourceId);
                icon = context.getDrawable(iconResourceId);
            }
        } else if (dataItem instanceof SipAddressDataItem) {
            final SipAddressDataItem sip = (SipAddressDataItem) dataItem;
@@ -1707,7 +1708,7 @@ public class QuickContactActivity extends ContactsActivity {
                }
                primaryContentDescription.append(header);
                iconResourceId = R.drawable.quantum_ic_dialer_sip_vd_theme_24;
                icon = res.getDrawable(iconResourceId);
                icon = context.getDrawable(iconResourceId);
            }
        } else if (dataItem instanceof StructuredNameDataItem) {
            // If the name is already set and this is not the super primary value then leave the
@@ -1743,8 +1744,8 @@ public class QuickContactActivity extends ContactsActivity {
                    // If a secondDataItem is available, use it to build an entry with
                    // alternate actions
                    if (secondDataItem != null) {
                        icon = res.getDrawable(R.drawable.quantum_ic_hangout_vd_theme_24);
                        alternateIcon = res.getDrawable(
                        icon = context.getDrawable(R.drawable.quantum_ic_hangout_vd_theme_24);
                        alternateIcon = context.getDrawable(
                                R.drawable.quantum_ic_hangout_video_vd_theme_24);
                        final HangoutsDataItemModel itemModel =
                                new HangoutsDataItemModel(intent, alternateIntent,
@@ -1759,9 +1760,10 @@ public class QuickContactActivity extends ContactsActivity {
                        text = itemModel.text;
                    } else {
                        if (HANGOUTS_DATA_5_VIDEO.equals(intent.getDataString())) {
                            icon = res.getDrawable(R.drawable.quantum_ic_hangout_video_vd_theme_24);
                            icon = context.getDrawable(
                                    R.drawable.quantum_ic_hangout_video_vd_theme_24);
                        } else {
                            icon = res.getDrawable(R.drawable.quantum_ic_hangout_vd_theme_24);
                            icon = context.getDrawable(R.drawable.quantum_ic_hangout_vd_theme_24);
                        }
                    }
                } else {