diff --git a/app/src/main/java/com/nextcloud/talk/components/filebrowser/operations/DavListing.java b/app/src/main/java/com/nextcloud/talk/components/filebrowser/operations/DavListing.java index e5ea94e91..38399344c 100644 --- a/app/src/main/java/com/nextcloud/talk/components/filebrowser/operations/DavListing.java +++ b/app/src/main/java/com/nextcloud/talk/components/filebrowser/operations/DavListing.java @@ -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() { @Override public void onSubscribe(Disposable d) { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.java b/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.java index 300a56892..c4f07b0be 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.java @@ -176,7 +176,7 @@ public class AccountVerificationController extends BaseController { } ncApi.getServerStatus(queryUrl) - .subscribeOn(Schedulers.newThread()) + .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer() { @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() { @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() { @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() { @Override public void onSubscribe(Disposable d) { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallController.java index cae0ff978..b668ca32f 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallController.java @@ -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() { @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() { @@ -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() { @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() { @@ -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() { @@ -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() { @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() { @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() { @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() { @Override public void onSubscribe(Disposable d) { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java index 449ae22a5..3ccbab63b 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java @@ -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() { @@ -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() { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java index 08dc54daa..f76f79207 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java @@ -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() { @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() { @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() { @@ -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() { @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() { @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() { @Override diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java index 065220430..3ad3f31f3 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java @@ -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() { @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() { @@ -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() { @Override diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java index 5712820bd..bd5f8d77f 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java @@ -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() { @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() { @Override diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java b/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java index 9292e9f04..1511d6b4d 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java @@ -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 -> { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ServerSelectionController.java b/app/src/main/java/com/nextcloud/talk/controllers/ServerSelectionController.java index 6f1833dad..ec0aa3c54 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ServerSelectionController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ServerSelectionController.java @@ -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); diff --git a/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java b/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java index 47568ac83..6a3491b3e 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java @@ -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()); diff --git a/app/src/main/java/com/nextcloud/talk/controllers/WebViewLoginController.java b/app/src/main/java/com/nextcloud/talk/controllers/WebViewLoginController.java index 9e9984fa5..89b0fc747 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/WebViewLoginController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/WebViewLoginController.java @@ -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) { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java index 92f8ae306..7468ac9bf 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java @@ -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() { @@ -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() { @@ -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() { @@ -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() { @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() { @@ -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() { diff --git a/app/src/main/java/com/nextcloud/talk/jobs/DeleteConversationWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/DeleteConversationWorker.java index f69c3e6d8..e77f90e4e 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/DeleteConversationWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/DeleteConversationWorker.java @@ -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() { Disposable disposable; diff --git a/app/src/main/java/com/nextcloud/talk/jobs/LeaveConversationWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/LeaveConversationWorker.java index 4cf4716ef..849314dce 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/LeaveConversationWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/LeaveConversationWorker.java @@ -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() { Disposable disposable; diff --git a/app/src/main/java/com/nextcloud/talk/jobs/ShareOperationWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/ShareOperationWorker.java index b128cfdbe..0a4d4373f 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/ShareOperationWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/ShareOperationWorker.java @@ -76,7 +76,7 @@ public class ShareOperationWorker extends Worker { filesArray.get(i), roomToken, "10") - .subscribeOn(Schedulers.newThread()) + .subscribeOn(Schedulers.io()) .blockingSubscribe(new Observer() { @Override public void onSubscribe(Disposable d) { diff --git a/app/src/main/java/com/nextcloud/talk/presenters/MentionAutocompletePresenter.java b/app/src/main/java/com/nextcloud/talk/presenters/MentionAutocompletePresenter.java index 2f7445d15..ebfb6f922 100644 --- a/app/src/main/java/com/nextcloud/talk/presenters/MentionAutocompletePresenter.java +++ b/app/src/main/java/com/nextcloud/talk/presenters/MentionAutocompletePresenter.java @@ -95,7 +95,7 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter 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() { diff --git a/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java b/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java index 11c5e919e..71f2619c6 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java @@ -271,7 +271,7 @@ public class PushUtils { ncApi.registerDeviceForNotificationsWithProxy(finalCredentials, ApiUtils.getUrlPushProxy(), proxyMap) - .subscribeOn(Schedulers.newThread()) + .subscribeOn(Schedulers.io()) .subscribe(new Observer() { @Override public void onSubscribe(Disposable d) { diff --git a/app/src/main/java/com/nextcloud/talk/utils/database/arbitrarystorage/ArbitraryStorageUtils.java b/app/src/main/java/com/nextcloud/talk/utils/database/arbitrarystorage/ArbitraryStorageUtils.java index afb33a331..d9db2d559 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/database/arbitrarystorage/ArbitraryStorageUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/database/arbitrarystorage/ArbitraryStorageUtils.java @@ -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 deleteResult = dataStore.delete(ArbitraryStorage.class).where(ArbitraryStorageEntity.ACCOUNT_IDENTIFIER.eq(accountIdentifier)).get(); return deleteResult.single().toObservable() - .subscribeOn(Schedulers.newThread()); + .subscribeOn(Schedulers.io()); } } diff --git a/app/src/main/java/com/nextcloud/talk/utils/database/user/UserUtils.java b/app/src/main/java/com/nextcloud/talk/utils/database/user/UserUtils.java index 9e08993be..bf6b174ad 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/database/user/UserUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/database/user/UserUtils.java @@ -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()); } } diff --git a/app/src/main/java/com/nextcloud/talk/utils/preferencestorage/DatabaseStorageModule.java b/app/src/main/java/com/nextcloud/talk/utils/preferencestorage/DatabaseStorageModule.java index 639efd45d..2b926138f 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/preferencestorage/DatabaseStorageModule.java +++ b/app/src/main/java/com/nextcloud/talk/utils/preferencestorage/DatabaseStorageModule.java @@ -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() { @Override public void onSubscribe(Disposable d) {