summaryrefslogtreecommitdiff
path: root/java/org/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'java/org/gnu')
-rw-r--r--java/org/gnu/emacs/EmacsDesktopNotification.java37
-rw-r--r--java/org/gnu/emacs/EmacsPixmap.java33
2 files changed, 32 insertions, 38 deletions
diff --git a/java/org/gnu/emacs/EmacsDesktopNotification.java b/java/org/gnu/emacs/EmacsDesktopNotification.java
index 121d8f481a2..56ed984d497 100644
--- a/java/org/gnu/emacs/EmacsDesktopNotification.java
+++ b/java/org/gnu/emacs/EmacsDesktopNotification.java
@@ -96,6 +96,7 @@ public final class EmacsDesktopNotification
RemoteViews contentView;
Intent intent;
PendingIntent pending;
+ int priority;
tem = context.getSystemService (Context.NOTIFICATION_SERVICE);
manager = (NotificationManager) tem;
@@ -116,11 +117,37 @@ public final class EmacsDesktopNotification
.build ());
}
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
- notification = (new Notification.Builder (context)
- .setContentTitle (title)
- .setContentText (content)
- .setSmallIcon (icon)
- .build ());
+ {
+ /* Android 7.1 and earlier don't segregate notifications into
+ distinct categories, but permit an importance to be
+ assigned to each individual notification. */
+
+ switch (importance)
+ {
+ case 2: /* IMPORTANCE_LOW */
+ default:
+ priority = Notification.PRIORITY_LOW;
+ break;
+
+ case 3: /* IMPORTANCE_DEFAULT */
+ priority = Notification.PRIORITY_DEFAULT;
+ break;
+
+ case 4: /* IMPORTANCE_HIGH */
+ priority = Notification.PRIORITY_HIGH;
+ break;
+ }
+
+ notification = (new Notification.Builder (context)
+ .setContentTitle (title)
+ .setContentText (content)
+ .setSmallIcon (icon)
+ .setPriority (priority)
+ .build ());
+
+ if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN)
+ notification.priority = priority;
+ }
else
{
notification = new Notification ();
diff --git a/java/org/gnu/emacs/EmacsPixmap.java b/java/org/gnu/emacs/EmacsPixmap.java
index e02699ecba7..fa6e61c15a5 100644
--- a/java/org/gnu/emacs/EmacsPixmap.java
+++ b/java/org/gnu/emacs/EmacsPixmap.java
@@ -51,39 +51,6 @@ public final class EmacsPixmap extends EmacsHandleObject
private long gcClipRectID;
public
- EmacsPixmap (short handle, int colors[], int width,
- int height, int depth)
- {
- super (handle);
-
- if (depth != 1 && depth != 24)
- throw new IllegalArgumentException ("Invalid depth specified"
- + " for pixmap: " + depth);
-
- switch (depth)
- {
- case 1:
- bitmap = Bitmap.createBitmap (colors, width, height,
- Bitmap.Config.ALPHA_8);
- break;
-
- case 24:
- bitmap = Bitmap.createBitmap (colors, width, height,
- Bitmap.Config.ARGB_8888);
- bitmap.setHasAlpha (false);
- break;
- }
-
- this.width = width;
- this.height = height;
- this.depth = depth;
-
- /* The immutable bitmap constructor is only leveraged to create
- small fringe bitmaps. */
- this.needCollect = false;
- }
-
- public
EmacsPixmap (short handle, int width, int height, int depth)
{
super (handle);