mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
add openvpn connection logic draft
This commit is contained in:
@@ -6,14 +6,18 @@ package org.amnezia.vpn.qt
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
|
||||
class VPNPermissionHelper : android.net.VpnService() {
|
||||
|
||||
private val tag = "VPNPermissionHelper"
|
||||
/**
|
||||
* This small service does nothing else then checking if the vpn permission
|
||||
* is present and prompting if not.
|
||||
*/
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
val intent = prepare(this.applicationContext)
|
||||
Log.i(tag, "VPNPermissionHelper onStartCommand")
|
||||
if (intent != null) {
|
||||
startActivityForResult(intent)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user