diff options
author | cyBerta <richy@cyborgsociety.org> | 2013-11-05 14:17:01 +0100 |
---|---|---|
committer | cyBerta <richy@cyborgsociety.org> | 2013-11-05 14:17:01 +0100 |
commit | c9f94cb469f979b4d25eb6ff8728b8972265a21f (patch) | |
tree | cca09a0e42b4338d47c1f8ec9a08f8aec21328db | |
parent | 5e43d1ea5436af16f227a98fee495f707c885a96 (diff) |
broken key icon added + icon is shown on 'not running' notification
-rw-r--r-- | res/drawable-hdpi/ic_vpn_disconnected.png | bin | 0 -> 801 bytes | |||
-rw-r--r-- | res/drawable-ldpi/ic_vpn_disconnected.png | bin | 0 -> 801 bytes | |||
-rw-r--r-- | res/drawable-mdpi/ic_vpn_disconnected.png | bin | 0 -> 586 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/ic_vpn_disconnected.png | bin | 0 -> 1091 bytes | |||
-rw-r--r-- | src/se/leap/openvpn/OpenVpnService.java | 15 |
5 files changed, 11 insertions, 4 deletions
diff --git a/res/drawable-hdpi/ic_vpn_disconnected.png b/res/drawable-hdpi/ic_vpn_disconnected.png Binary files differnew file mode 100644 index 00000000..dfb962b9 --- /dev/null +++ b/res/drawable-hdpi/ic_vpn_disconnected.png diff --git a/res/drawable-ldpi/ic_vpn_disconnected.png b/res/drawable-ldpi/ic_vpn_disconnected.png Binary files differnew file mode 100644 index 00000000..dfb962b9 --- /dev/null +++ b/res/drawable-ldpi/ic_vpn_disconnected.png diff --git a/res/drawable-mdpi/ic_vpn_disconnected.png b/res/drawable-mdpi/ic_vpn_disconnected.png Binary files differnew file mode 100644 index 00000000..f8b02bfb --- /dev/null +++ b/res/drawable-mdpi/ic_vpn_disconnected.png diff --git a/res/drawable-xhdpi/ic_vpn_disconnected.png b/res/drawable-xhdpi/ic_vpn_disconnected.png Binary files differnew file mode 100644 index 00000000..7f44c46f --- /dev/null +++ b/res/drawable-xhdpi/ic_vpn_disconnected.png diff --git a/src/se/leap/openvpn/OpenVpnService.java b/src/se/leap/openvpn/OpenVpnService.java index bec7dcee..3ce5a5b2 100644 --- a/src/se/leap/openvpn/OpenVpnService.java +++ b/src/se/leap/openvpn/OpenVpnService.java @@ -7,7 +7,6 @@ import java.util.Vector; import se.leap.bitmaskclient.Dashboard; import se.leap.bitmaskclient.R; - import android.annotation.TargetApi; import android.app.Notification; import android.app.NotificationManager; @@ -26,6 +25,7 @@ import android.os.Build; import android.os.IBinder; import android.os.Message; import android.os.ParcelFileDescriptor; +import android.util.Log; import se.leap.openvpn.OpenVPN.StateListener; public class OpenVpnService extends VpnService implements StateListener, Callback { @@ -63,6 +63,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac private static final int OPENVPN_STATUS = 1; public static final int PROTECT_FD = 0; + private static final String OPEN_VPN_SERVICE_TAG = "OPEN_VPN_SERVICE: "; private final IBinder mBinder = new LocalBinder(); @@ -106,9 +107,13 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac private void showNotification(String msg, String tickerText, boolean lowpriority, long when, boolean persistant) { String ns = Context.NOTIFICATION_SERVICE; mNotificationManager = (NotificationManager) getSystemService(ns); - - - int icon = R.drawable.ic_stat_vpn; + int icon; + if (tickerText == getString(R.string.state_noprocess)){ + icon = R.drawable.ic_vpn_disconnected; + }else{ + icon = R.drawable.ic_stat_vpn; + } + android.app.Notification.Builder nbuilder = new Notification.Builder(this); nbuilder.setContentTitle(getString(R.string.notifcation_title,mProfile.mName)); @@ -476,7 +481,9 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac // CONNECTED String ticker = getString(resid); boolean persist = ("NOPROCESS".equals(state)) ? false : true; + Log.d(OPEN_VPN_SERVICE_TAG, ticker); showNotification(getString(resid) +" " + logmessage,ticker,false,0,persist); + } } |