Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
0018a7ca
Commit
0018a7ca
authored
Dec 26, 2015
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix NAT mode not working after task removed from recent
parent
51ceb3da
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
17 deletions
+10
-17
src/main/scala/com/github/shadowsocks/BaseService.scala
src/main/scala/com/github/shadowsocks/BaseService.scala
+8
-1
src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala
...in/scala/com/github/shadowsocks/ServiceBoundContext.scala
+0
-2
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
.../scala/com/github/shadowsocks/ShadowsocksNatService.scala
+1
-7
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
.../scala/com/github/shadowsocks/ShadowsocksVpnService.scala
+1
-7
No files found.
src/main/scala/com/github/shadowsocks/BaseService.scala
View file @
0018a7ca
...
...
@@ -42,7 +42,7 @@ package com.github.shadowsocks
import
java.util.
{
Timer
,
TimerTask
}
import
android.app.Service
import
android.content.
Context
import
android.content.
{
Intent
,
Context
}
import
android.os.
{
Handler
,
RemoteCallbackList
}
import
com.github.shadowsocks.aidl.
{
Config
,
IShadowsocksService
,
IShadowsocksServiceCallback
}
import
com.github.shadowsocks.utils.
{
State
,
TrafficMonitor
,
TrafficMonitorThread
}
...
...
@@ -110,6 +110,7 @@ trait BaseService extends Service {
def
startRunner
(
config
:
Config
)
{
this
.
config
=
config
startService
(
new
Intent
(
getContext
,
getClass
))
TrafficMonitor
.
reset
()
trafficMonitorThread
=
new
TrafficMonitorThread
()
trafficMonitorThread
.
start
()
...
...
@@ -124,6 +125,12 @@ trait BaseService extends Service {
trafficMonitorThread
.
stopThread
()
trafficMonitorThread
=
null
}
// change the state
changeState
(
State
.
STOPPED
)
// stop the service if nothing has bound to it
stopSelf
()
}
def
updateTrafficTotal
(
tx
:
Long
,
rx
:
Long
)
{
...
...
src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala
View file @
0018a7ca
...
...
@@ -54,8 +54,6 @@ trait ServiceBoundContext extends Context {
connection
=
new
ShadowsocksServiceConnection
()
bindService
(
intent
,
connection
,
Context
.
BIND_AUTO_CREATE
)
startService
(
new
Intent
(
this
,
s
))
}
}
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
View file @
0018a7ca
...
...
@@ -458,8 +458,6 @@ class ShadowsocksNatService extends BaseService {
override
def
stopRunner
()
{
super
.
stopRunner
()
// channge the state
changeState
(
State
.
STOPPING
)
...
...
@@ -476,11 +474,7 @@ class ShadowsocksNatService extends BaseService {
// reset NAT
killProcesses
()
// stop the service if nothing has bound to it
stopSelf
()
// change the state
changeState
(
State
.
STOPPED
)
super
.
stopRunner
()
}
override
def
getTag
=
TAG
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
View file @
0018a7ca
...
...
@@ -113,8 +113,6 @@ class ShadowsocksVpnService extends VpnService with BaseService {
override
def
stopRunner
()
{
super
.
stopRunner
()
if
(
vpnThread
!=
null
)
{
vpnThread
.
stopThread
()
vpnThread
=
null
...
...
@@ -136,17 +134,13 @@ class ShadowsocksVpnService extends VpnService with BaseService {
conn
=
null
}
// stop the service if nothing has bound to it
stopSelf
()
// clean up recevier
if
(
closeReceiver
!=
null
)
{
unregisterReceiver
(
closeReceiver
)
closeReceiver
=
null
}
// channge the state
changeState
(
State
.
STOPPED
)
super
.
stopRunner
()
}
def
getVersionName
:
String
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment