diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-01-30 19:20:15 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-01-31 19:33:42 +0000 |
| commit | 33b69240f58f45def5ccf14342eb44339cc3b716 (patch) | |
| tree | 1a77f9eb76e4ca89a8e1c29f3bae52084f99c4eb /android | |
| parent | 3a0963e2c7253c2bcf0e302b766e7e95106890b2 (diff) | |
| download | mullvadvpn-33b69240f58f45def5ccf14342eb44339cc3b716.tar.xz mullvadvpn-33b69240f58f45def5ccf14342eb44339cc3b716.zip | |
Allow notification to be locked on foreground
Diffstat (limited to 'android')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/service/ForegroundNotificationManager.kt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ForegroundNotificationManager.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ForegroundNotificationManager.kt index f73a64d849..0a9a48e3fa 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ForegroundNotificationManager.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ForegroundNotificationManager.kt @@ -50,7 +50,7 @@ class ForegroundNotificationManager(val service: Service, val connectionProxy: C } private val shouldBeOnForeground - get() = !(tunnelState is TunnelState.Disconnected) + get() = lockedToForeground || !(tunnelState is TunnelState.Disconnected) private val notificationText: Int get() { @@ -142,12 +142,19 @@ class ForegroundNotificationManager(val service: Service, val connectionProxy: C var onConnect: (() -> Unit)? = null var onDisconnect: (() -> Unit)? = null + var loggedIn = false set(value) { field = value updateNotification() } + var lockedToForeground = false + set(value) { + field = value + updateNotificationForegroundStatus() + } + init { if (Build.VERSION.SDK_INT >= 26) { initChannel() |
