From 556d8d78bd3e33556050761732129d34ae28cda4 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Sat, 9 Jul 2016 08:59:13 +0800 Subject: [PATCH] Revert "Refine #530" This reverts commit 56de231c4f5365983c4e72094f96714b6245ded0. --- .../scala/com/github/shadowsocks/ServiceBoundContext.scala | 1 + .../scala/com/github/shadowsocks/ShadowsocksNotification.scala | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala b/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala index debd6cef..703cbcc8 100644 --- a/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala +++ b/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala @@ -62,6 +62,7 @@ trait ServiceBoundContext extends Context with IBinder.DeathRecipient { connection = new ShadowsocksServiceConnection() bindService(intent, connection, Context.BIND_AUTO_CREATE) + startService(intent) } } diff --git a/src/main/scala/com/github/shadowsocks/ShadowsocksNotification.scala b/src/main/scala/com/github/shadowsocks/ShadowsocksNotification.scala index 6691ffd8..73b61938 100644 --- a/src/main/scala/com/github/shadowsocks/ShadowsocksNotification.scala +++ b/src/main/scala/com/github/shadowsocks/ShadowsocksNotification.scala @@ -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) } }