Add shortcut title into pin label. Without shortcut title, the pin label does not make sense in non-English string.

Bug: 232198467
Test: manual test on local phone
Change-Id: I5a4760ffed87ed3e573eb4c48ef754e641853f61
This commit is contained in:
Song Hu
2022-05-11 15:06:05 -07:00
parent e10b6c4df4
commit 82b7fd414d

View File

@@ -269,7 +269,7 @@ public class ChooserTargetActionsDialogFragment extends DialogFragment
protected CharSequence getItemLabel(DisplayResolveInfo dri) { protected CharSequence getItemLabel(DisplayResolveInfo dri) {
final PackageManager pm = getContext().getPackageManager(); final PackageManager pm = getContext().getPackageManager();
return getPinLabel(isPinned(dri), return getPinLabel(isPinned(dri),
isShortcutTarget() ? "" : dri.getResolveInfo().loadLabel(pm)); isShortcutTarget() ? mShortcutTitle : dri.getResolveInfo().loadLabel(pm));
} }
@Nullable @Nullable