This commit is contained in:
Mygod
2016-06-17 17:59:12 +08:00
committed by Max Lv
parent 797b3fda12
commit 56de231c4f
2 changed files with 3 additions and 1 deletions
@@ -62,7 +62,6 @@ trait ServiceBoundContext extends Context with IBinder.DeathRecipient {
connection = new ShadowsocksServiceConnection()
bindService(intent, connection, Context.BIND_AUTO_CREATE)
startService(intent)
}
}
@@ -83,7 +83,9 @@ class ShadowsocksNotification(private val service: BaseService, profileName: Str
show()
} else if (forceShow) show()
private lazy val intent = new Intent(service, service.getClass)
def show() = {
service.startService(intent)
service.startForeground(1, builder.build)
}
@@ -94,6 +96,7 @@ class ShadowsocksNotification(private val service: BaseService, profileName: Str
}
unregisterCallback
service.stopForeground(true)
service.stopService(intent)
nm.cancel(1)
}
}