summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/NotificationManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/app/NotificationManager.java')
-rw-r--r--core/java/android/app/NotificationManager.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java
index e4bbe27..557964b 100644
--- a/core/java/android/app/NotificationManager.java
+++ b/core/java/android/app/NotificationManager.java
@@ -23,6 +23,7 @@ import android.app.Notification.Builder;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ParceledListSlice;
+import android.graphics.drawable.Icon;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
@@ -204,6 +205,7 @@ public class NotificationManager
notification.sound.checkFileUriExposed("Notification.sound");
}
}
+ fixLegacySmallIcon(notification, pkg);
if (localLOGV) Log.v(TAG, pkg + ": notify(" + id + ", " + notification + ")");
Notification stripped = notification.clone();
Builder.stripForDelivery(stripped);
@@ -231,6 +233,7 @@ public class NotificationManager
notification.sound.checkFileUriExposed("Notification.sound");
}
}
+ fixLegacySmallIcon(notification, pkg);
if (localLOGV) Log.v(TAG, pkg + ": notify(" + id + ", " + notification + ")");
Notification stripped = notification.clone();
Builder.stripForDelivery(stripped);
@@ -244,6 +247,12 @@ public class NotificationManager
}
}
+ private void fixLegacySmallIcon(Notification n, String pkg) {
+ if (n.getSmallIcon() == null && n.icon != 0) {
+ n.setSmallIcon(Icon.createWithResource(pkg, n.icon));
+ }
+ }
+
/**
* Cancel a previously shown notification. If it's transient, the view
* will be hidden. If it's persistent, it will be removed from the status