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
27bf6a22
Commit
27bf6a22
authored
Jun 18, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix connection test not reset in background
parent
56de231c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+8
-8
No files found.
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
27bf6a22
...
@@ -177,7 +177,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
...
@@ -177,7 +177,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
override
def
onServiceConnected
()
{
override
def
onServiceConnected
()
{
// Update the UI
// Update the UI
if
(
fab
!=
null
)
fab
.
setEnabled
(
true
)
if
(
fab
!=
null
)
fab
.
setEnabled
(
true
)
updateState
(
true
)
updateState
()
if
(
Build
.
VERSION
.
SDK_INT
>=
21
&&
app
.
isNatEnabled
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
21
&&
app
.
isNatEnabled
)
{
val
snackbar
=
Snackbar
.
make
(
findViewById
(
android
.
R
.
id
.
content
),
R
.
string
.
nat_deprecated
,
Snackbar
.
LENGTH_LONG
)
val
snackbar
=
Snackbar
.
make
(
findViewById
(
android
.
R
.
id
.
content
),
R
.
string
.
nat_deprecated
,
Snackbar
.
LENGTH_LONG
)
snackbar
.
setAction
(
R
.
string
.
switch_to_vpn
,
(
_
=>
preferences
.
natSwitch
.
setChecked
(
false
))
:
View.OnClickListener
)
snackbar
.
setAction
(
R
.
string
.
switch_to_vpn
,
(
_
=>
preferences
.
natSwitch
.
setChecked
(
false
))
:
View.OnClickListener
)
...
@@ -445,7 +445,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
...
@@ -445,7 +445,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
}
}
}
}
private
def
updateState
(
initial
:
Boolean
=
fals
e
)
{
private
def
updateState
(
resetConnectionTest
:
Boolean
=
tru
e
)
{
if
(
bgService
!=
null
)
{
if
(
bgService
!=
null
)
{
bgService
.
getState
match
{
bgService
.
getState
match
{
case
State
.
CONNECTING
=>
case
State
.
CONNECTING
=>
...
@@ -462,7 +462,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
...
@@ -462,7 +462,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
preferences
.
setEnabled
(
false
)
preferences
.
setEnabled
(
false
)
fabProgressCircle
.
postDelayed
(
hideCircle
,
100
)
fabProgressCircle
.
postDelayed
(
hideCircle
,
100
)
stat
.
setVisibility
(
View
.
VISIBLE
)
stat
.
setVisibility
(
View
.
VISIBLE
)
if
(
initial
)
if
(
app
.
isNatEnabled
)
connectionTestText
.
setVisibility
(
View
.
GONE
)
else
{
if
(
resetConnectionTest
)
if
(
app
.
isNatEnabled
)
connectionTestText
.
setVisibility
(
View
.
GONE
)
else
{
connectionTestText
.
setVisibility
(
View
.
VISIBLE
)
connectionTestText
.
setVisibility
(
View
.
VISIBLE
)
connectionTestText
.
setText
(
getString
(
R
.
string
.
connection_test_pending
))
connectionTestText
.
setText
(
getString
(
R
.
string
.
connection_test_pending
))
}
}
...
@@ -485,7 +485,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
...
@@ -485,7 +485,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
}
}
}
}
private
def
updateCurrentProfile
()
{
private
def
updateCurrentProfile
()
=
{
// Check if current profile changed
// Check if current profile changed
if
(
app
.
profileId
!=
currentProfile
.
id
)
{
if
(
app
.
profileId
!=
currentProfile
.
id
)
{
currentProfile
=
app
.
currentProfile
match
{
currentProfile
=
app
.
currentProfile
match
{
...
@@ -500,7 +500,9 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
...
@@ -500,7 +500,9 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
updatePreferenceScreen
()
updatePreferenceScreen
()
if
(
serviceStarted
)
serviceLoad
()
if
(
serviceStarted
)
serviceLoad
()
}
true
}
else
false
}
}
protected
override
def
onResume
()
{
protected
override
def
onResume
()
{
...
@@ -508,9 +510,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
...
@@ -508,9 +510,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
ConfigUtils
.
refresh
(
this
)
ConfigUtils
.
refresh
(
this
)
updateCurrentProfile
()
updateState
(
updateCurrentProfile
())
updateState
()
}
}
private
def
updatePreferenceScreen
()
{
private
def
updatePreferenceScreen
()
{
...
...
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