summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadTileService.kt8
1 files changed, 8 insertions, 0 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadTileService.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadTileService.kt
index 01a14db174..4e84a9f1e5 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadTileService.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadTileService.kt
@@ -1,8 +1,10 @@
package net.mullvad.mullvadvpn.service
import android.content.Intent
+import android.graphics.drawable.Icon
import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
+import net.mullvad.mullvadvpn.R
import net.mullvad.mullvadvpn.model.TunnelState
import net.mullvad.mullvadvpn.service.tunnelstate.TunnelStateListener
import net.mullvad.talpid.tunnel.ActionAfterDisconnect
@@ -17,11 +19,15 @@ class MullvadTileService : TileService() {
}
private lateinit var listener: TunnelStateListener
+ private lateinit var securedIcon: Icon
+ private lateinit var unsecuredIcon: Icon
override fun onCreate() {
super.onCreate()
listener = TunnelStateListener(this)
+ securedIcon = Icon.createWithResource(this, R.drawable.small_logo_white)
+ unsecuredIcon = Icon.createWithResource(this, R.drawable.small_logo_black)
}
override fun onStartListening() {
@@ -66,8 +72,10 @@ class MullvadTileService : TileService() {
qsTile.apply {
if (secured) {
state = Tile.STATE_ACTIVE
+ icon = securedIcon
} else {
state = Tile.STATE_INACTIVE
+ icon = unsecuredIcon
}
updateTile()