summaryrefslogtreecommitdiffhomepage
path: root/android/lib/common/src
diff options
context:
space:
mode:
authorMaryamShaghaghi <122574719+MaryamShaghaghi@users.noreply.github.com>2023-12-13 13:52:31 +0100
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2024-02-19 11:19:12 +0100
commit6634e8dfcb71ea0eda116b1fca3edc2031f55e52 (patch)
tree0f94270d01c75db81028563a79fee430d9ddeab8 /android/lib/common/src
parent0fa52c9746b446318c0baa58036ef7a9e90226c1 (diff)
downloadmullvadvpn-6634e8dfcb71ea0eda116b1fca3edc2031f55e52.tar.xz
mullvadvpn-6634e8dfcb71ea0eda116b1fca3edc2031f55e52.zip
Create auto connect and lockdown mode screen
Co-Authored-By: Boban Sijuk <49131853+Boki91@users.noreply.github.com>
Diffstat (limited to 'android/lib/common/src')
-rw-r--r--android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/ContextExtensions.kt8
1 files changed, 8 insertions, 0 deletions
diff --git a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/ContextExtensions.kt b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/ContextExtensions.kt
index b983e3538d..836a583284 100644
--- a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/ContextExtensions.kt
+++ b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/ContextExtensions.kt
@@ -41,3 +41,11 @@ fun Context.openLink(uri: Uri) {
val intent = Intent(Intent.ACTION_VIEW, uri)
startActivity(intent)
}
+
+fun Context.openVpnSettings() {
+ val intent = Intent("android.settings.VPN_SETTINGS")
+ startActivity(intent)
+}
+
+fun Context.vpnSettingsAvailable(): Boolean =
+ Intent("android.net.vpn.SETTINGS").resolveActivity(packageManager) != null