fix some issues

This commit is contained in:
Max Lv
2014-02-26 11:01:47 +08:00
parent 1926773229
commit 2bf44c7efd
2 changed files with 7 additions and 3 deletions
@@ -106,8 +106,8 @@ trait BaseService {
override def run() {
if (state != s) {
val n = callbacks.beginBroadcast()
for (i <- 0 to n -1) {
callbacks.getBroadcastItem(i).stateChanged(s, msg)
for (i <- 0 to n - 1) {
callbacks.getBroadcastItem(i).stateChanged(s, msg.substring(0, 64))
}
callbacks.finishBroadcast()
state = s
@@ -606,7 +606,11 @@ class Shadowsocks
def deattachService() {
if (bgService != null) {
bgService.unregisterCallback(callback)
try {
bgService.unregisterCallback(callback)
} catch {
case ignored: RemoteException => // Nothing
}
unbindService(connection)
bgService = null
}