Commit 556d8d78 authored by Max Lv's avatar Max Lv

Revert "Refine #530"

This reverts commit 56de231c.
parent 929b8c94
...@@ -62,6 +62,7 @@ trait ServiceBoundContext extends Context with IBinder.DeathRecipient { ...@@ -62,6 +62,7 @@ trait ServiceBoundContext extends Context with IBinder.DeathRecipient {
connection = new ShadowsocksServiceConnection() connection = new ShadowsocksServiceConnection()
bindService(intent, connection, Context.BIND_AUTO_CREATE) bindService(intent, connection, Context.BIND_AUTO_CREATE)
startService(intent)
} }
} }
......
...@@ -83,9 +83,7 @@ class ShadowsocksNotification(private val service: BaseService, profileName: Str ...@@ -83,9 +83,7 @@ class ShadowsocksNotification(private val service: BaseService, profileName: Str
show() show()
} else if (forceShow) show() } else if (forceShow) show()
private lazy val intent = new Intent(service, service.getClass)
def show() = { def show() = {
service.startService(intent)
service.startForeground(1, builder.build) service.startForeground(1, builder.build)
} }
...@@ -96,7 +94,6 @@ class ShadowsocksNotification(private val service: BaseService, profileName: Str ...@@ -96,7 +94,6 @@ class ShadowsocksNotification(private val service: BaseService, profileName: Str
} }
unregisterCallback unregisterCallback
service.stopForeground(true) service.stopForeground(true)
service.stopService(intent)
nm.cancel(1) nm.cancel(1)
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment