mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Set ongoing notification to minimum priority. #154
This commit is contained in:
@@ -12,7 +12,6 @@
|
|||||||
<string name="could_not_load_report_data">Could not load report data.</string>
|
<string name="could_not_load_report_data">Could not load report data.</string>
|
||||||
<string name="dev_report_saved">Report saved. It will be sent the next time you log into Briar.</string>
|
<string name="dev_report_saved">Report saved. It will be sent the next time you log into Briar.</string>
|
||||||
<string name="ongoing_notification_title">Signed into Briar</string>
|
<string name="ongoing_notification_title">Signed into Briar</string>
|
||||||
<string name="ongoing_notification_text">Touch to show the dashboard.</string>
|
|
||||||
<string name="setup_title">Briar Setup</string>
|
<string name="setup_title">Briar Setup</string>
|
||||||
<string name="choose_nickname">Choose your nickname:</string>
|
<string name="choose_nickname">Choose your nickname:</string>
|
||||||
<string name="choose_password">Choose your password:</string>
|
<string name="choose_password">Choose your password:</string>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
|
|||||||
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||||
import static android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP;
|
import static android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP;
|
||||||
import static android.support.v4.app.NotificationCompat.CATEGORY_SERVICE;
|
import static android.support.v4.app.NotificationCompat.CATEGORY_SERVICE;
|
||||||
|
import static android.support.v4.app.NotificationCompat.PRIORITY_MIN;
|
||||||
import static android.support.v4.app.NotificationCompat.VISIBILITY_SECRET;
|
import static android.support.v4.app.NotificationCompat.VISIBILITY_SECRET;
|
||||||
import static java.util.logging.Level.WARNING;
|
import static java.util.logging.Level.WARNING;
|
||||||
import static org.briarproject.api.lifecycle.LifecycleManager.StartResult.ALREADY_RUNNING;
|
import static org.briarproject.api.lifecycle.LifecycleManager.StartResult.ALREADY_RUNNING;
|
||||||
@@ -73,7 +74,7 @@ public class BriarService extends Service {
|
|||||||
NotificationCompat.Builder b = new NotificationCompat.Builder(this);
|
NotificationCompat.Builder b = new NotificationCompat.Builder(this);
|
||||||
b.setSmallIcon(R.drawable.ongoing_notification_icon);
|
b.setSmallIcon(R.drawable.ongoing_notification_icon);
|
||||||
b.setContentTitle(getText(R.string.ongoing_notification_title));
|
b.setContentTitle(getText(R.string.ongoing_notification_title));
|
||||||
b.setContentText(getText(R.string.ongoing_notification_text));
|
b.setContentText("");
|
||||||
b.setWhen(0); // Don't show the time
|
b.setWhen(0); // Don't show the time
|
||||||
b.setOngoing(true);
|
b.setOngoing(true);
|
||||||
Intent i = new Intent(this, NavDrawerActivity.class);
|
Intent i = new Intent(this, NavDrawerActivity.class);
|
||||||
@@ -84,6 +85,7 @@ public class BriarService extends Service {
|
|||||||
b.setCategory(CATEGORY_SERVICE);
|
b.setCategory(CATEGORY_SERVICE);
|
||||||
b.setVisibility(VISIBILITY_SECRET);
|
b.setVisibility(VISIBILITY_SECRET);
|
||||||
}
|
}
|
||||||
|
b.setPriority(PRIORITY_MIN);
|
||||||
startForeground(ONGOING_NOTIFICATION_ID, b.build());
|
startForeground(ONGOING_NOTIFICATION_ID, b.build());
|
||||||
// Start the services in a background thread
|
// Start the services in a background thread
|
||||||
new Thread() {
|
new Thread() {
|
||||||
|
|||||||
Reference in New Issue
Block a user