Moving some abstract classes to interfaces, to better use java-8 features

Change-Id: I862af4931c95cbde052130d8b7d4ac3375db782f
This commit is contained in:
Sunny Goyal
2018-07-09 16:47:01 -07:00
parent ce368154ce
commit 83fd25e3af
11 changed files with 62 additions and 247 deletions

View File

@@ -478,15 +478,11 @@ public class LoaderTask implements Runnable {
}
info = new ShortcutInfo(pinnedShortcut, context);
final ShortcutInfo finalInfo = info;
Provider<Bitmap> fallbackIconProvider = new Provider<Bitmap>() {
@Override
public Bitmap get() {
// If the pinned deep shortcut is no longer published,
// use the last saved icon instead of the default.
return c.loadIcon(finalInfo)
? finalInfo.iconBitmap : null;
}
};
// If the pinned deep shortcut is no longer published,
// use the last saved icon instead of the default.
Provider<Bitmap> fallbackIconProvider = () ->
c.loadIcon(finalInfo) ? finalInfo.iconBitmap : null;
LauncherIcons li = LauncherIcons.obtain(context);
li.createShortcutIcon(pinnedShortcut,
true /* badged */, fallbackIconProvider).applyTo(info);