Skip to content

Commit ce83c37

Browse files
amirzaidiSirRGB
authored andcommitted
Launcher3: Load backported notification icon from correct package
Conflicts: src/com/android/launcher3/notification/NotificationInfo.java
1 parent 4f319d9 commit ce83c37

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/com/android/launcher3/notification/NotificationInfo.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import android.app.Notification;
2121
import android.app.PendingIntent;
2222
import android.content.Context;
23+
import android.content.pm.PackageManager;
24+
import android.content.res.Resources;
2325
import android.graphics.drawable.BitmapDrawable;
2426
import android.graphics.drawable.Drawable;
2527
import android.graphics.drawable.Icon;
@@ -76,9 +78,13 @@ public NotificationInfo(Context context, StatusBarNotification statusBarNotifica
7678
mIconColor = statusBarNotification.getNotification().color;
7779
mIsIconLarge = false;
7880
} else {
79-
// Use the large icon.
80-
mIconDrawable = icon.loadDrawable(context);
81-
mIsIconLarge = true;
81+
try {
82+
String pkg = statusBarNotification.getPackageName();
83+
Resources res = context.getPackageManager().getResourcesForApplication(pkg);
84+
mIconDrawable = res.getDrawable(notification.icon);
85+
} catch (PackageManager.NameNotFoundException | Resources.NotFoundException e) {
86+
e.printStackTrace();
87+
}
8288
}
8389
if (mIconDrawable == null) {
8490
mIconDrawable = new BitmapDrawable(context.getResources(), LauncherAppState

0 commit comments

Comments
 (0)