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
65d5c3a7
Commit
65d5c3a7
authored
Dec 12, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some issues when logging-in after previous backpress fix
parent
cf18e7f8
Changes
28
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
951 additions
and
975 deletions
+951
-975
OkHttpHelper.kt
...src/debug/java/chat/rocket/android/helper/OkHttpHelper.kt
+4
-4
RocketChatApplication.java
.../main/java/chat/rocket/android/RocketChatApplication.java
+2
-1
RocketChatCache.java
app/src/main/java/chat/rocket/android/RocketChatCache.java
+0
-417
RocketChatCache.kt
app/src/main/java/chat/rocket/android/RocketChatCache.kt
+407
-0
AbstractAuthedActivity.java
.../chat/rocket/android/activity/AbstractAuthedActivity.java
+189
-190
LoginActivity.java
...main/java/chat/rocket/android/activity/LoginActivity.java
+74
-66
MainActivity.java
.../main/java/chat/rocket/android/activity/MainActivity.java
+6
-10
MainPresenter.java
...main/java/chat/rocket/android/activity/MainPresenter.java
+7
-9
MethodCallHelper.java
...c/main/java/chat/rocket/android/api/MethodCallHelper.java
+4
-8
DefaultCookieProvider.java
...a/chat/rocket/android/api/rest/DefaultCookieProvider.java
+27
-32
InputHostnameFragment.java
...et/android/fragment/add_server/InputHostnameFragment.java
+1
-1
InputHostnamePresenter.java
...t/android/fragment/add_server/InputHostnamePresenter.java
+2
-4
RoomPresenter.java
.../chat/rocket/android/fragment/chatroom/RoomPresenter.java
+2
-3
MessageOptionsDialogFragment.java
...ragment/chatroom/dialog/MessageOptionsDialogFragment.java
+114
-116
LoginContract.java
.../rocket/android/fragment/server_config/LoginContract.java
+14
-10
LoginFragment.kt
...at/rocket/android/fragment/server_config/LoginFragment.kt
+7
-3
LoginPresenter.kt
...t/rocket/android/fragment/server_config/LoginPresenter.kt
+3
-6
SidebarMainFragment.java
.../rocket/android/fragment/sidebar/SidebarMainFragment.java
+0
-2
SidebarMainPresenter.java
...rocket/android/fragment/sidebar/SidebarMainPresenter.java
+7
-10
MessagePopup.java
...at/rocket/android/layouthelper/chatroom/MessagePopup.java
+2
-4
PushManager.kt
app/src/main/java/chat/rocket/android/push/PushManager.kt
+9
-5
KeepAliveJob.kt
...src/main/java/chat/rocket/android/service/KeepAliveJob.kt
+0
-3
RealmBasedConnectivityManager.java
...rocket/android/service/RealmBasedConnectivityManager.java
+1
-1
RocketChatService.java
...n/java/chat/rocket/android/service/RocketChatService.java
+18
-15
AbstractRocketChatCacheObserver.java
...oid/service/internal/AbstractRocketChatCacheObserver.java
+2
-4
StreamRoomMessageManager.java
...et/android/service/internal/StreamRoomMessageManager.java
+47
-49
GcmPushRegistrationObserver.java
...android/service/observer/GcmPushRegistrationObserver.java
+1
-1
SessionObserver.java
...chat/rocket/android/service/observer/SessionObserver.java
+1
-1
No files found.
app/src/debug/java/chat/rocket/android/helper/OkHttpHelper.kt
View file @
65d5c3a7
package
chat.rocket.android.helper
import
android.content.Context
import
chat.rocket.android.RocketChatCache
import
chat.rocket.android.api.rest.CookieInterceptor
import
chat.rocket.android.api.rest.DefaultCookieProvider
import
com.facebook.stetho.okhttp3.StethoInterceptor
...
...
@@ -24,17 +23,18 @@ object OkHttpHelper {
return
httpClientForUploadFile
?:
throw
AssertionError
(
"httpClientForUploadFile set to null by another thread"
)
}
fun
getClientForDownloadFile
(
context
:
Context
):
OkHttpClient
{
if
(
httpClientForDownloadFile
==
null
)
{
fun
getClientForDownloadFile
():
OkHttpClient
{
if
(
httpClientForDownloadFile
==
null
)
{
httpClientForDownloadFile
=
OkHttpClient
.
Builder
()
.
addNetworkInterceptor
(
StethoInterceptor
())
.
followRedirects
(
true
)
.
followSslRedirects
(
true
)
.
addInterceptor
(
CookieInterceptor
(
DefaultCookieProvider
(
RocketChatCache
(
context
)
)))
.
addInterceptor
(
CookieInterceptor
(
DefaultCookieProvider
()))
.
build
()
}
return
httpClientForDownloadFile
?:
throw
AssertionError
(
"httpClientForDownloadFile set to null by another thread"
)
}
/**
* Returns the OkHttpClient instance for WebSocket connection.
* @return The OkHttpClient WebSocket connection instance.
...
...
app/src/main/java/chat/rocket/android/RocketChatApplication.java
View file @
65d5c3a7
...
...
@@ -35,6 +35,7 @@ public class RocketChatApplication extends MultiDexApplication {
@Override
public
void
onCreate
()
{
super
.
onCreate
();
RocketChatCache
.
INSTANCE
.
initialize
(
this
);
JobManager
.
create
(
this
).
addJobCreator
(
new
RocketChatJobCreator
());
DDPClient
.
initialize
(
OkHttpHelper
.
INSTANCE
.
getClientForWebSocket
());
Fabric
.
with
(
this
,
new
Crashlytics
());
...
...
@@ -46,7 +47,7 @@ public class RocketChatApplication extends MultiDexApplication {
RealmStore
.
put
(
serverInfo
.
getHostname
());
}
RocketChatWidgets
.
initialize
(
this
,
OkHttpHelper
.
INSTANCE
.
getClientForDownloadFile
(
this
));
RocketChatWidgets
.
initialize
(
this
,
OkHttpHelper
.
INSTANCE
.
getClientForDownloadFile
());
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
AppCompatDelegate
.
setCompatVectorFromResourcesEnabled
(
true
);
...
...
app/src/main/java/chat/rocket/android/RocketChatCache.java
deleted
100644 → 0
View file @
cf18e7f8
This diff is collapsed.
Click to expand it.
app/src/main/java/chat/rocket/android/RocketChatCache.kt
0 → 100644
View file @
65d5c3a7
This diff is collapsed.
Click to expand it.
app/src/main/java/chat/rocket/android/activity/AbstractAuthedActivity.java
View file @
65d5c3a7
...
...
@@ -24,10 +24,11 @@ import io.reactivex.schedulers.Schedulers;
import
okhttp3.HttpUrl
;
abstract
class
AbstractAuthedActivity
extends
AbstractFragmentActivity
{
@State
protected
String
hostname
;
@State
protected
String
roomId
;
@State
protected
String
hostname
;
@State
protected
String
roomId
;
private
RocketChatCache
rocketChatCache
;
private
CompositeDisposable
compositeDisposable
=
new
CompositeDisposable
();
private
boolean
isNotification
;
...
...
@@ -36,13 +37,11 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
rocketChatCache
=
new
RocketChatCache
(
this
);
if
(
savedInstanceState
==
null
)
{
handleIntent
(
getIntent
());
}
updateHostnameIfNeeded
(
rocketChatCache
.
getSelectedServerHostname
());
updateHostnameIfNeeded
(
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
());
}
@Override
...
...
@@ -61,16 +60,16 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
HttpUrl
url
=
HttpUrl
.
parse
(
hostname
);
if
(
url
!=
null
)
{
String
hostnameFromPush
=
url
.
host
();
String
loginHostname
=
rocketChatCache
.
getSiteUrlFor
(
hostnameFromPush
);
rocketChatCache
.
setSelectedServerHostname
(
loginHostname
);
String
loginHostname
=
RocketChatCache
.
INSTANCE
.
getSiteUrlFor
(
hostnameFromPush
);
RocketChatCache
.
INSTANCE
.
setSelectedServerHostname
(
loginHostname
);
if
(
intent
.
hasExtra
(
PushManager
.
EXTRA_ROOM_ID
))
{
rocketChatCache
.
setSelectedRoomId
(
intent
.
getStringExtra
(
PushManager
.
EXTRA_ROOM_ID
));
RocketChatCache
.
INSTANCE
.
setSelectedRoomId
(
intent
.
getStringExtra
(
PushManager
.
EXTRA_ROOM_ID
));
}
}
PushManager
.
INSTANCE
.
clearNotificationsByHost
(
hostname
);
}
else
{
updateHostnameIfNeeded
(
rocketChatCache
.
getSelectedServerHostname
());
updateHostnameIfNeeded
(
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
());
}
if
(
intent
.
hasExtra
(
PushManager
.
EXTRA_NOT_ID
)
&&
intent
.
hasExtra
(
PushManager
.
EXTRA_HOSTNAME
))
{
...
...
@@ -80,7 +79,7 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
HttpUrl
url
=
HttpUrl
.
parse
(
hostname
);
if
(
url
!=
null
)
{
String
hostnameFromPush
=
url
.
host
();
String
loginHostname
=
rocketChatCache
.
getSiteUrlFor
(
hostnameFromPush
);
String
loginHostname
=
RocketChatCache
.
INSTANCE
.
getSiteUrlFor
(
hostnameFromPush
);
PushManager
.
INSTANCE
.
clearNotificationsByHostAndNotificationId
(
loginHostname
,
notificationId
);
}
else
{
PushManager
.
INSTANCE
.
clearNotificationsByNotificationId
(
notificationId
);
...
...
@@ -93,14 +92,14 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
if
(
hostname
==
null
)
{
if
(
newHostname
!=
null
&&
assertServerRealmStoreExists
(
newHostname
))
{
updateHostname
(
newHostname
);
updateRoomIdIfNeeded
(
rocketChatCache
.
getSelectedRoomId
());
updateRoomIdIfNeeded
(
RocketChatCache
.
INSTANCE
.
getSelectedRoomId
());
}
else
{
recoverFromHostnameError
();
}
}
else
{
if
(
hostname
.
equals
(
newHostname
))
{
updateHostname
(
newHostname
);
updateRoomIdIfNeeded
(
rocketChatCache
.
getSelectedRoomId
());
updateRoomIdIfNeeded
(
RocketChatCache
.
INSTANCE
.
getSelectedRoomId
());
return
;
}
...
...
@@ -135,8 +134,8 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
// just connect to the first available
final
ServerInfo
serverInfo
=
serverInfoList
.
get
(
0
);
rocketChatCache
.
setSelectedServerHostname
(
serverInfo
.
getHostname
());
rocketChatCache
.
setSelectedRoomId
(
null
);
RocketChatCache
.
INSTANCE
.
setSelectedServerHostname
(
serverInfo
.
getHostname
());
RocketChatCache
.
INSTANCE
.
setSelectedRoomId
(
null
);
}
private
void
updateRoomIdIfNeeded
(
String
newRoomId
)
{
...
...
@@ -159,7 +158,7 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
RealmRoom
room
=
RealmStore
.
get
(
hostname
).
executeTransactionForRead
(
realm
->
realm
.
where
(
RealmRoom
.
class
).
equalTo
(
RealmRoom
.
ROOM_ID
,
roomId
).
findFirst
());
if
(
room
==
null
)
{
rocketChatCache
.
setSelectedRoomId
(
null
);
RocketChatCache
.
INSTANCE
.
setSelectedRoomId
(
null
);
return
false
;
}
return
true
;
...
...
@@ -184,8 +183,8 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
ConnectivityManager
.
getInstance
(
getApplicationContext
()).
keepAliveServer
();
if
(
isNotification
)
{
updateHostnameIfNeeded
(
rocketChatCache
.
getSelectedServerHostname
());
updateRoomIdIfNeeded
(
rocketChatCache
.
getSelectedRoomId
());
updateHostnameIfNeeded
(
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
());
updateRoomIdIfNeeded
(
RocketChatCache
.
INSTANCE
.
getSelectedRoomId
());
isNotification
=
false
;
}
}
...
...
@@ -204,7 +203,7 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
private
void
subscribeToConfigChanges
()
{
compositeDisposable
.
add
(
rocketChatCache
.
getSelectedServerHostnamePublisher
()
RocketChatCache
.
INSTANCE
.
getSelectedServerHostnamePublisher
()
.
map
(
Optional:
:
get
)
.
distinctUntilChanged
()
.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -216,7 +215,7 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
);
compositeDisposable
.
add
(
rocketChatCache
.
getSelectedRoomIdPublisher
()
RocketChatCache
.
INSTANCE
.
getSelectedRoomIdPublisher
()
.
filter
(
Optional:
:
isPresent
)
.
map
(
Optional:
:
get
)
.
subscribeOn
(
Schedulers
.
io
())
...
...
app/src/main/java/chat/rocket/android/activity/LoginActivity.java
View file @
65d5c3a7
...
...
@@ -89,4 +89,12 @@ public class LoginActivity extends AbstractFragmentActivity implements LoginCont
finish
();
overridePendingTransition
(
android
.
R
.
anim
.
fade_in
,
android
.
R
.
anim
.
fade_out
);
}
@Override
protected
boolean
onBackPress
()
{
LoginFragment
loginFragment
=
(
LoginFragment
)
getSupportFragmentManager
()
.
findFragmentById
(
getLayoutContainerForFragment
());
loginFragment
.
goBack
();
return
true
;
}
}
app/src/main/java/chat/rocket/android/activity/MainActivity.java
View file @
65d5c3a7
...
...
@@ -81,7 +81,7 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
ConnectivityManagerApi
connectivityManager
=
ConnectivityManager
.
getInstance
(
getApplicationContext
());
if
(
hostname
==
null
||
presenter
==
null
)
{
String
previousHostname
=
hostname
;
hostname
=
new
RocketChatCache
(
getApplicationContext
())
.
getSelectedServerHostname
();
hostname
=
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
();
if
(
hostname
==
null
)
{
showAddServerScreen
();
}
else
{
...
...
@@ -95,7 +95,7 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
connectivityManager
.
keepAliveServer
();
presenter
.
bindView
(
this
);
presenter
.
loadSignedInServers
(
hostname
);
roomId
=
new
RocketChatCache
(
getApplicationContext
())
.
getSelectedRoomId
();
roomId
=
RocketChatCache
.
INSTANCE
.
getSelectedRoomId
();
}
}
...
...
@@ -186,15 +186,12 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
PublicSettingRepository
publicSettingRepository
=
new
RealmPublicSettingRepository
(
hostname
);
RocketChatCache
rocketChatCache
=
new
RocketChatCache
(
this
);
presenter
=
new
MainPresenter
(
roomInteractor
,
createRoomInteractor
,
sessionInteractor
,
new
MethodCallHelper
(
this
,
hostname
),
ConnectivityManager
.
getInstance
(
getApplicationContext
()),
rocketChatCache
,
publicSettingRepository
);
...
...
@@ -203,12 +200,12 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
presenter
.
bindView
(
this
);
presenter
.
loadSignedInServers
(
hostname
);
roomId
=
rocketChatCache
.
getSelectedRoomId
();
roomId
=
RocketChatCache
.
INSTANCE
.
getSelectedRoomId
();
}
private
void
updateSidebarMainFragment
()
{
closeSidebarIfNeeded
();
String
selectedServerHostname
=
new
RocketChatCache
(
this
)
.
getSelectedServerHostname
();
String
selectedServerHostname
=
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
();
Fragment
sidebarFragment
=
findFragmentByTag
(
selectedServerHostname
);
if
(
sidebarFragment
==
null
)
{
sidebarFragment
=
SidebarMainFragment
.
create
(
selectedServerHostname
);
...
...
@@ -399,15 +396,14 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
private
void
changeServerIfNeeded
(
String
serverHostname
)
{
if
(!
hostname
.
equalsIgnoreCase
(
serverHostname
))
{
RocketChatCache
rocketChatCache
=
new
RocketChatCache
(
getApplicationContext
());
rocketChatCache
.
setSelectedServerHostname
(
serverHostname
);
RocketChatCache
.
INSTANCE
.
setSelectedServerHostname
(
serverHostname
);
}
}
@DebugLog
public
void
onLogout
()
{
presenter
.
prepareToLogout
();
if
(
new
RocketChatCache
(
getApplicationContext
())
.
getSelectedServerHostname
()
==
null
)
{
if
(
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
()
==
null
)
{
finish
();
LaunchUtil
.
showMainActivity
(
this
);
}
else
{
...
...
app/src/main/java/chat/rocket/android/activity/MainPresenter.java
View file @
65d5c3a7
...
...
@@ -41,7 +41,6 @@ public class MainPresenter extends BasePresenter<MainContract.View>
private
final
SessionInteractor
sessionInteractor
;
private
final
MethodCallHelper
methodCallHelper
;
private
final
ConnectivityManagerApi
connectivityManagerApi
;
private
final
RocketChatCache
rocketChatCache
;
private
final
PublicSettingRepository
publicSettingRepository
;
public
MainPresenter
(
RoomInteractor
roomInteractor
,
...
...
@@ -49,13 +48,12 @@ public class MainPresenter extends BasePresenter<MainContract.View>
SessionInteractor
sessionInteractor
,
MethodCallHelper
methodCallHelper
,
ConnectivityManagerApi
connectivityManagerApi
,
RocketChatCache
rocketChatCache
,
PublicSettingRepository
publicSettingRepository
)
{
PublicSettingRepository
publicSettingRepository
)
{
this
.
roomInteractor
=
roomInteractor
;
this
.
canCreateRoomInteractor
=
canCreateRoomInteractor
;
this
.
sessionInteractor
=
sessionInteractor
;
this
.
methodCallHelper
=
methodCallHelper
;
this
.
connectivityManagerApi
=
connectivityManagerApi
;
this
.
rocketChatCache
=
rocketChatCache
;
this
.
publicSettingRepository
=
publicSettingRepository
;
}
...
...
@@ -101,7 +99,7 @@ public class MainPresenter extends BasePresenter<MainContract.View>
@Override
public
void
release
()
{
if
(
rocketChatCache
.
getSessionToken
()
!=
null
)
{
if
(
RocketChatCache
.
INSTANCE
.
getSessionToken
()
!=
null
)
{
setUserAway
();
}
...
...
@@ -158,13 +156,13 @@ public class MainPresenter extends BasePresenter<MainContract.View>
String
logoUrl
=
(
jsonObject
.
has
(
"url"
))
?
jsonObject
.
optString
(
"url"
)
:
jsonObject
.
optString
(
"defaultUrl"
);
String
siteName
=
serverInfoPair
.
second
;
rocketChatCache
.
addHostname
(
hostname
.
toLowerCase
(),
logoUrl
,
siteName
);
return
rocketChatCache
.
getServerList
();
RocketChatCache
.
INSTANCE
.
addHostname
(
hostname
.
toLowerCase
(),
logoUrl
,
siteName
);
return
RocketChatCache
.
INSTANCE
.
getServerList
();
}
private
void
openRoom
()
{
String
hostname
=
rocketChatCache
.
getSelectedServerHostname
();
String
roomId
=
rocketChatCache
.
getSelectedRoomId
();
String
hostname
=
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
();
String
roomId
=
RocketChatCache
.
INSTANCE
.
getSelectedRoomId
();
if
(
roomId
==
null
||
roomId
.
length
()
==
0
)
{
view
.
showHome
();
...
...
@@ -214,7 +212,7 @@ public class MainPresenter extends BasePresenter<MainContract.View>
}
// TODO: Should we remove below and above calls to view?
// view.showConnectionOk();
rocketChatCache
.
setSessionToken
(
session
.
getToken
());
RocketChatCache
.
INSTANCE
.
setSessionToken
(
session
.
getToken
());
},
Logger
.
INSTANCE
::
report
);
...
...
app/src/main/java/chat/rocket/android/api/MethodCallHelper.java
View file @
65d5c3a7
...
...
@@ -12,7 +12,6 @@ import java.util.UUID;
import
bolts.Continuation
;
import
bolts.Task
;
import
chat.rocket.android.RocketChatApplication
;
import
chat.rocket.android.RocketChatCache
;
import
chat.rocket.android.helper.CheckSum
;
import
chat.rocket.android.helper.TextUtils
;
...
...
@@ -304,9 +303,7 @@ public class MethodCallHelper {
realm
.
createOrUpdateAllFromJson
(
RealmRoom
.
class
,
result
);
Context
appContext
=
RocketChatApplication
.
getInstance
();
RocketChatCache
cache
=
new
RocketChatCache
(
appContext
);
JSONObject
openedRooms
=
cache
.
getOpenedRooms
();
JSONObject
openedRooms
=
RocketChatCache
.
INSTANCE
.
getOpenedRooms
();
RealmQuery
<
RealmRoom
>
query
=
realm
.
where
(
RealmRoom
.
class
);
Iterator
<
String
>
keys
=
openedRooms
.
keys
();
...
...
@@ -314,7 +311,7 @@ public class MethodCallHelper {
String
rid
=
keys
.
next
();
RealmRoom
realmRoom
=
query
.
equalTo
(
RealmRoom
.
ID
,
rid
).
findFirst
();
if
(
realmRoom
==
null
)
{
cache
.
removeOpenedRoom
(
rid
);
RocketChatCache
.
INSTANCE
.
removeOpenedRoom
(
rid
);
}
else
{
loadMissedMessages
(
rid
,
realmRoom
.
getLastSeen
())
.
continueWithTask
(
task1
->
{
...
...
@@ -511,9 +508,8 @@ public class MethodCallHelper {
HttpUrl
httpSiteUrl
=
HttpUrl
.
parse
(
siteUrl
);
if
(
httpSiteUrl
!=
null
)
{
String
host
=
httpSiteUrl
.
host
();
RocketChatCache
rocketChatCache
=
new
RocketChatCache
(
context
);
rocketChatCache
.
addSiteUrl
(
host
,
currentHostname
);
rocketChatCache
.
addSiteName
(
currentHostname
,
siteName
);
RocketChatCache
.
INSTANCE
.
addSiteUrl
(
host
,
currentHostname
);
RocketChatCache
.
INSTANCE
.
addSiteName
(
currentHostname
,
siteName
);
}
}
...
...
app/src/main/java/chat/rocket/android/api/rest/DefaultCookieProvider.java
View file @
65d5c3a7
...
...
@@ -8,11 +8,6 @@ import chat.rocket.persistence.realm.models.internal.RealmSession;
public
class
DefaultCookieProvider
implements
CookieProvider
{
private
RocketChatCache
rocketChatCache
;
public
DefaultCookieProvider
(
RocketChatCache
rocketChatCache
)
{
this
.
rocketChatCache
=
rocketChatCache
;
}
@Override
public
String
getHostname
()
{
...
...
@@ -44,6 +39,6 @@ public class DefaultCookieProvider implements CookieProvider {
}
private
String
getHostnameFromCache
()
{
return
rocketChatCache
.
getSelectedServerHostname
();
return
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
();
}
}
app/src/main/java/chat/rocket/android/fragment/add_server/InputHostnameFragment.java
View file @
65d5c3a7
...
...
@@ -32,7 +32,7 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
super
.
onCreate
(
savedInstanceState
);
Context
appContext
=
getContext
().
getApplicationContext
();
presenter
=
new
InputHostnamePresenter
(
new
RocketChatCache
(
appContext
),
ConnectivityManager
.
getInstance
(
appContext
));
presenter
=
new
InputHostnamePresenter
(
ConnectivityManager
.
getInstance
(
appContext
));
}
@Override
...
...
app/src/main/java/chat/rocket/android/fragment/add_server/InputHostnamePresenter.java
View file @
65d5c3a7
...
...
@@ -14,11 +14,9 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import
io.reactivex.disposables.Disposable
;
public
class
InputHostnamePresenter
extends
BasePresenter
<
InputHostnameContract
.
View
>
implements
InputHostnameContract
.
Presenter
{
private
final
RocketChatCache
rocketChatCache
;
private
final
ConnectivityManagerApi
connectivityManager
;
public
InputHostnamePresenter
(
RocketChatCache
rocketChatCache
,
ConnectivityManagerApi
connectivityManager
)
{
this
.
rocketChatCache
=
rocketChatCache
;
public
InputHostnamePresenter
(
ConnectivityManagerApi
connectivityManager
)
{
this
.
connectivityManager
=
connectivityManager
;
}
...
...
@@ -54,7 +52,7 @@ public class InputHostnamePresenter extends BasePresenter<InputHostnameContract.
}
private
void
onServerValid
(
String
hostname
,
boolean
usesSecureConnection
)
{
rocketChatCache
.
setSelectedServerHostname
(
hostname
);
RocketChatCache
.
INSTANCE
.
setSelectedServerHostname
(
hostname
);
String
server
=
hostname
.
replace
(
"/"
,
"."
);
connectivityManager
.
addOrUpdateServer
(
server
,
server
,
!
usesSecureConnection
);
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomPresenter.java
View file @
65d5c3a7
...
...
@@ -170,7 +170,7 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
@Override
public
void
loadMissedMessages
()
{
RocketChatApplication
appContext
=
RocketChatApplication
.
getInstance
();
JSONObject
openedRooms
=
new
RocketChatCache
(
appContext
)
.
getOpenedRooms
();
JSONObject
openedRooms
=
RocketChatCache
.
INSTANCE
.
getOpenedRooms
();
if
(
openedRooms
.
has
(
roomId
))
{
try
{
JSONObject
room
=
openedRooms
.
getJSONObject
(
roomId
);
...
...
@@ -369,8 +369,7 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
.
filter
(
Optional:
:
isPresent
)
.
map
(
Optional:
:
get
)
.
map
(
room
->
{
new
RocketChatCache
(
RocketChatApplication
.
getInstance
())
.
addOpenedRoom
(
room
.
getRoomId
(),
room
.
getLastSeen
());
RocketChatCache
.
INSTANCE
.
addOpenedRoom
(
room
.
getRoomId
(),
room
.
getLastSeen
());
return
room
;
})
.
flatMap
(
messageInteractor:
:
getAllFrom
)
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/dialog/MessageOptionsDialogFragment.java
View file @
65d5c3a7
...
...
@@ -91,9 +91,7 @@ public class MessageOptionsDialogFragment extends BottomSheetDialogFragment {
}
private
void
setUpDialog
(
final
BottomSheetDialog
bottomSheetDialog
,
String
messageId
)
{
RocketChatCache
cache
=
new
RocketChatCache
(
bottomSheetDialog
.
getContext
());
String
hostname
=
cache
.
getSelectedServerHostname
();
String
hostname
=
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
();
EditMessageInteractor
editMessageInteractor
=
getEditMessageInteractor
(
hostname
);
...
...
app/src/main/java/chat/rocket/android/fragment/server_config/LoginContract.java
View file @
65d5c3a7
...
...
@@ -18,10 +18,14 @@ public interface LoginContract {
void
showLoginServices
(
List
<
LoginServiceConfiguration
>
loginServiceList
);
void
showTwoStepAuth
();
void
goBack
();
}
interface
Presenter
extends
BaseContract
.
Presenter
<
View
>
{
void
login
(
String
username
,
String
password
);
void
goBack
();
}
}
app/src/main/java/chat/rocket/android/fragment/server_config/LoginFragment.kt
View file @
65d5c3a7
...
...
@@ -50,9 +50,9 @@ class LoginFragment : AbstractServerConfigFragment(), LoginContract.View {
txtPasswd
=
rootView
.
findViewById
(
R
.
id
.
editor_passwd
)
waitingView
=
rootView
.
findViewById
(
R
.
id
.
waiting
)
btnEmail
.
setOnClickListener
{
view
->
presenter
.
login
(
txtUsername
.
text
.
toString
(),
txtPasswd
.
text
.
toString
())
}
btnEmail
.
setOnClickListener
{
_
->
presenter
.
login
(
txtUsername
.
text
.
toString
(),
txtPasswd
.
text
.
toString
())
}
btnUserRegistration
.
setOnClickListener
{
view
->
btnUserRegistration
.
setOnClickListener
{
_
->
UserRegistrationDialogFragment
.
create
(
hostname
,
txtUsername
.
text
.
toString
(),
txtPasswd
.
text
.
toString
())
.
show
(
fragmentManager
!!
,
"UserRegistrationDialogFragment"
)
}
...
...
@@ -84,7 +84,7 @@ class LoginFragment : AbstractServerConfigFragment(), LoginContract.View {
for
(
info
in
OAuthProviderInfo
.
LIST
)
{
if
(
supportedMap
[
info
.
serviceName
]
==
false
&&
info
.
serviceName
==
authProvider
.
service
)
{
supportedMap
.
put
(
info
.
serviceName
,
true
)
viewMap
[
info
.
serviceName
]
?.
setOnClickListener
{
view
->
viewMap
[
info
.
serviceName
]
?.
setOnClickListener
{
_
->
var
fragment
:
Fragment
?
=
null
try
{
fragment
=
info
.
fragmentClass
.
newInstance
()
...
...
@@ -126,4 +126,8 @@ class LoginFragment : AbstractServerConfigFragment(), LoginContract.View {
presenter
.
release
()
super
.
onPause
()
}
override
fun
goBack
()
{
presenter
.
goBack
()
}
}
app/src/main/java/chat/rocket/android/fragment/server_config/LoginPresenter.kt
View file @
65d5c3a7
...
...
@@ -30,17 +30,14 @@ class LoginPresenter(private val loginServiceConfigurationRepository: LoginServi
getLoginServices
()
}
override
fun
release
()
{
override
fun
goBack
()
{
val
context
=
RocketChatApplication
.
getInstance
()
val
rocketChatCache
=
RocketChatCache
(
context
)
val
hostname
=
rocketChatCache
.
selectedServerHostname
val
hostname
=
RocketChatCache
.
getSelectedServerHostname
()
hostname
?.
let
{
ConnectivityManager
.
getInstance
(
context
).
removeServer
(
hostname
)
r
ocketChatCache
.
clearSelectedHostnameReferences
()
R
ocketChatCache
.
clearSelectedHostnameReferences
()
}
super
.
release
()
LaunchUtil
.
showMainActivity
(
context
)
}
...
...
app/src/main/java/chat/rocket/android/fragment/sidebar/SidebarMainFragment.java
View file @
65d5c3a7
...
...
@@ -94,13 +94,11 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
new
SessionInteractor
(
new
RealmSessionRepository
(
hostname
))
);
RocketChatCache
rocketChatCache
=
new
RocketChatCache
(
getContext
().
getApplicationContext
());
presenter
=
new
SidebarMainPresenter
(
hostname
,
new
RoomInteractor
(
new
RealmRoomRepository
(
hostname
)),
userRepository
,
rocketChatCache
,
absoluteUrlHelper
,
new
MethodCallHelper
(
getContext
(),
hostname
),
new
RealmSpotlightRepository
(
hostname
)
...
...
app/src/main/java/chat/rocket/android/fragment/sidebar/SidebarMainPresenter.java
View file @
65d5c3a7
...
...
@@ -38,7 +38,6 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View
private
final
String
hostname
;
private
final
RoomInteractor
roomInteractor
;
private
final
UserRepository
userRepository
;
private
final
RocketChatCache
rocketChatCache
;
private
final
AbsoluteUrlHelper
absoluteUrlHelper
;
private
final
MethodCallHelper
methodCallHelper
;
private
SpotlightRepository
realmSpotlightRepository
;
...
...
@@ -47,14 +46,12 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View
public
SidebarMainPresenter
(
String
hostname
,
RoomInteractor
roomInteractor
,
UserRepository
userRepository
,
RocketChatCache
rocketChatCache
,
AbsoluteUrlHelper
absoluteUrlHelper
,
MethodCallHelper
methodCallHelper
,
RealmSpotlightRepository
realmSpotlightRepository
)
{
this
.
hostname
=
hostname
;
this
.
roomInteractor
=
roomInteractor
;
this
.
userRepository
=
userRepository
;
this
.
rocketChatCache
=
rocketChatCache
;
this
.
absoluteUrlHelper
=
absoluteUrlHelper
;
this
.
methodCallHelper
=
methodCallHelper
;
this
.
realmSpotlightRepository
=
realmSpotlightRepository
;
...
...
@@ -87,7 +84,7 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View
@Override
public
void
onRoomSelected
(
RoomSidebar
roomSidebar
)
{
rocketChatCache
.
setSelectedRoomId
(
roomSidebar
.
getRoomId
());
RocketChatCache
.
INSTANCE
.
setSelectedRoomId
(
roomSidebar
.
getRoomId
());
}
@Override
...
...
@@ -103,7 +100,7 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View
methodCallHelper
.
createDirectMessage
(
username
)
.
continueWithTask
(
task
->
{
if
(
task
.
isCompleted
())
{
rocketChatCache
.
setSelectedRoomId
(
task
.
getResult
());
RocketChatCache
.
INSTANCE
.
setSelectedRoomId
(
task
.
getResult
());
}
return
null
;
});
...
...
@@ -111,7 +108,7 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View
methodCallHelper
.
joinRoom
(
spotlight
.
getId
())
.
continueWithTask
(
task
->
{
if
(
task
.
isCompleted
())
{
rocketChatCache
.
setSelectedRoomId
(
spotlight
.
getId
());
RocketChatCache
.
INSTANCE
.
setSelectedRoomId
(
spotlight
.
getId
());
}
return
null
;
});
...
...
@@ -157,12 +154,12 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View
}
clearSubscriptions
();
String
currentHostname
=
rocketChatCache
.
getSelectedServerHostname
();
String
currentHostname
=
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
();
RealmHelper
realmHelper
=
RealmStore
.
getOrCreate
(
currentHostname
);
return
realmHelper
.
executeTransaction
(
realm
->
{
rocketChatCache
.
removeHostname
(
currentHostname
);
rocketChatCache
.
removeSelectedRoomId
(
currentHostname
);
rocketChatCache
.
setSelectedServerHostname
(
rocketChatCache
.
getFirstLoggedHostnameIfAny
());
RocketChatCache
.
INSTANCE
.
removeHostname
(
currentHostname
);
RocketChatCache
.
INSTANCE
.
removeSelectedRoomId
(
currentHostname
);
RocketChatCache
.
INSTANCE
.
setSelectedServerHostname
(
RocketChatCache
.
INSTANCE
.
getFirstLoggedHostnameIfAny
());
realm
.
executeTransactionAsync
(
Realm:
:
deleteAll
);
view
.
onPreparedToLogOut
();
ConnectivityManager
.
getInstance
(
RocketChatApplication
.
getInstance
())
...
...
app/src/main/java/chat/rocket/android/layouthelper/chatroom/MessagePopup.java
View file @
65d5c3a7
...
...
@@ -48,9 +48,7 @@ public class MessagePopup {
}
private
void
showAvailableActionsOnly
(
Context
context
)
{
RocketChatCache
cache
=
new
RocketChatCache
(
context
.
getApplicationContext
());
String
hostname
=
cache
.
getSelectedServerHostname
();
String
hostname
=
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
();
EditMessageInteractor
editMessageInteractor
=
getEditMessageInteractor
(
hostname
);
...
...
@@ -167,7 +165,7 @@ public class MessagePopup {
}
public
MessagePopup
setDeleteAction
(
ActionListener
actionListener
)
{
DELETE_ACTION_INFO
.
actionListener
=
actionListener
;
DELETE_ACTION_INFO
.
actionListener
=
actionListener
;
return
singleton
;
}
...
...
app/src/main/java/chat/rocket/android/push/PushManager.kt
View file @
65d5c3a7
package
chat.rocket.android.push
import
android.annotation.SuppressLint
import
android.app.Notification
import
android.app.NotificationChannel
import
android.app.NotificationManager
...
...
@@ -137,6 +138,7 @@ object PushManager {
return
group
}
@SuppressLint
(
"NewApi"
)
internal
fun
showNotification
(
context
:
Context
,
lastPushMessage
:
PushMessage
)
{
if
(
lastPushMessage
.
host
==
null
||
lastPushMessage
.
message
==
null
||
lastPushMessage
.
title
==
null
)
{
return
...
...
@@ -202,7 +204,7 @@ object PushManager {
.
setDeleteIntent
(
deleteIntent
)
.
setMessageNotification
()
val
subText
=
RocketChatCache
(
context
)
.
getHostSiteName
(
host
)
val
subText
=
RocketChatCache
.
getHostSiteName
(
host
)
if
(
subText
.
isNotEmpty
())
{
builder
.
setSubText
(
subText
)
}
...
...
@@ -257,6 +259,7 @@ object PushManager {
}
}
@SuppressLint
(
"NewApi"
)
@RequiresApi
(
Build
.
VERSION_CODES
.
N
)
internal
fun
createGroupNotificationForNougatAndAbove
(
context
:
Context
,
lastPushMessage
:
PushMessage
):
Notification
?
{
with
(
lastPushMessage
)
{
...
...
@@ -289,7 +292,7 @@ object PushManager {
manager
.
createNotificationChannel
(
groupChannel
)
}
val
subText
=
RocketChatCache
(
context
)
.
getHostSiteName
(
host
)
val
subText
=
RocketChatCache
.
getHostSiteName
(
host
)
if
(
subText
.
isNotEmpty
())
{
builder
.
setSubText
(
subText
)
}
...
...
@@ -344,7 +347,7 @@ object PushManager {
.
setContentIntent
(
contentIntent
)
.
setMessageNotification
()
val
subText
=
RocketChatCache
(
context
)
.
getHostSiteName
(
host
)
val
subText
=
RocketChatCache
.
getHostSiteName
(
host
)
if
(
subText
.
isNotEmpty
())
{
builder
.
setSubText
(
subText
)
}
...
...
@@ -370,6 +373,7 @@ object PushManager {
}
}
@SuppressLint
(
"NewApi"
)
@RequiresApi
(
Build
.
VERSION_CODES
.
N
)
internal
fun
createSingleNotificationForNougatAndAbove
(
context
:
Context
,
lastPushMessage
:
PushMessage
):
Notification
?
{
val
manager
:
NotificationManager
=
...
...
@@ -404,7 +408,7 @@ object PushManager {
manager
.
createNotificationChannel
(
channel
)
}
val
subText
=
RocketChatCache
(
context
)
.
getHostSiteName
(
host
)
val
subText
=
RocketChatCache
.
getHostSiteName
(
host
)
if
(
subText
.
isNotEmpty
())
{
builder
.
setSubText
(
subText
)
}
...
...
@@ -647,7 +651,7 @@ object PushManager {
}
val
httpUrl
=
HttpUrl
.
parse
(
pushMessage
.
host
)
httpUrl
?.
let
{
val
siteUrl
=
RocketChatCache
(
context
)
.
getSiteUrlFor
(
httpUrl
.
host
())
val
siteUrl
=
RocketChatCache
.
getSiteUrlFor
(
httpUrl
.
host
())
if
(
siteUrl
!=
null
)
{
sendMessage
(
siteUrl
,
message
,
pushMessage
.
rid
)
}
...
...
app/src/main/java/chat/rocket/android/service/KeepAliveJob.kt
View file @
65d5c3a7
...
...
@@ -2,7 +2,6 @@ package chat.rocket.android.service
import
chat.rocket.android.ConnectionStatusManager
import
chat.rocket.android.RocketChatApplication
import
chat.rocket.android.RocketChatCache
import
com.evernote.android.job.Job
import
com.evernote.android.job.JobManager
import
com.evernote.android.job.JobRequest
...
...
@@ -11,7 +10,6 @@ import java.util.concurrent.TimeUnit
class
KeepAliveJob
:
Job
()
{
private
val
connectivityManager
:
ConnectivityManagerApi
private
val
rocketChatCache
:
RocketChatCache
companion
object
{
val
TAG
=
"chat.rocket.android.service.KeepAliveJob"
...
...
@@ -38,7 +36,6 @@ class KeepAliveJob : Job() {
init
{
val
context
=
RocketChatApplication
.
getInstance
()
connectivityManager
=
ConnectivityManager
.
getInstance
(
context
)
rocketChatCache
=
RocketChatCache
(
context
)
}
override
fun
onRunJob
(
params
:
Params
):
Result
{
...
...
app/src/main/java/chat/rocket/android/service/RealmBasedConnectivityManager.java
View file @
65d5c3a7
...
...
@@ -74,7 +74,7 @@ import io.reactivex.subjects.BehaviorSubject;
@DebugLog
@Override
public
void
ensureConnections
()
{
String
hostname
=
new
RocketChatCache
(
appContext
)
.
getSelectedServerHostname
();
String
hostname
=
RocketChatCache
.
INSTANCE
.
getSelectedServerHostname
();
if
(
hostname
==
null
)
{
return
;
}
...
...
app/src/main/java/chat/rocket/android/service/RocketChatService.java
View file @
65d5c3a7
...
...
@@ -106,7 +106,8 @@ public class RocketChatService extends Service implements ConnectivityServiceInt
}
if
(
currentWebSocketThread
!=
null
)
{
return
currentWebSocketThread
.
terminate
(
isDisconnected
)
if
(
isDisconnected
)
{
return
currentWebSocketThread
.
terminate
(
true
)
.
doAfterTerminate
(()
->
currentWebSocketThread
=
null
)
.
flatMap
(
terminated
->
RocketChatWebSocketThread
.
getStarted
(
getApplicationContext
(),
hostname
)
...
...
@@ -122,6 +123,8 @@ public class RocketChatService extends Service implements ConnectivityServiceInt
})
);
}
return
Single
.
just
(
currentWebSocketThread
);
}
return
RocketChatWebSocketThread
.
getStarted
(
getApplicationContext
(),
hostname
)
.
doOnSuccess
(
thread
->
{
...
...
app/src/main/java/chat/rocket/android/service/internal/AbstractRocketChatCacheObserver.java
View file @
65d5c3a7
...
...
@@ -13,13 +13,11 @@ import chat.rocket.persistence.realm.models.ddp.RealmRoom;
import
io.reactivex.disposables.CompositeDisposable
;
public
abstract
class
AbstractRocketChatCacheObserver
implements
Registrable
{
private
final
Context
context
;
private
final
RealmHelper
realmHelper
;
private
String
roomId
;
private
CompositeDisposable
compositeDisposable
=
new
CompositeDisposable
();
protected
AbstractRocketChatCacheObserver
(
Context
context
,
RealmHelper
realmHelper
)
{
this
.
context
=
context
;
protected
AbstractRocketChatCacheObserver
(
RealmHelper
realmHelper
)
{
this
.
realmHelper
=
realmHelper
;
}
...
...
@@ -47,7 +45,7 @@ public abstract class AbstractRocketChatCacheObserver implements Registrable {
@Override
public
final
void
register
()
{
compositeDisposable
.
add
(
new
RocketChatCache
(
context
)
RocketChatCache
.
INSTANCE
.
getSelectedRoomIdPublisher
()
.
filter
(
Optional:
:
isPresent
)
.
map
(
Optional:
:
get
)
...
...
app/src/main/java/chat/rocket/android/service/internal/StreamRoomMessageManager.java
View file @
65d5c3a7
...
...
@@ -18,7 +18,6 @@ public class StreamRoomMessageManager implements Registrable {
private
final
RealmHelper
realmHelper
;
private
final
AbstractRocketChatCacheObserver
cacheObserver
;
private
final
Handler
handler
;
private
final
RocketChatCache
rocketChatCache
;
private
StreamRoomMessage
streamRoomMessage
;
public
StreamRoomMessageManager
(
Context
context
,
String
hostname
,
...
...
@@ -26,9 +25,8 @@ public class StreamRoomMessageManager implements Registrable {
this
.
context
=
context
;
this
.
hostname
=
hostname
;
this
.
realmHelper
=
realmHelper
;
this
.
rocketChatCache
=
new
RocketChatCache
(
context
);
cacheObserver
=
new
AbstractRocketChatCacheObserver
(
context
,
realmHelper
)
{
cacheObserver
=
new
AbstractRocketChatCacheObserver
(
realmHelper
)
{
@Override
protected
void
onRoomIdUpdated
(
String
roomId
)
{
unregisterStreamNotifyMessageIfNeeded
();
...
...
@@ -57,7 +55,7 @@ public class StreamRoomMessageManager implements Registrable {
@Override
public
void
register
()
{
cacheObserver
.
register
();
String
selectedRoomId
=
rocketChatCache
.
getSelectedRoomId
();
String
selectedRoomId
=
RocketChatCache
.
INSTANCE
.
getSelectedRoomId
();
if
(
selectedRoomId
==
null
)
{
return
;
}
...
...
app/src/main/java/chat/rocket/android/service/observer/GcmPushRegistrationObserver.java
View file @
65d5c3a7
...
...
@@ -68,7 +68,7 @@ public class GcmPushRegistrationObserver extends AbstractModelObserver<GcmPushRe
final
RealmUser
currentUser
=
realmHelper
.
executeTransactionForRead
(
realm
->
RealmUser
.
queryCurrentUser
(
realm
).
findFirst
());
final
String
userId
=
currentUser
!=
null
?
currentUser
.
getId
()
:
null
;
final
String
pushId
=
new
RocketChatCache
(
context
)
.
getOrCreatePushId
();
final
String
pushId
=
RocketChatCache
.
INSTANCE
.
getOrCreatePushId
();
return
new
RaixPushHelper
(
realmHelper
)
.
pushUpdate
(
pushId
,
gcmToken
,
userId
);
...
...
app/src/main/java/chat/rocket/android/service/observer/SessionObserver.java
View file @
65d5c3a7
...
...
@@ -74,7 +74,7 @@ public class SessionObserver extends AbstractModelObserver<RealmSession> {
// update push info
pushHelper
.
pushSetUser
(
new
RocketChatCache
(
context
)
.
getOrCreatePushId
())
.
pushSetUser
(
RocketChatCache
.
INSTANCE
.
getOrCreatePushId
())
.
continueWith
(
new
LogIfError
());
ConnectivityManager
.
getInstance
(
context
).
notifySessionEstablished
(
hostname
);
...
...
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