summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
index dfbbbd30..85336ac3 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
@@ -170,6 +170,9 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
jbNotificationExtras(lowpriority, nbuilder);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
+ lpNotificationExtras(nbuilder);
+
if (tickerText != null && !tickerText.equals(""))
nbuilder.setTicker(tickerText);
@@ -196,6 +199,13 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
});
}
+ @TargetApi(Build.VERSION_CODES.LOLLIPOP)
+ private void lpNotificationExtras(Notification.Builder nbuilder) {
+ nbuilder.setCategory(Notification.CATEGORY_SERVICE);
+ nbuilder.setLocalOnly(true);
+
+ }
+
private boolean runningOnAndroidTV() {
UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE);
return uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION;