Source:
private void handleNotificationIntent(Context context, Intent intent) { final String message = intent.getStringExtra("mp_message"); final String iconName = intent.getStringExtra("mp_icon_name"); CharSequence notificationTitle = intent.getStringExtra("mp_title"); if (message == null) return; if (MPConfig.DEBUG) Log.d(LOGTAG, "MP GCM notification received: " + message); final PackageManager manager = context.getPackageManager(); final Intent appIntent = manager.getLaunchIntentForPackage(context.getPackageName()); int notificationIcon = -1; if (null != iconName) { final ResourceIds drawableIds = new ResourceReader.Drawables(context); if (drawableIds.knownIdName(iconName)) { notificationIcon = drawableIds.idFromName(iconName); } } try { final ApplicationInfo appInfo = manager.getApplicationInfo(context.getPackageName(), 0); if (null == notificationTitle) { notificationTitle = manager.getApplicationLabel(appInfo); } if (notificationIcon == -1) { notificationIcon = appInfo.icon; } } catch (final NameNotFoundException e) { } if (notificationIcon == -1) { notificationIcon = android.R.drawable.sym_def_app_icon; } if (null == notificationTitle) { notificationTitle = "A Message For You"; } final PendingIntent contentIntent = PendingIntent.getActivity( context.getApplicationContext(), 0, appIntent, PendingIntent.FLAG_UPDATE_CURRENT ); final NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE); final Notification notification; if (Build.VERSION.SDK_INT >= 16) { notification = makeNotificationSDK16OrHigher(context, contentIntent, notificationIcon, notificationTitle, message); } else if (Build.VERSION.SDK_INT >= 11) { notification = makeNotificationSDK11OrHigher(context, contentIntent, notificationIcon, notificationTitle, message); } else { notification = makeNotificationSDKLessThan11(context, contentIntent, notificationIcon, notificationTitle, message); } notificationManager.notify(0, notification); }

Target:
private void handleNotificationIntent(Context context, Intent intent) { final String message = intent.getStringExtra("mp_message"); final String iconName = intent.getStringExtra("mp_icon_name"); CharSequence notificationTitle = intent.getStringExtra("mp_title"); if (message == null) return; if (MPConfig.DEBUG) Log.d(LOGTAG, "MP GCM notification received: " + message); final PackageManager manager = context.getPackageManager(); final Intent appIntent = manager.getLaunchIntentForPackage(context.getPackageName()); int notificationIcon = -1; if (null != iconName) { final ResourceIds drawableIds = new ResourceReader.Drawables(context); if (drawableIds.knownIdName(iconName)) { notificationIcon = drawableIds.idFromName(iconName); } } ApplicationInfo appInfo; try { appInfo = manager.getApplicationInfo(context.getPackageName(), 0); } catch (final NameNotFoundException e) { appInfo = null; } if (null == notificationTitle && null != appInfo) { notificationTitle = manager.getApplicationLabel(appInfo); } if (notificationIcon == -1 && null != appInfo) { notificationIcon = appInfo.icon; } if (notificationIcon == -1) { notificationIcon = android.R.drawable.sym_def_app_icon; } if (null == notificationTitle) { notificationTitle = "A Message For You"; } final PendingIntent contentIntent = PendingIntent.getActivity( context.getApplicationContext(), 0, appIntent, PendingIntent.FLAG_UPDATE_CURRENT ); final NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE); final Notification notification; if (Build.VERSION.SDK_INT >= 16) { notification = makeNotificationSDK16OrHigher(context, contentIntent, notificationIcon, notificationTitle, message); } else if (Build.VERSION.SDK_INT >= 11) { notification = makeNotificationSDK11OrHigher(context, contentIntent, notificationIcon, notificationTitle, message); } else { notification = makeNotificationSDKLessThan11(context, contentIntent, notificationIcon, notificationTitle, message); } notificationManager.notify(0, notification); }