mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Launcher change corresponding to platform change.
Here is platform change : ag/540450 Added try catch block so the APK works on older builds as well. Bug: 17390424 Change-Id: Id5731c65f036e35b71aa74ce6d8ae031107ed60b
This commit is contained in:
@@ -121,12 +121,15 @@ class AppWidgetManagerCompatVL extends AppWidgetManagerCompat {
|
||||
} else {
|
||||
badgeLocation.offset(bitmap.getWidth() - badgeSize - badgeMargin, top);
|
||||
}
|
||||
|
||||
UserManager userManager = (UserManager) mContext.getSystemService(
|
||||
Context.USER_SERVICE);
|
||||
|
||||
Drawable drawable = userManager.getBadgedDrawableForUser(new BitmapDrawable(res, bitmap),
|
||||
info.getProfile(), badgeLocation, 0);
|
||||
Drawable drawable = null;
|
||||
// STOPSHIP(mokani): Remove catch block once dogfood build is bigger than LRW70.
|
||||
// This hack is just to prevent crash in older builds.
|
||||
try {
|
||||
drawable = mPm.getUserBadgedDrawableForDensity(new BitmapDrawable(res, bitmap),
|
||||
info.getProfile(), badgeLocation, 0);
|
||||
} catch (Exception e) {
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
if (drawable instanceof BitmapDrawable) {
|
||||
return ((BitmapDrawable) drawable).getBitmap();
|
||||
|
||||
Reference in New Issue
Block a user