diff options
| author | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2024-03-13 12:44:49 +0100 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2024-03-14 14:53:44 +0100 |
| commit | fe6586647799a21c16f9c005a78bb14ce75dea09 (patch) | |
| tree | 37183fb94bc747ab279d52bb00c0b93f3647f4ca /android/lib | |
| parent | 461e29d36e5e2a6841e05897e732b5d068d4dcf0 (diff) | |
| download | mullvadvpn-fe6586647799a21c16f9c005a78bb14ce75dea09.tar.xz mullvadvpn-fe6586647799a21c16f9c005a78bb14ce75dea09.zip | |
Return success or error when creating and updating a custom list
Diffstat (limited to 'android/lib')
4 files changed, 31 insertions, 1 deletions
diff --git a/android/lib/ipc/src/main/kotlin/net/mullvad/mullvadvpn/lib/ipc/Event.kt b/android/lib/ipc/src/main/kotlin/net/mullvad/mullvadvpn/lib/ipc/Event.kt index 1136ae8c55..cce2ab1f87 100644 --- a/android/lib/ipc/src/main/kotlin/net/mullvad/mullvadvpn/lib/ipc/Event.kt +++ b/android/lib/ipc/src/main/kotlin/net/mullvad/mullvadvpn/lib/ipc/Event.kt @@ -5,6 +5,7 @@ import kotlinx.parcelize.Parcelize import net.mullvad.mullvadvpn.model.AccountCreationResult import net.mullvad.mullvadvpn.model.AccountExpiry import net.mullvad.mullvadvpn.model.AccountHistory +import net.mullvad.mullvadvpn.model.CreateCustomListResult import net.mullvad.mullvadvpn.model.DeviceListEvent import net.mullvad.mullvadvpn.model.DeviceState import net.mullvad.mullvadvpn.model.LoginResult @@ -14,6 +15,7 @@ import net.mullvad.mullvadvpn.model.RelayList import net.mullvad.mullvadvpn.model.RemoveDeviceResult import net.mullvad.mullvadvpn.model.Settings import net.mullvad.mullvadvpn.model.TunnelState +import net.mullvad.mullvadvpn.model.UpdateCustomListResult // Events that can be sent from the service sealed class Event : Message.EventMessage() { @@ -65,7 +67,9 @@ sealed class Event : Message.EventMessage() { @Parcelize object VpnPermissionRequest : Event() - @Parcelize data class CreateCustomListResult(val listId: String) : Event() + @Parcelize data class CreateCustomListResultEvent(val result: CreateCustomListResult) : Event() + + @Parcelize data class UpdateCustomListResultEvent(val result: UpdateCustomListResult) : Event() companion object { private const val MESSAGE_KEY = "event" diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/CreateCustomListResult.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/CreateCustomListResult.kt new file mode 100644 index 0000000000..73eaa209c8 --- /dev/null +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/CreateCustomListResult.kt @@ -0,0 +1,10 @@ +package net.mullvad.mullvadvpn.model + +import android.os.Parcelable +import kotlinx.parcelize.Parcelize + +sealed class CreateCustomListResult : Parcelable { + @Parcelize data class Ok(val id: String) : CreateCustomListResult() + + @Parcelize data class Error(val error: CustomListsError) : CreateCustomListResult() +} diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/CustomListsError.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/CustomListsError.kt new file mode 100644 index 0000000000..83806af4f7 --- /dev/null +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/CustomListsError.kt @@ -0,0 +1,6 @@ +package net.mullvad.mullvadvpn.model + +enum class CustomListsError { + CustomListExists, + OtherError +} diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/UpdateCustomListResult.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/UpdateCustomListResult.kt new file mode 100644 index 0000000000..ebfe9e8cd6 --- /dev/null +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/UpdateCustomListResult.kt @@ -0,0 +1,10 @@ +package net.mullvad.mullvadvpn.model + +import android.os.Parcelable +import kotlinx.parcelize.Parcelize + +sealed class UpdateCustomListResult : Parcelable { + @Parcelize data object Ok : UpdateCustomListResult() + + @Parcelize data class Error(val error: CustomListsError) : UpdateCustomListResult() +} |
