summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-09-10 02:17:12 -0700
committerLinux Build Service Account <lnxbuild@localhost>2018-09-10 02:17:12 -0700
commit32b1b58465e7f4b79d37f22594ce0d38a1c3a9f0 (patch)
tree2d018b97c7644872780899ca5b07ce11318219fd /src/com/android/gallery3d/filtershow
parenta5be66738d693e3be2c6df60de7f6cef77cdb333 (diff)
parente3e73ab80b01e0c4ea11412e032626a363da97d9 (diff)
downloadandroid_packages_apps_Gallery2-32b1b58465e7f4b79d37f22594ce0d38a1c3a9f0.tar.gz
android_packages_apps_Gallery2-32b1b58465e7f4b79d37f22594ce0d38a1c3a9f0.tar.bz2
android_packages_apps_Gallery2-32b1b58465e7f4b79d37f22594ce0d38a1c3a9f0.zip
Merge e3e73ab80b01e0c4ea11412e032626a363da97d9 on remote branch
Change-Id: Iee1d62acc65d10f81f62878aa7a009770e05be37
Diffstat (limited to 'src/com/android/gallery3d/filtershow')
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java1
-rwxr-xr-xsrc/com/android/gallery3d/filtershow/pipeline/ProcessingService.java19
2 files changed, 15 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java b/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
index 2bd121641..f5a56897d 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
@@ -156,6 +156,7 @@ public class ImagePreset {
}
public void updateOrAddFilterRepresentation(FilterRepresentation rep) {
+ if (rep == null) return;
int pos = getPositionForRepresentation(rep);
if (pos != -1) {
mFilters.elementAt(pos).useParametersFrom(rep);
diff --git a/src/com/android/gallery3d/filtershow/pipeline/ProcessingService.java b/src/com/android/gallery3d/filtershow/pipeline/ProcessingService.java
index 9a88e03e9..cd3dfe7d2 100755
--- a/src/com/android/gallery3d/filtershow/pipeline/ProcessingService.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/ProcessingService.java
@@ -17,6 +17,7 @@
package com.android.gallery3d.filtershow.pipeline;
import android.app.Notification;
+import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Context;
@@ -26,6 +27,7 @@ import android.graphics.Bitmap;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Binder;
+import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
@@ -243,11 +245,18 @@ public class ProcessingService extends Service {
mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
mNotifyMgr.cancelAll();
- mBuilder =
- new Notification.Builder(this)
- .setSmallIcon(R.drawable.filtershow_button_fx)
- .setContentTitle(getString(R.string.filtershow_notification_label))
- .setContentText(getString(R.string.filtershow_notification_message));
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ String channelId = "GallerySavingRequest";
+ NotificationChannel channel = new NotificationChannel(channelId, channelId,
+ NotificationManager.IMPORTANCE_DEFAULT);
+ mNotifyMgr.createNotificationChannel(channel);
+ mBuilder = new Notification.Builder(this, channelId);
+ } else {
+ mBuilder = new Notification.Builder(this);
+ }
+ mBuilder.setSmallIcon(R.drawable.filtershow_button_fx)
+ .setContentTitle(getString(R.string.filtershow_notification_label))
+ .setContentText(getString(R.string.filtershow_notification_message));
startForeground(mNotificationId, mBuilder.build());