diff options
author | Arne Schwabe <arne@rfc2549.org> | 2016-01-14 00:52:04 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2016-01-14 00:52:04 +0100 |
commit | 8414c4f167feebda70397c5ebc8cc13728315731 (patch) | |
tree | e68c9d728158438a05314cb585f1febb1de737fc | |
parent | e5a67778838b7a8ff9a61e59e1add239ceed1caa (diff) |
Set notification category
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 10 |
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; |