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
45b86476
Commit
45b86476
authored
Aug 19, 2019
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch RemoteException
parent
73faf2a1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
8 deletions
+9
-8
core/src/main/java/com/github/shadowsocks/aidl/ShadowsocksConnection.kt
...java/com/github/shadowsocks/aidl/ShadowsocksConnection.kt
+4
-3
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
+1
-1
mobile/src/main/java/com/github/shadowsocks/MainActivity.kt
mobile/src/main/java/com/github/shadowsocks/MainActivity.kt
+2
-2
tv/src/main/java/com/github/shadowsocks/tv/MainPreferenceFragment.kt
.../java/com/github/shadowsocks/tv/MainPreferenceFragment.kt
+2
-2
No files found.
core/src/main/java/com/github/shadowsocks/aidl/ShadowsocksConnection.kt
View file @
45b86476
...
...
@@ -24,7 +24,6 @@ import android.content.ComponentName
import
android.content.Context
import
android.content.Intent
import
android.content.ServiceConnection
import
android.os.DeadObjectException
import
android.os.Handler
import
android.os.IBinder
import
android.os.RemoteException
...
...
@@ -89,7 +88,7 @@ class ShadowsocksConnection(private val handler: Handler = Handler(),
if
(
bandwidthTimeout
!=
value
&&
service
!=
null
)
try
{
if
(
value
>
0
)
service
.
startListeningForBandwidth
(
serviceCallback
,
value
)
else
service
.
stopListeningForBandwidth
(
serviceCallback
)
}
catch
(
_
:
DeadObject
Exception
)
{
}
}
catch
(
_
:
Remote
Exception
)
{
}
field
=
value
}
var
service
:
IShadowsocksService
?
=
null
...
...
@@ -146,7 +145,9 @@ class ShadowsocksConnection(private val handler: Handler = Handler(),
connectionActive
=
false
if
(
listenForDeath
)
binder
?.
unlinkToDeath
(
this
,
0
)
binder
=
null
try
{
service
?.
stopListeningForBandwidth
(
serviceCallback
)
}
catch
(
_
:
RemoteException
)
{
}
service
=
null
callback
=
null
}
...
...
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
View file @
45b86476
...
...
@@ -115,7 +115,7 @@ object BaseService {
repeat
(
callbacks
.
beginBroadcast
())
{
try
{
work
(
callbacks
.
getBroadcastItem
(
it
))
}
catch
(
_
:
DeadObject
Exception
)
{
}
catch
(
_
:
Remote
Exception
)
{
}
catch
(
e
:
Exception
)
{
printLog
(
e
)
}
...
...
mobile/src/main/java/com/github/shadowsocks/MainActivity.kt
View file @
45b86476
...
...
@@ -26,8 +26,8 @@ import android.content.ActivityNotFoundException
import
android.content.Intent
import
android.net.VpnService
import
android.os.Bundle
import
android.os.DeadObjectException
import
android.os.Handler
import
android.os.RemoteException
import
android.util.Log
import
android.view.KeyCharacterMap
import
android.view.KeyEvent
...
...
@@ -133,7 +133,7 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Callback, OnPref
private
val
connection
=
ShadowsocksConnection
(
handler
,
true
)
override
fun
onServiceConnected
(
service
:
IShadowsocksService
)
=
changeState
(
try
{
BaseService
.
State
.
values
()[
service
.
state
]
}
catch
(
_
:
DeadObject
Exception
)
{
}
catch
(
_
:
Remote
Exception
)
{
BaseService
.
State
.
Idle
})
override
fun
onServiceDisconnected
()
=
changeState
(
BaseService
.
State
.
Idle
)
...
...
tv/src/main/java/com/github/shadowsocks/tv/MainPreferenceFragment.kt
View file @
45b86476
...
...
@@ -26,8 +26,8 @@ import android.content.ActivityNotFoundException
import
android.content.Intent
import
android.net.VpnService
import
android.os.Bundle
import
android.os.DeadObjectException
import
android.os.Handler
import
android.os.RemoteException
import
android.text.format.Formatter
import
android.util.Log
import
android.widget.Toast
...
...
@@ -139,7 +139,7 @@ class MainPreferenceFragment : LeanbackPreferenceFragmentCompat(), ShadowsocksCo
private
val
connection
=
ShadowsocksConnection
(
handler
,
true
)
override
fun
onServiceConnected
(
service
:
IShadowsocksService
)
=
changeState
(
try
{
BaseService
.
State
.
values
()[
service
.
state
]
}
catch
(
_
:
DeadObject
Exception
)
{
}
catch
(
_
:
Remote
Exception
)
{
BaseService
.
State
.
Idle
})
override
fun
onServiceDisconnected
()
=
changeState
(
BaseService
.
State
.
Idle
)
...
...
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