Update notification channel id

This commit is contained in:
Victor Shcherb 2018-05-02 20:56:43 +02:00
parent 5f306ef32c
commit 46a5cedf8d
3 changed files with 8 additions and 5 deletions

View file

@ -3,6 +3,7 @@ package net.osmand.plus.download;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.ActivityNotFoundException;
@ -19,7 +20,6 @@ import android.support.v4.app.NotificationCompat.Builder;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.Toast;
import net.osmand.IndexConstants;
import net.osmand.PlatformUtil;
import net.osmand.map.WorldRegion;
@ -113,7 +113,7 @@ public class DownloadIndexesThread {
Intent contentIntent = new Intent(app, DownloadActivity.class);
PendingIntent contentPendingIntent = PendingIntent.getActivity(app, 0, contentIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
Builder bld = new NotificationCompat.Builder(app);
Builder bld = new NotificationCompat.Builder(app, NotificationChannel.DEFAULT_CHANNEL_ID);
String msg = Version.getAppName(app);
if(!isFinished) {
msg = task.getDescription();

View file

@ -10,10 +10,11 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationCompat.BigTextStyle;
import android.support.v4.app.NotificationCompat.Builder;
import android.support.v4.app.NotificationCompat.BigTextStyle;
import android.view.View;
import net.osmand.plus.NavigationService;

View file

@ -1,13 +1,14 @@
package net.osmand.plus.notifications;
import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.NotificationCompat.Builder;
import android.support.v4.app.NotificationManagerCompat;
import android.support.v4.app.NotificationCompat;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.activities.MapActivity;
@ -57,12 +58,13 @@ public abstract class OsmandNotification {
this.top = top;
}
@SuppressLint("InlinedApi")
protected Builder createBuilder(boolean wearable) {
Intent contentIntent = new Intent(app, MapActivity.class);
PendingIntent contentPendingIntent = PendingIntent.getActivity(app, 0, contentIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
Builder builder = new Builder(app)
Builder builder = new Builder(app, NotificationChannel.DEFAULT_CHANNEL_ID)
.setVisibility(android.support.v4.app.NotificationCompat.VISIBILITY_PUBLIC)
.setPriority(top ? NotificationCompat.PRIORITY_HIGH : getPriority())
.setOngoing(ongoing && !wearable)