Fix hostname not displayed correctly in notification

This commit is contained in:
Mygod
2017-04-07 19:47:06 +08:00
parent b71019149f
commit 1268376b68
3 changed files with 3 additions and 2 deletions
@@ -124,6 +124,7 @@ trait BaseService extends Service {
} else true
def connect() {
profile.name = profile.getName // save original name before it's (possibly) overwritten by IP addresses
if (profile.host == "198.199.101.152") {
val holder = app.containerHolder
val container = holder.getContainer
@@ -204,7 +204,7 @@ class ShadowsocksNatService extends BaseService {
AclSyncJob.schedule(profile.route)
changeState(State.CONNECTED)
notification = new ShadowsocksNotification(this, profile.getName, true)
notification = new ShadowsocksNotification(this, profile.name, true)
}
override def stopRunner(stopService: Boolean, msg: String = null) {
@@ -138,7 +138,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
if (profile.route != Acl.ALL && profile.route != Acl.CUSTOM_RULES)
AclSyncJob.schedule(profile.route)
notification = new ShadowsocksNotification(this, profile.getName)
notification = new ShadowsocksNotification(this, profile.name)
}
/** Called when the activity is first created. */