Fix subscription thread

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2019-04-29 09:18:36 +02:00 committed by Mario Đanić
parent e2fe9a61af
commit 550b46c454
20 changed files with 63 additions and 63 deletions

View file

@ -47,7 +47,7 @@ public class DavListing extends ListingAbstractClass {
public ReadFilesystemOperation call() {
return new ReadFilesystemOperation(okHttpClient, currentUser, path, 1);
}
}).subscribeOn(Schedulers.newThread())
}).subscribeOn(Schedulers.io())
.subscribe(new SingleObserver<ReadFilesystemOperation>() {
@Override
public void onSubscribe(Disposable d) {

View file

@ -176,7 +176,7 @@ public class AccountVerificationController extends BaseController {
}
ncApi.getServerStatus(queryUrl)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Status>() {
@Override
@ -220,7 +220,7 @@ public class AccountVerificationController extends BaseController {
private void findServerTalkApp(String credentials) {
ncApi.getRooms(credentials, ApiUtils.getUrlForGetRooms(baseUrl))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.subscribe(new Observer<RoomsOverall>() {
@Override
public void onSubscribe(Disposable d) {
@ -257,7 +257,7 @@ public class AccountVerificationController extends BaseController {
baseUrl, displayName, null, true,
userId, null, null,
appPreferences.getTemporaryClientCertAlias(), null)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.subscribe(new Observer<UserEntity>() {
@Override
public void onSubscribe(Disposable d) {
@ -297,7 +297,7 @@ public class AccountVerificationController extends BaseController {
private void fetchProfile(String credentials) {
ncApi.getUserProfile(credentials,
ApiUtils.getUrlForUserProfile(baseUrl))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.subscribe(new Observer<UserProfileOverall>() {
@Override
public void onSubscribe(Disposable d) {

View file

@ -340,7 +340,7 @@ public class CallController extends BaseController {
private void handleFromNotification() {
ncApi.getRooms(credentials, ApiUtils.getUrlForGetRooms(baseUrl))
.retry(3)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<RoomsOverall>() {
@Override
@ -863,7 +863,7 @@ public class CallController extends BaseController {
leavingCall = false;
ncApi.getSignalingSettings(credentials, ApiUtils.getUrlForSignalingSettings(baseUrl))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.retry(3)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<SignalingSettingsOverall>() {
@ -894,7 +894,7 @@ public class CallController extends BaseController {
try {
userUtils.createOrUpdateUser(null, null, null, null, null, null, null,
conversationUser.getId(), null, null, LoganSquare.serialize(externalSignalingServer))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.subscribe();
} catch (IOException exception) {
Log.e(TAG, "Failed to serialize external signaling server");
@ -949,7 +949,7 @@ public class CallController extends BaseController {
private void checkCapabilities() {
ncApi.getCapabilities(credentials, ApiUtils.getUrlForCapabilities(baseUrl))
.retry(3)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<CapabilitiesOverall>() {
@Override
@ -999,7 +999,7 @@ public class CallController extends BaseController {
private void joinRoomAndCall() {
ncApi.joinRoom(credentials, ApiUtils.getUrlForSettingMyselfAsActiveParticipant(baseUrl,
roomToken), conversationPassword)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(3)
.subscribe(new Observer<CallOverall>() {
@ -1041,7 +1041,7 @@ public class CallController extends BaseController {
private void performCall() {
ncApi.joinCall(credentials,
ApiUtils.getUrlForCall(baseUrl, roomToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.retry(3)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<GenericOverall>() {
@ -1070,7 +1070,7 @@ public class CallController extends BaseController {
if (needsPing) {
ncApi.pingCall(credentials, ApiUtils.getUrlForCallPing(baseUrl, roomToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.repeatWhen(observable -> observable.delay(5000, TimeUnit.MILLISECONDS))
.takeWhile(observable -> inCall)
@ -1108,7 +1108,7 @@ public class CallController extends BaseController {
if (!hasExternalSignalingServer) {
ncApi.pullSignalingMessages(credentials, ApiUtils.getUrlForSignaling(baseUrl, urlToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.repeatWhen(observable -> observable)
.takeWhile(observable -> inCall)
@ -1358,7 +1358,7 @@ public class CallController extends BaseController {
private void hangupNetworkCalls() {
ncApi.leaveCall(credentials, ApiUtils.getUrlForCall(baseUrl, roomToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<GenericOverall>() {
@Override
@ -1395,7 +1395,7 @@ public class CallController extends BaseController {
private void leaveRoom() {
ncApi.leaveRoom(credentials, ApiUtils.getUrlForSettingMyselfAsActiveParticipant(baseUrl, roomToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<GenericOverall>() {
@Override
@ -1483,7 +1483,7 @@ public class CallController extends BaseController {
private void getPeersForCall() {
ncApi.getPeersForCall(credentials, ApiUtils.getUrlForCall(baseUrl, roomToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.subscribe(new Observer<ParticipantsOverall>() {
@Override
public void onSubscribe(Disposable d) {
@ -1675,7 +1675,7 @@ public class CallController extends BaseController {
Observable
.interval(1, TimeUnit.SECONDS)
.takeWhile(observer -> inCall)
.observeOn(Schedulers.newThread())
.observeOn(Schedulers.io())
.doOnNext(n -> magicPeerConnectionWrapperList.get(finalI).sendChannelData(dataChannelMessage));
break;
}
@ -1743,7 +1743,7 @@ public class CallController extends BaseController {
ncApi.sendSignalingMessages(credentials, ApiUtils.getUrlForSignaling(baseUrl, urlToken),
strings.toString())
.retry(3)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.subscribe(new Observer<SignalingOverall>() {
@Override
public void onSubscribe(Disposable d) {

View file

@ -197,7 +197,7 @@ public class CallNotificationController extends BaseController {
private void checkIfAnyParticipantsRemainInRoom() {
ncApi.getPeersForCall(credentials, ApiUtils.getUrlForParticipants(userBeingCalled.getBaseUrl(),
currentConversation.getToken()))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.takeWhile(observable -> !leavingScreen)
.retry(3)
.subscribe(new Observer<ParticipantsOverall>() {
@ -246,7 +246,7 @@ public class CallNotificationController extends BaseController {
private void handleFromNotification() {
ncApi.getRooms(credentials, ApiUtils.getUrlForGetRooms(userBeingCalled.getBaseUrl()))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.retry(3)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<RoomsOverall>() {

View file

@ -213,7 +213,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
private void getRoomInfo() {
ncApi.getRoom(credentials, ApiUtils.getRoom(conversationUser.getBaseUrl(), roomToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<RoomOverall>() {
@Override
@ -246,7 +246,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
private void handleFromNotification() {
ncApi.getRooms(credentials, ApiUtils.getUrlForGetRooms(conversationUser.getBaseUrl()))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<RoomsOverall>() {
@Override
@ -621,7 +621,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
private void startPing() {
if (!conversationUser.hasSpreedCapabilityWithName("no-ping")) {
ncApi.pingCall(credentials, ApiUtils.getUrlForCallPing(conversationUser.getBaseUrl(), roomToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.repeatWhen(observable -> observable.delay(5000, TimeUnit.MILLISECONDS))
.takeWhile(observable -> inChat)
@ -666,7 +666,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
if (currentCall == null) {
ncApi.joinRoom(credentials,
ApiUtils.getUrlForSettingMyselfAsActiveParticipant(conversationUser.getBaseUrl(), roomToken), roomPassword)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(3)
.subscribe(new Observer<CallOverall>() {
@ -719,7 +719,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
ncApi.leaveRoom(credentials,
ApiUtils.getUrlForSettingMyselfAsActiveParticipant(conversationUser.getBaseUrl(),
roomToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<GenericOverall>() {
@Override
@ -777,7 +777,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
ncApi.sendChatMessage(credentials, ApiUtils.getUrlForChat(conversationUser.getBaseUrl(), roomToken),
message, conversationUser
.getDisplayName())
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<GenericOverall>() {
@Override
@ -850,7 +850,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
ncApi.pullChatMessages(credentials, ApiUtils.getUrlForChat(conversationUser.getBaseUrl(),
roomToken),
fieldMap)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.takeWhile(observable -> inChat && !wasDetached)
.retry(3, observable -> inChat && !wasDetached)
@ -879,7 +879,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
} else {
ncApi.pullChatMessages(credentials,
ApiUtils.getUrlForChat(conversationUser.getBaseUrl(), roomToken), fieldMap)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(3, observable -> inChat && !wasDetached)
.takeWhile(observable -> inChat && !wasDetached)
@ -1201,7 +1201,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
ncApi.createRoom(credentials,
retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<RoomOverall>() {
@Override

View file

@ -253,7 +253,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
((UserItem) selectedObject).getModel().getUserId(), null);
ncApi.createRoom(credentials,
retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<RoomOverall>() {
@Override
@ -447,7 +447,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
ncApi.getContactsWithSearchParam(
credentials,
retrofitBucket.getUrl(), shareTypesList, modifiedQueryMap)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(3)
.subscribe(new Observer<ResponseBody>() {
@ -865,7 +865,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
ncApi.createRoom(credentials,
retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<RoomOverall>() {
@Override

View file

@ -280,7 +280,7 @@ public class ConversationInfoController extends BaseController {
private void getListOfParticipants() {
ncApi.getPeersForCall(credentials, ApiUtils.getUrlForParticipants(conversationUser.getBaseUrl(), conversationToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<ParticipantsOverall>() {
@Override
@ -351,7 +351,7 @@ public class ConversationInfoController extends BaseController {
private void fetchRoomInfo() {
ncApi.getRoom(credentials, ApiUtils.getRoom(conversationUser.getBaseUrl(), conversationToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<RoomOverall>() {
@Override

View file

@ -314,7 +314,7 @@ public class ConversationsListController extends BaseController implements Searc
callItems = new ArrayList<>();
roomsQueryDisposable = ncApi.getRooms(credentials, ApiUtils.getUrlForGetRooms(currentUser.getBaseUrl()))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(roomsOverall -> {

View file

@ -246,7 +246,7 @@ public class ServerSelectionController extends BaseController {
private void checkServer(String queryUrl, boolean checkForcedHttps) {
statusQueryDisposable = ncApi.getServerStatus(queryUrl)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(status -> {
String productName = getResources().getString(R.string.nc_server_product_name);

View file

@ -494,7 +494,7 @@ public class SettingsController extends BaseController {
profileQueryDisposable = ncApi.getUserProfile(credentials,
ApiUtils.getUrlForUserProfile(currentUser.getBaseUrl()))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(userProfileOverall -> {
@ -516,7 +516,7 @@ public class SettingsController extends BaseController {
null,
null, displayName, null, null,
null, currentUser.getId(), null, null, null)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(userEntityResult -> {
displayNameTextView.setText(userEntityResult.getDisplayName());

View file

@ -368,7 +368,7 @@ public class WebViewLoginController extends BaseController {
userQueryDisposable = userUtils.createOrUpdateUser(null, loginData.getToken(),
null, null, "", true,
null, currentUser.getId(), null, appPreferences.getTemporaryClientCertAlias(), null)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(userEntity -> {
if (finalMessageType != null) {

View file

@ -191,7 +191,7 @@ public class OperationsMenuController extends BaseController {
case 2:
ncApi.renameRoom(credentials, ApiUtils.getRoom(currentUser.getBaseUrl(), conversation.getToken()),
conversation.getName())
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(operationsObserver);
@ -199,7 +199,7 @@ public class OperationsMenuController extends BaseController {
case 3:
ncApi.makeRoomPublic(credentials, ApiUtils.getUrlForRoomVisibility(currentUser.getBaseUrl(), conversation
.getToken()))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(operationsObserver);
@ -213,7 +213,7 @@ public class OperationsMenuController extends BaseController {
}
ncApi.setPassword(credentials, ApiUtils.getUrlForPassword(currentUser.getBaseUrl(),
conversation.getToken()), pass)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(operationsObserver);
@ -224,14 +224,14 @@ public class OperationsMenuController extends BaseController {
case 8:
ncApi.makeRoomPrivate(credentials, ApiUtils.getUrlForRoomVisibility(currentUser.getBaseUrl(), conversation
.getToken()))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(operationsObserver);
break;
case 10:
ncApi.getRoom(credentials, ApiUtils.getRoom(baseUrl, conversationToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(new Observer<RoomOverall>() {
@ -284,7 +284,7 @@ public class OperationsMenuController extends BaseController {
final boolean isGroupCallWorkaroundFinal = isGroupCallWorkaround;
ncApi.createRoom(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(new Observer<RoomOverall>() {
@ -321,14 +321,14 @@ public class OperationsMenuController extends BaseController {
if (operationCode == 97) {
ncApi.removeConversationFromFavorites(credentials, ApiUtils.getUrlForConversationFavorites(currentUser.getBaseUrl(),
conversation.getToken()))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(operationsObserver);
} else {
ncApi.addConversationToFavorites(credentials, ApiUtils.getUrlForConversationFavorites(currentUser.getBaseUrl(),
conversation.getToken()))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(operationsObserver);
@ -337,7 +337,7 @@ public class OperationsMenuController extends BaseController {
case 99:
ncApi.joinRoom(credentials, ApiUtils.getUrlForSettingMyselfAsActiveParticipant(baseUrl, conversationToken),
callPassword)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(operationsObserver);
@ -350,7 +350,7 @@ public class OperationsMenuController extends BaseController {
private void performGroupCallWorkaround(String credentials) {
ncApi.makeRoomPrivate(credentials, ApiUtils.getUrlForRoomVisibility(currentUser.getBaseUrl(), conversation.getToken()))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(new Observer<GenericOverall>() {
@ -438,7 +438,7 @@ public class OperationsMenuController extends BaseController {
private void fetchCapabilities(String credentials) {
ncApi.getCapabilities(credentials, ApiUtils.getUrlForCapabilities(baseUrl))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<CapabilitiesOverall>() {
@Override
@ -512,7 +512,7 @@ public class OperationsMenuController extends BaseController {
groupId);
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(new Observer<AddParticipantOverall>() {
@ -552,7 +552,7 @@ public class OperationsMenuController extends BaseController {
userId);
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
.subscribe(new Observer<AddParticipantOverall>() {

View file

@ -83,7 +83,7 @@ public class DeleteConversationWorker extends Worker {
EventStatus.EventType.CONVERSATION_UPDATE, true);
ncApi.deleteRoom(credentials, ApiUtils.getRoom(operationUser.getBaseUrl(), conversationToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.blockingSubscribe(new Observer<GenericOverall>() {
Disposable disposable;

View file

@ -83,7 +83,7 @@ public class LeaveConversationWorker extends Worker {
EventStatus.EventType.CONVERSATION_UPDATE, true);
ncApi.removeSelfFromRoom(credentials, ApiUtils.getUrlForRemoveSelfFromRoom(operationUser.getBaseUrl(), conversationToken))
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.blockingSubscribe(new Observer<GenericOverall>() {
Disposable disposable;

View file

@ -76,7 +76,7 @@ public class ShareOperationWorker extends Worker {
filesArray.get(i),
roomToken,
"10")
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.blockingSubscribe(new Observer<Void>() {
@Override
public void onSubscribe(Disposable d) {

View file

@ -95,7 +95,7 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
ncApi.getMentionAutocompleteSuggestions(ApiUtils.getCredentials(currentUser.getUsername(), currentUser
.getToken()), ApiUtils.getUrlForMentionSuggestions(currentUser.getBaseUrl(), roomToken),
queryString, 5)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(3)
.subscribe(new Observer<MentionOverall>() {

View file

@ -271,7 +271,7 @@ public class PushUtils {
ncApi.registerDeviceForNotificationsWithProxy(finalCredentials,
ApiUtils.getUrlPushProxy(), proxyMap)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.subscribe(new Observer<Void>() {
@Override
public void onSubscribe(Disposable d) {

View file

@ -46,7 +46,7 @@ public class ArbitraryStorageUtils {
dataStore.upsert(arbitraryStorageEntity)
.toObservable()
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.subscribe();
}
@ -63,6 +63,6 @@ public class ArbitraryStorageUtils {
ReactiveScalar<Integer> deleteResult = dataStore.delete(ArbitraryStorage.class).where(ArbitraryStorageEntity.ACCOUNT_IDENTIFIER.eq(accountIdentifier)).get();
return deleteResult.single().toObservable()
.subscribeOn(Schedulers.newThread());
.subscribeOn(Schedulers.io());
}
}

View file

@ -90,7 +90,7 @@ public class UserUtils {
UserEntity user = (UserEntity) findUserQueryResult.firstOrNull();
return dataStore.delete(user)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
@ -101,7 +101,7 @@ public class UserUtils {
UserEntity user = (UserEntity) findUserQueryResult.firstOrNull();
return dataStore.delete(user)
.subscribeOn(Schedulers.newThread());
.subscribeOn(Schedulers.io());
}
@ -264,7 +264,7 @@ public class UserUtils {
return dataStore.upsert(user)
.toObservable()
.subscribeOn(Schedulers.newThread());
.subscribeOn(Schedulers.io());
}
}

View file

@ -89,7 +89,7 @@ public class DatabaseStorageModule implements StorageModule {
ncApi.setNotificationLevel(ApiUtils.getCredentials(conversationUser.getUsername(), conversationUser.getToken()),
ApiUtils.getUrlForSettingNotificationlevel(conversationUser.getBaseUrl(), conversationToken),
intValue)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.subscribe(new Observer<GenericOverall>() {
@Override
public void onSubscribe(Disposable d) {