Fix service notification on Android O
This commit is contained in:
parent
eee8451eee
commit
342ab8c41a
2 changed files with 1 additions and 9 deletions
|
@ -315,10 +315,6 @@ public final class LinphoneService extends Service {
|
||||||
notifIntent.putExtra("Notification", true);
|
notifIntent.putExtra("Notification", true);
|
||||||
mNotifContentIntent = PendingIntent.getActivity(this, 0, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
mNotifContentIntent = PendingIntent.getActivity(this, 0, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
|
||||||
if (Version.sdkAboveOrEqual(Version.API26_O_80)) {
|
|
||||||
disableNotificationsAutomaticRegistrationStatusContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
Bitmap bm = null;
|
Bitmap bm = null;
|
||||||
try {
|
try {
|
||||||
bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
|
bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
|
||||||
|
@ -756,10 +752,6 @@ public final class LinphoneService extends Service {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableNotificationsAutomaticRegistrationStatusContent() {
|
|
||||||
mDisableRegistrationStatus = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private synchronized void sendNotification(int level, int textId) {
|
private synchronized void sendNotification(int level, int textId) {
|
||||||
String text = getString(textId);
|
String text = getString(textId);
|
||||||
if (text.contains("%s") && LinphoneManager.getLc() != null) {
|
if (text.contains("%s") && LinphoneManager.getLc() != null) {
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class ApiTwentySixPlus {
|
||||||
String id = context.getString(R.string.notification_channel_id);
|
String id = context.getString(R.string.notification_channel_id);
|
||||||
CharSequence name = context.getString(R.string.content_title_notification);
|
CharSequence name = context.getString(R.string.content_title_notification);
|
||||||
String description = context.getString(R.string.content_title_notification);
|
String description = context.getString(R.string.content_title_notification);
|
||||||
int importance = NotificationManager.IMPORTANCE_HIGH;
|
int importance = NotificationManager.IMPORTANCE_DEFAULT;
|
||||||
NotificationChannel mChannel = new NotificationChannel(id, name, importance);
|
NotificationChannel mChannel = new NotificationChannel(id, name, importance);
|
||||||
mChannel.setDescription(description);
|
mChannel.setDescription(description);
|
||||||
mChannel.enableLights(true);
|
mChannel.enableLights(true);
|
||||||
|
|
Loading…
Reference in a new issue