From 91953cc4167b2202aa0428db1df85d8ef8021d3e Mon Sep 17 00:00:00 2001 From: Ihor Ivlev Date: Sun, 23 Feb 2025 09:49:27 +0100 Subject: [PATCH] Start VPN automatically --- .../main/java/com/openipc/pixelpilot/VideoActivity.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/com/openipc/pixelpilot/VideoActivity.java b/app/src/main/java/com/openipc/pixelpilot/VideoActivity.java index 0eebeeb..6534f90 100644 --- a/app/src/main/java/com/openipc/pixelpilot/VideoActivity.java +++ b/app/src/main/java/com/openipc/pixelpilot/VideoActivity.java @@ -1069,6 +1069,15 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten startDvr(dvrUri); } } + } else if (requestCode == 100) { // VPN_REQUEST_CODE is 100 + if (resultCode == RESULT_OK) { + // VPN permission granted, start the VPN service + Intent serviceIntent = new Intent(this, WfbNgVpnService.class); + startService(serviceIntent); + } else { + // VPN permission not granted + Log.e(TAG, "VPN permission was not granted by the user."); + } } }