mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Change getBadgedLabelForUser to use CharSequence
Bug: 16401636 Change-Id: I7b72a6dd53fec1c0afe6ea33803af9e3c54e597e
This commit is contained in:
@@ -64,8 +64,8 @@ public class IconCache {
|
||||
|
||||
private static class CacheEntry {
|
||||
public Bitmap icon;
|
||||
public String title;
|
||||
public String contentDescription;
|
||||
public CharSequence title;
|
||||
public CharSequence contentDescription;
|
||||
}
|
||||
|
||||
private static class CacheKey {
|
||||
|
||||
@@ -110,7 +110,7 @@ public class ItemInfo {
|
||||
/**
|
||||
* Content description of the item.
|
||||
*/
|
||||
String contentDescription;
|
||||
CharSequence contentDescription;
|
||||
|
||||
/**
|
||||
* The position of the item in a drag-and-drop operation.
|
||||
|
||||
@@ -4720,7 +4720,7 @@ public class Launcher extends Activity
|
||||
public ItemInfo createShortcutDragInfo(Intent shortcutIntent, CharSequence caption,
|
||||
Bitmap icon, UserHandleCompat user) {
|
||||
UserManagerCompat userManager = UserManagerCompat.getInstance(this);
|
||||
String contentDescription = userManager.getBadgedLabelForUser(caption.toString(), user);
|
||||
CharSequence contentDescription = userManager.getBadgedLabelForUser(caption, user);
|
||||
return new ShortcutInfo(shortcutIntent, caption, contentDescription, icon, user);
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ public class ShortcutInfo extends ItemInfo {
|
||||
}
|
||||
}
|
||||
|
||||
ShortcutInfo(Intent intent, CharSequence title, String contentDescription,
|
||||
ShortcutInfo(Intent intent, CharSequence title, CharSequence contentDescription,
|
||||
Bitmap icon, UserHandleCompat user) {
|
||||
this();
|
||||
this.intent = intent;
|
||||
|
||||
@@ -41,5 +41,5 @@ public abstract class UserManagerCompat {
|
||||
public abstract long getSerialNumberForUser(UserHandleCompat user);
|
||||
public abstract UserHandleCompat getUserForSerialNumber(long serialNumber);
|
||||
public abstract Drawable getBadgedDrawableForUser(Drawable unbadged, UserHandleCompat user);
|
||||
public abstract String getBadgedLabelForUser(String label, UserHandleCompat user);
|
||||
public abstract CharSequence getBadgedLabelForUser(CharSequence label, UserHandleCompat user);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class UserManagerCompatV16 extends UserManagerCompat {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getBadgedLabelForUser(String label, UserHandleCompat user) {
|
||||
public CharSequence getBadgedLabelForUser(CharSequence label, UserHandleCompat user) {
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,11 +49,12 @@ public class UserManagerCompatVL extends UserManagerCompatV17 {
|
||||
return mUserManager.getBadgedDrawableForUser(unbadged, user.getUser());
|
||||
}
|
||||
|
||||
public String getBadgedLabelForUser(String label, UserHandleCompat user) {
|
||||
public CharSequence getBadgedLabelForUser(CharSequence label, UserHandleCompat user) {
|
||||
if (user == null) {
|
||||
return label;
|
||||
}
|
||||
return mUserManager.getBadgedLabelForUser(label, user.getUser());
|
||||
// TODO Remove casts when API has made it from lmp-dev -> sdk
|
||||
return (CharSequence) mUserManager.getBadgedLabelForUser((String) label, user.getUser());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user