summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2016-01-14 00:52:04 +0100
committerArne Schwabe <arne@rfc2549.org>2016-01-14 00:52:04 +0100
commit8414c4f167feebda70397c5ebc8cc13728315731 (patch)
treee68c9d728158438a05314cb585f1febb1de737fc /main/src
parente5a67778838b7a8ff9a61e59e1add239ceed1caa (diff)
Set notification category
Diffstat (limited to 'main/src')
-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;