From 2a97aff24301b785fb60c36dd134d879ca88b214 Mon Sep 17 00:00:00 2001 From: Chiao Cheng Date: Mon, 30 Sep 2013 15:11:47 -0700 Subject: Default to business avatar for businesses without an image. Bug: 10988291 Change-Id: If06f30fdc6d12d1abcb20cd7a10b8d80a02ab22b --- InCallUI/res/drawable-hdpi/business_unknown.png | Bin 0 -> 1696 bytes InCallUI/res/drawable-hdpi/picture_unknown.png | Bin 3503 -> 4910 bytes InCallUI/res/drawable-mdpi/business_unknown.png | Bin 0 -> 1352 bytes InCallUI/res/drawable-mdpi/picture_unknown.png | Bin 2378 -> 3249 bytes InCallUI/res/drawable-xhdpi/business_unknown.png | Bin 0 -> 2450 bytes InCallUI/res/drawable-xhdpi/picture_unknown.png | Bin 4829 -> 6931 bytes InCallUI/res/drawable-xxhdpi/business_unknown.png | Bin 0 -> 3075 bytes InCallUI/res/drawable-xxhdpi/picture_unknown.png | Bin 22053 -> 8707 bytes .../src/com/android/incallui/ContactInfoCache.java | 6 ++++++ .../android/incallui/service/PhoneNumberService.java | 1 + 10 files changed, 7 insertions(+) create mode 100644 InCallUI/res/drawable-hdpi/business_unknown.png create mode 100644 InCallUI/res/drawable-mdpi/business_unknown.png create mode 100644 InCallUI/res/drawable-xhdpi/business_unknown.png create mode 100644 InCallUI/res/drawable-xxhdpi/business_unknown.png diff --git a/InCallUI/res/drawable-hdpi/business_unknown.png b/InCallUI/res/drawable-hdpi/business_unknown.png new file mode 100644 index 000000000..b369939ec Binary files /dev/null and b/InCallUI/res/drawable-hdpi/business_unknown.png differ diff --git a/InCallUI/res/drawable-hdpi/picture_unknown.png b/InCallUI/res/drawable-hdpi/picture_unknown.png index ba46da151..26d2be16f 100644 Binary files a/InCallUI/res/drawable-hdpi/picture_unknown.png and b/InCallUI/res/drawable-hdpi/picture_unknown.png differ diff --git a/InCallUI/res/drawable-mdpi/business_unknown.png b/InCallUI/res/drawable-mdpi/business_unknown.png new file mode 100644 index 000000000..eac97a9b7 Binary files /dev/null and b/InCallUI/res/drawable-mdpi/business_unknown.png differ diff --git a/InCallUI/res/drawable-mdpi/picture_unknown.png b/InCallUI/res/drawable-mdpi/picture_unknown.png index 995df75b3..1ee333caa 100644 Binary files a/InCallUI/res/drawable-mdpi/picture_unknown.png and b/InCallUI/res/drawable-mdpi/picture_unknown.png differ diff --git a/InCallUI/res/drawable-xhdpi/business_unknown.png b/InCallUI/res/drawable-xhdpi/business_unknown.png new file mode 100644 index 000000000..aa84456e4 Binary files /dev/null and b/InCallUI/res/drawable-xhdpi/business_unknown.png differ diff --git a/InCallUI/res/drawable-xhdpi/picture_unknown.png b/InCallUI/res/drawable-xhdpi/picture_unknown.png index b4bd3666a..db74fd962 100644 Binary files a/InCallUI/res/drawable-xhdpi/picture_unknown.png and b/InCallUI/res/drawable-xhdpi/picture_unknown.png differ diff --git a/InCallUI/res/drawable-xxhdpi/business_unknown.png b/InCallUI/res/drawable-xxhdpi/business_unknown.png new file mode 100644 index 000000000..6273bb324 Binary files /dev/null and b/InCallUI/res/drawable-xxhdpi/business_unknown.png differ diff --git a/InCallUI/res/drawable-xxhdpi/picture_unknown.png b/InCallUI/res/drawable-xxhdpi/picture_unknown.png index 41275930d..38bec2cff 100644 Binary files a/InCallUI/res/drawable-xxhdpi/picture_unknown.png and b/InCallUI/res/drawable-xxhdpi/picture_unknown.png differ diff --git a/InCallUI/src/com/android/incallui/ContactInfoCache.java b/InCallUI/src/com/android/incallui/ContactInfoCache.java index 13f8dd00d..4b482cb4c 100644 --- a/InCallUI/src/com/android/incallui/ContactInfoCache.java +++ b/InCallUI/src/com/android/incallui/ContactInfoCache.java @@ -234,6 +234,12 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete entry.location = oldEntry.location; } + // If no image and it's a business, switch to using the default business avatar. + if (info.getImageUrl() == null && info.isBusiness()) { + Log.d(TAG, "Business has no image. Using default."); + entry.photo = mContext.getResources().getDrawable(R.drawable.business_unknown); + } + // Add the contact info to the cache. mInfoMap.put(mCallId, entry); sendInfoNotifications(mCallId, entry); diff --git a/InCallUI/src/com/android/incallui/service/PhoneNumberService.java b/InCallUI/src/com/android/incallui/service/PhoneNumberService.java index 942bf422f..24303cdfd 100644 --- a/InCallUI/src/com/android/incallui/service/PhoneNumberService.java +++ b/InCallUI/src/com/android/incallui/service/PhoneNumberService.java @@ -67,5 +67,6 @@ public interface PhoneNumberService { public String getPhoneLabel(); public String getNormalizedNumber(); public String getImageUrl(); + public boolean isBusiness(); } } -- cgit v1.2.3