Messaging: Improve letter render decisioning for avatar
Change-Id: I263e617cf6fc058301537a6f2dc7d052bed6487a Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
@@ -161,7 +161,8 @@ public class AvatarUriUtil {
|
|||||||
public static Uri createAvatarUri(final Uri profilePhotoUri, final CharSequence name,
|
public static Uri createAvatarUri(final Uri profilePhotoUri, final CharSequence name,
|
||||||
final String defaultIdentifier, final String contactLookupKey) {
|
final String defaultIdentifier, final String contactLookupKey) {
|
||||||
Uri generatedUri;
|
Uri generatedUri;
|
||||||
if (!TextUtils.isEmpty(name) && isValidFirstCharacter(name)) {
|
if (name != null && !TextUtils.isEmpty(name)
|
||||||
|
&& Character.isLetter(name.charAt(0))) {
|
||||||
generatedUri = AvatarUriUtil.fromName(name, contactLookupKey);
|
generatedUri = AvatarUriUtil.fromName(name, contactLookupKey);
|
||||||
} else {
|
} else {
|
||||||
final String identifier = TextUtils.isEmpty(contactLookupKey)
|
final String identifier = TextUtils.isEmpty(contactLookupKey)
|
||||||
@@ -180,11 +181,6 @@ public class AvatarUriUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isValidFirstCharacter(final CharSequence name) {
|
|
||||||
final char c = name.charAt(0);
|
|
||||||
return c != '+';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an avatar URI used for the SIM selector.
|
* Creates an avatar URI used for the SIM selector.
|
||||||
* @param participantData the self participant data for an <i>active</i> SIM
|
* @param participantData the self participant data for an <i>active</i> SIM
|
||||||
|
|||||||
Reference in New Issue
Block a user