Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wade
DnsChanger
Commits
67222d6b
Commit
67222d6b
authored
Apr 13, 2018
by
Daniel Wolf
Browse files
Don't add the server to any list if it is empty
parent
aab090de
Changes
2
Show whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/dnschanger/activities/MainActivity.java
View file @
67222d6b
...
...
@@ -761,7 +761,7 @@ public class MainActivity extends NavigationDrawerActivity implements RuleImport
dialog
.
show
();
((
MainFragment
)
currentFragment
()).
checkDNSReachability
(
new
MainFragment
.
DNSReachabilityCallback
()
{
@Override
public
void
checkFinished
(
@NonNull
List
<
IPPortPair
>
unreachable
,
List
<
IPPortPair
>
reachable
)
{
public
void
checkFinished
(
@NonNull
List
<
IPPortPair
>
unreachable
,
@NonNull
List
<
IPPortPair
>
reachable
)
{
dialog
.
dismiss
();
if
(
unreachable
.
size
()
==
0
){
MainActivity
.
this
.
runOnUiThread
(
new
Runnable
()
{
...
...
app/src/main/java/com/frostnerd/dnschanger/fragments/MainFragment.java
View file @
67222d6b
...
...
@@ -496,11 +496,11 @@ public class MainFragment extends Fragment {
public
abstract
void
checkFinished
(
@NonNull
List
<
IPPortPair
>
unreachable
,
@NonNull
List
<
IPPortPair
>
reachable
);
public
final
void
checkProgress
(
IPPortPair
server
,
boolean
reachable
){
if
(
server
==
null
)
return
;
public
final
void
checkProgress
(
@NonNull
IPPortPair
server
,
boolean
reachable
){
if
(
server
==
null
||
server
.
isEmpty
()
)
return
;
if
(!
reachable
)
unreachable
.
add
(
server
);
else
this
.
reachable
.
add
(
server
);
if
(
this
.
unreachable
.
size
()
+
this
.
reachable
.
size
()
>=
servers
)
checkFinished
(
unreachable
,
this
.
reachable
);
if
(
this
.
unreachable
.
size
()
+
this
.
reachable
.
size
()
>=
servers
)
checkFinished
(
this
.
unreachable
,
this
.
reachable
);
}
void
setServers
(
int
servers
){
...
...
Write
Preview
Supports
Markdown
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