@@ -352,10 +352,10 @@ public void sendToNotificationCentreWithPicture(Bundle bundle, Bitmap largeIconB
352352
353353 String smallIcon = bundle .getString ("smallIcon" );
354354
355- if (smallIcon != null ) {
356- smallIconResId = res .getIdentifier (smallIcon , "mipmap" , packageName );
357- } else if (! smallIcon . isEmpty () ) {
358- smallIconResId = res .getIdentifier ("ic_notification" , "mipmap" , packageName );
355+ if (smallIcon != null && ! smallIcon . isEmpty () ) {
356+ smallIconResId = res .getIdentifier (smallIcon , "mipmap" , packageName );
357+ } else if ( smallIcon == null ) {
358+ smallIconResId = res .getIdentifier ("ic_notification" , "mipmap" , packageName );
359359 }
360360
361361 if (smallIconResId == 0 ) {
@@ -374,10 +374,10 @@ public void sendToNotificationCentreWithPicture(Bundle bundle, Bitmap largeIconB
374374
375375 String largeIcon = bundle .getString ("largeIcon" );
376376
377- if (largeIcon != null ) {
378- largeIconResId = res .getIdentifier (largeIcon , "mipmap" , packageName );
379- } else if (! largeIcon . isEmpty () ) {
380- largeIconResId = res .getIdentifier ("ic_launcher" , "mipmap" , packageName );
377+ if (largeIcon != null && ! largeIcon . isEmpty () ) {
378+ largeIconResId = res .getIdentifier (largeIcon , "mipmap" , packageName );
379+ } else if ( largeIcon == null ) {
380+ largeIconResId = res .getIdentifier ("ic_launcher" , "mipmap" , packageName );
381381 }
382382
383383 // Before Lolipop there was no large icon for notifications.
0 commit comments