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
bae5e9d0
Commit
bae5e9d0
authored
Jul 22, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check bgService in ShadowsocksTileService
parent
455aa15f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/main/scala/com/github/shadowsocks/ShadowsocksTileService.scala
...scala/com/github/shadowsocks/ShadowsocksTileService.scala
+3
-3
No files found.
src/main/scala/com/github/shadowsocks/ShadowsocksTileService.scala
View file @
bae5e9d0
...
@@ -46,7 +46,7 @@ final class ShadowsocksTileService extends TileService with ServiceBoundContext
...
@@ -46,7 +46,7 @@ final class ShadowsocksTileService extends TileService with ServiceBoundContext
}
}
}
}
override
def
onServiceConnected
=
callback
.
stateChanged
(
bgService
.
getState
,
null
)
override
def
onServiceConnected
()
=
callback
.
stateChanged
(
bgService
.
getState
,
null
)
override
def
onCreate
{
override
def
onCreate
{
super
.
onCreate
super
.
onCreate
...
@@ -66,9 +66,9 @@ final class ShadowsocksTileService extends TileService with ServiceBoundContext
...
@@ -66,9 +66,9 @@ final class ShadowsocksTileService extends TileService with ServiceBoundContext
detachService
// just in case the user switches to NAT mode, also saves battery
detachService
// just in case the user switches to NAT mode, also saves battery
}
}
override
def
onClick
=
if
(
isLocked
)
unlockAndRun
(
toggle
)
else
toggle
()
override
def
onClick
()
=
if
(
isLocked
)
unlockAndRun
(
toggle
)
else
toggle
()
private
def
toggle
()
=
bgService
.
getState
match
{
private
def
toggle
()
=
if
(
bgService
!=
null
)
bgService
.
getState
match
{
case
State
.
STOPPED
=>
Utils
.
startSsService
(
this
)
case
State
.
STOPPED
=>
Utils
.
startSsService
(
this
)
case
State
.
CONNECTED
=>
Utils
.
stopSsService
(
this
)
case
State
.
CONNECTED
=>
Utils
.
stopSsService
(
this
)
case
_
=>
// ignore
case
_
=>
// ignore
...
...
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