1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 18:59:01 +00:00

Use hashed email/name for shortcut ID

This commit is contained in:
M66B 2021-08-06 10:08:52 +02:00
parent 7cb2635594
commit 176aa6d24b

View file

@ -247,7 +247,7 @@ class Shortcuts {
circular && !identicon ? null : Helper.dp2pixels(context, 3)); circular && !identicon ? null : Helper.dp2pixels(context, 3));
IconCompat icon = IconCompat.createWithBitmap(bitmap); IconCompat icon = IconCompat.createWithBitmap(bitmap);
String id = (name == null ? email : "\"" + name + "\" <" + email + ">"); String id = Integer.toHexString(Objects.hash(name, email));
Set<String> categories = new HashSet<>(Arrays.asList(BuildConfig.APPLICATION_ID + ".TEXT_SHARE_TARGET")); Set<String> categories = new HashSet<>(Arrays.asList(BuildConfig.APPLICATION_ID + ".TEXT_SHARE_TARGET"));
ShortcutInfoCompat.Builder builder = new ShortcutInfoCompat.Builder(context, id) ShortcutInfoCompat.Builder builder = new ShortcutInfoCompat.Builder(context, id)
.setIcon(icon) .setIcon(icon)