schwabe / ics-openvpn

OpenVPN for Android
3.35k stars 1.2k forks source link

VPN disconnects when removing app from recent apps on Xiaomi devices #1568

Closed VITYQ closed 1 year ago

VITYQ commented 1 year ago

To make issues more manageable, I would appreciate it if you fill out the following details as applicable:

General information

  1. Android Version - 9
  2. Android Vendor/Custom ROM - Xiaomi
  3. Device - mi 6
  4. Version of the app - self-built

Description of the issue

I implemented your application as second module of project. I added new UI and just executing methods from your application. And there's a problem on Xiaomi devices that removing app from recent apps causing VPN disconnect. This problem isn't seen on other devices

In original version of OpenVPN from Google Play this is not actual and application keeps connection even when removed from recent apps

How can it be fixed?

schwabe commented 1 year ago

Can you please at least link your source code? As you said, your app is based on mine and you therefore also agreed to GPL.

VITYQ commented 1 year ago

Oh, I resolved this problem by myself.

I removed notification by adding stopForeground(true) after startForeground in OpenVpnService in method showNotification and that was the reason. I decided to leave the notifications as they were before and the problem went away

schwabe commented 1 year ago

@VITYQ please still share the source code of your app

VITYQ commented 1 year ago

Of course https://github.com/VITYQ/TestOpenVpn