Add Quick Settings tile (#660)
* Add Quick Settings tile - Add multi-client support to AmneziaVpnService - Make AmneziaActivity permanently connected to AmneziaVpnService while it is running - Refactor processing of connection state changes on qt side - Add VpnState DataStore - Add check if AmneziaVpnService is running * Add tile reset when the server is removed from the application
This commit is contained in:
parent
ca633ae882
commit
080e1d98c6
22 changed files with 602 additions and 154 deletions
|
|
@ -2,9 +2,9 @@ package org.amnezia.vpn.protocol
|
|||
|
||||
// keep synchronized with client/platforms/android/android_controller.h ConnectionState
|
||||
enum class ProtocolState {
|
||||
DISCONNECTED,
|
||||
CONNECTED,
|
||||
CONNECTING,
|
||||
DISCONNECTED,
|
||||
DISCONNECTING,
|
||||
RECONNECTING,
|
||||
UNKNOWN
|
||||
|
|
|
|||
|
|
@ -28,6 +28,10 @@ fun Bundle.putStatus(status: Status) {
|
|||
putInt(STATE_KEY, status.state.ordinal)
|
||||
}
|
||||
|
||||
fun Bundle.putStatus(state: ProtocolState) {
|
||||
putInt(STATE_KEY, state.ordinal)
|
||||
}
|
||||
|
||||
fun Bundle.getStatus(): Status =
|
||||
Status.build {
|
||||
setState(ProtocolState.entries[getInt(STATE_KEY)])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue