diff options
author | Arne Schwabe <arne@rfc2549.org> | 2022-09-10 18:47:09 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2022-09-10 18:47:09 +0200 |
commit | 8142b5d5ed0a73d37e397a0b553571a3236d60a1 (patch) | |
tree | d95b8cbecd861ecac0c59d1863039b0593ea2f56 /main | |
parent | fba254e72516aec398c3f5a95ba8c43e91dc9c90 (diff) |
Try to improve reliability of the Onbootreceiver
Diffstat (limited to 'main')
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/OnBootReceiver.java | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/OnBootReceiver.java b/main/src/main/java/de/blinkt/openvpn/OnBootReceiver.java index ebfab5b2..3facacc5 100644 --- a/main/src/main/java/de/blinkt/openvpn/OnBootReceiver.java +++ b/main/src/main/java/de/blinkt/openvpn/OnBootReceiver.java @@ -12,12 +12,10 @@ import android.content.SharedPreferences; import de.blinkt.openvpn.core.Preferences; import de.blinkt.openvpn.core.ProfileManager; +import de.blinkt.openvpn.core.VPNLaunchHelper; public class OnBootReceiver extends BroadcastReceiver { - - - // Debug: am broadcast -a android.intent.action.BOOT_COMPLETED @Override public void onReceive(Context context, Intent intent) { @@ -38,12 +36,6 @@ public class OnBootReceiver extends BroadcastReceiver { } void launchVPN(VpnProfile profile, Context context) { - Intent startVpnIntent = new Intent(Intent.ACTION_MAIN); - startVpnIntent.setClass(context, LaunchVPN.class); - startVpnIntent.putExtra(LaunchVPN.EXTRA_KEY,profile.getUUIDString()); - startVpnIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startVpnIntent.putExtra(LaunchVPN.EXTRA_HIDELOG, true); - - context.startActivity(startVpnIntent); + VPNLaunchHelper.startOpenVpn(profile, context.getApplicationContext()); } } |