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
1bea09c5
Commit
1bea09c5
authored
Dec 17, 2017
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary call to linkToDeath
parent
5c252a28
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
mobile/src/main/java/com/github/shadowsocks/MainActivity.kt
mobile/src/main/java/com/github/shadowsocks/MainActivity.kt
+1
-0
mobile/src/main/java/com/github/shadowsocks/ShadowsocksConnection.kt
...main/java/com/github/shadowsocks/ShadowsocksConnection.kt
+3
-2
No files found.
mobile/src/main/java/com/github/shadowsocks/MainActivity.kt
View file @
1bea09c5
...
...
@@ -224,6 +224,7 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, Drawe
}
}
override
val
listenForDeath
:
Boolean
get
()
=
true
override
fun
onServiceConnected
(
service
:
IShadowsocksService
)
=
changeState
(
service
.
state
)
override
fun
onServiceDisconnected
()
=
changeState
(
BaseService
.
IDLE
)
override
fun
binderDied
()
{
...
...
mobile/src/main/java/com/github/shadowsocks/ShadowsocksConnection.kt
View file @
1bea09c5
...
...
@@ -41,6 +41,7 @@ class ShadowsocksConnection(private val instance: Interface) : ServiceConnection
val
serviceCallback
:
IShadowsocksServiceCallback
?
get
()
=
null
val
connection
:
ShadowsocksConnection
get
()
=
connections
.
getOrPut
(
this
,
{
ShadowsocksConnection
(
this
)
})
val
listenForDeath
get
()
=
false
fun
onServiceConnected
(
service
:
IShadowsocksService
)
{
}
/**
...
...
@@ -66,7 +67,7 @@ class ShadowsocksConnection(private val instance: Interface) : ServiceConnection
override
fun
onServiceConnected
(
name
:
ComponentName
?,
binder
:
IBinder
)
{
this
.
binder
=
binder
binder
.
linkToDeath
(
instance
,
0
)
if
(
instance
.
listenForDeath
)
binder
.
linkToDeath
(
instance
,
0
)
val
service
=
IShadowsocksService
.
Stub
.
asInterface
(
binder
)
!!
this
.
service
=
service
if
(
instance
.
serviceCallback
!=
null
&&
!
callbackRegistered
)
try
{
...
...
@@ -106,7 +107,7 @@ class ShadowsocksConnection(private val instance: Interface) : ServiceConnection
(
instance
as
Context
).
unbindService
(
this
)
}
catch
(
_
:
IllegalArgumentException
)
{
}
// ignore
connectionActive
=
false
binder
?.
unlinkToDeath
(
instance
,
0
)
if
(
instance
.
listenForDeath
)
binder
?.
unlinkToDeath
(
instance
,
0
)
binder
=
null
service
=
null
}
...
...
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