Loading src/com/android/dialer/calllog/CallLogAdapter.java +6 −2 Original line number Diff line number Diff line Loading @@ -758,7 +758,11 @@ public class CallLogAdapter extends GroupingListAdapter final PhoneCallDetails details; views.reported = info.isBadData; views.isExternal = mContactInfoHelper.isExternal(info.sourceType); // The entry can only be reported as invalid if it has a valid ID and the source of the // entry supports marking entries as invalid. views.canBeReportedAsInvalid = mContactInfoHelper.canReportAsInvalid(info.sourceType, info.objectId); // Restore expansion state of the row on rebind. Inflate the actions ViewStub if required, // and set its visibility state accordingly. Loading Loading @@ -1023,7 +1027,7 @@ public class CallLogAdapter extends GroupingListAdapter views.rowId, views.callIds, null) ); if (views.isExternal && !views.reported) { if (views.canBeReportedAsInvalid && !views.reported) { views.reportButtonView.setVisibility(View.VISIBLE); } else { views.reportButtonView.setVisibility(View.GONE); Loading src/com/android/dialer/calllog/CallLogListItemViews.java +3 −2 Original line number Diff line number Diff line Loading @@ -108,9 +108,10 @@ public final class CallLogListItemViews { public boolean reported; /** * Whether or not the contact info came from a source other than the android contacts provider. * Whether or not the contact info can be marked as invalid from the source where * it was obtained. */ public boolean isExternal; public boolean canBeReportedAsInvalid; private CallLogListItemViews(QuickContactBadge quickContactView, View primaryActionView, PhoneCallDetailsViews phoneCallDetailsViews, View callLogEntryView, Loading src/com/android/dialer/calllog/ContactInfo.java +3 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ public class ContactInfo { /** The high-res photo for the contact, if available. */ public Uri photoUri; public boolean isBadData; public String objectId; public static ContactInfo EMPTY = new ContactInfo(); Loading Loading @@ -73,6 +74,7 @@ public class ContactInfo { if (!TextUtils.equals(normalizedNumber, other.normalizedNumber)) return false; if (photoId != other.photoId) return false; if (!UriUtils.areEqual(photoUri, other.photoUri)) return false; if (!TextUtils.equals(objectId, other.objectId)) return false; return true; } Loading @@ -81,6 +83,6 @@ public class ContactInfo { return Objects.toStringHelper(this).add("lookupUri", lookupUri).add("name", name).add( "type", type).add("label", label).add("number", number).add("formattedNumber", formattedNumber).add("normalizedNumber", normalizedNumber).add("photoId", photoId) .add("photoUri", photoUri).toString(); .add("photoUri", photoUri).add("objectId", objectId).toString(); } } src/com/android/dialer/calllog/ContactInfoHelper.java +9 −6 Original line number Diff line number Diff line Loading @@ -294,14 +294,17 @@ public class ContactInfoHelper { } /** * Given a contact's sourceType, return true if the contact came from an * external source. * This function looks at a contact's source and determines if the user can * mark caller ids from this source as invalid. * * @param sourceType sourceType of the contact. This is usually populated by * {@link #mCachedNumberLookupService}. * @param sourceType The source type to be checked * @param objectId The ID of the Contact object. * @return true if contacts from this source can be marked with an invalid caller id */ public boolean isExternal(int sourceType) { public boolean canReportAsInvalid(int sourceType, String objectId) { return mCachedNumberLookupService != null && mCachedNumberLookupService.isExternal(sourceType); && mCachedNumberLookupService.canReportAsInvalid(sourceType, objectId); } } src/com/android/dialer/service/CachedNumberLookupService.java +1 −2 Original line number Diff line number Diff line Loading @@ -34,8 +34,7 @@ public interface CachedNumberLookupService { public boolean isCacheUri(String uri); public boolean isBusiness(int sourceType); public boolean isExternal(int sourceType); public boolean canReportAsInvalid(int sourceType, String objectId); public boolean addPhoto(Context context, String number, byte[] photo); Loading Loading
src/com/android/dialer/calllog/CallLogAdapter.java +6 −2 Original line number Diff line number Diff line Loading @@ -758,7 +758,11 @@ public class CallLogAdapter extends GroupingListAdapter final PhoneCallDetails details; views.reported = info.isBadData; views.isExternal = mContactInfoHelper.isExternal(info.sourceType); // The entry can only be reported as invalid if it has a valid ID and the source of the // entry supports marking entries as invalid. views.canBeReportedAsInvalid = mContactInfoHelper.canReportAsInvalid(info.sourceType, info.objectId); // Restore expansion state of the row on rebind. Inflate the actions ViewStub if required, // and set its visibility state accordingly. Loading Loading @@ -1023,7 +1027,7 @@ public class CallLogAdapter extends GroupingListAdapter views.rowId, views.callIds, null) ); if (views.isExternal && !views.reported) { if (views.canBeReportedAsInvalid && !views.reported) { views.reportButtonView.setVisibility(View.VISIBLE); } else { views.reportButtonView.setVisibility(View.GONE); Loading
src/com/android/dialer/calllog/CallLogListItemViews.java +3 −2 Original line number Diff line number Diff line Loading @@ -108,9 +108,10 @@ public final class CallLogListItemViews { public boolean reported; /** * Whether or not the contact info came from a source other than the android contacts provider. * Whether or not the contact info can be marked as invalid from the source where * it was obtained. */ public boolean isExternal; public boolean canBeReportedAsInvalid; private CallLogListItemViews(QuickContactBadge quickContactView, View primaryActionView, PhoneCallDetailsViews phoneCallDetailsViews, View callLogEntryView, Loading
src/com/android/dialer/calllog/ContactInfo.java +3 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ public class ContactInfo { /** The high-res photo for the contact, if available. */ public Uri photoUri; public boolean isBadData; public String objectId; public static ContactInfo EMPTY = new ContactInfo(); Loading Loading @@ -73,6 +74,7 @@ public class ContactInfo { if (!TextUtils.equals(normalizedNumber, other.normalizedNumber)) return false; if (photoId != other.photoId) return false; if (!UriUtils.areEqual(photoUri, other.photoUri)) return false; if (!TextUtils.equals(objectId, other.objectId)) return false; return true; } Loading @@ -81,6 +83,6 @@ public class ContactInfo { return Objects.toStringHelper(this).add("lookupUri", lookupUri).add("name", name).add( "type", type).add("label", label).add("number", number).add("formattedNumber", formattedNumber).add("normalizedNumber", normalizedNumber).add("photoId", photoId) .add("photoUri", photoUri).toString(); .add("photoUri", photoUri).add("objectId", objectId).toString(); } }
src/com/android/dialer/calllog/ContactInfoHelper.java +9 −6 Original line number Diff line number Diff line Loading @@ -294,14 +294,17 @@ public class ContactInfoHelper { } /** * Given a contact's sourceType, return true if the contact came from an * external source. * This function looks at a contact's source and determines if the user can * mark caller ids from this source as invalid. * * @param sourceType sourceType of the contact. This is usually populated by * {@link #mCachedNumberLookupService}. * @param sourceType The source type to be checked * @param objectId The ID of the Contact object. * @return true if contacts from this source can be marked with an invalid caller id */ public boolean isExternal(int sourceType) { public boolean canReportAsInvalid(int sourceType, String objectId) { return mCachedNumberLookupService != null && mCachedNumberLookupService.isExternal(sourceType); && mCachedNumberLookupService.canReportAsInvalid(sourceType, objectId); } }
src/com/android/dialer/service/CachedNumberLookupService.java +1 −2 Original line number Diff line number Diff line Loading @@ -34,8 +34,7 @@ public interface CachedNumberLookupService { public boolean isCacheUri(String uri); public boolean isBusiness(int sourceType); public boolean isExternal(int sourceType); public boolean canReportAsInvalid(int sourceType, String objectId); public boolean addPhoto(Context context, String number, byte[] photo); Loading