@@ -62,6 +62,7 @@ trait ServiceBoundContext extends Context with IBinder.DeathRecipient {
|
||||
|
||||
connection = new ShadowsocksServiceConnection()
|
||||
bindService(intent, connection, Context.BIND_AUTO_CREATE)
|
||||
startService(intent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,9 +83,7 @@ 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)
|
||||
}
|
||||
|
||||
@@ -96,7 +94,6 @@ class ShadowsocksNotification(private val service: BaseService, profileName: Str
|
||||
}
|
||||
unregisterCallback
|
||||
service.stopForeground(true)
|
||||
service.stopService(intent)
|
||||
nm.cancel(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user