From cdd2a800ba434874d1ec3b083b6b1157473d30ba Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 21 Mar 2017 15:31:33 +0100 Subject: [PATCH] Show locked down indicator in status bar notification --- app/app.iml | 14 +++++++------- .../java/eu/faircode/netguard/ServiceSinkhole.java | 5 ++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/app.iml b/app/app.iml index 6da7a79f..de0404b2 100644 --- a/app/app.iml +++ b/app/app.iml @@ -50,6 +50,13 @@ + + + + + + + @@ -58,13 +65,6 @@ - - - - - - - diff --git a/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java b/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java index 5ce663d3..f452f597 100644 --- a/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java +++ b/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java @@ -2202,13 +2202,16 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS } private Notification getEnforcingNotification(int allowed, int blocked, int hosts) { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); + boolean lockdown = prefs.getBoolean("lockdown", false); + Intent main = new Intent(this, ActivityMain.class); PendingIntent pi = PendingIntent.getActivity(this, 0, main, PendingIntent.FLAG_UPDATE_CURRENT); TypedValue tv = new TypedValue(); getTheme().resolveAttribute(R.attr.colorPrimary, tv, true); NotificationCompat.Builder builder = new NotificationCompat.Builder(this) - .setSmallIcon(R.drawable.ic_security_white_24dp) + .setSmallIcon(lockdown ? R.drawable.ic_lock_outline_white_24dp : R.drawable.ic_security_white_24dp) .setContentIntent(pi) .setColor(tv.data) .setOngoing(true)