PhoneProfilesPlus icon indicating copy to clipboard operation
PhoneProfilesPlus copied to clipboard

Repetitively runs Intent

Open J4gQBqqR opened this issue 4 years ago • 6 comments

This is related to #73 I use the "Others"/"Run applications, shortcuts, intents" to connect, disconnect OpenVPN profile.

Usage scenario: Assume I connected my VPN for two profiles:

  1. At home, sleeping.
  2. At home, awake.

I use screen face down/up to tell the program which status I am in. When I face my screen up, I am "awake". When I face my screen down, I am asleep. The problem is, each time I flip my phone, the "OpenVPN connect intent" would be executed once.

Is there a way to avoid execute a "connect intent" when OpenVPN is already connected?

J4gQBqqR avatar Dec 06 '21 19:12 J4gQBqqR

What happens, when is activated profile with already activated VPN?

henrichg avatar Dec 07 '21 10:12 henrichg

I am sorry, but could you try to rephrase your question a bit more? I did not totally understand your question.

So what happens is, each time a profile is activated, my VPN connection is disconnected and reconnected again. I am not sure if this is an optimal behavior for VPN since it creates potential time window for IP leak.

Thank you.

J4gQBqqR avatar Dec 07 '21 18:12 J4gQBqqR

OK, maybe better :-)

  1. If you activate profile "At home, awake" (manual activation), this connect to VPN. Yes?
  2. And if you activate profile "At home, awake" again (manual activation), this disconnect and again connect to VPN (reconnect)? Is not any option in OpenVPN to not reconnect VPN, when the VPN profile is already connected?

Exists test of VPN conection: https://stackoverflow.com/questions/28386553/check-if-a-vpn-connection-is-active-in-android Maybe this can help. But I do not have any VPN for test it. Is possible to test it by you?

henrichg avatar Dec 07 '21 20:12 henrichg

  1. Yes.
  2. Yes, disconnected then connected again.
  3. I am not aware of any option for OpenVPN to skip execution of a connection intent if current connection is active.

I went through the link information. I'm unfortunately not familiar with Android and Java, not clear on how to test out that code.

If this behavior cannot be avoided, I totally understand. The app is already doing so much more than other alternatives.

J4gQBqqR avatar Dec 07 '21 22:12 J4gQBqqR

Possible is to check if VPN is activated, but is not possible to check which OpenVPN profile. Hm, hm.

henrichg avatar Dec 09 '21 15:12 henrichg

OK maybe impleneted. In this new beta version exists new profile parameter "Radios"/"VPN". It is move of OpenVPN intents from "Run applications, shortcuts, intents".

In dialog is also parameter "Do not set when VPN is already in state". Test it, if you want. https://drive.google.com/file/d/1CR4y2u3V8PCwQK9sw1P88JrlpSdA2Ou4/view?usp=drivesdk

henrichg avatar Jul 14 '22 15:07 henrichg