diff options
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/intent/Actions.kt')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/intent/Actions.kt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/intent/Actions.kt b/app/src/main/java/org/pacien/tincapp/intent/Actions.kt new file mode 100644 index 0000000..4650952 --- /dev/null +++ b/app/src/main/java/org/pacien/tincapp/intent/Actions.kt | |||
@@ -0,0 +1,19 @@ | |||
1 | package org.pacien.tincapp.intent | ||
2 | |||
3 | import android.net.Uri | ||
4 | import org.pacien.tincapp.BuildConfig | ||
5 | |||
6 | /** | ||
7 | * @author pacien | ||
8 | */ | ||
9 | object Actions { | ||
10 | const val PREFIX = "${BuildConfig.APPLICATION_ID}.intent.action" | ||
11 | const val ACTION_CONNECT = "$PREFIX.CONNECT" | ||
12 | const val ACTION_DISCONNECT = "$PREFIX.DISCONNECT" | ||
13 | const val EVENT_CONNECTED = "$PREFIX.CONNECTED" | ||
14 | const val EVENT_DISCONNECTED = "$PREFIX.DISCONNECTED" | ||
15 | const val TINC_SCHEME = "tinc" | ||
16 | |||
17 | fun buildNetworkUri(netName: String, passphrase: String? = null): Uri = | ||
18 | Uri.Builder().scheme(Actions.TINC_SCHEME).opaquePart(netName).fragment(passphrase).build() | ||
19 | } | ||