Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
2b009fff
Commit
2b009fff
authored
Dec 08, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Schedule KeepAliveJob when online
parent
ad4bab2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
MainPresenter.java
...main/java/chat/rocket/android/activity/MainPresenter.java
+7
-3
No files found.
app/src/main/java/chat/rocket/android/activity/MainPresenter.java
View file @
2b009fff
...
...
@@ -16,6 +16,7 @@ import chat.rocket.android.helper.LogIfError;
import
chat.rocket.android.helper.Logger
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.android.service.ConnectivityManagerApi
;
import
chat.rocket.android.service.KeepAliveJob
;
import
chat.rocket.android.service.ServerConnectivity
;
import
chat.rocket.android.shared.BasePresenter
;
import
chat.rocket.android_ddp.DDPClient
;
...
...
@@ -211,8 +212,8 @@ public class MainPresenter extends BasePresenter<MainContract.View>
view
.
showConnecting
();
return
;
}
//
view.showConnectionOk();
// TODO: Should we remove below and above calls to view?
//
view.showConnectionOk();
},
Logger:
:
report
);
...
...
@@ -227,10 +228,13 @@ public class MainPresenter extends BasePresenter<MainContract.View>
.
subscribe
(
connectivity
->
{
if
(
connectivity
.
state
==
ServerConnectivity
.
STATE_CONNECTED
)
{
KeepAliveJob
.
Companion
.
cancel
();
//TODO: notify almost connected or something like that.
// view.showConnectionOk();
}
else
if
(
connectivity
.
state
==
ServerConnectivity
.
STATE_DISCONNECTED
)
{
KeepAliveJob
.
Companion
.
cancel
();
if
(
connectivity
.
code
==
DDPClient
.
REASON_NETWORK_ERROR
)
{
KeepAliveJob
.
Companion
.
schedule
();
view
.
showConnectionError
();
}
}
else
if
(
connectivity
.
state
==
ServerConnectivity
.
STATE_SESSION_ESTABLISHED
)
{
...
...
@@ -240,7 +244,7 @@ public class MainPresenter extends BasePresenter<MainContract.View>
view
.
showConnecting
();
}
},
Logger:
:
report
RCLog:
:
e
);
addSubscription
(
disposable
);
...
...
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