Commit 14353653 authored by akwizgran's avatar akwizgran

Merge branch 'sign-in-reminder' into 'master'

Remove sign-in reminder when PasswordActivity starts

See merge request briar/briar!865
parents 81cbb7e8 e300245f
Pipeline #1915 passed with stage
in 8 minutes and 55 seconds
......@@ -54,7 +54,6 @@ import static org.briarproject.briar.api.android.AndroidNotificationManager.FAIL
import static org.briarproject.briar.api.android.AndroidNotificationManager.FAILURE_NOTIFICATION_ID;
import static org.briarproject.briar.api.android.AndroidNotificationManager.ONGOING_CHANNEL_ID;
import static org.briarproject.briar.api.android.AndroidNotificationManager.ONGOING_NOTIFICATION_ID;
import static org.briarproject.briar.api.android.AndroidNotificationManager.REMINDER_NOTIFICATION_ID;
public class BriarService extends Service {
......@@ -103,9 +102,9 @@ public class BriarService extends Service {
}
// Create notification channels
NotificationManager nm = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
if (SDK_INT >= 26) {
NotificationManager nm = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
NotificationChannel ongoingChannel = new NotificationChannel(
ONGOING_CHANNEL_ID,
getString(R.string.ongoing_notification_title),
......@@ -137,8 +136,6 @@ public class BriarService extends Service {
}
b.setPriority(PRIORITY_MIN);
startForeground(ONGOING_NOTIFICATION_ID, b.build());
// Remove sign-in reminder notification
nm.cancel(REMINDER_NOTIFICATION_ID);
// Start the services in a background thread
new Thread(() -> {
String nickname = databaseConfig.getLocalAuthorName();
......
package org.briarproject.briar.android.login;
import android.app.NotificationManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
......@@ -28,6 +29,7 @@ import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
import static org.briarproject.briar.api.android.AndroidNotificationManager.REMINDER_NOTIFICATION_ID;
public class PasswordActivity extends BaseActivity {
......@@ -88,6 +90,11 @@ public class PasswordActivity extends BaseActivity {
if (briarController.hasEncryptionKey()) {
setResult(RESULT_OK);
finish();
} else {
// Remove sign-in reminder notification
NotificationManager nm = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
nm.cancel(REMINDER_NOTIFICATION_ID);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment