Commit 45c310a6 authored by Libin Lu's avatar Libin Lu Committed by GitHub

Merge pull request #932 from evollu/remove-decode

remove decode for sound and image
parents 85e0a4ba be82034d
...@@ -128,7 +128,6 @@ public class SendNotificationTask extends AsyncTask<Void, Void, Void> { ...@@ -128,7 +128,6 @@ public class SendNotificationTask extends AsyncTask<Void, Void, Void> {
//large icon //large icon
String largeIcon = bundle.getString("large_icon"); String largeIcon = bundle.getString("large_icon");
if(largeIcon != null && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP){ if(largeIcon != null && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP){
largeIcon = URLDecoder.decode( largeIcon, "UTF-8" );
if (largeIcon.startsWith("http://") || largeIcon.startsWith("https://")) { if (largeIcon.startsWith("http://") || largeIcon.startsWith("https://")) {
Bitmap bitmap = getBitmapFromURL(largeIcon); Bitmap bitmap = getBitmapFromURL(largeIcon);
notification.setLargeIcon(bitmap); notification.setLargeIcon(bitmap);
...@@ -153,7 +152,6 @@ public class SendNotificationTask extends AsyncTask<Void, Void, Void> { ...@@ -153,7 +152,6 @@ public class SendNotificationTask extends AsyncTask<Void, Void, Void> {
String picture = bundle.getString("picture"); String picture = bundle.getString("picture");
if(picture!=null){ if(picture!=null){
picture = URLDecoder.decode( picture, "UTF-8" );
NotificationCompat.BigPictureStyle bigPicture = new NotificationCompat.BigPictureStyle(); NotificationCompat.BigPictureStyle bigPicture = new NotificationCompat.BigPictureStyle();
if (picture.startsWith("http://") || picture.startsWith("https://")) { if (picture.startsWith("http://") || picture.startsWith("https://")) {
...@@ -175,7 +173,6 @@ public class SendNotificationTask extends AsyncTask<Void, Void, Void> { ...@@ -175,7 +173,6 @@ public class SendNotificationTask extends AsyncTask<Void, Void, Void> {
//sound //sound
String soundName = bundle.getString("sound"); String soundName = bundle.getString("sound");
if (soundName != null) { if (soundName != null) {
soundName = URLDecoder.decode( soundName, "UTF-8" );
if (soundName.equalsIgnoreCase("default")) { if (soundName.equalsIgnoreCase("default")) {
notification.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)); notification.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
} else { } else {
...@@ -194,7 +191,6 @@ public class SendNotificationTask extends AsyncTask<Void, Void, Void> { ...@@ -194,7 +191,6 @@ public class SendNotificationTask extends AsyncTask<Void, Void, Void> {
String color = bundle.getString("color"); String color = bundle.getString("color");
if (color != null) { if (color != null) {
color = URLDecoder.decode( color, "UTF-8" );
notification.setColor(Color.parseColor(color)); notification.setColor(Color.parseColor(color));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment