Skip to content

Commit bb15283

Browse files
smdyvthestinger
authored andcommitted
refactor: show failure notification in status bar
Set the notification channel importance to `IMPORTANCE_LOW`. The new importance is used only after the remote verify job has been executed once. To fix this, a much larger refactoring would be required.
1 parent 795b8d1 commit bb15283

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/src/main/java/app/attestation/auditor/RemoteVerifyJob.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public class RemoteVerifyJob extends JobService {
5555
static final String KEY_INTERVAL = "remote_interval";
5656
private static final int NOTIFICATION_ID = 1;
5757
private static final String NOTIFICATION_CHANNEL_SUCCESS_ID = "remote_verification";
58-
private static final String NOTIFICATION_CHANNEL_FAILURE_ID = "remote_verification_failure";
58+
private static final String NOTIFICATION_CHANNEL_FAILURE_ID = "remote_verification_failure_2";
59+
private static final String NOTIFICATION_CHANNEL_FAILURE_ID_OLD = "remote_verification_failure";
5960

6061
static final ExecutorService executor = Executors.newSingleThreadExecutor();
6162
private Future<?> task;
@@ -213,9 +214,12 @@ public boolean onStartJob(final JobParameters params) {
213214
successChannel.setShowBadge(false);
214215
channels.add(successChannel);
215216

217+
// Raised from IMPORTANCE_MIN to IMPORTANCE_LOW
218+
manager.deleteNotificationChannel(NOTIFICATION_CHANNEL_FAILURE_ID_OLD);
219+
216220
final NotificationChannel failureChannel = new NotificationChannel(NOTIFICATION_CHANNEL_FAILURE_ID,
217221
context.getString(R.string.remote_verification_notification_failure_channel),
218-
NotificationManager.IMPORTANCE_MIN);
222+
NotificationManager.IMPORTANCE_LOW);
219223
failureChannel.setShowBadge(false);
220224
channels.add(failureChannel);
221225

0 commit comments

Comments
 (0)