From 273bae40dfabc3249acd4427d92abb2ed9fefa6c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 6 Feb 2020 17:15:14 -0800 Subject: [PATCH] altosdroid: Switch to NotificationCompat Instead of Notification, which doesn't appear to work on older android releases. Signed-off-by: Keith Packard --- altosdroid/app/build.gradle.in | 2 +- .../main/java/org/altusmetrum/AltosDroid/TelemetryService.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/altosdroid/app/build.gradle.in b/altosdroid/app/build.gradle.in index cc29d86c..5dbd30ee 100644 --- a/altosdroid/app/build.gradle.in +++ b/altosdroid/app/build.gradle.in @@ -41,7 +41,7 @@ android { dependencies { implementation 'androidx.appcompat:appcompat:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'androidx.core:core:1.2.0' implementation 'com.google.android.gms:play-services-maps:17.0.0' implementation fileTree(dir: 'libs', include: ['*.jar']) } - diff --git a/altosdroid/app/src/main/java/org/altusmetrum/AltosDroid/TelemetryService.java b/altosdroid/app/src/main/java/org/altusmetrum/AltosDroid/TelemetryService.java index 5dba24ba..d4f72b3f 100644 --- a/altosdroid/app/src/main/java/org/altusmetrum/AltosDroid/TelemetryService.java +++ b/altosdroid/app/src/main/java/org/altusmetrum/AltosDroid/TelemetryService.java @@ -31,6 +31,7 @@ import android.content.Intent; import android.content.Context; import android.os.*; import android.widget.Toast; +import androidx.core.app.NotificationCompat; import org.altusmetrum.altoslib_13.*; @@ -657,7 +658,7 @@ public class TelemetryService extends Service implements AltosIdleMonitorListene : ""; // Create notification to be displayed while the service runs - Notification notification = new Notification.Builder(this, channelId) + Notification notification = new NotificationCompat.Builder(this, channelId) .setContentTitle(getText(R.string.telemetry_service_label)) .setContentText(getText(R.string.telemetry_service_started)) .setContentIntent(contentIntent) -- 2.30.2