Setup make icon-loader library

Bug: 115891474

Test: make -j10 icon-loader
Next step: Launcher will depend on icon-loader in next CL

Change-Id: I797ddb857cf8be79f3be6ca2f174c593ca3713a5
This commit is contained in:
Hyunyoung Song
2018-10-18 15:05:45 -07:00
parent 6083c63e81
commit cda96a5b43
18 changed files with 70 additions and 56 deletions

View File

@@ -153,7 +153,7 @@ public class LoaderCursor extends CursorWrapper {
info.title = getTitle();
// the fallback icon
if (!loadIcon(info)) {
mIconCache.getDefaultIcon(info.user).applyTo(info);
info.applyFrom(mIconCache.getDefaultIcon(info.user));
}
// TODO: If there's an explicit component and we can't install that, delete it.
@@ -176,7 +176,7 @@ public class LoaderCursor extends CursorWrapper {
BitmapInfo iconInfo = li.createIconBitmap(info.iconResource);
li.recycle();
if (iconInfo != null) {
iconInfo.applyTo(info);
info.applyFrom(iconInfo);
return true;
}
}
@@ -185,7 +185,7 @@ public class LoaderCursor extends CursorWrapper {
// Failed to load from resource, try loading from DB.
byte[] data = getBlob(iconIndex);
try (LauncherIcons li = LauncherIcons.obtain(mContext)) {
li.createIconBitmap(BitmapFactory.decodeByteArray(data, 0, data.length)).applyTo(info);
info.applyFrom(li.createIconBitmap(BitmapFactory.decodeByteArray(data, 0, data.length)));
return true;
} catch (Exception e) {
Log.e(TAG, "Failed to load icon for info " + info, e);