Fix bug caused by edge case of Math.abs()

This commit is contained in:
cketti 2015-01-03 03:04:44 +01:00
parent 928c7f33a3
commit 65d2de0fcc
1 changed files with 2 additions and 2 deletions

View File

@ -156,8 +156,8 @@ public class ContactPictureLoader {
}
int val = address.hashCode();
int rgb = CONTACT_DUMMY_COLORS_ARGB[Math.abs(val) % CONTACT_DUMMY_COLORS_ARGB.length];
return rgb;
int colorIndex = (val & Integer.MAX_VALUE) % CONTACT_DUMMY_COLORS_ARGB.length;
return CONTACT_DUMMY_COLORS_ARGB[colorIndex];
}
private String calcUnknownContactLetter(Address address) {