summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-02-28 21:34:27 +0100
committercyBerta <cyberta@riseup.net>2021-02-28 21:34:27 +0100
commit69d74b6c74ce2ea31d2fad8b62a4eb983693de13 (patch)
tree6224386e69c316adef37e538bcccc2f7649bf9f7
parentd3a65ac73dafab3b6fecddee70dd0f2df5379966 (diff)
set early foreground notification for void vpn service
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java
index 02de7574..35d2b376 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java
@@ -76,7 +76,6 @@ public class VoidVpnService extends VpnService implements Observer, VpnNotificat
eipStatus = EipStatus.getInstance();
eipStatus.addObserver(this);
notificationManager = new VpnNotificationManager(this);
- notificationManager.createVoidVpnNotificationChannel();
}
@Override
@@ -94,6 +93,7 @@ public class VoidVpnService extends VpnService implements Observer, VpnNotificat
thread.run();
} else if (action.equals("android.net.VpnService") && Build.VERSION.SDK_INT >= ALWAYS_ON_MIN_API_LEVEL) {
//only always-on feature triggers this
+ startWithForegroundNotification();
thread = new Thread(new Runnable() {
public void run() {
establishBlockingVpn();
@@ -221,7 +221,14 @@ public class VoidVpnService extends VpnService implements Observer, VpnNotificat
}
public void startWithForegroundNotification() {
-
+ notificationManager.createOpenVpnNotificationChannel();
+ String message = getString(R.string.state_disconnected);
+ notificationManager.buildVoidVpnNotification(
+ message,
+ message,
+ eipStatus.getLevel(),
+ this::onNotificationBuild
+ );
}
}